@augustusbank/typescript-sdk 0.22.0 → 0.22.2

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 (164) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/client.d.mts +8 -8
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +8 -8
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/account-programs.d.mts +21 -16
  10. package/resources/account-programs.d.mts.map +1 -1
  11. package/resources/account-programs.d.ts +21 -16
  12. package/resources/account-programs.d.ts.map +1 -1
  13. package/resources/account-programs.js +2 -2
  14. package/resources/account-programs.js.map +1 -1
  15. package/resources/account-programs.mjs +2 -2
  16. package/resources/account-programs.mjs.map +1 -1
  17. package/resources/accounts.d.mts +21 -6
  18. package/resources/accounts.d.mts.map +1 -1
  19. package/resources/accounts.d.ts +21 -6
  20. package/resources/accounts.d.ts.map +1 -1
  21. package/resources/accounts.js +2 -2
  22. package/resources/accounts.js.map +1 -1
  23. package/resources/accounts.mjs +2 -2
  24. package/resources/accounts.mjs.map +1 -1
  25. package/resources/counterparties.d.mts +16 -16
  26. package/resources/counterparties.d.mts.map +1 -1
  27. package/resources/counterparties.d.ts +16 -16
  28. package/resources/counterparties.d.ts.map +1 -1
  29. package/resources/deposits.d.mts +10 -0
  30. package/resources/deposits.d.mts.map +1 -1
  31. package/resources/deposits.d.ts +10 -0
  32. package/resources/deposits.d.ts.map +1 -1
  33. package/resources/events.d.mts +3 -3
  34. package/resources/events.d.mts.map +1 -1
  35. package/resources/events.d.ts +3 -3
  36. package/resources/events.d.ts.map +1 -1
  37. package/resources/index.d.mts +4 -4
  38. package/resources/index.d.mts.map +1 -1
  39. package/resources/index.d.ts +4 -4
  40. package/resources/index.d.ts.map +1 -1
  41. package/resources/index.js.map +1 -1
  42. package/resources/index.mjs.map +1 -1
  43. package/resources/payouts.d.mts +22 -406
  44. package/resources/payouts.d.mts.map +1 -1
  45. package/resources/payouts.d.ts +22 -406
  46. package/resources/payouts.d.ts.map +1 -1
  47. package/resources/payouts.js +2 -4
  48. package/resources/payouts.js.map +1 -1
  49. package/resources/payouts.mjs +2 -4
  50. package/resources/payouts.mjs.map +1 -1
  51. package/resources/quotes/index.d.mts +1 -1
  52. package/resources/quotes/index.d.mts.map +1 -1
  53. package/resources/quotes/index.d.ts +1 -1
  54. package/resources/quotes/index.d.ts.map +1 -1
  55. package/resources/quotes/index.js.map +1 -1
  56. package/resources/quotes/index.mjs.map +1 -1
  57. package/resources/quotes/quotes.d.mts +0 -57
  58. package/resources/quotes/quotes.d.mts.map +1 -1
  59. package/resources/quotes/quotes.d.ts +0 -57
  60. package/resources/quotes/quotes.d.ts.map +1 -1
  61. package/resources/quotes/quotes.js +0 -7
  62. package/resources/quotes/quotes.js.map +1 -1
  63. package/resources/quotes/quotes.mjs +0 -7
  64. package/resources/quotes/quotes.mjs.map +1 -1
  65. package/resources/simulations/account-programs.d.mts +11 -72
  66. package/resources/simulations/account-programs.d.mts.map +1 -1
  67. package/resources/simulations/account-programs.d.ts +11 -72
  68. package/resources/simulations/account-programs.d.ts.map +1 -1
  69. package/resources/simulations/account-programs.js +1 -2
  70. package/resources/simulations/account-programs.js.map +1 -1
  71. package/resources/simulations/account-programs.mjs +1 -2
  72. package/resources/simulations/account-programs.mjs.map +1 -1
  73. package/resources/simulations/accounts.d.mts +16 -72
  74. package/resources/simulations/accounts.d.mts.map +1 -1
  75. package/resources/simulations/accounts.d.ts +16 -72
  76. package/resources/simulations/accounts.d.ts.map +1 -1
  77. package/resources/simulations/accounts.js +3 -3
  78. package/resources/simulations/accounts.js.map +1 -1
  79. package/resources/simulations/accounts.mjs +3 -3
  80. package/resources/simulations/accounts.mjs.map +1 -1
  81. package/resources/simulations/conversions.d.mts +54 -0
  82. package/resources/simulations/conversions.d.mts.map +1 -0
  83. package/resources/simulations/conversions.d.ts +54 -0
  84. package/resources/simulations/conversions.d.ts.map +1 -0
  85. package/resources/simulations/conversions.js +39 -0
  86. package/resources/simulations/conversions.js.map +1 -0
  87. package/resources/simulations/conversions.mjs +35 -0
  88. package/resources/simulations/conversions.mjs.map +1 -0
  89. package/resources/simulations/deposits.d.mts +14 -30
  90. package/resources/simulations/deposits.d.mts.map +1 -1
  91. package/resources/simulations/deposits.d.ts +14 -30
  92. package/resources/simulations/deposits.d.ts.map +1 -1
  93. package/resources/simulations/index.d.mts +3 -1
  94. package/resources/simulations/index.d.mts.map +1 -1
  95. package/resources/simulations/index.d.ts +3 -1
  96. package/resources/simulations/index.d.ts.map +1 -1
  97. package/resources/simulations/index.js +5 -1
  98. package/resources/simulations/index.js.map +1 -1
  99. package/resources/simulations/index.mjs +2 -0
  100. package/resources/simulations/index.mjs.map +1 -1
  101. package/resources/simulations/payouts.d.mts +33 -17
  102. package/resources/simulations/payouts.d.mts.map +1 -1
  103. package/resources/simulations/payouts.d.ts +33 -17
  104. package/resources/simulations/payouts.d.ts.map +1 -1
  105. package/resources/simulations/payouts.js +16 -0
  106. package/resources/simulations/payouts.js.map +1 -1
  107. package/resources/simulations/payouts.mjs +16 -0
  108. package/resources/simulations/payouts.mjs.map +1 -1
  109. package/resources/simulations/returns.d.mts +92 -0
  110. package/resources/simulations/returns.d.mts.map +1 -0
  111. package/resources/simulations/returns.d.ts +92 -0
  112. package/resources/simulations/returns.d.ts.map +1 -0
  113. package/resources/simulations/returns.js +55 -0
  114. package/resources/simulations/returns.js.map +1 -0
  115. package/resources/simulations/returns.mjs +51 -0
  116. package/resources/simulations/returns.mjs.map +1 -0
  117. package/resources/simulations/simulations.d.mts +10 -2
  118. package/resources/simulations/simulations.d.mts.map +1 -1
  119. package/resources/simulations/simulations.d.ts +10 -2
  120. package/resources/simulations/simulations.d.ts.map +1 -1
  121. package/resources/simulations/simulations.js +8 -0
  122. package/resources/simulations/simulations.js.map +1 -1
  123. package/resources/simulations/simulations.mjs +9 -1
  124. package/resources/simulations/simulations.mjs.map +1 -1
  125. package/resources/transactions.d.mts +60 -0
  126. package/resources/transactions.d.mts.map +1 -1
  127. package/resources/transactions.d.ts +60 -0
  128. package/resources/transactions.d.ts.map +1 -1
  129. package/resources/webhook-subscriptions.d.mts +9 -9
  130. package/resources/webhook-subscriptions.d.mts.map +1 -1
  131. package/resources/webhook-subscriptions.d.ts +9 -9
  132. package/resources/webhook-subscriptions.d.ts.map +1 -1
  133. package/resources/webhook-subscriptions.js +1 -1
  134. package/resources/webhook-subscriptions.mjs +1 -1
  135. package/resources/webhooks.d.mts +245 -30
  136. package/resources/webhooks.d.mts.map +1 -1
  137. package/resources/webhooks.d.ts +245 -30
  138. package/resources/webhooks.d.ts.map +1 -1
  139. package/src/client.ts +18 -10
  140. package/src/resources/account-programs.ts +29 -18
  141. package/src/resources/accounts.ts +29 -6
  142. package/src/resources/counterparties.ts +16 -16
  143. package/src/resources/deposits.ts +12 -0
  144. package/src/resources/events.ts +18 -12
  145. package/src/resources/index.ts +9 -5
  146. package/src/resources/payouts.ts +36 -1993
  147. package/src/resources/quotes/index.ts +1 -1
  148. package/src/resources/quotes/quotes.ts +0 -84
  149. package/src/resources/simulations/account-programs.ts +12 -87
  150. package/src/resources/simulations/accounts.ts +18 -87
  151. package/src/resources/simulations/conversions.ts +70 -0
  152. package/src/resources/simulations/deposits.ts +27 -35
  153. package/src/resources/simulations/index.ts +11 -0
  154. package/src/resources/simulations/payouts.ts +43 -18
  155. package/src/resources/simulations/returns.ts +123 -0
  156. package/src/resources/simulations/simulations.ts +40 -1
  157. package/src/resources/transactions.ts +70 -0
  158. package/src/resources/webhook-subscriptions.ts +49 -33
  159. package/src/resources/webhooks.ts +360 -36
  160. package/src/version.ts +1 -1
  161. package/version.d.mts +1 -1
  162. package/version.d.ts +1 -1
  163. package/version.js +1 -1
  164. package/version.mjs +1 -1
@@ -1,4 +1,4 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  export { Indicative, type IndicativeRetrieveResponse, type IndicativeRetrieveParams } from './indicative';
4
- export { Quotes, type QuoteRetrieveResponse } from './quotes';
4
+ export { Quotes } from './quotes';
@@ -3,98 +3,14 @@
3
3
  import { APIResource } from '../../core/resource';
4
4
  import * as IndicativeAPI from './indicative';
5
5
  import { Indicative, IndicativeRetrieveParams, IndicativeRetrieveResponse } from './indicative';
6
- import { APIPromise } from '../../core/api-promise';
7
- import { RequestOptions } from '../../internal/request-options';
8
- import { path } from '../../internal/utils/path';
9
6
 
10
7
  export class Quotes extends APIResource {
11
8
  indicative: IndicativeAPI.Indicative = new IndicativeAPI.Indicative(this._client);
12
-
13
- /**
14
- * Retrieves a persisted quote by ID.
15
- */
16
- retrieve(id: string, options?: RequestOptions): APIPromise<QuoteRetrieveResponse> {
17
- return this._client.get(path`/v1/quotes/${id}`, options);
18
- }
19
- }
20
-
21
- export interface QuoteRetrieveResponse {
22
- /**
23
- * Unique identifier of the quote.
24
- */
25
- id: string;
26
-
27
- /**
28
- * ISO 8601 UTC timestamp when the quote was created.
29
- */
30
- created_at: string;
31
-
32
- /**
33
- * Exchange rate applied.
34
- */
35
- exchange_rate: string;
36
-
37
- /**
38
- * ISO 8601 UTC timestamp when the quote expires.
39
- */
40
- expires_at: string;
41
-
42
- /**
43
- * Current funding status of the quote.
44
- */
45
- funding_status: 'pending' | 'sent' | 'completed' | 'failed' | 'on_hold';
46
-
47
- /**
48
- * Amount as a string decimal (e.g. "100.50").
49
- */
50
- source_amount: string;
51
-
52
- /**
53
- * Currency code (ISO 4217 or crypto).
54
- */
55
- source_currency: 'EUR' | 'GBP' | 'USD' | 'USDC' | 'BTC' | 'ETH' | 'SOL' | 'POL';
56
-
57
- /**
58
- * Current status of the quote.
59
- */
60
- status:
61
- | 'pending'
62
- | 'quote_accepted'
63
- | 'order_pending'
64
- | 'order_failed'
65
- | 'order_completed'
66
- | 'withdrawal_pending'
67
- | 'withdrawal_failed'
68
- | 'withdrawal_completed'
69
- | 'completed'
70
- | 'failed';
71
-
72
- /**
73
- * Amount as a string decimal (e.g. "100.50").
74
- */
75
- target_amount: string;
76
-
77
- /**
78
- * Currency code (ISO 4217 or crypto).
79
- */
80
- target_currency: 'EUR' | 'GBP' | 'USD' | 'USDC' | 'BTC' | 'ETH' | 'SOL' | 'POL';
81
-
82
- /**
83
- * Resource type discriminator.
84
- */
85
- type: 'quote';
86
-
87
- /**
88
- * ISO 8601 UTC timestamp when the quote was last updated.
89
- */
90
- updated_at: string;
91
9
  }
92
10
 
93
11
  Quotes.Indicative = Indicative;
94
12
 
95
13
  export declare namespace Quotes {
96
- export { type QuoteRetrieveResponse as QuoteRetrieveResponse };
97
-
98
14
  export {
99
15
  Indicative as Indicative,
100
16
  type IndicativeRetrieveResponse as IndicativeRetrieveResponse,
@@ -15,7 +15,7 @@ export class AccountPrograms extends APIResource {
15
15
  * const accountProgram =
16
16
  * await client.simulations.accountPrograms.create({
17
17
  * label: 'x',
18
- * type: 'fbo-program',
18
+ * type: 'fbo_program',
19
19
  * });
20
20
  * ```
21
21
  */
@@ -62,7 +62,6 @@ export class AccountPrograms extends APIResource {
62
62
  * {
63
63
  * destination: {
64
64
  * account_holder_name: 'Acme Sandbox Ltd.',
65
- * bic: 'COBADEFFXXX',
66
65
  * iban: 'DE89370400440532013000',
67
66
  * type: 'iban',
68
67
  * },
@@ -117,22 +116,6 @@ export interface AccountProgramCreateResponse {
117
116
  */
118
117
  account_program_id: string;
119
118
 
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
119
  /**
137
120
  * Resource type discriminator.
138
121
  */
@@ -145,22 +128,6 @@ export interface AccountProgramCloseResponse {
145
128
  */
146
129
  account_program_id: string;
147
130
 
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
131
  /**
165
132
  * Resource type discriminator.
166
133
  */
@@ -174,20 +141,10 @@ export interface AccountProgramDrainResponse {
174
141
  account_program_id: string;
175
142
 
176
143
  /**
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.
144
+ * Payouts created by the drain. Feed each id to
145
+ * `POST /v1/simulations/payouts/{id}/send` to settle.
189
146
  */
190
- success: boolean;
147
+ payout_ids: Array<string>;
191
148
 
192
149
  /**
193
150
  * Resource type discriminator.
@@ -201,22 +158,6 @@ export interface AccountProgramFreezeResponse {
201
158
  */
202
159
  account_program_id: string;
203
160
 
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
161
  /**
221
162
  * Resource type discriminator.
222
163
  */
@@ -229,22 +170,6 @@ export interface AccountProgramUnfreezeResponse {
229
170
  */
230
171
  account_program_id: string;
231
172
 
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
173
  /**
249
174
  * Resource type discriminator.
250
175
  */
@@ -260,7 +185,7 @@ export interface AccountProgramCreateParams {
260
185
  /**
261
186
  * Account program type.
262
187
  */
263
- type: 'fbo-program' | 'fbo-sponsored';
188
+ type: 'fbo_program' | 'fbo_sponsored';
264
189
  }
265
190
 
266
191
  export interface AccountProgramCloseParams {
@@ -276,23 +201,18 @@ export interface AccountProgramDrainParams {
276
201
  * under the program is drained.
277
202
  */
278
203
  destination:
279
- | AccountProgramDrainParams.IbanFinancialAddress
204
+ | AccountProgramDrainParams.IbanFinancialAddressRequest
280
205
  | AccountProgramDrainParams.SortCodeFinancialAddress
281
206
  | AccountProgramDrainParams.AbaFinancialAddress;
282
207
  }
283
208
 
284
209
  export namespace AccountProgramDrainParams {
285
- export interface IbanFinancialAddress {
210
+ export interface IbanFinancialAddressRequest {
286
211
  /**
287
212
  * Name of the account holder.
288
213
  */
289
214
  account_holder_name: string;
290
215
 
291
- /**
292
- * Bank Identifier Code, or null if not provided.
293
- */
294
- bic: string | null;
295
-
296
216
  /**
297
217
  * International Bank Account Number.
298
218
  */
@@ -302,6 +222,11 @@ export namespace AccountProgramDrainParams {
302
222
  * Discriminator for IBAN financial address.
303
223
  */
304
224
  type: 'iban';
225
+
226
+ /**
227
+ * Bank Identifier Code. Optional; omit or send null if not provided.
228
+ */
229
+ bic?: string | null;
305
230
  }
306
231
 
307
232
  export interface SortCodeFinancialAddress {
@@ -7,13 +7,14 @@ import { path } from '../../internal/utils/path';
7
7
 
8
8
  export class Accounts extends APIResource {
9
9
  /**
10
- * Creates a Mock-US USD operating (DDA) account owned by the caller merchant. This
11
- * endpoint is unavailable in live production.
10
+ * Creates a Mock-US USD account owned by the caller merchant. This endpoint is
11
+ * unavailable in live production.
12
12
  *
13
13
  * @example
14
14
  * ```ts
15
15
  * const account = await client.simulations.accounts.create({
16
16
  * label: 'x',
17
+ * type: 'operating',
17
18
  * });
18
19
  * ```
19
20
  */
@@ -50,7 +51,6 @@ export class Accounts extends APIResource {
50
51
  * {
51
52
  * destination: {
52
53
  * account_holder_name: 'Acme Sandbox Ltd.',
53
- * bic: 'COBADEFFXXX',
54
54
  * iban: 'DE89370400440532013000',
55
55
  * type: 'iban',
56
56
  * },
@@ -99,22 +99,6 @@ export interface AccountCreateResponse {
99
99
  */
100
100
  account_id: string;
101
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
102
  /**
119
103
  * Resource type discriminator.
120
104
  */
@@ -127,22 +111,6 @@ export interface AccountCloseResponse {
127
111
  */
128
112
  account_id: string;
129
113
 
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
114
  /**
147
115
  * Resource type discriminator.
148
116
  */
@@ -156,20 +124,10 @@ export interface AccountDrainResponse {
156
124
  account_id: string;
157
125
 
158
126
  /**
159
- * Account lifecycle event submitted to the sandbox.
127
+ * Payout created by the drain. Feed to `POST /v1/simulations/payouts/{id}/send` to
128
+ * settle.
160
129
  */
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;
130
+ payout_id: string;
173
131
 
174
132
  /**
175
133
  * Resource type discriminator.
@@ -183,22 +141,6 @@ export interface AccountFreezeResponse {
183
141
  */
184
142
  account_id: string;
185
143
 
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
144
  /**
203
145
  * Resource type discriminator.
204
146
  */
@@ -211,22 +153,6 @@ export interface AccountUnfreezeResponse {
211
153
  */
212
154
  account_id: string;
213
155
 
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
156
  /**
231
157
  * Resource type discriminator.
232
158
  */
@@ -238,6 +164,11 @@ export interface AccountCreateParams {
238
164
  * Human-readable label for the operating account.
239
165
  */
240
166
  label: string;
167
+
168
+ /**
169
+ * Account type.
170
+ */
171
+ type: 'operating';
241
172
  }
242
173
 
243
174
  export interface AccountCloseParams {
@@ -253,23 +184,18 @@ export interface AccountDrainParams {
253
184
  * drained.
254
185
  */
255
186
  destination:
256
- | AccountDrainParams.IbanFinancialAddress
187
+ | AccountDrainParams.IbanFinancialAddressRequest
257
188
  | AccountDrainParams.SortCodeFinancialAddress
258
189
  | AccountDrainParams.AbaFinancialAddress;
259
190
  }
260
191
 
261
192
  export namespace AccountDrainParams {
262
- export interface IbanFinancialAddress {
193
+ export interface IbanFinancialAddressRequest {
263
194
  /**
264
195
  * Name of the account holder.
265
196
  */
266
197
  account_holder_name: string;
267
198
 
268
- /**
269
- * Bank Identifier Code, or null if not provided.
270
- */
271
- bic: string | null;
272
-
273
199
  /**
274
200
  * International Bank Account Number.
275
201
  */
@@ -279,6 +205,11 @@ export namespace AccountDrainParams {
279
205
  * Discriminator for IBAN financial address.
280
206
  */
281
207
  type: 'iban';
208
+
209
+ /**
210
+ * Bank Identifier Code. Optional; omit or send null if not provided.
211
+ */
212
+ bic?: string | null;
282
213
  }
283
214
 
284
215
  export interface SortCodeFinancialAddress {
@@ -0,0 +1,70 @@
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 Conversions extends APIResource {
9
+ /**
10
+ * Releases a controlled (sandbox) conversion paused at its first step so it runs
11
+ * to completion normally. This endpoint is unavailable in live production.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const response =
16
+ * await client.simulations.conversions.complete(
17
+ * '550e8400-e29b-41d4-a716-446655440006',
18
+ * );
19
+ * ```
20
+ */
21
+ complete(id: string, options?: RequestOptions): APIPromise<ConversionCompleteResponse> {
22
+ return this._client.post(path`/v1/simulations/conversions/${id}/complete`, options);
23
+ }
24
+
25
+ /**
26
+ * Fails a controlled (sandbox) conversion paused at its first step, before any
27
+ * funds move. This endpoint is unavailable in live production.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const response = await client.simulations.conversions.fail(
32
+ * '550e8400-e29b-41d4-a716-446655440006',
33
+ * );
34
+ * ```
35
+ */
36
+ fail(id: string, options?: RequestOptions): APIPromise<ConversionFailResponse> {
37
+ return this._client.post(path`/v1/simulations/conversions/${id}/fail`, options);
38
+ }
39
+ }
40
+
41
+ export interface ConversionCompleteResponse {
42
+ /**
43
+ * Conversion whose execution is being simulated.
44
+ */
45
+ conversion_id: string;
46
+
47
+ /**
48
+ * Resource type discriminator.
49
+ */
50
+ type: 'conversion_simulation';
51
+ }
52
+
53
+ export interface ConversionFailResponse {
54
+ /**
55
+ * Conversion whose execution is being simulated.
56
+ */
57
+ conversion_id: string;
58
+
59
+ /**
60
+ * Resource type discriminator.
61
+ */
62
+ type: 'conversion_simulation';
63
+ }
64
+
65
+ export declare namespace Conversions {
66
+ export {
67
+ type ConversionCompleteResponse as ConversionCompleteResponse,
68
+ type ConversionFailResponse as ConversionFailResponse,
69
+ };
70
+ }
@@ -29,36 +29,10 @@ export interface DepositCreateResponse {
29
29
  */
30
30
  account_id: string;
31
31
 
32
- /**
33
- * Simulated amount as a decimal string.
34
- */
35
- amount: string;
36
-
37
- /**
38
- * Currency of the receiving account.
39
- */
40
- currency: 'EUR' | 'GBP' | 'USD' | 'USDC';
41
-
42
- /**
43
- * Payment rail the simulated deposit arrived on, or null when not known.
44
- */
45
- rail: 'sepa' | 'sepa_instant' | 'faster_payments' | 'ach' | 'fedwire' | 'swift' | null;
46
-
47
- /**
48
- * Whether the simulation submission was successful.
49
- */
50
- success: boolean;
51
-
52
32
  /**
53
33
  * Resource type discriminator.
54
34
  */
55
35
  type: 'deposit_simulation';
56
-
57
- /**
58
- * ISO 20022 unstructured remittance information (<RmtInf>/<Ustrd>), or null when
59
- * omitted.
60
- */
61
- unstructured_remittance_information: string | null;
62
36
  }
63
37
 
64
38
  export interface DepositCreateParams {
@@ -78,14 +52,32 @@ export interface DepositCreateParams {
78
52
  currency: 'EUR' | 'GBP' | 'USD' | 'USDC';
79
53
 
80
54
  /**
81
- * Sender of the simulated deposit.
55
+ * Sender of the simulated deposit. Mutually exclusive with `counterparty_id`.
82
56
  */
83
57
  counterparty?: DepositCreateParams.Counterparty;
84
58
 
59
+ /**
60
+ * ID of an existing counterparty to use as the sender of the simulated deposit.
61
+ * Mutually exclusive with `counterparty`.
62
+ */
63
+ counterparty_id?: string;
64
+
85
65
  /**
86
66
  * Payment rail the simulated deposit arrives on.
87
67
  */
88
- rail?: 'sepa' | 'sepa_instant' | 'faster_payments' | 'ach' | 'fedwire' | 'swift';
68
+ rail?:
69
+ | 'sepa'
70
+ | 'sepa_instant'
71
+ | 'faster_payments'
72
+ | 'swift'
73
+ | 'ach'
74
+ | 'fedwire'
75
+ | 'ethereum'
76
+ | 'ethereum_sepolia'
77
+ | 'solana'
78
+ | 'solana_devnet'
79
+ | 'polygon'
80
+ | 'polygon_amoy';
89
81
 
90
82
  /**
91
83
  * Unstructured remittance information attached to the transfer. Not all rails
@@ -96,7 +88,7 @@ export interface DepositCreateParams {
96
88
 
97
89
  export namespace DepositCreateParams {
98
90
  /**
99
- * Sender of the simulated deposit.
91
+ * Sender of the simulated deposit. Mutually exclusive with `counterparty_id`.
100
92
  */
101
93
  export interface Counterparty {
102
94
  /**
@@ -505,19 +497,19 @@ export namespace DepositCreateParams {
505
497
  line_1: string;
506
498
 
507
499
  /**
508
- * Secondary street address, or null if not recorded.
500
+ * Postal or ZIP code.
509
501
  */
510
- line_2: string | null;
502
+ postal_code: string;
511
503
 
512
504
  /**
513
- * Postal or ZIP code.
505
+ * Secondary street address. Optional; omit or send null if not recorded.
514
506
  */
515
- postal_code: string;
507
+ line_2?: string | null;
516
508
 
517
509
  /**
518
- * State, province, or region, or null if not recorded.
510
+ * State, province, or region. Optional; omit or send null if not recorded.
519
511
  */
520
- state: string | null;
512
+ state?: string | null;
521
513
  }
522
514
  }
523
515
  }
@@ -22,11 +22,22 @@ export {
22
22
  type AccountCloseParams,
23
23
  type AccountDrainParams,
24
24
  } from './accounts';
25
+ export { Conversions, type ConversionCompleteResponse, type ConversionFailResponse } from './conversions';
25
26
  export { Deposits, type DepositCreateResponse, type DepositCreateParams } from './deposits';
26
27
  export {
27
28
  Payouts,
28
29
  type PayoutRejectResponse,
30
+ type PayoutReturnResponse,
29
31
  type PayoutSendResponse,
30
32
  type PayoutRejectParams,
33
+ type PayoutReturnParams,
31
34
  } from './payouts';
35
+ export {
36
+ Returns,
37
+ type ReturnRejectResponse,
38
+ type ReturnReturnResponse,
39
+ type ReturnSendResponse,
40
+ type ReturnRejectParams,
41
+ type ReturnReturnParams,
42
+ } from './returns';
32
43
  export { Simulations } from './simulations';