uvd-x402-sdk 0.2.0__tar.gz → 0.2.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.
- {uvd_x402_sdk-0.2.0/src/uvd_x402_sdk.egg-info → uvd_x402_sdk-0.2.2}/PKG-INFO +11 -9
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/README.md +10 -8
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/pyproject.toml +1 -1
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/__init__.py +5 -5
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/config.py +5 -6
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/networks/__init__.py +3 -3
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/networks/base.py +1 -2
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/networks/evm.py +1 -21
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/networks/solana.py +29 -16
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2/src/uvd_x402_sdk.egg-info}/PKG-INFO +11 -9
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/LICENSE +0 -0
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/setup.cfg +0 -0
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/client.py +0 -0
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/decorators.py +0 -0
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/exceptions.py +0 -0
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/integrations/__init__.py +0 -0
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/integrations/django_integration.py +0 -0
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/integrations/fastapi_integration.py +0 -0
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/integrations/flask_integration.py +0 -0
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/integrations/lambda_integration.py +0 -0
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/models.py +0 -0
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/networks/near.py +0 -0
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/networks/stellar.py +0 -0
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/response.py +0 -0
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk.egg-info/SOURCES.txt +0 -0
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk.egg-info/dependency_links.txt +0 -0
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk.egg-info/requires.txt +0 -0
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk.egg-info/top_level.txt +0 -0
- {uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/tests/test_client.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: uvd-x402-sdk
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Python SDK for integrating x402 payments via the Ultravioleta DAO facilitator
|
|
5
5
|
Author-email: Ultravioleta DAO <dev@ultravioletadao.xyz>
|
|
6
6
|
Project-URL: Homepage, https://github.com/UltravioletaDAO/uvd-x402-sdk-python
|
|
@@ -51,11 +51,11 @@ Requires-Dist: httpx>=0.24.0; extra == "dev"
|
|
|
51
51
|
|
|
52
52
|
Python SDK for integrating **x402 cryptocurrency payments** via the Ultravioleta DAO facilitator.
|
|
53
53
|
|
|
54
|
-
Accept USDC payments across **
|
|
54
|
+
Accept USDC payments across **14 blockchain networks** with a single integration. The SDK handles signature verification, on-chain settlement, and all the complexity of multi-chain payments.
|
|
55
55
|
|
|
56
56
|
## Features
|
|
57
57
|
|
|
58
|
-
- **
|
|
58
|
+
- **14 Networks**: EVM chains (Base, Ethereum, Polygon, etc.), SVM chains (Solana, Fogo), NEAR, and Stellar
|
|
59
59
|
- **x402 v1 & v2**: Full support for both protocol versions with auto-detection
|
|
60
60
|
- **Framework Integrations**: Flask, FastAPI, Django, AWS Lambda
|
|
61
61
|
- **Gasless Payments**: Users sign authorizations, facilitator pays all network fees
|
|
@@ -88,14 +88,11 @@ print(f"Paid by {result.payer_address}, tx: {result.transaction_hash}")
|
|
|
88
88
|
| HyperEVM | EVM | 999 | `eip155:999` | Active |
|
|
89
89
|
| Unichain | EVM | 130 | `eip155:130` | Active |
|
|
90
90
|
| Monad | EVM | 143 | `eip155:143` | Active |
|
|
91
|
-
| BSC | EVM | 56 | `eip155:56` | Disabled* |
|
|
92
91
|
| Solana | SVM | - | `solana:5eykt...` | Active |
|
|
93
92
|
| Fogo | SVM | - | `solana:fogo` | Active |
|
|
94
93
|
| NEAR | NEAR | - | `near:mainnet` | Active |
|
|
95
94
|
| Stellar | Stellar | - | `stellar:pubnet` | Active |
|
|
96
95
|
|
|
97
|
-
*BSC's USDC doesn't support ERC-3009 TransferWithAuthorization
|
|
98
|
-
|
|
99
96
|
## Installation
|
|
100
97
|
|
|
101
98
|
```bash
|
|
@@ -689,7 +686,7 @@ The facilitator (https://facilitator.ultravioletadao.xyz) handles all on-chain i
|
|
|
689
686
|
|
|
690
687
|
**"Unsupported network"**
|
|
691
688
|
- Check that the network is in `supported_networks`
|
|
692
|
-
- Verify the network is enabled
|
|
689
|
+
- Verify the network is enabled
|
|
693
690
|
- For v2, ensure CAIP-2 format is correct
|
|
694
691
|
|
|
695
692
|
**"Payment verification failed"**
|
|
@@ -756,6 +753,12 @@ MIT License - see LICENSE file.
|
|
|
756
753
|
|
|
757
754
|
## Changelog
|
|
758
755
|
|
|
756
|
+
### v0.2.1 (2025-12-16)
|
|
757
|
+
|
|
758
|
+
- Removed BSC network (doesn't support ERC-3009)
|
|
759
|
+
- Added GitHub Actions workflow for PyPI publishing
|
|
760
|
+
- Updated to 14 supported networks
|
|
761
|
+
|
|
759
762
|
### v0.2.0 (2025-12-15)
|
|
760
763
|
|
|
761
764
|
- Added **NEAR Protocol** support with NEP-366 meta-transactions
|
|
@@ -766,11 +769,10 @@ MIT License - see LICENSE file.
|
|
|
766
769
|
- Added CAIP-2 parsing utilities (`parse_caip2_network`, `to_caip2_network`)
|
|
767
770
|
- Added `MultiPaymentConfig` for multi-network recipient configuration
|
|
768
771
|
- Added `Payment402BuilderV2` for v2 response construction
|
|
769
|
-
- Updated to 15 supported networks (14 enabled)
|
|
770
772
|
|
|
771
773
|
### v0.1.0 (2025-12-01)
|
|
772
774
|
|
|
773
775
|
- Initial release
|
|
774
|
-
-
|
|
776
|
+
- EVM, Solana, Stellar network support
|
|
775
777
|
- Flask, FastAPI, Django, Lambda integrations
|
|
776
778
|
- Full Pydantic models
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Python SDK for integrating **x402 cryptocurrency payments** via the Ultravioleta DAO facilitator.
|
|
4
4
|
|
|
5
|
-
Accept USDC payments across **
|
|
5
|
+
Accept USDC payments across **14 blockchain networks** with a single integration. The SDK handles signature verification, on-chain settlement, and all the complexity of multi-chain payments.
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
|
-
- **
|
|
9
|
+
- **14 Networks**: EVM chains (Base, Ethereum, Polygon, etc.), SVM chains (Solana, Fogo), NEAR, and Stellar
|
|
10
10
|
- **x402 v1 & v2**: Full support for both protocol versions with auto-detection
|
|
11
11
|
- **Framework Integrations**: Flask, FastAPI, Django, AWS Lambda
|
|
12
12
|
- **Gasless Payments**: Users sign authorizations, facilitator pays all network fees
|
|
@@ -39,14 +39,11 @@ print(f"Paid by {result.payer_address}, tx: {result.transaction_hash}")
|
|
|
39
39
|
| HyperEVM | EVM | 999 | `eip155:999` | Active |
|
|
40
40
|
| Unichain | EVM | 130 | `eip155:130` | Active |
|
|
41
41
|
| Monad | EVM | 143 | `eip155:143` | Active |
|
|
42
|
-
| BSC | EVM | 56 | `eip155:56` | Disabled* |
|
|
43
42
|
| Solana | SVM | - | `solana:5eykt...` | Active |
|
|
44
43
|
| Fogo | SVM | - | `solana:fogo` | Active |
|
|
45
44
|
| NEAR | NEAR | - | `near:mainnet` | Active |
|
|
46
45
|
| Stellar | Stellar | - | `stellar:pubnet` | Active |
|
|
47
46
|
|
|
48
|
-
*BSC's USDC doesn't support ERC-3009 TransferWithAuthorization
|
|
49
|
-
|
|
50
47
|
## Installation
|
|
51
48
|
|
|
52
49
|
```bash
|
|
@@ -640,7 +637,7 @@ The facilitator (https://facilitator.ultravioletadao.xyz) handles all on-chain i
|
|
|
640
637
|
|
|
641
638
|
**"Unsupported network"**
|
|
642
639
|
- Check that the network is in `supported_networks`
|
|
643
|
-
- Verify the network is enabled
|
|
640
|
+
- Verify the network is enabled
|
|
644
641
|
- For v2, ensure CAIP-2 format is correct
|
|
645
642
|
|
|
646
643
|
**"Payment verification failed"**
|
|
@@ -707,6 +704,12 @@ MIT License - see LICENSE file.
|
|
|
707
704
|
|
|
708
705
|
## Changelog
|
|
709
706
|
|
|
707
|
+
### v0.2.1 (2025-12-16)
|
|
708
|
+
|
|
709
|
+
- Removed BSC network (doesn't support ERC-3009)
|
|
710
|
+
- Added GitHub Actions workflow for PyPI publishing
|
|
711
|
+
- Updated to 14 supported networks
|
|
712
|
+
|
|
710
713
|
### v0.2.0 (2025-12-15)
|
|
711
714
|
|
|
712
715
|
- Added **NEAR Protocol** support with NEP-366 meta-transactions
|
|
@@ -717,11 +720,10 @@ MIT License - see LICENSE file.
|
|
|
717
720
|
- Added CAIP-2 parsing utilities (`parse_caip2_network`, `to_caip2_network`)
|
|
718
721
|
- Added `MultiPaymentConfig` for multi-network recipient configuration
|
|
719
722
|
- Added `Payment402BuilderV2` for v2 response construction
|
|
720
|
-
- Updated to 15 supported networks (14 enabled)
|
|
721
723
|
|
|
722
724
|
### v0.1.0 (2025-12-01)
|
|
723
725
|
|
|
724
726
|
- Initial release
|
|
725
|
-
-
|
|
727
|
+
- EVM, Solana, Stellar network support
|
|
726
728
|
- Flask, FastAPI, Django, Lambda integrations
|
|
727
729
|
- Full Pydantic models
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
uvd-x402-sdk: Python SDK for x402 payments via Ultravioleta DAO facilitator.
|
|
3
3
|
|
|
4
4
|
This SDK enables developers to easily integrate x402 cryptocurrency payments
|
|
5
|
-
into their Python applications with support for
|
|
5
|
+
into their Python applications with support for 14 blockchain networks across
|
|
6
6
|
4 network types (EVM, SVM, NEAR, Stellar).
|
|
7
7
|
|
|
8
8
|
Supports both x402 v1 and v2 protocols:
|
|
@@ -29,15 +29,15 @@ Example usage:
|
|
|
29
29
|
def protected_endpoint():
|
|
30
30
|
return {"message": "Payment verified!"}
|
|
31
31
|
|
|
32
|
-
Supported Networks (
|
|
33
|
-
- EVM (
|
|
34
|
-
HyperEVM, Unichain, Monad
|
|
32
|
+
Supported Networks (14 total):
|
|
33
|
+
- EVM (10): Base, Ethereum, Polygon, Arbitrum, Optimism, Avalanche, Celo,
|
|
34
|
+
HyperEVM, Unichain, Monad
|
|
35
35
|
- SVM (2): Solana, Fogo
|
|
36
36
|
- NEAR (1): NEAR Protocol
|
|
37
37
|
- Stellar (1): Stellar
|
|
38
38
|
"""
|
|
39
39
|
|
|
40
|
-
__version__ = "0.2.
|
|
40
|
+
__version__ = "0.2.2"
|
|
41
41
|
__author__ = "Ultravioleta DAO"
|
|
42
42
|
|
|
43
43
|
from uvd_x402_sdk.client import X402Client
|
|
@@ -84,17 +84,16 @@ class X402Config:
|
|
|
84
84
|
verify_timeout: float = 30.0
|
|
85
85
|
settle_timeout: float = 55.0 # Must be < Lambda timeout (60s)
|
|
86
86
|
|
|
87
|
-
# Network configuration - All
|
|
87
|
+
# Network configuration - All 14 networks
|
|
88
88
|
supported_networks: List[str] = field(default_factory=lambda: [
|
|
89
|
-
# EVM chains (
|
|
89
|
+
# EVM chains (10)
|
|
90
90
|
"base", "ethereum", "polygon", "arbitrum", "optimism",
|
|
91
91
|
"avalanche", "celo", "hyperevm", "unichain", "monad",
|
|
92
|
-
#
|
|
93
|
-
# SVM chains (2 total, 2 enabled)
|
|
92
|
+
# SVM chains (2)
|
|
94
93
|
"solana", "fogo",
|
|
95
|
-
# NEAR (1
|
|
94
|
+
# NEAR (1)
|
|
96
95
|
"near",
|
|
97
|
-
# Stellar (1
|
|
96
|
+
# Stellar (1)
|
|
98
97
|
"stellar",
|
|
99
98
|
])
|
|
100
99
|
|
|
@@ -4,9 +4,9 @@ Network configurations for x402 payments.
|
|
|
4
4
|
This module provides configuration for all supported blockchain networks,
|
|
5
5
|
including USDC contract addresses, RPC URLs, and network-specific parameters.
|
|
6
6
|
|
|
7
|
-
The SDK supports
|
|
8
|
-
-
|
|
9
|
-
Celo, HyperEVM, Unichain,
|
|
7
|
+
The SDK supports 14 mainnet networks out of the box:
|
|
8
|
+
- 10 EVM chains: Base, Ethereum, Polygon, Arbitrum, Optimism, Avalanche,
|
|
9
|
+
Celo, HyperEVM, Unichain, Monad
|
|
10
10
|
- 2 SVM chains: Solana, Fogo
|
|
11
11
|
- 1 NEAR: NEAR Protocol
|
|
12
12
|
- 1 Stellar: Stellar
|
|
@@ -48,7 +48,7 @@ class NetworkConfig:
|
|
|
48
48
|
network_type: Type of network (EVM, SOLANA, NEAR, STELLAR)
|
|
49
49
|
chain_id: EVM chain ID (0 for non-EVM networks)
|
|
50
50
|
usdc_address: USDC contract/token address
|
|
51
|
-
usdc_decimals: Number of decimals for USDC (
|
|
51
|
+
usdc_decimals: Number of decimals for USDC (6 for EVM/SVM, 7 for Stellar)
|
|
52
52
|
usdc_domain_name: EIP-712 domain name for USDC (EVM only)
|
|
53
53
|
usdc_domain_version: EIP-712 domain version (EVM only)
|
|
54
54
|
rpc_url: Default RPC endpoint
|
|
@@ -234,7 +234,6 @@ _NETWORK_TO_CAIP2 = {
|
|
|
234
234
|
"hyperevm": "eip155:999",
|
|
235
235
|
"unichain": "eip155:130",
|
|
236
236
|
"monad": "eip155:143",
|
|
237
|
-
"bsc": "eip155:56",
|
|
238
237
|
# SVM chains (solana:genesisHash first 32 chars)
|
|
239
238
|
"solana": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
|
|
240
239
|
"fogo": "solana:fogo", # Placeholder - update when known
|
|
@@ -7,7 +7,6 @@ Each chain uses ERC-3009 TransferWithAuthorization for USDC transfers.
|
|
|
7
7
|
Important EIP-712 domain considerations:
|
|
8
8
|
- Most chains use 'USD Coin' as the domain name
|
|
9
9
|
- Celo, HyperEVM, Unichain, Monad use 'USDC' as the domain name
|
|
10
|
-
- BSC USDC uses 18 decimals (not standard 6)
|
|
11
10
|
"""
|
|
12
11
|
|
|
13
12
|
from uvd_x402_sdk.networks.base import (
|
|
@@ -164,22 +163,6 @@ MONAD = NetworkConfig(
|
|
|
164
163
|
enabled=True,
|
|
165
164
|
)
|
|
166
165
|
|
|
167
|
-
# BNB Smart Chain (BSC)
|
|
168
|
-
# NOTE: BSC USDC uses 18 decimals (not 6 like other chains)
|
|
169
|
-
# NOTE: Binance-Peg USDC doesn't support ERC-3009 - DISABLED
|
|
170
|
-
BSC = NetworkConfig(
|
|
171
|
-
name="bsc",
|
|
172
|
-
display_name="BNB Smart Chain",
|
|
173
|
-
network_type=NetworkType.EVM,
|
|
174
|
-
chain_id=56,
|
|
175
|
-
usdc_address="0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
|
|
176
|
-
usdc_decimals=18, # Different from other chains!
|
|
177
|
-
usdc_domain_name="USD Coin",
|
|
178
|
-
usdc_domain_version="2",
|
|
179
|
-
rpc_url="https://binance.llamarpc.com",
|
|
180
|
-
enabled=False, # Disabled: Binance-Peg USDC doesn't support ERC-3009
|
|
181
|
-
)
|
|
182
|
-
|
|
183
166
|
# =============================================================================
|
|
184
167
|
# Register all EVM networks
|
|
185
168
|
# =============================================================================
|
|
@@ -195,7 +178,6 @@ _EVM_NETWORKS = [
|
|
|
195
178
|
HYPEREVM,
|
|
196
179
|
UNICHAIN,
|
|
197
180
|
MONAD,
|
|
198
|
-
BSC,
|
|
199
181
|
]
|
|
200
182
|
|
|
201
183
|
for network in _EVM_NETWORKS:
|
|
@@ -228,8 +210,6 @@ def get_token_decimals(network_name: str) -> int:
|
|
|
228
210
|
network_name: Network identifier
|
|
229
211
|
|
|
230
212
|
Returns:
|
|
231
|
-
Number of decimals (6 for
|
|
213
|
+
Number of decimals (6 for all supported chains)
|
|
232
214
|
"""
|
|
233
|
-
if network_name.lower() == "bsc":
|
|
234
|
-
return 18
|
|
235
215
|
return 6
|
|
@@ -11,12 +11,17 @@ All SVM chains use the same payment flow:
|
|
|
11
11
|
3. Facilitator is fee payer (user pays ZERO SOL/tokens)
|
|
12
12
|
4. Facilitator co-signs and submits transaction
|
|
13
13
|
|
|
14
|
-
Transaction Structure (
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
Transaction Structure (flexible, facilitator v1.9.4+):
|
|
15
|
+
- SetComputeUnitLimit instruction (recommended: 20,000 units)
|
|
16
|
+
- SetComputeUnitPrice instruction (recommended: 100,000 microLamports)
|
|
17
|
+
- TransferChecked (USDC transfer)
|
|
18
|
+
- Optional: CreateAssociatedTokenAccount (if recipient ATA doesn't exist)
|
|
19
|
+
- Additional instructions may be added by wallets (e.g., Phantom memo)
|
|
20
|
+
|
|
21
|
+
The facilitator scans for the transfer instruction rather than requiring
|
|
22
|
+
fixed positions, allowing wallets like Phantom to add extra instructions.
|
|
23
|
+
The full signed transaction is sent to the facilitator, which uses it
|
|
24
|
+
exactly as signed (no reconstruction).
|
|
20
25
|
"""
|
|
21
26
|
|
|
22
27
|
import base64
|
|
@@ -52,8 +57,8 @@ SOLANA = NetworkConfig(
|
|
|
52
57
|
"ata_program_id": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
53
58
|
# Default compute units for transfer
|
|
54
59
|
"compute_units": 20000,
|
|
55
|
-
#
|
|
56
|
-
"priority_fee_microlamports":
|
|
60
|
+
# Priority fee in microLamports (100k for fast landing on mainnet)
|
|
61
|
+
"priority_fee_microlamports": 100_000,
|
|
57
62
|
# Block explorer
|
|
58
63
|
"explorer_url": "https://solscan.io",
|
|
59
64
|
# Genesis hash (first 32 chars for CAIP-2)
|
|
@@ -82,8 +87,8 @@ FOGO = NetworkConfig(
|
|
|
82
87
|
"ata_program_id": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
83
88
|
# Default compute units for transfer
|
|
84
89
|
"compute_units": 20000,
|
|
85
|
-
#
|
|
86
|
-
"priority_fee_microlamports":
|
|
90
|
+
# Priority fee in microLamports (100k for fast landing)
|
|
91
|
+
"priority_fee_microlamports": 100_000,
|
|
87
92
|
# Block explorer (placeholder - update when available)
|
|
88
93
|
"explorer_url": "https://explorer.fogo.nightly.app",
|
|
89
94
|
# Network type identifier
|
|
@@ -165,11 +170,17 @@ def validate_svm_transaction_structure(transaction_base64: str) -> bool:
|
|
|
165
170
|
"""
|
|
166
171
|
Validate that an SVM transaction has the correct structure for x402.
|
|
167
172
|
|
|
168
|
-
The facilitator expects:
|
|
169
|
-
- VersionedTransaction with
|
|
170
|
-
-
|
|
171
|
-
-
|
|
172
|
-
-
|
|
173
|
+
The facilitator expects (flexible order, Dec 2024+):
|
|
174
|
+
- VersionedTransaction with at least 3 instructions
|
|
175
|
+
- SetComputeUnitLimit instruction (any position)
|
|
176
|
+
- SetComputeUnitPrice instruction (any position)
|
|
177
|
+
- TransferChecked instruction (SPL token)
|
|
178
|
+
- Optional: CreateAssociatedTokenAccount instruction
|
|
179
|
+
- Optional: Additional instructions from wallet (e.g., Phantom memo)
|
|
180
|
+
|
|
181
|
+
Note: Wallets like Phantom may add extra instructions during signing.
|
|
182
|
+
The facilitator v1.9.4+ handles this by scanning for the transfer
|
|
183
|
+
instruction rather than requiring fixed positions.
|
|
173
184
|
|
|
174
185
|
Args:
|
|
175
186
|
transaction_base64: Base64-encoded serialized transaction
|
|
@@ -266,4 +277,6 @@ SET_COMPUTE_UNIT_PRICE_DISCRIMINATOR = 3
|
|
|
266
277
|
|
|
267
278
|
# Default values for x402 transactions
|
|
268
279
|
DEFAULT_COMPUTE_UNITS = 20000
|
|
269
|
-
|
|
280
|
+
# Use 100k microlamports/CU for fast landing on mainnet
|
|
281
|
+
# Lower values (like 1) cause transactions to be deprioritized and time out
|
|
282
|
+
DEFAULT_PRIORITY_FEE_MICROLAMPORTS = 100_000
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: uvd-x402-sdk
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Python SDK for integrating x402 payments via the Ultravioleta DAO facilitator
|
|
5
5
|
Author-email: Ultravioleta DAO <dev@ultravioletadao.xyz>
|
|
6
6
|
Project-URL: Homepage, https://github.com/UltravioletaDAO/uvd-x402-sdk-python
|
|
@@ -51,11 +51,11 @@ Requires-Dist: httpx>=0.24.0; extra == "dev"
|
|
|
51
51
|
|
|
52
52
|
Python SDK for integrating **x402 cryptocurrency payments** via the Ultravioleta DAO facilitator.
|
|
53
53
|
|
|
54
|
-
Accept USDC payments across **
|
|
54
|
+
Accept USDC payments across **14 blockchain networks** with a single integration. The SDK handles signature verification, on-chain settlement, and all the complexity of multi-chain payments.
|
|
55
55
|
|
|
56
56
|
## Features
|
|
57
57
|
|
|
58
|
-
- **
|
|
58
|
+
- **14 Networks**: EVM chains (Base, Ethereum, Polygon, etc.), SVM chains (Solana, Fogo), NEAR, and Stellar
|
|
59
59
|
- **x402 v1 & v2**: Full support for both protocol versions with auto-detection
|
|
60
60
|
- **Framework Integrations**: Flask, FastAPI, Django, AWS Lambda
|
|
61
61
|
- **Gasless Payments**: Users sign authorizations, facilitator pays all network fees
|
|
@@ -88,14 +88,11 @@ print(f"Paid by {result.payer_address}, tx: {result.transaction_hash}")
|
|
|
88
88
|
| HyperEVM | EVM | 999 | `eip155:999` | Active |
|
|
89
89
|
| Unichain | EVM | 130 | `eip155:130` | Active |
|
|
90
90
|
| Monad | EVM | 143 | `eip155:143` | Active |
|
|
91
|
-
| BSC | EVM | 56 | `eip155:56` | Disabled* |
|
|
92
91
|
| Solana | SVM | - | `solana:5eykt...` | Active |
|
|
93
92
|
| Fogo | SVM | - | `solana:fogo` | Active |
|
|
94
93
|
| NEAR | NEAR | - | `near:mainnet` | Active |
|
|
95
94
|
| Stellar | Stellar | - | `stellar:pubnet` | Active |
|
|
96
95
|
|
|
97
|
-
*BSC's USDC doesn't support ERC-3009 TransferWithAuthorization
|
|
98
|
-
|
|
99
96
|
## Installation
|
|
100
97
|
|
|
101
98
|
```bash
|
|
@@ -689,7 +686,7 @@ The facilitator (https://facilitator.ultravioletadao.xyz) handles all on-chain i
|
|
|
689
686
|
|
|
690
687
|
**"Unsupported network"**
|
|
691
688
|
- Check that the network is in `supported_networks`
|
|
692
|
-
- Verify the network is enabled
|
|
689
|
+
- Verify the network is enabled
|
|
693
690
|
- For v2, ensure CAIP-2 format is correct
|
|
694
691
|
|
|
695
692
|
**"Payment verification failed"**
|
|
@@ -756,6 +753,12 @@ MIT License - see LICENSE file.
|
|
|
756
753
|
|
|
757
754
|
## Changelog
|
|
758
755
|
|
|
756
|
+
### v0.2.1 (2025-12-16)
|
|
757
|
+
|
|
758
|
+
- Removed BSC network (doesn't support ERC-3009)
|
|
759
|
+
- Added GitHub Actions workflow for PyPI publishing
|
|
760
|
+
- Updated to 14 supported networks
|
|
761
|
+
|
|
759
762
|
### v0.2.0 (2025-12-15)
|
|
760
763
|
|
|
761
764
|
- Added **NEAR Protocol** support with NEP-366 meta-transactions
|
|
@@ -766,11 +769,10 @@ MIT License - see LICENSE file.
|
|
|
766
769
|
- Added CAIP-2 parsing utilities (`parse_caip2_network`, `to_caip2_network`)
|
|
767
770
|
- Added `MultiPaymentConfig` for multi-network recipient configuration
|
|
768
771
|
- Added `Payment402BuilderV2` for v2 response construction
|
|
769
|
-
- Updated to 15 supported networks (14 enabled)
|
|
770
772
|
|
|
771
773
|
### v0.1.0 (2025-12-01)
|
|
772
774
|
|
|
773
775
|
- Initial release
|
|
774
|
-
-
|
|
776
|
+
- EVM, Solana, Stellar network support
|
|
775
777
|
- Flask, FastAPI, Django, Lambda integrations
|
|
776
778
|
- Full Pydantic models
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/integrations/django_integration.py
RENAMED
|
File without changes
|
{uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/integrations/fastapi_integration.py
RENAMED
|
File without changes
|
{uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/integrations/flask_integration.py
RENAMED
|
File without changes
|
{uvd_x402_sdk-0.2.0 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/integrations/lambda_integration.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|