Skip to content

Conversation

@AbrahamOjes
Copy link

Summary

This PR adds Polygon Amoy testnet support to the Python x402 SDK, bringing it to parity with the TypeScript implementation.

Changes

networks.py

  • Added polygon-amoy to the SupportedNetworks Literal type
  • Added chain ID mapping: polygon-amoy: 80002 to EVM_NETWORK_TO_CHAIN_ID

chains.py

  • Added polygon-amoy: "80002" to NETWORK_TO_ID mapping
  • Added USDC token configuration for chain ID 80002:
    • Address: 0x41E94Eb019C0762f9Bfcf9Fb1E58725BfB0e7582
    • Name: USDC
    • Decimals: 6
    • Version: 2

Tests

  • Added comprehensive test suite in test_polygon_amoy.py covering:
    • Network support verification
    • Chain ID mappings
    • USDC token configuration
    • Utility function compatibility

Testing

All existing tests pass (87 tests) plus 6 new tests for Polygon Amoy support:

tests/test_polygon_amoy.py::test_polygon_amoy_supported_network PASSED
tests/test_polygon_amoy.py::test_polygon_amoy_chain_id_mapping PASSED
tests/test_polygon_amoy.py::test_polygon_amoy_known_tokens PASSED
tests/test_polygon_amoy.py::test_get_chain_id_polygon_amoy PASSED
tests/test_polygon_amoy.py::test_get_default_token_address_polygon_amoy PASSED
tests/test_polygon_amoy.py::test_get_chain_id_direct_chain_id PASSED

Fixes #670

- Add polygon-amoy to SupportedNetworks literal
- Add polygon-amoy chain ID (80002) to network mappings
- Add USDC token configuration for Polygon Amoy
- Add comprehensive tests for Polygon Amoy support

Fixes coinbase#670
@cb-heimdall
Copy link

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

@vercel
Copy link

vercel bot commented Jan 17, 2026

@AbrahamOjes is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added sdk Changes to core v2 packages python labels Jan 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python sdk Changes to core v2 packages

Development

Successfully merging this pull request may close these issues.

Please add Polygon Amoy network support to the Python implementation

2 participants