Polymesh
Main entry point of the Polymesh SDK
Hierarchy
Polymesh
Index
Properties
Accessors
Methods
Properties
claims
• claims: Claims
Defined in src/Polymesh.ts:81
middleware
• middleware: Middleware
Defined in src/Polymesh.ts:82
settlements
• settlements: Settlements
Defined in src/Polymesh.ts:83
Accessors
_middlewareApi
• get _middlewareApi(): ApolloClient‹NormalizedCacheObject›
Defined in src/Polymesh.ts:787
Middleware client
Returns: ApolloClient‹NormalizedCacheObject›
_polkadotApi
• get _polkadotApi(): ApiPromise
Defined in src/Polymesh.ts:779
Polkadot client
Returns: ApiPromise
Methods
addSigner
▸ addSigner(params
: object): Account
Defined in src/Polymesh.ts:727
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
Returns: Account
▸ addSigner(params
: object): Account
Defined in src/Polymesh.ts:735
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
Returns: Account
▸ addSigner(params
: object): Account
Defined in src/Polymesh.ts:743
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
accountUri
string
account URI
Returns: Account
claimClassicTicker
▸ claimClassicTicker(args
: ClaimClassicTickerParams, opts?
: ProcedureOpts): Promise‹TransactionQueue‹TickerReservation››
Defined in src/Polymesh.ts:366
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
note
this method is of type ProcedureMethod, which means you can call claimClassicTicker.checkAuthorization
on it to see whether the Current Account has the required permissions to run it
Parameters:
Returns: Promise‹TransactionQueue‹TickerReservation››
disconnect
▸ disconnect(): Promise‹void›
Defined in src/Polymesh.ts:717
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(args?
: undefined | object): Account
Defined in src/Polymesh.ts:501
Create an Account instance from an address. If no address is passed, the current Account is returned
Parameters:
args?
undefined | object
Returns: Account
getAccountBalance
▸ getAccountBalance(args?
: undefined | object): Promise‹AccountBalance›
Defined in src/Polymesh.ts:304
Get the free/locked POLYX balance of an Account
note
can be subscribed to
Parameters:
args?
undefined | object
Returns: Promise‹AccountBalance›
▸ getAccountBalance(callback
: SubCallback‹AccountBalance›): Promise‹UnsubCallback›
Defined in src/Polymesh.ts:305
Parameters:
callback
Returns: Promise‹UnsubCallback›
▸ getAccountBalance(args
: object, callback
: SubCallback‹AccountBalance›): Promise‹UnsubCallback›
Defined in src/Polymesh.ts:306
Parameters:
▪ args: object
account
string | Account
▪ callback: SubCallback‹AccountBalance›
Returns: Promise‹UnsubCallback›
getAccounts
▸ getAccounts(): Account[]
Defined in src/Polymesh.ts:516
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
Returns: Account[]
getCurrentIdentity
▸ getCurrentIdentity(): Promise‹Identity | null›
Defined in src/Polymesh.ts:494
Retrieve the Identity associated to the current Account (null if there is none)
Returns: Promise‹Identity | null›
getIdentity
▸ getIdentity(args
: object): Promise‹Identity›
Defined in src/Polymesh.ts:476
Create an Identity instance from a DID
throws
if there is no Identity with the passed DID
Parameters:
▪ args: object
did
string
Returns: Promise‹Identity›
getLatestBlock
▸ getLatestBlock(): Promise‹BigNumber›
Defined in src/Polymesh.ts:706
Retrieve the number of the latest block in the chain
Returns: Promise‹BigNumber›
getNetworkProperties
▸ getNetworkProperties(): Promise‹NetworkProperties›
Defined in src/Polymesh.ts:642
Retrieve information for the current network
Returns: Promise‹NetworkProperties›
getNetworkVersion
▸ getNetworkVersion(): Promise‹string›
Defined in src/Polymesh.ts:769
Fetch the current network version (i.e. 3.1.0)
Returns: Promise‹string›
getSecurityToken
▸ getSecurityToken(args
: object): Promise‹SecurityToken›
Defined in src/Polymesh.ts:623
Retrieve a Security Token
Parameters:
▪ args: object
ticker
string
Security Token ticker
Returns: Promise‹SecurityToken›
getSecurityTokens
▸ getSecurityTokens(args?
: undefined | object): Promise‹SecurityToken[]›
Defined in src/Polymesh.ts:591
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
Returns: Promise‹SecurityToken[]›
getTickerReservation
▸ getTickerReservation(args
: object): Promise‹TickerReservation›
Defined in src/Polymesh.ts:441
Retrieve a Ticker Reservation
Parameters:
▪ args: object
ticker
string
Security Token ticker
Returns: Promise‹TickerReservation›
getTickerReservations
▸ getTickerReservations(args?
: undefined | object): Promise‹TickerReservation[]›
Defined in src/Polymesh.ts:407
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
Returns: Promise‹TickerReservation[]›
getTransactionFees
▸ getTransactionFees(args
: object): Promise‹BigNumber›
Defined in src/Polymesh.ts:535
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›
getTreasuryAccount
▸ getTreasuryAccount(): Account
Defined in src/Polymesh.ts:542
Get the treasury wallet address
Returns: Account
getTreasuryBalance
▸ getTreasuryBalance(): Promise‹BigNumber›
Defined in src/Polymesh.ts:666
Get the Treasury POLYX balance
note
can be subscribed to
Returns: Promise‹BigNumber›
▸ getTreasuryBalance(callback
: SubCallback‹BigNumber›): Promise‹UnsubCallback›
Defined in src/Polymesh.ts:667
Parameters:
callback
SubCallback‹BigNumber›
Returns: Promise‹UnsubCallback›
isIdentityValid
▸ isIdentityValid(args
: object): Promise‹boolean›
Defined in src/Polymesh.ts:523
Return whether the supplied Identity/DID exists
Parameters:
▪ args: object
identity
Identity | string
Returns: Promise‹boolean›
isTickerAvailable
▸ isTickerAvailable(args
: object): Promise‹boolean›
Defined in src/Polymesh.ts:375
Check if a ticker hasn't been reserved
note
can be subscribed to
Parameters:
▪ args: object
ticker
string
Returns: Promise‹boolean›
▸ isTickerAvailable(args
: object, callback
: SubCallback‹boolean›): Promise‹UnsubCallback›
Defined in src/Polymesh.ts:376
Parameters:
▪ args: object
ticker
string
▪ callback: SubCallback‹boolean›
Returns: Promise‹UnsubCallback›
onConnectionError
▸ onConnectionError(callback
: function): function
Defined in src/Polymesh.ts:555
Handle connection errors
Parameters:
▪ callback: function
▸ (...args
: unknown[]): unknown
Parameters:
...args
unknown[]
Returns: function
an unsubscribe callback
▸ (): void
onDisconnect
▸ onDisconnect(callback
: function): function
Defined in src/Polymesh.ts:572
Handle disconnection
Parameters:
▪ callback: function
▸ (...args
: unknown[]): unknown
Parameters:
...args
unknown[]
Returns: function
an unsubscribe callback
▸ (): void
registerIdentity
▸ registerIdentity(args
: RegisterIdentityParams, opts?
: ProcedureOpts): Promise‹TransactionQueue‹Identity››
Defined in src/Polymesh.ts:699
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
note
this method is of type ProcedureMethod, which means you can call registerIdentity.checkAuthorization
on it to see whether the Current Account has the required permissions to run it
Parameters:
opts?
Returns: Promise‹TransactionQueue‹Identity››
reserveTicker
▸ reserveTicker(args
: ReserveTickerParams, opts?
: ProcedureOpts): Promise‹TransactionQueue‹TickerReservation››
Defined in src/Polymesh.ts:354
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
note
this method is of type ProcedureMethod, which means you can call reserveTicker.checkAuthorization
on it to see whether the Current Account has the required permissions to run it
Parameters:
opts?
Returns: Promise‹TransactionQueue‹TickerReservation››
setSigner
▸ setSigner(signer
: string | Account): void
Defined in src/Polymesh.ts:762
Set the SDK's current signing key to the provided address
note
the key must have been previously added via addSigner
Parameters:
signer
string | Account
Returns: void
transferPolyx
▸ transferPolyx(args
: TransferPolyxParams, opts?
: ProcedureOpts): Promise‹TransactionQueue‹void››
Defined in src/Polymesh.ts:293
Transfer an amount of POLYX to a specified Account
note
this method is of type ProcedureMethod, which means you can call transferPolyx.checkAuthorization
on it to see whether the Current Account has the required permissions to run it
Parameters:
opts?
Returns: Promise‹TransactionQueue‹void››
Static
connect
Static
connect▸ connect(params
: ConnectParamsBase & object): Promise‹Polymesh›
Defined in src/Polymesh.ts:130
Create the instance and connect to the Polymesh node using an account seed
Parameters:
params
ConnectParamsBase & object
Returns: Promise‹Polymesh›
▸ connect(params
: ConnectParamsBase & object): Promise‹Polymesh›
Defined in src/Polymesh.ts:140
Create the instance and connect to the Polymesh node using a keyring
Parameters:
params
ConnectParamsBase & object
Returns: Promise‹Polymesh›
▸ connect(params
: ConnectParamsBase & object): Promise‹Polymesh›
Defined in src/Polymesh.ts:153
Create the instance and connect to the Polymesh node using an account URI
Parameters:
params
ConnectParamsBase & object
Returns: Promise‹Polymesh›
▸ connect(params
: ConnectParamsBase & object): Promise‹Polymesh›
Defined in src/Polymesh.ts:163
Create the instance and connect to the Polymesh node using an account mnemonic
Parameters:
params
ConnectParamsBase & object
Returns: Promise‹Polymesh›
▸ connect(params
: ConnectParamsBase): Promise‹Polymesh›
Defined in src/Polymesh.ts:172
Create the instance and connect to the Polymesh node without an account
Parameters:
params
Returns: Promise‹Polymesh›
Last updated