From 5424c1c1b4716c85222bbf108e657473b29cf069 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Thu, 9 Oct 2025 18:17:57 +0800 Subject: [PATCH] Add support for Taiko mainnet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add Taiko mainnet as a supported network with chain ID 167000, RPC URL https://rpc.mainnet.taiko.xyz, and USDC contract address 0x07d83526730c7438048d55a4fc0b850e2aab6f0b. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- README.md | 6 ++++++ x402_a2a/core/merchant.ts | 1 + x402_a2a/core/wallet.ts | 1 + x402_a2a/types/state.ts | 2 +- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e6e8fd2..9f81efc 100644 --- a/README.md +++ b/README.md @@ -298,6 +298,12 @@ The library works with any EVM-compatible network. The example agents use: - USDC: `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` - Explorer: https://basescan.org/ +### Taiko Mainnet (production) +- Chain ID: `167000` +- RPC: `https://rpc.mainnet.taiko.xyz` +- USDC: `0x07d83526730c7438048d55a4fc0b850e2aab6f0b` +- Explorer: https://taikoscan.io + ## Security ### Best practices diff --git a/x402_a2a/core/merchant.ts b/x402_a2a/core/merchant.ts index 6cebb15..f61e022 100644 --- a/x402_a2a/core/merchant.ts +++ b/x402_a2a/core/merchant.ts @@ -47,6 +47,7 @@ function processPriceToAtomicAmount( "base-sepolia": "0x036CbD53842c5426634e7929541eC2318f3dCF7e", ethereum: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", polygon: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", + taiko: "0x07d83526730c7438048d55a4fc0b850e2aab6f0b", }; if (typeof price === "string") { diff --git a/x402_a2a/core/wallet.ts b/x402_a2a/core/wallet.ts index c05dafc..a412060 100644 --- a/x402_a2a/core/wallet.ts +++ b/x402_a2a/core/wallet.ts @@ -165,6 +165,7 @@ function getChainId(network: string): number { "base-sepolia": 84532, "ethereum": 1, "polygon": 137, + "taiko": 167000, }; return chainIds[network] || 84532; } diff --git a/x402_a2a/types/state.ts b/x402_a2a/types/state.ts index 07eb729..1c41625 100644 --- a/x402_a2a/types/state.ts +++ b/x402_a2a/types/state.ts @@ -35,7 +35,7 @@ export class x402Metadata { static readonly ERROR_KEY = "x402.payment.error"; } -export type SupportedNetworks = "base" | "base-sepolia" | "ethereum" | "polygon"; +export type SupportedNetworks = "base" | "base-sepolia" | "ethereum" | "polygon" | "taiko"; // Core x402 Protocol Types (equivalent to x402.types in Python) export interface EIP712Domain {