uvd-x402-sdk 0.3.0__py3-none-any.whl → 0.3.2__py3-none-any.whl

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.
uvd_x402_sdk/__init__.py CHANGED
@@ -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
@@ -1,4 +1,4 @@
1
- uvd_x402_sdk/__init__.py,sha256=0IwhkXv-aqP1TbTuoHtL91TeRp2JFVbH1q6AqAbqeWI,4901
1
+ uvd_x402_sdk/__init__.py,sha256=13c09ZmjH-rO6p2JHpUVl0gr3JgyVK3LG15dhoUHlIs,4901
2
2
  uvd_x402_sdk/client.py,sha256=QbK22DtC3HmvvCezphQ-UsYX468vKrIN-M_wF4pv9cM,18389
3
3
  uvd_x402_sdk/config.py,sha256=BNGnX2RwZ_ELIcSKU7RkwTUcln4LMFZdCwG1ptASKN8,8644
4
4
  uvd_x402_sdk/decorators.py,sha256=XJ7V4554hsa-AVDrizF1oKmeTysg5zlkQRcaeGBI73E,9767
@@ -10,14 +10,14 @@ uvd_x402_sdk/integrations/django_integration.py,sha256=e3xaV1Yz3HHI7zZBNcyTmV0Js
10
10
  uvd_x402_sdk/integrations/fastapi_integration.py,sha256=j5h1IJwFLBBoWov7ANLCFaxeCa8pugn-XU9ibrzIL0Y,10205
11
11
  uvd_x402_sdk/integrations/flask_integration.py,sha256=0iQKO5-WRxE76Pv-1jEl4lYhjCLmq_R-jxR5g9xIcKw,8825
12
12
  uvd_x402_sdk/integrations/lambda_integration.py,sha256=nRf4o3nS6Syx-d5P0kEhz66y7jb_S4w-mwaIazgiA9c,10184
13
- uvd_x402_sdk/networks/__init__.py,sha256=cqTW4NCuEKhsOSRAQDsusu1m1PaHCf791drVXLCYxUU,2100
14
- uvd_x402_sdk/networks/base.py,sha256=3wrm2aAmMxxdeCqGBArKFXkpARwWtokkOM_jeg_gJNI,14505
15
- uvd_x402_sdk/networks/evm.py,sha256=Ua1Rq7YPC_t5ZxnLi2_MK0kloaZNYW5ykllfQshYWMg,9950
13
+ uvd_x402_sdk/networks/__init__.py,sha256=5EECOYHl2OukNv55sIJlHlU4XI9s1Uv2ksoXnxkpduM,2039
14
+ uvd_x402_sdk/networks/base.py,sha256=At8ujOr7snjWqdQQ2-vACQ4AshVvSn0FsennGF6BpQk,14347
15
+ uvd_x402_sdk/networks/evm.py,sha256=ezgZ0MHX6iWsb0VoleOJHJoMB7dF9evQxeLCGD-aEbs,8890
16
16
  uvd_x402_sdk/networks/near.py,sha256=sxbxT1NqjcENh8ysFLDpAx5DGizf1EI0YjwgviLfqcY,11608
17
17
  uvd_x402_sdk/networks/solana.py,sha256=kVSHRi57eTJdBtgI8SUbHfQUxYzx-_YvI_bEB0HIvNg,9351
18
18
  uvd_x402_sdk/networks/stellar.py,sha256=c-6re-dVc2-6gJ5rL4krUTaFsPz5vkactOJD-0wowBA,3534
19
- uvd_x402_sdk-0.3.0.dist-info/LICENSE,sha256=OcLzB_iSgMbvk7b0dlyvleY_IbL2WUaPxvn1CHw2uAc,1073
20
- uvd_x402_sdk-0.3.0.dist-info/METADATA,sha256=Yrj2HBiKah89TNsI3liY-LQYMCirwJxWUTsKO2WpPJw,26948
21
- uvd_x402_sdk-0.3.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
22
- uvd_x402_sdk-0.3.0.dist-info/top_level.txt,sha256=Exyjj_Kl7CDAGFMi72lT9oFPOYiRNZb3l8tr906mMmc,13
23
- uvd_x402_sdk-0.3.0.dist-info/RECORD,,
19
+ uvd_x402_sdk-0.3.2.dist-info/LICENSE,sha256=OcLzB_iSgMbvk7b0dlyvleY_IbL2WUaPxvn1CHw2uAc,1073
20
+ uvd_x402_sdk-0.3.2.dist-info/METADATA,sha256=B_s8VazTzB4gTi2bmKhQuzGH84Efoj0R-7VaE2fth6s,29150
21
+ uvd_x402_sdk-0.3.2.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
22
+ uvd_x402_sdk-0.3.2.dist-info/top_level.txt,sha256=Exyjj_Kl7CDAGFMi72lT9oFPOYiRNZb3l8tr906mMmc,13
23
+ uvd_x402_sdk-0.3.2.dist-info/RECORD,,