0.0.17 • Published 28 days ago

@jmgayosso/ual-metakeep v0.0.17

Weekly downloads
-
License
ISC
Repository
-
Last release
28 days ago

Hashed Polkadot API

This client api is used to interacting with gatedMarketplace pallet, this allows quick connection, queries and calls to TX on this pallet.

To install the hashed polkadot api, run the following command:

npm i --save @jmgayosso/hashed-polkadot-api or yarn add --save @jmgayosso/hashed-polkadot-api

To connect to 'hashed chain' we can use an instance of PolkadotApi that handles the connection and provides methods to sign tx, requestUsers from polkadotJS and sign and verify messages.

import { PolkadotApi } from '@jmgayosso/hashed-polkadot-api'

const polkadotApi = new PolkadotApi({
  chainURI: 'wss://n1.hashed.systems',
  appName: 'Hashed portal'
})
await polkadotApi.connect()

PolkadotApi is requeried to create an instance of MarketplaceApi, this class provides all methods to interact with gatedMarketplace pallet.

import { PolkadotApi, MarketplaceApi } from '@jmgayosso/hashed-polkadot-api'

const polkadotApi = new PolkadotApi('wss://n1.hashed.systems')
await polkadotApi.connect()

const marketplaceApi = new MarketplaceApi(polkadotApi)

Once an instance of MarketplaceApi is created, the following methods can be accessed.

MarketplaceApi

await marketplaceApi.getMarketplaceById({
  marketId: '0xa54035afb49b42cdacbe27c830dd1b66078069886e80cdd8bab3d139caa0489e'
})
await marketplaceApi.getAuthoritiesByMarketplace({
  marketId: '0xa54035afb49b42cdacbe27c830dd1b66078069886e80cdd8bab3d139caa0489e'
})
await marketplaceApi.getAllMarketplaces({
  startKey,
  pageSize
})
await marketplaceApi.getMyMarketplaces({
   accountId
})
await marketplaceApi.getParticipantsByMarket({
  marketId: '0xa54035afb49b42cdacbe27c830dd1b66078069886e80cdd8bab3d139caa0489e'
})
  • applyFor: This function calls to 'apply' extrinsic
await marketplaceApi.applyFor({
  marketId,
  user,
  fields,
  custodianFields
})
await marketplaceApi.reapplyFor({
    marketId,
    user,
    fields,
    custodianFields
})
await marketplaceApi.createMarketplace({
  admin,
  user,
  label
})
await marketplaceApi.enrollApplicant({
  marketId,
  user,
  accountOrApplication,
  approved,
  feedback
})
await marketplaceApi.getApplicationStatusByAccount({
  marketId,
  account
})
await marketplaceApi.getMarketplacesByAuthority({
  accountId,
  marketplaceId
})
0.0.17

28 days ago

0.0.16

1 month ago

0.0.12

1 month ago

0.0.13

1 month ago

0.0.14

1 month ago

0.0.15

1 month ago

0.0.11

2 months ago

0.0.10

3 months ago

0.0.9

3 months ago

0.0.8

4 months ago

0.0.5

4 months ago

0.0.7

4 months ago

0.0.6

4 months ago

0.0.3

4 months ago

0.0.2

4 months ago