getWalletTokenAllowances

Get the list of spenders and allowances granted by the given wallet address across all token contracts or a specific one.

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 *

string

The address of the wallet

contractAddress

string

The address of the spender

pageSize

number

Number of records to be retrieved on one page

pageKey

string

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

walletAddress

string

The address of the wallet

count

number

The number of allowances

nextPageKey

string

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

allowances

array

The array of Allowance objects

contractAddress

string

The token contract address

contractDecimals

string

Token decimals specified in the contract

contractName

string

The name of the token

contractSymbols

string

The name of the token

spenderAddress

string

The address of the spender

allowance

string

The amount allowed for spending

walletBalance

string

The balance of tokens for the wallet creating the allowance

blockHash

string

The hash of the block

blockTimestamp

string

The timestamp of the block

transactionHash

string

The hash of the transaction

transactionIndex

integer

The number of the transaction

logIndex

integer

The 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.

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!

GET https://eth-mainnet.blastapi.io/<project-id>/builder/getWalletTokenAllowances?

Query Parameters

NameTypeDescription

walletAddress*

String

0x03beccdb0e0e6a622923f4294ef3d4be58afa1e86ee7d65ba87013395df00846

{
  "walletAddress": "0x03beccdb0e0e6a622923f4294ef3d4be58afa1e86ee7d65ba87013395df00846",
  "count": 16,
  "tokenAllowances": [
    {
      "contractAddress": "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8",
      "contractDecimals": "6",
      "contractName": "USD Coin",
      "contractSymbol": "USDC",
      "spenderAddress": "0x01114c7103e12c2b2ecbd3a2472ba9c48ddcbf702b1c242dd570057e26212111",
      "allowance": "11291410",
      "walletBalance": "0",
      "blockHash": "0x06280a4cdc303e4d677b7d4a5c1e7ce6e7d0772f351e8843541fb0d599e5306e",
      "blockNumber": 469599,
      "blockTimestamp": "2023-12-14T13:34:22.000Z",
      "transactionHash": "0x06c84d14bcce03577a85d42f89e1ffbf8b2fe13fbb51f60b116a8f019b7ee2ec"
    },
    {
      "contractAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
      "contractDecimals": "18",
      "contractName": "Ether",
      "contractSymbol": "ETH",
      "spenderAddress": "0x01114c7103e12c2b2ecbd3a2472ba9c48ddcbf702b1c242dd570057e26212111",
      "allowance": "5000000000000000",
      "walletBalance": "13074810394533563",
      "blockHash": "0x00d3137abc9d161332cc04f9ea87b2d9962c7bf36ae25377549db6eb682b503d",
      "blockNumber": 469598,
      "blockTimestamp": "2023-12-14T13:32:48.000Z",
      "transactionHash": "0x01bd0220182c09076278de933d7088574e687ca14c524e6262e93a5960c36357"
    },
    {
      "contractAddress": "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8",
      "contractDecimals": "6",
      "contractName": "USD Coin",
      "contractSymbol": "USDC",
      "spenderAddress": "0x00f6f4cf62e3c010e0ac2451cc7807b5eec19a40b0faacd00cca3914280fdf5a",
      "allowance": "10264918",
      "walletBalance": "0",
      "blockHash": "0x00cd4e407dcb164b284bbc874a7057dd3d2db279ada2ca31768681911d6368aa",
      "blockNumber": 445120,
      "blockTimestamp": "2023-11-29T12:32:37.000Z",
      "transactionHash": "0x05f831d3d199ef134e4b6dac2bdf3be7e71a669aade16d69a7a4548739060d0d"
    },
    {
      "contractAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
      "contractDecimals": "18",
      "contractName": "Ether",
      "contractSymbol": "ETH",
      "spenderAddress": "0x00f6f4cf62e3c010e0ac2451cc7807b5eec19a40b0faacd00cca3914280fdf5a",
      "allowance": "5000000000000000",
      "walletBalance": "13074810394533563",
      "blockHash": "0x04bcbcc18fa28e8322649606408627008f4f5f3d7a7790ff515a78ae01eabdf6",
      "blockNumber": 445117,
      "blockTimestamp": "2023-11-29T12:31:59.000Z",
      "transactionHash": "0x02037e731293872f9969061688b1f7dd71108aeb8dc5edb8cb9ee5992f678f32"
    },
    {
      "contractAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
      "contractDecimals": "18",
      "contractName": "Ether",
      "contractSymbol": "ETH",
      "spenderAddress": "0x04c0a5193d58f74fbace4b74dcf65481e734ed1714121bdc571da345540efa05",
      "allowance": "600000000000000000",
      "walletBalance": "13074810394533563",
      "blockHash": "0x02555f743ee01b4594f38f93a1eac9745147023bcd0723720adc266eabb35633",
      "blockNumber": 425374,
      "blockTimestamp": "2023-11-24T10:32:27.000Z",
      "transactionHash": "0x013d5d72f63e2006d369351bdaef062c562e7dd0f8b46df9e9c2ebbbe7621f49"
    },
    {
      "contractAddress": "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8",
      "contractDecimals": "6",
      "contractName": "Tether USD",
      "contractSymbol": "USDT",
      "spenderAddress": "0x010884171baf1914edc28d7afb619b40a4051cfae78a094a55d230f19e944a28",
      "allowance": "1260344576",
      "walletBalance": "0",
      "blockHash": "0x052fc2006fddf1a71d957b030fc597d155d89ef8fc4f785a1b2c3d3ea7d36af9",
      "blockNumber": 425364,
      "blockTimestamp": "2023-11-24T10:27:07.000Z",
      "transactionHash": "0x030ad9432f9eb69a6c57a364ee7f918f5235531093afcc78469713ec6512c2b6"
    },
    {
      "contractAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
      "contractDecimals": "18",
      "contractName": "Ether",
      "contractSymbol": "ETH",
      "spenderAddress": "0x010884171baf1914edc28d7afb619b40a4051cfae78a094a55d230f19e944a28",
      "allowance": "600000000000000000",
      "walletBalance": "13074810394533563",
      "blockHash": "0x0500d4cd753456567db593a63389f833593264f9f804f5f4d714467ece415a76",
      "blockNumber": 425361,
      "blockTimestamp": "2023-11-24T10:25:20.000Z",
      "transactionHash": "0x00b8e834ec946ca646e97b292ef0e2bb40d82d1f41c5f07cc4efbf2d2df65c99"
    },
    {
      "contractAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
      "contractDecimals": "18",
      "contractName": "Ether",
      "contractSymbol": "ETH",
      "spenderAddress": "0x051734077ba7baf5765896c56ce10b389d80cdcee8622e23c0556fb49e82df1b",
      "allowance": "1000000000000",
      "walletBalance": "13074810394533563",
      "blockHash": "0x0091ae49c82a250100ac16f9b535890dbfe533fb1c68fbbd6307378963848d0e",
      "blockNumber": 422499,
      "blockTimestamp": "2023-11-23T15:06:44.000Z",
      "transactionHash": "0x049a4f691bc8e2d1b3d5a07676466ad663b05283d62272da16e0d80638292886"
    },
    {
      "contractAddress": "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8",
      "contractDecimals": "6",
      "contractName": "USD Coin",
      "contractSymbol": "USDC",
      "spenderAddress": "0x04270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f",
      "allowance": "10287094",
      "walletBalance": "0",
      "blockHash": "0x02da3991eab89307ef861c3281e869188bca7909e59d2b303d3b87e07b09cfb4",
      "blockNumber": 422491,
      "blockTimestamp": "2023-11-23T14:57:03.000Z",
      "transactionHash": "0x00e0a940ad8a81385cea0a7353d80b48b0c500afc76a079182f9ea5a84155b48"
    },
    {
      "contractAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
      "contractDecimals": "18",
      "contractName": "Ether",
      "contractSymbol": "ETH",
      "spenderAddress": "0x04270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f",
      "allowance": "5000000000000000",
      "walletBalance": "13074810394533563",
      "blockHash": "0x02da3991eab89307ef861c3281e869188bca7909e59d2b303d3b87e07b09cfb4",
      "blockNumber": 422491,
      "blockTimestamp": "2023-11-23T14:57:03.000Z",
      "transactionHash": "0x0599d13a1cd3f1db448b0fd01756c2a99fc7342f65e797cd3639d664e67ff3cc"
    },
    {
      "contractAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
      "contractDecimals": "18",
      "contractName": "Ether",
      "contractSymbol": "ETH",
      "spenderAddress": "0x06ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678",
      "allowance": "599178082191783",
      "walletBalance": "13074810394533563",
      "blockHash": "0x076f2b7f99e0767a902c7bde0f5469cb205fe1cdb588549ae13fa012c0a9128a",
      "blockNumber": 232559,
      "blockTimestamp": "2023-09-17T08:34:56.000Z",
      "transactionHash": "0x07b20eb82eea4e1f028ece1bdc259148aa70faed3319d2ef3e301cf0a65a87c7"
    },
    {
      "contractAddress": "0x053c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8",
      "contractDecimals": "6",
      "contractName": "USD Coin",
      "contractSymbol": "USDC",
      "spenderAddress": "0x07a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1",
      "allowance": "32899474",
      "walletBalance": "0",
      "blockHash": "0x05e3a9aab5bb8099d47c953fe65cad44b62ab1edaae710c27784a6e7187302a1",
      "blockNumber": 171623,
      "blockTimestamp": "2023-08-25T18:55:09.000Z",
      "transactionHash": "0x05d46c3ee474fb98506bfc880f53a55a9bee45dae6b3dac720f2560a5cd2e34f"
    },
    {
      "contractAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
      "contractDecimals": "18",
      "contractName": "Ether",
      "contractSymbol": "ETH",
      "spenderAddress": "0x07a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1",
      "allowance": "20000000000000000",
      "walletBalance": "13074810394533563",
      "blockHash": "0x05e3a9aab5bb8099d47c953fe65cad44b62ab1edaae710c27784a6e7187302a1",
      "blockNumber": 171623,
      "blockTimestamp": "2023-08-25T18:55:09.000Z",
      "transactionHash": "0x02424aa4419e46b1b558ce8ea5c6f16adeaa3315fb25b912289b23a635ad2d13"
    },
    {
      "contractAddress": "0x068f5c6a61780768455de69077e07e89787839bf8166decfbf92b645209c0fb8",
      "contractDecimals": "6",
      "contractName": "Tether USD",
      "contractSymbol": "USDT",
      "spenderAddress": "0x041fd22b238fa21cfcf5dd45a8548974d8263b3a531a60388411c5e230f97023",
      "allowance": "16109640",
      "walletBalance": "0",
      "blockHash": "0x077a6cdb118d09d7d007a70fef980f9e9c3ea1d75e15b3c4875816dee5c4cca8",
      "blockNumber": 56765,
      "blockTimestamp": "2023-05-17T17:55:52.000Z",
      "transactionHash": "0x0523fab349edc619ff79f7be58591971c9251f16a8c3ed448238e6db4fa33cfa"
    },
    {
      "contractAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
      "contractDecimals": "18",
      "contractName": "Ether",
      "contractSymbol": "ETH",
      "spenderAddress": "0x041fd22b238fa21cfcf5dd45a8548974d8263b3a531a60388411c5e230f97023",
      "allowance": "9000000000000000",
      "walletBalance": "13074810394533563",
      "blockHash": "0x01e2e938e134040d8f6bd5f00aa007745e2d27988aea265cb5b5bec5fd0f5887",
      "blockNumber": 56764,
      "blockTimestamp": "2023-05-17T17:51:24.000Z",
      "transactionHash": "0x050ae8ff0d8667af902e5efea3f3e9293b142f281ee2afd52495b9b9c2e2802e"
    },
    {
      "contractAddress": "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
      "contractDecimals": "18",
      "contractName": "Ether",
      "contractSymbol": "ETH",
      "spenderAddress": "0x0173f81c529191726c6e7287e24626fe24760ac44dae2a1f7e02080230f8458b",
      "allowance": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
      "walletBalance": "13074810394533563",
      "blockHash": "0x03b736d54d0d2bdc0ae006d6adcdbfffa7a5688028d9e048ecb1469ed7143773",
      "blockNumber": 45210,
      "blockTimestamp": "2023-04-26T12:14:57.000Z",
      "transactionHash": "0x0498d7a0bb7d2ad6e92359e8026e947d2fdcfd35f0465c49fab2b4ca4f06c537"
    }
  ]
}

Curl request example

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

Last updated