Request all available tokens and their balances, manage token approvals and more.
getTokens
params
(TokensRequest, optional): Configuration for the requested tokens.
chains
(ChainId[], optional): List of chain IDs or keys. If not specified, returns tokens on all available chains.
chainTypes
(ChainType[], optional): List of chain types.
options
(RequestOptions, optional): Additional request options.
TokensResponse
getToken
chain
(ChainKey | ChainId): ID or key of the chain that contains the token.
token
(string): Address or symbol of the token on the requested chain.
options
(RequestOptions, optional): Additional request options.
Token
object.
getTokenBalance
walletAddress
(string): A wallet address.
token
(Token): A Token object.
TokenAmount
or null
.
getTokenBalances
walletAddress
(string): A wallet address.
tokens
(Token[]): A list of Token objects.
TokenAmount
objects.
getTokenBalancesByChain
walletAddress
(string): A wallet address.
tokensByChain
[chainId: number]: Token[]: A list of Token objects organized by chain IDs.
getTokenAllowance
token
(BaseToken): The token for which to check the allowance.
ownerAddress
(string): The owner of the token.
spenderAddress
(string): The spender address that was approved.
bigint
representing the allowance or undefined if the token is a native token.
getTokenAllowanceMulticall
ownerAddress
(string): The owner of the tokens.
tokens
(TokenSpender[]): A list of token and spender address pairs.
TokenAllowance
objects.
setTokenAllowance
request
(ApproveTokenRequest): The approval request.
walletClient
(WalletClient): The wallet client used to send the transaction.
token
(BaseToken): The token for which to set the allowance.
spenderAddress
(string): The address of the spender.
amount
(bigint): The amount of tokens to approve.
infiniteApproval
(boolean, optional): If true, sets the approval to the maximum uint256 value.
Hash
representing the transaction hash or void
if no transaction is needed (e.g., for native tokens).
revokeTokenApproval
request
(RevokeApprovalRequest): The revoke request.
walletClient
(WalletClient): The wallet client used to send the transaction.
token
(BaseToken): The token for which to revoke the allowance.
spenderAddress
(string): The address of the spender.
Hash
representing the transaction hash or void
if no transaction is needed (e.g., for native tokens).