Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const paymentPayload = await processPayment(
- **Full TypeScript support** - Complete type definitions and interfaces
- **Ethereum wallet integration** - Built on ethers.js for signing and verification
- **Dynamic pricing** - Set prices based on request parameters
- **Multi-network support** - Works with Base, Base Sepolia, and other EVM chains
- **Multi-network support** - Works with Base, Base Sepolia, Ink, and other EVM chains
- **ERC-20 token payments** - Native support for USDC and other tokens
- **ADK-compatible** - Works seamlessly with [ADK TypeScript](https://github.com/njraladdin/adk-typescript)

Expand Down Expand Up @@ -281,7 +281,7 @@ npm run dev

## Supported networks

The library works with any EVM-compatible network. The example agents use:
The library works with any EVM-compatible network. Built-in support includes:

### Base Sepolia (testnet)
- Chain ID: `84532`
Expand All @@ -292,12 +292,30 @@ The library works with any EVM-compatible network. The example agents use:
- ETH: https://www.alchemy.com/faucets/base-sepolia
- USDC: https://faucet.circle.com/

### Base Mainnet (production)
### Base Mainnet
- Chain ID: `8453`
- RPC: `https://mainnet.base.org`
- USDC: `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`
- Explorer: https://basescan.org/

### Ink Mainnet
- Chain ID: `57073`
- RPC: `https://rpc-gel.inkonchain.com`
- USDC: `0x2D270e6886d130D724215A266106e6832161EAEd`
- Explorer: https://explorer.inkonchain.com

### Ethereum Mainnet
- Chain ID: `1`
- USDC: `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48`

### Polygon Mainnet
- Chain ID: `137`
- USDC: `0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359`

### Polygon Amoy (testnet)
- Chain ID: `80002`
- USDC: `0x41E94Eb019C0762f9Bfcf9Fb1E58725BfB0e7582`

## Security

### Best practices
Expand Down
8 changes: 8 additions & 0 deletions merchant-agent/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ GOOGLE_API_KEY=your_api_key_here
# Merchant Configuration
MERCHANT_WALLET_ADDRESS=your-merchant-wallet-address
PAYMENT_NETWORK=base-sepolia
# Supported networks: base, base-sepolia, ethereum, polygon, polygon-amoy, ink
# Network-specific USDC contracts:
# - base: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
# - base-sepolia: 0x036CbD53842c5426634e7929541eC2318f3dCF7e
# - ethereum: 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
# - polygon: 0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359
# - polygon-amoy: 0x41E94Eb019C0762f9Bfcf9Fb1E58725BfB0e7582
# - ink: 0x2D270e6886d130D724215A266106e6832161EAEd
USDC_CONTRACT=0x036CbD53842c5426634e7929541eC2318f3dCF7e

# Facilitator Configuration
Expand Down
1 change: 1 addition & 0 deletions x402_a2a/core/merchant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function processPriceToAtomicAmount(
ethereum: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
polygon: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
"polygon-amoy": "0x41E94Eb019C0762f9Bfcf9Fb1E58725BfB0e7582",
ink: "0x2D270e6886d130D724215A266106e6832161EAEd",
};

if (typeof price === "string") {
Expand Down
1 change: 1 addition & 0 deletions x402_a2a/core/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ function getChainId(network: string): number {
"ethereum": 1,
"polygon": 137,
"polygon-amoy": 80002,
"ink": 57073,
};
return chainIds[network] || 84532;
}
2 changes: 1 addition & 1 deletion x402_a2a/types/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class x402Metadata {
static readonly ERROR_KEY = "x402.payment.error";
}

export type SupportedNetworks = "base" | "base-sepolia" | "ethereum" | "polygon" | "polygon-amoy";
export type SupportedNetworks = "base" | "base-sepolia" | "ethereum" | "polygon" | "polygon-amoy" | "ink";

// Core x402 Protocol Types (equivalent to x402.types in Python)
export interface EIP712Domain {
Expand Down