Polymesh
Main entry point of the Polymesh SDK
Hierarchy
Polymesh
Index
Properties
Accessors
Methods
Properties
claims
• claims: Claims
Defined in src/Polymesh.ts:74
middleware
• middleware: Middleware
Defined in src/Polymesh.ts:75
registerIdentity
• registerIdentity: ProcedureMethod‹RegisterIdentityParams, Identity›
Defined in src/Polymesh.ts:639
Register an Identity
note
must be a CDD provider
note
this may create Authorization Requests which have to be accepted by the corresponding Accounts and/or Identities. An Account or Identity can fetch its pending Authorization Requests by calling authorizations.getReceived
note
required role:
Customer Due Diligence Provider
reserveTicker
• reserveTicker: ProcedureMethod‹ReserveTickerParams, TickerReservation›
Defined in src/Polymesh.ts:330
Reserve a ticker symbol to later use in the creation of a Security Token. The ticker will expire after a set amount of time, after which other users can reserve it
param
ticker symbol to reserve
note
required role:
Ticker Owner
transferPolyX
• transferPolyX: ProcedureMethod‹TransferPolyXParams, void›
Defined in src/Polymesh.ts:269
Transfer an amount of POLYX to a specified Account
param
account that will receive the POLYX
param
amount of POLYX to be transferred
param
identifier string to help differentiate transfers
Accessors
_polkadotApi
• get _polkadotApi(): ApiPromise
Defined in src/Polymesh.ts:664
Polkadot client
Returns: ApiPromise
Methods
disconnect
▸ disconnect(): Promise‹void›
Defined in src/Polymesh.ts:655
Disconnect the client and close all open connections and subscriptions
note
the SDK will become unusable after this operation. It will throw an error when attempting to access any chain or middleware data. If you wish to continue using the SDK, you must create a new instance by calling connect
Returns: Promise‹void›
getAccount
▸ getAccount(): CurrentAccount
Defined in src/Polymesh.ts:443
Create an Account instance from an address. If no address is passed, the current Account is returned
Returns: CurrentAccount
▸ getAccount(args
: object): Account
Defined in src/Polymesh.ts:444
Parameters:
▪ args: object
Name | Type |
| string |
Returns: Account
getAccountBalance
▸ getAccountBalance(args?
: undefined | object): Promise‹AccountBalance›
Defined in src/Polymesh.ts:278
Get the free/locked POLYX balance of an Account
note
can be subscribed to
Parameters:
Name | Type |
| undefined | object |
Returns: Promise‹AccountBalance›
▸ getAccountBalance(callback
: SubCallback‹AccountBalance›): Promise‹UnsubCallback›
Defined in src/Polymesh.ts:279
Parameters:
Name | Type |
|
Returns: Promise‹UnsubCallback›
▸ getAccountBalance(args
: object, callback
: SubCallback‹AccountBalance›): Promise‹UnsubCallback›
Defined in src/Polymesh.ts:280
Parameters:
▪ args: object
Name | Type |
| string | Account |
▪ callback: SubCallback‹AccountBalance›
Returns: Promise‹UnsubCallback›
getCurrentIdentity
▸ getCurrentIdentity(): Promise‹CurrentIdentity | null›
Defined in src/Polymesh.ts:436
Retrieve the Identity associated to the current Account (null if there is none)
Returns: Promise‹CurrentIdentity | null›
getIdentity
▸ getIdentity(args
: object): Identity
Defined in src/Polymesh.ts:429
Create an Identity instance from a DID
Parameters:
▪ args: object
Name | Type |
| string |
Returns: Identity
getLatestBlock
▸ getLatestBlock(): Promise‹BigNumber›
Defined in src/Polymesh.ts:644
Retrieve the number of the latest block in the chain
Returns: Promise‹BigNumber›
getNetworkProperties
▸ getNetworkProperties(): Promise‹NetworkProperties›
Defined in src/Polymesh.ts:585
Retrieve information for the current network
Returns: Promise‹NetworkProperties›
getSecurityToken
▸ getSecurityToken(args
: object): Promise‹SecurityToken›
Defined in src/Polymesh.ts:559
Retrieve a Security Token
Parameters:
▪ args: object
Name | Type | Description |
| string | Security Token ticker |
Returns: Promise‹SecurityToken›
getSecurityTokens
▸ getSecurityTokens(args?
: undefined | object): Promise‹SecurityToken[]›
Defined in src/Polymesh.ts:527
Retrieve all the Security Tokens owned by an Identity
note
tokens with unreadable characters in their tickers will be left out
Parameters:
Name | Type |
| undefined | object |
Returns: Promise‹SecurityToken[]›
getTickerReservation
▸ getTickerReservation(args
: object): Promise‹TickerReservation›
Defined in src/Polymesh.ts:403
Retrieve a Ticker Reservation
Parameters:
▪ args: object
Name | Type | Description |
| string | Security Token ticker |
Returns: Promise‹TickerReservation›
getTickerReservations
▸ getTickerReservations(args?
: undefined | object): Promise‹TickerReservation[]›
Defined in src/Polymesh.ts:369
Retrieve all the ticker reservations currently owned by an Identity. This doesn't include tokens that have already been launched
note
reservations with unreadable characters in their tickers will be left out
Parameters:
Name | Type |
| undefined | object |
Returns: Promise‹TickerReservation[]›
getTransactionFees
▸ getTransactionFees(args
: object): Promise‹BigNumber›
Defined in src/Polymesh.ts:471
Retrieve the protocol fees associated with running a specific transaction
Parameters:
▪ args: object
Name | Type | Description |
| TxTag | transaction tag (i.e. TxTags.asset.CreateAsset or "asset.createAsset") |
Returns: Promise‹BigNumber›
getTreasuryAccount
▸ getTreasuryAccount(): Account
Defined in src/Polymesh.ts:478
Get the treasury wallet address
Returns: Account
getTreasuryBalance
▸ getTreasuryBalance(): Promise‹BigNumber›
Defined in src/Polymesh.ts:609
Get the Treasury POLYX balance
note
can be subscribed to
Returns: Promise‹BigNumber›
▸ getTreasuryBalance(callback
: SubCallback‹BigNumber›): Promise‹UnsubCallback›
Defined in src/Polymesh.ts:610
Parameters:
Name | Type |
| SubCallback‹BigNumber› |
Returns: Promise‹UnsubCallback›
isIdentityValid
▸ isIdentityValid(args
: object): Promise‹boolean›
Defined in src/Polymesh.ts:460
Return whether the supplied Identity/DID exists
Parameters:
▪ args: object
Name | Type |
| Identity | string |
Returns: Promise‹boolean›
isTickerAvailable
▸ isTickerAvailable(args
: object): Promise‹boolean›
Defined in src/Polymesh.ts:337
Check if a ticker hasn't been reserved
note
can be subscribed to
Parameters:
▪ args: object
Name | Type |
| string |
Returns: Promise‹boolean›
▸ isTickerAvailable(args
: object, callback
: SubCallback‹boolean›): Promise‹UnsubCallback›
Defined in src/Polymesh.ts:338
Parameters:
▪ args: object
Name | Type |
| string |
▪ callback: SubCallback‹boolean›
Returns: Promise‹UnsubCallback›
onConnectionError
▸ onConnectionError(callback
: function): function
Defined in src/Polymesh.ts:491
Handle connection errors
Parameters:
▪ callback: function
▸ (...args
: unknown[]): unknown
Parameters:
Name | Type |
| unknown[] |
Returns: function
an unsubscribe callback
▸ (): void
onDisconnect
▸ onDisconnect(callback
: function): function
Defined in src/Polymesh.ts:508
Handle disconnection
Parameters:
▪ callback: function
▸ (...args
: unknown[]): unknown
Parameters:
Name | Type |
| unknown[] |
Returns: function
an unsubscribe callback
▸ (): void
Static
connect
Static
connect▸ connect(params
: ConnectParamsBase & object): Promise‹Polymesh›
Defined in src/Polymesh.ts:114
Create the instance and connect to the Polymesh node using an account seed
Parameters:
Name | Type |
| ConnectParamsBase & object |
Returns: Promise‹Polymesh›
▸ connect(params
: ConnectParamsBase & object): Promise‹Polymesh›
Defined in src/Polymesh.ts:124
Create the instance and connect to the Polymesh node using a keyring
Parameters:
Name | Type |
| ConnectParamsBase & object |
Returns: Promise‹Polymesh›
▸ connect(params
: ConnectParamsBase & object): Promise‹Polymesh›
Defined in src/Polymesh.ts:138
Create the instance and connect to the Polymesh node using an account URI
Parameters:
Name | Type |
| ConnectParamsBase & object |
Returns: Promise‹Polymesh›
▸ connect(params
: ConnectParamsBase & object): Promise‹Polymesh›
Defined in src/Polymesh.ts:148
Create the instance and connect to the Polymesh node using an account mnemonic
Parameters:
Name | Type |
| ConnectParamsBase & object |
Returns: Promise‹Polymesh›
▸ connect(params
: ConnectParamsBase): Promise‹Polymesh›
Defined in src/Polymesh.ts:157
Create the instance and connect to the Polymesh node without an account
Parameters:
Name | Type |
|
Returns: Promise‹Polymesh›
Last updated