api.entities.Account - PolymeshAssociation/polymesh-sdk GitHub Wiki
@polymeshassociation/polymesh-sdk / api/entities/Account
Defined in: api/entities/Account/index.ts:96
Represents an Account in the Polymesh blockchain. Accounts can hold POLYX, control Identities and vote on proposals (among other things)
-
Entity<UniqueIdentifiers,string>
address:
string
Defined in: api/entities/Account/index.ts:110
Polymesh-specific address of the Account. Serves as an identifier
authorizations:
Authorizations<Account>
Defined in: api/entities/Account/index.ts:119
key:
string
Defined in: api/entities/Account/index.ts:116
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
Defined in: api/entities/Account/index.ts:121
subsidies:
Subsidies
Defined in: api/entities/Account/index.ts:120
uuid:
string
Defined in: api/entities/Entity.ts:46
checkPermissions(
permissions):Promise<CheckPermissionsResult<Account>>
Defined in: api/entities/Account/index.ts:394
Check if this Account possesses certain Permissions to act on behalf of its corresponding Identity
| Parameter | Type |
|---|---|
permissions |
SimplePermissions |
Promise<CheckPermissionsResult<Account>>
which permissions the Account is missing (if any) and the final result
exists():
Promise<boolean>
Defined in: api/entities/Account/index.ts:477
Determine whether this Account exists on chain
Promise<boolean>
getAssetBalances(
args?):Promise<PortfolioBalance[]>
Defined in: api/entities/Account/index.ts:676
Retrieve the balances of all fungible assets in this Account
| Parameter | Type | Description |
|---|---|---|
args? |
{ assets: (string | FungibleAsset)[]; } |
- |
args.assets? |
(string | FungibleAsset)[] |
array of FungibleAssets (or tickers) for which to fetch balances (optional, all balances are retrieved if not passed) |
Promise<PortfolioBalance[]>
getBalance():
Promise<AccountBalance>
Defined in: api/entities/Account/index.ts:145
Get the free/locked POLYX balance of the Account
Promise<AccountBalance>
Promise that resolves to the Account's POLYX balance information
getBalance(
callback):Promise<UnsubCallback>
Defined in: api/entities/Account/index.ts:156
Get the free/locked POLYX balance of the Account (with subscription support)
| Parameter | Type | Description |
|---|---|---|
callback |
SubCallback<AccountBalance> |
Callback function that receives balance updates |
Promise<UnsubCallback>
Promise that resolves to an unsubscribe function
can be subscribed to, if connected to node using a web socket
getCollections(
args?):Promise<PortfolioCollection[]>
Defined in: api/entities/Account/index.ts:756
Retrieve the NFTs held in this Account
| Parameter | Type | Description |
|---|---|---|
args? |
{ collections: (string | NftCollection)[]; } |
- |
args.collections? |
(string | NftCollection)[] |
array of NftCollection (or tickers) for which to fetch holdings (optional, all holdings are retrieved if not passed) |
Promise<PortfolioCollection[]>
getCurrentNonce():
Promise<BigNumber>
Defined in: api/entities/Account/index.ts:491
Retrieve the current nonce for this Account
Promise<BigNumber>
getIdentity():
Promise<Identity|null>
Defined in: api/entities/Account/index.ts:175
Retrieve the Identity associated to this Account (null if there is none)
Promise<Identity | null>
getMultiSig():
Promise<MultiSig|null>
Defined in: api/entities/Account/index.ts:449
Fetch the MultiSig this Account is part of. If this Account is not a signer on any MultiSig, return null
Promise<MultiSig | null>
getNextAssetId():
Promise<string>
Defined in: api/entities/Account/index.ts:629
Returns next assetID that will be generated for this Identity
Promise<string>
getOffChainReceipts():
Promise<BigNumber[]>
Defined in: api/entities/Account/index.ts:602
Returns all off chain receipts used by this Account
Promise<BigNumber[]>
getPendingProposals():
Promise<MultiSigProposal[]>
Defined in: api/entities/Account/index.ts:586
Returns pending MultiSig proposals for this Account
Promise<MultiSigProposal[]>
uses the middleware
if the Account is not a signer on any MultiSig
getPermissions():
Promise<Permissions>
Defined in: api/entities/Account/index.ts:341
Retrieve the Permissions this Account has as a Permissioned Account for its corresponding Identity
Promise<Permissions>
if there is no Identity associated with the Account
getPolyxTransactions(
filters):Promise<ResultSet<HistoricPolyxTransaction>>
Defined in: api/entities/Account/index.ts:568
Returns POLYX transactions associated with this account
| Parameter | Type | Description |
|---|---|---|
filters |
{ size?: BigNumber; start?: BigNumber; } |
- |
filters.size? |
BigNumber |
page size |
filters.start? |
BigNumber |
page offset |
Promise<ResultSet<HistoricPolyxTransaction>>
uses the middleware
getTransactionHistory(
filters?):Promise<ResultSet<ExtrinsicData>>
Defined in: api/entities/Account/index.ts:211
Retrieve a list of transactions signed by this Account. Can be filtered using parameters
| Parameter | Type | Description |
|---|---|---|
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 |
Promise<ResultSet<ExtrinsicData>>
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)
uses the middleware v2
getTypeInfo():
Promise<AccountTypeInfo>
Defined in: api/entities/Account/index.ts:512
Retrieve the type of Account, and its relation to an Identity, if applicable
Promise<AccountTypeInfo>
isEqual(
entity):boolean
Defined in: api/entities/Entity.ts:61
Determine whether this Entity is the same as another one
| Parameter | Type |
|---|---|
entity |
Entity<unknown, unknown> |
boolean
isFrozen():
Promise<boolean>
Defined in: api/entities/Account/index.ts:320
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
Promise<boolean>
returns false if the Account isn't associated to any Identity
toHuman():
string
Defined in: api/entities/Account/index.ts:484
Return the Account's address
string
staticgenerateUuid<Identifiers>(identifiers):string
Defined in: api/entities/Entity.ts:14
Generate the Entity's UUID from its identifying properties
| Type Parameter |
|---|
Identifiers |
| Parameter | Type | Description |
|---|---|---|
identifiers |
Identifiers |
- |
string
staticunserialize<Identifiers>(serialized):Identifiers
Defined in: api/entities/Entity.ts:23
Unserialize a UUID into its Unique Identifiers
| Type Parameter |
|---|
Identifiers |
| Parameter | Type | Description |
|---|---|---|
serialized |
string |
UUID to unserialize |
Identifiers