q402_clear_delegation
Clear the EIP-7702 delegation on a selected Q402 chain to reset it or switch your wallet to the x402 rail on Base, using two-phase consent and a prior status check.
Instructions
Clear the EIP-7702 delegation on a Q402 chain for the configured wallet. Call this when the user wants to reset a chain's delegation, OR to switch a wallet off the q402 rail so it can use the x402 (EIP-3009) rail on Base (a q402-delegated wallet can't settle x402). The next q402_pay on the same chain re-creates the delegation automatically, so don't clear right before a normal pay. Pair with q402_wallet_status / q402_agentic_info first to see which chains have an active delegation. Works in all three wallet modes: eoa (Q402_PRIVATE_KEY) and agentic-local (Q402_AGENTIC_PRIVATE_KEY) sign LOCALLY; agentic-server (Mode C) holds only a live apiKey and the server signs with the encrypted Agent Wallet key. Q402 sponsors the on-chain TX on every chain EXCEPT Ethereum, where the gas is billed to your Gas Tank. Two-phase consent: call once WITHOUT consentToken to get a preview + token (no broadcast), then re-call with the same args plus that consentToken to execute.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | Yes | Which Q402 chain to clear the delegation on. | |
| walletId | No | Server-managed Agent Wallet only (walletMode="agentic-server"). Lowercased Agent Wallet address when you hold more than one; omit to use your single/default wallet. | |
| walletMode | No | Which wallet to clear. "eoa" = Q402_PRIVATE_KEY, "agentic-local" = Q402_AGENTIC_PRIVATE_KEY (both sign locally), "agentic-server" = server-managed Agent Wallet (apiKey only, no private key). Omit when only one mode is configured; required when several are. | |
| consentToken | No | Two-phase consent. Omit on the first call to get a needs_confirmation preview + consentToken (no broadcast); re-call with the SAME args plus this token to execute. Re-derived from the resolved chain + wallet. |