Skip to main content

getWalletTokenAllowances

Efficiently access a comprehensive list of spenders and the corresponding allowances granted by a specified wallet address, including all token contracts or a specific one if desired. Notably, the response is structured to present allowances in a reverse chronological order, with the most recent approvals at the forefront, allowing for efficient tracking and management. This API is paginated, response items are ordered descending by blockNumber and approvalIndex.

How to use getWalletTokenAllowances method ?

Below, you'll find an in-depth guide that provides a comprehensive explanation of how to utilize the getWalletTokenAllowances method effectively using Blast.

Parameters

FieldTypeDescription

walletAddress

*
stringThe address of the wallet
contractAddressstringThe address of the spender
pageSizenumberNumber of records to be retrieved on one page
pageKeystring

Key used to get the next page of results. Must be set to the value of nextPageKey returned in the previous response

Returns

Discover an insightful explanation of the returned parameters here, offering a deep understanding of their significance and implications.

FieldTypeDescription
walletAddressstringThe address of the wallet
countnumberThe number of allowances
nextPageKeystringKey used to get the next page of results. Must be set to the value of nextPageKey returned in the previous response
allowancesarrayThe array of Allowance objects
contractAddressstringThe token contract address
contractDecimalsstringToken decimals specified in the contract
contractNamestringThe name of the token
contractSymbolsstringThe name of the token
spenderAddressstringThe address of the spender
allowancestringThe amount allowed for spending
walletBalancestringThe balance of tokens for the wallet creating the allowance
blockHashstringThe hash of the block
blockTimestampstringThe timestamp of the block
transactionHashstringThe hash of the transaction
transactionIndexintegerThe number of the transaction
logIndexintegerThe index of the log

Example Request and Result for getWalletTokenAllowances

In this section, we not only provide an illustrative example of a request but also offer a detailed breakdown of the response. This example demonstrates how to retrieve the list of spenders and allowances granted by the given wallet address across all token contracts or a specific one using the getWalletTokenAllowances Builder API method. Developers can use this as a reference for crafting their own requests and parsing the returned data when working with the getWalletTokenAllowances method.

info

The example in this section uses a non-existing project id.

Make sure you replace it with your Starknet endpoint when issuing the Builder API calls.

Don't have a project id? Here's a straightforward guide on how to obtain one!

Curl request example

curl --location 'https://starknet-mainnet.blastapi.io/<project-id>/builder/getWalletTokenAllowances?walletAddress=0x03beccdb0e0e6a622923f4294ef3d4be58afa1e86ee7d65ba87013395df00846'