uvd-x402-sdk 0.5.5__tar.gz → 0.5.6__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.5/src/uvd_x402_sdk.egg-info → uvd_x402_sdk-0.5.6}/PKG-INFO +1 -1
  2. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/pyproject.toml +1 -1
  3. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk/__init__.py +3 -1
  4. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk/models.py +51 -0
  5. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk/networks/__init__.py +7 -4
  6. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk/networks/sui.py +8 -1
  7. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6/src/uvd_x402_sdk.egg-info}/PKG-INFO +1 -1
  8. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/LICENSE +0 -0
  9. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/README.md +0 -0
  10. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/setup.cfg +0 -0
  11. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk/client.py +0 -0
  12. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk/config.py +0 -0
  13. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk/decorators.py +0 -0
  14. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk/exceptions.py +0 -0
  15. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk/facilitator.py +0 -0
  16. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk/integrations/__init__.py +0 -0
  17. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk/integrations/django_integration.py +0 -0
  18. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk/integrations/fastapi_integration.py +0 -0
  19. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk/integrations/flask_integration.py +0 -0
  20. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk/integrations/lambda_integration.py +0 -0
  21. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk/networks/algorand.py +0 -0
  22. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk/networks/base.py +0 -0
  23. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk/networks/evm.py +0 -0
  24. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk/networks/near.py +0 -0
  25. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk/networks/solana.py +0 -0
  26. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk/networks/stellar.py +0 -0
  27. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk/response.py +0 -0
  28. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk.egg-info/SOURCES.txt +0 -0
  29. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk.egg-info/dependency_links.txt +0 -0
  30. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk.egg-info/requires.txt +0 -0
  31. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/src/uvd_x402_sdk.egg-info/top_level.txt +0 -0
  32. {uvd_x402_sdk-0.5.5 → uvd_x402_sdk-0.5.6}/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.5.5
3
+ Version: 0.5.6
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "uvd-x402-sdk"
7
- version = "0.5.5"
7
+ version = "0.5.6"
8
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"
@@ -42,7 +42,7 @@ Supported Networks (18 total):
42
42
  - Sui (2): Sui mainnet, Sui testnet
43
43
  """
44
44
 
45
- __version__ = "0.5.5"
45
+ __version__ = "0.5.6"
46
46
  __author__ = "Ultravioleta DAO"
47
47
 
48
48
  from uvd_x402_sdk.client import X402Client
@@ -67,6 +67,7 @@ from uvd_x402_sdk.models import (
67
67
  SolanaPayloadContent, # Alias for backward compatibility
68
68
  NEARPayloadContent,
69
69
  StellarPayloadContent,
70
+ SuiPayloadContent,
70
71
  # Requirements models (v1)
71
72
  PaymentRequirements,
72
73
  # Requirements models (v2)
@@ -172,6 +173,7 @@ __all__ = [
172
173
  "SolanaPayloadContent",
173
174
  "NEARPayloadContent",
174
175
  "StellarPayloadContent",
176
+ "SuiPayloadContent",
175
177
  # Requirements models
176
178
  "PaymentRequirements",
177
179
  "PaymentOption",
@@ -114,12 +114,59 @@ class StellarPayloadContent(BaseModel):
114
114
  populate_by_name = True
115
115
 
116
116
 
117
+ class SuiPayloadContent(BaseModel):
118
+ """
119
+ Sui payment payload using sponsored transactions.
120
+
121
+ Contains a user-signed programmable transaction that the facilitator sponsors.
122
+ The facilitator pays gas (in SUI), user pays ZERO SUI.
123
+
124
+ Transaction Flow:
125
+ 1. User creates a programmable transaction for token transfer
126
+ 2. User signs the transaction (setSender + setGasOwner for sponsorship)
127
+ 3. Transaction is sent to facilitator with sender signature
128
+ 4. Facilitator adds sponsor signature and pays gas
129
+ 5. Facilitator submits to Sui network
130
+
131
+ Required Fields (all mandatory for facilitator deserialization):
132
+ - transactionBytes: BCS-encoded TransactionData
133
+ - senderSignature: User's Ed25519 or Secp256k1 signature
134
+ - from: Sender Sui address (0x + 64 hex)
135
+ - to: Recipient Sui address (0x + 64 hex)
136
+ - amount: Transfer amount in base units
137
+ - coinObjectId: The Sui coin object ID used for the transfer (CRITICAL!)
138
+ """
139
+
140
+ transactionBytes: str = Field(
141
+ ..., description="Base64-encoded BCS serialized TransactionData"
142
+ )
143
+ senderSignature: str = Field(
144
+ ..., description="Base64-encoded user signature (Ed25519 or Secp256k1)"
145
+ )
146
+ from_address: str = Field(
147
+ ..., alias="from", description="Sender Sui address (0x + 64 hex chars)"
148
+ )
149
+ to: str = Field(
150
+ ..., description="Recipient Sui address (0x + 64 hex chars)"
151
+ )
152
+ amount: str = Field(
153
+ ..., description="Amount in token base units (e.g., '1000000' for 1 USDC)"
154
+ )
155
+ coinObjectId: str = Field(
156
+ ..., description="Sui coin object ID used for the transfer (REQUIRED by facilitator)"
157
+ )
158
+
159
+ class Config:
160
+ populate_by_name = True
161
+
162
+
117
163
  # Union type for all payload contents
118
164
  PayloadContent = Union[
119
165
  EVMPayloadContent,
120
166
  SVMPayloadContent,
121
167
  NEARPayloadContent,
122
168
  StellarPayloadContent,
169
+ SuiPayloadContent,
123
170
  ]
124
171
 
125
172
 
@@ -196,6 +243,10 @@ class PaymentPayload(BaseModel):
196
243
  """Parse payload as Stellar format."""
197
244
  return StellarPayloadContent(**self.payload)
198
245
 
246
+ def get_sui_payload(self) -> SuiPayloadContent:
247
+ """Parse payload as Sui format (sponsored transaction)."""
248
+ return SuiPayloadContent(**self.payload)
249
+
199
250
 
200
251
  class PaymentRequirements(BaseModel):
201
252
  """
