uvd-x402-sdk 0.2.1__py3-none-any.whl → 0.2.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 +1 -1
- uvd_x402_sdk/networks/solana.py +29 -16
- {uvd_x402_sdk-0.2.1.dist-info → uvd_x402_sdk-0.2.2.dist-info}/METADATA +1 -1
- {uvd_x402_sdk-0.2.1.dist-info → uvd_x402_sdk-0.2.2.dist-info}/RECORD +7 -7
- {uvd_x402_sdk-0.2.1.dist-info → uvd_x402_sdk-0.2.2.dist-info}/LICENSE +0 -0
- {uvd_x402_sdk-0.2.1.dist-info → uvd_x402_sdk-0.2.2.dist-info}/WHEEL +0 -0
- {uvd_x402_sdk-0.2.1.dist-info → uvd_x402_sdk-0.2.2.dist-info}/top_level.txt +0 -0
uvd_x402_sdk/__init__.py
CHANGED
uvd_x402_sdk/networks/solana.py
CHANGED
|
@@ -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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
uvd_x402_sdk/__init__.py,sha256=
|
|
1
|
+
uvd_x402_sdk/__init__.py,sha256=Z_q46CqoCRpvkm_czDHeGHSkJKczlGfaS0JYjfvYzeM,4662
|
|
2
2
|
uvd_x402_sdk/client.py,sha256=oWPnm7uKeIrIx4hD_NCopDDDaKU0dP8E8SGHvzwByew,18916
|
|
3
3
|
uvd_x402_sdk/config.py,sha256=UEQC9Cnk2Q7MLPebqjog7ucTyMJkGw8-OhL7v8JEJww,8892
|
|
4
4
|
uvd_x402_sdk/decorators.py,sha256=dojuSHXdJ029aMC3IVTqQtZAy_Z9FJlY-Lm23qtlJUw,10092
|
|
@@ -14,10 +14,10 @@ uvd_x402_sdk/networks/__init__.py,sha256=mBspQT3gtN6qRCmk-2Qa1I70d9BURk6po2OCCJE
|
|
|
14
14
|
uvd_x402_sdk/networks/base.py,sha256=HU5ca8Lp6x5QHEZxtHUkp1qM7F1t84kgxCAROyEOMaI,10264
|
|
15
15
|
uvd_x402_sdk/networks/evm.py,sha256=hSAkQAu537lQWWZn2iO_o33N5Qmqe7ZtzbghjP42N7Y,5866
|
|
16
16
|
uvd_x402_sdk/networks/near.py,sha256=R88fxEDE0W6buUrs_Hlc1LyJ4OSXTZlmCf393-CxjAg,12005
|
|
17
|
-
uvd_x402_sdk/networks/solana.py,sha256=
|
|
17
|
+
uvd_x402_sdk/networks/solana.py,sha256=pWdwUe3N08bCu75CUn_8UzjMFfygMPeNhB1Hf0J2vac,9633
|
|
18
18
|
uvd_x402_sdk/networks/stellar.py,sha256=luXKdqUwJHRa8N0hfOoMEpny3u1PS7nNtU6c8VGqpIY,3663
|
|
19
|
-
uvd_x402_sdk-0.2.
|
|
20
|
-
uvd_x402_sdk-0.2.
|
|
21
|
-
uvd_x402_sdk-0.2.
|
|
22
|
-
uvd_x402_sdk-0.2.
|
|
23
|
-
uvd_x402_sdk-0.2.
|
|
19
|
+
uvd_x402_sdk-0.2.2.dist-info/LICENSE,sha256=_FxTbuGgcgrco5ZjC_8o-NhyoPGYuF8B86m02LavkCA,1094
|
|
20
|
+
uvd_x402_sdk-0.2.2.dist-info/METADATA,sha256=tofqPIOfpHE-ZWOvayGvD1fXJsqFJKLPtlEUTYwbAr0,22679
|
|
21
|
+
uvd_x402_sdk-0.2.2.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
22
|
+
uvd_x402_sdk-0.2.2.dist-info/top_level.txt,sha256=Exyjj_Kl7CDAGFMi72lT9oFPOYiRNZb3l8tr906mMmc,13
|
|
23
|
+
uvd_x402_sdk-0.2.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|