Polymesh

Main entry point of the Polymesh SDK

Hierarchy

  • Polymesh

Index

Properties

Accessors

Methods

Properties

claims

• claims: Claims

Defined in src/Polymesh.ts:79arrow-up-right

middleware

• middleware: Middleware

Defined in src/Polymesh.ts:80arrow-up-right

settlements

• settlements: Settlements

Defined in src/Polymesh.ts:81arrow-up-right

Accessors

_polkadotApi

• get _polkadotApi(): ApiPromise

Defined in src/Polymesh.ts:756arrow-up-right

Polkadot client

Returns: ApiPromise

Methods

addSigner

â–¸ addSigner(params: object): Account

Defined in src/Polymesh.ts:711arrow-up-right

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

Name

Type

Description

accountSeed

string

hex seed of the account

Returns: Account

â–¸ addSigner(params: object): Account

Defined in src/Polymesh.ts:719arrow-up-right

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

Name

Type

Description

accountMnemonic

string

account mnemonic

Returns: Account

â–¸ addSigner(params: object): Account

Defined in src/Polymesh.ts:727arrow-up-right

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

Name

Type

Description

accountUri

string

account URI

Returns: Account

claimClassicTicker

▸ claimClassicTicker(args: ClaimClassicTickerParams, opts?: ProcedureOpts): Promise‹TransactionQueue‹TickerReservation››

Defined in src/Polymesh.ts:353arrow-up-right

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:701arrow-up-right

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:475arrow-up-right

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:476arrow-up-right

Parameters:

â–ª args: object

Name

Type

address

string

Returns: Account

getAccountBalance

▸ getAccountBalance(args?: undefined | object): Promise‹AccountBalance›

Defined in src/Polymesh.ts:291arrow-up-right

Get the free/locked POLYX balance of an Account

note can be subscribed to

Parameters:

Name

Type

args?

undefined | object

Returns: Promise‹AccountBalance›

▸ getAccountBalance(callback: SubCallback‹AccountBalance›): Promise‹UnsubCallback›

Defined in src/Polymesh.ts:292arrow-up-right

Parameters:

Name

Type

callback

Returns: Promise‹UnsubCallback›

▸ getAccountBalance(args: object, callback: SubCallback‹AccountBalance›): Promise‹UnsubCallback›

Defined in src/Polymesh.ts:293arrow-up-right

Parameters:

â–ª args: object

Name

Type

account

string | Account

▪ callback: SubCallback‹AccountBalance›

Returns: Promise‹UnsubCallback›

getAccounts

â–¸ getAccounts(): []

Defined in src/Polymesh.ts:494arrow-up-right

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: []

getCurrentIdentity

▸ getCurrentIdentity(): Promise‹CurrentIdentity | null›

Defined in src/Polymesh.ts:468arrow-up-right

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:461arrow-up-right

Create an Identity instance from a DID

Parameters:

â–ª args: object

Name

Type

did

string

Returns: Identity

getLatestBlock

▸ getLatestBlock(): Promise‹BigNumber›

Defined in src/Polymesh.ts:690arrow-up-right

Retrieve the number of the latest block in the chain

Returns: Promise‹BigNumber›

getNetworkProperties

▸ getNetworkProperties(): Promise‹NetworkProperties›

Defined in src/Polymesh.ts:626arrow-up-right

Retrieve information for the current network

Returns: Promise‹NetworkProperties›

getSecurityToken

▸ getSecurityToken(args: object): Promise‹SecurityToken›

Defined in src/Polymesh.ts:600arrow-up-right

Retrieve a Security Token

Parameters:

â–ª args: object

Name

Type

Description

ticker

string

Security Token ticker

Returns: Promise‹SecurityToken›

getSecurityTokens

▸ getSecurityTokens(args?: undefined | object): Promise‹SecurityToken[]›

Defined in src/Polymesh.ts:568arrow-up-right

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

Returns: Promise‹SecurityToken[]›

getTickerReservation

▸ getTickerReservation(args: object): Promise‹TickerReservation›

Defined in src/Polymesh.ts:428arrow-up-right

Retrieve a Ticker Reservation

Parameters:

â–ª args: object

Name

Type

Description

ticker

string

Security Token ticker

Returns: Promise‹TickerReservation›

getTickerReservations

▸ getTickerReservations(args?: undefined | object): Promise‹TickerReservation[]›

Defined in src/Polymesh.ts:394arrow-up-right

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

Returns: Promise‹TickerReservation[]›

getTransactionFees

▸ getTransactionFees(args: object): Promise‹BigNumber›

Defined in src/Polymesh.ts:512arrow-up-right

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›

getTreasuryAccount

â–¸ getTreasuryAccount(): Account

Defined in src/Polymesh.ts:519arrow-up-right

Get the treasury wallet address

Returns: Account

getTreasuryBalance

▸ getTreasuryBalance(): Promise‹BigNumber›

Defined in src/Polymesh.ts:650arrow-up-right

Get the Treasury POLYX balance

note can be subscribed to

Returns: Promise‹BigNumber›

▸ getTreasuryBalance(callback: SubCallback‹BigNumber›): Promise‹UnsubCallback›

Defined in src/Polymesh.ts:651arrow-up-right

Parameters:

Name

Type

callback

SubCallback‹BigNumber›

Returns: Promise‹UnsubCallback›

isIdentityValid

▸ isIdentityValid(args: object): Promise‹boolean›

Defined in src/Polymesh.ts:501arrow-up-right

Return whether the supplied Identity/DID exists

Parameters:

â–ª args: object

Name

Type

identity

Identity | string

Returns: Promise‹boolean›

isTickerAvailable

▸ isTickerAvailable(args: object): Promise‹boolean›

Defined in src/Polymesh.ts:362arrow-up-right

Check if a ticker hasn't been reserved

note can be subscribed to

Parameters:

â–ª args: object

Name

Type

ticker

string

Returns: Promise‹boolean›

▸ isTickerAvailable(args: object, callback: SubCallback‹boolean›): Promise‹UnsubCallback›

Defined in src/Polymesh.ts:363arrow-up-right

Parameters:

â–ª args: object

Name

Type

ticker

string

▪ callback: SubCallback‹boolean›

Returns: Promise‹UnsubCallback›

onConnectionError

â–¸ onConnectionError(callback: function): function

Defined in src/Polymesh.ts:532arrow-up-right

Handle connection errors

Parameters:

â–ª callback: function

â–¸ (...args: unknown[]): unknown

Parameters:

Name

Type

...args

unknown[]

Returns: function

an unsubscribe callback

â–¸ (): void

onDisconnect

â–¸ onDisconnect(callback: function): function

Defined in src/Polymesh.ts:549arrow-up-right

Handle disconnection

Parameters:

â–ª callback: function

â–¸ (...args: unknown[]): unknown

Parameters:

Name

Type

...args

unknown[]

Returns: function

an unsubscribe callback

â–¸ (): void

registerIdentity

▸ registerIdentity(args: RegisterIdentityParams, opts?: ProcedureOpts): Promise‹TransactionQueue‹Identity››

Defined in src/Polymesh.ts:683arrow-up-right

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:

Returns: Promise‹TransactionQueue‹Identity››

reserveTicker

▸ reserveTicker(args: ReserveTickerParams, opts?: ProcedureOpts): Promise‹TransactionQueue‹TickerReservation››

Defined in src/Polymesh.ts:341arrow-up-right

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:

Returns: Promise‹TransactionQueue‹TickerReservation››

setSigner

â–¸ setSigner(signer: string | Account): void

Defined in src/Polymesh.ts:746arrow-up-right

Set the SDK's current signing key to the provided address

note the key must have been previously added via addSigner

Parameters:

Name

Type

signer

string | Account

Returns: void

transferPolyx

▸ transferPolyx(args: TransferPolyxParams, opts?: ProcedureOpts): Promise‹TransactionQueue‹void››

Defined in src/Polymesh.ts:280arrow-up-right

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:

Returns: Promise‹TransactionQueue‹void››

Static connect

▸ connect(params: ConnectParamsBase & object): Promise‹Polymesh›

Defined in src/Polymesh.ts:128arrow-up-right

Create the instance and connect to the Polymesh node using an account seed

Parameters:

Name

Type

params

Returns: Promise‹Polymesh›

▸ connect(params: ConnectParamsBase & object): Promise‹Polymesh›

Defined in src/Polymesh.ts:138arrow-up-right

Create the instance and connect to the Polymesh node using a keyring

Parameters:

Name

Type

params

Returns: Promise‹Polymesh›

▸ connect(params: ConnectParamsBase & object): Promise‹Polymesh›

Defined in src/Polymesh.ts:151arrow-up-right

Create the instance and connect to the Polymesh node using an account URI

Parameters:

Name

Type

params

Returns: Promise‹Polymesh›

▸ connect(params: ConnectParamsBase & object): Promise‹Polymesh›

Defined in src/Polymesh.ts:161arrow-up-right

Create the instance and connect to the Polymesh node using an account mnemonic

Parameters:

Name

Type

params

Returns: Promise‹Polymesh›

▸ connect(params: ConnectParamsBase): Promise‹Polymesh›

Defined in src/Polymesh.ts:170arrow-up-right

Create the instance and connect to the Polymesh node without an account

Parameters:

Name

Type

Returns: Promise‹Polymesh›

Last updated

Was this helpful?