Polymesh SDK API Reference
v8.0.0
v8.0.0
  • Introduction
  • Globals
  • Classes
    • Account
    • Agent
    • AuthorizationRequest
    • Authorizations
    • Checkpoint
    • CheckpointSchedule
    • Checkpoints
    • Claims
    • Compliance
    • Context
    • CorporateAction
    • CorporateActions
    • Count
    • CurrentAccount
    • CurrentIdentity
    • 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
    • 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
    • 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
    • SetPercentageTransferRestrictionsParams
    • SetTokenDocumentsParams
    • SettlementLeg
    • SignerValue
    • SimpleEnumTransactionArgument
    • SimplePermissions
    • StoDetails
    • StoStatus
    • StoTier
    • StoWithDetails
    • TaxWithholding
    • TickerOwnerRole
    • TickerReservationDetails
    • Tier
    • ToggleFreezeSecondaryKeysParams
    • ToggleFreezeStoParams
    • ToggleFreezeTransfersParams
    • TogglePauseRequirementsParams
    • TokenDocument
    • TokenIdentifier
    • TransactionPermissions
    • 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
  • addPair
  • clone
  • disconnect
  • getAccounts
  • getCurrentAccount
  • getCurrentIdentity
  • getCurrentPair
  • getInvalidDids
  • getLatestBlock
  • getSigner
  • getTransactionArguments
  • getTransactionFees
  • isMiddlewareAvailable
  • isMiddlewareEnabled
  • issuedClaims
  • queryMiddleware
  • setPair
  • Static create

Was this helpful?

  1. Classes

Context

PreviousComplianceNextCorporateAction

Last updated 3 years ago

Was this helpful?

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

Accessors

Methods

Properties

Optional currentPair

isArchiveNode

• isArchiveNode: boolean = false

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

polymeshApi

• polymeshApi: ApiPromise

ss58Format

• ss58Format: number

Accessors

middlewareApi

• get middlewareApi(): ApolloClient‹NormalizedCacheObject›

Retrieve the middleware client

throws if the middleware is not enabled

Returns: ApolloClient‹NormalizedCacheObject›

Methods

accountBalance

Retrieve the account level POLYX balance

note can be subscribed to

Parameters:

Name

Type

account?

Retrieve the account level POLYX balance

note can be subscribed to

Parameters:

Name

Type

account

callback

addPair

Add a signing pair to the Keyring

Parameters:

Name

Type

params

clone

Returns a (shallow) clone of this instance. Useful for providing a separate Context to Procedures with different signers

disconnect

▸ disconnect(): Promise‹void›

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

Retrieve a list of Accounts that can act as signers

Returns: []

getCurrentAccount

Retrieve current Account

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

getCurrentIdentity

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)

getCurrentPair

Retrieve current Keyring Pair

throws if there is no Account associated to the SDK instance

getInvalidDids

Check whether Identities exist

Parameters:

Name

Type

identities

Returns: Promise‹string[]›

getLatestBlock

▸ getLatestBlock(): Promise‹BigNumber›

Retrieve the latest block number

Returns: Promise‹BigNumber›

getSigner

â–¸ getSigner(): AddressOrPair

Retrieve the signer address (or keyring pair)

Returns: AddressOrPair

getTransactionArguments

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

getTransactionFees

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

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›

Return whether the middleware is enabled and online

Returns: Promise‹boolean›

isMiddlewareEnabled

â–¸ isMiddlewareEnabled(): boolean

Return whether the middleware was enabled at startup

Returns: boolean

issuedClaims

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

queryMiddleware

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

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

Set a pair as the current Account keyring pair

Parameters:

Name

Type

address

string

Returns: void

Static create

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

• currentPair? :

Defined in

Defined in

Defined in

Defined in

Defined in

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

Defined in

string |

Returns: Promise‹›

▸ accountBalance(account: string | | undefined, callback: ‹›): Promise‹›

Defined in

string | | undefined

‹›

Returns: Promise‹›

â–¸ addPair(params: ):

Defined in

Returns:

â–¸ clone():

Defined in

Returns:

Defined in

Defined in

â–¸ getCurrentAccount():

Defined in

Returns:

▸ getCurrentIdentity(): Promise‹›

Defined in

Returns: Promise‹›

â–¸ getCurrentPair():

Defined in

Returns:

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

Defined in

(string | ‹›)[]

Defined in

Defined in

â–¸ getTransactionArguments(args: object): []

Defined in

Returns: []

Defined in

Defined in

Defined in

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

Defined in

‹, ›[]

(string | ‹›)[]

(string | ‹›)[]

Returns: Promise‹‹››

Defined in

Defined in

▸ create(params: object): Promise‹›

Defined in

|

Returns: Promise‹›

KeyringPair
src/base/Context.ts:114
src/base/Context.ts:119
src/base/Context.ts:112
src/base/Context.ts:121
src/base/Context.ts:953
src/base/Context.ts:344
src/base/Context.ts:345
src/base/Context.ts:284
KeyringPair
Context
src/base/Context.ts:1041
Context
src/base/Context.ts:1023
src/base/Context.ts:261
CurrentAccount
src/base/Context.ts:406
CurrentAccount
CurrentIdentity
src/base/Context.ts:426
CurrentIdentity
KeyringPair
src/base/Context.ts:446
KeyringPair
Identity
src/base/Context.ts:475
src/base/Context.ts:1011
src/base/Context.ts:462
src/base/Context.ts:525
src/base/Context.ts:498
src/base/Context.ts:998
src/base/Context.ts:991
ResultSet
ClaimData
src/base/Context.ts:902
ResultSet
ClaimData
src/base/Context.ts:969
src/base/Context.ts:326
Context
src/base/Context.ts:182
Context
currentPair
isArchiveNode
polymeshApi
ss58Format
middlewareApi
accountBalance
addPair
clone
disconnect
getAccounts
getCurrentAccount
getCurrentIdentity
getCurrentPair
getInvalidDids
getLatestBlock
getSigner
getTransactionArguments
getTransactionFees
isMiddlewareAvailable
isMiddlewareEnabled
issuedClaims
queryMiddleware
setPair
create
Account
Account
Identity
Identity
Identity
Account
Account
KeyringPair
ClaimType
UiKeyring
AccountBalance
AccountBalance
SubCallback
AccountBalance
UnsubCallback
UnsubCallback
AddPairParams
TransactionArgument
TransactionArgument
SubCallback
AccountBalance
AddPairParams
CommonKeyring
Exclude
InvestorUniquenessV2