api_client_Polymesh.Polymesh

@polymeshassociation/polymesh-sdk / Modules / api/client/Polymesh / Polymesh

Class: Polymesh

api/client/Polymesh.Polymesh

Main entry point of the Polymesh SDK

Table of contents

Properties

Accessors

Methods

Properties

accountManagement

accountManagement: AccountManagement

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

Defined in

api/client/Polymesh.ts:53arrow-up-right


assets

assets: Assets

A set of methods for interacting with Assets

Defined in

api/client/Polymesh.ts:61arrow-up-right


claims

claims: Claims

A set of methods to deal with Claims

Defined in

api/client/Polymesh.ts:41arrow-up-right


identities

identities: Identities

A set of methods for interacting with Polymesh Identities.

Defined in

api/client/Polymesh.ts:57arrow-up-right


network

network: Network

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

Defined in

api/client/Polymesh.ts:45arrow-up-right


settlements

settlements: Settlements

A set of methods for exchanging Assets

Defined in

api/client/Polymesh.ts:49arrow-up-right

Accessors

_middlewareApi

get _middlewareApi(): default<NormalizedCacheObject>

Middleware client

Returns

default<NormalizedCacheObject>

Defined in

api/client/Polymesh.ts:258arrow-up-right


_polkadotApi

get _polkadotApi(): ApiPromise

Polkadot client

Returns

ApiPromise

Defined in

api/client/Polymesh.ts:242arrow-up-right


_signingAddress

get _signingAddress(): string

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

Returns

string

Defined in

api/client/Polymesh.ts:250arrow-up-right

Methods

disconnect

disconnect(): Promise<void>

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>

Defined in

api/client/Polymesh.ts:217arrow-up-right


getSigningIdentity

getSigningIdentity(): Promise<null | Identity>

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

throws if there is no signing Account associated to the SDK

Returns

Promise<null | Identity>

Defined in

api/client/Polymesh.ts:172arrow-up-right


onConnectionError

onConnectionError(callback): () => void

Handle connection errors

Parameters

Name
Type

callback

(...args: unknown[]) => unknown

Returns

fn

an unsubscribe callback

▸ (): void

Handle connection errors

Returns

void

an unsubscribe callback

Defined in

api/client/Polymesh.ts:181arrow-up-right


onDisconnect

onDisconnect(callback): () => void

Handle disconnection

Parameters

Name
Type

callback

(...args: unknown[]) => unknown

Returns

fn

an unsubscribe callback

▸ (): void

Handle disconnection

Returns

void

an unsubscribe callback

Defined in

api/client/Polymesh.ts:198arrow-up-right


setSigningAccount

setSigningAccount(signer): Promise<void>

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

string | Account

Returns

Promise<void>

Defined in

api/client/Polymesh.ts:226arrow-up-right


setSigningManager

setSigningManager(signingManager): Promise<void>

Set the SDK's Signing Manager to the provided one

Parameters

Name
Type

signingManager

SigningManager

Returns

Promise<void>

Defined in

api/client/Polymesh.ts:233arrow-up-right


connect

Static connect(params): Promise<Polymesh>

Create an SDK instance and connect to a Polymesh node

Parameters

Name
Type

params

ConnectParams

Returns

Promise<Polymesh>

Defined in

api/client/Polymesh.ts:86arrow-up-right

Last updated

Was this helpful?