Skip to content

Commit 7ad6db5

Browse files
authored
Merge branch 'main' into feat/payment-model
2 parents 8298b2a + 0e33b54 commit 7ad6db5

31 files changed

Lines changed: 4278 additions & 921 deletions

poetry.lock

Lines changed: 125 additions & 126 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ python = "^3.10"
1111
httpx = "^0.28.1"
1212
pydantic = "^2.0"
1313
stellar-sdk = "^13.2.1"
14+
pydantic = "^2.0"
1415

1516
[tool.poetry.group.dev.dependencies]
1617
pytest = "^7.4.0"

src/shade/__init__.py

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
from types import ModuleType
33
from typing import Optional
44

5-
from .client import ShadeClient
6-
from .config import config, Environment
5+
from .client import ShadeClient, default_client, reset_default_client
6+
from .config import config, Environment, get_config
77
from .gateway import Gateway
88
from .http import AsyncHTTPClient, SyncHTTPClient
9+
from .resources import BaseResource
910
from .errors import (
1011
AuthenticationError,
1112
InvalidRequestError,
@@ -14,36 +15,72 @@
1415
HTTPError,
1516
RateLimitError,
1617
ShadeError,
18+
SignatureVerificationError,
19+
StellarError,
20+
wrap_stellar_errors,
21+
)
22+
from .models import (
23+
AssetBalance,
24+
Balance,
25+
Merchant,
26+
ShadeObject,
27+
Transfer,
28+
TransferStatus,
29+
WebhookEvent,
30+
WebhookEventType,
1731
)
1832

1933
__version__ = "0.1.0"
2034

21-
# ShadeClient is an alias for Gateway.
22-
ShadeClient = Gateway
23-
2435
__all__ = [
36+
"AssetBalance",
2537
"AsyncHTTPClient",
2638
"AuthenticationError",
39+
"Balance",
40+
"BaseResource",
2741
"Environment",
2842
"Gateway",
2943
"HTTPError",
3044
"InvalidRequestError",
45+
"Merchant",
3146
"NetworkError",
3247
"NotFoundError",
3348
"RateLimitError",
3449
"ShadeClient",
3550
"ShadeError",
51+
"SignatureVerificationError",
52+
"ShadeObject",
53+
"StellarError",
3654
"SyncHTTPClient",
55+
"Transfer",
56+
"TransferStatus",
57+
"WebhookEvent",
58+
"WebhookEventType",
3759
"config",
60+
"get_config",
3861
"api_base",
62+
"api_key",
63+
"default_client",
3964
"environment",
4065
"max_retries",
66+
"reset_default_client",
4167
"timeout",
68+
"wrap_stellar_errors",
4269
]
4370

4471
class _ShadeModule(ModuleType):
4572
"""Module subclass that exposes config-backed attributes on the shade package."""
4673

74+
@property
75+
def api_key(self) -> Optional[str]:
76+
from . import config as _config
77+
return _config.api_key
78+
79+
@api_key.setter
80+
def api_key(self, value: Optional[str]) -> None:
81+
from . import config as _config
82+
_config.api_key = value
83+
4784
@property
4885
def api_base(self) -> Optional[str]:
4986
from . import config as _config
@@ -86,3 +123,4 @@ def environment(self, value: str | Environment) -> None:
86123

87124

88125
sys.modules[__name__].__class__ = _ShadeModule
126+

src/shade/base.py

Whitespace-only changes.

0 commit comments

Comments
 (0)