Get Token Allowance
Check how many tokens a contract is approved to spend on behalf of a wallet. Useful for verifying approval status before swaps or DeFi interactions.
Catalog action EVM Onchain
Check how many tokens a contract is approved to spend on behalf of a wallet. Useful for verifying approval status before swaps or DeFi interactions.
At a Glance
| Field | Value |
|---|---|
| Action ID | get-allowance |
| Category | EVM Onchain |
| Connector | Not required |
| Requires gas | No |
| Funds movement | None declared |
| Tags | blockchain, evm, erc20, allowance, query, read, approve, defi, permission |
Payload Schema
| Field | Type | Required | Description |
|---|---|---|---|
tokenAddress | string | Yes | ERC20 token contract address |
ownerAddress | string | Yes | Address of the token owner |
spenderAddress | string | Yes | Address of the approved spender |
chainId | number | Yes | Chain ID (1=Ethereum, 137=Polygon, 56=BSC, 8453=Base, etc.) |
Result Schema
| Field | Type | Required | Description |
|---|---|---|---|
allowance | string | Yes | The current allowance in token smallest units |
formattedAllowance | string | No | Human-readable allowance with decimals |
isUnlimited | boolean | No | Whether the allowance is max uint256 (unlimited) |
tokenAddress | string | No | - |
ownerAddress | string | No | - |
spenderAddress | string | No | - |
Examples
json{ "type": "get-allowance", "payload": { "tokenAddress": "0x0000000000000000000000000000000000000000", "ownerAddress": "0x0000000000000000000000000000000000000000", "spenderAddress": "0x0000000000000000000000000000000000000000", "chainId": 8453 }, "children": []}
bashcurl -X POST "https://api.b3os.org/v1/actions/get-allowance/test" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "inputs": { "tokenAddress": "0x0000000000000000000000000000000000000000", "ownerAddress": "0x0000000000000000000000000000000000000000", "spenderAddress": "0x0000000000000000000000000000000000000000", "chainId": 8453 }}'
Payload fields can use workflow expressions such as {{$trigger.body.amount}}, {{$nodes.fetch.result.price}}, and {{$props.asset}} when the value should come from a trigger, prior node, or reusable workflow prop.
