Polymesh SDK API Reference
v9.0.0
v9.0.0
  • Introduction
  • Globals
  • Classes
    • Account
    • AuthorizationRequest
    • Authorizations
    • Checkpoint
    • CheckpointSchedule
    • Checkpoints
    • Claims
    • Compliance
    • Context
    • CorporateAction
    • CorporateActions
    • Count
    • CustomPermissionGroup
    • DefaultPortfolio
    • DefaultTrustedClaimIssuer
    • Distributions
    • DividendDistribution
    • Documents
    • Entity
    • Identity
    • IdentityAuthorizations
    • Instruction
    • Issuance
    • KnownPermissionGroup
    • Middleware
    • NumberedPortfolio
    • Offerings
    • Percentage
    • PermissionGroup
    • Permissions
    • Polymesh
    • PolymeshError
    • PolymeshTransaction
    • PolymeshTransactionBase
    • PolymeshTransactionBatch
    • Portfolio
    • Portfolios
    • Requirements
    • Schedules
    • SecurityToken
    • Settlements
    • Sto
    • TickerReservation
    • TokenHolders
    • TokenPermissions
    • TransactionQueue
    • TransferRestrictionBase
    • TransferRestrictions
    • TrustedClaimIssuers
    • Venue
  • Enums
    • AffirmationStatus
    • AuthorizationType
    • CalendarUnit
    • ClaimType
    • ConditionTarget
    • ConditionType
    • CorporateActionKind
    • CountryCode
    • ErrorCode
    • InstructionStatus
    • InstructionType
    • KnownTokenType
    • PermissionGroupType
    • PermissionType
    • ProposalStage
    • RoleType
    • ScopeType
    • SignerType
    • StoBalanceStatus
    • StoSaleStatus
    • StoTimingStatus
    • TargetTreatment
    • TickerReservationStatus
    • TokenIdentifierType
    • TransactionArgumentType
    • TransactionQueueStatus
    • TransactionStatus
    • TransferError
    • TransferRestrictionType
    • TransferStatus
    • TxGroup
    • VenueType
  • Interfaces
    • ActiveTransferRestrictions
    • AddBatchTransactionOpts
    • AddClaimsParams
    • AddInstructionParams
    • AddInstructionsParams
    • AddInvestorUniquenessClaimParams
    • AddPairBaseParams
    • AddTransactionOpts
    • AddTransactionOptsBase
    • AgentWithGroup
    • ArrayTransactionArgument
    • Balance
    • CalendarPeriod
    • CddProviderRole
    • CheckpointWithData
    • ClaimClassicTickerParams
    • ClaimData
    • ClaimScope
    • ClaimTarget
    • ComplexTransactionArgument
    • ConditionCompliance
    • ConnectParamsBase
    • ConstructorParams
    • ConsumeParams
    • ControllerTransferParams
    • CorporateActionDefaults
    • CorporateActionTargets
    • CountTransferRestriction
    • CountTransferRestrictionInput
    • CreateCheckpointScheduleParams
    • CreateGroupParams
    • CreateSecurityTokenParams
    • CreateVenueParams
    • DeletePortfolioParams
    • DistributionParticipant
    • DistributionPayment
    • DistributionWithDetails
    • DividendDistributionDetails
    • DividendDistributionParams
    • EditClaimsParams
    • EventIdentifier
    • ExtrinsicData
    • Fees
    • GroupedInstructions
    • HistoricSettlement
    • HumanReadable
    • IdentityBalance
    • IdentityRole
    • IdentityWithClaims
    • InstructionAffirmation
    • InvestInStoParams
    • Investment
    • InviteAccountParams
    • InviteExternalAgentParams
    • IssueTokensParams
    • KeyringPair
    • LeaveIdentityParams
    • Leg
    • LinkCaDocsParams
    • MiddlewareConfig
    • ModifyCorporateActionsAgentParams
    • ModifyInstructionAffirmationParams
    • ModifyPrimaryIssuanceAgentParams
    • ModifySignerPermissionsParams
    • ModifyTokenTrustedClaimIssuersAddSetParams
    • ModifyTokenTrustedClaimIssuersRemoveParams
    • MoveFundsParams
    • NetworkProperties
    • PaginationOptions
    • PayDividendsParams
    • PercentageTransferRestriction
    • PercentageTransferRestrictionInput
    • PlainTransactionArgument
    • PortfolioBalance
    • PortfolioCustodianRole
    • PortfolioMovement
    • ProcedureAuthorizationStatus
    • ProcedureMethod
    • ProcedureOpts
    • ProposalDetails
    • ProposalTimeFrames
    • ProposalVote
    • RedeemTokenParams
    • RegisterIdentityParams
    • RemoveCheckpointScheduleParams
    • RemoveCorporateActionParams
    • RemoveExternalAgentParams
    • RemoveSecondaryKeysParams
    • RenamePortfolioParams
    • Requirement
    • RequirementCompliance
    • ReserveTickerParams
    • ResultSet
    • RevokeClaimsParams
    • ScheduleDetails
    • ScheduleWithDetails
    • Scope
    • SecondaryKey
    • SectionPermissions
    • SecurityTokenDetails
    • SetAssetRequirementsParams
    • SetCountTransferRestrictionsParams
    • SetCustodianParams
    • SetGroupPermissionsParams
    • SetPercentageTransferRestrictionsParams
    • SetPermissionGroupParams
    • SetTokenDocumentsParams
    • SettlementLeg
    • SignerValue
    • SimpleEnumTransactionArgument
    • SimplePermissions
    • StoDetails
    • StoStatus
    • StoTier
    • StoWithDetails
    • TaxWithholding
    • TickerOwnerRole
    • TickerReservationDetails
    • Tier
    • ToggleFreezeSecondaryKeysParams
    • ToggleFreezeStoParams
    • ToggleFreezeTransfersParams
    • TogglePauseRequirementsParams
    • TokenBase
    • TokenDocument
    • TokenIdentifier
    • TokenWithGroup
    • TransactionPermissions
    • TransactionsParams
    • TransferBreakdown
    • TransferPolyxParams
    • TransferRestriction
    • TransferRestrictionInputBase
    • TransferRestrictionResult
    • TransferTickerOwnershipParams
    • TransferTokenOwnershipParams
    • TrustedClaimIssuer
    • TxGroupParams
    • UiKeyring
    • UniqueIdentifiers
    • VenueDetails
    • VenueOwnerRole
    • WaivePermissionsParams