@@ -4,18 +4,21 @@ 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 16 mainnet networks out of the box:
7
+ The SDK supports 17 mainnet networks across 6 blockchain families:
8
8
  - 10 EVM chains: Base, Ethereum, Polygon, Arbitrum, Optimism, Avalanche,
9
9
  Celo, HyperEVM, Unichain, Monad
10
10
  - 2 SVM chains: Solana, Fogo
11
11
  - 1 NEAR: NEAR Protocol
12
12
  - 1 Stellar: Stellar
13
- - 2 Algorand: Algorand mainnet and testnet
13
+ - 1 Algorand: Algorand
14
+ - 1 Sui: Sui (sponsored transactions)
14
15
 
15
- Multi-token support (EVM chains only):
16
+ + 15 testnets for development and testing.
17
+
18
+ Multi-token support:
16
19
  - USDC: All chains
17
20
  - EURC: Ethereum, Base, Avalanche
18
- - AUSD: Ethereum, Arbitrum, Avalanche, Polygon, Monad
21
+ - AUSD: Ethereum, Arbitrum, Avalanche, Polygon, Monad, Sui
19
22
  - PYUSD: Ethereum
20
23
 
21
24
  You can register custom networks using `register_network()`.
@@ -259,6 +259,7 @@ def validate_sui_payload(payload: Dict[str, Any]) -> bool:
259
259
  - from: Sender address
260
260
  - to: Recipient address
261
261
  - amount: Transfer amount (string)
262
+ - coinObjectId: Sui coin object ID used for transfer (REQUIRED by facilitator)
262
263
 
263
264
  Args:
264
265
  payload: Payload dictionary from x402 payment
@@ -266,7 +267,8 @@ def validate_sui_payload(payload: Dict[str, Any]) -> bool:
266
267
  Returns:
267
268
  True if valid, raises ValueError if invalid
268
269
  """
269
- required_fields = ["transactionBytes", "senderSignature", "from", "to", "amount"]
270
+ # CRITICAL: coinObjectId is REQUIRED by the facilitator for deserialization
271
+ required_fields = ["transactionBytes", "senderSignature", "from", "to", "amount", "coinObjectId"]
270
272
  for field in required_fields:
271
273
  if field not in payload:
272
274
  raise ValueError(f"Sui payload missing '{field}' field")
@@ -303,6 +305,11 @@ def validate_sui_payload(payload: Dict[str, Any]) -> bool:
303
305
  except (ValueError, TypeError) as e:
304
306
  raise ValueError(f"Invalid amount: {e}")
305
307
 
308
+ # Validate coinObjectId is a valid Sui object ID (66 chars: 0x + 64 hex)
309
+ coin_object_id = payload["coinObjectId"]
310
+ if not is_valid_sui_address(coin_object_id):
311
+ raise ValueError(f"Invalid coinObjectId: {coin_object_id} (expected 0x + 64 hex chars)")
312
+
306
313
  return True
307
314
 
308
315
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: uvd-x402-sdk
3
- Version: 0.5.5
3
+ Version: 0.5.6
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
File without changes
File without changes
File without changes