Polymesh SDK API Reference
v6.0.0
v6.0.0
  • Introduction
  • Globals
  • Classes
    • Account
    • AuthorizationRequest
    • Authorizations
    • Checkpoint
    • CheckpointSchedule
    • Checkpoints
    • Claims
    • Compliance
    • Context
    • CorporateAction
    • CorporateActions
    • Count
    • CurrentAccount
    • CurrentIdentity
    • DefaultPortfolio
    • DefaultTrustedClaimIssuer
    • Distributions
    • DividendDistribution
    • Documents
    • Entity
    • Identity
    • IdentityAuthorizations
    • Instruction
    • Issuance
    • Middleware
    • NumberedPortfolio
    • Offerings
    • Percentage
    • Polymesh
    • PolymeshError
    • PolymeshTransaction
    • PolymeshTransactionBase
    • PolymeshTransactionBatch
    • Portfolio
    • Portfolios
    • Requirements
    • Schedules
    • SecurityToken
    • Settlements
    • Sto
    • TickerReservation
    • TokenHolders
    • TransactionQueue
    • TransferRestrictionBase
    • TransferRestrictions
    • TrustedClaimIssuers
    • Venue
  • Enums
    • AffirmationStatus
    • AuthorizationType
    • CalendarUnit
    • ClaimType
    • ConditionTarget
    • ConditionType
    • CorporateActionKind
    • CountryCode
    • ErrorCode
    • InstructionStatus
    • InstructionType
    • KnownTokenType
    • ProposalStage
    • RoleType
    • ScopeType
    • StoBalanceStatus
    • StoSaleStatus
    • StoTimingStatus
    • TargetTreatment
    • TickerReservationStatus
    • TokenIdentifierType
    • TransactionArgumentType
    • TransactionQueueStatus
    • TransactionStatus
    • TransferError
    • TransferRestrictionType
    • TransferStatus
    • TxGroup
    • VenueType
  • Interfaces
    • AccountData
    • ActiveTransferRestrictions
    • AddBatchTransactionOpts
    • AddClaimsParams
    • AddInstructionParams
    • AddInstructionsParams
    • AddInvestorUniquenessClaimParams
    • AddTransactionOpts
    • AddTransactionOptsBase
    • ArrayTransactionArgument
    • Balance
    • CalendarPeriod
    • CddProviderRole
    • CheckpointWithData
    • ClaimClassicTickerParams
    • ClaimData
    • ClaimScope
    • ClaimTarget
    • ComplexTransactionArgument
    • ConditionCompliance
    • ConnectParamsBase
    • ConstructorParams
    • ConsumeParams
    • ControllerTransferParams
    • CorporateActionDefaults
    • CorporateActionTargets
    • CountTransferRestriction
    • CountTransferRestrictionInput
    • CreateCheckpointScheduleParams
    • CreateSecurityTokenParams
    • CreateVenueParams
    • DeletePortfolioParams
    • DistributionParticipant
    • DistributionPayment
    • DistributionWithDetails
    • DividendDistributionDetails
    • DividendDistributionParams
    • EditClaimsParams
    • EventIdentifier
    • ExtrinsicData
    • Fees
    • HistoricSettlement
    • IdentityBalance
    • IdentityWithClaims
    • InstructionAffirmation
    • InvestInStoParams
    • Investment
    • InviteAccountParams
    • IssueTokensParams
    • KeyringPair
    • LeaveIdentityParams
    • Leg
    • LinkCaDocsParams
    • MiddlewareConfig
    • ModifyCorporateActionsAgentParams
    • ModifyInstructionAffirmationParams
    • ModifyPrimaryIssuanceAgentParams
    • ModifySignerPermissionsParams
    • ModifyTokenTrustedClaimIssuersAddSetParams
    • ModifyTokenTrustedClaimIssuersRemoveParams
    • MoveFundsParams
    • NetworkProperties
    • PaginationOptions
    • PayDividendsParams
    • PercentageTransferRestriction
    • PercentageTransferRestrictionInput
    • Permissions
    • PermissionsLike
    • PlainTransactionArgument
    • PortfolioBalance
    • PortfolioCustodianRole
    • PortfolioMovement
    • ProcedureAuthorizationStatus
    • ProcedureMethod
    • ProposalDetails
    • ProposalTimeFrames
    • ProposalVote
    • RedeemTokenParams
    • RegisterIdentityParams
    • RemoveCheckpointScheduleParams
    • RemoveCorporateActionParams
    • RemoveSecondaryKeysParams
    • RenamePortfolioParams
    • Requirement
    • RequirementCompliance
    • ReserveTickerParams
    • ResultSet
    • RevokeClaimsParams
    • ScheduleDetails
    • ScheduleWithDetails
    • Scope
    • SecondaryKey
    • SecurityTokenDetails
    • SetAssetRequirementsParams
    • SetCountTransferRestrictionsParams
    • SetCustodianParams
    • SetPercentageTransferRestrictionsParams
    • SetTokenDocumentsParams
    • SettlementLeg
    • SimpleEnumTransactionArgument
    • StoDetails
    • StoStatus
    • StoTier
    • StoWithDetails
    • TaxWithholding
    • TickerOwnerRole
    • TickerReservationDetails
    • Tier
    • ToggleFreezeSecondaryKeysParams
    • ToggleFreezeStoParams
    • ToggleFreezeTransfersParams
    • TogglePauseRequirementsParams
    • TokenCaaRole
    • TokenDocument
    • TokenIdentifier
    • TokenOwnerRole
    • TokenPiaRole
    • TransferBreakdown
    • TransferPolyxParams
    • TransferRestriction
    • TransferRestrictionInputBase
    • TransferRestrictionResult
    • TransferTickerOwnershipParams
    • TransferTokenOwnershipParams
    • TrustedClaimIssuer
    • UiKeyring
    • UniqueIdentifiers
    • VenueDetails
    • VenueOwnerRole
