cryptochief-crypto-processing-python 0.1.0__tar.gz → 0.2.0__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 (41) hide show
  1. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/PKG-INFO +4 -3
  2. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/README.md +1 -0
  3. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/pyproject.toml +1 -1
  4. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/__init__.py +5 -0
  5. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/_version.py +1 -1
  6. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/client.py +2 -0
  7. cryptochief_crypto_processing_python-0.2.0/src/cryptochief/services/credits.py +70 -0
  8. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/.gitignore +0 -0
  9. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/LICENSE +0 -0
  10. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/_models.py +0 -0
  11. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/amount.py +0 -0
  12. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/assets.py +0 -0
  13. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/chains.py +0 -0
  14. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/contract/__init__.py +0 -0
  15. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/contract/base58.py +0 -0
  16. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/contract/borsh.py +0 -0
  17. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/contract/evm_abi.py +0 -0
  18. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/contract/keccak.py +0 -0
  19. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/contract/tron_address.py +0 -0
  20. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/errors.py +0 -0
  21. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/pagination.py +0 -0
  22. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/poll.py +0 -0
  23. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/rsa.py +0 -0
  24. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/services/__init__.py +0 -0
  25. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/services/base.py +0 -0
  26. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/services/blockchain.py +0 -0
  27. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/services/currencies.py +0 -0
  28. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/services/payins.py +0 -0
  29. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/services/payouts.py +0 -0
  30. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/services/static_deposits.py +0 -0
  31. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/services/sweeps.py +0 -0
  32. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/services/transactions.py +0 -0
  33. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/services/wallets.py +0 -0
  34. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/services/withdrawals.py +0 -0
  35. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/sign.py +0 -0
  36. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/ton/__init__.py +0 -0
  37. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/ton/address.py +0 -0
  38. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/ton/messages.py +0 -0
  39. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/ton/rpc.py +0 -0
  40. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/transport.py +0 -0
  41. {cryptochief_crypto_processing_python-0.1.0 → cryptochief_crypto_processing_python-0.2.0}/src/cryptochief/webhook.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: cryptochief-crypto-processing-python
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: Official async Python SDK for the Crypto Chief crypto payment gateway and crypto processing API. Accept crypto payments, send single and mass crypto payouts, sign on-chain transactions and smart-contract calls, manage wallets, convert fiat to crypto, and verify webhooks across Ethereum, BNB Smart Chain, Polygon, Tron, TON, Solana, Bitcoin, XRP and 20+ blockchains. USDT and USDC stablecoin support with int-precise amounts and asyncio/httpx.
5
5
  Project-URL: Homepage, https://crypto-chief.com/processing/
6
6
  Project-URL: Documentation, https://docs-sdk.crypto-chief.com/processing/python
@@ -34,7 +34,7 @@ Provides-Extra: dev
34
34
  Requires-Dist: mypy>=1.8; extra == 'dev'
35
35
  Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
36
36
  Requires-Dist: pytest>=8; extra == 'dev'
37
- Requires-Dist: ruff>=0.4; extra == 'dev'
37
+ Requires-Dist: ruff<0.16,>=0.4; extra == 'dev'
38
38
  Description-Content-Type: text/markdown
39
39
 
40
40
  # Crypto Chief Python SDK - Crypto Processing API Client
@@ -126,6 +126,7 @@ Both credentials come from the Dashboard -> Project.
126
126
  | Static-deposit history | `client.static_deposits` | `info`, `history` |
127
127
  | On-chain queries | `client.blockchain` | `contracts_available`, `wallet_balance`, `transaction_status` |
128
128
  | Fiat <-> crypto rate quote | `client.currencies` | `fiat_to_crypto`, `crypto_to_fiat` |
129
+ | Credits (billing) balance check and top-up - free of charge | `client.credits` | `balance`, `topup` |
129
130
 
130
131
  ## Accept a crypto payment (pay-in)
131
132
 
@@ -87,6 +87,7 @@ Both credentials come from the Dashboard -> Project.
87
87
  | Static-deposit history | `client.static_deposits` | `info`, `history` |
88
88
  | On-chain queries | `client.blockchain` | `contracts_available`, `wallet_balance`, `transaction_status` |
89
89
  | Fiat <-> crypto rate quote | `client.currencies` | `fiat_to_crypto`, `crypto_to_fiat` |
90
+ | Credits (billing) balance check and top-up - free of charge | `client.credits` | `balance`, `topup` |
90
91
 
91
92
  ## Accept a crypto payment (pay-in)
92
93
 
@@ -82,7 +82,7 @@ dev = [
82
82
  "pytest>=8",
83
83
  "pytest-asyncio>=0.23",
84
84
  "mypy>=1.8",
85
- "ruff>=0.4",
85
+ "ruff>=0.4,<0.16",
86
86
  ]
87
87
 
88
88
  [project.urls]
@@ -75,6 +75,7 @@ from .services.blockchain import (
75
75
  TxStatusRow,
76
76
  WalletBalanceRow,
77
77
  )