Powered by GitBook
On this page
  • Hierarchy
  • Index
  • Properties
  • Accessors
  • Methods
  • Properties
  • claims
  • middleware
  • settlements
  • Accessors
  • _middlewareApi
  • _polkadotApi
  • Methods
  • addSigner
  • claimClassicTicker
  • disconnect
  • getAccount
  • getAccountBalance
  • getAccounts
  • getCurrentIdentity
  • getIdentity
  • getLatestBlock
  • getNetworkProperties
  • getSecurityToken
  • getSecurityTokens
  • getTickerReservation
  • getTickerReservations
  • getTransactionFees
  • getTreasuryAccount
  • getTreasuryBalance
  • isIdentityValid
  • isTickerAvailable
  • onConnectionError
  • onDisconnect
  • registerIdentity
  • reserveTicker
  • setSigner
  • transferPolyx
  • Static connect

Was this helpful?

  1. Classes

Polymesh

PreviousPermissionsNextPolymeshError

Last updated 3 years ago

Was this helpful?

Main entry point of the Polymesh SDK

Hierarchy

  • Polymesh

Index

Properties

Accessors

Methods

Properties

claims

middleware

settlements

• settlements: Settlements

Accessors

_middlewareApi

• get _middlewareApi(): ApolloClient‹NormalizedCacheObject›

Middleware client

Returns: ApolloClient‹NormalizedCacheObject›

_polkadotApi

• get _polkadotApi(): ApiPromise

Polkadot client

Returns: ApiPromise

Methods

addSigner

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

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

Parameters:

â–ª params: object

Name

Type

Description

accountUri

string

account URI

claimClassicTicker

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:

Name

Type

args

opts?

disconnect

▸ disconnect(): Promise‹void›

Disconnect the client and close all open connections and subscriptions

Returns: Promise‹void›

getAccount

Create an Account instance from an address. If no address is passed, the current Account is returned

Parameters:

â–ª args: object

Name

Type

address

string

getAccountBalance

Get the free/locked POLYX balance of an Account

note can be subscribed to

Parameters:

Name

Type

args?

undefined | object

Parameters:

Name

Type

callback

Parameters:

â–ª args: object

Name

Type

account

getAccounts

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

getCurrentIdentity

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

getIdentity

Create an Identity instance from a DID

Parameters:

â–ª args: object

Name

Type

did

string

getLatestBlock

▸ getLatestBlock(): Promise‹BigNumber›

Retrieve the number of the latest block in the chain

Returns: Promise‹BigNumber›

getNetworkProperties

Retrieve information for the current network

getSecurityToken

Retrieve a Security Token

Parameters:

â–ª args: object

Name

Type

Description

ticker

string

Security Token ticker

getSecurityTokens

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

getTickerReservation

Retrieve a Ticker Reservation

Parameters:

â–ª args: object

Name

Type

Description

ticker

string

Security Token ticker

getTickerReservations

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

getTransactionFees

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

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

Get the treasury wallet address

getTreasuryBalance

▸ getTreasuryBalance(): Promise‹BigNumber›

Get the Treasury POLYX balance

note can be subscribed to

Returns: Promise‹BigNumber›

Parameters:

Name

Type

callback

isIdentityValid

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

Return whether the supplied Identity/DID exists

Parameters:

â–ª args: object

Name

Type

identity

Returns: Promise‹boolean›

isTickerAvailable

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

Check if a ticker hasn't been reserved

