Polymesh
Last updated
Was this helpful?
Last updated
Was this helpful?
Main entry point of the Polymesh SDK
Polymesh
Register an Identity
note
must be a CDD provider
note
required role:
Customer Due Diligence Provider
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
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
• get _polkadotApi(): ApiPromise
Polkadot client
Returns: ApiPromise
▸ disconnect(): Promise‹void›
Disconnect the client and close all open connections and subscriptions
Returns: Promise‹void›
Create an Account instance from an address. If no address is passed, the current Account is returned
Parameters:
â–ª args: object
Name
Type
address
string
Get the free/locked POLYX balance of an Account
note
can be subscribed to
Parameters:
Name
Type
args?
undefined | object
Parameters:
Name
Type
callback
Parameters:
â–ª args: object
Name
Type
account
Retrieve the Identity associated to the current Account (null if there is none)
Create an Identity instance from a DID
Parameters:
â–ª args: object
Name
Type
did
string
▸ getLatestBlock(): Promise‹BigNumber›
Retrieve the number of the latest block in the chain
Returns: Promise‹BigNumber›
Retrieve information for the current network
Retrieve a Security Token
Parameters:
â–ª args: object
Name
Type
Description
ticker
string
Security Token ticker
Retrieve all the Security Tokens owned by an Identity
note
tokens with unreadable characters in their tickers will be left out
Parameters:
Name
Type
args?
undefined | object
Retrieve a Ticker Reservation
Parameters:
â–ª args: object
Name
Type
Description
ticker
string
Security Token ticker
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
args?
undefined | object
â–¸ getTransactionFees(args
: object): Promise‹BigNumber›
Retrieve the protocol fees associated with running a specific transaction
Parameters:
â–ª args: object
Name
Type
Description
tag
TxTag
transaction tag (i.e. TxTags.asset.CreateAsset or "asset.createAsset")
Returns: Promise‹BigNumber›
Get the treasury wallet address
▸ getTreasuryBalance(): Promise‹BigNumber›
Get the Treasury POLYX balance
note
can be subscribed to
Returns: Promise‹BigNumber›
Parameters:
Name
Type
callback
â–¸ isIdentityValid(args
: object): Promise‹boolean›
Return whether the supplied Identity/DID exists
Parameters:
â–ª args: object
Name
Type
identity
Returns: Promise‹boolean›
â–¸ isTickerAvailable(args
: object): Promise‹boolean›
Check if a ticker hasn't been reserved
note
can be subscribed to
Parameters:
â–ª args: object
Name
Type
ticker
string
Returns: Promise‹boolean›
Parameters:
â–ª args: object
Name
Type
ticker
string
â–¸ onConnectionError(callback
: function): function
Handle connection errors
Parameters:
â–ª callback: function
â–¸ (...args
: unknown[]): unknown
Parameters:
Name
Type
...args
unknown[]
Returns: function
an unsubscribe callback
â–¸ (): void
â–¸ onDisconnect(callback
: function): function
Handle disconnection
Parameters:
â–ª callback: function
â–¸ (...args
: unknown[]): unknown
Parameters:
Name
Type
...args
unknown[]
Returns: function
an unsubscribe callback
â–¸ (): void
Static
connectCreate the instance and connect to the Polymesh node using an account seed
Parameters:
Name
Type
params
Create the instance and connect to the Polymesh node using a keyring
Parameters:
Name
Type
params
Create the instance and connect to the Polymesh node using an account URI
Parameters:
Name
Type
params
Create the instance and connect to the Polymesh node using an account mnemonic
Parameters:
Name
Type
params
Create the instance and connect to the Polymesh node without an account
Parameters:
Name
Type
params
• claims:
Defined in
• middleware:
Defined in
• registerIdentity: ProcedureMethod‹, ›
Defined in
note
this may create which have to be accepted by the corresponding and/or . An Account or Identity can fetch its pending Authorization Requests by calling authorizations.getReceived
• reserveTicker: ProcedureMethod‹, ›
Defined in
• transferPolyX: ProcedureMethod‹, void›
Defined in
Defined in
Defined in
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
â–¸ getAccount():
Defined in
Returns:
â–¸ getAccount(args
: object):
Defined in
Returns:
â–¸ getAccountBalance(args?
: undefined | object): Promise‹›
Defined in
Returns: Promise‹›
â–¸ getAccountBalance(callback
: ‹›): Promise‹›
Defined in
‹›
Returns: Promise‹›
â–¸ getAccountBalance(args
: object, callback
: ‹›): Promise‹›
Defined in
string |
▪ callback: ‹›
Returns: Promise‹›
▸ getCurrentIdentity(): Promise‹ | null›
Defined in
Returns: Promise‹ | null›
â–¸ getIdentity(args
: object):
Defined in
Returns:
Defined in
▸ getNetworkProperties(): Promise‹›
Defined in
Returns: Promise‹›
â–¸ getSecurityToken(args
: object): Promise‹›
Defined in
Returns: Promise‹›
â–¸ getSecurityTokens(args?
: undefined | object): Promise‹[]›
Defined in
Returns: Promise‹[]›
â–¸ getTickerReservation(args
: object): Promise‹›
Defined in
Returns: Promise‹›
â–¸ getTickerReservations(args?
: undefined | object): Promise‹[]›
Defined in
Returns: Promise‹[]›
Defined in
â–¸ getTreasuryAccount():
Defined in
Returns:
Defined in
â–¸ getTreasuryBalance(callback
: ‹BigNumber›): Promise‹›
Defined in
‹BigNumber›
Returns: Promise‹›
Defined in
| string
Defined in
â–¸ isTickerAvailable(args
: object, callback
: ‹boolean›): Promise‹›
Defined in
▪ callback: ‹boolean›
Returns: Promise‹›
Defined in
Defined in
â–¸ connect(params
: & object): Promise‹›
Defined in
& object
Returns: Promise‹›
â–¸ connect(params
: & object): Promise‹›
Defined in
& object
Returns: Promise‹›
â–¸ connect(params
: & object): Promise‹›
Defined in
& object
Returns: Promise‹›
â–¸ connect(params
: & object): Promise‹›
Defined in
& object
Returns: Promise‹›
â–¸ connect(params
: ): Promise‹›
Defined in
Returns: Promise‹›