@augustusbank/typescript-sdk 0.21.0 → 0.22.1
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.
- package/CHANGELOG.md +39 -0
- package/client.d.mts +12 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +12 -6
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/account-holders.d.mts +1555 -1184
- package/resources/account-holders.d.mts.map +1 -1
- package/resources/account-holders.d.ts +1555 -1184
- package/resources/account-holders.d.ts.map +1 -1
- package/resources/account-holders.js +59 -0
- package/resources/account-holders.js.map +1 -1
- package/resources/account-holders.mjs +59 -0
- package/resources/account-holders.mjs.map +1 -1
- package/resources/account-programs.d.mts +22 -17
- package/resources/account-programs.d.mts.map +1 -1
- package/resources/account-programs.d.ts +22 -17
- package/resources/account-programs.d.ts.map +1 -1
- package/resources/account-programs.js +2 -2
- package/resources/account-programs.js.map +1 -1
- package/resources/account-programs.mjs +2 -2
- package/resources/account-programs.mjs.map +1 -1
- package/resources/accounts.d.mts +226 -48
- package/resources/accounts.d.mts.map +1 -1
- package/resources/accounts.d.ts +226 -48
- package/resources/accounts.d.ts.map +1 -1
- package/resources/accounts.js +55 -2
- package/resources/accounts.js.map +1 -1
- package/resources/accounts.mjs +55 -2
- package/resources/accounts.mjs.map +1 -1
- package/resources/api-keys.d.mts +1 -1
- package/resources/api-keys.d.mts.map +1 -1
- package/resources/api-keys.d.ts +1 -1
- package/resources/api-keys.d.ts.map +1 -1
- package/resources/api-versions.d.mts +3 -0
- package/resources/api-versions.d.mts.map +1 -1
- package/resources/api-versions.d.ts +3 -0
- package/resources/api-versions.d.ts.map +1 -1
- package/resources/conversions.d.mts +36 -81
- package/resources/conversions.d.mts.map +1 -1
- package/resources/conversions.d.ts +36 -81
- package/resources/conversions.d.ts.map +1 -1
- package/resources/conversions.js +25 -1
- package/resources/conversions.js.map +1 -1
- package/resources/conversions.mjs +25 -1
- package/resources/conversions.mjs.map +1 -1
- package/resources/counterparties.d.mts +1042 -0
- package/resources/counterparties.d.mts.map +1 -0
- package/resources/counterparties.d.ts +1042 -0
- package/resources/counterparties.d.ts.map +1 -0
- package/resources/counterparties.js +45 -0
- package/resources/counterparties.js.map +1 -0
- package/resources/counterparties.mjs +41 -0
- package/resources/counterparties.mjs.map +1 -0
- package/resources/deposits.d.mts +48 -186
- package/resources/deposits.d.mts.map +1 -1
- package/resources/deposits.d.ts +48 -186
- package/resources/deposits.d.ts.map +1 -1
- package/resources/events.d.mts +3 -3
- package/resources/events.d.mts.map +1 -1
- package/resources/events.d.ts +3 -3
- package/resources/events.d.ts.map +1 -1
- package/resources/index.d.mts +5 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +5 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/payouts.d.mts +133 -335
- package/resources/payouts.d.mts.map +1 -1
- package/resources/payouts.d.ts +133 -335
- package/resources/payouts.d.ts.map +1 -1
- package/resources/payouts.js +25 -0
- package/resources/payouts.js.map +1 -1
- package/resources/payouts.mjs +25 -0
- package/resources/payouts.mjs.map +1 -1
- package/resources/quotes/indicative.d.mts +7 -11
- package/resources/quotes/indicative.d.mts.map +1 -1
- package/resources/quotes/indicative.d.ts +7 -11
- package/resources/quotes/indicative.d.ts.map +1 -1
- package/resources/quotes/quotes.d.mts +4 -8
- package/resources/quotes/quotes.d.mts.map +1 -1
- package/resources/quotes/quotes.d.ts +4 -8
- package/resources/quotes/quotes.d.ts.map +1 -1
- package/resources/quotes/quotes.js.map +1 -1
- package/resources/quotes/quotes.mjs.map +1 -1
- package/resources/returns.d.mts +84 -39
- package/resources/returns.d.mts.map +1 -1
- package/resources/returns.d.ts +84 -39
- package/resources/returns.d.ts.map +1 -1
- package/resources/returns.js +22 -0
- package/resources/returns.js.map +1 -1
- package/resources/returns.mjs +22 -0
- package/resources/returns.mjs.map +1 -1
- package/resources/scopes.d.mts +4 -1
- package/resources/scopes.d.mts.map +1 -1
- package/resources/scopes.d.ts +4 -1
- package/resources/scopes.d.ts.map +1 -1
- package/resources/simulations/account-programs.d.mts +215 -0
- package/resources/simulations/account-programs.d.mts.map +1 -0
- package/resources/simulations/account-programs.d.ts +215 -0
- package/resources/simulations/account-programs.d.ts.map +1 -0
- package/resources/simulations/account-programs.js +96 -0
- package/resources/simulations/account-programs.js.map +1 -0
- package/resources/simulations/account-programs.mjs +92 -0
- package/resources/simulations/account-programs.mjs.map +1 -0
- package/resources/simulations/accounts.d.mts +209 -0
- package/resources/simulations/accounts.d.mts.map +1 -0
- package/resources/simulations/accounts.d.ts +209 -0
- package/resources/simulations/accounts.d.ts.map +1 -0
- package/resources/simulations/accounts.js +90 -0
- package/resources/simulations/accounts.js.map +1 -0
- package/resources/simulations/accounts.mjs +86 -0
- package/resources/simulations/accounts.mjs.map +1 -0
- package/resources/simulations/conversions.d.mts +54 -0
- package/resources/simulations/conversions.d.mts.map +1 -0
- package/resources/simulations/conversions.d.ts +54 -0
- package/resources/simulations/conversions.d.ts.map +1 -0
- package/resources/simulations/conversions.js +39 -0
- package/resources/simulations/conversions.js.map +1 -0
- package/resources/simulations/conversions.mjs +35 -0
- package/resources/simulations/conversions.mjs.map +1 -0
- package/resources/simulations/deposits.d.mts +202 -0
- package/resources/simulations/deposits.d.mts.map +1 -0
- package/resources/simulations/deposits.d.ts +202 -0
- package/resources/simulations/deposits.d.ts.map +1 -0
- package/resources/simulations/deposits.js +25 -0
- package/resources/simulations/deposits.js.map +1 -0
- package/resources/simulations/deposits.mjs +21 -0
- package/resources/simulations/deposits.mjs.map +1 -0
- package/resources/simulations/index.d.mts +7 -0
- package/resources/simulations/index.d.mts.map +1 -0
- package/resources/simulations/index.d.ts +7 -0
- package/resources/simulations/index.d.ts.map +1 -0
- package/resources/simulations/index.js +17 -0
- package/resources/simulations/index.js.map +1 -0
- package/resources/simulations/index.mjs +8 -0
- package/resources/simulations/index.mjs.map +1 -0
- package/resources/simulations/payouts.d.mts +62 -0
- package/resources/simulations/payouts.d.mts.map +1 -0
- package/resources/simulations/payouts.d.ts +62 -0
- package/resources/simulations/payouts.d.ts.map +1 -0
- package/resources/simulations/payouts.js +39 -0
- package/resources/simulations/payouts.js.map +1 -0
- package/resources/simulations/payouts.mjs +35 -0
- package/resources/simulations/payouts.mjs.map +1 -0
- package/resources/simulations/simulations.d.mts +26 -0
- package/resources/simulations/simulations.d.mts.map +1 -0
- package/resources/simulations/simulations.d.ts +26 -0
- package/resources/simulations/simulations.d.ts.map +1 -0
- package/resources/simulations/simulations.js +33 -0
- package/resources/simulations/simulations.js.map +1 -0
- package/resources/simulations/simulations.mjs +28 -0
- package/resources/simulations/simulations.mjs.map +1 -0
- package/resources/simulations.d.mts +2 -0
- package/resources/simulations.d.mts.map +1 -0
- package/resources/simulations.d.ts +2 -0
- package/resources/simulations.d.ts.map +1 -0
- package/resources/simulations.js +6 -0
- package/resources/simulations.js.map +1 -0
- package/resources/simulations.mjs +3 -0
- package/resources/simulations.mjs.map +1 -0
- package/resources/transactions.d.mts +342 -162
- package/resources/transactions.d.mts.map +1 -1
- package/resources/transactions.d.ts +342 -162
- package/resources/transactions.d.ts.map +1 -1
- package/resources/webhook-subscriptions.d.mts +61 -11
- package/resources/webhook-subscriptions.d.mts.map +1 -1
- package/resources/webhook-subscriptions.d.ts +61 -11
- package/resources/webhook-subscriptions.d.ts.map +1 -1
- package/resources/webhook-subscriptions.js +49 -0
- package/resources/webhook-subscriptions.js.map +1 -1
- package/resources/webhook-subscriptions.mjs +49 -0
- package/resources/webhook-subscriptions.mjs.map +1 -1
- package/resources/webhooks.d.mts +976 -978
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +976 -978
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +48 -8
- package/src/resources/account-holders.ts +1701 -1282
- package/src/resources/account-programs.ts +30 -19
- package/src/resources/accounts.ts +265 -50
- package/src/resources/api-keys.ts +3 -0
- package/src/resources/api-versions.ts +3 -0
- package/src/resources/conversions.ts +36 -93
- package/src/resources/counterparties.ts +3127 -0
- package/src/resources/deposits.ts +66 -269
- package/src/resources/events.ts +18 -12
- package/src/resources/index.ts +21 -4
- package/src/resources/payouts.ts +204 -439
- package/src/resources/quotes/indicative.ts +7 -12
- package/src/resources/quotes/quotes.ts +4 -9
- package/src/resources/returns.ts +144 -40
- package/src/resources/scopes.ts +7 -1
- package/src/resources/simulations/account-programs.ts +282 -0
- package/src/resources/simulations/accounts.ts +265 -0
- package/src/resources/simulations/conversions.ts +70 -0
- package/src/resources/simulations/deposits.ts +522 -0
- package/src/resources/simulations/index.ts +33 -0
- package/src/resources/simulations/payouts.ts +80 -0
- package/src/resources/simulations/simulations.ts +92 -0
- package/src/resources/simulations.ts +3 -0
- package/src/resources/transactions.ts +954 -206
- package/src/resources/webhook-subscriptions.ts +102 -36
- package/src/resources/webhooks.ts +1283 -1153
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -33,29 +33,24 @@ export interface IndicativeRetrieveResponse {
|
|
|
33
33
|
rate: string;
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Amount as a string decimal (e.g. "100.50").
|
|
37
37
|
*/
|
|
38
38
|
source_amount: string;
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
41
|
+
* Currency code (ISO 4217 or crypto).
|
|
42
42
|
*/
|
|
43
43
|
source_currency: 'EUR' | 'GBP' | 'USD' | 'USDC' | 'BTC' | 'ETH' | 'SOL' | 'POL';
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* Amount as a string decimal (e.g. "100.50").
|
|
47
47
|
*/
|
|
48
48
|
target_amount: string;
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* Currency code (ISO 4217 or crypto).
|
|
52
52
|
*/
|
|
53
53
|
target_currency: 'EUR' | 'GBP' | 'USD' | 'USDC' | 'BTC' | 'ETH' | 'SOL' | 'POL';
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Venue the quote was fetched from.
|
|
57
|
-
*/
|
|
58
|
-
venue: string;
|
|
59
54
|
}
|
|
60
55
|
|
|
61
56
|
export namespace IndicativeRetrieveResponse {
|
|
@@ -77,17 +72,17 @@ export namespace IndicativeRetrieveResponse {
|
|
|
77
72
|
|
|
78
73
|
export interface IndicativeRetrieveParams {
|
|
79
74
|
/**
|
|
80
|
-
*
|
|
75
|
+
* Currency code (ISO 4217 or crypto).
|
|
81
76
|
*/
|
|
82
77
|
source_currency: 'EUR' | 'GBP' | 'USD' | 'USDC' | 'BTC' | 'ETH' | 'SOL' | 'POL';
|
|
83
78
|
|
|
84
79
|
/**
|
|
85
|
-
*
|
|
80
|
+
* Currency code (ISO 4217 or crypto).
|
|
86
81
|
*/
|
|
87
82
|
target_currency: 'EUR' | 'GBP' | 'USD' | 'USDC' | 'BTC' | 'ETH' | 'SOL' | 'POL';
|
|
88
83
|
|
|
89
84
|
/**
|
|
90
|
-
*
|
|
85
|
+
* Amount as a string decimal (e.g. "100.50").
|
|
91
86
|
*/
|
|
92
87
|
source_amount?: string;
|
|
93
88
|
}
|
|
@@ -45,12 +45,12 @@ export interface QuoteRetrieveResponse {
|
|
|
45
45
|
funding_status: 'pending' | 'sent' | 'completed' | 'failed' | 'on_hold';
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* Amount as a string decimal (e.g. "100.50").
|
|
49
49
|
*/
|
|
50
50
|
source_amount: string;
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
53
|
+
* Currency code (ISO 4217 or crypto).
|
|
54
54
|
*/
|
|
55
55
|
source_currency: 'EUR' | 'GBP' | 'USD' | 'USDC' | 'BTC' | 'ETH' | 'SOL' | 'POL';
|
|
56
56
|
|
|
@@ -70,12 +70,12 @@ export interface QuoteRetrieveResponse {
|
|
|
70
70
|
| 'failed';
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
73
|
+
* Amount as a string decimal (e.g. "100.50").
|
|
74
74
|
*/
|
|
75
75
|
target_amount: string;
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
78
|
+
* Currency code (ISO 4217 or crypto).
|
|
79
79
|
*/
|
|
80
80
|
target_currency: 'EUR' | 'GBP' | 'USD' | 'USDC' | 'BTC' | 'ETH' | 'SOL' | 'POL';
|
|
81
81
|
|
|
@@ -88,11 +88,6 @@ export interface QuoteRetrieveResponse {
|
|
|
88
88
|
* ISO 8601 UTC timestamp when the quote was last updated.
|
|
89
89
|
*/
|
|
90
90
|
updated_at: string;
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Execution venue (e.g. "kraken").
|
|
94
|
-
*/
|
|
95
|
-
venue: string;
|
|
96
91
|
}
|
|
97
92
|
|
|
98
93
|
Quotes.Indicative = Indicative;
|
package/src/resources/returns.ts
CHANGED
|
@@ -9,6 +9,13 @@ import { path } from '../internal/utils/path';
|
|
|
9
9
|
export class Returns extends APIResource {
|
|
10
10
|
/**
|
|
11
11
|
* Initiates a return of funds from a deposit to the source.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const _return = await client.returns.create({
|
|
16
|
+
* deposit_id: '550e8400-e29b-41d4-a716-446655440004',
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
12
19
|
*/
|
|
13
20
|
create(body: ReturnCreateParams, options?: RequestOptions): APIPromise<ReturnCreateResponse> {
|
|
14
21
|
return this._client.post('/v1/returns', { body, ...options });
|
|
@@ -16,6 +23,13 @@ export class Returns extends APIResource {
|
|
|
16
23
|
|
|
17
24
|
/**
|
|
18
25
|
* Retrieves a return by ID.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const _return = await client.returns.retrieve(
|
|
30
|
+
* '550e8400-e29b-41d4-a716-446655440005',
|
|
31
|
+
* );
|
|
32
|
+
* ```
|
|
19
33
|
*/
|
|
20
34
|
retrieve(id: string, options?: RequestOptions): APIPromise<ReturnRetrieveResponse> {
|
|
21
35
|
return this._client.get(path`/v1/returns/${id}`, options);
|
|
@@ -23,6 +37,14 @@ export class Returns extends APIResource {
|
|
|
23
37
|
|
|
24
38
|
/**
|
|
25
39
|
* Lists deposit returns for the merchant with cursor-based pagination.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* // Automatically fetches more pages as needed.
|
|
44
|
+
* for await (const returnListResponse of client.returns.list()) {
|
|
45
|
+
* // ...
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
26
48
|
*/
|
|
27
49
|
list(
|
|
28
50
|
query: ReturnListParams | null | undefined = {},
|
|
@@ -46,12 +68,7 @@ export interface ReturnCreateResponse {
|
|
|
46
68
|
amount: string;
|
|
47
69
|
|
|
48
70
|
/**
|
|
49
|
-
*
|
|
50
|
-
*/
|
|
51
|
-
created_at: string;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Currency code (ISO 4217 currency code or crypto currency code).
|
|
71
|
+
* Currency code (ISO 4217 or crypto).
|
|
55
72
|
*/
|
|
56
73
|
currency: 'EUR' | 'GBP' | 'USD' | 'USDC';
|
|
57
74
|
|
|
@@ -65,20 +82,53 @@ export interface ReturnCreateResponse {
|
|
|
65
82
|
*/
|
|
66
83
|
failure: ReturnCreateResponse.Failure | null;
|
|
67
84
|
|
|
85
|
+
/**
|
|
86
|
+
* ISO 8601 UTC timestamp when the return was initiated.
|
|
87
|
+
*/
|
|
88
|
+
initiated_at: string;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Payment scheme or blockchain used for the return, or null when unknown.
|
|
92
|
+
*/
|
|
93
|
+
rail:
|
|
94
|
+
| 'sepa'
|
|
95
|
+
| 'sepa_instant'
|
|
96
|
+
| 'faster_payments'
|
|
97
|
+
| 'swift'
|
|
98
|
+
| 'internal'
|
|
99
|
+
| 'target'
|
|
100
|
+
| 'ach'
|
|
101
|
+
| 'fedwire'
|
|
102
|
+
| 'bitcoin'
|
|
103
|
+
| 'bitcoin_testnet4'
|
|
104
|
+
| 'ethereum'
|
|
105
|
+
| 'ethereum_sepolia'
|
|
106
|
+
| 'solana'
|
|
107
|
+
| 'solana_devnet'
|
|
108
|
+
| 'polygon'
|
|
109
|
+
| 'polygon_amoy'
|
|
110
|
+
| null;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* ISO 8601 UTC timestamp when the return was sent.
|
|
114
|
+
*/
|
|
115
|
+
sent_at: string | null;
|
|
116
|
+
|
|
68
117
|
/**
|
|
69
118
|
* Current status of the return.
|
|
70
119
|
*/
|
|
71
|
-
status: '
|
|
120
|
+
status: 'initiated' | 'submitted' | 'sent' | 'failed' | 'returned';
|
|
72
121
|
|
|
73
122
|
/**
|
|
74
|
-
*
|
|
123
|
+
* Transaction hash for crypto returns, or null when not known. Only blockchain
|
|
124
|
+
* rails support this field.
|
|
75
125
|
*/
|
|
76
|
-
|
|
126
|
+
tx_hash: string | null;
|
|
77
127
|
|
|
78
128
|
/**
|
|
79
|
-
*
|
|
129
|
+
* Resource type discriminator.
|
|
80
130
|
*/
|
|
81
|
-
|
|
131
|
+
type: 'return';
|
|
82
132
|
}
|
|
83
133
|
|
|
84
134
|
export namespace ReturnCreateResponse {
|
|
@@ -94,6 +144,7 @@ export namespace ReturnCreateResponse {
|
|
|
94
144
|
| 'account_blocked'
|
|
95
145
|
| 'insufficient_funds'
|
|
96
146
|
| 'invalid_account_format'
|
|
147
|
+
| 'invalid_routing_number'
|
|
97
148
|
| 'invalid_instruction'
|
|
98
149
|
| 'invalid_amount'
|
|
99
150
|
| 'invalid_time'
|
|
@@ -129,12 +180,7 @@ export interface ReturnRetrieveResponse {
|
|
|
129
180
|
amount: string;
|
|
130
181
|
|
|
131
182
|
/**
|
|
132
|
-
*
|
|
133
|
-
*/
|
|
134
|
-
created_at: string;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Currency code (ISO 4217 currency code or crypto currency code).
|
|
183
|
+
* Currency code (ISO 4217 or crypto).
|
|
138
184
|
*/
|
|
139
185
|
currency: 'EUR' | 'GBP' | 'USD' | 'USDC';
|
|
140
186
|
|
|
@@ -148,20 +194,53 @@ export interface ReturnRetrieveResponse {
|
|
|
148
194
|
*/
|
|
149
195
|
failure: ReturnRetrieveResponse.Failure | null;
|
|
150
196
|
|
|
197
|
+
/**
|
|
198
|
+
* ISO 8601 UTC timestamp when the return was initiated.
|
|
199
|
+
*/
|
|
200
|
+
initiated_at: string;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Payment scheme or blockchain used for the return, or null when unknown.
|
|
204
|
+
*/
|
|
205
|
+
rail:
|
|
206
|
+
| 'sepa'
|
|
207
|
+
| 'sepa_instant'
|
|
208
|
+
| 'faster_payments'
|
|
209
|
+
| 'swift'
|
|
210
|
+
| 'internal'
|
|
211
|
+
| 'target'
|
|
212
|
+
| 'ach'
|
|
213
|
+
| 'fedwire'
|
|
214
|
+
| 'bitcoin'
|
|
215
|
+
| 'bitcoin_testnet4'
|
|
216
|
+
| 'ethereum'
|
|
217
|
+
| 'ethereum_sepolia'
|
|
218
|
+
| 'solana'
|
|
219
|
+
| 'solana_devnet'
|
|
220
|
+
| 'polygon'
|
|
221
|
+
| 'polygon_amoy'
|
|
222
|
+
| null;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* ISO 8601 UTC timestamp when the return was sent.
|
|
226
|
+
*/
|
|
227
|
+
sent_at: string | null;
|
|
228
|
+
|
|
151
229
|
/**
|
|
152
230
|
* Current status of the return.
|
|
153
231
|
*/
|
|
154
|
-
status: '
|
|
232
|
+
status: 'initiated' | 'submitted' | 'sent' | 'failed' | 'returned';
|
|
155
233
|
|
|
156
234
|
/**
|
|
157
|
-
*
|
|
235
|
+
* Transaction hash for crypto returns, or null when not known. Only blockchain
|
|
236
|
+
* rails support this field.
|
|
158
237
|
*/
|
|
159
|
-
|
|
238
|
+
tx_hash: string | null;
|
|
160
239
|
|
|
161
240
|
/**
|
|
162
|
-
*
|
|
241
|
+
* Resource type discriminator.
|
|
163
242
|
*/
|
|
164
|
-
|
|
243
|
+
type: 'return';
|
|
165
244
|
}
|
|
166
245
|
|
|
167
246
|
export namespace ReturnRetrieveResponse {
|
|
@@ -177,6 +256,7 @@ export namespace ReturnRetrieveResponse {
|
|
|
177
256
|
| 'account_blocked'
|
|
178
257
|
| 'insufficient_funds'
|
|
179
258
|
| 'invalid_account_format'
|
|
259
|
+
| 'invalid_routing_number'
|
|
180
260
|
| 'invalid_instruction'
|
|
181
261
|
| 'invalid_amount'
|
|
182
262
|
| 'invalid_time'
|
|
@@ -212,12 +292,7 @@ export interface ReturnListResponse {
|
|
|
212
292
|
amount: string;
|
|
213
293
|
|
|
214
294
|
/**
|
|
215
|
-
*
|
|
216
|
-
*/
|
|
217
|
-
created_at: string;
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* Currency code (ISO 4217 currency code or crypto currency code).
|
|
295
|
+
* Currency code (ISO 4217 or crypto).
|
|
221
296
|
*/
|
|
222
297
|
currency: 'EUR' | 'GBP' | 'USD' | 'USDC';
|
|
223
298
|
|
|
@@ -231,20 +306,53 @@ export interface ReturnListResponse {
|
|
|
231
306
|
*/
|
|
232
307
|
failure: ReturnListResponse.Failure | null;
|
|
233
308
|
|
|
309
|
+
/**
|
|
310
|
+
* ISO 8601 UTC timestamp when the return was initiated.
|
|
311
|
+
*/
|
|
312
|
+
initiated_at: string;
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Payment scheme or blockchain used for the return, or null when unknown.
|
|
316
|
+
*/
|
|
317
|
+
rail:
|
|
318
|
+
| 'sepa'
|
|
319
|
+
| 'sepa_instant'
|
|
320
|
+
| 'faster_payments'
|
|
321
|
+
| 'swift'
|
|
322
|
+
| 'internal'
|
|
323
|
+
| 'target'
|
|
324
|
+
| 'ach'
|
|
325
|
+
| 'fedwire'
|
|
326
|
+
| 'bitcoin'
|
|
327
|
+
| 'bitcoin_testnet4'
|
|
328
|
+
| 'ethereum'
|
|
329
|
+
| 'ethereum_sepolia'
|
|
330
|
+
| 'solana'
|
|
331
|
+
| 'solana_devnet'
|
|
332
|
+
| 'polygon'
|
|
333
|
+
| 'polygon_amoy'
|
|
334
|
+
| null;
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* ISO 8601 UTC timestamp when the return was sent.
|
|
338
|
+
*/
|
|
339
|
+
sent_at: string | null;
|
|
340
|
+
|
|
234
341
|
/**
|
|
235
342
|
* Current status of the return.
|
|
236
343
|
*/
|
|
237
|
-
status: '
|
|
344
|
+
status: 'initiated' | 'submitted' | 'sent' | 'failed' | 'returned';
|
|
238
345
|
|
|
239
346
|
/**
|
|
240
|
-
*
|
|
347
|
+
* Transaction hash for crypto returns, or null when not known. Only blockchain
|
|
348
|
+
* rails support this field.
|
|
241
349
|
*/
|
|
242
|
-
|
|
350
|
+
tx_hash: string | null;
|
|
243
351
|
|
|
244
352
|
/**
|
|
245
|
-
*
|
|
353
|
+
* Resource type discriminator.
|
|
246
354
|
*/
|
|
247
|
-
|
|
355
|
+
type: 'return';
|
|
248
356
|
}
|
|
249
357
|
|
|
250
358
|
export namespace ReturnListResponse {
|
|
@@ -260,6 +368,7 @@ export namespace ReturnListResponse {
|
|
|
260
368
|
| 'account_blocked'
|
|
261
369
|
| 'insufficient_funds'
|
|
262
370
|
| 'invalid_account_format'
|
|
371
|
+
| 'invalid_routing_number'
|
|
263
372
|
| 'invalid_instruction'
|
|
264
373
|
| 'invalid_amount'
|
|
265
374
|
| 'invalid_time'
|
|
@@ -288,11 +397,6 @@ export interface ReturnCreateParams {
|
|
|
288
397
|
* Deposit to return funds from.
|
|
289
398
|
*/
|
|
290
399
|
deposit_id: string;
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Payment rail when the deposit allows multiple schemes.
|
|
294
|
-
*/
|
|
295
|
-
rail?: 'sepa_instant' | 'sepa' | 'faster_payments';
|
|
296
400
|
}
|
|
297
401
|
|
|
298
402
|
export interface ReturnListParams extends CursorPageParams {
|
|
@@ -304,9 +408,9 @@ export interface ReturnListParams extends CursorPageParams {
|
|
|
304
408
|
deposit_id?: string;
|
|
305
409
|
|
|
306
410
|
/**
|
|
307
|
-
*
|
|
411
|
+
* Filter by return status.
|
|
308
412
|
*/
|
|
309
|
-
status?: '
|
|
413
|
+
status?: 'initiated' | 'submitted' | 'sent' | 'failed' | 'returned';
|
|
310
414
|
}
|
|
311
415
|
|
|
312
416
|
export namespace ReturnListParams {
|
package/src/resources/scopes.ts
CHANGED
|
@@ -42,12 +42,15 @@ export namespace ScopeListResponse {
|
|
|
42
42
|
| 'account_programs:read'
|
|
43
43
|
| 'account_holders:read'
|
|
44
44
|
| 'account_holders:write'
|
|
45
|
+
| 'counterparties:read'
|
|
46
|
+
| 'counterparties:write'
|
|
45
47
|
| 'webhook_subscriptions:read'
|
|
46
48
|
| 'webhook_subscriptions:write'
|
|
47
49
|
| 'events:read'
|
|
48
50
|
| 'webhook_deliveries:read'
|
|
49
51
|
| 'webhook_deliveries:write'
|
|
50
|
-
| 'transactions:read'
|
|
52
|
+
| 'transactions:read'
|
|
53
|
+
| 'simulations:write';
|
|
51
54
|
|
|
52
55
|
/**
|
|
53
56
|
* Action category.
|
|
@@ -74,6 +77,9 @@ export namespace ScopeListResponse {
|
|
|
74
77
|
*/
|
|
75
78
|
resource: string;
|
|
76
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Resource type discriminator.
|
|
82
|
+
*/
|
|
77
83
|
type: 'scope';
|
|
78
84
|
}
|
|
79
85
|
}
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
import { path } from '../../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
export class AccountPrograms extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Creates a Mock-US USD account program owned by the caller merchant. This
|
|
11
|
+
* endpoint is unavailable in live production.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const accountProgram =
|
|
16
|
+
* await client.simulations.accountPrograms.create({
|
|
17
|
+
* label: 'x',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
create(
|
|
22
|
+
body: AccountProgramCreateParams,
|
|
23
|
+
options?: RequestOptions,
|
|
24
|
+
): APIPromise<AccountProgramCreateResponse> {
|
|
25
|
+
return this._client.post('/v1/simulations/account_programs', { body, ...options });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Closes an account program. All child accounts must be drained via the drain
|
|
30
|
+
* endpoint first. This endpoint is unavailable in live production.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const response =
|
|
35
|
+
* await client.simulations.accountPrograms.close(
|
|
36
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
37
|
+
* { reason: 'aml_risk_fraud' },
|
|
38
|
+
* );
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
close(
|
|
42
|
+
id: string,
|
|
43
|
+
body: AccountProgramCloseParams,
|
|
44
|
+
options?: RequestOptions,
|
|
45
|
+
): APIPromise<AccountProgramCloseResponse> {
|
|
46
|
+
return this._client.post(path`/v1/simulations/account_programs/${id}/close`, { body, ...options });
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Creates outbound payouts that drain the residual balance of every frozen account
|
|
51
|
+
* under the program to the provided destination. The program must be frozen. Every
|
|
52
|
+
* returned `payout_ids[i]` must be settled via
|
|
53
|
+
* `POST /v1/simulations/payouts/{id}/send` for the program balance to reach zero.
|
|
54
|
+
* This endpoint is unavailable in live production.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const response =
|
|
59
|
+
* await client.simulations.accountPrograms.drain(
|
|
60
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
61
|
+
* {
|
|
62
|
+
* destination: {
|
|
63
|
+
* account_holder_name: 'Acme Sandbox Ltd.',
|
|
64
|
+
* iban: 'DE89370400440532013000',
|
|
65
|
+
* type: 'iban',
|
|
66
|
+
* },
|
|
67
|
+
* },
|
|
68
|
+
* );
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
drain(
|
|
72
|
+
id: string,
|
|
73
|
+
body: AccountProgramDrainParams,
|
|
74
|
+
options?: RequestOptions,
|
|
75
|
+
): APIPromise<AccountProgramDrainResponse> {
|
|
76
|
+
return this._client.post(path`/v1/simulations/account_programs/${id}/drain`, { body, ...options });
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Freezes an existing account program and its virtual accounts. This endpoint is
|
|
81
|
+
* unavailable in live production.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* const response =
|
|
86
|
+
* await client.simulations.accountPrograms.freeze(
|
|
87
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
88
|
+
* );
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
freeze(id: string, options?: RequestOptions): APIPromise<AccountProgramFreezeResponse> {
|
|
92
|
+
return this._client.post(path`/v1/simulations/account_programs/${id}/freeze`, options);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Unfreezes an existing account program and its virtual accounts. This endpoint is
|
|
97
|
+
* unavailable in live production.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```ts
|
|
101
|
+
* const response =
|
|
102
|
+
* await client.simulations.accountPrograms.unfreeze(
|
|
103
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
104
|
+
* );
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
unfreeze(id: string, options?: RequestOptions): APIPromise<AccountProgramUnfreezeResponse> {
|
|
108
|
+
return this._client.post(path`/v1/simulations/account_programs/${id}/unfreeze`, options);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface AccountProgramCreateResponse {
|
|
113
|
+
/**
|
|
114
|
+
* Account program whose lifecycle is being simulated.
|
|
115
|
+
*/
|
|
116
|
+
account_program_id: string;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Resource type discriminator.
|
|
120
|
+
*/
|
|
121
|
+
type: 'account_program_simulation';
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface AccountProgramCloseResponse {
|
|
125
|
+
/**
|
|
126
|
+
* Account program whose lifecycle is being simulated.
|
|
127
|
+
*/
|
|
128
|
+
account_program_id: string;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Resource type discriminator.
|
|
132
|
+
*/
|
|
133
|
+
type: 'account_program_simulation';
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface AccountProgramDrainResponse {
|
|
137
|
+
/**
|
|
138
|
+
* Account program whose lifecycle is being simulated.
|
|
139
|
+
*/
|
|
140
|
+
account_program_id: string;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Payouts created by the drain. Feed each id to
|
|
144
|
+
* `POST /v1/simulations/payouts/{id}/send` to settle.
|
|
145
|
+
*/
|
|
146
|
+
payout_ids: Array<string>;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Resource type discriminator.
|
|
150
|
+
*/
|
|
151
|
+
type: 'account_program_simulation';
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface AccountProgramFreezeResponse {
|
|
155
|
+
/**
|
|
156
|
+
* Account program whose lifecycle is being simulated.
|
|
157
|
+
*/
|
|
158
|
+
account_program_id: string;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Resource type discriminator.
|
|
162
|
+
*/
|
|
163
|
+
type: 'account_program_simulation';
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface AccountProgramUnfreezeResponse {
|
|
167
|
+
/**
|
|
168
|
+
* Account program whose lifecycle is being simulated.
|
|
169
|
+
*/
|
|
170
|
+
account_program_id: string;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Resource type discriminator.
|
|
174
|
+
*/
|
|
175
|
+
type: 'account_program_simulation';
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export interface AccountProgramCreateParams {
|
|
179
|
+
/**
|
|
180
|
+
* Human-readable label for the account program.
|
|
181
|
+
*/
|
|
182
|
+
label: string;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export interface AccountProgramCloseParams {
|
|
186
|
+
/**
|
|
187
|
+
* Reason for closing the account program.
|
|
188
|
+
*/
|
|
189
|
+
reason: 'aml_risk_fraud' | 'client_request';
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface AccountProgramDrainParams {
|
|
193
|
+
/**
|
|
194
|
+
* Fiat financial address to which the residual balance of every frozen account
|
|
195
|
+
* under the program is drained.
|
|
196
|
+
*/
|
|
197
|
+
destination:
|
|
198
|
+
| AccountProgramDrainParams.IbanFinancialAddressRequest
|
|
199
|
+
| AccountProgramDrainParams.SortCodeFinancialAddress
|
|
200
|
+
| AccountProgramDrainParams.AbaFinancialAddress;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export namespace AccountProgramDrainParams {
|
|
204
|
+
export interface IbanFinancialAddressRequest {
|
|
205
|
+
/**
|
|
206
|
+
* Name of the account holder.
|
|
207
|
+
*/
|
|
208
|
+
account_holder_name: string;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* International Bank Account Number.
|
|
212
|
+
*/
|
|
213
|
+
iban: string;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Discriminator for IBAN financial address.
|
|
217
|
+
*/
|
|
218
|
+
type: 'iban';
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Bank Identifier Code. Optional; omit or send null if not provided.
|
|
222
|
+
*/
|
|
223
|
+
bic?: string | null;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export interface SortCodeFinancialAddress {
|
|
227
|
+
/**
|
|
228
|
+
* Name of the account holder.
|
|
229
|
+
*/
|
|
230
|
+
account_holder_name: string;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* UK account number (8 digits).
|
|
234
|
+
*/
|
|
235
|
+
account_number: string;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* UK sort code (6 digits).
|
|
239
|
+
*/
|
|
240
|
+
sort_code: string;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Discriminator for UK sort code financial address.
|
|
244
|
+
*/
|
|
245
|
+
type: 'sort_code';
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export interface AbaFinancialAddress {
|
|
249
|
+
/**
|
|
250
|
+
* Name of the account holder.
|
|
251
|
+
*/
|
|
252
|
+
account_holder_name: string;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Bank account number.
|
|
256
|
+
*/
|
|
257
|
+
account_number: string;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* ABA routing number (9 digits).
|
|
261
|
+
*/
|
|
262
|
+
routing_number: string;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Discriminator for ABA wire financial address.
|
|
266
|
+
*/
|
|
267
|
+
type: 'aba';
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export declare namespace AccountPrograms {
|
|
272
|
+
export {
|
|
273
|
+
type AccountProgramCreateResponse as AccountProgramCreateResponse,
|
|
274
|
+
type AccountProgramCloseResponse as AccountProgramCloseResponse,
|
|
275
|
+
type AccountProgramDrainResponse as AccountProgramDrainResponse,
|
|
276
|
+
type AccountProgramFreezeResponse as AccountProgramFreezeResponse,
|
|
277
|
+
type AccountProgramUnfreezeResponse as AccountProgramUnfreezeResponse,
|
|
278
|
+
type AccountProgramCreateParams as AccountProgramCreateParams,
|
|
279
|
+
type AccountProgramCloseParams as AccountProgramCloseParams,
|
|
280
|
+
type AccountProgramDrainParams as AccountProgramDrainParams,
|
|
281
|
+
};
|
|
282
|
+
}
|