note can be subscribed to

Parameters:

â–ª args: object

Name

Type

ticker

string

Returns: Promise‹boolean›

Parameters:

â–ª args: object

Name

Type

ticker

string

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

registerIdentity

Register an Identity

note must be a CDD provider

note required role:

  • Customer Due Diligence Provider

Parameters:

Name

Type

args

opts?

reserveTicker

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:

Name

Type

args

opts?

setSigner

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

Parameters:

Name

Type

signer

Returns: void

transferPolyx

Transfer an amount of POLYX to a specified Account

Parameters:

Name

Type

args

opts?

Static connect

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

Parameters:

Name

Type

params

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

Parameters:

Name

Type

params

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

Parameters:

Name

Type

params

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

Parameters:

Name

Type

params

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

Parameters:

Name

Type

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():

Defined in

Returns:

â–¸ getAccount(args: 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):

Defined in

Returns:

Defined in

▸ getNetworkProperties(): Promise‹›

Defined in

Returns: Promise‹›

▸ 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‹›

Claims
src/Polymesh.ts:77
Middleware
src/Polymesh.ts:78
src/Polymesh.ts:79
src/Polymesh.ts:762
src/Polymesh.ts:754
Account
src/Polymesh.ts:709
Account
Account
src/Polymesh.ts:717
Account
Account
src/Polymesh.ts:725
Account
ClaimClassicTickerParams
ProcedureOpts
TransactionQueue
TickerReservation
src/Polymesh.ts:351
ProcedureMethod
TransactionQueue
TickerReservation
src/Polymesh.ts:699
Account
src/Polymesh.ts:473
Account
Account
src/Polymesh.ts:474
Account
src/Polymesh.ts:289
src/Polymesh.ts:290
src/Polymesh.ts:291
Account
src/Polymesh.ts:492
Account
Identity
src/Polymesh.ts:466
Identity
Identity
src/Polymesh.ts:459
Identity
src/Polymesh.ts:688
NetworkProperties
src/Polymesh.ts:624
NetworkProperties
SecurityToken
src/Polymesh.ts:598
SecurityToken
SecurityToken
src/Polymesh.ts:566
SecurityToken
TickerReservation
src/Polymesh.ts:426
TickerReservation
TickerReservation
src/Polymesh.ts:392
TickerReservation
src/Polymesh.ts:510
Account
src/Polymesh.ts:517
Account
src/Polymesh.ts:648
src/Polymesh.ts:649
src/Polymesh.ts:499
src/Polymesh.ts:360
src/Polymesh.ts:361
src/Polymesh.ts:530
src/Polymesh.ts:547
RegisterIdentityParams
ProcedureOpts
TransactionQueue
Identity
src/Polymesh.ts:681
Authorization Requests
Accounts
Identities
ProcedureMethod
TransactionQueue
Identity
ReserveTickerParams
ProcedureOpts
TransactionQueue
TickerReservation
src/Polymesh.ts:339
ProcedureMethod
TransactionQueue
TickerReservation
Account
src/Polymesh.ts:744
TransferPolyxParams
ProcedureOpts
TransactionQueue
src/Polymesh.ts:278
ProcedureMethod
TransactionQueue
ConnectParamsBase
Polymesh
src/Polymesh.ts:126
Polymesh
ConnectParamsBase
Polymesh
src/Polymesh.ts:136
Polymesh
ConnectParamsBase
Polymesh
src/Polymesh.ts:149
Polymesh
ConnectParamsBase
Polymesh
src/Polymesh.ts:159
Polymesh
ConnectParamsBase
Polymesh
src/Polymesh.ts:168
Polymesh
claims
middleware
settlements
_middlewareApi
_polkadotApi
addSigner
claimClassicTicker
disconnect
getAccount
getAccountBalance
getAccounts
getCurrentIdentity
getIdentity
getLatestBlock
getNetworkProperties
getSecurityToken
getSecurityTokens
getTickerReservation
getTickerReservations
getTransactionFees
getTreasuryAccount
getTreasuryBalance
isIdentityValid
isTickerAvailable
onConnectionError
onDisconnect
registerIdentity
reserveTicker
setSigner
transferPolyx
connect
setSigner
connect
addSigner
ClaimClassicTickerParams
ProcedureOpts
Account
Identity
RegisterIdentityParams
ProcedureOpts
ReserveTickerParams
ProcedureOpts
Account
TransferPolyxParams
ProcedureOpts
ConnectParamsBase
ConnectParamsBase
ConnectParamsBase
ConnectParamsBase
ConnectParamsBase
AccountBalance
AccountBalance
SubCallback
AccountBalance
UnsubCallback
UnsubCallback
SubCallback
AccountBalance
UnsubCallback
SubCallback
AccountBalance
UnsubCallback
SubCallback
UnsubCallback
UnsubCallback
SubCallback
UnsubCallback
SubCallback
UnsubCallback
SubCallback
AccountBalance
SubCallback