@blindpay/node 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.
Files changed (139) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +124 -0
  3. package/dist/api-client-Cw2mNJeR.d.mts +349 -0
  4. package/dist/api-client-Cw2mNJeR.d.ts +349 -0
  5. package/dist/chunk-2DAKB5XK.mjs +212 -0
  6. package/dist/chunk-3CZJEDS5.mjs +41 -0
  7. package/dist/chunk-CNNEROQ7.mjs +46 -0
  8. package/dist/chunk-ES7RXEM7.mjs +245 -0
  9. package/dist/chunk-GCCHFONX.mjs +17893 -0
  10. package/dist/chunk-GEDDLCJY.mjs +77 -0
  11. package/dist/chunk-GNDAATIJ.mjs +35 -0
  12. package/dist/chunk-HKFAJXJG.mjs +65 -0
  13. package/dist/chunk-LK3JPQ6I.mjs +49 -0
  14. package/dist/chunk-LLWEHHKB.mjs +47 -0
  15. package/dist/chunk-LUDGZPXY.mjs +51 -0
  16. package/dist/chunk-M6IYYMRW.mjs +35 -0
  17. package/dist/chunk-OBKEW4AQ.mjs +91 -0
  18. package/dist/chunk-QHMIK7U3.mjs +24 -0
  19. package/dist/chunk-QVOSGLUO.mjs +36 -0
  20. package/dist/chunk-UCAW3RTZ.mjs +47 -0
  21. package/dist/chunk-VKN2AMCW.mjs +57 -0
  22. package/dist/index.d.mts +81 -0
  23. package/dist/index.d.ts +81 -0
  24. package/dist/index.js +895 -0
  25. package/dist/index.mjs +95 -0
  26. package/dist/magic-string.es-6D2DRE4K.mjs +1325 -0
  27. package/dist/resources/api-keys/api-keys.test.d.mts +2 -0
  28. package/dist/resources/api-keys/api-keys.test.d.ts +2 -0
  29. package/dist/resources/api-keys/api-keys.test.js +19881 -0
  30. package/dist/resources/api-keys/api-keys.test.mjs +130 -0
  31. package/dist/resources/api-keys/index.d.mts +45 -0
  32. package/dist/resources/api-keys/index.d.ts +45 -0
  33. package/dist/resources/api-keys/index.js +64 -0
  34. package/dist/resources/api-keys/index.mjs +9 -0
  35. package/dist/resources/available/available.test.d.mts +2 -0
  36. package/dist/resources/available/available.test.d.ts +2 -0
  37. package/dist/resources/available/available.test.js +19877 -0
  38. package/dist/resources/available/available.test.mjs +122 -0
  39. package/dist/resources/available/index.d.mts +25 -0
  40. package/dist/resources/available/index.d.ts +25 -0
  41. package/dist/resources/available/index.js +39 -0
  42. package/dist/resources/available/index.mjs +9 -0
  43. package/dist/resources/bank-accounts/bank-accounts.test.d.mts +2 -0
  44. package/dist/resources/bank-accounts/bank-accounts.test.d.ts +2 -0
  45. package/dist/resources/bank-accounts/bank-accounts.test.js +20173 -0
  46. package/dist/resources/bank-accounts/bank-accounts.test.mjs +418 -0
  47. package/dist/resources/bank-accounts/index.d.mts +414 -0
  48. package/dist/resources/bank-accounts/index.d.ts +414 -0
  49. package/dist/resources/bank-accounts/index.js +227 -0
  50. package/dist/resources/bank-accounts/index.mjs +9 -0
  51. package/dist/resources/instances/index.d.mts +42 -0
  52. package/dist/resources/instances/index.d.ts +42 -0
  53. package/dist/resources/instances/index.js +75 -0
  54. package/dist/resources/instances/index.mjs +9 -0
  55. package/dist/resources/instances/instances.test.d.mts +2 -0
  56. package/dist/resources/instances/instances.test.d.ts +2 -0
  57. package/dist/resources/instances/instances.test.js +19873 -0
  58. package/dist/resources/instances/instances.test.mjs +118 -0
  59. package/dist/resources/partner-fees/index.d.mts +65 -0
  60. package/dist/resources/partner-fees/index.d.ts +65 -0
  61. package/dist/resources/partner-fees/index.js +69 -0
  62. package/dist/resources/partner-fees/index.mjs +9 -0
  63. package/dist/resources/partner-fees/partner-fees.test.d.mts +2 -0
  64. package/dist/resources/partner-fees/partner-fees.test.d.ts +2 -0
  65. package/dist/resources/partner-fees/partner-fees.test.js +19889 -0
  66. package/dist/resources/partner-fees/partner-fees.test.mjs +134 -0
  67. package/dist/resources/payins/index.d.mts +200 -0
  68. package/dist/resources/payins/index.d.ts +200 -0
  69. package/dist/resources/payins/index.js +75 -0
  70. package/dist/resources/payins/index.mjs +9 -0
  71. package/dist/resources/payins/payins-quotes.test.d.mts +2 -0
  72. package/dist/resources/payins/payins-quotes.test.d.ts +2 -0
  73. package/dist/resources/payins/payins-quotes.test.js +19852 -0
  74. package/dist/resources/payins/payins-quotes.test.mjs +97 -0
  75. package/dist/resources/payins/payins.test.d.mts +2 -0
  76. package/dist/resources/payins/payins.test.d.ts +2 -0
  77. package/dist/resources/payins/payins.test.js +20268 -0
  78. package/dist/resources/payins/payins.test.mjs +513 -0
  79. package/dist/resources/payins/quotes.d.mts +45 -0
  80. package/dist/resources/payins/quotes.d.ts +45 -0
  81. package/dist/resources/payins/quotes.js +63 -0
  82. package/dist/resources/payins/quotes.mjs +9 -0
  83. package/dist/resources/payouts/index.d.mts +155 -0
  84. package/dist/resources/payouts/index.d.ts +155 -0
  85. package/dist/resources/payouts/index.js +93 -0
  86. package/dist/resources/payouts/index.mjs +9 -0
  87. package/dist/resources/payouts/payouts.test.d.mts +2 -0
  88. package/dist/resources/payouts/payouts.test.d.ts +2 -0
  89. package/dist/resources/payouts/payouts.test.js +20346 -0
  90. package/dist/resources/payouts/payouts.test.mjs +591 -0
  91. package/dist/resources/quotes/index.d.mts +59 -0
  92. package/dist/resources/quotes/index.d.ts +59 -0
  93. package/dist/resources/quotes/index.js +63 -0
  94. package/dist/resources/quotes/index.mjs +9 -0
  95. package/dist/resources/quotes/quotes.test.d.mts +2 -0
  96. package/dist/resources/quotes/quotes.test.d.ts +2 -0
  97. package/dist/resources/quotes/quotes.test.js +19866 -0
  98. package/dist/resources/quotes/quotes.test.mjs +111 -0
  99. package/dist/resources/receivers/index.d.mts +205 -0
  100. package/dist/resources/receivers/index.d.ts +205 -0
  101. package/dist/resources/receivers/index.js +85 -0
  102. package/dist/resources/receivers/index.mjs +9 -0
  103. package/dist/resources/receivers/receivers.test.d.mts +2 -0
  104. package/dist/resources/receivers/receivers.test.d.ts +2 -0
  105. package/dist/resources/receivers/receivers.test.js +20145 -0
  106. package/dist/resources/receivers/receivers.test.mjs +390 -0
  107. package/dist/resources/virtual-accounts/index.d.mts +58 -0
  108. package/dist/resources/virtual-accounts/index.d.ts +58 -0
  109. package/dist/resources/virtual-accounts/index.js +79 -0
  110. package/dist/resources/virtual-accounts/index.mjs +9 -0
  111. package/dist/resources/virtual-accounts/virtual-accounts.test.d.mts +2 -0
  112. package/dist/resources/virtual-accounts/virtual-accounts.test.d.ts +2 -0
  113. package/dist/resources/virtual-accounts/virtual-accounts.test.js +19902 -0
  114. package/dist/resources/virtual-accounts/virtual-accounts.test.mjs +147 -0
  115. package/dist/resources/wallets/blockchain.d.mts +83 -0
  116. package/dist/resources/wallets/blockchain.d.ts +83 -0
  117. package/dist/resources/wallets/blockchain.js +105 -0
  118. package/dist/resources/wallets/blockchain.mjs +9 -0
  119. package/dist/resources/wallets/blockchain.test.d.mts +2 -0
  120. package/dist/resources/wallets/blockchain.test.d.ts +2 -0
  121. package/dist/resources/wallets/blockchain.test.js +19897 -0
  122. package/dist/resources/wallets/blockchain.test.mjs +142 -0
  123. package/dist/resources/wallets/offramp.d.mts +46 -0
  124. package/dist/resources/wallets/offramp.d.ts +46 -0
  125. package/dist/resources/wallets/offramp.js +77 -0
  126. package/dist/resources/wallets/offramp.mjs +9 -0
  127. package/dist/resources/wallets/offramp.test.d.mts +2 -0
  128. package/dist/resources/wallets/offramp.test.d.ts +2 -0
  129. package/dist/resources/wallets/offramp.test.js +19872 -0
  130. package/dist/resources/wallets/offramp.test.mjs +117 -0
  131. package/dist/resources/webhooks/index.d.mts +49 -0
  132. package/dist/resources/webhooks/index.d.ts +49 -0
  133. package/dist/resources/webhooks/index.js +74 -0
  134. package/dist/resources/webhooks/index.mjs +9 -0
  135. package/dist/resources/webhooks/webhooks.test.d.mts +2 -0
  136. package/dist/resources/webhooks/webhooks.test.d.ts +2 -0
  137. package/dist/resources/webhooks/webhooks.test.js +19878 -0
  138. package/dist/resources/webhooks/webhooks.test.mjs +123 -0
  139. package/package.json +65 -0
