write.wallet.approve
Build an unsigned approval transaction for ERC20 tokens or ERC721/ERC1155 NFTs. Required before depositing or adding liquidity. Check allowance first to skip if sufficient.
Instructions
Build an unsigned approval transaction. For ERC20 tokens: generates approve(spender, amount). For ERC721/ERC1155 NFTs (e.g. LP positions): generates setApprovalForAll(operator, true). Required before write.account.deposit or write.account.add_liquidity (when depositing from wallet). Tip: call read.wallet.allowances first to check if approval already exists — skip this if the current allowance is sufficient.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token_address | Yes | Token contract address to approve | |
| spender_address | Yes | Address being approved — use the Arcadia account address for deposits | |
| asset_type | No | Token type: 'erc20' (default) for fungible tokens, 'erc721' or 'erc1155' for NFTs (LP positions) | erc20 |
| amount | No | ERC20 only: amount in raw units, or 'max_uint256' for unlimited. Ignored for NFTs. | max_uint256 |
| chain_id | No | Chain ID: 8453 (Base), 130 (Unichain), or 10 (Optimism) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | Yes | ||
| transaction | Yes | ||
| predicted_account_address | No |