78
+ from .services.credits import CreditsBalance, CreditsService, CreditsTopup
78
79
  from .services.currencies import ConvertRequest, ConvertResponse, CurrenciesService
79
80
  from .services.payins import (
80
81
  CoinOption,
@@ -227,6 +228,7 @@ __all__ = [
227
228
  "StaticDepositsService",
228
229
  "BlockchainService",
229
230
  "CurrenciesService",
231
+ "CreditsService",
230
232
  # Payout types
231
233
  "EstimatePayoutRequest",
232
234
  "ExecutePayoutRequest",
@@ -296,6 +298,9 @@ __all__ = [
296
298
  # Currency types
297
299
  "ConvertRequest",
298
300
  "ConvertResponse",
301
+ # Credits types
302
+ "CreditsBalance",
303
+ "CreditsTopup",
299
304
  # Contract encoders
300
305
  "encode_evm_call",
301
306
  "encode_evm_call_hex",
@@ -1,3 +1,3 @@
1
1
  """Single source of truth for the package version."""
2
2
 
3
- __version__ = "0.1.0"
3
+ __version__ = "0.2.0"
@@ -12,6 +12,7 @@ from ._version import __version__
12
12
  from .errors import CryptoChiefError, is_retryable
13
13
  from .rsa import RsaKeyNotConfiguredError, decrypt_rsa_oaep, load_rsa_private_key_pem
14
14
  from .services.blockchain import BlockchainService
15
+ from .services.credits import CreditsService
15
16
  from .services.currencies import CurrenciesService
16
17
  from .services.payins import PayInsService
17
18
  from .services.payouts import PayoutsService
@@ -96,6 +97,7 @@ class CryptoChiefClient:
96
97
  self.static_deposits = StaticDepositsService(self)
97
98
  self.blockchain = BlockchainService(self)
98
99
  self.currencies = CurrenciesService(self)
100
+ self.credits = CreditsService(self)
99
101
 
100
102
  async def request(self, path: str, body: Any = None) -> Any:
101
103
  """Low-level signed POST against an API path (e.g. ``/v1/payout/estimate``).
@@ -0,0 +1,70 @@
1
+ """Merchant credits (billing): balance check and top-up.
2
+
3
+ Both calls are billing-exempt (free of charge) - integrations can poll the
4
+ balance or open a top-up invoice without spending a paid call. Rate-limited to
5
+ 60 req/min per project; the balance answers even at zero or negative balance.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ from dataclasses import dataclass
11
+
12
+ from .._models import from_dict
13
+ from .base import BaseService
14
+
15
+
16
+ @dataclass(kw_only=True)
17
+ class CreditsBalance:
18
+ #: Current balance in credits (10_000_000 credits = 1 USD).
19
+ credits_balance: int = 0
20
+ #: Pre-formatted USD with 2 decimals - can be negative, e.g. ``"-1.52"``.
21
+ usd_balance: str = ""
22
+ is_postpaid: bool = False
23
+ #: Effective debt limit in credits (postpaid only, 0 for prepaid).
24
+ debt_limit_credits: int = 0
25
+ #: Whether gas-paying ops (``/v1/transaction/execute`` etc.) would pass the gate.
26
+ can_execute_gas_operations: bool = False
27
+ #: Minimum credits required for gas-paying operations.
28
+ gas_ops_min_credits: int = 0
29
+ timestamp: str = "" # RFC3339
30
+
31
+
32
+ @dataclass(kw_only=True)
33
+ class CreditsTopup:
34
+ #: Billing invoice id.
35
+ invoice_id: int = 0
36
+ #: Hosted payment page (QR code, network selection, live status).
37
+ payment_link: str = ""
38
+ amount: str = ""
39
+ currency: str = ""
40
+ status: str = "" # "pending" on creation
41
+ order_uuid: str = ""
42
+ #: Unix seconds; 0 when the server does not set an expiry.
43
+ expired_at: int = 0
44
+
45
+
46
+ class CreditsService(BaseService):
47
+ async def balance(self) -> CreditsBalance:
48
+ """Current credits balance - free of charge, safe to poll before paid calls."""
49
+ return from_dict(CreditsBalance, await self._post("/v1/credits/balance", {}))
50
+
51
+ async def topup(
52
+ self,
53
+ *,
54
+ amount: str,
55
+ currency: str,
56
+ url_success: str | None = None,
57
+ url_error: str | None = None,
58
+ ) -> CreditsTopup:
59
+ """Open a credits top-up invoice - free of charge.
60
+
61
+ ``amount`` is a positive decimal up to 100000 (USD-pegged), ``currency``
62
+ is ``"USDT"`` or ``"USDC"``. Send the payer to ``payment_link``; the
63
+ optional urls are absolute http(s) redirects after payment.
64
+ """
65
+ body: dict[str, str] = {"amount": amount, "currency": currency}
66
+ if url_success is not None:
67
+ body["url_success"] = url_success
68
+ if url_error is not None:
69
+ body["url_error"] = url_error
70
+ return from_dict(CreditsTopup, await self._post("/v1/credits/topup", body))