package/dist/index.js ADDED
@@ -0,0 +1,895 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols)
16
+ for (var prop of __getOwnPropSymbols(b)) {
17
+ if (__propIsEnum.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23
+ var __objRest = (source, exclude) => {
24
+ var target = {};
25
+ for (var prop in source)
26
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
27
+ target[prop] = source[prop];
28
+ if (source != null && __getOwnPropSymbols)
29
+ for (var prop of __getOwnPropSymbols(source)) {
30
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
31
+ target[prop] = source[prop];
32
+ }
33
+ return target;
34
+ };
35
+ var __export = (target, all) => {
36
+ for (var name in all)
37
+ __defProp(target, name, { get: all[name], enumerable: true });
38
+ };
39
+ var __copyProps = (to, from, except, desc) => {
40
+ if (from && typeof from === "object" || typeof from === "function") {
41
+ for (let key of __getOwnPropNames(from))
42
+ if (!__hasOwnProp.call(to, key) && key !== except)
43
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
44
+ }
45
+ return to;
46
+ };
47
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
48
+ var __async = (__this, __arguments, generator) => {
49
+ return new Promise((resolve, reject) => {
50
+ var fulfilled = (value) => {
51
+ try {
52
+ step(generator.next(value));
53
+ } catch (e) {
54
+ reject(e);
55
+ }
56
+ };
57
+ var rejected = (value) => {
58
+ try {
59
+ step(generator.throw(value));
60
+ } catch (e) {
61
+ reject(e);
62
+ }
63
+ };
64
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
65
+ step((generator = generator.apply(__this, __arguments)).next());
66
+ });
67
+ };
68
+
69
+ // src/index.ts
70
+ var index_exports = {};
71
+ __export(index_exports, {
72
+ Blindpay: () => Blindpay,
73
+ createApiKeysResource: () => createApiKeysResource,
74
+ createAvailableResource: () => createAvailableResource,
75
+ createBankAccountsResource: () => createBankAccountsResource,
76
+ createBlockchainWalletsResource: () => createBlockchainWalletsResource,
77
+ createInstancesResource: () => createInstancesResource,
78
+ createOfframpWalletsResource: () => createOfframpWalletsResource,
79
+ createPartnerFeesResource: () => createPartnerFeesResource,
80
+ createPayinQuotesResource: () => createPayinQuotesResource,
81
+ createPayinsResource: () => createPayinsResource,
82
+ createPayoutsResource: () => createPayoutsResource,
83
+ createQuotesResource: () => createQuotesResource,
84
+ createReceiversResource: () => createReceiversResource,
85
+ createVirtualAccountsResource: () => createVirtualAccountsResource,
86
+ createWebhookEndpointsResource: () => createWebhookEndpointsResource
87
+ });
88
+ module.exports = __toCommonJS(index_exports);
89
+
90
+ // src/client.ts
91
+ var import_node_crypto = require("crypto");
92
+
93
+ // package.json
94
+ var version = "1.0.0";
95
+
96
+ // src/internal/blindpay-error.ts
97
+ var BlindpayError = class extends Error {
98
+ constructor(message) {
99
+ super(message);
100
+ this.name = "BlindpayError";
101
+ }
102
+ };
103
+
104
+ // src/resources/api-keys/index.ts
105
+ function createApiKeysResource(client) {
106
+ return {
107
+ list({ instanceId }) {
108
+ return client.get(`/instances/${instanceId}/api-keys`);
109
+ },
110
+ create(_a) {
111
+ var _b = _a, {
112
+ instanceId
113
+ } = _b, data = __objRest(_b, [
114
+ "instanceId"
115
+ ]);
116
+ return client.post(`/instances/${instanceId}/api-keys`, data);
117
+ },
118
+ get({ instanceId, id }) {
119
+ return client.get(`/instances/${instanceId}/api_keys/${id}`);
120
+ },
121
+ delete({ instanceId, id }) {
122
+ return client.delete(`/instances/${instanceId}/api-keys/${id}`);
123
+ }
124
+ };
125
+ }
126
+
127
+ // src/resources/available/index.ts
128
+ function createAvailableResource(client) {
129
+ return {
130
+ getBankDetails(rail) {
131
+ return client.get(`/available/bank-details?rail=${rail}`);
132
+ },
133
+ getRails() {
134
+ return client.get("/available/rails");
135
+ }
136
+ };
137
+ }
138
+
139
+ // src/resources/bank-accounts/index.ts
140
+ function createBankAccountsResource(client) {
141
+ return {
142
+ list({
143
+ instanceId,
144
+ receiverId
145
+ }) {
146
+ return client.get(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`);
147
+ },
148
+ createPix({
149
+ instanceId,
150
+ receiverId,
151
+ name,
152
+ pix_key
153
+ }) {
154
+ return client.post(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`, {
155
+ type: "pix",
156
+ name,
157
+ pix_key
158
+ });
159
+ },
160
+ createArgentinaTransfers({
161
+ instanceId,
162
+ receiverId,
163
+ beneficiary_name,
164
+ name,
165
+ transfers_account,
166
+ transfers_type
167
+ }) {
168
+ return client.post(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`, {
169
+ type: "transfers_bitso",
170
+ beneficiary_name,
171
+ name,
172
+ transfers_account,
173
+ transfers_type
174
+ });
175
+ },
176
+ createSpei({
177
+ instanceId,
178
+ receiverId,
179
+ beneficiary_name,
180
+ name,
181
+ spei_clabe,
182
+ spei_institution_code,
183
+ spei_protocol
184
+ }) {
185
+ return client.post(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`, {
186
+ type: "spei_bitso",
187
+ beneficiary_name,
188
+ name,
189
+ spei_clabe,
190
+ spei_institution_code,
191
+ spei_protocol
192
+ });
193
+ },
194
+ createColombiaAch({
195
+ instanceId,
196
+ receiverId,
197
+ name,
198
+ account_type,
199
+ ach_cop_beneficiary_first_name,
200
+ ach_cop_beneficiary_last_name,
201
+ ach_cop_document_id,
202
+ ach_cop_document_type,
203
+ ach_cop_email,
204
+ ach_cop_bank_code,
205
+ ach_cop_bank_account
206
+ }) {
207
+ return client.post(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`, {
208
+ type: "ach_cop_bitso",
209
+ name,
210
+ account_type,
211
+ ach_cop_beneficiary_first_name,
212
+ ach_cop_beneficiary_last_name,
213
+ ach_cop_document_id,
214
+ ach_cop_document_type,
215
+ ach_cop_email,
216
+ ach_cop_bank_code,
217
+ ach_cop_bank_account
218
+ });
219
+ },
220
+ createAch({
221
+ instanceId,
222
+ receiverId,
223
+ name,
224
+ account_class,
225
+ account_number,
226
+ account_type,
227
+ beneficiary_name,
228
+ routing_number
229
+ }) {
230
+ return client.post(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`, {
231
+ type: "ach",
232
+ name,
233
+ account_class,
234
+ account_number,
235
+ account_type,
236
+ beneficiary_name,
237
+ routing_number
238
+ });
239
+ },
240
+ createWire({
241
+ instanceId,
242
+ receiverId,
243
+ name,
244
+ account_number,
245
+ beneficiary_name,
246
+ routing_number,
247
+ address_line_1,
248
+ address_line_2,
249
+ city,
250
+ state_province_region,
251
+ country,
252
+ postal_code
253
+ }) {
254
+ return client.post(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`, {
255
+ type: "wire",
256
+ name,
257
+ account_number,
258
+ beneficiary_name,
259
+ routing_number,
260
+ address_line_1,
261
+ address_line_2,
262
+ city,
263
+ state_province_region,
264
+ country,
265
+ postal_code
266
+ });
267
+ },
268
+ createInternationalSwift({
269
+ instanceId,
270
+ receiverId,
271
+ name,
272
+ swift_account_holder_name,
273
+ swift_account_number_iban,
274
+ swift_bank_address_line_1,
275
+ swift_bank_address_line_2,
276
+ swift_bank_city,
277
+ swift_bank_country,
278
+ swift_bank_name,
279
+ swift_bank_postal_code,
280
+ swift_bank_state_province_region,
281
+ swift_beneficiary_address_line_1,
282
+ swift_beneficiary_address_line_2,
283
+ swift_beneficiary_city,
284
+ swift_beneficiary_country,
285
+ swift_beneficiary_postal_code,
286
+ swift_beneficiary_state_province_region,
287
+ swift_code_bic,
288
+ swift_intermediary_bank_account_number_iban,
289
+ swift_intermediary_bank_country,
290
+ swift_intermediary_bank_name,
291
+ swift_intermediary_bank_swift_code_bic
292
+ }) {
293
+ return client.post(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`, {
294
+ type: "international_swift",
295
+ name,
296
+ swift_account_holder_name,
297
+ swift_account_number_iban,
298
+ swift_bank_address_line_1,
299
+ swift_bank_address_line_2,
300
+ swift_bank_city,
301
+ swift_bank_country,
302
+ swift_bank_name,
303
+ swift_bank_postal_code,
304
+ swift_bank_state_province_region,
305
+ swift_beneficiary_address_line_1,
306
+ swift_beneficiary_address_line_2,
307
+ swift_beneficiary_city,
308
+ swift_beneficiary_country,
309
+ swift_beneficiary_postal_code,
310
+ swift_beneficiary_state_province_region,
311
+ swift_code_bic,
312
+ swift_intermediary_bank_account_number_iban,
313
+ swift_intermediary_bank_country,
314
+ swift_intermediary_bank_name,
315
+ swift_intermediary_bank_swift_code_bic
316
+ });
317
+ },
318
+ get({
319
+ instanceId,
320
+ receiverId,
321
+ id
322
+ }) {
323
+ return client.get(
324
+ `/instances/${instanceId}/receivers/${receiverId}/bank-accounts/${id}`
325
+ );
326
+ },
327
+ delete({
328
+ instanceId,
329
+ receiverId,
330
+ id
331
+ }) {
332
+ return client.delete(
333
+ `/instances/${instanceId}/receivers/${receiverId}/bank-accounts/${id}`
334
+ );
335
+ }
336
+ };
337
+ }
338
+
339
+ // src/resources/instances/index.ts
340
+ function createInstancesResource(client) {
341
+ return {
342
+ getMembers({
343
+ instanceId
344
+ }) {
345
+ return client.get(`/instances/${instanceId}/members`);
346
+ },
347
+ update(_a) {
348
+ var _b = _a, { instanceId } = _b, data = __objRest(_b, ["instanceId"]);
349
+ return client.put(`/instances/${instanceId}`, data);
350
+ },
351
+ delete({ instanceId }) {
352
+ return client.delete(`/instances/${instanceId}`);
353
+ },
354
+ deleteMember({
355
+ instanceId,
356
+ id
357
+ }) {
358
+ return client.delete(`/instances/${instanceId}/members/${id}`);
359
+ },
360
+ updateMemberRole(_c) {
361
+ var _d = _c, {
362
+ instanceId,
363
+ id
364
+ } = _d, data = __objRest(_d, [
365
+ "instanceId",
366
+ "id"
367
+ ]);
368
+ return client.put(`/instances/${instanceId}/members/${id}`, data);
369
+ }
370
+ };
371
+ }
372
+
373
+ // src/resources/partner-fees/index.ts
374
+ function createPartnerFeesResource(client) {
375
+ return {
376
+ list({
377
+ instanceId
378
+ }) {
379
+ return client.get(`/instances/${instanceId}/partner-fees`);
380
+ },
381
+ create(_a) {
382
+ var _b = _a, {
383
+ instanceId
384
+ } = _b, data = __objRest(_b, [
385
+ "instanceId"
386
+ ]);
387
+ return client.post(`/instances/${instanceId}/partner-fees`, data);
388
+ },
389
+ get({
390
+ instanceId,
391
+ id
392
+ }) {
393
+ return client.get(`/instances/${instanceId}/partner-fees/${id}`);
394
+ },
395
+ delete({ instanceId, id }) {
396
+ return client.delete(`/instances/${instanceId}/partner-fees/${id}`);
397
+ }
398
+ };
399
+ }
400
+
401
+ // src/resources/payins/index.ts
402
+ function createPayinsResource(client) {
403
+ return {
404
+ list({
405
+ instanceId,
406
+ params
407
+ }) {
408
+ const queryParams = params ? `?${new URLSearchParams(params)}` : "";
409
+ return client.get(`/instances/${instanceId}/payins${queryParams}`);
410
+ },
411
+ get({ instanceId, id }) {
412
+ return client.get(`/instances/${instanceId}/payins/${id}`);
413
+ },
414
+ getTrack({ id }) {
415
+ return client.get(`/e/payins/${id}`);
416
+ },
417
+ export({
418
+ instanceId,
419
+ params
420
+ }) {
421
+ const queryParams = params ? `?${new URLSearchParams(params)}` : "";
422
+ return client.get(`/instances/${instanceId}/export/payins${queryParams}`);
423
+ },
424
+ createEvm(_a) {
425
+ var _b = _a, {
426
+ instanceId
427
+ } = _b, data = __objRest(_b, [
428
+ "instanceId"
429
+ ]);
430
+ return client.post(`/instances/${instanceId}/payins/evm`, data);
431
+ }
432
+ };
433
+ }
434
+
435
+ // src/resources/payins/quotes.ts
436
+ function createPayinQuotesResource(client) {
437
+ return {
438
+ create(_a) {
439
+ var _b = _a, {
440
+ instanceId
441
+ } = _b, data = __objRest(_b, [
442
+ "instanceId"
443
+ ]);
444
+ return client.post(`/instances/${instanceId}/payin-quotes`, data);
445
+ },
446
+ getFxRate(_c) {
447
+ var _d = _c, {
448
+ instanceId
449
+ } = _d, data = __objRest(_d, [
450
+ "instanceId"
451
+ ]);
452
+ return client.post(`/instances/${instanceId}/payin-quotes/fx`, data);
453
+ }
454
+ };
455
+ }
456
+
457
+ // src/resources/payouts/index.ts
458
+ function createPayoutsResource(client) {
459
+ return {
460
+ list({
461
+ instanceId,
462
+ params
463
+ }) {
464
+ const queryParams = params ? `?${new URLSearchParams(params)}` : "";
465
+ return client.get(`/instances/${instanceId}/payouts${queryParams}`);
466
+ },
467
+ export({
468
+ instanceId,
469
+ params
470
+ }) {
471
+ const queryParams = params ? `?${new URLSearchParams(params)}` : "";
472
+ return client.get(`/instances/${instanceId}/export/payouts${queryParams}`);
473
+ },
474
+ get({ instanceId, id }) {
475
+ return client.get(`/instances/${instanceId}/payouts/${id}`);
476
+ },
477
+ getTrack({
478
+ id
479
+ }) {
480
+ return client.get(`/e/payouts/${id}`);
481
+ },
482
+ authorizeStellarToken(_a) {
483
+ var _b = _a, {
484
+ instanceId
485
+ } = _b, data = __objRest(_b, [
486
+ "instanceId"
487
+ ]);
488
+ return client.post(`/instances/${instanceId}/payouts/stellar/authorize`, data);
489
+ },
490
+ createStellar(_c) {
491
+ var _d = _c, {
492
+ instanceId
493
+ } = _d, data = __objRest(_d, [
494
+ "instanceId"
495
+ ]);
496
+ return client.post(`/instances/${instanceId}/payouts/stellar`, data);
497
+ },
498
+ createEvm(_e) {
499
+ var _f = _e, {
500
+ instanceId
501
+ } = _f, data = __objRest(_f, [
502
+ "instanceId"
503
+ ]);
504
+ return client.post(`/instances/${instanceId}/payouts/evm`, data);
505
+ }
506
+ };
507
+ }
508
+
509
+ // src/resources/quotes/index.ts
510
+ function createQuotesResource(client) {
511
+ return {
512
+ create(_a) {
513
+ var _b = _a, {
514
+ instanceId
515
+ } = _b, data = __objRest(_b, [
516
+ "instanceId"
517
+ ]);
518
+ return client.post(`/instances/${instanceId}/quotes`, data);
519
+ },
520
+ getFxRate(_c) {
521
+ var _d = _c, {
522
+ instanceId
523
+ } = _d, data = __objRest(_d, [
524
+ "instanceId"
525
+ ]);
526
+ return client.post(`/instances/${instanceId}/quotes/fx`, data);
527
+ }
528
+ };
529
+ }
530
+
531
+ // src/resources/receivers/index.ts
532
+ function createReceiversResource(client) {
533
+ return {
534
+ list({
535
+ instanceId
536
+ }) {
537
+ return client.get(`/instances/${instanceId}/receivers`);
538
+ },
539
+ create(_a) {
540
+ var _b = _a, {
541
+ instanceId
542
+ } = _b, data = __objRest(_b, [
543
+ "instanceId"
544
+ ]);
545
+ return client.post(`/instances/${instanceId}/receivers`, data);
546
+ },
547
+ get({
548
+ instanceId,
549
+ id
550
+ }) {
551
+ return client.get(`/instances/${instanceId}/receivers/${id}`);
552
+ },
553
+ update(_c) {
554
+ var _d = _c, {
555
+ instanceId,
556
+ id
557
+ } = _d, data = __objRest(_d, [
558
+ "instanceId",
559
+ "id"
560
+ ]);
561
+ return client.patch(`/instances/${instanceId}/receivers/${id}`, data);
562
+ },
563
+ delete({ instanceId, id }) {
564
+ return client.delete(`/instances/${instanceId}/receivers/${id}`);
565
+ },
566
+ getLimits({
567
+ instanceId,
568
+ id
569
+ }) {
570
+ return client.get(`/instances/${instanceId}/limits/receivers/${id}`);
571
+ }
572
+ };
573
+ }
574
+
575
+ // src/resources/virtual-accounts/index.ts
576
+ function createVirtualAccountsResource(client) {
577
+ return {
578
+ update(_a) {
579
+ var _b = _a, {
580
+ instanceId,
581
+ receiverId
582
+ } = _b, data = __objRest(_b, [
583
+ "instanceId",
584
+ "receiverId"
585
+ ]);
586
+ return client.put(
587
+ `/instances/${instanceId}/receivers/${receiverId}/virtual-accounts`,
588
+ data
589
+ );
590
+ },
591
+ create(_c) {
592
+ var _d = _c, {
593
+ instanceId,
594
+ receiverId
595
+ } = _d, data = __objRest(_d, [
596
+ "instanceId",
597
+ "receiverId"
598
+ ]);
599
+ return client.post(
600
+ `/instances/${instanceId}/receivers/${receiverId}/virtual-accounts`,
601
+ data
602
+ );
603
+ },
604
+ get({
605
+ instanceId,
606
+ receiverId
607
+ }) {
608
+ return client.get(`/instances/${instanceId}/receivers/${receiverId}/virtual-accounts`);
609
+ }
610
+ };
611
+ }
612
+
613
+ // src/resources/wallets/blockchain.ts
614
+ function createBlockchainWalletsResource(client) {
615
+ return {
616
+ list({
617
+ instanceId,
618
+ receiverId
619
+ }) {
620
+ return client.get(
621
+ `/instances/${instanceId}/receivers/${receiverId}/blockchain-wallets`
622
+ );
623
+ },
624
+ create(_a) {
625
+ var _b = _a, {
626
+ instanceId
627
+ } = _b, data = __objRest(_b, [
628
+ "instanceId"
629
+ ]);
630
+ return client.post(`/instances/${instanceId}/blockchain-wallets`, data);
631
+ },
632
+ getWalletMessage({
633
+ receiverId,
634
+ instanceId
635
+ }) {
636
+ return client.get(
637
+ `/instances/${instanceId}/receivers/${receiverId}/blockchain-wallets/sign-message`
638
+ );
639
+ },
640
+ get({
641
+ instanceId,
642
+ receiverId,
643
+ id
644
+ }) {
645
+ return client.get(
646
+ `/instances/${instanceId}/receivers/${receiverId}/blockchain-wallets/${id}`
647
+ );
648
+ },
649
+ delete({
650
+ instanceId,
651
+ receiverId,
652
+ id
653
+ }) {
654
+ return client.delete(
655
+ `/instances/${instanceId}/receivers/${receiverId}/blockchain-wallets/${id}`
656
+ );
657
+ },
658
+ createAssetTrustline(_c) {
659
+ var _d = _c, {
660
+ instanceId
661
+ } = _d, data = __objRest(_d, [
662
+ "instanceId"
663
+ ]);
664
+ return client.post(`/instances/${instanceId}/create-asset-trustline`, data);
665
+ },
666
+ mintUsdbStellar(_e) {
667
+ var _f = _e, {
668
+ instanceId
669
+ } = _f, data = __objRest(_f, [
670
+ "instanceId"
671
+ ]);
672
+ return client.post(`/instances/${instanceId}/mint-usdb-stellar`, data);
673
+ }
674
+ };
675
+ }
676
+
677
+ // src/resources/wallets/offramp.ts
678
+ function createOfframpWalletsResource(client) {
679
+ return {
680
+ list({
681
+ instanceId
682
+ }) {
683
+ return client.get(`/instances/${instanceId}/offramp_wallets`);
684
+ },
685
+ create(_a) {
686
+ var _b = _a, {
687
+ receiverId,
688
+ instanceId,
689
+ bankAccountId
690
+ } = _b, data = __objRest(_b, [
691
+ "receiverId",
692
+ "instanceId",
693
+ "bankAccountId"
694
+ ]);
695
+ return client.post(
696
+ `/instances/${instanceId}/receivers/${receiverId}/bank-accounts/${bankAccountId}/offramp_wallets`,
697
+ data
698
+ );
699
+ },
700
+ get({
701
+ receiverId,
702
+ instanceId,
703
+ bankAccountId,
704
+ id
705
+ }) {
706
+ return client.get(
707
+ `/instances/${instanceId}/receivers/${receiverId}/bank-accounts/${bankAccountId}/offramp_wallets/${id}`
708
+ );
709
+ }
710
+ };
711
+ }
712
+
713
+ // src/resources/webhooks/index.ts
714
+ function createWebhookEndpointsResource(client) {
715
+ return {
716
+ list({
717
+ instanceId
718
+ }) {
719
+ return client.get(`/instances/${instanceId}/webhook-endpoints`);
720
+ },
721
+ create(_a) {
722
+ var _b = _a, {
723
+ instanceId
724
+ } = _b, data = __objRest(_b, [
725
+ "instanceId"
726
+ ]);
727
+ return client.post(`/instances/${instanceId}/webhook-endpoints`, data);
728
+ },
729
+ delete({ instanceId, id }) {
730
+ return client.delete(`/instances/${instanceId}/webhook-endpoints/${id}`);
731
+ },
732
+ getSecret({
733
+ instanceId,
734
+ id
735
+ }) {
736
+ return client.get(`/instances/${instanceId}/webhook-endpoints/${id}/secret`);
737
+ },
738
+ getPortalAccessUrl({
739
+ instanceId
740
+ }) {
741
+ return client.get(`/instances/${instanceId}/webhook-endpoints/portal-access`);
742
+ }
743
+ };
744
+ }
745
+
746
+ // src/client.ts
747
+ var Blindpay = class {
748
+ constructor(apiKey) {
749
+ // Options
750
+ this.baseUrl = "https://api.blindpay.com/v1";
751
+ if (!apiKey) {
752
+ throw new BlindpayError("Api key not provided, get your api key on blindpay dashboard");
753
+ }
754
+ this.apiKey = apiKey;
755
+ this.headers = {
756
+ "Content-Type": "application/json",
757
+ Accept: "application/json",
758
+ "User-Agent": `blindpay-node/${version}`,
759
+ Authorization: `Bearer ${this.apiKey}`
760
+ };
761
+ this.api = {
762
+ get: this.get.bind(this),
763
+ post: this.post.bind(this),
764
+ put: this.put.bind(this),
765
+ patch: this.patch.bind(this),
766
+ delete: this.delete.bind(this)
767
+ };
768
+ this.available = createAvailableResource(this.api);
769
+ this.instances = __spreadProps(__spreadValues({}, createInstancesResource(this.api)), {
770
+ apiKeys: createApiKeysResource(this.api),
771
+ webhookEndpoints: createWebhookEndpointsResource(this.api)
772
+ });
773
+ this.partnerFees = createPartnerFeesResource(this.api);
774
+ this.payins = __spreadProps(__spreadValues({}, createPayinsResource(this.api)), {
775
+ quotes: createPayinQuotesResource(this.api)
776
+ });
777
+ this.quotes = createQuotesResource(this.api);
778
+ this.payouts = createPayoutsResource(this.api);
779
+ this.receivers = __spreadProps(__spreadValues({}, createReceiversResource(this.api)), {
780
+ bankAccounts: createBankAccountsResource(this.api)
781
+ });
782
+ this.virtualAccounts = createVirtualAccountsResource(this.api);
783
+ this.wallets = {
784
+ blockchain: createBlockchainWalletsResource(this.api),
785
+ offramp: createOfframpWalletsResource(this.api)
786
+ };
787
+ }
788
+ request(method, path, body) {
789
+ return __async(this, null, function* () {
790
+ var _a;
791
+ try {
792
+ const response = yield fetch(`${this.baseUrl}${path}`, {
793
+ method,
794
+ headers: this.headers,
795
+ body: body ? JSON.stringify(body) : void 0
796
+ });
797
+ if (!response.ok) {
798
+ const error = yield response.json();
799
+ return {
800
+ data: null,
801
+ error: {
802
+ message: (_a = error == null ? void 0 : error.message) != null ? _a : "Unknown error"
803
+ }
804
+ };
805
+ }
806
+ const data = yield response.json();
807
+ return {
808
+ data,
809
+ error: null
810
+ };
811
+ } catch (error) {
812
+ if (error instanceof Error) {
813
+ return {
814
+ data: null,
815
+ error: {
816
+ message: error.message
817
+ }
818
+ };
819
+ }
820
+ const errorMessage = error && typeof error === "object" && "message" in error && typeof error.message === "string" ? error.message : "Unknown error";
821
+ return {
822
+ data: null,
823
+ error: {
824
+ message: errorMessage
825
+ }
826
+ };
827
+ }
828
+ });
829
+ }
830
+ get(path) {
831
+ return __async(this, null, function* () {
832
+ return this.request("GET", path);
833
+ });
834
+ }
835
+ post(path, body) {
836
+ return __async(this, null, function* () {
837
+ return this.request("POST", path, body);
838
+ });
839
+ }
840
+ put(path, body) {
841
+ return __async(this, null, function* () {
842
+ return this.request("PUT", path, body);
843
+ });
844
+ }
845
+ patch(path, body) {
846
+ return __async(this, null, function* () {
847
+ return this.request("PATCH", path, body);
848
+ });
849
+ }
850
+ delete(path, body) {
851
+ return __async(this, null, function* () {
852
+ return this.request("DELETE", path, body);
853
+ });
854
+ }
855
+ /**
856
+ * Verifies the BlindPay webhook signature
857
+ *
858
+ * @param params.secret The webhook secret from BlindPay dashboard
859
+ * @param params.id The value of the `svix-id` header
860
+ * @param params.timestamp The value of the `svix-timestamp` header
861
+ * @param params.payload The raw request body
862
+ * @param params.svixSignature The value of the `svix-signature` header
863
+ * @returns {boolean} True if the signature is valid, false otherwise
864
+ */
865
+ verifyWebhookSignature({
866
+ secret,
867
+ id,
868
+ timestamp,
869
+ payload,
870
+ svixSignature
871
+ }) {
872
+ const signedContent = `${id}.${timestamp}.${payload}`;
873
+ const secretBytes = Buffer.from(secret.split("_")[1], "base64");
874
+ const expectedSignature = (0, import_node_crypto.createHmac)("sha256", secretBytes).update(signedContent).digest("base64");
875
+ return svixSignature.length === expectedSignature.length && (0, import_node_crypto.timingSafeEqual)(Buffer.from(svixSignature), Buffer.from(expectedSignature));
876
+ }
877
+ };
878
+ // Annotate the CommonJS export names for ESM import in node:
879
+ 0 && (module.exports = {
880
+ Blindpay,
881
+ createApiKeysResource,
882
+ createAvailableResource,
883
+ createBankAccountsResource,
884
+ createBlockchainWalletsResource,
885
+ createInstancesResource,
886
+ createOfframpWalletsResource,
887
+ createPartnerFeesResource,
888
+ createPayinQuotesResource,
889
+ createPayinsResource,
890
+ createPayoutsResource,
891
+ createQuotesResource,
892
+ createReceiversResource,
893
+ createVirtualAccountsResource,
894
+ createWebhookEndpointsResource
895
+ });