Skip to content

Commit ebb1b60

Browse files
feat(api): add STABLECOIN method, make method_attributes optional in payment
1 parent ed5c9b0 commit ebb1b60

10 files changed

Lines changed: 537 additions & 4 deletions

File tree

‎.stats.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 213
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-0a244b9dc934ff683c683f6b8fc053d923ffd40fcd32516e2fc79f36b7f61395.yml
3-
openapi_spec_hash: c0c04c03b24b8baecd070e9faf7dccbd
4-
config_hash: 337a99d8cc30006358b7bc2531401669
1+
configured_endpoints: 214
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-ba08fed613d6854a75abf98f01d4178cb8bee759c7e095b2441733f4f928d12c.yml
3+
openapi_spec_hash: 342b408b7ab6cfe1b27e5b1582aead28
4+
config_hash: f6d04d790aaddf639fc04b7f0092e7ec

‎api.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,18 @@ Methods:
690690

691691
- <code title="post /v1/external_bank_accounts/{external_bank_account_token}/micro_deposits">client.external_bank_accounts.micro_deposits.<a href="./src/lithic/resources/external_bank_accounts/micro_deposits.py">create</a>(external_bank_account_token, \*\*<a href="src/lithic/types/external_bank_accounts/micro_deposit_create_params.py">params</a>) -> <a href="./src/lithic/types/external_bank_accounts/micro_deposit_create_response.py">MicroDepositCreateResponse</a></code>
692692

693+
# BlockchainRecipients
694+
695+
Types:
696+
697+
```python
698+
from lithic.types import BlockchainRecipient
699+
```
700+
701+
Methods:
702+
703+
- <code title="post /v1/blockchain_recipients">client.blockchain_recipients.<a href="./src/lithic/resources/blockchain_recipients.py">create</a>(\*\*<a href="src/lithic/types/blockchain_recipient_create_params.py">params</a>) -> <a href="./src/lithic/types/blockchain_recipient.py">BlockchainRecipient</a></code>
704+
693705
# Payments
694706

695707
Types:

‎src/lithic/_client.py‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
financial_accounts,
7171
card_authorizations,
7272
responder_endpoints,
73+
blockchain_recipients,
7374
management_operations,
7475
auth_stream_enrollment,
7576
external_bank_accounts,
@@ -101,6 +102,7 @@
101102
from .resources.card_authorizations import CardAuthorizations, AsyncCardAuthorizations
102103
from .resources.responder_endpoints import ResponderEndpoints, AsyncResponderEndpoints
103104
from .resources.auth_rules.auth_rules import AuthRules, AsyncAuthRules
105+
from .resources.blockchain_recipients import BlockchainRecipients, AsyncBlockchainRecipients
104106
from .resources.management_operations import ManagementOperations, AsyncManagementOperations
105107
from .resources.auth_stream_enrollment import AuthStreamEnrollment, AsyncAuthStreamEnrollment
106108
from .resources.tokenization_decisioning import TokenizationDecisioning, AsyncTokenizationDecisioning
@@ -336,6 +338,12 @@ def external_bank_accounts(self) -> ExternalBankAccounts:
336338

337339
return ExternalBankAccounts(self)
338340

341+
@cached_property
342+
def blockchain_recipients(self) -> BlockchainRecipients:
343+
from .resources.blockchain_recipients import BlockchainRecipients
344+
345+
return BlockchainRecipients(self)
346+
339347
@cached_property
340348
def payments(self) -> Payments:
341349
from .resources.payments import Payments
@@ -772,6 +780,12 @@ def external_bank_accounts(self) -> AsyncExternalBankAccounts:
772780

773781
return AsyncExternalBankAccounts(self)
774782

783+
@cached_property
784+
def blockchain_recipients(self) -> AsyncBlockchainRecipients:
785+
from .resources.blockchain_recipients import AsyncBlockchainRecipients
786+
787+
return AsyncBlockchainRecipients(self)
788+
775789
@cached_property
776790
def payments(self) -> AsyncPayments:
777791
from .resources.payments import AsyncPayments
@@ -1122,6 +1136,12 @@ def external_bank_accounts(self) -> external_bank_accounts.ExternalBankAccountsW
11221136

