web3_subscribe
Subscribe to a paid data tier (build or pro) on Base network using USDC via x402 payment protocol.
Instructions
Subscribe to a paid tier (build or pro) using x402 USDC payment on Base.
TWO-STEP FLOW: Step 1: Call with just tier (omit payment_signature) → returns 402 with payment details (amount in micro-USDC, pay_to treasury address, network, asset_address). Step 2: Sign a USDC EIP-3009 transferWithAuthorization, build the x402 v2 payment payload, base64-encode it, and call again with payment_signature.
PAYMENT PAYLOAD FORMAT (x402 v2): The payment_signature must be a base64-encoded JSON string with this exact structure: { "x402Version": 2, "payload": { "signature": "0x<130+ hex chars — EIP-712 signature>", "authorization": { "from": "0x", "to": "0x<pay_to address from step 1>", "value": "<amount from step 1, as string e.g. '49000000'>", "validAfter": "0", "validBefore": "<unix timestamp ~1hr from now, as string>", "nonce": "0x<64 hex chars — 32 random bytes>" } } }
EIP-712 SIGNING: Domain: { name: 'USD Coin', version: '2', chainId: 8453, verifyingContract: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' } Type: TransferWithAuthorization(address from, address to, uint256 value, uint256 validAfter, uint256 validBefore, bytes32 nonce) Sign the typed data, then hex-encode the 65-byte signature with 0x prefix.
IMPORTANT: All values inside authorization (value, validAfter, validBefore) must be STRINGS, not numbers.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tier | Yes | Subscription tier: 'build' ($49/mo) or 'pro' ($199/mo) | |
| payment_signature | No | Base64-encoded x402 v2 payment payload JSON. Omit on first call to get pricing (402 response). On second call, provide base64(JSON) where JSON has: { "x402Version": 2, "payload": { "signature": "0x...", "authorization": { "from", "to", "value", "validAfter", "validBefore", "nonce" } } }. See tool description for full format. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Result data object |