stableops 0.7.1__tar.gz → 0.10.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 (26) hide show
  1. {stableops-0.7.1 → stableops-0.10.4}/PKG-INFO +3 -3
  2. {stableops-0.7.1 → stableops-0.10.4}/examples/async_example.py +2 -2
  3. {stableops-0.7.1 → stableops-0.10.4}/examples/create_order.py +3 -3
  4. {stableops-0.7.1 → stableops-0.10.4}/pyproject.toml +3 -3
  5. {stableops-0.7.1 → stableops-0.10.4}/stableops/__init__.py +1 -1
  6. {stableops-0.7.1 → stableops-0.10.4}/stableops/addresses.py +2 -2
  7. {stableops-0.7.1 → stableops-0.10.4}/stableops/checkout_sessions.py +1 -1
  8. {stableops-0.7.1 → stableops-0.10.4}/stableops/client.py +2 -2
  9. {stableops-0.7.1 → stableops-0.10.4}/stableops/payment_orders.py +15 -2
  10. {stableops-0.7.1 → stableops-0.10.4}/tests/test_addresses.py +1 -1
  11. {stableops-0.7.1 → stableops-0.10.4}/tests/test_checkout_sessions.py +5 -5
  12. {stableops-0.7.1 → stableops-0.10.4}/tests/test_payment_orders.py +5 -5
  13. {stableops-0.7.1 → stableops-0.10.4}/tests/test_types.py +3 -3
  14. {stableops-0.7.1 → stableops-0.10.4}/.github/workflows/publish.yml +0 -0
  15. {stableops-0.7.1 → stableops-0.10.4}/.gitignore +0 -0
  16. {stableops-0.7.1 → stableops-0.10.4}/.pylintrc +0 -0
  17. {stableops-0.7.1 → stableops-0.10.4}/LICENSE +0 -0
  18. {stableops-0.7.1 → stableops-0.10.4}/README.md +0 -0
  19. {stableops-0.7.1 → stableops-0.10.4}/README.zh-CN.md +0 -0
  20. {stableops-0.7.1 → stableops-0.10.4}/examples/README.md +0 -0
  21. {stableops-0.7.1 → stableops-0.10.4}/examples/webhook_handler.py +0 -0
  22. {stableops-0.7.1 → stableops-0.10.4}/stableops/errors.py +0 -0
  23. {stableops-0.7.1 → stableops-0.10.4}/stableops/http.py +0 -0
  24. {stableops-0.7.1 → stableops-0.10.4}/stableops/types.py +0 -0
  25. {stableops-0.7.1 → stableops-0.10.4}/stableops/webhooks.py +0 -0
  26. {stableops-0.7.1 → stableops-0.10.4}/tests/test_webhooks.py +0 -0
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stableops
3
- Version: 0.7.1
3
+ Version: 0.10.4
4
4
  Summary: Official Python SDK for StableOps - Stablecoin payment infrastructure
5
5
  Project-URL: Homepage, https://stableops.dev
6
6
  Project-URL: Documentation, https://docs.stableops.dev
7
- Project-URL: Repository, https://github.com/stableops/stableops
8
- Project-URL: Bug Tracker, https://github.com/stableops/stableops/issues
7
+ Project-URL: Repository, https://github.com/StableOps/stableops-api-python-sdk
8
+ Project-URL: Bug Tracker, https://github.com/StableOps/stableops-api-python-sdk/issues
9
9
  Author-email: StableOps <hello@stableops.dev>
10
10
  License: Apache-2.0
11
11
  License-File: LICENSE
@@ -18,8 +18,8 @@ async def main():
18
18
  order = await client.payment_orders.create(
19
19
  merchant_order_id="async_order_123",
20
20
  amount="25.00",
21
- accepted_assets=[{"chain": "base", "asset": "USDC"}],
22
- expires_at=(datetime.now(timezone.utc) + timedelta(minutes=25)).isoformat(),
21
+ accepted_assets=[{"chain": "base-sepolia", "asset": "USDC"}],
22
+ expires_at=(datetime.now(timezone.utc) + timedelta(minutes=25)).strftime("%Y-%m-%dT%H:%M:%SZ"),
23
23
  )
24
24
 
25
25
  print(f"✓ Order created: {order.id}")
@@ -17,11 +17,11 @@ order = client.payment_orders.create(
17
17
  merchant_order_id=f"order_{int(time.time())}",
18
18
  amount="10.00",
19
19
  accepted_assets=[
20
- {"chain": "base", "asset": "USDC"},
21
- {"chain": "ethereum", "asset": "USDC"},
20
+ {"chain": "base-sepolia", "asset": "USDC"},
21
+ {"chain": "ethereum-sepolia", "asset": "USDC"},
22
22
  ],
23
23
  # 必传:≤30min(sandbox)/≤24h(live)。
24
- expires_at=(datetime.now(timezone.utc) + timedelta(minutes=25)).isoformat(),
24
+ expires_at=(datetime.now(timezone.utc) + timedelta(minutes=25)).strftime("%Y-%m-%dT%H:%M:%SZ"),
25
25
  metadata={
26
26
  "user_id": "user_123",
27
27
  "product_id": "prod_456",
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "stableops"
7
- version = "0.7.1"
7
+ version = "0.10.4"
8
8
  description = "Official Python SDK for StableOps - Stablecoin payment infrastructure"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -46,8 +46,8 @@ dev = [
46
46
  [project.urls]
47
47
  Homepage = "https://stableops.dev"
48
48
  Documentation = "https://docs.stableops.dev"
49
- Repository = "https://github.com/stableops/stableops"
50
- "Bug Tracker" = "https://github.com/stableops/stableops/issues"
49
+ Repository = "https://github.com/StableOps/stableops-api-python-sdk"
50
+ "Bug Tracker" = "https://github.com/StableOps/stableops-api-python-sdk/issues"
51
51
 
52
52
  [tool.hatch.build.targets.wheel]
53
53
  packages = ["stableops"]
@@ -8,7 +8,7 @@ Example:
8
8
  >>> order = client.payment_orders.create(
9
9
  ... merchant_order_id="order_123",
10
10
  ... amount="10.00",
11
- ... accepted_assets=[{"chain": "base", "asset": "USDC"}],
11
+ ... accepted_assets=[{"chain": "base-sepolia", "asset": "USDC"}],
12
12
  ... expires_at="2026-06-20T12:30:00Z",
13
13
  ... )
14
14
  """
@@ -55,7 +55,7 @@ class AddressesApi:
55
55
 
56
56
  Example:
57
57
  >>> result = client.addresses.import_addresses(
58
- ... chain="base",
58
+ ... chain="base-sepolia",
59
59
  ... addresses=["0x1234..."],
60
60
  ... mode="single",
61
61
  ... )
@@ -92,7 +92,7 @@ class AddressesApi:
92
92
  Response with items and has_more
93
93
 
94
94
  Example:
95
- >>> result = client.addresses.list(chain="base", limit=20)
95
+ >>> result = client.addresses.list(chain="base-sepolia", limit=20)
96
96
  """
97
97
  query: Dict[str, Any] = {}
98
98
  if chain:
@@ -102,7 +102,7 @@ class CheckoutSessionsApi:
102
102
  >>> session = client.checkout_sessions.create(
103
103
  ... merchant_order_id="order_123",
104
104
  ... amount="10.00",
105
- ... accepted_assets=[{"chain": "base", "asset": "USDC"}],
105
+ ... accepted_assets=[{"chain": "base-sepolia", "asset": "USDC"}],
106
106
  ... expires_at="2026-06-20T12:30:00Z",
107
107
  ... title="Pro plan",
108
108
  ... success_url="https://shop.example/success",
@@ -21,7 +21,7 @@ class StableOps:
21
21
  ... merchant_order_id="order_123",
22
22
  ... amount="10.00",
23
23
  ... settlement_asset="USDC",
24
- ... accepted_assets=[{"chain": "base", "asset": "USDC"}],
24
+ ... accepted_assets=[{"chain": "base-sepolia", "asset": "USDC"}],
25
25
  ... expires_at="2026-06-20T12:30:00Z",
26
26
  ... )
27
27
  """
@@ -85,7 +85,7 @@ class AsyncStableOps:
85
85
  ... merchant_order_id="order_123",
86
86
  ... amount="10.00",
87
87
  ... settlement_asset="USDC",
88
- ... accepted_assets=[{"chain": "base", "asset": "USDC"}],
88
+ ... accepted_assets=[{"chain": "base-sepolia", "asset": "USDC"}],
89
89
  ... expires_at="2026-06-20T12:30:00Z",
90
90
  ... )
91
91
  ... print(f"Order created: {order.id}")
@@ -10,6 +10,19 @@ from stableops.types import (
10
10
  )
11
11
 
12
12
 
13
+ def _normalize_iso_datetime(dt: str) -> str:
14
+ """Convert ISO datetime to Zod 4-compatible format (requires 'Z' suffix for UTC).
15
+
16
+ Python's datetime.isoformat() produces '+00:00' for UTC, but Zod 4's
17
+ iso.datetime() only accepts the 'Z' suffix and rejects '+00:00'.
18
+ """
19
+ if dt.endswith('+00:00'):
20
+ return dt[:-6] + 'Z'
21
+ if dt.endswith('+00:00.000'):
22
+ return dt[:-9] + 'Z'
23
+ return dt
24
+
25
+
13
26
  def _to_create_body(
14
27
  merchant_order_id: str,
15
28
  amount: str,
@@ -23,7 +36,7 @@ def _to_create_body(
23
36
  "merchant_order_id": merchant_order_id,
24
37
  "amount": amount,
25
38
  "accepted_assets": accepted_assets,
26
- "expires_at": expires_at,
39
+ "expires_at": _normalize_iso_datetime(expires_at),
27
40
  }
28
41
  if amount_mode is not None:
29
42
  body["amount_mode"] = amount_mode
@@ -97,7 +110,7 @@ class PaymentOrdersApi:
97
110
  >>> order = client.payment_orders.create(
98
111
  ... merchant_order_id="order_123",
99
112
  ... amount="10.00",
100
- ... accepted_assets=[{"chain": "base", "asset": "USDC"}],
113
+ ... accepted_assets=[{"chain": "base-sepolia", "asset": "USDC"}],
101
114
  ... expires_at="2026-06-20T12:30:00Z",
102
115
  ... )
103
116
  """
@@ -13,7 +13,7 @@ class FakeHttp:
13
13
  self.last_request = kwargs
14
14
  return {
15
15
  "id": "addr_1",
16
- "chain": "base",
16
+ "chain": "base-sepolia",
17
17
  "address": "0xabc",
18
18
  "label": kwargs["body"].get("label"),
19
19
  "mode": "single",
@@ -27,8 +27,8 @@ def _wire_session(**overrides: Any) -> Dict[str, Any]:
27
27
  "expires_at": None,
28
28
  "metadata": None,
29
29
  "created_at": "2026-06-01T00:00:00.000Z",
30
- "accepted_assets": [{"chain": "base", "asset": "USDC"}],
31
- "payment_instructions": [{"chain": "base", "asset": "USDC", "address": "0xabc"}],
30
+ "accepted_assets": [{"chain": "base-sepolia", "asset": "USDC"}],
31
+ "payment_instructions": [{"chain": "base-sepolia", "asset": "USDC", "address": "0xabc"}],
32
32
  },
33
33
  }
34
34
  wire.update(overrides)
@@ -52,7 +52,7 @@ def test_create_builds_hosted_url_from_client_secret() -> None:
52
52
  session = api.create(
53
53
  merchant_order_id="m_1",
54
54
  amount="10.00",
55
- accepted_assets=[{"chain": "base", "asset": "USDC"}],
55
+ accepted_assets=[{"chain": "base-sepolia", "asset": "USDC"}],
56
56
  expires_at="2026-06-20T12:30:00Z",
57
57
  title="Pro plan",
58
58
  walletconnect_project_id="wc_proj_1",
@@ -73,7 +73,7 @@ def test_create_default_base_url() -> None:
73
73
  session = api.create(
74
74
  merchant_order_id="m_1",
75
75
  amount="10.00",
76
- accepted_assets=[{"chain": "base", "asset": "USDC"}],
76
+ accepted_assets=[{"chain": "base-sepolia", "asset": "USDC"}],
77
77
  expires_at="2026-06-20T12:30:00Z",
78
78
  )
79
79
 
@@ -88,7 +88,7 @@ def test_url_is_none_without_client_secret() -> None:
88
88
  session = api.create(
89
89
  merchant_order_id="m_1",
90
90
  amount="10.00",
91
- accepted_assets=[{"chain": "base", "asset": "USDC"}],
91
+ accepted_assets=[{"chain": "base-sepolia", "asset": "USDC"}],
92
92
  expires_at="2026-06-20T12:30:00Z",
93
93
  )
94
94
 
@@ -16,8 +16,8 @@ def _wire_order(**overrides: Any) -> Dict[str, Any]:
16
16
  "expires_at": None,
17
17
  "metadata": None,
18
18
  "created_at": "2026-06-01T00:00:00.000Z",
19
- "accepted_assets": [{"chain": "base", "asset": "USDC"}],
20
- "payment_instructions": [{"chain": "base", "asset": "USDC", "address": "0xabc"}],
19
+ "accepted_assets": [{"chain": "base-sepolia", "asset": "USDC"}],
20
+ "payment_instructions": [{"chain": "base-sepolia", "asset": "USDC", "address": "0xabc"}],
21
21
  }
22
22
  wire.update(overrides)
23
23
  return wire
@@ -40,7 +40,7 @@ def test_create_does_not_send_settlement_asset_and_forwards_amount_mode() -> Non
40
40
  order = api.create(
41
41
  merchant_order_id="m_1",
42
42
  amount="10.00",
43
- accepted_assets=[{"chain": "base", "asset": "USDC"}],
43
+ accepted_assets=[{"chain": "base-sepolia", "asset": "USDC"}],
44
44
  expires_at="2026-06-20T12:30:00Z",
45
45
  amount_mode="auto",
46
46
  )
@@ -61,7 +61,7 @@ def test_amount_mode_omitted_when_not_provided() -> None:
61
61
  api.create(
62
62
  merchant_order_id="m_1",
63
63
  amount="10.00",
64
- accepted_assets=[{"chain": "base", "asset": "USDC"}],
64
+ accepted_assets=[{"chain": "base-sepolia", "asset": "USDC"}],
65
65
  expires_at="2026-06-20T12:30:00Z",
66
66
  )
67
67
 
@@ -78,7 +78,7 @@ def test_from_wire_tolerates_missing_settlement_asset() -> None:
78
78
  order = api.create(
79
79
  merchant_order_id="m_1",
80
80
  amount="10.00",
81
- accepted_assets=[{"chain": "base", "asset": "USDC"}],
81
+ accepted_assets=[{"chain": "base-sepolia", "asset": "USDC"}],
82
82
  expires_at="2026-06-20T12:30:00Z",
83
83
  )
84
84
 
@@ -32,12 +32,12 @@ def test_payment_order_accepts_current_api_wire_values() -> None:
32
32
  expires_at=None,
33
33
  metadata=None,
34
34
  created_at="2026-05-31T00:00:00.000Z",
35
- accepted_assets=[AcceptedAssetInput(chain="solana", asset="USDC")],
35
+ accepted_assets=[AcceptedAssetInput(chain="solana-devnet", asset="USDC")],
36
36
  payment_instructions=[
37
- PaymentOrderInstruction(chain="solana", asset="USDC", address="RecipientWallet123")
37
+ PaymentOrderInstruction(chain="solana-devnet", asset="USDC", address="RecipientWallet123")
38
38
  ],
39
39
  )
40
40
 
41
41
  assert order.status == "created"
42
42
  assert len(order.payment_instructions) == 1
43
- assert order.payment_instructions[0].chain == "solana"
43
+ assert order.payment_instructions[0].chain == "solana-devnet"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes