branta 3.2.2__tar.gz → 3.2.3__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. {branta-3.2.2 → branta-3.2.3}/CHANGELOG.md +5 -0
  2. {branta-3.2.2 → branta-3.2.3}/PKG-INFO +1 -1
  3. {branta-3.2.2 → branta-3.2.3}/branta/extensions.py +2 -1
  4. {branta-3.2.2 → branta-3.2.3}/branta/v2/parser.py +2 -2
  5. {branta-3.2.2 → branta-3.2.3}/pyproject.toml +1 -1
  6. {branta-3.2.2 → branta-3.2.3}/tests/test_extensions.py +5 -0
  7. {branta-3.2.2 → branta-3.2.3}/tests/test_qr_parser.py +4 -0
  8. branta-3.2.2/example.py +0 -40
  9. {branta-3.2.2 → branta-3.2.3}/.github/workflows/tests.yml +0 -0
  10. {branta-3.2.2 → branta-3.2.3}/.gitignore +0 -0
  11. {branta-3.2.2 → branta-3.2.3}/CLAUDE.md +0 -0
  12. {branta-3.2.2 → branta-3.2.3}/LICENSE +0 -0
  13. {branta-3.2.2 → branta-3.2.3}/README.md +0 -0
  14. {branta-3.2.2 → branta-3.2.3}/SECURITY.md +0 -0
  15. {branta-3.2.2 → branta-3.2.3}/branta/__init__.py +0 -0
  16. {branta-3.2.2 → branta-3.2.3}/branta/enums.py +0 -0
  17. {branta-3.2.2 → branta-3.2.3}/branta/exceptions.py +0 -0
  18. {branta-3.2.2 → branta-3.2.3}/branta/models.py +0 -0
  19. {branta-3.2.2 → branta-3.2.3}/branta/options.py +0 -0
  20. {branta-3.2.2 → branta-3.2.3}/branta/v2/__init__.py +0 -0
  21. {branta-3.2.2 → branta-3.2.3}/branta/v2/builder.py +0 -0
  22. {branta-3.2.2 → branta-3.2.3}/branta/v2/client.py +0 -0
  23. {branta-3.2.2 → branta-3.2.3}/branta/v2/encryption.py +0 -0
  24. {branta-3.2.2 → branta-3.2.3}/branta/v2/secret_generator.py +0 -0
  25. {branta-3.2.2 → branta-3.2.3}/branta/v2/serialization.py +0 -0
  26. {branta-3.2.2 → branta-3.2.3}/branta/v2/service.py +0 -0
  27. {branta-3.2.2 → branta-3.2.3}/tests/__init__.py +0 -0
  28. {branta-3.2.2 → branta-3.2.3}/tests/test_builder.py +0 -0
  29. {branta-3.2.2 → branta-3.2.3}/tests/test_client.py +0 -0
  30. {branta-3.2.2 → branta-3.2.3}/tests/test_encryption.py +0 -0
  31. {branta-3.2.2 → branta-3.2.3}/tests/test_integration.py +0 -0
  32. {branta-3.2.2 → branta-3.2.3}/tests/test_service.py +0 -0
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [3.2.3] - 2026-10-28
8
+
9
+ ### Added
10
+ - Recognize signet and regtest Ark addresses (`tark1`) as `ark_address`, alongside mainnet `ark1`. Strict-mode hash-ZK lookup and registration treat them the same way as `ark1`.
11
+
7
12
  ## [3.2.2] - 2026-09-30
8
13
 
9
14
  ### Fixed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: branta
3
- Version: 3.2.2
3
+ Version: 3.2.3
4
4
  Summary: Python SDK for the Branta V2 API — payment destination lookup and registration with zero-knowledge encryption support
5
5
  Project-URL: Homepage, https://branta.pro
6
6
  Project-URL: Repository, https://github.com/BrantaOps/branta-python
@@ -67,7 +67,8 @@ def is_bolt11(value: str) -> bool:
67
67
 
68
68
 
69
69
  def is_ark(value: str) -> bool:
70
- return value.lower().startswith("ark1")
70
+ lower = value.lower()
71
+ return lower.startswith("ark1") or lower.startswith("tark1")
71
72
 
72
73
 
73
74
  def is_silent_payment(value: str) -> bool:
@@ -5,7 +5,7 @@ from typing import Dict, List, Optional
5
5
  from urllib.parse import parse_qs, unquote, urlparse
