Skip to content

token.list()

[Source]

List the MPTs an account holds or issued.

Signature

token.list(
  params?: TokenListParams
): Promise<TokenListResult>

Parameters

ParameterTypeRequiredDescription
role'holder' | 'issuer'NoList tokens the account holds or issued. Defaults to tokens held if omitted.
accountstringNoThe account to query. Defaults to the primary signer's account.

Returns

Resolves to a TokenListResult, where tokens[i] corresponds to data[i]:

FieldTypeDescription
tokensreadonly string[]The MPT issuance id of each token.
datareadonly TokenListEntry[]The shaped entries.

TokenListEntry

FieldTypeDescription
tokenIDstringThe MPT issuance id.
balancestring (optional)The account's balance (present for role: 'holder').
issuanceTokenData (optional)The full issuance snapshot (present for role: 'issuer'). See token.retrieve for TokenData.

Underlying XRPL request

Read-only — no signer is required and nothing is submitted. Queries the ledger with account_objects.

Example

const { data } = await client.token.list({ role: 'holder' })

for (const entry of data) {
  console.log(entry.tokenID, entry.balance)
}