Skip to main content
Version: 21.0.x

Class: Account

api/entities/Account.Account

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

Hierarchy

Properties

address

address: string

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

Defined in

api/entities/Account/index.ts:81


authorizations

authorizations: Authorizations<Account>

Defined in

api/entities/Account/index.ts:90


key

key: string

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.

Defined in

api/entities/Account/index.ts:87


subsidies

subsidies: Subsidies

Defined in

api/entities/Account/index.ts:91


uuid

uuid: string

Inherited from

Entity.uuid

Defined in

api/entities/Entity.ts:46

Methods

checkPermissions

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

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

Parameters

NameType
permissionsSimplePermissions

Returns

Promise<CheckPermissionsResult<Account>>

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


exists

exists(): Promise<boolean>

Determine whether this Account exists on chain

Returns

Promise<boolean>

Overrides

Entity.exists


getBalance

getBalance(): Promise<Balance>

Get the free/locked POLYX balance of the Account

Note

can be subscribed to

Returns

Promise<Balance>

getBalance(callback): Promise<UnsubCallback>

Parameters

NameType
callbackSubCallback<Balance>

Returns

Promise<UnsubCallback>


getCurrentNonce

getCurrentNonce(): Promise<BigNumber>

Retrieve the current nonce for this Account

Returns

Promise<BigNumber>


getIdentity

getIdentity(): Promise<null | Identity>

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

Returns

Promise<null | Identity>


getMultiSig

getMultiSig(): Promise<null | MultiSig>

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

Returns

Promise<null | MultiSig>


getPermissions

getPermissions(): Promise<Permissions>

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

Throws

if there is no Identity associated with the Account

Returns

Promise<Permissions>


getSubsidy

getSubsidy(): Promise<null | SubsidyWithAllowance>

Get the subsidized balance of this Account and the subsidizer Account. If this Account isn't being subsidized, return null

Note

can be subscribed to

Deprecated

in favour of subsidies.getSubsidizer

Returns

Promise<null | SubsidyWithAllowance>

getSubsidy(callback): Promise<UnsubCallback>

Parameters

NameType
callbackSubCallback<null | SubsidyWithAllowance>

Returns

Promise<UnsubCallback>


getTransactionHistory

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

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

Note

if both blockNumber and blockHash are passed, only blockNumber is taken into account

Note

uses the middleware

Parameters

NameTypeDescription
filtersObject-
filters.blockHash?string-
filters.blockNumber?BigNumber-
filters.orderBy?TransactionOrderByInput-
filters.size?BigNumberpage size
filters.start?BigNumberpage offset
filters.success?booleanwhether the transaction was successful or not
filters.tag?TxTagtag associated with the transaction

Returns

Promise<ResultSet<ExtrinsicData>>


getTransactionHistoryV2

getTransactionHistoryV2(filters?): Promise<ResultSet<ExtrinsicData>>

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

Note

if both blockNumber and blockHash are passed, only blockNumber is taken into account

Note

uses the middlewareV2

Parameters

NameTypeDescription
filtersObject-
filters.blockHash?string-
filters.blockNumber?BigNumber-
filters.orderBy?ExtrinsicsOrderBy-
filters.size?BigNumberpage size
filters.start?BigNumberpage offset
filters.success?booleanwhether the transaction was successful or not
filters.tag?TxTagtag associated with the transaction

Returns

Promise<ResultSet<ExtrinsicData>>


getTypeInfo

getTypeInfo(): Promise<AccountTypeInfo>

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

Returns

Promise<AccountTypeInfo>


isEqual

isEqual(entity): boolean

Determine whether this Entity is the same as another one

Parameters

NameType
entityEntity<unknown, unknown>

Returns

boolean

Inherited from

Entity.isEqual


isFrozen

isFrozen(): Promise<boolean>

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

Note

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

Returns

Promise<boolean>


toHuman

toHuman(): string

Return the Account's address

Returns

string

Overrides

Entity.toHuman


generateUuid

Static generateUuid<Identifiers>(identifiers): string

Generate the Entity's UUID from its identifying properties

Type parameters

Name
Identifiers

Parameters

NameType
identifiersIdentifiers

Returns

string

Inherited from

Entity.generateUuid


unserialize

Static unserialize<Identifiers>(serialized): Identifiers

Unserialize a UUID into its Unique Identifiers

Type parameters

Name
Identifiers

Parameters

NameTypeDescription
serializedstringUUID to unserialize

Returns

Identifiers

Inherited from

Entity.unserialize