List the MPTs an account holds or issued.
token.list(
params?: TokenListParams
): Promise<TokenListResult>| Parameter | Type | Required | Description |
|---|---|---|---|
role | 'holder' | 'issuer' | No | List tokens the account holds or issued. Defaults to tokens held if omitted. |
account | string | No | The account to query. Defaults to the primary signer's account. |
Resolves to a TokenListResult, where tokens[i] corresponds to data[i]:
| Field | Type | Description |
|---|---|---|
tokens | readonly string[] | The MPT issuance id of each token. |
data | readonly TokenListEntry[] | The shaped entries. |
| Field | Type | Description |
|---|---|---|
tokenID | string | The MPT issuance id. |
balance | string (optional) | The account's balance (present for role: 'holder'). |
issuance | TokenData (optional) | The full issuance snapshot (present for role: 'issuer'). See token.retrieve for TokenData. |
Read-only — no signer is required and nothing is submitted. Queries the ledger with account_objects.
const { data } = await client.token.list({ role: 'holder' })
for (const entry of data) {
console.log(entry.tokenID, entry.balance)
}