Skip to main content
Version: 29.0.x

Class: Account

Defined in: src/api/entities/Account/index.ts:76

Represents an Account in the Polymesh blockchain. Accounts can hold POLYX, control Identities and vote on proposals (among other things)

Extends​

  • Entity<UniqueIdentifiers, string>

Extended by​

Properties​

address​

address: string

Defined in: src/api/entities/Account/index.ts:90

Polymesh-specific address of the Account. Serves as an identifier


authorizations​

authorizations: Authorizations<Account>

Defined in: src/api/entities/Account/index.ts:99


key​

key: string

Defined in: src/api/entities/Account/index.ts:96

A hex representation of the cryptographic public key of the Account. This is consistent across Substrate chains, while the address depends on the chain as well.


staking​

staking: Staking

Defined in: src/api/entities/Account/index.ts:101


subsidies​

subsidies: Subsidies

Defined in: src/api/entities/Account/index.ts:100


uuid​

uuid: string

Defined in: src/api/entities/Entity.ts:46

Inherited from​

Entity.uuid

Methods​

checkPermissions()​

checkPermissions(permissions: SimplePermissions): Promise<CheckPermissionsResult<Account>>

Defined in: src/api/entities/Account/index.ts:375

Check if this Account possesses certain Permissions to act on behalf of its corresponding Identity

Parameters​

ParameterType

permissions

SimplePermissions

Returns​

Promise<CheckPermissionsResult<Account>>

which permissions the Account is missing (if any) and the final result


exists()​

exists(): Promise<boolean>

Defined in: src/api/entities/Account/index.ts:458

Determine whether this Account exists on chain

Returns​

Promise<boolean>

Overrides​

Entity.exists


getBalance()​

Call Signature​

getBalance(): Promise<Balance>

Defined in: src/api/entities/Account/index.ts:125

Get the free/locked POLYX balance of the Account

Returns​

Promise<Balance>

Promise that resolves to the Account's POLYX balance information

Call Signature​

getBalance(callback: SubCallback<Balance>): Promise<UnsubCallback>

Defined in: src/api/entities/Account/index.ts:136

Get the free/locked POLYX balance of the Account (with subscription support)

Parameters​
ParameterTypeDescription

callback

SubCallback<Balance>

Callback function that receives balance updates

Returns​

Promise<UnsubCallback>

Promise that resolves to an unsubscribe function

Note​

can be subscribed to, if connected to node using a web socket


getCurrentNonce()​

getCurrentNonce(): Promise<BigNumber>

Defined in: src/api/entities/Account/index.ts:472

Retrieve the current nonce for this Account

Returns​

Promise<BigNumber>


getIdentity()​

getIdentity(): Promise<null | Identity>

Defined in: src/api/entities/Account/index.ts:155

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

Returns​

Promise<null | Identity>


getMultiSig()​

getMultiSig(): Promise<null | MultiSig>

Defined in: src/api/entities/Account/index.ts:430

Fetch the MultiSig this Account is part of. If this Account is not a signer on any MultiSig, return null

Returns​

Promise<null | MultiSig>


getNextAssetId()​

getNextAssetId(): Promise<string>

Defined in: src/api/entities/Account/index.ts:617

Returns next assetID that will be generated for this Identity

Returns​

Promise<string>


getOffChainReceipts()​

getOffChainReceipts(): Promise<BigNumber[]>

Defined in: src/api/entities/Account/index.ts:590

Returns all off chain receipts used by this Account

Returns​

Promise<BigNumber[]>


getPendingProposals()​

getPendingProposals(): Promise<MultiSigProposal[]>

Defined in: src/api/entities/Account/index.ts:574

Returns pending MultiSig proposals for this Account

Returns​

Promise<MultiSigProposal[]>

Note​

uses the middleware

Throws​

if the Account is not a signer on any MultiSig


getPermissions()​

getPermissions(): Promise<Permissions>

Defined in: src/api/entities/Account/index.ts:322

Retrieve the Permissions this Account has as a Permissioned Account for its corresponding Identity

Returns​

Promise<Permissions>

Throws​

if there is no Identity associated with the Account


getPolyxTransactions()​

getPolyxTransactions(filters: object): Promise<ResultSet<HistoricPolyxTransaction>>

Defined in: src/api/entities/Account/index.ts:556

Returns POLYX transactions associated with this account

Parameters​

ParameterTypeDescription

filters

{ size?: BigNumber; start?: BigNumber; }

‐

filters.size?

BigNumber

page size

filters.start?

BigNumber

page offset

Returns​

Promise<ResultSet<HistoricPolyxTransaction>>

Note​

uses the middleware


getTransactionHistory()​

getTransactionHistory(filters: object): Promise<ResultSet<ExtrinsicData>>

Defined in: src/api/entities/Account/index.ts:191

Retrieve a list of transactions signed by this Account. Can be filtered using parameters

Parameters​

ParameterTypeDescription

filters

{ blockHash?: string; blockNumber?: BigNumber; orderBy?: ExtrinsicsOrderBy; size?: BigNumber; start?: BigNumber; success?: boolean; tag?: TxTag; }

‐

filters.blockHash?

string

‐

filters.blockNumber?

BigNumber

‐

filters.orderBy?

ExtrinsicsOrderBy

‐

filters.size?

BigNumber

page size

filters.start?

BigNumber

page offset

filters.success?

boolean

whether the transaction was successful or not

filters.tag?

TxTag

tag associated with the transaction

Returns​

Promise<ResultSet<ExtrinsicData>>

Note​

if both blockNumber and blockHash are passed, only blockNumber is taken into account. Also, for ordering by block_id, one should pass ExtrinsicsOrderBy.BlockIdAsc or ExtrinsicsOrderBy.BlockIdDesc in order of their choice (since block ID is a string field in middleware v2)

Note​

uses the middleware v2


getTypeInfo()​

getTypeInfo(): Promise<AccountTypeInfo>

Defined in: src/api/entities/Account/index.ts:493

Retrieve the type of Account, and its relation to an Identity, if applicable

Returns​

Promise<AccountTypeInfo>


isEqual()​

isEqual(entity: Entity<unknown, unknown>): boolean

Defined in: src/api/entities/Entity.ts:61

Determine whether this Entity is the same as another one

Parameters​

ParameterType

entity

Entity<unknown, unknown>

Returns​

boolean

Inherited from​

Entity.isEqual


isFrozen()​

isFrozen(): Promise<boolean>

Defined in: src/api/entities/Account/index.ts:301

Check whether this Account is frozen. If frozen, it cannot perform any Identity related action until the primary Account of the Identity unfreezes all secondary Accounts

Returns​

Promise<boolean>

Note​

returns false if the Account isn't associated to any Identity


toHuman()​

toHuman(): string

Defined in: src/api/entities/Account/index.ts:465

Return the Account's address

Returns​

string

Overrides​

Entity.toHuman


generateUuid()​

static generateUuid<Identifiers>(identifiers: Identifiers): string

Defined in: src/api/entities/Entity.ts:14

Generate the Entity's UUID from its identifying properties

Type Parameters​

Type Parameter

Identifiers

Parameters​

ParameterTypeDescription

identifiers

Identifiers

Returns​

string

Inherited from​

Entity.generateUuid


unserialize()​

static unserialize<Identifiers>(serialized: string): Identifiers

Defined in: src/api/entities/Entity.ts:23

Unserialize a UUID into its Unique Identifiers

Type Parameters​

Type Parameter

Identifiers

Parameters​

ParameterTypeDescription

serialized

string

UUID to unserialize

Returns​

Identifiers

Inherited from​

Entity.unserialize