11231137
return ExternalBankAccountsWithRawResponse(self._client.external_bank_accounts)
11241138

1139+
@cached_property
1140+
def blockchain_recipients(self) -> blockchain_recipients.BlockchainRecipientsWithRawResponse:
1141+
from .resources.blockchain_recipients import BlockchainRecipientsWithRawResponse
1142+
1143+
return BlockchainRecipientsWithRawResponse(self._client.blockchain_recipients)
1144+
11251145
@cached_property
11261146
def payments(self) -> payments.PaymentsWithRawResponse:
11271147
from .resources.payments import PaymentsWithRawResponse
@@ -1331,6 +1351,12 @@ def external_bank_accounts(self) -> external_bank_accounts.AsyncExternalBankAcco
13311351

13321352
return AsyncExternalBankAccountsWithRawResponse(self._client.external_bank_accounts)
13331353

1354+
@cached_property
1355+
def blockchain_recipients(self) -> blockchain_recipients.AsyncBlockchainRecipientsWithRawResponse:
1356+
from .resources.blockchain_recipients import AsyncBlockchainRecipientsWithRawResponse
1357+
1358+
return AsyncBlockchainRecipientsWithRawResponse(self._client.blockchain_recipients)
1359+
13341360
@cached_property
13351361
def payments(self) -> payments.AsyncPaymentsWithRawResponse:
13361362
from .resources.payments import AsyncPaymentsWithRawResponse
@@ -1540,6 +1566,12 @@ def external_bank_accounts(self) -> external_bank_accounts.ExternalBankAccountsW
15401566

15411567
return ExternalBankAccountsWithStreamingResponse(self._client.external_bank_accounts)
15421568

1569+
@cached_property
1570+
def blockchain_recipients(self) -> blockchain_recipients.BlockchainRecipientsWithStreamingResponse:
1571+
from .resources.blockchain_recipients import BlockchainRecipientsWithStreamingResponse
1572+
1573+
return BlockchainRecipientsWithStreamingResponse(self._client.blockchain_recipients)
1574+
15431575
@cached_property
15441576
def payments(self) -> payments.PaymentsWithStreamingResponse:
15451577
from .resources.payments import PaymentsWithStreamingResponse
@@ -1749,6 +1781,12 @@ def external_bank_accounts(self) -> external_bank_accounts.AsyncExternalBankAcco
17491781

17501782
return AsyncExternalBankAccountsWithStreamingResponse(self._client.external_bank_accounts)
17511783

1784+
@cached_property
1785+
def blockchain_recipients(self) -> blockchain_recipients.AsyncBlockchainRecipientsWithStreamingResponse:
1786+
from .resources.blockchain_recipients import AsyncBlockchainRecipientsWithStreamingResponse
1787+
1788+
return AsyncBlockchainRecipientsWithStreamingResponse(self._client.blockchain_recipients)
1789+
17521790
@cached_property
17531791
def payments(self) -> payments.AsyncPaymentsWithStreamingResponse:
17541792
from .resources.payments import AsyncPaymentsWithStreamingResponse