Powered by GitBook
On this page
  • Hierarchy
  • Index
  • Properties
  • Accessors
  • Methods
  • Properties
  • Optional currentPair
  • isArchiveNode
  • polymeshApi
  • ss58Format
  • Accessors
  • middlewareApi
  • Methods
  • accountBalance
  • disconnect
  • getAccounts
  • getCurrentAccount
  • getCurrentIdentity
  • getCurrentPair
  • getInvalidDids
  • getLatestBlock
  • getSecondaryKeys
  • getSigner
  • getTransactionArguments
  • getTransactionFees
  • isMiddlewareAvailable
  • isMiddlewareEnabled
  • issuedClaims
  • queryMiddleware
  • setPair
  • Static create

Was this helpful?

  1. Classes

Context

Context in which the SDK is being used

  • Holds the current low level API

  • Holds the current keyring pair

  • Holds the current Identity

Hierarchy

  • Context

Index

Properties

  • currentPair

  • isArchiveNode

  • polymeshApi

  • ss58Format

Accessors

  • middlewareApi

Methods

  • accountBalance

  • disconnect

  • getAccounts

  • getCurrentAccount

  • getCurrentIdentity

  • getCurrentPair

  • getInvalidDids

  • getLatestBlock

  • getSecondaryKeys

  • getSigner

  • getTransactionArguments

  • getTransactionFees

  • isMiddlewareAvailable

  • isMiddlewareEnabled

  • issuedClaims

  • queryMiddleware

  • setPair

  • create

Properties

Optional currentPair

• currentPair? : KeyringPair

Defined in src/base/Context.ts:111

isArchiveNode

• isArchiveNode: boolean = false

Defined in src/base/Context.ts:116

Whether the current node is an archive node (contains a full history from genesis onward) or not

polymeshApi

• polymeshApi: ApiPromise

Defined in src/base/Context.ts:109

ss58Format

• ss58Format: number = DEFAULT_SS58_FORMAT

Defined in src/base/Context.ts:118

Accessors

middlewareApi

• get middlewareApi(): ApolloClient‹NormalizedCacheObject›

Defined in src/base/Context.ts:936

Retrieve the middleware client

throws if the middleware is not enabled

Returns: ApolloClient‹NormalizedCacheObject›

Methods

accountBalance

▸ accountBalance(account?: string | Account): Promise‹AccountBalance›

Defined in src/base/Context.ts:293

Retrieve the account level POLYX balance

note can be subscribed to

Parameters:

Name

Type

account?

Returns: Promise‹AccountBalance›

▸ accountBalance(account: string | Account | undefined, callback: SubCallback‹AccountBalance›): Promise‹UnsubCallback›

Defined in src/base/Context.ts:294

Retrieve the account level POLYX balance

note can be subscribed to

Parameters:

Name

Type

account

callback

Returns: Promise‹UnsubCallback›

disconnect

▸ disconnect(): Promise‹void›

Defined in src/base/Context.ts:1006

Disconnect the Polkadot API, middleware, and render this instance unusable

note after disconnecting, trying to access any property in this objecct will result in an error

Returns: Promise‹void›

getAccounts

▸ getAccounts(): Array‹AccountData›

Defined in src/base/Context.ts:265

Retrieve a list of addresses associated with the account

Returns: Array‹AccountData›

getCurrentAccount

▸ getCurrentAccount(): CurrentAccount

Defined in src/base/Context.ts:355

Retrieve current Account

throws if there is no current account associated to the SDK instance

Returns: CurrentAccount

getCurrentIdentity

▸ getCurrentIdentity(): Promise‹CurrentIdentity›

Defined in src/base/Context.ts:375

Retrieve current Identity

