dutchman-bridge 1.0.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.
- package/README.md +212 -0
- package/dist/client/client.gen.d.ts +2 -0
- package/dist/client/client.gen.js +220 -0
- package/dist/client/index.d.ts +10 -0
- package/dist/client/index.js +17 -0
- package/dist/client/types.gen.d.ts +120 -0
- package/dist/client/types.gen.js +3 -0
- package/dist/client/utils.gen.d.ts +37 -0
- package/dist/client/utils.gen.js +241 -0
- package/dist/client.gen.d.ts +12 -0
- package/dist/client.gen.js +6 -0
- package/dist/core/auth.gen.d.ts +25 -0
- package/dist/core/auth.gen.js +18 -0
- package/dist/core/bodySerializer.gen.d.ts +25 -0
- package/dist/core/bodySerializer.gen.js +60 -0
- package/dist/core/params.gen.d.ts +43 -0
- package/dist/core/params.gen.js +112 -0
- package/dist/core/pathSerializer.gen.d.ts +33 -0
- package/dist/core/pathSerializer.gen.js +115 -0
- package/dist/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/core/queryKeySerializer.gen.js +98 -0
- package/dist/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/core/serverSentEvents.gen.js +135 -0
- package/dist/core/types.gen.d.ts +83 -0
- package/dist/core/types.gen.js +3 -0
- package/dist/core/utils.gen.d.ts +19 -0
- package/dist/core/utils.gen.js +93 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +20 -0
- package/dist/sdk.gen.d.ts +339 -0
- package/dist/sdk.gen.js +794 -0
- package/dist/types.gen.d.ts +1935 -0
- package/dist/types.gen.js +3 -0
- package/package.json +32 -0
- package/src/client/client.gen.ts +277 -0
- package/src/client/index.ts +27 -0
- package/src/client/types.gen.ts +218 -0
- package/src/client/utils.gen.ts +316 -0
- package/src/client.gen.ts +16 -0
- package/src/core/auth.gen.ts +48 -0
- package/src/core/bodySerializer.gen.ts +82 -0
- package/src/core/params.gen.ts +178 -0
- package/src/core/pathSerializer.gen.ts +171 -0
- package/src/core/queryKeySerializer.gen.ts +117 -0
- package/src/core/serverSentEvents.gen.ts +242 -0
- package/src/core/types.gen.ts +110 -0
- package/src/core/utils.gen.ts +140 -0
- package/src/index.ts +5 -0
- package/src/sdk.gen.ts +887 -0
- package/src/types.gen.ts +2178 -0
package/dist/sdk.gen.js
ADDED
|
@@ -0,0 +1,794 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DutchmanBridge = exports.Webhook = exports.Features = exports.Countries = exports.Receiving = exports.Bank = exports.Ramp = exports.GlobalSend = exports.Send = exports.Wallet = exports.Kyc = exports.Profile = exports.Customers = void 0;
|
|
5
|
+
const client_1 = require("./client");
|
|
6
|
+
const client_gen_1 = require("./client.gen");
|
|
7
|
+
class HeyApiClient {
|
|
8
|
+
constructor(args) {
|
|
9
|
+
this.client = args?.client ?? client_gen_1.client;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
class HeyApiRegistry {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.defaultKey = 'default';
|
|
15
|
+
this.instances = new Map();
|
|
16
|
+
}
|
|
17
|
+
get(key) {
|
|
18
|
+
const instance = this.instances.get(key ?? this.defaultKey);
|
|
19
|
+
if (!instance) {
|
|
20
|
+
throw new Error(`No SDK client found. Create one with "new DutchmanBridge()" to fix this error.`);
|
|
21
|
+
}
|
|
22
|
+
return instance;
|
|
23
|
+
}
|
|
24
|
+
set(value, key) {
|
|
25
|
+
this.instances.set(key ?? this.defaultKey, value);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
class Customers extends HeyApiClient {
|
|
29
|
+
/**
|
|
30
|
+
* Register a customer under your account
|
|
31
|
+
*
|
|
32
|
+
* The customer never authenticates with Dutchman Bridge directly -- that's entirely yours to manage. This just attributes a new customer id to your account so every other Partner API call can reference it.
|
|
33
|
+
*/
|
|
34
|
+
register(options) {
|
|
35
|
+
return (options.client ?? this.client).post({
|
|
36
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
37
|
+
url: '/api/v1/partner/v1/customers',
|
|
38
|
+
...options,
|
|
39
|
+
headers: {
|
|
40
|
+
'Content-Type': 'application/json',
|
|
41
|
+
...options.headers
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Read one of your customer's profile
|
|
47
|
+
*/
|
|
48
|
+
get(options) {
|
|
49
|
+
return (options.client ?? this.client).get({
|
|
50
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
51
|
+
url: '/api/v1/partner/v1/customers/{customerId}',
|
|
52
|
+
...options
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A customer's full snapshot -- profile, KYC, and wallet -- in one call
|
|
57
|
+
*
|
|
58
|
+
* Replaces separately calling profile/kyc/wallet routes when you just need a customer's current state, e.g. right after registration or to reconcile after a webhook. Not a substitute for the wallet routes' live balance -- fetch this fresh rather than caching it indefinitely, since a crypto deposit or fiat funding event has no webhook of its own yet.
|
|
59
|
+
*/
|
|
60
|
+
full(options) {
|
|
61
|
+
return (options.client ?? this.client).get({
|
|
62
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
63
|
+
url: '/api/v1/partner/v1/customers/{customerId}/full',
|
|
64
|
+
...options
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.Customers = Customers;
|
|
69
|
+
class Profile extends HeyApiClient {
|
|
70
|
+
/**
|
|
71
|
+
* Delete the customer's account
|
|
72
|
+
*
|
|
73
|
+
* Refused (409) while the customer still holds a balance or has a transfer in flight. Deleting twice is not an error.
|
|
74
|
+
*/
|
|
75
|
+
deleteAccount(options) {
|
|
76
|
+
return (options.client ?? this.client).delete({
|
|
77
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
78
|
+
url: '/api/v1/partner/v1/customers/{customerId}',
|
|
79
|
+
...options
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The customer's profile
|
|
84
|
+
*/
|
|
85
|
+
profile(options) {
|
|
86
|
+
return (options.client ?? this.client).get({
|
|
87
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
88
|
+
url: '/api/v1/partner/v1/customers/{customerId}/profile',
|
|
89
|
+
...options
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Update the customer's profile
|
|
94
|
+
*
|
|
95
|
+
* Identity fields can be filled in while empty; once KYC is approved they lock, and only an admin re-verification request reopens them.
|
|
96
|
+
*/
|
|
97
|
+
updateProfile(options) {
|
|
98
|
+
return (options.client ?? this.client).patch({
|
|
99
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
100
|
+
url: '/api/v1/partner/v1/customers/{customerId}/profile',
|
|
101
|
+
...options,
|
|
102
|
+
headers: {
|
|
103
|
+
'Content-Type': 'application/json',
|
|
104
|
+
...options.headers
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Change the customer's password
|
|
110
|
+
*/
|
|
111
|
+
changePassword(options) {
|
|
112
|
+
return (options.client ?? this.client).patch({
|
|
113
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
114
|
+
url: '/api/v1/partner/v1/customers/{customerId}/change-password',
|
|
115
|
+
...options,
|
|
116
|
+
headers: {
|
|
117
|
+
'Content-Type': 'application/json',
|
|
118
|
+
...options.headers
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Read the customer's settlement preference (AUTO to default bank vs MANUAL hold)
|
|
124
|
+
*/
|
|
125
|
+
getSettlementMode(options) {
|
|
126
|
+
return (options.client ?? this.client).get({
|
|
127
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
128
|
+
url: '/api/v1/partner/v1/customers/{customerId}/settlement-mode',
|
|
129
|
+
...options
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Update how the customer's sale proceeds settle
|
|
134
|
+
*/
|
|
135
|
+
setSettlementMode(options) {
|
|
136
|
+
return (options.client ?? this.client).patch({
|
|
137
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
138
|
+
url: '/api/v1/partner/v1/customers/{customerId}/settlement-mode',
|
|
139
|
+
...options,
|
|
140
|
+
headers: {
|
|
141
|
+
'Content-Type': 'application/json',
|
|
142
|
+
...options.headers
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* The customer's withdrawal / global payout history, newest first
|
|
148
|
+
*/
|
|
149
|
+
withdrawals(options) {
|
|
150
|
+
return (options.client ?? this.client).get({
|
|
151
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
152
|
+
url: '/api/v1/partner/v1/customers/{customerId}/withdrawals',
|
|
153
|
+
...options
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
exports.Profile = Profile;
|
|
158
|
+
class Kyc extends HeyApiClient {
|
|
159
|
+
/**
|
|
160
|
+
* A customer's KYC records, newest first
|
|
161
|
+
*/
|
|
162
|
+
status(options) {
|
|
163
|
+
return (options.client ?? this.client).get({
|
|
164
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
165
|
+
url: '/api/v1/partner/v1/customers/{customerId}/kyc',
|
|
166
|
+
...options
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Any open re-verification request an admin has raised for the customer
|
|
171
|
+
*
|
|
172
|
+
* The items to re-provide plus the message, or null when there is nothing to re-verify.
|
|
173
|
+
*/
|
|
174
|
+
reverification(options) {
|
|
175
|
+
return (options.client ?? this.client).get({
|
|
176
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
177
|
+
url: '/api/v1/partner/v1/customers/{customerId}/kyc/reverification',
|
|
178
|
+
...options
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Submit Tier 1 (BVN + NIN)
|
|
183
|
+
*/
|
|
184
|
+
tier1(options) {
|
|
185
|
+
return (options.client ?? this.client).post({
|
|
186
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
187
|
+
url: '/api/v1/partner/v1/customers/{customerId}/kyc/tier1',
|
|
188
|
+
...options,
|
|
189
|
+
headers: {
|
|
190
|
+
'Content-Type': 'application/json',
|
|
191
|
+
...options.headers
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Submit Tier 2 (ID document, from a prior /kyc/documents upload)
|
|
197
|
+
*/
|
|
198
|
+
tier2(options) {
|
|
199
|
+
return (options.client ?? this.client).post({
|
|
200
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
201
|
+
url: '/api/v1/partner/v1/customers/{customerId}/kyc/tier2',
|
|
202
|
+
...options,
|
|
203
|
+
headers: {
|
|
204
|
+
'Content-Type': 'application/json',
|
|
205
|
+
...options.headers
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Submit Tier 3 (date of birth + address, for cross-border corridors)
|
|
211
|
+
*/
|
|
212
|
+
tier3(options) {
|
|
213
|
+
return (options.client ?? this.client).post({
|
|
214
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
215
|
+
url: '/api/v1/partner/v1/customers/{customerId}/kyc/tier3',
|
|
216
|
+
...options,
|
|
217
|
+
headers: {
|
|
218
|
+
'Content-Type': 'application/json',
|
|
219
|
+
...options.headers
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Check a customer's selfie before submitting it
|
|
225
|
+
*
|
|
226
|
+
* Returns what to change -- too dark, blurry, sunglasses, more than one face -- so it can be retaken now rather than rejected by a reviewer days later. Advisory only: a submission is never blocked on this.
|
|
227
|
+
*/
|
|
228
|
+
selfieCheckRoute(options) {
|
|
229
|
+
return (options.client ?? this.client).post({
|
|
230
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
231
|
+
url: '/api/v1/partner/v1/customers/{customerId}/kyc/selfie-check',
|
|
232
|
+
...options,
|
|
233
|
+
headers: {
|
|
234
|
+
'Content-Type': 'application/json',
|
|
235
|
+
...options.headers
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Upload a customer's ID document or selfie ahead of Tier 2
|
|
241
|
+
*/
|
|
242
|
+
document(options) {
|
|
243
|
+
return (options.client ?? this.client).post({
|
|
244
|
+
...client_1.formDataBodySerializer,
|
|
245
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
246
|
+
url: '/api/v1/partner/v1/customers/{customerId}/kyc/documents',
|
|
247
|
+
...options,
|
|
248
|
+
headers: {
|
|
249
|
+
'Content-Type': null,
|
|
250
|
+
...options.headers
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
exports.Kyc = Kyc;
|
|
256
|
+
class Wallet extends HeyApiClient {
|
|
257
|
+
/**
|
|
258
|
+
* USDT + local fiat balance
|
|
259
|
+
*/
|
|
260
|
+
balance(options) {
|
|
261
|
+
return (options.client ?? this.client).get({
|
|
262
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
263
|
+
url: '/api/v1/partner/v1/customers/{customerId}/balance',
|
|
264
|
+
...options
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Live updates: re-emits the customer's balance on every credit/debit
|
|
269
|
+
*
|
|
270
|
+
* Mirrors Dutchman Bridge's own consumer /user/balance/stream, scoped to the customer instead of the caller's own JWT. Long-lived --keep the connection open rather than reconnecting per update.
|
|
271
|
+
*/
|
|
272
|
+
streamBalance(options) {
|
|
273
|
+
return (options.client ?? this.client).get({
|
|
274
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
275
|
+
url: '/api/v1/partner/v1/customers/{customerId}/balance/stream',
|
|
276
|
+
...options
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Recent balance movements, cursor-paginated
|
|
281
|
+
*/
|
|
282
|
+
transactions(options) {
|
|
283
|
+
return (options.client ?? this.client).get({
|
|
284
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
285
|
+
url: '/api/v1/partner/v1/customers/{customerId}/transactions',
|
|
286
|
+
...options
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* The customer's per-network USDT deposit addresses
|
|
291
|
+
*/
|
|
292
|
+
addresses(options) {
|
|
293
|
+
return (options.client ?? this.client).get({
|
|
294
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
295
|
+
url: '/api/v1/partner/v1/customers/{customerId}/addresses',
|
|
296
|
+
...options
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Local-currency virtual account for fiat funding
|
|
301
|
+
*
|
|
302
|
+
* Issued on first read in the customer's own fiat (NGN needs an approved BVN first); the same account is returned on every read after.
|
|
303
|
+
*/
|
|
304
|
+
virtualAccountFor(options) {
|
|
305
|
+
return (options.client ?? this.client).get({
|
|
306
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
307
|
+
url: '/api/v1/partner/v1/customers/{customerId}/virtual-account',
|
|
308
|
+
...options
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Pay a held balance out to the customer's default bank account
|
|
313
|
+
*/
|
|
314
|
+
withdraw(options) {
|
|
315
|
+
return (options.client ?? this.client).post({
|
|
316
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
317
|
+
url: '/api/v1/partner/v1/customers/{customerId}/withdraw',
|
|
318
|
+
...options,
|
|
319
|
+
headers: {
|
|
320
|
+
'Content-Type': 'application/json',
|
|
321
|
+
...options.headers
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Start a fund-by-charge: a one-off bank account (bank_transfer) or a redirect URL to authorise (eft, ZAR)
|
|
327
|
+
*/
|
|
328
|
+
initiateFundingCharge(options) {
|
|
329
|
+
return (options.client ?? this.client).post({
|
|
330
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
331
|
+
url: '/api/v1/partner/v1/customers/{customerId}/funding/charge',
|
|
332
|
+
...options,
|
|
333
|
+
headers: {
|
|
334
|
+
'Content-Type': 'application/json',
|
|
335
|
+
...options.headers
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* The customer's funding charges, newest first
|
|
341
|
+
*/
|
|
342
|
+
fundingCharges(options) {
|
|
343
|
+
return (options.client ?? this.client).get({
|
|
344
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
345
|
+
url: '/api/v1/partner/v1/customers/{customerId}/funding/charges',
|
|
346
|
+
...options
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
exports.Wallet = Wallet;
|
|
351
|
+
class Send extends HeyApiClient {
|
|
352
|
+
/**
|
|
353
|
+
* Networks the customer can send USDT/USDC on, with fee and minimum
|
|
354
|
+
*/
|
|
355
|
+
networks(options) {
|
|
356
|
+
return (options.client ?? this.client).get({
|
|
357
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
358
|
+
url: '/api/v1/partner/v1/customers/{customerId}/send/networks',
|
|
359
|
+
...options
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Quote a send before submitting it
|
|
364
|
+
*/
|
|
365
|
+
quote(options) {
|
|
366
|
+
return (options.client ?? this.client).post({
|
|
367
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
368
|
+
url: '/api/v1/partner/v1/customers/{customerId}/send/quote',
|
|
369
|
+
...options,
|
|
370
|
+
headers: {
|
|
371
|
+
'Content-Type': 'application/json',
|
|
372
|
+
...options.headers
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Send USDT on-chain to the given address
|
|
378
|
+
*/
|
|
379
|
+
submit(options) {
|
|
380
|
+
return (options.client ?? this.client).post({
|
|
381
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
382
|
+
url: '/api/v1/partner/v1/customers/{customerId}/send',
|
|
383
|
+
...options,
|
|
384
|
+
headers: {
|
|
385
|
+
'Content-Type': 'application/json',
|
|
386
|
+
...options.headers
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
exports.Send = Send;
|
|
392
|
+
class GlobalSend extends HeyApiClient {
|
|
393
|
+
/**
|
|
394
|
+
* Re-check the customer's level 3 verification status with the partner
|
|
395
|
+
*/
|
|
396
|
+
verificationStatus(options) {
|
|
397
|
+
return (options.client ?? this.client).get({
|
|
398
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
399
|
+
url: '/api/v1/partner/v1/customers/{customerId}/global-send/verification',
|
|
400
|
+
...options
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Countries the customer can send to, with their currency and rails
|
|
405
|
+
*/
|
|
406
|
+
corridors(options) {
|
|
407
|
+
return (options.client ?? this.client).get({
|
|
408
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
409
|
+
url: '/api/v1/partner/v1/customers/{customerId}/global-send/corridors',
|
|
410
|
+
...options
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Price a cross-border send for the customer
|
|
415
|
+
*/
|
|
416
|
+
quote(options) {
|
|
417
|
+
return (options.client ?? this.client).post({
|
|
418
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
419
|
+
url: '/api/v1/partner/v1/customers/{customerId}/global-send/quote',
|
|
420
|
+
...options,
|
|
421
|
+
headers: {
|
|
422
|
+
'Content-Type': 'application/json',
|
|
423
|
+
...options.headers
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Initiate a cross-border send for the customer
|
|
429
|
+
*/
|
|
430
|
+
initiate(options) {
|
|
431
|
+
return (options.client ?? this.client).post({
|
|
432
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
433
|
+
url: '/api/v1/partner/v1/customers/{customerId}/global-send/initiate',
|
|
434
|
+
...options,
|
|
435
|
+
headers: {
|
|
436
|
+
'Content-Type': 'application/json',
|
|
437
|
+
...options.headers
|
|
438
|
+
}
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
exports.GlobalSend = GlobalSend;
|
|
443
|
+
class Ramp extends HeyApiClient {
|
|
444
|
+
/**
|
|
445
|
+
* Price a buy (fiat -> USDT) against the customer's fiat balance
|
|
446
|
+
*/
|
|
447
|
+
buyQuote(options) {
|
|
448
|
+
return (options.client ?? this.client).post({
|
|
449
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
450
|
+
url: '/api/v1/partner/v1/customers/{customerId}/buy/quote',
|
|
451
|
+
...options,
|
|
452
|
+
headers: {
|
|
453
|
+
'Content-Type': 'application/json',
|
|
454
|
+
...options.headers
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Execute a buy from the customer's fiat balance
|
|
460
|
+
*/
|
|
461
|
+
buy(options) {
|
|
462
|
+
return (options.client ?? this.client).post({
|
|
463
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
464
|
+
url: '/api/v1/partner/v1/customers/{customerId}/buy/execute',
|
|
465
|
+
...options,
|
|
466
|
+
headers: {
|
|
467
|
+
'Content-Type': 'application/json',
|
|
468
|
+
...options.headers
|
|
469
|
+
}
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* Networks the customer can sell USDT on
|
|
474
|
+
*/
|
|
475
|
+
sellNetworks(options) {
|
|
476
|
+
return (options.client ?? this.client).get({
|
|
477
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
478
|
+
url: '/api/v1/partner/v1/customers/{customerId}/sell/networks',
|
|
479
|
+
...options
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Live USDT rates in the customer's local fiat, for previewing a conversion
|
|
484
|
+
*
|
|
485
|
+
* Does not lock a rate -- checkout still goes through the quote routes.
|
|
486
|
+
*/
|
|
487
|
+
rate(options) {
|
|
488
|
+
return (options.client ?? this.client).get({
|
|
489
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
490
|
+
url: '/api/v1/partner/v1/customers/{customerId}/rate',
|
|
491
|
+
...options
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Price a sell (USDT -> fiat) against the customer's USDT balance
|
|
496
|
+
*/
|
|
497
|
+
sellQuote(options) {
|
|
498
|
+
return (options.client ?? this.client).post({
|
|
499
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
500
|
+
url: '/api/v1/partner/v1/customers/{customerId}/sell/quote',
|
|
501
|
+
...options,
|
|
502
|
+
headers: {
|
|
503
|
+
'Content-Type': 'application/json',
|
|
504
|
+
...options.headers
|
|
505
|
+
}
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* Execute a sell from the customer's USDT balance
|
|
510
|
+
*/
|
|
511
|
+
sell(options) {
|
|
512
|
+
return (options.client ?? this.client).post({
|
|
513
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
514
|
+
url: '/api/v1/partner/v1/customers/{customerId}/sell/execute',
|
|
515
|
+
...options,
|
|
516
|
+
headers: {
|
|
517
|
+
'Content-Type': 'application/json',
|
|
518
|
+
...options.headers
|
|
519
|
+
}
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
exports.Ramp = Ramp;
|
|
524
|
+
class Bank extends HeyApiClient {
|
|
525
|
+
/**
|
|
526
|
+
* Banks for the given (or the customer's own) country/currency
|
|
527
|
+
*/
|
|
528
|
+
banks(options) {
|
|
529
|
+
return (options.client ?? this.client).get({
|
|
530
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
531
|
+
url: '/api/v1/partner/v1/customers/{customerId}/banks',
|
|
532
|
+
...options
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Resolve an account number to its account name
|
|
537
|
+
*/
|
|
538
|
+
verifyAccount(options) {
|
|
539
|
+
return (options.client ?? this.client).post({
|
|
540
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
541
|
+
url: '/api/v1/partner/v1/customers/{customerId}/bank/verify-account',
|
|
542
|
+
...options,
|
|
543
|
+
headers: {
|
|
544
|
+
'Content-Type': 'application/json',
|
|
545
|
+
...options.headers
|
|
546
|
+
}
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* List the customer's linked payout accounts, default first
|
|
551
|
+
*/
|
|
552
|
+
getAccounts(options) {
|
|
553
|
+
return (options.client ?? this.client).get({
|
|
554
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
555
|
+
url: '/api/v1/partner/v1/customers/{customerId}/accounts',
|
|
556
|
+
...options
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* Link a payout bank account to the customer
|
|
561
|
+
*/
|
|
562
|
+
addAccount(options) {
|
|
563
|
+
return (options.client ?? this.client).post({
|
|
564
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
565
|
+
url: '/api/v1/partner/v1/customers/{customerId}/accounts',
|
|
566
|
+
...options,
|
|
567
|
+
headers: {
|
|
568
|
+
'Content-Type': 'application/json',
|
|
569
|
+
...options.headers
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Make a linked account the customer's default payout destination
|
|
575
|
+
*/
|
|
576
|
+
setDefaultAccount(options) {
|
|
577
|
+
return (options.client ?? this.client).patch({
|
|
578
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
579
|
+
url: '/api/v1/partner/v1/customers/{customerId}/accounts/{accountId}/default',
|
|
580
|
+
...options
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* Remove a customer's linked payout account
|
|
585
|
+
*/
|
|
586
|
+
deleteAccount(options) {
|
|
587
|
+
return (options.client ?? this.client).delete({
|
|
588
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
589
|
+
url: '/api/v1/partner/v1/customers/{customerId}/accounts/{accountId}',
|
|
590
|
+
...options
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
exports.Bank = Bank;
|
|
595
|
+
class Receiving extends HeyApiClient {
|
|
596
|
+
/**
|
|
597
|
+
* Foreign currencies the customer can be paid in
|
|
598
|
+
*/
|
|
599
|
+
currencies(options) {
|
|
600
|
+
return (options.client ?? this.client).get({
|
|
601
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
602
|
+
url: '/api/v1/partner/v1/customers/{customerId}/receiving-accounts/currencies',
|
|
603
|
+
...options
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* Every foreign-currency account the customer holds
|
|
608
|
+
*/
|
|
609
|
+
list(options) {
|
|
610
|
+
return (options.client ?? this.client).get({
|
|
611
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
612
|
+
url: '/api/v1/partner/v1/customers/{customerId}/receiving-accounts',
|
|
613
|
+
...options
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* Payments seen on the customer's receiving accounts, including ones still in flight
|
|
618
|
+
*/
|
|
619
|
+
activity(options) {
|
|
620
|
+
return (options.client ?? this.client).get({
|
|
621
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
622
|
+
url: '/api/v1/partner/v1/customers/{customerId}/receiving-accounts/activity',
|
|
623
|
+
...options
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* Open (or return) the customer's account for one currency
|
|
628
|
+
*
|
|
629
|
+
* Idempotent per currency -- calling twice returns the same account rather than opening a second one.
|
|
630
|
+
*/
|
|
631
|
+
open(options) {
|
|
632
|
+
return (options.client ?? this.client).post({
|
|
633
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
634
|
+
url: '/api/v1/partner/v1/customers/{customerId}/receiving-accounts/{currency}',
|
|
635
|
+
...options
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Re-read one of the customer's accounts from the partner
|
|
640
|
+
*
|
|
641
|
+
* An account is often issued pending and activated shortly after, and nothing pushes a notification for that transition.
|
|
642
|
+
*/
|
|
643
|
+
refresh(options) {
|
|
644
|
+
return (options.client ?? this.client).post({
|
|
645
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
646
|
+
url: '/api/v1/partner/v1/customers/{customerId}/receiving-accounts/{currency}/refresh',
|
|
647
|
+
...options
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
exports.Receiving = Receiving;
|
|
652
|
+
class Countries extends HeyApiClient {
|
|
653
|
+
/**
|
|
654
|
+
* Countries currently enabled for onboarding
|
|
655
|
+
*/
|
|
656
|
+
list(options) {
|
|
657
|
+
return (options?.client ?? this.client).get({
|
|
658
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
659
|
+
url: '/api/v1/partner/v1/countries',
|
|
660
|
+
...options
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
exports.Countries = Countries;
|
|
665
|
+
class Features extends HeyApiClient {
|
|
666
|
+
/**
|
|
667
|
+
* Every switchable capability and its current state
|
|
668
|
+
*/
|
|
669
|
+
list(options) {
|
|
670
|
+
return (options?.client ?? this.client).get({
|
|
671
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
672
|
+
url: '/api/v1/partner/v1/features',
|
|
673
|
+
...options
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
exports.Features = Features;
|
|
678
|
+
class Webhook extends HeyApiClient {
|
|
679
|
+
/**
|
|
680
|
+
* Your current webhook URL and whether a secret is set
|
|
681
|
+
*/
|
|
682
|
+
config(options) {
|
|
683
|
+
return (options?.client ?? this.client).get({
|
|
684
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
685
|
+
url: '/api/v1/partner/v1/webhook',
|
|
686
|
+
...options
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* Set your webhook URL and receive a new signing secret
|
|
691
|
+
*
|
|
692
|
+
* Validates the URL, mints a fresh secret (the old one stops working), stores it encrypted, and immediately POSTs a signed `webhook.test` event to the URL. The secret is returned here and nowhere else.
|
|
693
|
+
*/
|
|
694
|
+
setUrl(options) {
|
|
695
|
+
return (options.client ?? this.client).put({
|
|
696
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
697
|
+
url: '/api/v1/partner/v1/webhook',
|
|
698
|
+
...options,
|
|
699
|
+
headers: {
|
|
700
|
+
'Content-Type': 'application/json',
|
|
701
|
+
...options.headers
|
|
702
|
+
}
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* Rotate the signing secret
|
|
707
|
+
*
|
|
708
|
+
* The previous secret stops working immediately; queued deliveries are signed with the new one. A `webhook.test` ping is sent, as on PUT.
|
|
709
|
+
*/
|
|
710
|
+
rotateSecret(options) {
|
|
711
|
+
return (options?.client ?? this.client).post({
|
|
712
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
713
|
+
url: '/api/v1/partner/v1/webhook/rotate-secret',
|
|
714
|
+
...options
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
/**
|
|
718
|
+
* Your delivery log, newest first
|
|
719
|
+
*/
|
|
720
|
+
deliveries(options) {
|
|
721
|
+
return (options?.client ?? this.client).get({
|
|
722
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
723
|
+
url: '/api/v1/partner/v1/webhook/deliveries',
|
|
724
|
+
...options
|
|
725
|
+
});
|
|
726
|
+
}
|
|
727
|
+
/**
|
|
728
|
+
* One delivery, including the payload that was sent
|
|
729
|
+
*/
|
|
730
|
+
delivery(options) {
|
|
731
|
+
return (options.client ?? this.client).get({
|
|
732
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
733
|
+
url: '/api/v1/partner/v1/webhook/deliveries/{id}',
|
|
734
|
+
...options
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* Send a delivery again
|
|
739
|
+
*
|
|
740
|
+
* Queues it for immediate re-delivery with the SAME event id, so your handler can recognise it as a duplicate if the original did land.
|
|
741
|
+
*/
|
|
742
|
+
replay(options) {
|
|
743
|
+
return (options.client ?? this.client).post({
|
|
744
|
+
security: [{ name: 'x-api-key', type: 'apiKey' }],
|
|
745
|
+
url: '/api/v1/partner/v1/webhook/deliveries/{id}/replay',
|
|
746
|
+
...options
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
exports.Webhook = Webhook;
|
|
751
|
+
class DutchmanBridge extends HeyApiClient {
|
|
752
|
+
constructor(args) {
|
|
753
|
+
super(args);
|
|
754
|
+
DutchmanBridge.__registry.set(this, args?.key);
|
|
755
|
+
}
|
|
756
|
+
get customers() {
|
|
757
|
+
return this._customers ?? (this._customers = new Customers({ client: this.client }));
|
|
758
|
+
}
|
|
759
|
+
get profile() {
|
|
760
|
+
return this._profile ?? (this._profile = new Profile({ client: this.client }));
|
|
761
|
+
}
|
|
762
|
+
get kyc() {
|
|
763
|
+
return this._kyc ?? (this._kyc = new Kyc({ client: this.client }));
|
|
764
|
+
}
|
|
765
|
+
get wallet() {
|
|
766
|
+
return this._wallet ?? (this._wallet = new Wallet({ client: this.client }));
|
|
767
|
+
}
|
|
768
|
+
get send() {
|
|
769
|
+
return this._send ?? (this._send = new Send({ client: this.client }));
|
|
770
|
+
}
|
|
771
|
+
get globalSend() {
|
|
772
|
+
return this._globalSend ?? (this._globalSend = new GlobalSend({ client: this.client }));
|
|
773
|
+
}
|
|
774
|
+
get ramp() {
|
|
775
|
+
return this._ramp ?? (this._ramp = new Ramp({ client: this.client }));
|
|
776
|
+
}
|
|
777
|
+
get bank() {
|
|
778
|
+
return this._bank ?? (this._bank = new Bank({ client: this.client }));
|
|
779
|
+
}
|
|
780
|
+
get receiving() {
|
|
781
|
+
return this._receiving ?? (this._receiving = new Receiving({ client: this.client }));
|
|
782
|
+
}
|
|
783
|
+
get countries() {
|
|
784
|
+
return this._countries ?? (this._countries = new Countries({ client: this.client }));
|
|
785
|
+
}
|
|
786
|
+
get features() {
|
|
787
|
+
return this._features ?? (this._features = new Features({ client: this.client }));
|
|
788
|
+
}
|
|
789
|
+
get webhook() {
|
|
790
|
+
return this._webhook ?? (this._webhook = new Webhook({ client: this.client }));
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
exports.DutchmanBridge = DutchmanBridge;
|
|
794
|
+
DutchmanBridge.__registry = new HeyApiRegistry();
|