‎src/lithic/resources/__init__.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,14 @@
225225
ResponderEndpointsWithStreamingResponse,
226226
AsyncResponderEndpointsWithStreamingResponse,
227227
)
228+
from .blockchain_recipients import (
229+
BlockchainRecipients,
230+
AsyncBlockchainRecipients,
231+
BlockchainRecipientsWithRawResponse,
232+
AsyncBlockchainRecipientsWithRawResponse,
233+
BlockchainRecipientsWithStreamingResponse,
234+
AsyncBlockchainRecipientsWithStreamingResponse,
235+
)
228236
from .management_operations import (
229237
ManagementOperations,
230238
AsyncManagementOperations,
@@ -375,6 +383,12 @@
375383
"AsyncExternalBankAccountsWithRawResponse",
376384
"ExternalBankAccountsWithStreamingResponse",
377385
"AsyncExternalBankAccountsWithStreamingResponse",
386+
"BlockchainRecipients",
387+
"AsyncBlockchainRecipients",
388+
"BlockchainRecipientsWithRawResponse",
389+
"AsyncBlockchainRecipientsWithRawResponse",
390+
"BlockchainRecipientsWithStreamingResponse",
391+
"AsyncBlockchainRecipientsWithStreamingResponse",
378392
"Payments",
379393
"AsyncPayments",
380394
"PaymentsWithRawResponse",
Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
import httpx
6+
7+
from .. import _legacy_response
8+
from ..types import OwnerType, blockchain_recipient_create_params
9+
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
10+
from .._utils import maybe_transform, async_maybe_transform
11+
from .._compat import cached_property
12+
from .._resource import SyncAPIResource, AsyncAPIResource
13+
from .._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
14+
from .._base_client import make_request_options
15+
from ..types.owner_type import OwnerType
16+
from ..types.blockchain_recipient import BlockchainRecipient
17+
18+
__all__ = ["BlockchainRecipients", "AsyncBlockchainRecipients"]
19+
20+
21+
class BlockchainRecipients(SyncAPIResource):
22+
@cached_property
23+
def with_raw_response(self) -> BlockchainRecipientsWithRawResponse:
24+
"""
25+
This property can be used as a prefix for any HTTP method call to return
26+
the raw response object instead of the parsed content.
27+
28+
For more information, see https://www.github.com/lithic-com/lithic-python#accessing-raw-response-data-eg-headers
29+
"""
30+
return BlockchainRecipientsWithRawResponse(self)
31+
32+
@cached_property
33+
def with_streaming_response(self) -> BlockchainRecipientsWithStreamingResponse:
34+
"""
35+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
36+
37+
For more information, see https://www.github.com/lithic-com/lithic-python#with_streaming_response
38+
"""
39+
return BlockchainRecipientsWithStreamingResponse(self)
40+
41+
def create(
42+
self,
43+
*,
44+
account_token: str,
45+
address: str,
46+
chain: str,
47+
owner: str,
48+
owner_type: OwnerType,
49+
address_tag: str | Omit = omit,
50+
name: str | Omit = omit,
51+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
52+
# The extra values given here take precedence over values defined on the client or passed to this method.
53+
extra_headers: Headers | None = None,
54+
extra_query: Query | None = None,
55+
extra_body: Body | None = None,
56+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
57+
) -> BlockchainRecipient:
58+
"""
59+
Register a blockchain address as a withdrawal destination for a financial
60+
account
61+
62+
The recipient is created with a `PENDING` verification state and cannot receive
63+
a payout until screening of the address completes. Registering an address that
64+
is already registered to the same financial account returns the existing
65+
recipient and its current verification state, rather than creating a second one
66+
67+
Args:
68+
account_token: The financial account the blockchain recipient belongs to
69+
70+
address: The blockchain address funds will be withdrawn to
71+
72+
chain: The blockchain network that the address belongs to
73+
74+
owner: Legal name of the business or individual who owns the blockchain address
75+
76+
owner_type: Owner Type
77+
78+
address_tag: An optional tag or memo used by some chains to identify the destination of a
79+
transfer within a shared address
80+
81+
name: The nickname for this blockchain recipient
82+
83+
extra_headers: Send extra headers
84+
85+
extra_query: Add additional query parameters to the request
86+
87+
extra_body: Add additional JSON properties to the request
88+
89+
timeout: Override the client-level default timeout for this request, in seconds
90+
"""
91+
return self._post(
92+
"/v1/blockchain_recipients",
93+
body=maybe_transform(
94+
{
95+
"account_token": account_token,
96+
"address": address,
97+
"chain": chain,
98+
"owner": owner,
99+
"owner_type": owner_type,
100+
"address_tag": address_tag,
101+
"name": name,
102+
},
103+
blockchain_recipient_create_params.BlockchainRecipientCreateParams,
104+
),
105+
options=make_request_options(
106+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
107+
),
108+
cast_to=BlockchainRecipient,
109+
)
110+
111+
112+
class AsyncBlockchainRecipients(AsyncAPIResource):
113+
@cached_property
114+
def with_raw_response(self) -> AsyncBlockchainRecipientsWithRawResponse:
115+
"""
116+
This property can be used as a prefix for any HTTP method call to return
117+
the raw response object instead of the parsed content.
118+
119+
For more information, see https://www.github.com/lithic-com/lithic-python#accessing-raw-response-data-eg-headers
120+
"""
121+
return AsyncBlockchainRecipientsWithRawResponse(self)
122+
123+
@cached_property
124+
def with_streaming_response(self) -> AsyncBlockchainRecipientsWithStreamingResponse:
125+
"""
126+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
127+
128+
For more information, see https://www.github.com/lithic-com/lithic-python#with_streaming_response
129+
"""
130+
return AsyncBlockchainRecipientsWithStreamingResponse(self)
131+
132+
async def create(
133+
self,
134+
*,
135+
account_token: str,
136+
address: str,
137+
chain: str,
138+
owner: str,
139+
owner_type: OwnerType,
140+
address_tag: str | Omit = omit,
141+
name: str | Omit = omit,
142+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
143+
# The extra values given here take precedence over values defined on the client or passed to this method.
144+
extra_headers: Headers | None = None,
145+
extra_query: Query | None = None,
146+
extra_body: Body | None = None,
147+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
148+
) -> BlockchainRecipient:
149+
"""
150+
Register a blockchain address as a withdrawal destination for a financial
151+
account
152+
153+
The recipient is created with a `PENDING` verification state and cannot receive
154+
a payout until screening of the address completes. Registering an address that
155+
is already registered to the same financial account returns the existing
156+
recipient and its current verification state, rather than creating a second one
157+
158+
Args:
159+
account_token: The financial account the blockchain recipient belongs to
160+
161+
address: The blockchain address funds will be withdrawn to
162+
163+
chain: The blockchain network that the address belongs to
164+
165+
owner: Legal name of the business or individual who owns the blockchain address
166+
167+
owner_type: Owner Type
168+
169+
address_tag: An optional tag or memo used by some chains to identify the destination of a
170+
transfer within a shared address
171+
172+
name: The nickname for this blockchain recipient
173+
174+
extra_headers: Send extra headers
175+
176+
extra_query: Add additional query parameters to the request
177+
178+
extra_body: Add additional JSON properties to the request
179+
180+
timeout: Override the client-level default timeout for this request, in seconds
181+
"""
182+
return await self._post(
183+
"/v1/blockchain_recipients",
184+
body=await async_maybe_transform(
185+
{
186+
"account_token": account_token,
187+
"address": address,
188+
"chain": chain,
189+
"owner": owner,
190+
"owner_type": owner_type,
191+
"address_tag": address_tag,
192+
"name": name,
193+
},
194+
blockchain_recipient_create_params.BlockchainRecipientCreateParams,
195+
),
196+
options=make_request_options(
197+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
198+
),
199+
cast_to=BlockchainRecipient,
200+
)
201+
202+
203+
class BlockchainRecipientsWithRawResponse:
204+
def __init__(self, blockchain_recipients: BlockchainRecipients) -> None:
205+
self._blockchain_recipients = blockchain_recipients
206+
207+
self.create = _legacy_response.to_raw_response_wrapper(
208+
blockchain_recipients.create,
209+
)
210+
211+
212+
class AsyncBlockchainRecipientsWithRawResponse:
213+
def __init__(self, blockchain_recipients: AsyncBlockchainRecipients) -> None:
214+
self._blockchain_recipients = blockchain_recipients
215+
216+
self.create = _legacy_response.async_to_raw_response_wrapper(
217+
blockchain_recipients.create,
218+
)
219+
220+
221+
class BlockchainRecipientsWithStreamingResponse:
222+
def __init__(self, blockchain_recipients: BlockchainRecipients) -> None:
223+
self._blockchain_recipients = blockchain_recipients
224+
225+
self.create = to_streamed_response_wrapper(
226+
blockchain_recipients.create,
227+
)
228+
229+
230+
class AsyncBlockchainRecipientsWithStreamingResponse:
231+
def __init__(self, blockchain_recipients: AsyncBlockchainRecipients) -> None:
232+
self._blockchain_recipients = blockchain_recipients
233+
234+
self.create = async_to_streamed_response_wrapper(
235+
blockchain_recipients.create,
236+
)

0 commit comments

Comments
 (0)