@augustusbank/typescript-sdk 0.20.0 → 0.22.0

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 (196) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/client.d.mts +6 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +6 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +6 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/account-holders.d.mts +1555 -1184
  12. package/resources/account-holders.d.mts.map +1 -1
  13. package/resources/account-holders.d.ts +1555 -1184
  14. package/resources/account-holders.d.ts.map +1 -1
  15. package/resources/account-holders.js +59 -0
  16. package/resources/account-holders.js.map +1 -1
  17. package/resources/account-holders.mjs +59 -0
  18. package/resources/account-holders.mjs.map +1 -1
  19. package/resources/account-programs.d.mts +2 -2
  20. package/resources/account-programs.d.ts +2 -2
  21. package/resources/accounts.d.mts +206 -43
  22. package/resources/accounts.d.mts.map +1 -1
  23. package/resources/accounts.d.ts +206 -43
  24. package/resources/accounts.d.ts.map +1 -1
  25. package/resources/accounts.js +53 -0
  26. package/resources/accounts.js.map +1 -1
  27. package/resources/accounts.mjs +53 -0
  28. package/resources/accounts.mjs.map +1 -1
  29. package/resources/api-keys.d.mts +1 -1
  30. package/resources/api-keys.d.mts.map +1 -1
  31. package/resources/api-keys.d.ts +1 -1
  32. package/resources/api-keys.d.ts.map +1 -1
  33. package/resources/api-versions.d.mts +3 -0
  34. package/resources/api-versions.d.mts.map +1 -1
  35. package/resources/api-versions.d.ts +3 -0
  36. package/resources/api-versions.d.ts.map +1 -1
  37. package/resources/conversions.d.mts +36 -81
  38. package/resources/conversions.d.mts.map +1 -1
  39. package/resources/conversions.d.ts +36 -81
  40. package/resources/conversions.d.ts.map +1 -1
  41. package/resources/conversions.js +25 -1
  42. package/resources/conversions.js.map +1 -1
  43. package/resources/conversions.mjs +25 -1
  44. package/resources/conversions.mjs.map +1 -1
  45. package/resources/counterparties.d.mts +1042 -0
  46. package/resources/counterparties.d.mts.map +1 -0
  47. package/resources/counterparties.d.ts +1042 -0
  48. package/resources/counterparties.d.ts.map +1 -0
  49. package/resources/counterparties.js +45 -0
  50. package/resources/counterparties.js.map +1 -0
  51. package/resources/counterparties.mjs +41 -0
  52. package/resources/counterparties.mjs.map +1 -0
  53. package/resources/deposits.d.mts +38 -186
  54. package/resources/deposits.d.mts.map +1 -1
  55. package/resources/deposits.d.ts +38 -186
  56. package/resources/deposits.d.ts.map +1 -1
  57. package/resources/index.d.mts +2 -0
  58. package/resources/index.d.mts.map +1 -1
  59. package/resources/index.d.ts +2 -0
  60. package/resources/index.d.ts.map +1 -1
  61. package/resources/index.js +5 -1
  62. package/resources/index.js.map +1 -1
  63. package/resources/index.mjs +2 -0
  64. package/resources/index.mjs.map +1 -1
  65. package/resources/payouts.d.mts +458 -276
  66. package/resources/payouts.d.mts.map +1 -1
  67. package/resources/payouts.d.ts +458 -276
  68. package/resources/payouts.d.ts.map +1 -1
  69. package/resources/payouts.js +27 -0
  70. package/resources/payouts.js.map +1 -1
  71. package/resources/payouts.mjs +27 -0
  72. package/resources/payouts.mjs.map +1 -1
  73. package/resources/quotes/indicative.d.mts +7 -11
  74. package/resources/quotes/indicative.d.mts.map +1 -1
  75. package/resources/quotes/indicative.d.ts +7 -11
  76. package/resources/quotes/indicative.d.ts.map +1 -1
  77. package/resources/quotes/quotes.d.mts +4 -8
  78. package/resources/quotes/quotes.d.mts.map +1 -1
  79. package/resources/quotes/quotes.d.ts +4 -8
  80. package/resources/quotes/quotes.d.ts.map +1 -1
  81. package/resources/quotes/quotes.js.map +1 -1
  82. package/resources/quotes/quotes.mjs.map +1 -1
  83. package/resources/returns.d.mts +84 -39
  84. package/resources/returns.d.mts.map +1 -1
  85. package/resources/returns.d.ts +84 -39
  86. package/resources/returns.d.ts.map +1 -1
  87. package/resources/returns.js +22 -0
  88. package/resources/returns.js.map +1 -1
  89. package/resources/returns.mjs +22 -0
  90. package/resources/returns.mjs.map +1 -1
  91. package/resources/scopes.d.mts +4 -1
  92. package/resources/scopes.d.mts.map +1 -1
  93. package/resources/scopes.d.ts +4 -1
  94. package/resources/scopes.d.ts.map +1 -1
  95. package/resources/simulations/account-programs.d.mts +281 -0
  96. package/resources/simulations/account-programs.d.mts.map +1 -0
  97. package/resources/simulations/account-programs.d.ts +281 -0
  98. package/resources/simulations/account-programs.d.ts.map +1 -0
  99. package/resources/simulations/account-programs.js +98 -0
  100. package/resources/simulations/account-programs.js.map +1 -0
  101. package/resources/simulations/account-programs.mjs +94 -0
  102. package/resources/simulations/account-programs.mjs.map +1 -0
  103. package/resources/simulations/accounts.d.mts +270 -0
  104. package/resources/simulations/accounts.d.mts.map +1 -0
  105. package/resources/simulations/accounts.d.ts +270 -0
  106. package/resources/simulations/accounts.d.ts.map +1 -0
  107. package/resources/simulations/accounts.js +91 -0
  108. package/resources/simulations/accounts.js.map +1 -0
  109. package/resources/simulations/accounts.mjs +87 -0
  110. package/resources/simulations/accounts.mjs.map +1 -0
  111. package/resources/simulations/deposits.d.mts +218 -0
  112. package/resources/simulations/deposits.d.mts.map +1 -0
  113. package/resources/simulations/deposits.d.ts +218 -0
  114. package/resources/simulations/deposits.d.ts.map +1 -0
  115. package/resources/simulations/deposits.js +25 -0
  116. package/resources/simulations/deposits.js.map +1 -0
  117. package/resources/simulations/deposits.mjs +21 -0
  118. package/resources/simulations/deposits.mjs.map +1 -0
  119. package/resources/simulations/index.d.mts +6 -0
  120. package/resources/simulations/index.d.mts.map +1 -0
  121. package/resources/simulations/index.d.ts +6 -0
  122. package/resources/simulations/index.d.ts.map +1 -0
  123. package/resources/simulations/index.js +15 -0
  124. package/resources/simulations/index.js.map +1 -0
  125. package/resources/simulations/index.mjs +7 -0
  126. package/resources/simulations/index.mjs.map +1 -0
  127. package/resources/simulations/payouts.d.mts +76 -0
  128. package/resources/simulations/payouts.d.mts.map +1 -0
  129. package/resources/simulations/payouts.d.ts +76 -0
  130. package/resources/simulations/payouts.d.ts.map +1 -0
  131. package/resources/simulations/payouts.js +39 -0
  132. package/resources/simulations/payouts.js.map +1 -0
  133. package/resources/simulations/payouts.mjs +35 -0
  134. package/resources/simulations/payouts.mjs.map +1 -0
  135. package/resources/simulations/simulations.d.mts +22 -0
  136. package/resources/simulations/simulations.d.mts.map +1 -0
  137. package/resources/simulations/simulations.d.ts +22 -0
  138. package/resources/simulations/simulations.d.ts.map +1 -0
  139. package/resources/simulations/simulations.js +29 -0
  140. package/resources/simulations/simulations.js.map +1 -0
  141. package/resources/simulations/simulations.mjs +24 -0
  142. package/resources/simulations/simulations.mjs.map +1 -0
  143. package/resources/simulations.d.mts +2 -0
  144. package/resources/simulations.d.mts.map +1 -0
  145. package/resources/simulations.d.ts +2 -0
  146. package/resources/simulations.d.ts.map +1 -0
  147. package/resources/simulations.js +6 -0
  148. package/resources/simulations.js.map +1 -0
  149. package/resources/simulations.mjs +3 -0
  150. package/resources/simulations.mjs.map +1 -0
  151. package/resources/transactions.d.mts +300 -180
  152. package/resources/transactions.d.mts.map +1 -1
  153. package/resources/transactions.d.ts +300 -180
  154. package/resources/transactions.d.ts.map +1 -1
  155. package/resources/webhook-subscriptions.d.mts +54 -4
  156. package/resources/webhook-subscriptions.d.mts.map +1 -1
  157. package/resources/webhook-subscriptions.d.ts +54 -4
  158. package/resources/webhook-subscriptions.d.ts.map +1 -1
  159. package/resources/webhook-subscriptions.js +49 -0
  160. package/resources/webhook-subscriptions.js.map +1 -1
  161. package/resources/webhook-subscriptions.mjs +49 -0
  162. package/resources/webhook-subscriptions.mjs.map +1 -1
  163. package/resources/webhooks.d.mts +736 -953
  164. package/resources/webhooks.d.mts.map +1 -1
  165. package/resources/webhooks.d.ts +736 -953
  166. package/resources/webhooks.d.ts.map +1 -1
  167. package/src/client.ts +32 -0
  168. package/src/resources/account-holders.ts +1701 -1282
  169. package/src/resources/account-programs.ts +2 -2
  170. package/src/resources/accounts.ts +236 -44
  171. package/src/resources/api-keys.ts +3 -0
  172. package/src/resources/api-versions.ts +3 -0
  173. package/src/resources/conversions.ts +36 -93
  174. package/src/resources/counterparties.ts +3127 -0
  175. package/src/resources/deposits.ts +54 -269
  176. package/src/resources/index.ts +13 -0
  177. package/src/resources/payouts.ts +2089 -367
  178. package/src/resources/quotes/indicative.ts +7 -12
  179. package/src/resources/quotes/quotes.ts +4 -9
  180. package/src/resources/returns.ts +144 -40
  181. package/src/resources/scopes.ts +7 -1
  182. package/src/resources/simulations/account-programs.ts +363 -0
  183. package/src/resources/simulations/accounts.ts +340 -0
  184. package/src/resources/simulations/deposits.ts +530 -0
  185. package/src/resources/simulations/index.ts +32 -0
  186. package/src/resources/simulations/payouts.ts +98 -0
  187. package/src/resources/simulations/simulations.ts +82 -0
  188. package/src/resources/simulations.ts +3 -0
  189. package/src/resources/transactions.ts +910 -232
  190. package/src/resources/webhook-subscriptions.ts +54 -4
  191. package/src/resources/webhooks.ts +948 -1126
  192. package/src/version.ts +1 -1
  193. package/version.d.mts +1 -1
  194. package/version.d.ts +1 -1
  195. package/version.js +1 -1
  196. package/version.mjs +1 -1
