uvd-x402-sdk 0.5.1__tar.gz → 0.5.4__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 (32) hide show
  1. {uvd_x402_sdk-0.5.1/src/uvd_x402_sdk.egg-info → uvd_x402_sdk-0.5.4}/PKG-INFO +198 -5
  2. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/README.md +195 -2
  3. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/pyproject.toml +3 -2
  4. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk/__init__.py +12 -2
  5. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk/facilitator.py +20 -0
  6. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk/networks/__init__.py +1 -1
  7. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk/networks/base.py +16 -0
  8. uvd_x402_sdk-0.5.4/src/uvd_x402_sdk/networks/sui.py +387 -0
  9. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4/src/uvd_x402_sdk.egg-info}/PKG-INFO +198 -5
  10. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk.egg-info/SOURCES.txt +1 -0
  11. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/LICENSE +0 -0
  12. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/setup.cfg +0 -0
  13. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk/client.py +0 -0
  14. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk/config.py +0 -0
  15. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk/decorators.py +0 -0
  16. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk/exceptions.py +0 -0
  17. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk/integrations/__init__.py +0 -0
  18. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk/integrations/django_integration.py +0 -0
  19. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk/integrations/fastapi_integration.py +0 -0
  20. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk/integrations/flask_integration.py +0 -0
  21. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk/integrations/lambda_integration.py +0 -0
  22. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk/models.py +0 -0
  23. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk/networks/algorand.py +0 -0
  24. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk/networks/evm.py +0 -0
  25. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk/networks/near.py +0 -0
  26. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk/networks/solana.py +0 -0
  27. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk/networks/stellar.py +0 -0
  28. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk/response.py +0 -0
  29. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk.egg-info/dependency_links.txt +0 -0
  30. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk.egg-info/requires.txt +0 -0
  31. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/src/uvd_x402_sdk.egg-info/top_level.txt +0 -0
  32. {uvd_x402_sdk-0.5.1 → uvd_x402_sdk-0.5.4}/tests/test_client.py +0 -0
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: uvd-x402-sdk
3
- Version: 0.5.1
4
- Summary: Python SDK for x402 payments - gasless crypto payments across 16 blockchains with multi-stablecoin support (USDC, EURC, AUSD, PYUSD, USDT)
3
+ Version: 0.5.4
4
+ Summary: Python SDK for x402 payments - gasless crypto payments across 18 blockchains with multi-stablecoin support (USDC, EURC, AUSD, PYUSD, USDT)
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
8
8
  Project-URL: Repository, https://github.com/UltravioletaDAO/uvd-x402-sdk-python
9
9
  Project-URL: Issues, https://github.com/UltravioletaDAO/uvd-x402-sdk-python/issues
10
- Keywords: x402,payments,crypto,usdc,eurc,stablecoin,web3,evm,solana,near,stellar,algorand,facilitator,gasless,eip-712,eip-3009
10
+ Keywords: x402,payments,crypto,usdc,eurc,stablecoin,web3,evm,solana,near,stellar,algorand,sui,facilitator,gasless,eip-712,eip-3009
11
11
  Classifier: Development Status :: 4 - Beta
12
12
  Classifier: Intended Audience :: Developers
13
13
  Classifier: License :: OSI Approved :: MIT License
@@ -53,11 +53,13 @@ Requires-Dist: httpx>=0.24.0; extra == "dev"
53
53
 
54
54
  Python SDK for integrating **x402 cryptocurrency payments** via the Ultravioleta DAO facilitator.
55
55
 
56
- Accept **gasless stablecoin 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.
56
+ Accept **gasless stablecoin payments** across **16 blockchain networks** with a single integration. The SDK handles signature verification, on-chain settlement, and all the complexity of multi-chain payments.
57
+
58
+ **New in v0.5.0+**: The SDK now includes embedded facilitator addresses - no manual configuration needed!
57
59
 
58
60
  ## Features
59
61
 
60
- - **14 Networks**: EVM chains (Base, Ethereum, Polygon, etc.), SVM chains (Solana, Fogo), NEAR, and Stellar
62
+ - **16 Networks**: EVM chains (Base, Ethereum, Polygon, etc.), SVM chains (Solana, Fogo), NEAR, Stellar, and Algorand
61
63
  - **5 Stablecoins**: USDC, EURC, AUSD, PYUSD, USDT (EVM chains)
62
64
  - **x402 v1 & v2**: Full support for both protocol versions with auto-detection
63
65
  - **Framework Integrations**: Flask, FastAPI, Django, AWS Lambda
@@ -95,6 +97,8 @@ print(f"Paid by {result.payer_address}, tx: {result.transaction_hash}")
95
97
  | Fogo | SVM | - | `solana:fogo` | Active |
96
98
  | NEAR | NEAR | - | `near:mainnet` | Active |
97
99
  | Stellar | Stellar | - | `stellar:pubnet` | Active |
100
+ | Algorand | Algorand | - | `algorand:mainnet` | Active |
101
+ | Algorand Testnet | Algorand | - | `algorand:testnet` | Active |
98
102
 
99
103
  ### Supported Tokens (EVM Chains)
100
104
 
@@ -117,6 +121,7 @@ pip install uvd-x402-sdk[flask] # Flask integration
117
121
  pip install uvd-x402-sdk[fastapi] # FastAPI/Starlette integration
118
122
  pip install uvd-x402-sdk[django] # Django integration
119
123
  pip install uvd-x402-sdk[aws] # AWS Lambda helpers
124
+ pip install uvd-x402-sdk[algorand] # Algorand atomic group helpers
120
125
 
121
126
  # All integrations
122
127
  pip install uvd-x402-sdk[all]
@@ -375,6 +380,65 @@ from uvd_x402_sdk.networks.near import validate_near_payload
375
380
  validate_near_payload(payload.payload) # Raises ValueError if invalid
376
381
  ```
377
382
 
383
+ ### Algorand
384
+
385
+ Algorand uses atomic groups with ASA (Algorand Standard Assets) transfers.
386
+
387
+ ```python
388
+ from uvd_x402_sdk import X402Client, X402Config
389
+
390
+ config = X402Config(
391
+ recipient_algorand="NCDSNUQ2QLXDMJXRALAW4CRUSSKG4IS37MVOFDQQPC45SE4EBZO42U6ZX4",
392
+ supported_networks=["algorand"],
393
+ )
394
+
395
+ client = X402Client(config=config)
396
+ result = client.process_payment(x_payment_header, Decimal("1.00"))
397
+
398
+ # Algorand uses atomic groups: [fee_tx, payment_tx]
399
+ from uvd_x402_sdk.networks.algorand import (
400
+ validate_algorand_payload,
401
+ get_algorand_fee_payer,
402
+ build_atomic_group,
403
+ )
404
+
405
+ # Get the facilitator fee payer address
406
+ fee_payer = get_algorand_fee_payer("algorand")
407
+ print(f"Fee payer: {fee_payer}") # KIMS5H6Q...
408
+
409
+ # Validate payload structure
410
+ payload = client.extract_payload(x_payment_header)
411
+ validate_algorand_payload(payload.payload) # Raises ValueError if invalid
412
+ ```
413
+
414
+ #### Building Algorand Payments (requires `pip install uvd-x402-sdk[algorand]`)
415
+
416
+ ```python
417
+ from uvd_x402_sdk.networks.algorand import (
418
+ build_atomic_group,
419
+ build_x402_payment_request,
420
+ get_algorand_fee_payer,
421
+ )
422
+ from algosdk.v2client import algod
423
+
424
+ # Connect to Algorand node
425
+ client = algod.AlgodClient("", "https://mainnet-api.algonode.cloud")
426
+
427
+ # Build atomic group
428
+ payload = build_atomic_group(
429
+ sender_address="YOUR_ADDRESS...",
430
+ recipient_address="MERCHANT_ADDRESS...",
431
+ amount=1000000, # 1 USDC (6 decimals)
432
+ asset_id=31566704, # USDC ASA ID on mainnet
433
+ facilitator_address=get_algorand_fee_payer("algorand"),
434
+ sign_transaction=lambda txn: txn.sign(private_key),
435
+ algod_client=client,
436
+ )
437
+
438
+ # Build x402 payment request
439
+ request = build_x402_payment_request(payload, network="algorand")
440
+ ```
441
+
378
442
  ---
379
443
 
380
444
  ## x402 v1 vs v2
@@ -593,6 +657,94 @@ config = X402Config.from_env()
593
657
 
594
658
  ---
595
659
 
660
+ ## Facilitator Addresses
661
+
662
+ The SDK includes all facilitator addresses as embedded constants. You don't need to configure them manually.
663
+
664
+ ### Fee Payer Addresses (Non-EVM)
665
+
666
+ Non-EVM chains require a fee payer address for gasless transactions:
667
+
668
+ ```python
669
+ from uvd_x402_sdk import (
670
+ # Algorand
671
+ ALGORAND_FEE_PAYER_MAINNET, # KIMS5H6QLCUDL65L5UBTOXDPWLMTS7N3AAC3I6B2NCONEI5QIVK7LH2C2I
672
+ ALGORAND_FEE_PAYER_TESTNET, # 5DPPDQNYUPCTXRZWRYSF3WPYU6RKAUR25F3YG4EKXQRHV5AUAI62H5GXL4
673
+
674
+ # Solana
675
+ SOLANA_FEE_PAYER_MAINNET, # F742C4VfFLQ9zRQyithoj5229ZgtX2WqKCSFKgH2EThq
676
+ SOLANA_FEE_PAYER_DEVNET, # 6xNPewUdKRbEZDReQdpyfNUdgNg8QRc8Mt263T5GZSRv
677
+
678
+ # Fogo
679
+ FOGO_FEE_PAYER_MAINNET, # F742C4VfFLQ9zRQyithoj5229ZgtX2WqKCSFKgH2EThq
680
+ FOGO_FEE_PAYER_TESTNET, # 6xNPewUdKRbEZDReQdpyfNUdgNg8QRc8Mt263T5GZSRv
681
+
682
+ # NEAR
683
+ NEAR_FEE_PAYER_MAINNET, # uvd-facilitator.near
684
+ NEAR_FEE_PAYER_TESTNET, # uvd-facilitator.testnet
685
+
686
+ # Stellar
687
+ STELLAR_FEE_PAYER_MAINNET, # GCHPGXJT2WFFRFCA5TV4G4E3PMMXLNIDUH27PKDYA4QJ2XGYZWGFZNHB
688
+ STELLAR_FEE_PAYER_TESTNET, # GBBFZMLUJEZVI32EN4XA2KPP445XIBTMTRBLYWFIL556RDTHS2OWFQ2Z
689
+
690
+ # Helper function
691
+ get_fee_payer, # Get fee payer for any network
692
+ )
693
+
694
+ # Get fee payer for any network
695
+ fee_payer = get_fee_payer("algorand") # Returns KIMS5H6Q...
696
+ fee_payer = get_fee_payer("solana") # Returns F742C4VfF...
697
+ fee_payer = get_fee_payer("base") # Returns None (EVM doesn't need fee payer)
698
+ ```
699
+
700
+ ### EVM Facilitator Addresses
701
+
702
+ EVM chains use EIP-3009 transferWithAuthorization (gasless by design), but the facilitator wallet addresses are available for reference:
703
+
704
+ ```python
705
+ from uvd_x402_sdk import (
706
+ EVM_FACILITATOR_MAINNET, # 0x103040545AC5031A11E8C03dd11324C7333a13C7
707
+ EVM_FACILITATOR_TESTNET, # 0x34033041a5944B8F10f8E4D8496Bfb84f1A293A8
708
+ )
709
+ ```
710
+
711
+ ### Helper Functions
712
+
713
+ ```python
714
+ from uvd_x402_sdk import (
715
+ get_fee_payer, # Get fee payer address for a network
716
+ requires_fee_payer, # Check if network needs fee payer
717
+ get_all_fee_payers, # Get all registered fee payers
718
+ build_payment_info, # Build payment info with auto feePayer
719
+ DEFAULT_FACILITATOR_URL, # https://facilitator.ultravioletadao.xyz
720
+ )
721
+
722
+ # Check if network needs fee payer
723
+ requires_fee_payer("algorand") # True
724
+ requires_fee_payer("base") # False
725
+
726
+ # Build payment info with automatic fee payer
727
+ info = build_payment_info(
728
+ network="algorand",
729
+ pay_to="MERCHANT_ADDRESS...",
730
+ max_amount_required="1000000",
731
+ description="API access"
732
+ )
733
+ # info = {
734
+ # 'network': 'algorand',
735
+ # 'payTo': 'MERCHANT_ADDRESS...',
736
+ # 'maxAmountRequired': '1000000',
737
+ # 'description': 'API access',
738
+ # 'asset': '31566704',
739
+ # 'extra': {
740
+ # 'token': 'usdc',
741
+ # 'feePayer': 'KIMS5H6QLCUDL65L5UBTOXDPWLMTS7N3AAC3I6B2NCONEI5QIVK7LH2C2I'
742
+ # }
743
+ # }
744
+ ```
745
+
746
+ ---
747
+
596
748
  ## Registering Custom Networks
597
749
 
598
750
  ```python
