@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.
Files changed (216) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/client.d.mts +12 -6
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +12 -6
  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 +22 -17
  20. package/resources/account-programs.d.mts.map +1 -1
  21. package/resources/account-programs.d.ts +22 -17
  22. package/resources/account-programs.d.ts.map +1 -1
  23. package/resources/account-programs.js +2 -2
  24. package/resources/account-programs.js.map +1 -1
  25. package/resources/account-programs.mjs +2 -2
  26. package/resources/account-programs.mjs.map +1 -1
  27. package/resources/accounts.d.mts +226 -48
  28. package/resources/accounts.d.mts.map +1 -1
  29. package/resources/accounts.d.ts +226 -48
  30. package/resources/accounts.d.ts.map +1 -1
  31. package/resources/accounts.js +55 -2
  32. package/resources/accounts.js.map +1 -1
  33. package/resources/accounts.mjs +55 -2
  34. package/resources/accounts.mjs.map +1 -1
  35. package/resources/api-keys.d.mts +1 -1
  36. package/resources/api-keys.d.mts.map +1 -1
  37. package/resources/api-keys.d.ts +1 -1
  38. package/resources/api-keys.d.ts.map +1 -1
  39. package/resources/api-versions.d.mts +3 -0
  40. package/resources/api-versions.d.mts.map +1 -1
  41. package/resources/api-versions.d.ts +3 -0
  42. package/resources/api-versions.d.ts.map +1 -1
  43. package/resources/conversions.d.mts +36 -81
  44. package/resources/conversions.d.mts.map +1 -1
  45. package/resources/conversions.d.ts +36 -81
  46. package/resources/conversions.d.ts.map +1 -1
  47. package/resources/conversions.js +25 -1
  48. package/resources/conversions.js.map +1 -1
  49. package/resources/conversions.mjs +25 -1
  50. package/resources/conversions.mjs.map +1 -1
  51. package/resources/counterparties.d.mts +1042 -0
  52. package/resources/counterparties.d.mts.map +1 -0
  53. package/resources/counterparties.d.ts +1042 -0
  54. package/resources/counterparties.d.ts.map +1 -0
  55. package/resources/counterparties.js +45 -0
  56. package/resources/counterparties.js.map +1 -0
  57. package/resources/counterparties.mjs +41 -0
  58. package/resources/counterparties.mjs.map +1 -0
  59. package/resources/deposits.d.mts +48 -186
  60. package/resources/deposits.d.mts.map +1 -1
  61. package/resources/deposits.d.ts +48 -186
  62. package/resources/deposits.d.ts.map +1 -1
  63. package/resources/events.d.mts +3 -3
  64. package/resources/events.d.mts.map +1 -1
  65. package/resources/events.d.ts +3 -3
  66. package/resources/events.d.ts.map +1 -1
  67. package/resources/index.d.mts +5 -3
  68. package/resources/index.d.mts.map +1 -1
  69. package/resources/index.d.ts +5 -3
  70. package/resources/index.d.ts.map +1 -1
  71. package/resources/index.js +5 -1
  72. package/resources/index.js.map +1 -1
  73. package/resources/index.mjs +2 -0
  74. package/resources/index.mjs.map +1 -1
  75. package/resources/payouts.d.mts +133 -335
  76. package/resources/payouts.d.mts.map +1 -1
  77. package/resources/payouts.d.ts +133 -335
  78. package/resources/payouts.d.ts.map +1 -1
  79. package/resources/payouts.js +25 -0
  80. package/resources/payouts.js.map +1 -1
  81. package/resources/payouts.mjs +25 -0
  82. package/resources/payouts.mjs.map +1 -1
  83. package/resources/quotes/indicative.d.mts +7 -11
  84. package/resources/quotes/indicative.d.mts.map +1 -1
  85. package/resources/quotes/indicative.d.ts +7 -11
  86. package/resources/quotes/indicative.d.ts.map +1 -1
  87. package/resources/quotes/quotes.d.mts +4 -8
  88. package/resources/quotes/quotes.d.mts.map +1 -1
  89. package/resources/quotes/quotes.d.ts +4 -8
  90. package/resources/quotes/quotes.d.ts.map +1 -1
  91. package/resources/quotes/quotes.js.map +1 -1
  92. package/resources/quotes/quotes.mjs.map +1 -1
  93. package/resources/returns.d.mts +84 -39
  94. package/resources/returns.d.mts.map +1 -1
  95. package/resources/returns.d.ts +84 -39
  96. package/resources/returns.d.ts.map +1 -1
  97. package/resources/returns.js +22 -0
  98. package/resources/returns.js.map +1 -1
  99. package/resources/returns.mjs +22 -0
  100. package/resources/returns.mjs.map +1 -1
  101. package/resources/scopes.d.mts +4 -1
  102. package/resources/scopes.d.mts.map +1 -1
  103. package/resources/scopes.d.ts +4 -1
  104. package/resources/scopes.d.ts.map +1 -1
  105. package/resources/simulations/account-programs.d.mts +215 -0
  106. package/resources/simulations/account-programs.d.mts.map +1 -0
  107. package/resources/simulations/account-programs.d.ts +215 -0
  108. package/resources/simulations/account-programs.d.ts.map +1 -0
  109. package/resources/simulations/account-programs.js +96 -0
  110. package/resources/simulations/account-programs.js.map +1 -0
  111. package/resources/simulations/account-programs.mjs +92 -0
  112. package/resources/simulations/account-programs.mjs.map +1 -0
  113. package/resources/simulations/accounts.d.mts +209 -0
  114. package/resources/simulations/accounts.d.mts.map +1 -0
  115. package/resources/simulations/accounts.d.ts +209 -0
  116. package/resources/simulations/accounts.d.ts.map +1 -0
  117. package/resources/simulations/accounts.js +90 -0
  118. package/resources/simulations/accounts.js.map +1 -0
  119. package/resources/simulations/accounts.mjs +86 -0
  120. package/resources/simulations/accounts.mjs.map +1 -0
  121. package/resources/simulations/conversions.d.mts +54 -0
  122. package/resources/simulations/conversions.d.mts.map +1 -0
  123. package/resources/simulations/conversions.d.ts +54 -0
  124. package/resources/simulations/conversions.d.ts.map +1 -0
  125. package/resources/simulations/conversions.js +39 -0
  126. package/resources/simulations/conversions.js.map +1 -0
  127. package/resources/simulations/conversions.mjs +35 -0
  128. package/resources/simulations/conversions.mjs.map +1 -0
  129. package/resources/simulations/deposits.d.mts +202 -0
  130. package/resources/simulations/deposits.d.mts.map +1 -0
  131. package/resources/simulations/deposits.d.ts +202 -0
  132. package/resources/simulations/deposits.d.ts.map +1 -0
  133. package/resources/simulations/deposits.js +25 -0
  134. package/resources/simulations/deposits.js.map +1 -0
  135. package/resources/simulations/deposits.mjs +21 -0
  136. package/resources/simulations/deposits.mjs.map +1 -0
  137. package/resources/simulations/index.d.mts +7 -0
  138. package/resources/simulations/index.d.mts.map +1 -0
  139. package/resources/simulations/index.d.ts +7 -0
  140. package/resources/simulations/index.d.ts.map +1 -0
  141. package/resources/simulations/index.js +17 -0
  142. package/resources/simulations/index.js.map +1 -0
  143. package/resources/simulations/index.mjs +8 -0
  144. package/resources/simulations/index.mjs.map +1 -0
  145. package/resources/simulations/payouts.d.mts +62 -0
  146. package/resources/simulations/payouts.d.mts.map +1 -0
  147. package/resources/simulations/payouts.d.ts +62 -0
  148. package/resources/simulations/payouts.d.ts.map +1 -0
  149. package/resources/simulations/payouts.js +39 -0
  150. package/resources/simulations/payouts.js.map +1 -0
  151. package/resources/simulations/payouts.mjs +35 -0
  152. package/resources/simulations/payouts.mjs.map +1 -0
  153. package/resources/simulations/simulations.d.mts +26 -0
  154. package/resources/simulations/simulations.d.mts.map +1 -0
  155. package/resources/simulations/simulations.d.ts +26 -0
  156. package/resources/simulations/simulations.d.ts.map +1 -0
  157. package/resources/simulations/simulations.js +33 -0
  158. package/resources/simulations/simulations.js.map +1 -0
  159. package/resources/simulations/simulations.mjs +28 -0
  160. package/resources/simulations/simulations.mjs.map +1 -0
  161. package/resources/simulations.d.mts +2 -0
  162. package/resources/simulations.d.mts.map +1 -0
  163. package/resources/simulations.d.ts +2 -0
  164. package/resources/simulations.d.ts.map +1 -0
  165. package/resources/simulations.js +6 -0
  166. package/resources/simulations.js.map +1 -0
  167. package/resources/simulations.mjs +3 -0
  168. package/resources/simulations.mjs.map +1 -0
  169. package/resources/transactions.d.mts +342 -162
  170. package/resources/transactions.d.mts.map +1 -1
  171. package/resources/transactions.d.ts +342 -162
  172. package/resources/transactions.d.ts.map +1 -1
  173. package/resources/webhook-subscriptions.d.mts +61 -11
  174. package/resources/webhook-subscriptions.d.mts.map +1 -1
  175. package/resources/webhook-subscriptions.d.ts +61 -11
  176. package/resources/webhook-subscriptions.d.ts.map +1 -1
  177. package/resources/webhook-subscriptions.js +49 -0
  178. package/resources/webhook-subscriptions.js.map +1 -1
  179. package/resources/webhook-subscriptions.mjs +49 -0
  180. package/resources/webhook-subscriptions.mjs.map +1 -1
  181. package/resources/webhooks.d.mts +976 -978
  182. package/resources/webhooks.d.mts.map +1 -1
  183. package/resources/webhooks.d.ts +976 -978
  184. package/resources/webhooks.d.ts.map +1 -1
  185. package/src/client.ts +48 -8
  186. package/src/resources/account-holders.ts +1701 -1282
  187. package/src/resources/account-programs.ts +30 -19
  188. package/src/resources/accounts.ts +265 -50
  189. package/src/resources/api-keys.ts +3 -0
  190. package/src/resources/api-versions.ts +3 -0
  191. package/src/resources/conversions.ts +36 -93
  192. package/src/resources/counterparties.ts +3127 -0
  193. package/src/resources/deposits.ts +66 -269
  194. package/src/resources/events.ts +18 -12
  195. package/src/resources/index.ts +21 -4
  196. package/src/resources/payouts.ts +204 -439
  197. package/src/resources/quotes/indicative.ts +7 -12
  198. package/src/resources/quotes/quotes.ts +4 -9
  199. package/src/resources/returns.ts +144 -40
  200. package/src/resources/scopes.ts +7 -1
  201. package/src/resources/simulations/account-programs.ts +282 -0
  202. package/src/resources/simulations/accounts.ts +265 -0
  203. package/src/resources/simulations/conversions.ts +70 -0
  204. package/src/resources/simulations/deposits.ts +522 -0
  205. package/src/resources/simulations/index.ts +33 -0
  206. package/src/resources/simulations/payouts.ts +80 -0
  207. package/src/resources/simulations/simulations.ts +92 -0
  208. package/src/resources/simulations.ts +3 -0
  209. package/src/resources/transactions.ts +954 -206
  210. package/src/resources/webhook-subscriptions.ts +102 -36
  211. package/src/resources/webhooks.ts +1283 -1153
  212. package/src/version.ts +1 -1
  213. package/version.d.mts +1 -1
  214. package/version.d.ts +1 -1
  215. package/version.js +1 -1
  216. package/version.mjs +1 -1
