uvd-x402-sdk 0.2.1__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.
Files changed (29) hide show
  1. {uvd_x402_sdk-0.2.1/src/uvd_x402_sdk.egg-info → uvd_x402_sdk-0.2.2}/PKG-INFO +1 -1
  2. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/pyproject.toml +1 -1
  3. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/__init__.py +1 -1
  4. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/networks/solana.py +29 -16
  5. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2/src/uvd_x402_sdk.egg-info}/PKG-INFO +1 -1
  6. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/LICENSE +0 -0
  7. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/README.md +0 -0
  8. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/setup.cfg +0 -0
  9. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/client.py +0 -0
  10. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/config.py +0 -0
  11. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/decorators.py +0 -0
  12. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/exceptions.py +0 -0
  13. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/integrations/__init__.py +0 -0
  14. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/integrations/django_integration.py +0 -0
  15. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/integrations/fastapi_integration.py +0 -0
  16. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/integrations/flask_integration.py +0 -0
  17. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/integrations/lambda_integration.py +0 -0
  18. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/models.py +0 -0
  19. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/networks/__init__.py +0 -0
  20. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/networks/base.py +0 -0
  21. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/networks/evm.py +0 -0
  22. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/networks/near.py +0 -0
  23. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/networks/stellar.py +0 -0
  24. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk/response.py +0 -0
  25. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk.egg-info/SOURCES.txt +0 -0
  26. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk.egg-info/dependency_links.txt +0 -0
  27. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk.egg-info/requires.txt +0 -0
  28. {uvd_x402_sdk-0.2.1 → uvd_x402_sdk-0.2.2}/src/uvd_x402_sdk.egg-info/top_level.txt +0 -0
  29. {uvd_x402_sdk-0.2.1 → 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.1
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "uvd-x402-sdk"
7
- version = "0.2.1"
7
+ version = "0.2.2"
8
8
  description = "Python SDK for integrating x402 payments via the Ultravioleta DAO facilitator"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -37,7 +37,7 @@ Supported Networks (14 total):
37
37
  - Stellar (1): Stellar
38
38
  """
39
39
 
40
- __version__ = "0.2.1"
40
+ __version__ = "0.2.2"
41
41
  __author__ = "Ultravioleta DAO"
42
42
 
43
43
  from uvd_x402_sdk.client import X402Client
@@ -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 (REQUIRED by facilitator):
15
- - Instruction 0: SetComputeUnitLimit (units: 20,000)
16
- - Instruction 1: SetComputeUnitPrice (microLamports: 1)
17
- - Instruction 2: TransferChecked (USDC transfer)
18
-
19
- The facilitator validates this exact structure in src/chain/solana.rs.
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
- # Default priority fee in microLamports
56
- "priority_fee_microlamports": 1,
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
- # Default priority fee in microLamports
86
- "priority_fee_microlamports": 1,
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 exactly 3 instructions
170
- - Instruction 0: SetComputeUnitLimit
171
- - Instruction 1: SetComputeUnitPrice
172
- - Instruction 2: TransferChecked (SPL token)
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
- DEFAULT_PRIORITY_FEE_MICROLAMPORTS = 1
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.1
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
File without changes
File without changes
File without changes