The WalletTokenErrors object represents tokens and associated errors. It provides token stats, including quantities and USD values, and holds tokens with retrieval errors.

In our SDK, tokens are represented by the WalletTokens object. This object encapsulates both the fetched tokens and any errors encountered during retrieval for the specified wallet.

export class WalletTokens {
  stats: Array<WalletTokenStats>;
  errors: Array<TokenError>;
}
@dataclass
class WalletTokens:
    stats: list[WalletTokenStats]
    errors: list[TokenError]

Within the stats field, you'll find a comprehensive list of the tokens held by the wallet, along with their corresponding quantities and USD values (if available).

export class WalletTokenStats {
  token: BaseToken;
  wallet: BaseWallet;
  usd_value: string | undefined;
  balance: string;
}
@dataclass
class WalletTokenStats:
    token: BaseToken
    wallet: BaseWallet
    usd_value: str | None
    balance: str

In the errors field, you'll find a list of tokens held by the wallet where we were unable to retrieve the balance amount or encountered other errors during the fetching process.

export class TokenError {
  token: SimpleToken;
  chain: ChainKeys;
}
@dataclass
class TokenError:
    token: SimpleToken
    chain: ChainKeys