Skip to content

feat(supported): return CAIP-2 chain IDs for v2 protocol#1

Open
kbak wants to merge 1 commit intoinfra402:mainfrom
kbak:feature/v2-supported-caip2
Open

feat(supported): return CAIP-2 chain IDs for v2 protocol#1
kbak wants to merge 1 commit intoinfra402:mainfrom
kbak:feature/v2-supported-caip2

Conversation

@kbak
Copy link

@kbak kbak commented Feb 11, 2026

Summary

  • The /supported endpoint only returned v1-format entries with network names (e.g. "base", "solana") and x402Version: 1
  • V2 clients expect CAIP-2 chain IDs (e.g. "eip155:8453", "solana:mainnet") with x402Version: 2
  • Each provider (EVM, Solana, Aptos) now returns both a v1 entry and a v2 entry, making the response backward compatible

Example response (before)

{"kinds": [{"x402Version": 1, "scheme": "exact", "network": "base"}]}

Example response (after)

{"kinds": [
  {"x402Version": 1, "scheme": "exact", "network": "base"},
  {"x402Version": 2, "scheme": "exact", "network": "eip155:8453"}
]}

Files changed

  • src/chain/evm.rs — add v2 entry in supported()
  • src/chain/solana.rs — add v2 entry in supported()
  • src/chain/aptos.rs — add v2 entry in supported()
  • src/types.rs — add X402Version::V2 variant with serde support
  • src/network.rs — add CAIP-2 format test

Test plan

  • cargo test --lib — 143 tests pass
  • cargo clippy — no new warnings
  • New tests verify v1+v2 entries for Aptos mainnet and testnet
  • New test verifies JSON wire format (x402Version serializes as 2)
  • New test verifies all Network variants produce valid CAIP-2 strings

🤖 Generated with Claude Code

The /supported endpoint only returned v1-format entries with network
names (e.g. "base", "solana"). V2 clients expect CAIP-2 chain IDs
(e.g. "eip155:8453", "solana:mainnet"). Each provider now returns
both a v1 entry (x402Version: 1, network name) and a v2 entry
(x402Version: 2, CAIP-2 chain ID).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
kbak added a commit to kbak/infra402-facilitator that referenced this pull request Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant