dominusnode 1.0.0__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.
dominusnode/x402.py ADDED
@@ -0,0 +1,88 @@
1
+ """x402 (HTTP 402 Payment Required) protocol information resource."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import List
6
+ from dataclasses import dataclass, field
7
+
8
+ from .http_client import AsyncHttpClient, SyncHttpClient
9
+
10
+
11
+ @dataclass(frozen=True)
12
+ class X402Facilitator:
13
+ address: str
14
+ chain: str
15
+ network: str
16
+
17
+
18
+ @dataclass(frozen=True)
19
+ class X402Pricing:
20
+ per_request_cents: int
21
+ per_gb_cents: int
22
+ currency: str
23
+
24
+
25
+ @dataclass(frozen=True)
26
+ class X402Info:
27
+ supported: bool
28
+ enabled: bool
29
+ protocol: str
30
+ version: str
31
+ facilitators: List[X402Facilitator]
32
+ pricing: X402Pricing
33
+ currencies: List[str]
34
+ wallet_type: str
35
+ agentic_wallets: bool
36
+
37
+
38
+ def _parse_x402_info(data: dict) -> X402Info:
39
+ """Parse x402 info response into typed dataclass."""
40
+ facilitators = [
41
+ X402Facilitator(
42
+ address=f["address"],
43
+ chain=f["chain"],
44
+ network=f["network"],
45
+ )
46
+ for f in data.get("facilitators", [])
47
+ ]
48
+ pricing_data = data.get("pricing", {})
49
+ pricing = X402Pricing(
50
+ per_request_cents=pricing_data.get("perRequestCents", 0),
51
+ per_gb_cents=pricing_data.get("perGbCents", 0),
52
+ currency=pricing_data.get("currency", ""),
53
+ )
54
+ return X402Info(
55
+ supported=data.get("supported", False),
56
+ enabled=data.get("enabled", False),
57
+ protocol=data.get("protocol", ""),
58
+ version=data.get("version", ""),
59
+ facilitators=facilitators,
60
+ pricing=pricing,
61
+ currencies=data.get("currencies", []),
62
+ wallet_type=data.get("walletType", ""),
63
+ agentic_wallets=data.get("agenticWallets", False),
64
+ )
65
+
66
+
67
+ class X402Resource:
68
+ """Synchronous x402 protocol information operations."""
69
+
70
+ def __init__(self, http: SyncHttpClient) -> None:
71
+ self._http = http
72
+
73
+ def get_info(self) -> X402Info:
74
+ """Get x402 protocol information (no auth required)."""
75
+ data = self._http.get("/api/x402/info", requires_auth=False)
76
+ return _parse_x402_info(data)
77
+
78
+
79
+ class AsyncX402Resource:
80
+ """Asynchronous x402 protocol information operations."""
81
+
82
+ def __init__(self, http: AsyncHttpClient) -> None:
83
+ self._http = http
84
+
85
+ async def get_info(self) -> X402Info:
86
+ """Get x402 protocol information (no auth required)."""
87
+ data = await self._http.get("/api/x402/info", requires_auth=False)
88
+ return _parse_x402_info(data)
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dominus Node
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.1
2
+ Name: dominusnode
3
+ Version: 1.0.0
4
+ Summary: Official Dominus Node SDK for Python
5
+ License: MIT
6
+ Requires-Python: >=3.9
7
+ License-File: LICENSE
8
+ Requires-Dist: httpx >=0.24.0
9
+ Provides-Extra: dev
10
+ Requires-Dist: pytest >=7.0 ; extra == 'dev'
11
+ Requires-Dist: pytest-asyncio >=0.21 ; extra == 'dev'
12
+ Requires-Dist: respx >=0.20 ; extra == 'dev'
13
+
@@ -0,0 +1,26 @@
1
+ dominusnode/__init__.py,sha256=WHpiGLDhnzEjWKIuDDGMabBv3XJlbrtF2TS1bHvkp-w,3285
2
+ dominusnode/admin.py,sha256=xPmJSQgFZvzITZRiWBnQPlveIGwTE9T6d3P7ScL4q-k,10129
3
+ dominusnode/agent_wallet.py,sha256=EmVwwv3XU9npTKG_GgLDzVOuEiDKdLhDNxhGXH9UJmo,9562
4
+ dominusnode/auth.py,sha256=lDOo-iau1QttDuRzRviLEcnkli5lkj3-Sa7Hj4pvmIw,10890
5
+ dominusnode/client.py,sha256=OrrUEV_tmEZbO9ePzDtoERLCR_MzLTjyWnFEqn8I3b0,16689
6
+ dominusnode/constants.py,sha256=TrinW6HzWvzUO69qfMWeb8Zh0FVTSw1QILwTgyeyOno,497
7
+ dominusnode/errors.py,sha256=vF4fwhOt6d3_6SWBhrD5GOLI8dpvdfz8cSyYew9FmYI,2858
8
+ dominusnode/http_client.py,sha256=xvMXgR1FaDasN9xWnH9vsZnBWPvq-WAlyjVps4Y15-o,16613
9
+ dominusnode/keys.py,sha256=oWbVwsrneQ4Onx2TD-vCu3OcimLgrlHp9LgWKOGlecA,3332
10
+ dominusnode/plans.py,sha256=hwr8WInN5wqyUDx-Km7fJUgqFlR-Lm1SKW_pUQrQHhs,3674
11
+ dominusnode/proxy.py,sha256=2EuL-cRyCEE09yV4uDcQ2zIm__sJJNX6CRGqrYtPM-I,8740
12
+ dominusnode/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
+ dominusnode/sessions.py,sha256=-7vlztmbGds2A1OsbAV3_TW5APfxbu8nQv56JUkTfhA,2129
14
+ dominusnode/slots.py,sha256=VKGGWnGoaU5m5qz0Fs8mcdRhsAlqkS7m5N3rSI974nM,2335
15
+ dominusnode/teams.py,sha256=nWU0FxVqky-Ci3kHfx43SuDEna1YQP7JPkO4BNDmdE0,13217
16
+ dominusnode/token_manager.py,sha256=xgkhJMaYoRX5svI1veIwQqQLW8oBTvUTNqDJBel0sEw,8002
17
+ dominusnode/types.py,sha256=_RF_Ok2byJ7Bliop1mXt7q1XXDQlQ6aV5RzMgMB3B1E,13862
18
+ dominusnode/usage.py,sha256=9Mj5kNAayhi86TjVlY4HH4SSTojP64_aUQlM-MxNhNk,7074
19
+ dominusnode/wallet.py,sha256=qGUmCAHoBFqkEVTqCfSVsf19x1ATkUToLLZ_2KMWnII,8063
20
+ dominusnode/wallet_auth.py,sha256=rroGn2GrTmyy6EYiKYfNrZfnZSvBZ70cwJvSACdMPWA,8877
21
+ dominusnode/x402.py,sha256=mtziF6ZQyHLArrBXaMDiE4svUOzZS7jkesmv9RYjta8,2431
22
+ dominusnode-1.0.0.dist-info/LICENSE,sha256=NBkjfgN0tpbJjWf7uqsPCOMgq7uuSEW4uaGDCpB8HbI,1069
23
+ dominusnode-1.0.0.dist-info/METADATA,sha256=axYGZgosJ9gRZRovaKvFMra-c0bwvDM8neYQi87E32o,354
24
+ dominusnode-1.0.0.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
25
+ dominusnode-1.0.0.dist-info/top_level.txt,sha256=xUsTotK5cVkWFeLnn6BJMeUjd7M-Y7_Amo8JawImfco,12
26
+ dominusnode-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (71.1.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ dominusnode