approve_permit2
One-time ERC-20 approval of a token to the Permit2 contract, needed before paying x402 "upto" endpoints with that token. A normal on-chain transaction (needs gas).
Instructions
One-time ERC-20 approval of a token to the Permit2 contract, needed before paying x402 "upto" endpoints with that token. A normal on-chain transaction (needs gas). By default approves the maximum, the ecosystem norm, so it never has to be repeated; pass amount to grant a bounded allowance instead (required under AGENTWALLET_MAX_TX_TOKEN and under a spend policy, both of which refuse a max approval; under a policy the allowance counts against the budgets). Permit2 itself only moves what each signed authorization allows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | Yes | ERC-20 token address (e.g. USDC on Base) | |
| amount | No | Allowance to grant in human units (e.g. "100"). Omit for unlimited. | |
| chain_id | Yes | Chain ID | |
| wallet_id | Yes | Wallet ID |