@@ -0,0 +1,265 @@
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
+ * iban: 'DE89370400440532013000',
54
+ * type: 'iban',
55
+ * },
56
+ * },
57
+ * );
58
+ * ```
59
+ */
60
+ drain(id: string, body: AccountDrainParams, options?: RequestOptions): APIPromise<AccountDrainResponse> {
61
+ return this._client.post(path`/v1/simulations/accounts/${id}/drain`, { body, ...options });
62
+ }
63
+
64
+ /**
65
+ * Freezes an existing operating (DDA) account. This endpoint is unavailable in
66
+ * live production.
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * const response = await client.simulations.accounts.freeze(
71
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
72
+ * );
73
+ * ```
74
+ */
75
+ freeze(id: string, options?: RequestOptions): APIPromise<AccountFreezeResponse> {
76
+ return this._client.post(path`/v1/simulations/accounts/${id}/freeze`, options);
77
+ }
78
+
79
+ /**
80
+ * Unfreezes an existing operating (DDA) account. This endpoint is unavailable in
81
+ * live production.
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * const response = await client.simulations.accounts.unfreeze(
86
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
87
+ * );
88
+ * ```
89
+ */
90
+ unfreeze(id: string, options?: RequestOptions): APIPromise<AccountUnfreezeResponse> {
91
+ return this._client.post(path`/v1/simulations/accounts/${id}/unfreeze`, options);
92
+ }
93
+ }
94
+
95
+ export interface AccountCreateResponse {
96
+ /**
97
+ * Account whose lifecycle is being simulated.
98
+ */
99
+ account_id: string;
100
+
101
+ /**
102
+ * Resource type discriminator.
103
+ */
104
+ type: 'account_simulation';
105
+ }
106
+
107
+ export interface AccountCloseResponse {
108
+ /**
109
+ * Account whose lifecycle is being simulated.
110
+ */
111
+ account_id: string;
112
+
113
+ /**
114
+ * Resource type discriminator.
115
+ */
116
+ type: 'account_simulation';
117
+ }
118
+
119
+ export interface AccountDrainResponse {
120
+ /**
121
+ * Account whose lifecycle is being simulated.
122
+ */
123
+ account_id: string;
124
+
125
+ /**
126
+ * Payout created by the drain. Feed to `POST /v1/simulations/payouts/{id}/send` to
127
+ * settle.
128
+ */
129
+ payout_id: string;
130
+
131
+ /**
132
+ * Resource type discriminator.
133
+ */
134
+ type: 'account_simulation';
135
+ }
136
+
137
+ export interface AccountFreezeResponse {
138
+ /**
139
+ * Account whose lifecycle is being simulated.
140
+ */
141
+ account_id: string;
142
+
143
+ /**
144
+ * Resource type discriminator.
145
+ */
146
+ type: 'account_simulation';
147
+ }
148
+
149
+ export interface AccountUnfreezeResponse {
150
+ /**
151
+ * Account whose lifecycle is being simulated.
152
+ */
153
+ account_id: string;
154
+
155
+ /**
156
+ * Resource type discriminator.
157
+ */
158
+ type: 'account_simulation';
159
+ }
160
+
161
+ export interface AccountCreateParams {
162
+ /**
163
+ * Human-readable label for the operating account.
164
+ */
165
+ label: string;
166
+ }
167
+
168
+ export interface AccountCloseParams {
169
+ /**
170
+ * Reason for closing the account.
171
+ */
172
+ reason: 'aml_risk_fraud' | 'client_request';
173
+ }
174
+
175
+ export interface AccountDrainParams {
176
+ /**
177
+ * Fiat financial address to which the residual balance of the frozen account is
178
+ * drained.
179
+ */
180
+ destination:
181
+ | AccountDrainParams.IbanFinancialAddressRequest
182
+ | AccountDrainParams.SortCodeFinancialAddress
183
+ | AccountDrainParams.AbaFinancialAddress;
184
+ }
185
+
186
+ export namespace AccountDrainParams {
187
+ export interface IbanFinancialAddressRequest {
188
+ /**
189
+ * Name of the account holder.
190
+ */
191
+ account_holder_name: string;
192
+
193
+ /**
194
+ * International Bank Account Number.
195
+ */
196
+ iban: string;
197
+
198
+ /**
199
+ * Discriminator for IBAN financial address.
200
+ */
201
+ type: 'iban';
202
+
203
+ /**
204
+ * Bank Identifier Code. Optional; omit or send null if not provided.
205
+ */
206
+ bic?: string | null;
207
+ }
208
+
209
+ export interface SortCodeFinancialAddress {
210
+ /**
211
+ * Name of the account holder.
212
+ */
213
+ account_holder_name: string;
214
+
215
+ /**
216
+ * UK account number (8 digits).
217
+ */
218
+ account_number: string;
219
+
220
+ /**
221
+ * UK sort code (6 digits).
222
+ */
223
+ sort_code: string;
224
+
225
+ /**
226
+ * Discriminator for UK sort code financial address.
227
+ */
228
+ type: 'sort_code';
229
+ }
230
+
231
+ export interface AbaFinancialAddress {
232
+ /**
233
+ * Name of the account holder.
234
+ */
235
+ account_holder_name: string;
236
+
237
+ /**
238
+ * Bank account number.
239
+ */
240
+ account_number: string;
241
+
242
+ /**
243
+ * ABA routing number (9 digits).
244
+ */
245
+ routing_number: string;
246
+
247
+ /**
248
+ * Discriminator for ABA wire financial address.
249
+ */
250
+ type: 'aba';
251
+ }
252
+ }
253
+
254
+ export declare namespace Accounts {
255
+ export {
256
+ type AccountCreateResponse as AccountCreateResponse,
257
+ type AccountCloseResponse as AccountCloseResponse,
258
+ type AccountDrainResponse as AccountDrainResponse,
259
+ type AccountFreezeResponse as AccountFreezeResponse,
260
+ type AccountUnfreezeResponse as AccountUnfreezeResponse,
261
+ type AccountCreateParams as AccountCreateParams,
262
+ type AccountCloseParams as AccountCloseParams,
263
+ type AccountDrainParams as AccountDrainParams,
264
+ };
265
+ }
@@ -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
+ }