@@ -823,6 +975,7 @@ The facilitator (https://facilitator.ultravioletadao.xyz) handles all on-chain i
823
975
  | SVM | Partial transaction | Co-signs + submits transaction |
824
976
  | NEAR | DelegateAction (Borsh) | Wraps in `Action::Delegate` |
825
977
  | Stellar | Auth entry (XDR) | Wraps in fee-bump transaction |
978
+ | Algorand | ASA transfer tx | Signs fee tx + submits atomic group |
826
979
 
827
980
  ---
828
981
 
@@ -929,6 +1082,46 @@ MIT License - see LICENSE file.
929
1082
 
930
1083
  ## Changelog
931
1084
 
1085
+ ### v0.5.2 (2025-12-26)
1086
+
1087
+ - Added EVM facilitator addresses for reference
1088
+ - `EVM_FACILITATOR_MAINNET`: 0x103040545AC5031A11E8C03dd11324C7333a13C7
1089
+ - `EVM_FACILITATOR_TESTNET`: 0x34033041a5944B8F10f8E4D8496Bfb84f1A293A8
1090
+
1091
+ ### v0.5.1 (2025-12-26)
1092
+
1093
+ - Changed default Algorand mainnet network name from `algorand-mainnet` to `algorand`
1094
+ - Aligns with facilitator v1.9.5+ which now uses `algorand` as the primary network identifier
1095
+
1096
+ ### v0.5.0 (2025-12-26)
1097
+
1098
+ - **Facilitator Module**: Added `facilitator.py` with all fee payer addresses embedded as constants
1099
+ - SDK users no longer need to configure facilitator addresses manually
1100
+ - Added constants: `ALGORAND_FEE_PAYER_MAINNET`, `SOLANA_FEE_PAYER_MAINNET`, `NEAR_FEE_PAYER_MAINNET`, `STELLAR_FEE_PAYER_MAINNET`, etc.
1101
+ - Added helper functions: `get_fee_payer()`, `requires_fee_payer()`, `build_payment_info()`
1102
+ - Network-specific helpers: `get_algorand_fee_payer()`, `get_svm_fee_payer()`, `get_near_fee_payer()`, `get_stellar_fee_payer()`
1103
+
1104
+ ### v0.4.2 (2025-12-26)
1105
+
1106
+ - **Algorand Atomic Group Fix**: Rewrote Algorand payload format to use GoPlausible x402-avm atomic group spec
1107
+ - New `AlgorandPaymentPayload` dataclass with `paymentIndex` and `paymentGroup` fields
1108
+ - Added `build_atomic_group()` helper for constructing two-transaction atomic groups
1109
+ - Added `validate_algorand_payload()` for payload validation
1110
+ - Added `build_x402_payment_request()` for building complete x402 requests
1111
+
1112
+ ### v0.4.1 (2025-12-26)
1113
+
1114
+ - Added AUSD (Agora USD) support on Solana using Token2022 program
1115
+ - Added `TOKEN_2022_PROGRAM_ID` constant
1116
+ - Added `get_token_program_id()` and `is_token_2022()` helpers
1117
+
1118
+ ### v0.4.0 (2025-12-26)
1119
+
1120
+ - **Algorand Support**: Added Algorand mainnet and testnet networks
1121
+ - Added `ALGORAND` NetworkType
1122
+ - Added `algorand` optional dependency (`py-algorand-sdk>=2.0.0`)
1123
+ - SDK now supports 16 blockchain networks
1124
+
932
1125
  ### v0.3.4 (2025-12-22)
933
1126
 
934
1127
  - Added USDT support (USDT0 omnichain via LayerZero) on Ethereum, Arbitrum, Optimism, Avalanche, Polygon
@@ -2,11 +2,13 @@
2
2
 
3
3
  Python SDK for integrating **x402 cryptocurrency payments** via the Ultravioleta DAO facilitator.
4
4
 
5
- Accept **gasless stablecoin 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.
5
+ Accept **gasless stablecoin payments** across **16 blockchain networks** with a single integration. The SDK handles signature verification, on-chain settlement, and all the complexity of multi-chain payments.
6
+
7
+ **New in v0.5.0+**: The SDK now includes embedded facilitator addresses - no manual configuration needed!
6
8
 
7
9
  ## Features
8
10
 
9
- - **14 Networks**: EVM chains (Base, Ethereum, Polygon, etc.), SVM chains (Solana, Fogo), NEAR, and Stellar
11
+ - **16 Networks**: EVM chains (Base, Ethereum, Polygon, etc.), SVM chains (Solana, Fogo), NEAR, Stellar, and Algorand
10
12
  - **5 Stablecoins**: USDC, EURC, AUSD, PYUSD, USDT (EVM chains)
11
13
  - **x402 v1 & v2**: Full support for both protocol versions with auto-detection
12
14
  - **Framework Integrations**: Flask, FastAPI, Django, AWS Lambda
@@ -44,6 +46,8 @@ print(f"Paid by {result.payer_address}, tx: {result.transaction_hash}")
44
46
  | Fogo | SVM | - | `solana:fogo` | Active |
45
47
  | NEAR | NEAR | - | `near:mainnet` | Active |
46
48
  | Stellar | Stellar | - | `stellar:pubnet` | Active |
49
+ | Algorand | Algorand | - | `algorand:mainnet` | Active |
50
+ | Algorand Testnet | Algorand | - | `algorand:testnet` | Active |
47
51
 
48
52
  ### Supported Tokens (EVM Chains)
49
53
 
@@ -66,6 +70,7 @@ pip install uvd-x402-sdk[flask] # Flask integration
66
70
  pip install uvd-x402-sdk[fastapi] # FastAPI/Starlette integration
67
71
  pip install uvd-x402-sdk[django] # Django integration
68
72
  pip install uvd-x402-sdk[aws] # AWS Lambda helpers
73
+ pip install uvd-x402-sdk[algorand] # Algorand atomic group helpers
69
74
 
70
75
  # All integrations
71
76
  pip install uvd-x402-sdk[all]
@@ -324,6 +329,65 @@ from uvd_x402_sdk.networks.near import validate_near_payload
324
329
  validate_near_payload(payload.payload) # Raises ValueError if invalid
325
330
  ```
326
331
 
332
+ ### Algorand
333
+
334
+ Algorand uses atomic groups with ASA (Algorand Standard Assets) transfers.
335
+
336
+ ```python
337
+ from uvd_x402_sdk import X402Client, X402Config
338
+
339
+ config = X402Config(
340
+ recipient_algorand="NCDSNUQ2QLXDMJXRALAW4CRUSSKG4IS37MVOFDQQPC45SE4EBZO42U6ZX4",
341
+ supported_networks=["algorand"],
342
+ )
343
+
344
+ client = X402Client(config=config)
345
+ result = client.process_payment(x_payment_header, Decimal("1.00"))
346
+
347
+ # Algorand uses atomic groups: [fee_tx, payment_tx]
348
+ from uvd_x402_sdk.networks.algorand import (
349
+ validate_algorand_payload,
350
+ get_algorand_fee_payer,
351
+ build_atomic_group,
352
+ )
353
+
354
+ # Get the facilitator fee payer address
355
+ fee_payer = get_algorand_fee_payer("algorand")
356
+ print(f"Fee payer: {fee_payer}") # KIMS5H6Q...
357
+
358
+ # Validate payload structure
359
+ payload = client.extract_payload(x_payment_header)
360
+ validate_algorand_payload(payload.payload) # Raises ValueError if invalid
361
+ ```
362
+
363
+ #### Building Algorand Payments (requires `pip install uvd-x402-sdk[algorand]`)
364
+
365
+ ```python
366
+ from uvd_x402_sdk.networks.algorand import (
367
+ build_atomic_group,
368
+ build_x402_payment_request,
369
+ get_algorand_fee_payer,
370
+ )
371
+ from algosdk.v2client import algod
372
+
373
+ # Connect to Algorand node
374
+ client = algod.AlgodClient("", "https://mainnet-api.algonode.cloud")
375
+
376
+ # Build atomic group
377
+ payload = build_atomic_group(
378
+ sender_address="YOUR_ADDRESS...",
379
+ recipient_address="MERCHANT_ADDRESS...",
380
+ amount=1000000, # 1 USDC (6 decimals)
381
+ asset_id=31566704, # USDC ASA ID on mainnet
382
+ facilitator_address=get_algorand_fee_payer("algorand"),
383
+ sign_transaction=lambda txn: txn.sign(private_key),
384
+ algod_client=client,
385
+ )
386
+
387
+ # Build x402 payment request
388
+ request = build_x402_payment_request(payload, network="algorand")
389
+ ```
390
+
327
391
  ---
328
392
 
329
393
  ## x402 v1 vs v2
@@ -542,6 +606,94 @@ config = X402Config.from_env()
542
606
 
543
607
  ---
544
608
 
609
+ ## Facilitator Addresses
610
+
611
+ The SDK includes all facilitator addresses as embedded constants. You don't need to configure them manually.
612
+
613
+ ### Fee Payer Addresses (Non-EVM)
614
+
615
+ Non-EVM chains require a fee payer address for gasless transactions:
616
+
617
+ ```python
618
+ from uvd_x402_sdk import (
619
+ # Algorand
620
+ ALGORAND_FEE_PAYER_MAINNET, # KIMS5H6QLCUDL65L5UBTOXDPWLMTS7N3AAC3I6B2NCONEI5QIVK7LH2C2I
621
+ ALGORAND_FEE_PAYER_TESTNET, # 5DPPDQNYUPCTXRZWRYSF3WPYU6RKAUR25F3YG4EKXQRHV5AUAI62H5GXL4
622
+
623
+ # Solana
624
+ SOLANA_FEE_PAYER_MAINNET, # F742C4VfFLQ9zRQyithoj5229ZgtX2WqKCSFKgH2EThq
625
+ SOLANA_FEE_PAYER_DEVNET, # 6xNPewUdKRbEZDReQdpyfNUdgNg8QRc8Mt263T5GZSRv
626
+
627
+ # Fogo
628
+ FOGO_FEE_PAYER_MAINNET, # F742C4VfFLQ9zRQyithoj5229ZgtX2WqKCSFKgH2EThq
629
+ FOGO_FEE_PAYER_TESTNET, # 6xNPewUdKRbEZDReQdpyfNUdgNg8QRc8Mt263T5GZSRv
630
+
631
+ # NEAR
632
+ NEAR_FEE_PAYER_MAINNET, # uvd-facilitator.near
633
+ NEAR_FEE_PAYER_TESTNET, # uvd-facilitator.testnet
634
+
635
+ # Stellar
636
+ STELLAR_FEE_PAYER_MAINNET, # GCHPGXJT2WFFRFCA5TV4G4E3PMMXLNIDUH27PKDYA4QJ2XGYZWGFZNHB
637
+ STELLAR_FEE_PAYER_TESTNET, # GBBFZMLUJEZVI32EN4XA2KPP445XIBTMTRBLYWFIL556RDTHS2OWFQ2Z
638
+
639
+ # Helper function
640
+ get_fee_payer, # Get fee payer for any network
641
+ )
642
+
643
+ # Get fee payer for any network
644
+ fee_payer = get_fee_payer("algorand") # Returns KIMS5H6Q...
645
+ fee_payer = get_fee_payer("solana") # Returns F742C4VfF...
646
+ fee_payer = get_fee_payer("base") # Returns None (EVM doesn't need fee payer)
647
+ ```
648
+
649
+ ### EVM Facilitator Addresses
650
+
651
+ EVM chains use EIP-3009 transferWithAuthorization (gasless by design), but the facilitator wallet addresses are available for reference:
652
+
653
+ ```python
654
+ from uvd_x402_sdk import (
655
+ EVM_FACILITATOR_MAINNET, # 0x103040545AC5031A11E8C03dd11324C7333a13C7
656
+ EVM_FACILITATOR_TESTNET, # 0x34033041a5944B8F10f8E4D8496Bfb84f1A293A8
657
+ )
658
+ ```
659
+
660
+ ### Helper Functions
661
+
662
+ ```python
663
+ from uvd_x402_sdk import (
664
+ get_fee_payer, # Get fee payer address for a network
665
+ requires_fee_payer, # Check if network needs fee payer
666
+ get_all_fee_payers, # Get all registered fee payers
667
+ build_payment_info, # Build payment info with auto feePayer
668
+ DEFAULT_FACILITATOR_URL, # https://facilitator.ultravioletadao.xyz
669
+ )
670
+
671
+ # Check if network needs fee payer
672
+ requires_fee_payer("algorand") # True
673
+ requires_fee_payer("base") # False
674
+
675
+ # Build payment info with automatic fee payer
676
+ info = build_payment_info(
677
+ network="algorand",
678
+ pay_to="MERCHANT_ADDRESS...",
679
+ max_amount_required="1000000",
680
+ description="API access"
681
+ )
682
+ # info = {
683
+ # 'network': 'algorand',
684
+ # 'payTo': 'MERCHANT_ADDRESS...',
685
+ # 'maxAmountRequired': '1000000',
686
+ # 'description': 'API access',
687
+ # 'asset': '31566704',
688
+ # 'extra': {
689
+ # 'token': 'usdc',
690
+ # 'feePayer': 'KIMS5H6QLCUDL65L5UBTOXDPWLMTS7N3AAC3I6B2NCONEI5QIVK7LH2C2I'
691
+ # }
692
+ # }
693
+ ```
694
+
695
+ ---
696
+
545
697
  ## Registering Custom Networks
546
698
 
547
699
  ```python
@@ -772,6 +924,7 @@ The facilitator (https://facilitator.ultravioletadao.xyz) handles all on-chain i
772
924
  | SVM | Partial transaction | Co-signs + submits transaction |
773
925
  | NEAR | DelegateAction (Borsh) | Wraps in `Action::Delegate` |
774
926
  | Stellar | Auth entry (XDR) | Wraps in fee-bump transaction |
927
+ | Algorand | ASA transfer tx | Signs fee tx + submits atomic group |
775
928
 
776
929
  ---
777
930
 
@@ -878,6 +1031,46 @@ MIT License - see LICENSE file.
878
1031
 
879
1032
  ## Changelog
880
1033
 
1034
+ ### v0.5.2 (2025-12-26)
1035
+
1036
+ - Added EVM facilitator addresses for reference
1037
+ - `EVM_FACILITATOR_MAINNET`: 0x103040545AC5031A11E8C03dd11324C7333a13C7
1038
+ - `EVM_FACILITATOR_TESTNET`: 0x34033041a5944B8F10f8E4D8496Bfb84f1A293A8
1039
+
1040
+ ### v0.5.1 (2025-12-26)
1041
+
1042
+ - Changed default Algorand mainnet network name from `algorand-mainnet` to `algorand`
1043
+ - Aligns with facilitator v1.9.5+ which now uses `algorand` as the primary network identifier
1044
+
1045
+ ### v0.5.0 (2025-12-26)
1046
+
1047
+ - **Facilitator Module**: Added `facilitator.py` with all fee payer addresses embedded as constants
1048
+ - SDK users no longer need to configure facilitator addresses manually
1049
+ - Added constants: `ALGORAND_FEE_PAYER_MAINNET`, `SOLANA_FEE_PAYER_MAINNET`, `NEAR_FEE_PAYER_MAINNET`, `STELLAR_FEE_PAYER_MAINNET`, etc.
1050
+ - Added helper functions: `get_fee_payer()`, `requires_fee_payer()`, `build_payment_info()`
1051
+ - Network-specific helpers: `get_algorand_fee_payer()`, `get_svm_fee_payer()`, `get_near_fee_payer()`, `get_stellar_fee_payer()`
1052
+
1053
+ ### v0.4.2 (2025-12-26)
1054
+
1055
+ - **Algorand Atomic Group Fix**: Rewrote Algorand payload format to use GoPlausible x402-avm atomic group spec
1056
+ - New `AlgorandPaymentPayload` dataclass with `paymentIndex` and `paymentGroup` fields
1057
+ - Added `build_atomic_group()` helper for constructing two-transaction atomic groups
1058
+ - Added `validate_algorand_payload()` for payload validation
1059
+ - Added `build_x402_payment_request()` for building complete x402 requests
1060
+
1061
+ ### v0.4.1 (2025-12-26)
1062
+
1063
+ - Added AUSD (Agora USD) support on Solana using Token2022 program
1064
+ - Added `TOKEN_2022_PROGRAM_ID` constant
1065
+ - Added `get_token_program_id()` and `is_token_2022()` helpers
1066
+
1067
+ ### v0.4.0 (2025-12-26)
1068
+
1069
+ - **Algorand Support**: Added Algorand mainnet and testnet networks
1070
+ - Added `ALGORAND` NetworkType
1071
+ - Added `algorand` optional dependency (`py-algorand-sdk>=2.0.0`)
1072
+ - SDK now supports 16 blockchain networks
1073
+
881
1074
  ### v0.3.4 (2025-12-22)
882
1075
 
883
1076
  - Added USDT support (USDT0 omnichain via LayerZero) on Ethereum, Arbitrum, Optimism, Avalanche, Polygon
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "uvd-x402-sdk"
7
- version = "0.5.1"
8
- description = "Python SDK for x402 payments - gasless crypto payments across 16 blockchains with multi-stablecoin support (USDC, EURC, AUSD, PYUSD, USDT)"
7
+ version = "0.5.4"
8
+ description = "Python SDK for x402 payments - gasless crypto payments across 18 blockchains with multi-stablecoin support (USDC, EURC, AUSD, PYUSD, USDT)"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
11
11
  authors = [
@@ -24,6 +24,7 @@ keywords = [
24
24
  "near",
25
25
  "stellar",
26
26
  "algorand",
27
+ "sui",
27
28
  "facilitator",
28
29
  "gasless",
29
30
  "eip-712",
@@ -32,16 +32,17 @@ Example usage:
32
32
  def protected_endpoint():
33
33
  return {"message": "Payment verified!"}
34
34
 
35
- Supported Networks (16 total):
35
+ Supported Networks (18 total):
36
36
  - EVM (10): Base, Ethereum, Polygon, Arbitrum, Optimism, Avalanche, Celo,
37
37
  HyperEVM, Unichain, Monad
38
38
  - SVM (2): Solana, Fogo
39
39
  - NEAR (1): NEAR Protocol
40
40
  - Stellar (1): Stellar
41
41
  - Algorand (2): Algorand mainnet, Algorand testnet
42
+ - Sui (2): Sui mainnet, Sui testnet
42
43
  """
43
44
 
44
- __version__ = "0.5.1"
45
+ __version__ = "0.5.4"
45
46
  __author__ = "Ultravioleta DAO"
46
47
 
47
48
  from uvd_x402_sdk.client import X402Client
@@ -128,6 +129,11 @@ from uvd_x402_sdk.facilitator import (
128
129
  NEAR_FEE_PAYER_TESTNET,
129
130
  STELLAR_FEE_PAYER_MAINNET,
130
131
  STELLAR_FEE_PAYER_TESTNET,
132
+ SUI_FEE_PAYER_MAINNET,
133
+ SUI_FEE_PAYER_TESTNET,
134
+ # EVM facilitator addresses (for reference)
135
+ EVM_FACILITATOR_MAINNET,
136
+ EVM_FACILITATOR_TESTNET,
131
137
  # Helper functions
132
138
  get_fee_payer,
133
139
  get_facilitator_address,
@@ -221,6 +227,10 @@ __all__ = [
221
227
  "NEAR_FEE_PAYER_TESTNET",
222
228
  "STELLAR_FEE_PAYER_MAINNET",
223
229
  "STELLAR_FEE_PAYER_TESTNET",
230
+ "SUI_FEE_PAYER_MAINNET",
231
+ "SUI_FEE_PAYER_TESTNET",
232
+ "EVM_FACILITATOR_MAINNET",
233
+ "EVM_FACILITATOR_TESTNET",
224
234
  "get_fee_payer",
225
235
  "get_facilitator_address",
226
236
  "requires_fee_payer",
@@ -58,6 +58,19 @@ NEAR_FEE_PAYER_TESTNET = "uvd-facilitator.testnet"
58
58
  STELLAR_FEE_PAYER_MAINNET = "GCHPGXJT2WFFRFCA5TV4G4E3PMMXLNIDUH27PKDYA4QJ2XGYZWGFZNHB"
59
59
  STELLAR_FEE_PAYER_TESTNET = "GBBFZMLUJEZVI32EN4XA2KPP445XIBTMTRBLYWFIL556RDTHS2OWFQ2Z"
60
60
 
61
+ # Sui fee payer addresses (sponsor wallets)
62
+ SUI_FEE_PAYER_MAINNET = "0xe7bbf2b13f7d72714760aa16e024fa1b35a978793f9893d0568a4fbf356a764a"
63
+ SUI_FEE_PAYER_TESTNET = "0xabbd16a2fab2a502c9cfe835195a6fc7d70bfc27cffb40b8b286b52a97006e67"
64
+
65
+
66
+ # =============================================================================
67
+ # EVM Facilitator Addresses (for reference - EVM uses EIP-3009, no fee payer needed)
68
+ # =============================================================================
69
+
70
+ # EVM facilitator wallet addresses (used for settlement, not fee payment)
71
+ EVM_FACILITATOR_MAINNET = "0x103040545AC5031A11E8C03dd11324C7333a13C7"
72
+ EVM_FACILITATOR_TESTNET = "0x34033041a5944B8F10f8E4D8496Bfb84f1A293A8"
73
+
61
74
 
62
75
  # =============================================================================
63
76
  # Network to Fee Payer Mapping
@@ -86,6 +99,10 @@ _FEE_PAYER_BY_NETWORK: Dict[str, str] = {
86
99
  "stellar": STELLAR_FEE_PAYER_MAINNET,
87
100
  "stellar-mainnet": STELLAR_FEE_PAYER_MAINNET,
88
101
  "stellar-testnet": STELLAR_FEE_PAYER_TESTNET,
102
+ # Sui
103
+ "sui": SUI_FEE_PAYER_MAINNET,
104
+ "sui-mainnet": SUI_FEE_PAYER_MAINNET,
105
+ "sui-testnet": SUI_FEE_PAYER_TESTNET,
89
106
  }
90
107
 
91
108
  # CAIP-2 format mappings (x402 v2)
@@ -105,6 +122,9 @@ _FEE_PAYER_BY_CAIP2: Dict[str, str] = {
105
122
  # Stellar
106
123
  "stellar:pubnet": STELLAR_FEE_PAYER_MAINNET,
107
124
  "stellar:testnet": STELLAR_FEE_PAYER_TESTNET,
125
+ # Sui
126
+ "sui:mainnet": SUI_FEE_PAYER_MAINNET,
127
+ "sui:testnet": SUI_FEE_PAYER_TESTNET,
108
128
  }
109
129
 
110
130
 
@@ -48,7 +48,7 @@ from uvd_x402_sdk.networks.base import (
48
48
  )
49
49
 
50
50
  # Import all default network configurations
51
- from uvd_x402_sdk.networks import evm, solana, near, stellar, algorand
51
+ from uvd_x402_sdk.networks import evm, solana, near, stellar, algorand, sui
52
52
 
53
53
  __all__ = [
54
54
  # Core
@@ -57,6 +57,7 @@ class NetworkType(Enum):
57
57
  - NEAR: NEP-366 SignedDelegateAction (meta-transaction)
58
58
  - STELLAR: Soroban Authorization Entry XDR
59
59
  - ALGORAND: ASA (Algorand Standard Assets) transfer via signed transaction
60
+ - SUI: Sui sponsored transactions (Move-based programmable transactions)
60
61
 
61
62
  Note: SOLANA is deprecated, use SVM instead for Solana-compatible chains.
62
63
  """
@@ -67,12 +68,18 @@ class NetworkType(Enum):
67
68
  NEAR = "near"
68
69
  STELLAR = "stellar"
69
70
  ALGORAND = "algorand" # Algorand ASA transfers
71
+ SUI = "sui" # Sui Move VM chains (sponsored transactions)
70
72
 
71
73
  @classmethod
72
74
  def is_svm(cls, network_type: "NetworkType") -> bool:
73
75
  """Check if network type is SVM-compatible (Solana, Fogo, etc.)."""
74
76
  return network_type in (cls.SVM, cls.SOLANA)
75
77
 
78
+ @classmethod
79
+ def is_sui(cls, network_type: "NetworkType") -> bool:
80
+ """Check if network type is Sui-based."""
81
+ return network_type == cls.SUI
82
+
76
83
 
77
84
  @dataclass
78
85
  class NetworkConfig:
@@ -372,6 +379,7 @@ _CAIP2_NAMESPACE_MAP = {
372
379
  "near": NetworkType.NEAR,
373
380
  "stellar": NetworkType.STELLAR,
374
381
  "algorand": NetworkType.ALGORAND,
382
+ "sui": NetworkType.SUI,
375
383
  }
376
384
 
377
385
  # Network name to CAIP-2 format
@@ -397,6 +405,9 @@ _NETWORK_TO_CAIP2 = {
397
405
  # Algorand
398
406
  "algorand": "algorand:mainnet",
399
407
  "algorand-testnet": "algorand:testnet",
408
+ # Sui
409
+ "sui": "sui:mainnet",
410
+ "sui-testnet": "sui:testnet",
400
411
  }
401
412
 
402
413
  # CAIP-2 to network name mapping (reverse of above)
@@ -455,6 +466,11 @@ def parse_caip2_network(caip2_id: str) -> Optional[str]:
455
466
  return "algorand"
456
467
  if reference == "testnet":
457
468
  return "algorand-testnet"
469
+ if namespace == "sui":
470
+ if reference == "mainnet":
471
+ return "sui"
472
+ if reference == "testnet":
473
+ return "sui-testnet"
458
474
 
459
475
  return None
460
476