uvd-x402-sdk 0.4.0__tar.gz → 0.4.1__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 (30) hide show
  1. {uvd_x402_sdk-0.4.0/src/uvd_x402_sdk.egg-info → uvd_x402_sdk-0.4.1}/PKG-INFO +1 -1
  2. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/pyproject.toml +1 -1
  3. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk/networks/solana.py +72 -1
  4. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1/src/uvd_x402_sdk.egg-info}/PKG-INFO +1 -1
  5. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/LICENSE +0 -0
  6. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/README.md +0 -0
  7. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/setup.cfg +0 -0
  8. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk/__init__.py +0 -0
  9. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk/client.py +0 -0
  10. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk/config.py +0 -0
  11. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk/decorators.py +0 -0
  12. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk/exceptions.py +0 -0
  13. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk/integrations/__init__.py +0 -0
  14. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk/integrations/django_integration.py +0 -0
  15. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk/integrations/fastapi_integration.py +0 -0
  16. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk/integrations/flask_integration.py +0 -0
  17. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk/integrations/lambda_integration.py +0 -0
  18. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk/models.py +0 -0
  19. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk/networks/__init__.py +0 -0
  20. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk/networks/algorand.py +0 -0
  21. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk/networks/base.py +0 -0
  22. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk/networks/evm.py +0 -0
  23. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk/networks/near.py +0 -0
  24. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk/networks/stellar.py +0 -0
  25. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk/response.py +0 -0
  26. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk.egg-info/SOURCES.txt +0 -0
  27. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk.egg-info/dependency_links.txt +0 -0
  28. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk.egg-info/requires.txt +0 -0
  29. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/src/uvd_x402_sdk.egg-info/top_level.txt +0 -0
  30. {uvd_x402_sdk-0.4.0 → uvd_x402_sdk-0.4.1}/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.4.0
3
+ Version: 0.4.1
4
4
  Summary: Python SDK for x402 payments - gasless crypto payments across 16 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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "uvd-x402-sdk"
7
- version = "0.4.0"
7
+ version = "0.4.1"
8
8
  description = "Python SDK for x402 payments - gasless crypto payments across 16 blockchains with multi-stablecoin support (USDC, EURC, AUSD, PYUSD, USDT)"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -5,6 +5,10 @@ This module supports all SVM-compatible chains:
5
5
  - Solana (mainnet)
6
6
  - Fogo (fast finality SVM)
7
7
 
8
+ Supported Tokens:
9
+ - USDC: Standard SPL Token (TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA)
10
+ - AUSD: Token2022 (TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb)
11
+
8
12
  All SVM chains use the same payment flow:
9
13
  1. User creates a partially-signed VersionedTransaction
10
14
  2. Transaction contains SPL token TransferChecked instruction
@@ -14,7 +18,7 @@ All SVM chains use the same payment flow:
14
18
  Transaction Structure (flexible, facilitator v1.9.4+):
15
19
  - SetComputeUnitLimit instruction (recommended: 20,000 units)
16
20
  - SetComputeUnitPrice instruction (recommended: 100,000 microLamports)
17
- - TransferChecked (USDC transfer)
21
+ - TransferChecked (SPL or Token2022 transfer)
18
22
  - Optional: CreateAssociatedTokenAccount (if recipient ATA doesn't exist)
19
23
  - Additional instructions may be added by wallets (e.g., Phantom memo)
20
24
 
@@ -30,6 +34,7 @@ from typing import Dict, Any, Optional
30
34
  from uvd_x402_sdk.networks.base import (
31
35
  NetworkConfig,
32
36
  NetworkType,
37
+ TokenConfig,
33
38
  register_network,
34
39
  )
35
40
 
@@ -50,9 +55,28 @@ SOLANA = NetworkConfig(
50
55
  usdc_domain_version="",
51
56
  rpc_url="https://api.mainnet-beta.solana.com",
52
57
  enabled=True,
58
+ tokens={
59
+ # USDC - Standard SPL Token
60
+ "usdc": TokenConfig(
61
+ address="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
62
+ decimals=6,
63
+ name="", # Not applicable for SVM
64
+ version="",
65
+ ),
66
+ # AUSD - Token2022 (Agora USD)
67
+ # Uses Token2022 with extensions: PermanentDelegate, TransferHook, Metadata
68
+ "ausd": TokenConfig(
69
+ address="AUSD1jCcCyPLybk1YnvPWsHQSrZ46dxwoMniN4N2UEB9",
70
+ decimals=6,
71
+ name="", # Not applicable for SVM
72
+ version="",
73
+ ),
74
+ },
53
75
  extra_config={
54
76
  # Token program ID (standard SPL token program)
55
77
  "token_program_id": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
78
+ # Token2022 program ID (for AUSD and other Token2022 tokens)
79
+ "token_2022_program_id": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",
56
80
  # Associated Token Account program
57
81
  "ata_program_id": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
58
82
  # Default compute units for transfer
@@ -280,3 +304,50 @@ DEFAULT_COMPUTE_UNITS = 20000
280
304
  # Use 100k microlamports/CU for fast landing on mainnet
281
305
  # Lower values (like 1) cause transactions to be deprioritized and time out
282
306
  DEFAULT_PRIORITY_FEE_MICROLAMPORTS = 100_000
307
+
308
+ # =============================================================================
309
+ # Token Program Constants
310
+ # =============================================================================
311
+
312
+ # Standard SPL Token Program (used by USDC)
313
+ TOKEN_PROGRAM_ID = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
314
+
315
+ # Token2022 Program (used by AUSD - has extensions like TransferHook)
316
+ TOKEN_2022_PROGRAM_ID = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
317
+
318
+ # Associated Token Account Program (same for both SPL and Token2022)
319
+ ATA_PROGRAM_ID = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
320
+
321
+ # Tokens that use Token2022 instead of standard SPL
322
+ TOKEN_2022_TOKENS = {"ausd"}
323
+
324
+
325
+ def get_token_program_id(token_type: str) -> str:
326
+ """
327
+ Get the token program ID for a given token type.
328
+
329
+ USDC uses standard SPL Token program.
330
+ AUSD uses Token2022 (with extensions like TransferHook).
331
+
332
+ Args:
333
+ token_type: Token type (e.g., 'usdc', 'ausd')
334
+
335
+ Returns:
336
+ Token program ID string
337
+ """
338
+ if token_type.lower() in TOKEN_2022_TOKENS:
339
+ return TOKEN_2022_PROGRAM_ID
340
+ return TOKEN_PROGRAM_ID
341
+
342
+
343
+ def is_token_2022(token_type: str) -> bool:
344
+ """
345
+ Check if a token uses the Token2022 program.
346
+
347
+ Args:
348
+ token_type: Token type (e.g., 'usdc', 'ausd')
349
+
350
+ Returns:
351
+ True if token uses Token2022, False for standard SPL
352
+ """
353
+ return token_type.lower() in TOKEN_2022_TOKENS
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: uvd-x402-sdk
3
- Version: 0.4.0
3
+ Version: 0.4.1
4
4
  Summary: Python SDK for x402 payments - gasless crypto payments across 16 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
File without changes
File without changes
File without changes