a2a-protocol-core 0.1.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.
@@ -0,0 +1,62 @@
1
+ """
2
+ a2a-protocol-core — the open, deterministic core of the DNS of Money A2A surface.
3
+
4
+ What lives here is the dependency-light, verifiable protocol layer that external
5
+ AI agents adopt: the ``pay:`` address grammar, the canonical/semantic hashing
6
+ used to make payment intent stable across vocabularies, the A2A-041 wire schemas,
7
+ and a thin payment-hook client.
8
+
9
+ The intelligence lives in the calling agent. This package serves deterministic,
10
+ inspectable primitives — no rail selection, no scoring, no model in the path.
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ from a2a_protocol_core.addressing import (
16
+ MAX_PAY_URI_LENGTH,
17
+ PAY_URI_PATTERN,
18
+ assert_valid_pay_uri,
19
+ is_valid_pay_uri,
20
+ )
21
+ from a2a_protocol_core.canonical_hash import compute_canonical_hash
22
+ from a2a_protocol_core.client import A2APaymentHookClient
23
+ from a2a_protocol_core.schemas import (
24
+ A2ACapabilities,
25
+ A2APaymentHookRequest,
26
+ A2APaymentHookResponse,
27
+ ResolutionDetail,
28
+ SettlementDetail,
29
+ )
30
+ from a2a_protocol_core.semantic_normalizer import (
31
+ CANONICAL_ACTIONS,
32
+ SYNONYM_MAP,
33
+ compute_semantic_hash,
34
+ normalize_action,
35
+ normalize_message,
36
+ )
37
+
38
+ __version__ = "0.1.0"
39
+
40
+ __all__ = [
41
+ "__version__",
42
+ # addressing
43
+ "PAY_URI_PATTERN",
44
+ "MAX_PAY_URI_LENGTH",
45
+ "is_valid_pay_uri",
46
+ "assert_valid_pay_uri",
47
+ # hashing
48
+ "compute_canonical_hash",
49
+ "compute_semantic_hash",
50
+ "normalize_action",
51
+ "normalize_message",
52
+ "CANONICAL_ACTIONS",
53
+ "SYNONYM_MAP",
54
+ # schemas
55
+ "A2APaymentHookRequest",
56
+ "A2APaymentHookResponse",
57
+ "ResolutionDetail",
58
+ "SettlementDetail",
59
+ "A2ACapabilities",
60
+ # client
61
+ "A2APaymentHookClient",
62
+ ]
@@ -0,0 +1,29 @@
1
+ """
2
+ FAS-1 ``pay:`` URI addressing.
3
+
4
+ The single source of truth for the ``pay:`` address grammar used across the
5
+ A2A protocol surface. Kept dependency-free (stdlib only) so it can be imported
6
+ anywhere — validators, schemas, clients.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ import re
12
+
13
+ # pay:<label>(.<label>)* — labels are lowercase alphanumeric + hyphen,
14
+ # 1..63 chars, no leading hyphen. Total length capped at 128.
15
+ PAY_URI_PATTERN = re.compile(r"^pay:[a-z0-9][a-z0-9\-]{0,62}(\.[a-z0-9][a-z0-9\-]{0,62})*$")
16
+
17
+ MAX_PAY_URI_LENGTH = 128
18
+
19
+
20
+ def is_valid_pay_uri(value: str) -> bool:
21
+ """Return True if ``value`` is a syntactically valid ``pay:`` URI."""
22
+ return bool(PAY_URI_PATTERN.match(value)) and len(value) <= MAX_PAY_URI_LENGTH
23
+
24
+
25
+ def assert_valid_pay_uri(value: str) -> str:
26
+ """Return ``value`` if valid, else raise ``ValueError``."""
27
+ if not is_valid_pay_uri(value):
28
+ raise ValueError(f"Invalid pay: URI format: {value}")
29
+ return value
@@ -0,0 +1,79 @@
1
+ """
2
+ A2A-008 Canonical Hash computation.
3
+
4
+ Produces a SHA256 hash of the semantically significant fields of a payment
5
+ request. Two semantically equivalent payments (same amount, currency, rail,
6
+ alias, category) produce the same ``canonical_hash`` regardless of
7
+ session/trace/idempotency metadata.
8
+
9
+ Excluded fields: session_id, request_id, trace_id, timestamp,
10
+ idempotency_key, memo, payload_hash, canonical_hash, created_at, updated_at.
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ import hashlib
16
+ import json
17
+
18
+ from a2a_protocol_core.semantic_normalizer import normalize_action
19
+
20
+ # Fields that carry no semantic payment meaning — excluded from the hash.
21
+ _EXCLUDED_KEYS = frozenset(
22
+ {
23
+ "session_id",
24
+ "request_id",
25
+ "trace_id",
26
+ "timestamp",
27
+ "idempotency_key",
28
+ "memo",
29
+ "payload_hash",
30
+ "canonical_hash",
31
+ "created_at",
32
+ "updated_at",
33
+ }
34
+ )
35
+
36
+ # Fields that carry semantic payment meaning — included if present.
37
+ _INCLUDED_KEYS = (
38
+ "amount",
39
+ "currency",
40
+ "rail",
41
+ "preferred_rail",
42
+ "alias",
43
+ "alias_uri",
44
+ "alias_name",
45
+ "payment_category",
46
+ "payment_type",
47
+ "action",
48
+ )
49
+
50
+
51
+ def compute_canonical_hash(payment_request: dict) -> str:
52
+ """
53
+ Compute the SHA256 canonical hash of semantically significant payment fields.
54
+
55
+ Rules:
56
+ - Include: amount, currency, rail/preferred_rail, alias/alias_uri,
57
+ payment_category/payment_type, action.
58
+ - Exclude: session_id, request_id, trace_id, timestamp,
59
+ idempotency_key, memo, payload_hash, canonical_hash.
60
+ - Normalize ``action`` via the A2A-009 semantic normalizer.
61
+ - Sort keys, JSON serialize, SHA256.
62
+ """
63
+ canonical: dict = {}
64
+ for key in _INCLUDED_KEYS:
65
+ if key in payment_request and payment_request[key] is not None:
66
+ val = payment_request[key]
67
+ # Normalize numeric types to string for consistency.
68
+ if isinstance(val, (int, float)):
69
+ val = str(val)
70
+ # Normalize action via the semantic normalizer (best-effort).
71
+ if key == "action" and isinstance(val, str):
72
+ try:
73
+ val = normalize_action(val)
74
+ except ValueError:
75
+ pass # keep raw if not a recognized action
76
+ canonical[key] = val
77
+
78
+ serialized = json.dumps(canonical, sort_keys=True)
79
+ return hashlib.sha256(serialized.encode()).hexdigest()
@@ -0,0 +1,104 @@
1
+ """
2
+ A2A-041 Payment Hook client.
3
+
4
+ A thin, synchronous client over the DNS of Money A2A surface. Intelligence
5
+ lives in the *calling* agent; this client only carries a well-formed,
6
+ validated request to the deterministic core and parses the response.
7
+
8
+ from a2a_protocol_core import A2APaymentHookClient
9
+
10
+ client = A2APaymentHookClient(base_url="https://api.dnsofmoney.com")
11
+ result = client.trigger(
12
+ job_id="job-123",
13
+ provider_pay_address="pay:agent.compute",
14
+ requester_pay_address="pay:vendor.alpha",
15
+ amount="2.50",
16
+ currency="USD",
17
+ semantic_hash="abc123...",
18
+ )
19
+ print(result.settlement_result.status, result.iso_message_ref)
20
+ """
21
+
22
+ from __future__ import annotations
23
+
24
+ from decimal import Decimal
25
+ from typing import Optional, Union
26
+
27
+ import requests
28
+
29
+ from a2a_protocol_core.schemas import (
30
+ A2ACapabilities,
31
+ A2APaymentHookRequest,
32
+ A2APaymentHookResponse,
33
+ )
34
+
35
+ DEFAULT_TIMEOUT = 30
36
+
37
+
38
+ class A2APaymentHookClient:
39
+ def __init__(
40
+ self,
41
+ base_url: str,
42
+ api_key: Optional[str] = None,
43
+ verify_ssl: bool = True,
44
+ timeout: int = DEFAULT_TIMEOUT,
45
+ session: Optional[requests.Session] = None,
46
+ ) -> None:
47
+ self.base_url = base_url.rstrip("/")
48
+ self.api_key = api_key
49
+ self.verify_ssl = verify_ssl
50
+ self.timeout = timeout
51
+ self._session = session or requests.Session()
52
+
53
+ def _headers(self) -> dict:
54
+ headers = {"Content-Type": "application/json"}
55
+ if self.api_key:
56
+ headers["X-API-Key"] = self.api_key
57
+ return headers
58
+
59
+ def capabilities(self) -> A2ACapabilities:
60
+ """Fetch the server's advertised A2A capabilities."""
61
+ resp = self._session.get(
62
+ f"{self.base_url}/v1/a2a/capabilities",
63
+ headers=self._headers(),
64
+ verify=self.verify_ssl,
65
+ timeout=self.timeout,
66
+ )
67
+ resp.raise_for_status()
68
+ return A2ACapabilities.model_validate(resp.json())
69
+
70
+ def trigger(
71
+ self,
72
+ job_id: str,
73
+ provider_pay_address: str,
74
+ requester_pay_address: str,
75
+ amount: Union[str, int, float, Decimal],
76
+ semantic_hash: str,
77
+ currency: str = "USD",
78
+ receipt_ref: Optional[str] = None,
79
+ ) -> A2APaymentHookResponse:
80
+ """
81
+ Fire the A2A-041 payment hook.
82
+
83
+ The request is validated client-side (pay: URI grammar, non-empty
84
+ semantic hash) before it ever hits the wire, so malformed intents fail
85
+ fast and locally.
86
+ """
87
+ request = A2APaymentHookRequest(
88
+ job_id=job_id,
89
+ provider_pay_address=provider_pay_address,
90
+ requester_pay_address=requester_pay_address,
91
+ amount=Decimal(str(amount)),
92
+ currency=currency,
93
+ semantic_hash=semantic_hash,
94
+ receipt_ref=receipt_ref,
95
+ )
96
+ resp = self._session.post(
97
+ f"{self.base_url}/v1/a2a/payment-hook",
98
+ data=request.model_dump_json(),
99
+ headers=self._headers(),
100
+ verify=self.verify_ssl,
101
+ timeout=self.timeout,
102
+ )
103
+ resp.raise_for_status()
104
+ return A2APaymentHookResponse.model_validate(resp.json())
File without changes
@@ -0,0 +1,72 @@
1
+ """
2
+ Wire schemas for the A2A-041 Payment Hook.
3
+
4
+ Pydantic v2 models shared between client and server. These define the public
5
+ request/response contract for ``POST /v1/a2a/payment-hook``.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import uuid
11
+ from datetime import datetime
12
+ from decimal import Decimal
13
+ from typing import Optional
14
+
15
+ from pydantic import BaseModel, field_validator
16
+
17
+ from a2a_protocol_core.addressing import is_valid_pay_uri
18
+
19
+
20
+ class A2APaymentHookRequest(BaseModel):
21
+ """A2A-041 compute-marketplace receipt -> settlement trigger."""
22
+
23
+ job_id: str
24
+ provider_pay_address: str
25
+ requester_pay_address: str
26
+ amount: Decimal
27
+ currency: str = "USD"
28
+ semantic_hash: str
29
+ receipt_ref: Optional[str] = None
30
+
31
+ @field_validator("provider_pay_address", "requester_pay_address")
32
+ @classmethod
33
+ def _validate_pay_uri(cls, v: str) -> str:
34
+ if not is_valid_pay_uri(v):
35
+ raise ValueError(f"Invalid pay: URI format: {v}")
36
+ return v
37
+
38
+ @field_validator("semantic_hash")
39
+ @classmethod
40
+ def _validate_semantic_hash(cls, v: str) -> str:
41
+ if not v or not v.strip():
42
+ raise ValueError("semantic_hash must not be empty")
43
+ return v
44
+
45
+
46
+ class ResolutionDetail(BaseModel):
47
+ provider_address: Optional[str] = None
48
+ rail: Optional[str] = None
49
+ endpoint: Optional[str] = None
50
+
51
+
52
+ class SettlementDetail(BaseModel):
53
+ status: str
54
+ rail: Optional[str] = None
55
+ tx_ref: Optional[str] = None
56
+ amount: Decimal
57
+ currency: str
58
+
59
+
60
+ class A2APaymentHookResponse(BaseModel):
61
+ hook_id: uuid.UUID
62
+ job_id: str
63
+ resolution: ResolutionDetail
64
+ settlement_result: SettlementDetail
65
+ iso_message_ref: Optional[str] = None
66
+ created_at: datetime
67
+
68
+
69
+ class A2ACapabilities(BaseModel):
70
+ binding_version: str
71
+ supported_schemes: list[str]
72
+ protocol_versions: list[str]
@@ -0,0 +1,75 @@
1
+ """
2
+ A2A-009 Semantic Normalizer.
3
+
4
+ Collapses synonym verbs ("send", "pay", "transfer") into canonical
5
+ action codes ("EXECUTE_PAYMENT", "QUERY", "VERIFY", "REPORT").
6
+
7
+ Used by A2A-008 ``canonical_hash`` for action field normalization. Two agents
8
+ that describe the same intent with different words produce the same canonical
9
+ action, so the canonical hash is stable across vocabularies.
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ import hashlib
15
+ import json
16
+ from copy import deepcopy
17
+
18
+ SYNONYM_MAP: dict[str, str] = {
19
+ "transfer": "EXECUTE_PAYMENT",
20
+ "send": "EXECUTE_PAYMENT",
21
+ "pay": "EXECUTE_PAYMENT",
22
+ "payment": "EXECUTE_PAYMENT",
23
+ "resolve": "QUERY",
24
+ "lookup": "QUERY",
25
+ "verify": "VERIFY",
26
+ "check": "VERIFY",
27
+ "confirm": "VERIFY",
28
+ "report": "REPORT",
29
+ "status": "REPORT",
30
+ }
31
+
32
+ CANONICAL_ACTIONS: frozenset[str] = frozenset(
33
+ {
34
+ "EXECUTE_PAYMENT",
35
+ "QUERY",
36
+ "VERIFY",
37
+ "REPORT",
38
+ }
39
+ )
40
+
41
+
42
+ def normalize_action(raw_action: str) -> str:
43
+ """
44
+ Normalize a raw action string to its canonical form.
45
+
46
+ Lowercases, strips whitespace, collapses synonyms.
47
+ Raises ValueError if the result is not in CANONICAL_ACTIONS.
48
+ """
49
+ cleaned = raw_action.strip().lower()
50
+ canonical = SYNONYM_MAP.get(cleaned, cleaned.upper())
51
+ if canonical not in CANONICAL_ACTIONS:
52
+ raise ValueError(f"Unknown action '{raw_action}' — not in {sorted(CANONICAL_ACTIONS)}")
53
+ return canonical
54
+
55
+
56
+ def normalize_message(message: dict) -> dict:
57
+ """
58
+ Normalize the 'action' field of an A2A message.
59
+
60
+ Returns a normalized copy — does NOT mutate the input.
61
+ """
62
+ normalized = deepcopy(message)
63
+ if "action" in normalized:
64
+ normalized["action"] = normalize_action(normalized["action"])
65
+ return normalized
66
+
67
+
68
+ def compute_semantic_hash(normalized_message: dict) -> str:
69
+ """
70
+ SHA256 of the canonical representation of a normalized message.
71
+
72
+ Deterministic: same normalized content -> same hash.
73
+ """
74
+ serialized = json.dumps(normalized_message, sort_keys=True)
75
+ return hashlib.sha256(serialized.encode()).hexdigest()
@@ -0,0 +1,111 @@
1
+ Metadata-Version: 2.4
2
+ Name: a2a-protocol-core
3
+ Version: 0.1.0
4
+ Summary: Open, deterministic protocol core for the DNS of Money A2A payment surface (FAS-1 pay: addressing, canonical hashing, payment-hook client).
5
+ Project-URL: Homepage, https://dnsofmoney.com
6
+ Project-URL: Specification, https://github.com/dnsofmoney/dns-of-money
7
+ Project-URL: Source, https://github.com/dnsofmoney/a2a-protocol-core
8
+ Author: DNS of Money
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: a2a,ai-agents,fas-1,iso20022,pay-uri,payments,xrpl
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Topic :: Office/Business :: Financial
17
+ Requires-Python: >=3.10
18
+ Requires-Dist: pydantic>=2.10.0
19
+ Requires-Dist: requests>=2.31.0
20
+ Provides-Extra: dev
21
+ Requires-Dist: pytest>=8.3.0; extra == 'dev'
22
+ Requires-Dist: ruff>=0.8.0; extra == 'dev'
23
+ Description-Content-Type: text/markdown
24
+
25
+ # a2a-protocol-core
26
+
27
+ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
28
+
29
+ The open, **deterministic** protocol core of the [DNS of Money](https://dnsofmoney.com)
30
+ agent-to-agent (A2A) payment surface — the dependency-light layer external AI
31
+ agents adopt to resolve, hash, and initiate `pay:` payments.
32
+
33
+ > The intelligence lives in the **calling agent**. This package serves
34
+ > deterministic, inspectable primitives — no rail selection, no scoring, no
35
+ > model anywhere in the money path.
36
+
37
+ ## Install
38
+
39
+ ```bash
40
+ pip install a2a-protocol-core
41
+ ```
42
+
43
+ Runtime deps are intentionally minimal: `pydantic` and `requests`.
44
+
45
+ ## What's in here
46
+
47
+ | Module | A2A ref | Purpose |
48
+ |---|---|---|
49
+ | `addressing` | FAS-1 | `pay:` URI grammar + validation (`is_valid_pay_uri`) |
50
+ | `semantic_normalizer` | A2A-009 | collapse synonym verbs → canonical action codes |
51
+ | `canonical_hash` | A2A-008 | metadata- & vocabulary-stable payment-intent hash |
52
+ | `schemas` | A2A-041 | payment-hook request/response wire models |
53
+ | `client` | A2A-041 | `A2APaymentHookClient` over `/v1/a2a/*` |
54
+
55
+ ## Quick start
56
+
57
+ ```python
58
+ from a2a_protocol_core import (
59
+ A2APaymentHookClient,
60
+ compute_canonical_hash,
61
+ normalize_message,
62
+ )
63
+
64
+ # Your agent describes intent however it likes...
65
+ intent = {"action": "send", "amount": "2.50", "currency": "USD", "alias": "pay:agent.compute"}
66
+
67
+ # ...which collapses to a stable hash regardless of wording ("send" == "transfer" == "pay").
68
+ semantic_hash = compute_canonical_hash(normalize_message(intent))
69
+
70
+ client = A2APaymentHookClient(base_url="https://api.dnsofmoney.com")
71
+ result = client.trigger(
72
+ job_id="job-001",
73
+ provider_pay_address="pay:agent.compute",
74
+ requester_pay_address="pay:vendor.alpha",
75
+ amount="2.50",
76
+ currency="USD",
77
+ semantic_hash=semantic_hash,
78
+ )
79
+ print(result.settlement_result.status, result.iso_message_ref)
80
+ ```
81
+
82
+ See [`examples/trigger_payment_hook.py`](examples/trigger_payment_hook.py).
83
+
84
+ ## Why canonical hashing?
85
+
86
+ Two agents describing the same payment with different words ("send" vs
87
+ "transfer") or different session/trace metadata must produce the **same**
88
+ intent fingerprint. `compute_canonical_hash` excludes non-semantic noise
89
+ (session/request/trace ids, timestamps, idempotency keys, memos) and
90
+ normalizes the action verb, so the hash captures *what* is being paid — not
91
+ *how it was phrased*. That fingerprint binds an agent's intent to a settlement
92
+ without trusting free text.
93
+
94
+ ## Design constraints
95
+
96
+ - **Deterministic only.** Nothing here selects or scores a rail.
97
+ - **Off the money path.** The hash and client describe and carry intent; the
98
+ deterministic core (server-side) resolves, generates ISO 20022, and settles.
99
+ - **Dependency-light.** Safe to embed in an agent runtime.
100
+
101
+ ## Development
102
+
103
+ ```bash
104
+ pip install -e ".[dev]"
105
+ pytest
106
+ ruff check src tests
107
+ ```
108
+
109
+ ## License
110
+
111
+ Apache-2.0 — permissive with an explicit patent grant. See [LICENSE](LICENSE).
@@ -0,0 +1,11 @@
1
+ a2a_protocol_core/__init__.py,sha256=QZb-azs_WdhxhrFM0C48WC0QlyKjhy4SN9yZMTTJXEU,1682
2
+ a2a_protocol_core/addressing.py,sha256=CIz2mlPqXIozPFXRUti8hJjVshf7NTPVdL2M0L-a2pc,968
3
+ a2a_protocol_core/canonical_hash.py,sha256=dMnnNF2HFiqU0hBpJuniUFH3t_jIMuHzYqCacSPzvEU,2440
4
+ a2a_protocol_core/client.py,sha256=IMhd0B49tDgvwFOLqbgUqoC8cKJKapVmIj84I5qemxk,3237
5
+ a2a_protocol_core/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ a2a_protocol_core/schemas.py,sha256=lS31Z7hbTpL-DgHXquEhyeplkGaF4azfFjX0PDcQ1UM,1854
7
+ a2a_protocol_core/semantic_normalizer.py,sha256=nPXVPkORA2ndVGRG_E4ZRZ7UZwLuzyPuxhMKGZFXeNE,2116
8
+ a2a_protocol_core-0.1.0.dist-info/METADATA,sha256=--bhaPB0M4HlRoF-zYHs-Hyc9-gHm_tfZM9VJMs_obA,3967
9
+ a2a_protocol_core-0.1.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
10
+ a2a_protocol_core-0.1.0.dist-info/licenses/LICENSE,sha256=XQfMo7_nr-i2UdEebl_-yY3jP-IIDm2jmhs0WLcGlFg,11342
11
+ a2a_protocol_core-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.30.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 DNS of Money
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.