Polymesh SDK API Reference
beta
beta
  • Globals
  • Classes
    • Account
    • AccountManagement
    • Asset
    • AssetHolders
    • AssetPermissions
    • Assets
    • AuthorizationRequest
    • Authorizations
    • Checkpoint
    • CheckpointSchedule
    • Checkpoints
    • Claims
    • Compliance
    • CorporateAction
    • CorporateActionBase
    • CorporateActions
    • Count
    • CustomPermissionGroup
    • DefaultPortfolio
    • DefaultTrustedClaimIssuer
    • Distributions
    • DividendDistribution
    • Documents
    • Entity
    • Identities
    • Identity
    • IdentityAuthorizations
    • Instruction
    • Issuance
    • KnownPermissionGroup
    • Network
    • NumberedPortfolio
    • Offering
    • Offerings
    • Percentage
    • PermissionGroup
    • Permissions
    • Polymesh
    • PolymeshError
    • PolymeshTransaction
    • PolymeshTransactionBase
    • PolymeshTransactionBatch
    • Portfolio
    • Portfolios
    • Requirements
    • Schedules
    • Settlements
    • Subsidy
    • TickerReservation
    • TransactionQueue
    • TransferRestrictionBase
    • TransferRestrictions
    • TrustedClaimIssuers
    • Venue
  • Enums
  • Interfaces
Powered by GitBook
On this page
  • Hierarchy
  • Index
  • Properties
  • Accessors
  • Methods
  • Properties
  • accountManagement
  • assets
  • claims
  • identities
  • network
  • settlements
  • Accessors
  • _middlewareApi
  • _polkadotApi
  • _signingAddress
  • Methods
  • disconnect
  • getSigningIdentity
  • onConnectionError
  • onDisconnect
  • setSigningAccount
  • setSigningManager
  • Static connect

Was this helpful?

  1. Classes

Polymesh

PreviousPermissionsNextPolymeshError

Last updated 2 years ago

Was this helpful?

Main entry point of the Polymesh SDK

Hierarchy

  • Polymesh

Index

Properties

Accessors

Methods

Properties

accountManagement

A set of methods for managing a Polymesh Identity's Accounts and their permissions


assets

A set of methods for interacting with Assets


claims

A set of methods to deal with Claims


identities

A set of methods for interacting with Polymesh Identities.


network

A set of methods to interact with the Polymesh network. This includes transferring POLYX, reading network properties and querying for historical events


settlements

• settlements: Settlements

A set of methods for exchanging Assets

Accessors

_middlewareApi

• get _middlewareApi(): ApolloClient‹NormalizedCacheObject›

Middleware client

Returns: ApolloClient‹NormalizedCacheObject›


_polkadotApi

• get _polkadotApi(): ApiPromise

Polkadot client

Returns: ApiPromise


_signingAddress

• get _signingAddress(): string

signing address (to manually submit transactions with the polkadot API)

Returns: string

Methods

disconnect

▸ disconnect(): Promise‹void›

Disconnect the client and close all open connections and subscriptions

Returns: Promise‹void›


getSigningIdentity

Retrieve the Identity associated to the signing Account (null if there is none)

throws if there is no signing Account associated to the SDK


onConnectionError

▸ 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

▸ onDisconnect(callback: function): function

Handle disconnection

Parameters:

▪ callback: function

▸ (...args: unknown[]): unknown

Parameters:

Name
Type

...args

unknown[]

Returns: function

an unsubscribe callback

▸ (): void


setSigningAccount

Set the SDK's signing Account to the provided one

throws if the passed Account is not present in the Signing Manager (or there is no Signing Manager)

Parameters:

Name
Type

signer

Returns: Promise‹void›


setSigningManager

▸ setSigningManager(signingManager: SigningManager): Promise‹void›

Set the SDK's Signing Manager to the provided one

Parameters:

Name
Type

signingManager

SigningManager

Returns: Promise‹void›


Static connect

Create an SDK instance and connect to a Polymesh node

Parameters:

Name
Type

params

• accountManagement:

Defined in

• assets:

Defined in

• claims:

Defined in

• identities:

Defined in

• network:

Defined in

Defined in

Defined in

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

▸ getSigningIdentity(): Promise‹ | null›

Defined in

Returns: Promise‹ | null›

Defined in

Defined in

▸ setSigningAccount(signer: string | ): Promise‹void›

Defined in

string |

Defined in

▸ connect(params: ): Promise‹›

Defined in

Returns: Promise‹›

AccountManagement
src/Polymesh.ts:91
Assets
src/Polymesh.ts:99
Claims
src/Polymesh.ts:79
Identities
src/Polymesh.ts:95
Network
src/Polymesh.ts:83
src/Polymesh.ts:87
src/Polymesh.ts:274
src/Polymesh.ts:258
src/Polymesh.ts:266
src/Polymesh.ts:233
Identity
src/Polymesh.ts:188
Identity
src/Polymesh.ts:197
src/Polymesh.ts:214
Account
src/Polymesh.ts:242
src/Polymesh.ts:249
ConnectParams
Polymesh
src/Polymesh.ts:124
Polymesh
accountManagement
assets
claims
identities
network
settlements
_middlewareApi
_polkadotApi
_signingAddress
disconnect
getSigningIdentity
onConnectionError
onDisconnect
setSigningAccount
setSigningManager
connect
connect
Account
ConnectParams