Get Token Allowances by Account

Returns information for fungible token allowances for an account.

This method will use 20 Compute Units.


Get fungible token allowances for an account

get

Returns information for fungible token allowances for an account.

Ordering

The order is governed by a combination of the spender id and the token id values, with spender id being the parent column. The token id value governs its order within the given spender id.

Note: The default order for this API is currently ASC

Filtering

When filtering there are some restrictions enforced to ensure correctness and scalability.

The table below defines the restrictions and support for the endpoint

Query Param Comparison Operator Support Description Example
spender.id eq Y Single occurrence only. ?spender.id=X
ne N
lt(e) Y Single occurrence only. ?spender.id=lte:X
gt(e) Y Single occurrence only. ?spender.id=gte:X
token.id eq Y Single occurrence only. Requires the presence of a spender.id query ?token.id=lt:Y
ne N
lt(e) Y Single occurrence only. Requires the presence of an lte or eq spender.id query ?spender.id=lte:X&token.id=lt:Y
gt(e) Y Single occurrence only. Requires the presence of an gte or eq spender.id query ?spender.id=gte:X&token.id=gt:Y

Both filters must be a single occurrence of gt(e) or lt(e) which provide a lower and or upper boundary for search.

Path parameters
idOrAliasOrEvmAddressstringrequired

Account alias or account id or evm address

Example: {"value":"HIQQEXWKW53RKN4W6XXC4Q232SYNZ3SZANVZZSUME5B5PRGXL663UAQA"}
Pattern: ^(\d{1,10}\.){0,2}(\d{1,10}|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))$
Query parameters
limitinteger · int32 · min: 1 · max: 100 · default: 25optional

The maximum number of items to return

Example: 2
orderundefined · enum · default: "asc"optional

The order in which items are listed

Example: desc
Available options:
spender.idstringoptional

The ID of the spender to return information for

Example: {"summary":"--","value":""}
Pattern: ^((gte?|lte?|eq|ne)\:)?(\d{1,10}\.\d{1,10}\.)?\d{1,10}$
token.idstringoptional

The ID of the token to return information for

Example: {"summary":"--","value":""}
Pattern: ^((gte?|lte?|eq|ne)\:)?(\d{1,10}\.\d{1,10}\.)?\d{1,10}$
Responses
curl -L \
  --url 'https://mainnet.hedera.validationcloud.io/v1/YOUR_API_KEY/api/v1/accounts/{idOrAliasOrEvmAddress}/allowances/tokens'
{
  "allowances": [
    {
      "amount_granted": 100,
      "owner": "0.1.2",
      "spender": "0.1.2",
      "timestamp": {
        "from": null,
        "to": null
      },
      "token_id": "0.1.2"
    }
  ],
  "links": {
    "next": "/api/v1/transactions?timestamp=lt:1657598275.517984411"
  }
}

Last updated

Was this helpful?