uvd-x402-sdk 0.3.0__tar.gz → 0.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {uvd_x402_sdk-0.3.0/src/uvd_x402_sdk.egg-info → uvd_x402_sdk-0.3.2}/PKG-INFO +78 -23
  2. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/README.md +76 -21
  3. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/pyproject.toml +2 -2
  4. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk/__init__.py +1 -1
  5. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk/networks/__init__.py +0 -2
  6. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk/networks/base.py +4 -6
  7. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk/networks/evm.py +3 -35
  8. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2/src/uvd_x402_sdk.egg-info}/PKG-INFO +78 -23
  9. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/LICENSE +0 -0
  10. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/setup.cfg +0 -0
  11. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk/client.py +0 -0
  12. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk/config.py +0 -0
  13. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk/decorators.py +0 -0
  14. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk/exceptions.py +0 -0
  15. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk/integrations/__init__.py +0 -0
  16. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk/integrations/django_integration.py +0 -0
  17. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk/integrations/fastapi_integration.py +0 -0
  18. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk/integrations/flask_integration.py +0 -0
  19. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk/integrations/lambda_integration.py +0 -0
  20. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk/models.py +0 -0
  21. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk/networks/near.py +0 -0
  22. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk/networks/solana.py +0 -0
  23. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk/networks/stellar.py +0 -0
  24. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk/response.py +0 -0
  25. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk.egg-info/SOURCES.txt +0 -0
  26. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk.egg-info/dependency_links.txt +0 -0
  27. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk.egg-info/requires.txt +0 -0
  28. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/src/uvd_x402_sdk.egg-info/top_level.txt +0 -0
  29. {uvd_x402_sdk-0.3.0 → uvd_x402_sdk-0.3.2}/tests/test_client.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: uvd-x402-sdk
3
- Version: 0.3.0
4
- Summary: Python SDK for x402 payments - gasless crypto payments across 14 blockchains with multi-stablecoin support (USDC, EURC, AUSD, PYUSD, GHO, crvUSD)
3
+ Version: 0.3.2
4
+ Summary: Python SDK for x402 payments - gasless crypto payments across 14 blockchains with multi-stablecoin support (USDC, EURC, AUSD, PYUSD)
5
5
  Author-email: Ultravioleta DAO <dev@ultravioletadao.xyz>
6
6
  Project-URL: Homepage, https://github.com/UltravioletaDAO/uvd-x402-sdk-python
7
7
  Project-URL: Documentation, https://docs.ultravioletadao.xyz/x402-sdk
@@ -56,7 +56,7 @@ Accept **gasless stablecoin payments** across **14 blockchain networks** with a
56
56
  ## Features
57
57
 
58
58
  - **14 Networks**: EVM chains (Base, Ethereum, Polygon, etc.), SVM chains (Solana, Fogo), NEAR, and Stellar
59
- - **6 Stablecoins**: USDC, EURC, AUSD, PYUSD, GHO, crvUSD (EVM chains)
59
+ - **4 Stablecoins**: USDC, EURC, AUSD, PYUSD (EVM chains)
60
60
  - **x402 v1 & v2**: Full support for both protocol versions with auto-detection
61
61
  - **Framework Integrations**: Flask, FastAPI, Django, AWS Lambda
62
62
  - **Gasless Payments**: Users sign EIP-712/EIP-3009 authorizations, facilitator pays all network fees
@@ -102,8 +102,6 @@ print(f"Paid by {result.payer_address}, tx: {result.transaction_hash}")
102
102
  | EURC | Ethereum, Base, Avalanche | 6 |
103
103
  | AUSD | Ethereum, Arbitrum, Avalanche, Polygon, Monad | 6 |
104
104
  | PYUSD | Ethereum | 6 |
105
- | GHO | Ethereum, Base, Arbitrum | 18 |
106
- | crvUSD | Ethereum, Arbitrum | 18 |
107
105
 
108
106
  ## Installation
109
107
 