throws if there is no Identity associated to the current Account (or there is no current Account associated to the SDK instance)

Returns: Promise‹CurrentIdentity›

getCurrentPair

▸ getCurrentPair(): KeyringPair

Defined in src/base/Context.ts:395

Retrieve current Keyring Pair

throws if there is no Account associated to the SDK instance

Returns: KeyringPair

getInvalidDids

▸ getInvalidDids(identities: (string | Identity‹›)[]): Promise‹string[]›

Defined in src/base/Context.ts:423

Check whether Identities exist

Parameters:

Name

Type

identities

Returns: Promise‹string[]›

getLatestBlock

▸ getLatestBlock(): Promise‹BigNumber›

Defined in src/base/Context.ts:994

Retrieve the latest block number

Returns: Promise‹BigNumber›

getSecondaryKeys

▸ getSecondaryKeys(): Promise‹SecondaryKey[]›

Defined in src/base/Context.ts:621

Retrieve the list of secondary keys related to the Account

note can be subscribed to

Returns: Promise‹SecondaryKey[]›

▸ getSecondaryKeys(callback: SubCallback‹SecondaryKey[]›): Promise‹UnsubCallback›

Defined in src/base/Context.ts:622

Parameters:

Name

Type

callback

Returns: Promise‹UnsubCallback›

getSigner

▸ getSigner(): AddressOrPair

Defined in src/base/Context.ts:410

Retrieve the signer address (or keyring pair)

Returns: AddressOrPair

getTransactionArguments

▸ getTransactionArguments(args: object): TransactionArgument[]

Defined in src/base/Context.ts:473

Retrieve the types of arguments that a certain transaction requires to be run

Parameters:

▪ args: object

Name

Type

Description

tag

TxTag

tag associated with the transaction that will be executed if the proposal passes

Returns: TransactionArgument[]

getTransactionFees

▸ getTransactionFees(tag: TxTag): Promise‹BigNumber›

Defined in src/base/Context.ts:446

Retrieve the protocol fees associated with running a specific transaction

Parameters:

Name

Type

Description

tag

TxTag

transaction tag (i.e. TxTags.asset.CreateAsset or "asset.createAsset")

Returns: Promise‹BigNumber›

isMiddlewareAvailable

▸ isMiddlewareAvailable(): Promise‹boolean›

Defined in src/base/Context.ts:981

Return whether the middleware is enabled and online

Returns: Promise‹boolean›

isMiddlewareEnabled

▸ isMiddlewareEnabled(): boolean

Defined in src/base/Context.ts:974

Return whether the middleware was enabled at startup

Returns: boolean

issuedClaims

▸ issuedClaims(opts: object): Promise‹ResultSet‹ClaimData››

Defined in src/base/Context.ts:885

Retrieve a list of claims. Can be filtered using parameters

note uses the middleware (optional)

Parameters:

▪Default value opts: object= {}

Name

Type

Description

claimTypes?

types of the claims to fetch. Defaults to any type

includeExpired?

undefined | false | true

whether to include expired claims. Defaults to true

size?

undefined | number

page size

start?

undefined | number

page offset

targets?

identities (or Identity IDs) for which to fetch claims (targets). Defaults to all targets

trustedClaimIssuers?

identity IDs of claim issuers. Defaults to all claim issuers

Returns: Promise‹ResultSet‹ClaimData››

queryMiddleware

▸ queryMiddleware‹Result›(query: GraphqlQuery‹unknown›): Promise‹ApolloQueryResult‹Result››

Defined in src/base/Context.ts:952

Make a query to the middleware server using the apollo client

Type parameters:

▪ Result: Partial‹Query›

Parameters:

Name

Type

query

GraphqlQuery‹unknown›

Returns: Promise‹ApolloQueryResult‹Result››

setPair

▸ setPair(address: string): Promise‹void›

Defined in src/base/Context.ts:275

Set a pair as the current account keyring pair

Parameters:

Name

Type

address

string

Returns: Promise‹void›

Static create

▸ create(params: object): Promise‹Context›

Defined in src/base/Context.ts:166

Create the Context instance

Parameters:

▪ params: object

Name

Type

accountMnemonic?

undefined | string

accountSeed?

undefined | string

accountUri?

undefined | string

keyring?

middlewareApi

ApolloClient‹NormalizedCacheObject› | null

polymeshApi

ApiPromise

Returns: Promise‹Context›

PreviousComplianceNextCorporateAction

Last updated 4 years ago

Was this helpful?

string |

string | | undefined

‹›

(string | ‹›)[]

‹[]›

‹, ›[]

(string | ‹›)[]

(string | ‹›)[]

|

Account
Account
SubCallback
AccountBalance
Identity
SubCallback
SecondaryKey
Exclude
ClaimType
InvestorUniquenessV2
Identity
Identity
CommonKeyring
UiKeyring