@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
@@ -0,0 +1,390 @@
1
+ import {
2
+ afterEach,
3
+ describe,
4
+ globalExpect,
5
+ init_dist,
6
+ it
7
+ } from "../../chunk-GCCHFONX.mjs";
8
+ import {
9
+ Blindpay,
10
+ init_client
11
+ } from "../../chunk-ES7RXEM7.mjs";
12
+ import "../../chunk-GEDDLCJY.mjs";
13
+ import "../../chunk-LK3JPQ6I.mjs";
14
+ import "../../chunk-CNNEROQ7.mjs";
15
+ import "../../chunk-GNDAATIJ.mjs";
16
+ import "../../chunk-VKN2AMCW.mjs";
17
+ import "../../chunk-LUDGZPXY.mjs";
18
+ import "../../chunk-3CZJEDS5.mjs";
19
+ import "../../chunk-UCAW3RTZ.mjs";
20
+ import "../../chunk-M6IYYMRW.mjs";
21
+ import "../../chunk-HKFAJXJG.mjs";
22
+ import "../../chunk-QVOSGLUO.mjs";
23
+ import "../../chunk-2DAKB5XK.mjs";
24
+ import "../../chunk-QHMIK7U3.mjs";
25
+ import "../../chunk-LLWEHHKB.mjs";
26
+ import {
27
+ __async,
28
+ __commonJS
29
+ } from "../../chunk-OBKEW4AQ.mjs";
30
+
31
+ // src/resources/receivers/receivers.test.ts
32
+ var require_receivers_test = __commonJS({
33
+ "src/resources/receivers/receivers.test.ts"(exports) {
34
+ init_dist();
35
+ init_client();
36
+ describe("Receivers", () => {
37
+ afterEach(() => fetchMock.resetMocks());
38
+ const blindpay = new Blindpay("test-key");
39
+ describe("List receivers", () => {
40
+ it("should list receivers", () => __async(null, null, function* () {
41
+ const mockedReceivers = [
42
+ {
43
+ id: "re_000000000000",
44
+ type: "individual",
45
+ kyc_type: "standard",
46
+ kyc_status: "verifying",
47
+ kyc_warnings: [
48
+ {
49
+ code: null,
50
+ message: null,
51
+ resolution_status: null,
52
+ warning_id: null
53
+ }
54
+ ],
55
+ email: "email@example.com",
56
+ tax_id: "536804398",
57
+ address_line_1: "738 Plain St",
58
+ address_line_2: "Building 22",
59
+ city: "Marshfield",
60
+ state_province_region: "MA",
61
+ country: "US",
62
+ postal_code: "02050",
63
+ ip_address: "127.0.0.1",
64
+ image_url: "https://example.com/image.png",
65
+ phone_number: "+1234567890",
66
+ proof_of_address_doc_type: "UTILITY_BILL",
67
+ proof_of_address_doc_file: "https://example.com/image.png",
68
+ first_name: "John",
69
+ last_name: "Doe",
70
+ date_of_birth: "1998-01-01T00:00:00Z",
71
+ id_doc_country: "BR",
72
+ id_doc_type: "PASSPORT",
73
+ id_doc_front_file: "https://example.com/image.png",
74
+ id_doc_back_file: "https://example.com/image.png",
75
+ legal_name: "Company Name Inc.",
76
+ alternate_name: "Company Name Inc.",
77
+ formation_date: "1998-01-01T00:00:00Z",
78
+ website: "https://example.com",
79
+ owners: [
80
+ {
81
+ id: "ub_000000000000",
82
+ first_name: "John",
83
+ last_name: "Doe",
84
+ address_line_1: "738 Plain St",
85
+ address_line_2: "Building 22",
86
+ city: "Marshfield",
87
+ state_province_region: "MA",
88
+ country: "US",
89
+ postal_code: "02050",
90
+ id_doc_country: "BR",
91
+ id_doc_type: "PASSPORT",
92
+ id_doc_front_file: "https://example.com/image.png",
93
+ id_doc_back_file: "https://example.com/image.png"
94
+ }
95
+ ],
96
+ incorporation_doc_file: "https://example.com/image.png",
97
+ proof_of_ownership_doc_file: "https://example.com/image.png",
98
+ source_of_funds_doc_type: "business_income",
99
+ source_of_funds_doc_file: "https://example.com/image.png",
100
+ individual_holding_doc_front_file: "https://example.com/image.png",
101
+ purpose_of_transactions: "business_transactions",
102
+ purpose_of_transactions_explanation: "I am a business owner and I want to receive payments from my customers",
103
+ external_id: "your_company_external_id",
104
+ instance_id: "in_000000000000",
105
+ tos_id: "to_000000000000",
106
+ aiprise_validation_key: "",
107
+ created_at: "2021-01-01T00:00:00Z",
108
+ updated_at: "2021-01-01T00:00:00Z",
109
+ limit: {
110
+ per_transaction: 1e5,
111
+ daily: 2e5,
112
+ monthly: 1e6
113
+ }
114
+ }
115
+ ];
116
+ fetchMock.mockResponseOnce(JSON.stringify(mockedReceivers), {
117
+ headers: { "Content-Type": "application/json" }
118
+ });
119
+ const { data, error } = yield blindpay.receivers.list({
120
+ instanceId: "in_000000000000"
121
+ });
122
+ globalExpect(error).toBeNull();
123
+ globalExpect(data).toEqual(mockedReceivers);
124
+ }));
125
+ });
126
+ describe("Create receiver", () => {
127
+ const mockedReceiver = {
128
+ id: "re_000000000000"
129
+ };
130
+ it("should create a receiver", () => __async(null, null, function* () {
131
+ fetchMock.mockResponseOnce(JSON.stringify(mockedReceiver), {
132
+ headers: { "Content-Type": "application/json" }
133
+ });
134
+ const { data, error } = yield blindpay.receivers.create({
135
+ type: "individual",
136
+ kyc_type: "standard",
137
+ email: "email@example.com",
138
+ tax_id: "536804398",
139
+ address_line_1: "738 Plain St",
140
+ address_line_2: "Building 22",
141
+ city: "Marshfield",
142
+ state_province_region: "MA",
143
+ country: "US",
144
+ postal_code: "02050",
145
+ ip_address: "127.0.0.1",
146
+ image_url: "https://example.com/image.png",
147
+ phone_number: "+1234567890",
148
+ proof_of_address_doc_type: "UTILITY_BILL",
149
+ proof_of_address_doc_file: "https://example.com/image.png",
150
+ first_name: "John",
151
+ last_name: "Doe",
152
+ date_of_birth: "1998-01-01T00:00:00Z",
153
+ id_doc_country: "BR",
154
+ id_doc_type: "PASSPORT",
155
+ id_doc_front_file: "https://example.com/image.png",
156
+ id_doc_back_file: "https://example.com/image.png",
157
+ legal_name: "Company Name Inc.",
158
+ alternate_name: "Company Name Inc.",
159
+ formation_date: "1998-01-01T00:00:00Z",
160
+ website: "https://example.com",
161
+ owners: [
162
+ {
163
+ first_name: "John",
164
+ last_name: "Doe",
165
+ role: "beneficial_owner",
166
+ date_of_birth: "1998-01-01T00:00:00Z",
167
+ tax_id: "536804398",
168
+ address_line_1: "738 Plain St",
169
+ address_line_2: "Building 22",
170
+ city: "Marshfield",
171
+ state_province_region: "MA",
172
+ country: "US",
173
+ postal_code: "02050",
174
+ id_doc_country: "BR",
175
+ id_doc_type: "PASSPORT",
176
+ id_doc_front_file: "https://example.com/image.png",
177
+ id_doc_back_file: "https://example.com/image.png",
178
+ proof_of_address_doc_file: "https://example.com/image.png",
179
+ proof_of_address_doc_type: "UTILITY_BILL"
180
+ }
181
+ ],
182
+ incorporation_doc_file: "https://example.com/image.png",
183
+ proof_of_ownership_doc_file: "https://example.com/image.png",
184
+ source_of_funds_doc_type: "business_income",
185
+ source_of_funds_doc_file: "https://example.com/image.png",
186
+ individual_holding_doc_front_file: "https://example.com/image.png",
187
+ purpose_of_transactions: "business_transactions",
188
+ purpose_of_transactions_explanation: "I am a business owner and I want to receive payments from my customers",
189
+ external_id: "your_company_external_id",
190
+ tos_id: "to_000000000000",
191
+ instanceId: "in_000000000000"
192
+ });
193
+ globalExpect(error).toBeNull();
194
+ globalExpect(data).toEqual({ id: "re_000000000000" });
195
+ }));
196
+ });
197
+ describe("Get receiver", () => {
198
+ it("should get a receiver", () => __async(null, null, function* () {
199
+ const mockedReceiver = {
200
+ id: "re_000000000000",
201
+ type: "individual",
202
+ kyc_type: "standard",
203
+ kyc_status: "verifying",
204
+ kyc_warnings: [
205
+ {
206
+ code: null,
207
+ message: null,
208
+ resolution_status: null,
209
+ warning_id: null
210
+ }
211
+ ],
212
+ email: "email@example.com",
213
+ tax_id: "536804398",
214
+ address_line_1: "738 Plain St",
215
+ address_line_2: "Building 22",
216
+ city: "Marshfield",
217
+ state_province_region: "MA",
218
+ country: "US",
219
+ postal_code: "02050",
220
+ ip_address: "127.0.0.1",
221
+ image_url: "https://example.com/image.png",
222
+ phone_number: "+1234567890",
223
+ proof_of_address_doc_type: "UTILITY_BILL",
224
+ proof_of_address_doc_file: "https://example.com/image.png",
225
+ first_name: "John",
226
+ last_name: "Doe",
227
+ date_of_birth: "1998-01-01T00:00:00Z",
228
+ id_doc_country: "BR",
229
+ id_doc_type: "PASSPORT",
230
+ id_doc_front_file: "https://example.com/image.png",
231
+ id_doc_back_file: "https://example.com/image.png",
232
+ legal_name: "Company Name Inc.",
233
+ alternate_name: "Company Name Inc.",
234
+ formation_date: "1998-01-01T00:00:00Z",
235
+ website: "https://example.com",
236
+ owners: [
237
+ {
238
+ id: "ub_000000000000",
239
+ first_name: "John",
240
+ last_name: "Doe",
241
+ address_line_1: "738 Plain St",
242
+ address_line_2: "Building 22",
243
+ city: "Marshfield",
244
+ state_province_region: "MA",
245
+ country: "US",
246
+ postal_code: "02050",
247
+ id_doc_country: "BR",
248
+ id_doc_type: "PASSPORT",
249
+ id_doc_front_file: "https://example.com/image.png",
250
+ id_doc_back_file: "https://example.com/image.png"
251
+ }
252
+ ],
253
+ incorporation_doc_file: "https://example.com/image.png",
254
+ proof_of_ownership_doc_file: "https://example.com/image.png",
255
+ source_of_funds_doc_type: "business_income",
256
+ source_of_funds_doc_file: "https://example.com/image.png",
257
+ individual_holding_doc_front_file: "https://example.com/image.png",
258
+ purpose_of_transactions: "business_transactions",
259
+ purpose_of_transactions_explanation: "I am a business owner and I want to receive payments from my customers",
260
+ external_id: "your_company_external_id",
261
+ instance_id: "in_000000000000",
262
+ tos_id: "to_000000000000",
263
+ aiprise_validation_key: "",
264
+ created_at: "2021-01-01T00:00:00Z",
265
+ updated_at: "2021-01-01T00:00:00Z",
266
+ limit: {
267
+ per_transaction: 1e5,
268
+ daily: 2e5,
269
+ monthly: 1e6
270
+ }
271
+ };
272
+ fetchMock.mockResponseOnce(JSON.stringify(mockedReceiver), {
273
+ headers: { "Content-Type": "application/json" }
274
+ });
275
+ const { data, error } = yield blindpay.receivers.get({
276
+ instanceId: "in_000000000000",
277
+ id: "re_000000000000"
278
+ });
279
+ globalExpect(error).toBeNull();
280
+ globalExpect(data).toEqual(mockedReceiver);
281
+ }));
282
+ });
283
+ describe("Update receiver", () => {
284
+ it("should update a receiver", () => __async(null, null, function* () {
285
+ fetchMock.mockResponseOnce(JSON.stringify({ data: null }), {
286
+ headers: { "Content-Type": "application/json" }
287
+ });
288
+ const { data, error } = yield blindpay.receivers.update({
289
+ instanceId: "in_000000000000",
290
+ id: "re_000000000000",
291
+ email: "email@example.com",
292
+ tax_id: "536804398",
293
+ address_line_1: "738 Plain St",
294
+ address_line_2: "Building 22",
295
+ city: "Marshfield",
296
+ state_province_region: "MA",
297
+ country: "US",
298
+ postal_code: "02050",
299
+ ip_address: "127.0.0.1",
300
+ image_url: "https://example.com/image.png",
301
+ phone_number: "+1234567890",
302
+ proof_of_address_doc_type: "UTILITY_BILL",
303
+ proof_of_address_doc_file: "https://example.com/image.png",
304
+ first_name: "John",
305
+ last_name: "Doe",
306
+ date_of_birth: "1998-01-01T00:00:00Z",
307
+ id_doc_country: "BR",
308
+ id_doc_type: "PASSPORT",
309
+ id_doc_front_file: "https://example.com/image.png",
310
+ id_doc_back_file: "https://example.com/image.png",
311
+ legal_name: "Company Name Inc.",
312
+ alternate_name: "Company Name Inc.",
313
+ formation_date: "1998-01-01T00:00:00Z",
314
+ website: "https://example.com",
315
+ owners: [
316
+ {
317
+ id: "ub_000000000000",
318
+ first_name: "John",
319
+ last_name: "Doe",
320
+ role: "beneficial_owner",
321
+ date_of_birth: "1998-01-01T00:00:00Z",
322
+ tax_id: "536804398",
323
+ address_line_1: "738 Plain St",
324
+ address_line_2: "Building 22",
325
+ city: "Marshfield",
326
+ state_province_region: "MA",
327
+ country: "US",
328
+ postal_code: "02050",
329
+ id_doc_country: "BR",
330
+ id_doc_type: "PASSPORT",
331
+ id_doc_front_file: "https://example.com/image.png",
332
+ id_doc_back_file: "https://example.com/image.png"
333
+ }
334
+ ],
335
+ incorporation_doc_file: "https://example.com/image.png",
336
+ proof_of_ownership_doc_file: "https://example.com/image.png",
337
+ source_of_funds_doc_type: "business_income",
338
+ source_of_funds_doc_file: "https://example.com/image.png",
339
+ individual_holding_doc_front_file: "https://example.com/image.png",
340
+ purpose_of_transactions: "business_transactions",
341
+ purpose_of_transactions_explanation: "I am a business owner and I want to receive payments from my customers",
342
+ external_id: "your_company_external_id",
343
+ tos_id: "to_000000000000"
344
+ });
345
+ globalExpect(error).toBeNull();
346
+ globalExpect(data).toEqual({ data: null });
347
+ }));
348
+ });
349
+ describe("Delete receiver", () => {
350
+ it("should delete a receiver", () => __async(null, null, function* () {
351
+ fetchMock.mockResponseOnce(JSON.stringify({ data: null }), {
352
+ headers: { "Content-Type": "application/json" }
353
+ });
354
+ const { data, error } = yield blindpay.receivers.delete({
355
+ instanceId: "in_000000000000",
356
+ id: "re_000000000000"
357
+ });
358
+ globalExpect(error).toBeNull();
359
+ globalExpect(data).toEqual({ data: null });
360
+ }));
361
+ });
362
+ describe("Get receiver limits", () => {
363
+ it("should get receiver limits", () => __async(null, null, function* () {
364
+ const mockedReceiverLimits = {
365
+ limits: {
366
+ payin: {
367
+ daily: 1e4,
368
+ monthly: 5e4
369
+ },
370
+ payout: {
371
+ daily: 2e4,
372
+ monthly: 1e5
373
+ }
374
+ }
375
+ };
376
+ fetchMock.mockResponseOnce(JSON.stringify(mockedReceiverLimits), {
377
+ headers: { "Content-Type": "application/json" }
378
+ });
379
+ const { data, error } = yield blindpay.receivers.getLimits({
380
+ instanceId: "in_000000000000",
381
+ id: "re_000000000000"
382
+ });
383
+ globalExpect(error).toBeNull();
384
+ globalExpect(data).toEqual(mockedReceiverLimits);
385
+ }));
386
+ });
387
+ });
388
+ }
389
+ });
390
+ export default require_receivers_test();
@@ -0,0 +1,58 @@
1
+ import { I as InternalApiClient, S as StablecoinToken, B as BlindpayApiResponse } from '../../api-client-Cw2mNJeR.mjs';
2
+
3
+ type VirtualAccount = {
4
+ id: string;
5
+ us: {
6
+ ach: {
7
+ routing_number: string;
8
+ account_number: string;
9
+ };
10
+ wire: {
11
+ routing_number: string;
12
+ account_number: string;
13
+ };
14
+ rtp: {
15
+ routing_number: string;
16
+ account_number: string;
17
+ };
18
+ swift_bic_code: string;
19
+ account_type: string;
20
+ beneficiary: {
21
+ name: string;
22
+ address_line_1: string;
23
+ address_line_2: string;
24
+ };
25
+ receiving_bank: {
26
+ name: string;
27
+ address_line_1: string;
28
+ address_line_2: string;
29
+ };
30
+ };
31
+ token: StablecoinToken;
32
+ blockchain_wallet_id: string;
33
+ };
34
+ type CreateVirtualAccountInput = {
35
+ instanceId: string;
36
+ receiverId: string;
37
+ blockchain_wallet_id: string;
38
+ token: StablecoinToken;
39
+ };
40
+ type CreateVirtualAccountResponse = VirtualAccount;
41
+ type GetVirtualAccountInput = {
42
+ instanceId: string;
43
+ receiverId: string;
44
+ };
45
+ type GetVirtualAccountResponse = VirtualAccount;
46
+ type UpdateVirtualAccountInput = {
47
+ instanceId: string;
48
+ receiverId: string;
49
+ blockchain_wallet_id: string;
50
+ token: StablecoinToken;
51
+ };
52
+ declare function createVirtualAccountsResource(client: InternalApiClient): {
53
+ update({ instanceId, receiverId, ...data }: UpdateVirtualAccountInput): Promise<BlindpayApiResponse<void>>;
54
+ create({ instanceId, receiverId, ...data }: CreateVirtualAccountInput): Promise<BlindpayApiResponse<CreateVirtualAccountResponse>>;
55
+ get({ instanceId, receiverId, }: GetVirtualAccountInput): Promise<BlindpayApiResponse<GetVirtualAccountResponse>>;
56
+ };
57
+
58
+ export { type CreateVirtualAccountInput, type CreateVirtualAccountResponse, type GetVirtualAccountInput, type GetVirtualAccountResponse, type UpdateVirtualAccountInput, type VirtualAccount, createVirtualAccountsResource };
@@ -0,0 +1,58 @@
1
+ import { I as InternalApiClient, S as StablecoinToken, B as BlindpayApiResponse } from '../../api-client-Cw2mNJeR.js';
2
+
3
+ type VirtualAccount = {
4
+ id: string;
5
+ us: {
6
+ ach: {
7
+ routing_number: string;
8
+ account_number: string;
9
+ };
10
+ wire: {
11
+ routing_number: string;
12
+ account_number: string;
13
+ };
14
+ rtp: {
15
+ routing_number: string;
16
+ account_number: string;
17
+ };
18
+ swift_bic_code: string;
19
+ account_type: string;
20
+ beneficiary: {
21
+ name: string;
22
+ address_line_1: string;
23
+ address_line_2: string;
24
+ };
25
+ receiving_bank: {
26
+ name: string;
27
+ address_line_1: string;
28
+ address_line_2: string;
29
+ };
30
+ };
31
+ token: StablecoinToken;
32
+ blockchain_wallet_id: string;
33
+ };
34
+ type CreateVirtualAccountInput = {
35
+ instanceId: string;
36
+ receiverId: string;
37
+ blockchain_wallet_id: string;
38
+ token: StablecoinToken;
39
+ };
40
+ type CreateVirtualAccountResponse = VirtualAccount;
41
+ type GetVirtualAccountInput = {
42
+ instanceId: string;
43
+ receiverId: string;
44
+ };
45
+ type GetVirtualAccountResponse = VirtualAccount;
46
+ type UpdateVirtualAccountInput = {
47
+ instanceId: string;
48
+ receiverId: string;
49
+ blockchain_wallet_id: string;
50
+ token: StablecoinToken;
51
+ };
52
+ declare function createVirtualAccountsResource(client: InternalApiClient): {
53
+ update({ instanceId, receiverId, ...data }: UpdateVirtualAccountInput): Promise<BlindpayApiResponse<void>>;
54
+ create({ instanceId, receiverId, ...data }: CreateVirtualAccountInput): Promise<BlindpayApiResponse<CreateVirtualAccountResponse>>;
55
+ get({ instanceId, receiverId, }: GetVirtualAccountInput): Promise<BlindpayApiResponse<GetVirtualAccountResponse>>;
56
+ };
57
+
58
+ export { type CreateVirtualAccountInput, type CreateVirtualAccountResponse, type GetVirtualAccountInput, type GetVirtualAccountResponse, type UpdateVirtualAccountInput, type VirtualAccount, createVirtualAccountsResource };
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
+ var __objRest = (source, exclude) => {
9
+ var target = {};
10
+ for (var prop in source)
11
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
12
+ target[prop] = source[prop];
13
+ if (source != null && __getOwnPropSymbols)
14
+ for (var prop of __getOwnPropSymbols(source)) {
15
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
16
+ target[prop] = source[prop];
17
+ }
18
+ return target;
19
+ };
20
+ var __export = (target, all) => {
21
+ for (var name in all)
22
+ __defProp(target, name, { get: all[name], enumerable: true });
23
+ };
24
+ var __copyProps = (to, from, except, desc) => {
25
+ if (from && typeof from === "object" || typeof from === "function") {
26
+ for (let key of __getOwnPropNames(from))
27
+ if (!__hasOwnProp.call(to, key) && key !== except)
28
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
29
+ }
30
+ return to;
31
+ };
32
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
+
34
+ // src/resources/virtual-accounts/index.ts
35
+ var virtual_accounts_exports = {};
36
+ __export(virtual_accounts_exports, {
37
+ createVirtualAccountsResource: () => createVirtualAccountsResource
38
+ });
39
+ module.exports = __toCommonJS(virtual_accounts_exports);
40
+ function createVirtualAccountsResource(client) {
41
+ return {
42
+ update(_a) {
43
+ var _b = _a, {
44
+ instanceId,
45
+ receiverId
46
+ } = _b, data = __objRest(_b, [
47
+ "instanceId",
48
+ "receiverId"
49
+ ]);
50
+ return client.put(
51
+ `/instances/${instanceId}/receivers/${receiverId}/virtual-accounts`,
52
+ data
53
+ );
54
+ },
55
+ create(_c) {
56
+ var _d = _c, {
57
+ instanceId,
58
+ receiverId
59
+ } = _d, data = __objRest(_d, [
60
+ "instanceId",
61
+ "receiverId"
62
+ ]);
63
+ return client.post(
64
+ `/instances/${instanceId}/receivers/${receiverId}/virtual-accounts`,
65
+ data
66
+ );
67
+ },
68
+ get({
69
+ instanceId,
70
+ receiverId
71
+ }) {
72
+ return client.get(`/instances/${instanceId}/receivers/${receiverId}/virtual-accounts`);
73
+ }
74
+ };
75
+ }
76
+ // Annotate the CommonJS export names for ESM import in node:
77
+ 0 && (module.exports = {
78
+ createVirtualAccountsResource
79
+ });
@@ -0,0 +1,9 @@
1
+ import {
2
+ createVirtualAccountsResource,
3
+ init_virtual_accounts
4
+ } from "../../chunk-LUDGZPXY.mjs";
5
+ import "../../chunk-OBKEW4AQ.mjs";
6
+ init_virtual_accounts();
7
+ export {
8
+ createVirtualAccountsResource
9
+ };