@@ -0,0 +1,363 @@
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
+ * type: 'fbo-program',
19
+ * });
20
+ * ```
21
+ */
22
+ create(
23
+ body: AccountProgramCreateParams,
24
+ options?: RequestOptions,
25
+ ): APIPromise<AccountProgramCreateResponse> {
26
+ return this._client.post('/v1/simulations/account_programs', { body, ...options });
27
+ }
28
+
29
+ /**
30
+ * Closes an account program. All child accounts must be drained via the drain
31
+ * endpoint first. This endpoint is unavailable in live production.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const response =
36
+ * await client.simulations.accountPrograms.close(
37
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
38
+ * { reason: 'aml_risk_fraud' },
39
+ * );
40
+ * ```
41
+ */
42
+ close(
43
+ id: string,
44
+ body: AccountProgramCloseParams,
45
+ options?: RequestOptions,
46
+ ): APIPromise<AccountProgramCloseResponse> {
47
+ return this._client.post(path`/v1/simulations/account_programs/${id}/close`, { body, ...options });
48
+ }
49
+
50
+ /**
51
+ * Creates outbound payouts that drain the residual balance of every frozen account
52
+ * under the program to the provided destination. The program must be frozen. Every
53
+ * returned `payout_ids[i]` must be settled via
54
+ * `POST /v1/simulations/payouts/{id}/send` for the program balance to reach zero.
55
+ * This endpoint is unavailable in live production.
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * const response =
60
+ * await client.simulations.accountPrograms.drain(
61
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
62
+ * {
63
+ * destination: {
64
+ * account_holder_name: 'Acme Sandbox Ltd.',
65
+ * bic: 'COBADEFFXXX',
66
+ * iban: 'DE89370400440532013000',
67
+ * type: 'iban',
68
+ * },
69
+ * },
70
+ * );
71
+ * ```
72
+ */
73
+ drain(
74
+ id: string,
75
+ body: AccountProgramDrainParams,
76
+ options?: RequestOptions,
77
+ ): APIPromise<AccountProgramDrainResponse> {
78
+ return this._client.post(path`/v1/simulations/account_programs/${id}/drain`, { body, ...options });
79
+ }
80
+
81
+ /**
82
+ * Freezes an existing account program and its virtual accounts. This endpoint is
83
+ * unavailable in live production.
84
+ *
85
+ * @example
86
+ * ```ts
87
+ * const response =
88
+ * await client.simulations.accountPrograms.freeze(
89
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
90
+ * );
91
+ * ```
92
+ */
93
+ freeze(id: string, options?: RequestOptions): APIPromise<AccountProgramFreezeResponse> {
94
+ return this._client.post(path`/v1/simulations/account_programs/${id}/freeze`, options);
95
+ }
96
+
97
+ /**
98
+ * Unfreezes an existing account program and its virtual accounts. This endpoint is
99
+ * unavailable in live production.
100
+ *
101
+ * @example
102
+ * ```ts
103
+ * const response =
104
+ * await client.simulations.accountPrograms.unfreeze(
105
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
106
+ * );
107
+ * ```
108
+ */
109
+ unfreeze(id: string, options?: RequestOptions): APIPromise<AccountProgramUnfreezeResponse> {
110
+ return this._client.post(path`/v1/simulations/account_programs/${id}/unfreeze`, options);
111
+ }
112
+ }
113
+
114
+ export interface AccountProgramCreateResponse {
115
+ /**
116
+ * Account program whose lifecycle is being simulated.
117
+ */
118
+ account_program_id: string;
119
+
120
+ /**
121
+ * Account program lifecycle event submitted to the sandbox.
122
+ */
123
+ event: 'create' | 'freeze' | 'unfreeze' | 'close' | 'drain';
124
+
125
+ /**
126
+ * Payouts created by a drain event. Feed each id to
127
+ * `POST /v1/simulations/payouts/{id}/send` to settle. `null` for non-drain events.
128
+ */
129
+ payout_ids: Array<string> | null;
130
+
131
+ /**
132
+ * Whether the simulation submission was successful.
133
+ */
134
+ success: boolean;
135
+
136
+ /**
137
+ * Resource type discriminator.
138
+ */
139
+ type: 'account_program_simulation';
140
+ }
141
+
142
+ export interface AccountProgramCloseResponse {
143
+ /**
144
+ * Account program whose lifecycle is being simulated.
145
+ */
146
+ account_program_id: string;
147
+
148
+ /**
149
+ * Account program lifecycle event submitted to the sandbox.
150
+ */
151
+ event: 'create' | 'freeze' | 'unfreeze' | 'close' | 'drain';
152
+
153
+ /**
154
+ * Payouts created by a drain event. Feed each id to
155
+ * `POST /v1/simulations/payouts/{id}/send` to settle. `null` for non-drain events.
156
+ */
157
+ payout_ids: Array<string> | null;
158
+
159
+ /**
160
+ * Whether the simulation submission was successful.
161
+ */
162
+ success: boolean;
163
+
164
+ /**
165
+ * Resource type discriminator.
166
+ */
167
+ type: 'account_program_simulation';
168
+ }
169
+
170
+ export interface AccountProgramDrainResponse {
171
+ /**
172
+ * Account program whose lifecycle is being simulated.
173
+ */
174
+ account_program_id: string;
175
+
176
+ /**
177
+ * Account program lifecycle event submitted to the sandbox.
178
+ */
179
+ event: 'create' | 'freeze' | 'unfreeze' | 'close' | 'drain';
180
+
181
+ /**
182
+ * Payouts created by a drain event. Feed each id to
183
+ * `POST /v1/simulations/payouts/{id}/send` to settle. `null` for non-drain events.
184
+ */
185
+ payout_ids: Array<string> | null;
186
+
187
+ /**
188
+ * Whether the simulation submission was successful.
189
+ */
190
+ success: boolean;
191
+
192
+ /**
193
+ * Resource type discriminator.
194
+ */
195
+ type: 'account_program_simulation';
196
+ }
197
+
198
+ export interface AccountProgramFreezeResponse {
199
+ /**
200
+ * Account program whose lifecycle is being simulated.
201
+ */
202
+ account_program_id: string;
203
+
204
+ /**
205
+ * Account program lifecycle event submitted to the sandbox.
206
+ */
207
+ event: 'create' | 'freeze' | 'unfreeze' | 'close' | 'drain';
208
+
209
+ /**
210
+ * Payouts created by a drain event. Feed each id to
211
+ * `POST /v1/simulations/payouts/{id}/send` to settle. `null` for non-drain events.
212
+ */
213
+ payout_ids: Array<string> | null;
214
+
215
+ /**
216
+ * Whether the simulation submission was successful.
217
+ */
218
+ success: boolean;
219
+
220
+ /**
221
+ * Resource type discriminator.
222
+ */
223
+ type: 'account_program_simulation';
224
+ }
225
+
226
+ export interface AccountProgramUnfreezeResponse {
227
+ /**
228
+ * Account program whose lifecycle is being simulated.
229
+ */
230
+ account_program_id: string;
231
+
232
+ /**
233
+ * Account program lifecycle event submitted to the sandbox.
234
+ */
235
+ event: 'create' | 'freeze' | 'unfreeze' | 'close' | 'drain';
236
+
237
+ /**
238
+ * Payouts created by a drain event. Feed each id to
239
+ * `POST /v1/simulations/payouts/{id}/send` to settle. `null` for non-drain events.
240
+ */
241
+ payout_ids: Array<string> | null;
242
+
243
+ /**
244
+ * Whether the simulation submission was successful.
245
+ */
246
+ success: boolean;
247
+
248
+ /**
249
+ * Resource type discriminator.
250
+ */
251
+ type: 'account_program_simulation';
252
+ }
253
+
254
+ export interface AccountProgramCreateParams {
255
+ /**
256
+ * Human-readable label for the account program.
257
+ */
258
+ label: string;
259
+
260
+ /**
261
+ * Account program type.
262
+ */
263
+ type: 'fbo-program' | 'fbo-sponsored';
264
+ }
265
+
266
+ export interface AccountProgramCloseParams {
267
+ /**
268
+ * Reason for closing the account program.
269
+ */
270
+ reason: 'aml_risk_fraud' | 'client_request';
271
+ }
272
+
273
+ export interface AccountProgramDrainParams {
274
+ /**
275
+ * Fiat financial address to which the residual balance of every frozen account
276
+ * under the program is drained.
277
+ */
278
+ destination:
279
+ | AccountProgramDrainParams.IbanFinancialAddress
280
+ | AccountProgramDrainParams.SortCodeFinancialAddress
281
+ | AccountProgramDrainParams.AbaFinancialAddress;
282
+ }
283
+
284
+ export namespace AccountProgramDrainParams {
285
+ export interface IbanFinancialAddress {
286
+ /**
287
+ * Name of the account holder.
288
+ */
289
+ account_holder_name: string;
290
+
291
+ /**
292
+ * Bank Identifier Code, or null if not provided.
293
+ */
294
+ bic: string | null;
295
+
296
+ /**
297
+ * International Bank Account Number.
298
+ */
299
+ iban: string;
300
+
301
+ /**
302
+ * Discriminator for IBAN financial address.
303
+ */
304
+ type: 'iban';
305
+ }
306
+
307
+ export interface SortCodeFinancialAddress {
308
+ /**
309
+ * Name of the account holder.
310
+ */
311
+ account_holder_name: string;
312
+
313
+ /**
314
+ * UK account number (8 digits).
315
+ */
316
+ account_number: string;
317
+
318
+ /**
319
+ * UK sort code (6 digits).
320
+ */
321
+ sort_code: string;
322
+
323
+ /**
324
+ * Discriminator for UK sort code financial address.
325
+ */
326
+ type: 'sort_code';
327
+ }
328
+
329
+ export interface AbaFinancialAddress {
330
+ /**
331
+ * Name of the account holder.
332
+ */
333
+ account_holder_name: string;
334
+
335
+ /**
336
+ * Bank account number.
337
+ */
338
+ account_number: string;
339
+
340
+ /**
341
+ * ABA routing number (9 digits).
342
+ */
343
+ routing_number: string;
344
+
345
+ /**
346
+ * Discriminator for ABA wire financial address.
347
+ */
348
+ type: 'aba';
349
+ }
350
+ }
351
+
352
+ export declare namespace AccountPrograms {
353
+ export {
354
+ type AccountProgramCreateResponse as AccountProgramCreateResponse,
355
+ type AccountProgramCloseResponse as AccountProgramCloseResponse,
356
+ type AccountProgramDrainResponse as AccountProgramDrainResponse,
357
+ type AccountProgramFreezeResponse as AccountProgramFreezeResponse,
358
+ type AccountProgramUnfreezeResponse as AccountProgramUnfreezeResponse,
359
+ type AccountProgramCreateParams as AccountProgramCreateParams,
360
+ type AccountProgramCloseParams as AccountProgramCloseParams,
361
+ type AccountProgramDrainParams as AccountProgramDrainParams,
362
+ };
363
+ }
@@ -0,0 +1,340 @@
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 Accounts extends APIResource {
9
+ /**
10
+ * Creates a Mock-US USD operating (DDA) account owned by the caller merchant. This
11
+ * endpoint is unavailable in live production.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const account = await client.simulations.accounts.create({
16
+ * label: 'x',
17
+ * });
18
+ * ```
19
+ */
20
+ create(body: AccountCreateParams, options?: RequestOptions): APIPromise<AccountCreateResponse> {
21
+ return this._client.post('/v1/simulations/accounts', { body, ...options });
22
+ }
23
+
24
+ /**
25
+ * Closes an operating (DDA) account. The account must be drained via the drain
26
+ * endpoint first. This endpoint is unavailable in live production.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const response = await client.simulations.accounts.close(
31
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
32
+ * { reason: 'aml_risk_fraud' },
33
+ * );
34
+ * ```
35
+ */
36
+ close(id: string, body: AccountCloseParams, options?: RequestOptions): APIPromise<AccountCloseResponse> {
37
+ return this._client.post(path`/v1/simulations/accounts/${id}/close`, { body, ...options });
38
+ }
39
+
40
+ /**
41
+ * Creates an outbound payout that drains the residual balance of a frozen
42
+ * operating (DDA) account to the provided destination. The returned `payout_id`
43
+ * must be settled via `POST /v1/simulations/payouts/{id}/send` for the account
44
+ * balance to reach zero. This endpoint is unavailable in live production.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const response = await client.simulations.accounts.drain(
49
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
50
+ * {
51
+ * destination: {
52
+ * account_holder_name: 'Acme Sandbox Ltd.',
53
+ * bic: 'COBADEFFXXX',
54
+ * iban: 'DE89370400440532013000',
55
+ * type: 'iban',
56
+ * },
57
+ * },
58
+ * );
59
+ * ```
60
+ */
61
+ drain(id: string, body: AccountDrainParams, options?: RequestOptions): APIPromise<AccountDrainResponse> {
62
+ return this._client.post(path`/v1/simulations/accounts/${id}/drain`, { body, ...options });
63
+ }
64
+
65
+ /**
66
+ * Freezes an existing operating (DDA) account. This endpoint is unavailable in
67
+ * live production.
68
+ *
69
+ * @example
70
+ * ```ts
71
+ * const response = await client.simulations.accounts.freeze(
72
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
73
+ * );
74
+ * ```
75
+ */
76
+ freeze(id: string, options?: RequestOptions): APIPromise<AccountFreezeResponse> {
77
+ return this._client.post(path`/v1/simulations/accounts/${id}/freeze`, options);
78
+ }
79
+
80
+ /**
81
+ * Unfreezes an existing operating (DDA) account. This endpoint is unavailable in
82
+ * live production.
83
+ *
84
+ * @example
85
+ * ```ts
86
+ * const response = await client.simulations.accounts.unfreeze(
87
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
88
+ * );
89
+ * ```
90
+ */
91
+ unfreeze(id: string, options?: RequestOptions): APIPromise<AccountUnfreezeResponse> {
92
+ return this._client.post(path`/v1/simulations/accounts/${id}/unfreeze`, options);
93
+ }
94
+ }
95
+
96
+ export interface AccountCreateResponse {
97
+ /**
98
+ * Account whose lifecycle is being simulated.
99
+ */
100
+ account_id: string;
101
+
102
+ /**
103
+ * Account lifecycle event submitted to the sandbox.
104
+ */
105
+ event: 'create' | 'freeze' | 'unfreeze' | 'close' | 'drain';
106
+
107
+ /**
108
+ * Payout created by a drain event. Feed to
109
+ * `POST /v1/simulations/payouts/{id}/send` to settle. `null` for non-drain events.
110
+ */
111
+ payout_id: string | null;
112
+
113
+ /**
114
+ * Whether the simulation submission was successful.
115
+ */
116
+ success: boolean;
117
+
118
+ /**
119
+ * Resource type discriminator.
120
+ */
121
+ type: 'account_simulation';
122
+ }
123
+
124
+ export interface AccountCloseResponse {
125
+ /**
126
+ * Account whose lifecycle is being simulated.
127
+ */
128
+ account_id: string;
129
+
130
+ /**
131
+ * Account lifecycle event submitted to the sandbox.
132
+ */
133
+ event: 'create' | 'freeze' | 'unfreeze' | 'close' | 'drain';
134
+
135
+ /**
136
+ * Payout created by a drain event. Feed to
137
+ * `POST /v1/simulations/payouts/{id}/send` to settle. `null` for non-drain events.
138
+ */
139
+ payout_id: string | null;
140
+
141
+ /**
142
+ * Whether the simulation submission was successful.
143
+ */
144
+ success: boolean;
145
+
146
+ /**
147
+ * Resource type discriminator.
148
+ */
149
+ type: 'account_simulation';
150
+ }
151
+
152
+ export interface AccountDrainResponse {
153
+ /**
154
+ * Account whose lifecycle is being simulated.
155
+ */
156
+ account_id: string;
157
+
158
+ /**
159
+ * Account lifecycle event submitted to the sandbox.
160
+ */
161
+ event: 'create' | 'freeze' | 'unfreeze' | 'close' | 'drain';
162
+
163
+ /**
164
+ * Payout created by a drain event. Feed to
165
+ * `POST /v1/simulations/payouts/{id}/send` to settle. `null` for non-drain events.
166
+ */
167
+ payout_id: string | null;
168
+
169
+ /**
170
+ * Whether the simulation submission was successful.
171
+ */
172
+ success: boolean;
173
+
174
+ /**
175
+ * Resource type discriminator.
176
+ */
177
+ type: 'account_simulation';
178
+ }
179
+
180
+ export interface AccountFreezeResponse {
181
+ /**
182
+ * Account whose lifecycle is being simulated.
183
+ */
184
+ account_id: string;
185
+
186
+ /**
187
+ * Account lifecycle event submitted to the sandbox.
188
+ */
189
+ event: 'create' | 'freeze' | 'unfreeze' | 'close' | 'drain';
190
+
191
+ /**
192
+ * Payout created by a drain event. Feed to
193
+ * `POST /v1/simulations/payouts/{id}/send` to settle. `null` for non-drain events.
194
+ */
195
+ payout_id: string | null;
196
+
197
+ /**
198
+ * Whether the simulation submission was successful.
199
+ */
200
+ success: boolean;
201
+
202
+ /**
203
+ * Resource type discriminator.
204
+ */
205
+ type: 'account_simulation';
206
+ }
207
+
208
+ export interface AccountUnfreezeResponse {
209
+ /**
210
+ * Account whose lifecycle is being simulated.
211
+ */
212
+ account_id: string;
213
+
214
+ /**
215
+ * Account lifecycle event submitted to the sandbox.
216
+ */
217
+ event: 'create' | 'freeze' | 'unfreeze' | 'close' | 'drain';
218
+
219
+ /**
220
+ * Payout created by a drain event. Feed to
221
+ * `POST /v1/simulations/payouts/{id}/send` to settle. `null` for non-drain events.
222
+ */
223
+ payout_id: string | null;
224
+
225
+ /**
226
+ * Whether the simulation submission was successful.
227
+ */
228
+ success: boolean;
229
+
230
+ /**
231
+ * Resource type discriminator.
232
+ */
233
+ type: 'account_simulation';
234
+ }
235
+
236
+ export interface AccountCreateParams {
237
+ /**
238
+ * Human-readable label for the operating account.
239
+ */
240
+ label: string;
241
+ }
242
+
243
+ export interface AccountCloseParams {
244
+ /**
245
+ * Reason for closing the account.
246
+ */
247
+ reason: 'aml_risk_fraud' | 'client_request';
248
+ }
249
+
250
+ export interface AccountDrainParams {
251
+ /**
252
+ * Fiat financial address to which the residual balance of the frozen account is
253
+ * drained.
254
+ */
255
+ destination:
256
+ | AccountDrainParams.IbanFinancialAddress
257
+ | AccountDrainParams.SortCodeFinancialAddress
258
+ | AccountDrainParams.AbaFinancialAddress;
259
+ }
260
+
261
+ export namespace AccountDrainParams {
262
+ export interface IbanFinancialAddress {
263
+ /**
264
+ * Name of the account holder.
265
+ */
266
+ account_holder_name: string;
267
+
268
+ /**
269
+ * Bank Identifier Code, or null if not provided.
270
+ */
271
+ bic: string | null;
272
+
273
+ /**
274
+ * International Bank Account Number.
275
+ */
276
+ iban: string;
277
+
278
+ /**
279
+ * Discriminator for IBAN financial address.
280
+ */
281
+ type: 'iban';
282
+ }
283
+
284
+ export interface SortCodeFinancialAddress {
285
+ /**
286
+ * Name of the account holder.
287
+ */
288
+ account_holder_name: string;
289
+
290
+ /**
291
+ * UK account number (8 digits).
292
+ */
293
+ account_number: string;
294
+
295
+ /**
296
+ * UK sort code (6 digits).
297
+ */
298
+ sort_code: string;
299
+
300
+ /**
301
+ * Discriminator for UK sort code financial address.
302
+ */
303
+ type: 'sort_code';
304
+ }
305
+
306
+ export interface AbaFinancialAddress {
307
+ /**
308
+ * Name of the account holder.
309
+ */
310
+ account_holder_name: string;
311
+
312
+ /**
313
+ * Bank account number.
314
+ */
315
+ account_number: string;
316
+
317
+ /**
318
+ * ABA routing number (9 digits).
319
+ */
320
+ routing_number: string;
321
+
322
+ /**
323
+ * Discriminator for ABA wire financial address.
324
+ */
325
+ type: 'aba';
326
+ }
327
+ }
328
+
329
+ export declare namespace Accounts {
330
+ export {
331
+ type AccountCreateResponse as AccountCreateResponse,
332
+ type AccountCloseResponse as AccountCloseResponse,
333
+ type AccountDrainResponse as AccountDrainResponse,
334
+ type AccountFreezeResponse as AccountFreezeResponse,
335
+ type AccountUnfreezeResponse as AccountUnfreezeResponse,
336
+ type AccountCreateParams as AccountCreateParams,
337
+ type AccountCloseParams as AccountCloseParams,
338
+ type AccountDrainParams as AccountDrainParams,
339
+ };
340
+ }