@@ -639,10 +637,10 @@ from uvd_x402_sdk import (
639
637
 
640
638
  # Check which tokens a network supports
641
639
  tokens = get_supported_tokens("ethereum")
642
- print(tokens) # ['usdc', 'eurc', 'ausd', 'pyusd', 'gho', 'crvusd']
640
+ print(tokens) # ['usdc', 'eurc', 'ausd', 'pyusd']
643
641
 
644
642
  tokens = get_supported_tokens("base")
645
- print(tokens) # ['usdc', 'eurc', 'gho']
643
+ print(tokens) # ['usdc', 'eurc']
646
644
 
647
645
  # Check if a specific token is supported
648
646
  if is_token_supported("ethereum", "eurc"):
@@ -657,10 +655,10 @@ if config:
657
655
  print(f"EIP-712 version: {config.version}")
658
656
 
659
657
  # Find all networks that support a token
660
- networks = get_networks_by_token("gho")
658
+ networks = get_networks_by_token("eurc")
661
659
  for network in networks:
662
- print(f"GHO available on: {network.display_name}")
663
- # Output: GHO available on: Ethereum, Base, Arbitrum One
660
+ print(f"EURC available on: {network.display_name}")
661
+ # Output: EURC available on: Ethereum, Base, Avalanche C-Chain
664
662
  ```
665
663
 
666
664
  ### Token Configuration
@@ -672,7 +670,7 @@ from uvd_x402_sdk import TokenConfig, get_token_config
672
670
 
673
671
  # TokenConfig structure
674
672
  # - address: Contract address
675
- # - decimals: Token decimals (6 for most, 18 for GHO/crvUSD)
673
+ # - decimals: Token decimals (6 for all supported stablecoins)
676
674
  # - name: EIP-712 domain name (e.g., "USD Coin", "EURC", "Gho Token")
677
675
  # - version: EIP-712 domain version
678
676
 
@@ -685,12 +683,12 @@ eurc = get_token_config("base", "eurc")
685
683
  # version="2"
686
684
  # )
687
685
 
688
- # Example: Get GHO config on Ethereum (note: 18 decimals)
689
- gho = get_token_config("ethereum", "gho")
686
+ # Example: Get PYUSD config on Ethereum
687
+ pyusd = get_token_config("ethereum", "pyusd")
690
688
  # TokenConfig(
691
- # address="0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f",
692
- # decimals=18,
693
- # name="Gho Token",
689
+ # address="0x6c3ea9036406852006290770BEdFcAbA0e23A0e8",
690
+ # decimals=6,
691
+ # name="PayPal USD",
694
692
  # version="1"
695
693
  # )
696
694
  ```
@@ -703,8 +701,55 @@ gho = get_token_config("ethereum", "gho")
703
701
  | `eurc` | Euro Coin | 6 | Circle |
704
702
  | `ausd` | Agora USD | 6 | Agora Finance |
705
703
  | `pyusd` | PayPal USD | 6 | PayPal/Paxos |
706
- | `gho` | GHO Stablecoin | 18 | Aave |
707
- | `crvusd` | Curve USD | 18 | Curve Finance |
704
+
705
+ ### Critical Implementation Notes
706
+
707
+ #### EIP-712 Domain Names Vary by Chain
708
+
709
+ The same token may use **different EIP-712 domain names on different chains**. This affects signature verification.
710
+
711
+ | Token | Ethereum | Base | Avalanche |
712
+ |-------|----------|------|-----------|
713
+ | EURC | `"Euro Coin"` | `"EURC"` | `"Euro Coin"` |
714
+ | USDC | `"USD Coin"` | `"USD Coin"` | `"USD Coin"` |
715
+ | AUSD | `"AUSD"` | N/A | `"AUSD"` |
716
+ | PYUSD | `"PayPal USD"` | N/A | N/A |
717
+
718
+ **Important:** Always use `get_token_config()` to get the correct domain name. Never hardcode domain names.
719
+
720
+ ```python
721
+ # CORRECT: Use get_token_config for each chain
722
+ eurc_base = get_token_config("base", "eurc")
723
+ # TokenConfig(name="EURC", version="2", ...)
724
+
725
+ eurc_ethereum = get_token_config("ethereum", "eurc")
726
+ # TokenConfig(name="Euro Coin", version="2", ...)
727
+ ```
728
+
729
+ #### PYUSD Signature Format (PayPal USD)
730
+
731
+ PYUSD uses the Paxos implementation which only supports the **v,r,s signature variant** of `transferWithAuthorization`. This is different from Circle's USDC/EURC which support both compact bytes and v,r,s variants.
732
+
733
+ **Backend implications:**
734
+ - The x402 facilitator (v1.9.0+) automatically handles this by detecting PYUSD and using `transferWithAuthorization_1(v,r,s)` instead of `transferWithAuthorization_0(bytes signature)`
735
+ - If using a custom facilitator, ensure it supports the v,r,s variant for PYUSD
736
+
737
+ #### Token Info Must Be Passed to Facilitator
738
+
739
+ When using non-USDC tokens, your backend **must** pass the token info (including EIP-712 domain) to the facilitator. This is done via the `extra` field in `paymentRequirements`:
740
+
741
+ ```python
742
+ # When building payment requirements for the facilitator
743
+ payment_requirements = {
744
+ "asset": token_address, # Use actual token address, NOT hardcoded USDC
745
+ "extra": {
746
+ "name": token_config.name, # EIP-712 domain name
747
+ "version": token_config.version, # EIP-712 domain version
748
+ }
749
+ }
750
+ ```
751
+
752
+ Without this, the facilitator will use wrong EIP-712 domain and signature verification will fail with "invalid signature" error.
708
753
 
709
754
  ---
710
755
 
@@ -753,7 +798,7 @@ except X402Error as e:
753
798
 
754
799
  ## How x402 Works
755
800
 
756
- The x402 protocol enables gasless stablecoin payments (USDC, EURC, AUSD, PYUSD, GHO, crvUSD):
801
+ The x402 protocol enables gasless stablecoin payments (USDC, EURC, AUSD, PYUSD):
757
802
 
758
803
  ```
759
804
  1. User Request --> Client sends request without payment
@@ -796,7 +841,7 @@ The facilitator (https://facilitator.ultravioletadao.xyz) handles all on-chain i
796
841
  ## Security
797
842
 
798
843
  - Users **NEVER** pay gas or submit transactions directly
799
- - **EVM**: Users sign EIP-712 structured messages for any supported stablecoin (USDC, EURC, AUSD, PYUSD, GHO, crvUSD)
844
+ - **EVM**: Users sign EIP-712 structured messages for any supported stablecoin (USDC, EURC, AUSD, PYUSD)
800
845
  - **Solana/Fogo**: Users sign partial transactions (facilitator co-signs and submits)
801
846
  - **Stellar**: Users sign Soroban authorization entries only
802
847
  - **NEAR**: Users sign NEP-366 meta-transactions (DelegateAction)
@@ -881,15 +926,25 @@ MIT License - see LICENSE file.
881
926
 
882
927
  ## Changelog
883
928
 
929
+ ### v0.3.2 (2025-12-21)
930
+
931
+ - Added critical implementation notes for multi-token support:
932
+ - EIP-712 domain names vary by chain (e.g., EURC is "Euro Coin" on Ethereum but "EURC" on Base)
933
+ - PYUSD uses v,r,s signature variant (Paxos implementation)
934
+ - Token info must be passed to facilitator via `extra` field
935
+
936
+ ### v0.3.1 (2025-12-21)
937
+
938
+ - Removed GHO and crvUSD token support (not EIP-3009 compatible)
939
+ - SDK now supports 4 stablecoins: USDC, EURC, AUSD, PYUSD
940
+
884
941
  ### v0.3.0 (2025-12-20)
885
942
 
886
- - **Multi-Stablecoin Support**: Added support for 6 stablecoins on EVM chains
943
+ - **Multi-Stablecoin Support**: Added support for 4 stablecoins on EVM chains
887
944
  - USDC (all EVM chains)
888
945
  - EURC (Ethereum, Base, Avalanche)
889
946
  - AUSD (Ethereum, Arbitrum, Avalanche, Polygon, Monad)
890
947
  - PYUSD (Ethereum)
891
- - GHO (Ethereum, Base, Arbitrum)
892
- - crvUSD (Ethereum, Arbitrum)
893
948
  - Added `TokenType` literal type and `TokenConfig` dataclass
894
949
  - Added token helper functions: `get_token_config()`, `get_supported_tokens()`, `is_token_supported()`, `get_networks_by_token()`
895
950
  - Added `tokens` field to `NetworkConfig` for multi-token configurations
@@ -7,7 +7,7 @@ Accept **gasless stablecoin payments** across **14 blockchain networks** with a
7
7
  ## Features
8
8
 
9
9
  - **14 Networks**: EVM chains (Base, Ethereum, Polygon, etc.), SVM chains (Solana, Fogo), NEAR, and Stellar
10
- - **6 Stablecoins**: USDC, EURC, AUSD, PYUSD, GHO, crvUSD (EVM chains)
10
+ - **4 Stablecoins**: USDC, EURC, AUSD, PYUSD (EVM chains)
11
11
  - **x402 v1 & v2**: Full support for both protocol versions with auto-detection
12
12
  - **Framework Integrations**: Flask, FastAPI, Django, AWS Lambda
13
13
  - **Gasless Payments**: Users sign EIP-712/EIP-3009 authorizations, facilitator pays all network fees
@@ -53,8 +53,6 @@ print(f"Paid by {result.payer_address}, tx: {result.transaction_hash}")
53
53
  | EURC | Ethereum, Base, Avalanche | 6 |
54
54
  | AUSD | Ethereum, Arbitrum, Avalanche, Polygon, Monad | 6 |
55
55
  | PYUSD | Ethereum | 6 |
56
- | GHO | Ethereum, Base, Arbitrum | 18 |
57
- | crvUSD | Ethereum, Arbitrum | 18 |
58
56
 
59
57
  ## Installation
60
58
 
@@ -590,10 +588,10 @@ from uvd_x402_sdk import (
590
588
 
591
589
  # Check which tokens a network supports
592
590
  tokens = get_supported_tokens("ethereum")
593
- print(tokens) # ['usdc', 'eurc', 'ausd', 'pyusd', 'gho', 'crvusd']
591
+ print(tokens) # ['usdc', 'eurc', 'ausd', 'pyusd']
594
592
 
595
593
  tokens = get_supported_tokens("base")
596
- print(tokens) # ['usdc', 'eurc', 'gho']
594
+ print(tokens) # ['usdc', 'eurc']
597
595
 
598
596
  # Check if a specific token is supported
599
597
  if is_token_supported("ethereum", "eurc"):
@@ -608,10 +606,10 @@ if config:
608
606
  print(f"EIP-712 version: {config.version}")
609
607
 
610
608
  # Find all networks that support a token
611
- networks = get_networks_by_token("gho")
609
+ networks = get_networks_by_token("eurc")
612
610
  for network in networks:
613
- print(f"GHO available on: {network.display_name}")
614
- # Output: GHO available on: Ethereum, Base, Arbitrum One
611
+ print(f"EURC available on: {network.display_name}")
612
+ # Output: EURC available on: Ethereum, Base, Avalanche C-Chain
615
613
  ```
616
614
 
617
615
  ### Token Configuration
@@ -623,7 +621,7 @@ from uvd_x402_sdk import TokenConfig, get_token_config
623
621
 
624
622
  # TokenConfig structure
625
623
  # - address: Contract address
626
- # - decimals: Token decimals (6 for most, 18 for GHO/crvUSD)
624
+ # - decimals: Token decimals (6 for all supported stablecoins)
627
625
  # - name: EIP-712 domain name (e.g., "USD Coin", "EURC", "Gho Token")
628
626
  # - version: EIP-712 domain version
629
627
 
@@ -636,12 +634,12 @@ eurc = get_token_config("base", "eurc")
636
634
  # version="2"
637
635
  # )
638
636
 
639
- # Example: Get GHO config on Ethereum (note: 18 decimals)
640
- gho = get_token_config("ethereum", "gho")
637
+ # Example: Get PYUSD config on Ethereum
638
+ pyusd = get_token_config("ethereum", "pyusd")
641
639
  # TokenConfig(
642
- # address="0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f",
643
- # decimals=18,
644
- # name="Gho Token",
640
+ # address="0x6c3ea9036406852006290770BEdFcAbA0e23A0e8",
641
+ # decimals=6,
642
+ # name="PayPal USD",
645
643
  # version="1"
646
644
  # )
647
645
  ```
@@ -654,8 +652,55 @@ gho = get_token_config("ethereum", "gho")
654
652
  | `eurc` | Euro Coin | 6 | Circle |
655
653
  | `ausd` | Agora USD | 6 | Agora Finance |
656
654
  | `pyusd` | PayPal USD | 6 | PayPal/Paxos |
657
- | `gho` | GHO Stablecoin | 18 | Aave |
658
- | `crvusd` | Curve USD | 18 | Curve Finance |
655
+
656
+ ### Critical Implementation Notes
657
+
658
+ #### EIP-712 Domain Names Vary by Chain
659
+
660
+ The same token may use **different EIP-712 domain names on different chains**. This affects signature verification.
661
+
662
+ | Token | Ethereum | Base | Avalanche |
663
+ |-------|----------|------|-----------|
664
+ | EURC | `"Euro Coin"` | `"EURC"` | `"Euro Coin"` |
665
+ | USDC | `"USD Coin"` | `"USD Coin"` | `"USD Coin"` |
666
+ | AUSD | `"AUSD"` | N/A | `"AUSD"` |
667
+ | PYUSD | `"PayPal USD"` | N/A | N/A |
668
+
669
+ **Important:** Always use `get_token_config()` to get the correct domain name. Never hardcode domain names.
670
+
671
+ ```python
672
+ # CORRECT: Use get_token_config for each chain
673
+ eurc_base = get_token_config("base", "eurc")
674
+ # TokenConfig(name="EURC", version="2", ...)
675
+
676
+ eurc_ethereum = get_token_config("ethereum", "eurc")
677
+ # TokenConfig(name="Euro Coin", version="2", ...)
678
+ ```
679
+
680
+ #### PYUSD Signature Format (PayPal USD)
681
+
682
+ PYUSD uses the Paxos implementation which only supports the **v,r,s signature variant** of `transferWithAuthorization`. This is different from Circle's USDC/EURC which support both compact bytes and v,r,s variants.
683
+
684
+ **Backend implications:**
685
+ - The x402 facilitator (v1.9.0+) automatically handles this by detecting PYUSD and using `transferWithAuthorization_1(v,r,s)` instead of `transferWithAuthorization_0(bytes signature)`
686
+ - If using a custom facilitator, ensure it supports the v,r,s variant for PYUSD
687
+
688
+ #### Token Info Must Be Passed to Facilitator
689
+
690
+ When using non-USDC tokens, your backend **must** pass the token info (including EIP-712 domain) to the facilitator. This is done via the `extra` field in `paymentRequirements`:
691
+
692
+ ```python
693
+ # When building payment requirements for the facilitator
694
+ payment_requirements = {
695
+ "asset": token_address, # Use actual token address, NOT hardcoded USDC
696
+ "extra": {
697
+ "name": token_config.name, # EIP-712 domain name
698
+ "version": token_config.version, # EIP-712 domain version
699
+ }
700
+ }
701
+ ```
702
+
703
+ Without this, the facilitator will use wrong EIP-712 domain and signature verification will fail with "invalid signature" error.
659
704
 
660
705
  ---
661
706
 
@@ -704,7 +749,7 @@ except X402Error as e:
704
749
 
705
750
  ## How x402 Works
706
751
 
707
- The x402 protocol enables gasless stablecoin payments (USDC, EURC, AUSD, PYUSD, GHO, crvUSD):
752
+ The x402 protocol enables gasless stablecoin payments (USDC, EURC, AUSD, PYUSD):
708
753
 
709
754
  ```
710
755
  1. User Request --> Client sends request without payment
@@ -747,7 +792,7 @@ The facilitator (https://facilitator.ultravioletadao.xyz) handles all on-chain i
747
792
  ## Security
748
793
 
749
794
  - Users **NEVER** pay gas or submit transactions directly
750
- - **EVM**: Users sign EIP-712 structured messages for any supported stablecoin (USDC, EURC, AUSD, PYUSD, GHO, crvUSD)
795
+ - **EVM**: Users sign EIP-712 structured messages for any supported stablecoin (USDC, EURC, AUSD, PYUSD)
751
796
  - **Solana/Fogo**: Users sign partial transactions (facilitator co-signs and submits)
752
797
  - **Stellar**: Users sign Soroban authorization entries only
753
798
  - **NEAR**: Users sign NEP-366 meta-transactions (DelegateAction)
@@ -832,15 +877,25 @@ MIT License - see LICENSE file.
832
877
 
833
878
  ## Changelog
834
879
 
880
+ ### v0.3.2 (2025-12-21)
881
+
882
+ - Added critical implementation notes for multi-token support:
883
+ - EIP-712 domain names vary by chain (e.g., EURC is "Euro Coin" on Ethereum but "EURC" on Base)
884
+ - PYUSD uses v,r,s signature variant (Paxos implementation)
885
+ - Token info must be passed to facilitator via `extra` field
886
+
887
+ ### v0.3.1 (2025-12-21)
888
+
889
+ - Removed GHO and crvUSD token support (not EIP-3009 compatible)
890
+ - SDK now supports 4 stablecoins: USDC, EURC, AUSD, PYUSD
891
+
835
892
  ### v0.3.0 (2025-12-20)
836
893
 
837
- - **Multi-Stablecoin Support**: Added support for 6 stablecoins on EVM chains
894
+ - **Multi-Stablecoin Support**: Added support for 4 stablecoins on EVM chains
838
895
  - USDC (all EVM chains)
839
896
  - EURC (Ethereum, Base, Avalanche)
840
897
  - AUSD (Ethereum, Arbitrum, Avalanche, Polygon, Monad)
841
898
  - PYUSD (Ethereum)
842
- - GHO (Ethereum, Base, Arbitrum)
843
- - crvUSD (Ethereum, Arbitrum)
844
899
  - Added `TokenType` literal type and `TokenConfig` dataclass
845
900
  - Added token helper functions: `get_token_config()`, `get_supported_tokens()`, `is_token_supported()`, `get_networks_by_token()`
846
901
  - Added `tokens` field to `NetworkConfig` for multi-token configurations
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "uvd-x402-sdk"
7
- version = "0.3.0"
8
- description = "Python SDK for x402 payments - gasless crypto payments across 14 blockchains with multi-stablecoin support (USDC, EURC, AUSD, PYUSD, GHO, crvUSD)"
7
+ version = "0.3.2"
8
+ description = "Python SDK for x402 payments - gasless crypto payments across 14 blockchains with multi-stablecoin support (USDC, EURC, AUSD, PYUSD)"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
11
11
  authors = [
@@ -37,7 +37,7 @@ Supported Networks (14 total):
37
37
  - Stellar (1): Stellar
38
38
  """
39
39
 
40
- __version__ = "0.3.0"
40
+ __version__ = "0.3.2"
41
41
  __author__ = "Ultravioleta DAO"
42
42
 
43
43
  from uvd_x402_sdk.client import X402Client
@@ -16,8 +16,6 @@ Multi-token support (EVM chains only):
16
16
  - EURC: Ethereum, Base, Avalanche
17
17
  - AUSD: Ethereum, Arbitrum, Avalanche, Polygon, Monad
18
18
  - PYUSD: Ethereum
19
- - GHO: Ethereum, Base, Arbitrum
20
- - crvUSD: Ethereum, Arbitrum
21
19
 
22
20
  You can register custom networks using `register_network()`.
23
21
  """
@@ -22,12 +22,10 @@ from typing import Dict, List, Literal, Optional, Any
22
22
  # - eurc: Euro Coin (Circle) - 6 decimals
23
23
  # - ausd: Agora USD (Agora Finance) - 6 decimals
24
24
  # - pyusd: PayPal USD (PayPal/Paxos) - 6 decimals
25
- # - gho: GHO Stablecoin (Aave) - 18 decimals
26
- # - crvusd: Curve USD (Curve Finance) - 18 decimals
27
- TokenType = Literal["usdc", "eurc", "ausd", "pyusd", "gho", "crvusd"]
25
+ TokenType = Literal["usdc", "eurc", "ausd", "pyusd"]
28
26
 
29
27
  # All supported token types
30
- ALL_TOKEN_TYPES: List[TokenType] = ["usdc", "eurc", "ausd", "pyusd", "gho", "crvusd"]
28
+ ALL_TOKEN_TYPES: List[TokenType] = ["usdc", "eurc", "ausd", "pyusd"]
31
29
 
32
30
 
33
31
  @dataclass
@@ -37,7 +35,7 @@ class TokenConfig:
37
35
 
38
36
  Attributes:
39
37
  address: Contract address of the token
40
- decimals: Number of decimals (6 for most stablecoins, 18 for GHO/crvUSD)
38
+ decimals: Number of decimals (6 for all supported stablecoins)
41
39
  name: Token name for EIP-712 domain (e.g., "USD Coin" or "USDC")
42
40
  version: Token version for EIP-712 domain
43
41
  """
@@ -300,7 +298,7 @@ def get_supported_tokens(network_name: str) -> List[TokenType]:
300
298
 
301
299
  Example:
302
300
  >>> tokens = get_supported_tokens('ethereum')
303
- >>> print(tokens) # ['usdc', 'eurc', 'ausd', 'pyusd', 'gho', 'crvusd']
301
+ >>> print(tokens) # ['usdc', 'eurc', 'ausd', 'pyusd']
304
302
  """
305
303
  network = get_network(network_name)
306
304
  if not network:
@@ -13,8 +13,6 @@ Multi-token support:
13
13
  - EURC: Ethereum, Base, Avalanche (6 decimals)
14
14
  - AUSD: Ethereum, Arbitrum, Avalanche, Polygon, Monad (6 decimals)
15
15
  - PYUSD: Ethereum (6 decimals)
16
- - GHO: Ethereum, Base, Arbitrum (18 decimals)
17
- - crvUSD: Ethereum, Arbitrum (18 decimals)
18
16
  """
19
17
 
20
18
  from uvd_x402_sdk.networks.base import (
@@ -28,7 +26,7 @@ from uvd_x402_sdk.networks.base import (
28
26
  # EVM Networks Configuration
29
27
  # =============================================================================
30
28
 
31
- # Base (Layer 2) - supports USDC, EURC, GHO
29
+ # Base (Layer 2) - supports USDC, EURC
32
30
  BASE = NetworkConfig(
33
31
  name="base",
34
32
  display_name="Base",
@@ -53,16 +51,10 @@ BASE = NetworkConfig(
53
51
  name="EURC",
54
52
  version="2",
55
53
  ),
56
- "gho": TokenConfig(
57
- address="0x6Bb7a212910682DCFdbd5BCBb3e28FB4E8da10Ee",
58
- decimals=18,
59
- name="Gho Token",
60
- version="1",
61
- ),
62
54
  },
63
55
  )
64
56
 
65
- # Ethereum Mainnet (supports all 6 stablecoins)
57
+ # Ethereum Mainnet - supports USDC, EURC, AUSD, PYUSD
66
58
  ETHEREUM = NetworkConfig(
67
59
  name="ethereum",
68
60
  display_name="Ethereum",
@@ -99,18 +91,6 @@ ETHEREUM = NetworkConfig(
99
91
  name="PayPal USD",
100
92
  version="1",
101
93
  ),
102
- "gho": TokenConfig(
103
- address="0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f",
104
- decimals=18,
105
- name="Gho Token",
106
- version="1",
107
- ),
108
- "crvusd": TokenConfig(
109
- address="0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E",
110
- decimals=18,
111
- name="Curve.Fi USD Stablecoin",
112
- version="1",
113
- ),
114
94
  },
115
95
  )
116
96
 
@@ -142,7 +122,7 @@ POLYGON = NetworkConfig(
142
122
  },
143
123
  )
144
124
 
145
- # Arbitrum One - supports USDC, AUSD, GHO, crvUSD
125
+ # Arbitrum One - supports USDC, AUSD
146
126
  ARBITRUM = NetworkConfig(
147
127
  name="arbitrum",
148
128
  display_name="Arbitrum One",
@@ -167,18 +147,6 @@ ARBITRUM = NetworkConfig(
167
147
  name="Agora USD",
168
148
  version="1",
169
149
  ),
170
- "gho": TokenConfig(
171
- address="0x7dfF72693f6A4149b17e7C6314655f6A9F7c8B33",
172
- decimals=18,
173
- name="Gho Token",
174
- version="1",
175
- ),
176
- "crvusd": TokenConfig(
177
- address="0x498Bf2B1e120FeD3ad3D42EA2165E9b73f99C1e5",
178
- decimals=18,
179
- name="Curve.Fi USD Stablecoin",
180
- version="1",
181
- ),
182
150
  },
183
151
  )
184
152
 
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: uvd-x402-sdk
3
- Version: 0.3.0
4
- Summary: Python SDK for x402 payments - gasless crypto payments across 14 blockchains with multi-stablecoin support (USDC, EURC, AUSD, PYUSD, GHO, crvUSD)
3
+ Version: 0.3.2
4
+ Summary: Python SDK for x402 payments - gasless crypto payments across 14 blockchains with multi-stablecoin support (USDC, EURC, AUSD, PYUSD)
5
5
  Author-email: Ultravioleta DAO <dev@ultravioletadao.xyz>
6
6
  Project-URL: Homepage, https://github.com/UltravioletaDAO/uvd-x402-sdk-python
7
7
  Project-URL: Documentation, https://docs.ultravioletadao.xyz/x402-sdk
@@ -56,7 +56,7 @@ Accept **gasless stablecoin payments** across **14 blockchain networks** with a
56
56
  ## Features
57
57
 
58
58
  - **14 Networks**: EVM chains (Base, Ethereum, Polygon, etc.), SVM chains (Solana, Fogo), NEAR, and Stellar
59
- - **6 Stablecoins**: USDC, EURC, AUSD, PYUSD, GHO, crvUSD (EVM chains)
59
+ - **4 Stablecoins**: USDC, EURC, AUSD, PYUSD (EVM chains)
60
60
  - **x402 v1 & v2**: Full support for both protocol versions with auto-detection
61
61
  - **Framework Integrations**: Flask, FastAPI, Django, AWS Lambda
62
62
  - **Gasless Payments**: Users sign EIP-712/EIP-3009 authorizations, facilitator pays all network fees
@@ -102,8 +102,6 @@ print(f"Paid by {result.payer_address}, tx: {result.transaction_hash}")
102
102
  | EURC | Ethereum, Base, Avalanche | 6 |
103
103
  | AUSD | Ethereum, Arbitrum, Avalanche, Polygon, Monad | 6 |
104
104
  | PYUSD | Ethereum | 6 |
105
- | GHO | Ethereum, Base, Arbitrum | 18 |
106
- | crvUSD | Ethereum, Arbitrum | 18 |
107
105
 
108
106
  ## Installation
109
107
 
@@ -639,10 +637,10 @@ from uvd_x402_sdk import (
639
637
 
640
638
  # Check which tokens a network supports
641
639
  tokens = get_supported_tokens("ethereum")
642
- print(tokens) # ['usdc', 'eurc', 'ausd', 'pyusd', 'gho', 'crvusd']
640
+ print(tokens) # ['usdc', 'eurc', 'ausd', 'pyusd']
643
641
 
644
642
  tokens = get_supported_tokens("base")
645
- print(tokens) # ['usdc', 'eurc', 'gho']
643
+ print(tokens) # ['usdc', 'eurc']
646
644
 
647
645
  # Check if a specific token is supported
648
646
  if is_token_supported("ethereum", "eurc"):
@@ -657,10 +655,10 @@ if config:
657
655
  print(f"EIP-712 version: {config.version}")
658
656
 
659
657
  # Find all networks that support a token
660
- networks = get_networks_by_token("gho")
658
+ networks = get_networks_by_token("eurc")
661
659
  for network in networks:
662
- print(f"GHO available on: {network.display_name}")
663
- # Output: GHO available on: Ethereum, Base, Arbitrum One
660
+ print(f"EURC available on: {network.display_name}")
661
+ # Output: EURC available on: Ethereum, Base, Avalanche C-Chain
664
662
  ```
665
663
 
666
664
  ### Token Configuration
@@ -672,7 +670,7 @@ from uvd_x402_sdk import TokenConfig, get_token_config
672
670
 
673
671
  # TokenConfig structure
674
672
  # - address: Contract address
675
- # - decimals: Token decimals (6 for most, 18 for GHO/crvUSD)
673
+ # - decimals: Token decimals (6 for all supported stablecoins)
676
674
  # - name: EIP-712 domain name (e.g., "USD Coin", "EURC", "Gho Token")
677
675
  # - version: EIP-712 domain version
678
676
 
@@ -685,12 +683,12 @@ eurc = get_token_config("base", "eurc")
685
683
  # version="2"
686
684
  # )
687
685
 
688
- # Example: Get GHO config on Ethereum (note: 18 decimals)
689
- gho = get_token_config("ethereum", "gho")
686
+ # Example: Get PYUSD config on Ethereum
687
+ pyusd = get_token_config("ethereum", "pyusd")
690
688
  # TokenConfig(
691
- # address="0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f",
692
- # decimals=18,
693
- # name="Gho Token",
689
+ # address="0x6c3ea9036406852006290770BEdFcAbA0e23A0e8",
690
+ # decimals=6,
691
+ # name="PayPal USD",
694
692
  # version="1"
695
693
  # )
696
694
  ```
@@ -703,8 +701,55 @@ gho = get_token_config("ethereum", "gho")
703
701
  | `eurc` | Euro Coin | 6 | Circle |
704
702
  | `ausd` | Agora USD | 6 | Agora Finance |
705
703
  | `pyusd` | PayPal USD | 6 | PayPal/Paxos |
706
- | `gho` | GHO Stablecoin | 18 | Aave |
707
- | `crvusd` | Curve USD | 18 | Curve Finance |
704
+
705
+ ### Critical Implementation Notes
706
+
707
+ #### EIP-712 Domain Names Vary by Chain
708
+
709
+ The same token may use **different EIP-712 domain names on different chains**. This affects signature verification.
710
+
711
+ | Token | Ethereum | Base | Avalanche |
712
+ |-------|----------|------|-----------|
713
+ | EURC | `"Euro Coin"` | `"EURC"` | `"Euro Coin"` |
714
+ | USDC | `"USD Coin"` | `"USD Coin"` | `"USD Coin"` |
715
+ | AUSD | `"AUSD"` | N/A | `"AUSD"` |
716
+ | PYUSD | `"PayPal USD"` | N/A | N/A |
717
+
718
+ **Important:** Always use `get_token_config()` to get the correct domain name. Never hardcode domain names.
719
+
720
+ ```python
721
+ # CORRECT: Use get_token_config for each chain
722
+ eurc_base = get_token_config("base", "eurc")
723
+ # TokenConfig(name="EURC", version="2", ...)
724
+
725
+ eurc_ethereum = get_token_config("ethereum", "eurc")
726
+ # TokenConfig(name="Euro Coin", version="2", ...)
727
+ ```
728
+
729
+ #### PYUSD Signature Format (PayPal USD)
730
+
731
+ PYUSD uses the Paxos implementation which only supports the **v,r,s signature variant** of `transferWithAuthorization`. This is different from Circle's USDC/EURC which support both compact bytes and v,r,s variants.
732
+
733
+ **Backend implications:**
734
+ - The x402 facilitator (v1.9.0+) automatically handles this by detecting PYUSD and using `transferWithAuthorization_1(v,r,s)` instead of `transferWithAuthorization_0(bytes signature)`
735
+ - If using a custom facilitator, ensure it supports the v,r,s variant for PYUSD
736
+
737
+ #### Token Info Must Be Passed to Facilitator
738
+
739
+ When using non-USDC tokens, your backend **must** pass the token info (including EIP-712 domain) to the facilitator. This is done via the `extra` field in `paymentRequirements`:
740
+
741
+ ```python
742
+ # When building payment requirements for the facilitator
743
+ payment_requirements = {
744
+ "asset": token_address, # Use actual token address, NOT hardcoded USDC
745
+ "extra": {
746
+ "name": token_config.name, # EIP-712 domain name
747
+ "version": token_config.version, # EIP-712 domain version
748
+ }
749
+ }
750
+ ```
751
+
752
+ Without this, the facilitator will use wrong EIP-712 domain and signature verification will fail with "invalid signature" error.
708
753
 
709
754
  ---
710
755
 
@@ -753,7 +798,7 @@ except X402Error as e:
753
798
 
754
799
  ## How x402 Works
755
800
 
756
- The x402 protocol enables gasless stablecoin payments (USDC, EURC, AUSD, PYUSD, GHO, crvUSD):
801
+ The x402 protocol enables gasless stablecoin payments (USDC, EURC, AUSD, PYUSD):
757
802
 
758
803
  ```
759
804
  1. User Request --> Client sends request without payment
@@ -796,7 +841,7 @@ The facilitator (https://facilitator.ultravioletadao.xyz) handles all on-chain i
796
841
  ## Security
797
842
 
798
843
  - Users **NEVER** pay gas or submit transactions directly
799
- - **EVM**: Users sign EIP-712 structured messages for any supported stablecoin (USDC, EURC, AUSD, PYUSD, GHO, crvUSD)
844
+ - **EVM**: Users sign EIP-712 structured messages for any supported stablecoin (USDC, EURC, AUSD, PYUSD)
800
845
  - **Solana/Fogo**: Users sign partial transactions (facilitator co-signs and submits)
801
846
  - **Stellar**: Users sign Soroban authorization entries only
802
847
  - **NEAR**: Users sign NEP-366 meta-transactions (DelegateAction)
@@ -881,15 +926,25 @@ MIT License - see LICENSE file.
881
926
 
882
927
  ## Changelog
883
928
 
929
+ ### v0.3.2 (2025-12-21)
930
+
931
+ - Added critical implementation notes for multi-token support:
932
+ - EIP-712 domain names vary by chain (e.g., EURC is "Euro Coin" on Ethereum but "EURC" on Base)
933
+ - PYUSD uses v,r,s signature variant (Paxos implementation)
934
+ - Token info must be passed to facilitator via `extra` field
935
+
936
+ ### v0.3.1 (2025-12-21)
937
+
938
+ - Removed GHO and crvUSD token support (not EIP-3009 compatible)
939
+ - SDK now supports 4 stablecoins: USDC, EURC, AUSD, PYUSD
940
+
884
941
  ### v0.3.0 (2025-12-20)
885
942
 
886
- - **Multi-Stablecoin Support**: Added support for 6 stablecoins on EVM chains
943
+ - **Multi-Stablecoin Support**: Added support for 4 stablecoins on EVM chains
887
944
  - USDC (all EVM chains)
888
945
  - EURC (Ethereum, Base, Avalanche)
889
946
  - AUSD (Ethereum, Arbitrum, Avalanche, Polygon, Monad)
890
947
  - PYUSD (Ethereum)
891
- - GHO (Ethereum, Base, Arbitrum)
892
- - crvUSD (Ethereum, Arbitrum)
893
948
  - Added `TokenType` literal type and `TokenConfig` dataclass
894
949
  - Added token helper functions: `get_token_config()`, `get_supported_tokens()`, `is_token_supported()`, `get_networks_by_token()`
895
950
  - Added `tokens` field to `NetworkConfig` for multi-token configurations
File without changes
File without changes