Polymesh
Last updated
Was this helpful?
Last updated
Was this helpful?
Main entry point of the Polymesh SDK
Polymesh
• settlements: Settlements
• get _middlewareApi(): ApolloClient‹NormalizedCacheObject›
Middleware client
Returns: ApolloClient‹NormalizedCacheObject›
• get _polkadotApi(): ApiPromise
Polkadot client
Returns: ApiPromise
Adds a new signing key to the SDK instance. This will not change the current signer. For that, you must explicitly call setSigner
Parameters:
â–ª params: object
accountSeed
string
hex seed of the account
Adds a new signing key to the SDK instance. This will not change the current signer. For that, you must explicitly call setSigner
Parameters:
â–ª params: object
accountMnemonic
string
account mnemonic
Parameters:
â–ª params: object
accountUri
string
account URI
Claim a ticker symbol that was reserved in Polymath Classic (Ethereum). The Ethereum account that owns the ticker must sign a special message that contains the DID of the Identity that will own the ticker in Polymesh, and provide the signed data to this call
Parameters:
args
opts?
▸ 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?
undefined | object
Get the free/locked POLYX balance of an Account
note
can be subscribed to
Parameters:
args?
undefined | object
Parameters:
callback
Parameters:
â–ª args: object
account
Return a list that contains all the signing Accounts associated to the SDK instance
throws
— if there is no current Account associated to the SDK instance
Retrieve the Identity associated to the current Account (null if there is none)
Create an Identity instance from a DID
throws
if there is no Identity with the passed DID
Parameters:
â–ª args: object
did
string
▸ getLatestBlock(): Promise‹BigNumber›
Retrieve the number of the latest block in the chain
Returns: Promise‹BigNumber›
Retrieve information for the current network
▸ getNetworkVersion(): Promise‹string›
Fetch the current network version (i.e. 3.1.0)
Returns: Promise‹string›
Retrieve a Security Token
Parameters:
â–ª args: object
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:
args?
undefined | object
Retrieve a Ticker Reservation
Parameters:
â–ª args: object
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:
args?
undefined | object
â–¸ getTransactionFees(args
: object): Promise‹BigNumber›
Retrieve the protocol fees associated with running a specific transaction
Parameters:
â–ª args: object
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:
callback
â–¸ isIdentityValid(args
: object): Promise‹boolean›
Return whether the supplied Identity/DID exists
Parameters:
â–ª args: object
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
ticker
string
Returns: Promise‹boolean›
Parameters:
â–ª args: object
ticker
string
â–¸ onConnectionError(callback
: function): function
Handle connection errors
Parameters:
â–ª callback: function
â–¸ (...args
: unknown[]): unknown
Parameters:
...args
unknown[]
Returns: function
an unsubscribe callback
â–¸ (): void
â–¸ onDisconnect(callback
: function): function
Handle disconnection
Parameters:
â–ª callback: function
â–¸ (...args
: unknown[]): unknown
Parameters:
...args
unknown[]
Returns: function
an unsubscribe callback
â–¸ (): void
Register an Identity
note
must be a CDD provider
note
required role:
Customer Due Diligence Provider
Parameters:
args
opts?
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
Parameters:
args
opts?
Set the SDK's current signing key to the provided address
Parameters:
signer
Returns: void
Transfer an amount of POLYX to a specified Account
Parameters:
args
opts?
Static
connectCreate the instance and connect to the Polymesh node using an account seed
Parameters:
params
Create the instance and connect to the Polymesh node using a keyring
Parameters:
params
Create the instance and connect to the Polymesh node using an account URI
Parameters:
params
Create the instance and connect to the Polymesh node using an account mnemonic
Parameters:
params
Create the instance and connect to the Polymesh node without an account
Parameters:
params
• claims:
Defined in
• middleware:
Defined in
Defined in
Defined in
Defined in
â–¸ addSigner(params
: object):
Defined in
Returns:
â–¸ addSigner(params
: object):
Defined in
Returns:
â–¸ addSigner(params
: object):
Defined in
Adds a new signing key to the SDK instance. This will not change the current signer. For that, you must explicitly call
Returns:
â–¸ claimClassicTicker(args
: , opts?
: ): Promise‹‹››
Defined in
note
this method is of type , which means you can call claimClassicTicker.checkAuthorization
on it to see whether the Current Account has the required permissions to run it
Returns: Promise‹‹››
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(args?
: undefined | 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‹›
â–¸ getAccounts(): []
Defined in
Returns: []
▸ getCurrentIdentity(): Promise‹ | null›
Defined in
Returns: Promise‹ | null›
â–¸ getIdentity(args
: object): Promise‹›
Defined in
Returns: Promise‹›
Defined in
▸ getNetworkProperties(): Promise‹›
Defined in
Returns: Promise‹›
Defined in
â–¸ 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
â–¸ registerIdentity(args
: , opts?
: ): Promise‹‹››
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
note
this method is of type , which means you can call registerIdentity.checkAuthorization
on it to see whether the Current Account has the required permissions to run it
Returns: Promise‹‹››
â–¸ reserveTicker(args
: , opts?
: ): Promise‹‹››
Defined in
note
this method is of type , which means you can call reserveTicker.checkAuthorization
on it to see whether the Current Account has the required permissions to run it
Returns: Promise‹‹››
â–¸ setSigner(signer
: string | ): void
Defined in
note
the key must have been previously added via
string |
â–¸ transferPolyx(args
: , opts?
: ): Promise‹‹void››
Defined in
note
this method is of type , which means you can call transferPolyx.checkAuthorization
on it to see whether the Current Account has the required permissions to run it
Returns: Promise‹‹void››
â–¸ 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‹›