Skip to content

Commit 481f1cd

Browse files
committed
feat: add get swift code bank details endpoint
1 parent 3e4941b commit 481f1cd

6 files changed

Lines changed: 112 additions & 2 deletions

File tree

‎Makefile‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: lint-check lint-fix typecheck
1+
.PHONY: lint-check lint-fix typecheck test
22

33
lint-check:
44
uv run ruff format --check
@@ -11,3 +11,6 @@ lint-fix:
1111
typecheck:
1212
uv run pyright
1313
uv run mypy .
14+
15+
test:
16+
uv run pytest -v

‎pyproject.toml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ dev = [
5858
"ruff",
5959
"pyright==1.1.399",
6060
"mypy",
61+
"pytest>=8.0.0",
62+
"pytest-asyncio>=0.23.0",
6163
]
6264

6365
[tool.ruff]
@@ -79,6 +81,14 @@ known-first-party = ["blindpay"]
7981

8082
[tool.ruff.lint.per-file-ignores]
8183
"examples/*.py" = ["T201"]
84+
"tests/*.py" = ["T201"]
85+
86+
[tool.pytest.ini_options]
87+
asyncio_mode = "auto"
88+
testpaths = ["tests"]
89+
python_files = ["test_*.py"]
90+
python_classes = ["Test*"]
91+
python_functions = ["test_*"]
8292

8393
[tool.mypy]
8494
pretty = true
@@ -98,4 +108,5 @@ disallow_incomplete_defs = true
98108
disallow_untyped_decorators = true
99109
exclude = [
100110
"^examples/",
111+
"^tests/",
101112
]

‎src/blindpay/client.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from blindpay.resources.wallets.offramp import OfframpWalletsResource, OfframpWalletsResourceSync
2929
from blindpay.resources.webhooks.webhooks import WebhookEndpointsResource, WebhookEndpointsResourceSync
3030

31-
__version__ = "1.0.0"
31+
__version__ = "1.1.0"
3232

3333
T = TypeVar("T")
3434

‎src/blindpay/resources/available/available.py‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,17 @@ class RailInfo(TypedDict):
8080
GetBankDetailsResponse = List[BankDetail]
8181
GetRailsResponse = List[RailInfo]
8282

83+
class SwiftCodeBankDetail(TypedDict):
84+
id: str
85+
bank: str
86+
city: str
87+
branch: str
88+
swiftCode: str
89+
swiftCodeLink: str
90+
country: str
91+
countrySlug: str
92+
93+
GetSwiftCodeBankDetailsResponse = List[SwiftCodeBankDetail]
8394

8495
class AvailableResource:
8596
def __init__(self, client: InternalApiClient):
@@ -92,6 +103,9 @@ async def get_rails(self) -> BlindpayApiResponse[GetRailsResponse]:
92103
return await self._client.get("/available/rails")
93104

94105

106+
async def get_swift_code_bank_details(self, swift: str) -> BlindpayApiResponse[GetSwiftCodeBankDetailsResponse]:
107+
return await self._client.get(f"/available/swift/{swift}")
108+
95109
class AvailableResourceSync:
96110
"""Synchronous version of AvailableResource"""
97111

@@ -104,6 +118,9 @@ def get_bank_details(self, rail: Rail) -> BlindpayApiResponse[GetBankDetailsResp
104118
def get_rails(self) -> BlindpayApiResponse[GetRailsResponse]:
105119
return self._client.get("/available/rails")
106120

121+
def get_swift_code_bank_details(self, swift: str) -> BlindpayApiResponse[GetSwiftCodeBankDetailsResponse]:
122+
return self._client.get(f"/available/swift/{swift}")
123+
107124

108125
def create_available_resource(client: InternalApiClient) -> AvailableResource:
109126
return AvailableResource(client)

‎tests/__init__.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Tests for the Blindpay Python SDK."""

‎uv.lock‎

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

0 commit comments

Comments
 (0)