6
6
 
7
7
  from branta.enums import DestinationType
8
- from branta.extensions import is_bolt11, is_silent_payment
8
+ from branta.extensions import is_ark, is_bolt11, is_silent_payment
9
9
 
10
10
  _LN_ADDRESS_RE = re.compile(r"^[^@\s]+@[^@\s]+\.[^@\s]+$")
11
11
  _ETH_HEX_RE = re.compile(r"^[0-9a-fA-F]{40}$")
@@ -27,7 +27,7 @@ def _detect_plain_text_type(value: str) -> Optional[DestinationType]:
27
27
  return DestinationType.Bolt12
28
28
  if lower.startswith("lnurl"):
29
29
  return DestinationType.LnUrl
30
- if lower.startswith("ark1"):
30
+ if is_ark(value):
31
31
  return DestinationType.ArkAddress
32
32
  if is_silent_payment(value):
33
33
  return DestinationType.SilentPayment
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "branta"
7
- version = "3.2.2"
7
+ version = "3.2.3"
8
8
  description = "Python SDK for the Branta V2 API — payment destination lookup and registration with zero-knowledge encryption support"
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -53,6 +53,10 @@ class TestIsArk:
53
53
  def test_uppercase_is_ark(self):
54
54
  assert is_ark("ARK1TESTADDRESS") is True
55
55
 
56
+ def test_tark1_prefix_is_ark(self):
57
+ assert is_ark("tark1testaddress") is True
58
+ assert is_ark("TARK1TESTADDRESS") is True
59
+
56
60
  def test_bitcoin_address_not_ark(self):
57
61
  assert is_ark("bc1qtest") is False
58
62
 
@@ -77,6 +81,7 @@ class TestGetHashZkType:
77
81
 
78
82
  def test_ark_returns_ark_type(self):
79
83
  assert get_hash_zk_type("ark1testaddress") == DestinationType.ArkAddress
84
+ assert get_hash_zk_type("tark1testaddress") == DestinationType.ArkAddress
80
85
 
81
86
  def test_silent_payment_returns_silent_payment_type(self):
82
87
  assert get_hash_zk_type("sp1testpayment") == DestinationType.SilentPayment
@@ -30,6 +30,10 @@ class TestQRParserPlainText:
30
30
  parser = QRParser("ark1testaddress")
31
31
  assert parser.destination_type == DestinationType.ArkAddress
32
32
 
33
+ def test_signet_ark_address_detected(self):
34
+ parser = QRParser("tark1testaddress")
35
+ assert parser.destination_type == DestinationType.ArkAddress
36
+
33
37
  def test_silent_payment_detected(self):
34
38
  parser = QRParser("sp1testpayment")
35
39
  assert parser.destination_type == DestinationType.SilentPayment
branta-3.2.2/example.py DELETED
@@ -1,40 +0,0 @@
1
- import asyncio
2
- import json
3
- import os
4
-
5
- from branta.enums import BrantaServerBaseUrl, DestinationType, PrivacyMode
6
- from branta.options import BrantaClientOptions
7
- from branta.v2 import BrantaService
8
-
9
- API_KEY = "77bc078af334fbcb616cec0b3e6f7e04c976c8629df8c616310924a65b24e3d6"
10
-
11
- options = BrantaClientOptions(
12
- base_url=BrantaServerBaseUrl.Localhost,
13
- default_api_key=API_KEY,
14
- privacy=PrivacyMode.Strict,
15
- )
16
-
17
-
18
- async def main() -> None:
19
- async with BrantaService(options) as service:
20
- payment = (
21
- service.create_payment_builder()
22
- .add_destination("bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq", DestinationType.BitcoinAddress)
23
- .set_zk()
24
- .set_child_platform("ChildCo", logo_url="https://example.com/logo.png")
25
- .build()
26
- )
27
-
28
- result = await service.add_payment(payment)
29
-
30
- print("Secret: ", result.secret)
31
- print("Verify URL:", result.verify_url)
32
- print("Payment:")
33
- print(json.dumps(
34
- {"destinations": [{"value": d.value, "type": d.type, "is_zk": d.is_zk} for d in result.payment.destinations]},
35
- indent=2,
36
- ))
37
-
38
-
39
- if __name__ == "__main__":
40
- asyncio.run(main())
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes