@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,591 @@
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/payouts/payouts.test.ts
32
+ var require_payouts_test = __commonJS({
33
+ "src/resources/payouts/payouts.test.ts"(exports) {
34
+ init_dist();
35
+ init_client();
36
+ describe("Payouts", () => {
37
+ afterEach(() => fetchMock.resetMocks());
38
+ const blindpay = new Blindpay("test-key");
39
+ describe("List payouts", () => {
40
+ it("should list payouts", () => __async(null, null, function* () {
41
+ const mockedPayouts = {
42
+ data: [
43
+ {
44
+ receiver_id: "re_000000000000",
45
+ id: "pa_000000000000",
46
+ status: "processing",
47
+ sender_wallet_address: "0x123...890",
48
+ signed_transaction: "AAA...Zey8y0A",
49
+ quote_id: "qu_000000000000",
50
+ instance_id: "in_000000000000",
51
+ tracking_transaction: {
52
+ step: "processing",
53
+ status: "failed",
54
+ transaction_hash: "0x123...890",
55
+ completed_at: "2011-10-05T14:48:00.000Z"
56
+ },
57
+ tracking_payment: {
58
+ step: "on_hold",
59
+ provider_name: "blockchain",
60
+ provider_transaction_id: "0x123...890",
61
+ provider_status: "canceled",
62
+ estimated_time_of_arrival: "5_min",
63
+ completed_at: "2011-10-05T14:48:00.000Z"
64
+ },
65
+ tracking_liquidity: {
66
+ step: "processing",
67
+ provider_transaction_id: "0x123...890",
68
+ provider_status: "deposited",
69
+ estimated_time_of_arrival: "1_business_day",
70
+ completed_at: "2011-10-05T14:48:00.000Z"
71
+ },
72
+ tracking_complete: {
73
+ step: "on_hold",
74
+ status: "tokens_refunded",
75
+ transaction_hash: "0x123...890",
76
+ completed_at: "2011-10-05T14:48:00.000Z"
77
+ },
78
+ tracking_partner_fee: {
79
+ step: "on_hold",
80
+ transaction_hash: "0x123...890",
81
+ completed_at: "2011-10-05T14:48:00.000Z"
82
+ },
83
+ created_at: "2021-01-01T00:00:00Z",
84
+ updated_at: "2021-01-01T00:00:00Z",
85
+ image_url: "https://example.com/image.png",
86
+ first_name: "John",
87
+ last_name: "Doe",
88
+ legal_name: "Company Name Inc.",
89
+ network: "sepolia",
90
+ token: "USDC",
91
+ description: "Memo code or description, only works with USD and BRL",
92
+ sender_amount: 1010,
93
+ receiver_amount: 5240,
94
+ partner_fee_amount: 150,
95
+ commercial_quotation: 495,
96
+ blindpay_quotation: 485,
97
+ total_fee_amount: 1.5,
98
+ receiver_local_amount: 1e3,
99
+ currency: "BRL",
100
+ transaction_document_file: "https://example.com/image.png",
101
+ transaction_document_type: "invoice",
102
+ transaction_document_id: "1234567890",
103
+ name: "Bank Account Name",
104
+ type: "wire",
105
+ pix_key: "14947677768",
106
+ account_number: "1001001234",
107
+ routing_number: "012345678",
108
+ country: "US",
109
+ account_class: "individual",
110
+ address_line_1: "Address line 1",
111
+ address_line_2: "Address line 2",
112
+ city: "City",
113
+ state_province_region: "State/Province/Region",
114
+ postal_code: "Postal code",
115
+ account_type: "checking",
116
+ ach_cop_beneficiary_first_name: "Fernando",
117
+ ach_cop_bank_account: "12345678",
118
+ ach_cop_bank_code: "051",
119
+ ach_cop_beneficiary_last_name: "Guzman Alarc\xF3n",
120
+ ach_cop_document_id: "1661105408",
121
+ ach_cop_document_type: "CC",
122
+ ach_cop_email: "fernando.guzman@gmail.com",
123
+ beneficiary_name: "Individual full name or business name",
124
+ spei_clabe: "5482347403740546",
125
+ spei_protocol: "clabe",
126
+ spei_institution_code: "40002",
127
+ swift_beneficiary_country: "MX",
128
+ swift_code_bic: "123456789",
129
+ swift_account_holder_name: "John Doe",
130
+ swift_account_number_iban: "123456789",
131
+ transfers_account: "BM123123123123",
132
+ transfers_type: "CVU",
133
+ has_virtual_account: true
134
+ }
135
+ ],
136
+ pagination: {
137
+ has_more: true,
138
+ next_page: 3,
139
+ prev_page: 1
140
+ }
141
+ };
142
+ fetchMock.mockResponseOnce(JSON.stringify(mockedPayouts), {
143
+ headers: { "Content-Type": "application/json" }
144
+ });
145
+ const { data, error } = yield blindpay.payouts.list({
146
+ instanceId: "in_000000000000"
147
+ });
148
+ globalExpect(error).toBeNull();
149
+ globalExpect(data).toEqual(mockedPayouts);
150
+ }));
151
+ });
152
+ describe("Get payout", () => {
153
+ it("should get a payout", () => __async(null, null, function* () {
154
+ const mockedPayout = {
155
+ receiver_id: "re_000000000000",
156
+ id: "pa_000000000000",
157
+ status: "processing",
158
+ sender_wallet_address: "0x123...890",
159
+ signed_transaction: "AAA...Zey8y0A",
160
+ quote_id: "qu_000000000000",
161
+ instance_id: "in_000000000000",
162
+ tracking_transaction: {
163
+ step: "processing",
164
+ status: "failed",
165
+ transaction_hash: "0x123...890",
166
+ completed_at: "2011-10-05T14:48:00.000Z"
167
+ },
168
+ tracking_payment: {
169
+ step: "on_hold",
170
+ provider_name: "blockchain",
171
+ provider_transaction_id: "0x123...890",
172
+ provider_status: "canceled",
173
+ estimated_time_of_arrival: "5_min",
174
+ completed_at: "2011-10-05T14:48:00.000Z"
175
+ },
176
+ tracking_liquidity: {
177
+ step: "processing",
178
+ provider_transaction_id: "0x123...890",
179
+ provider_status: "deposited",
180
+ estimated_time_of_arrival: "1_business_day",
181
+ completed_at: "2011-10-05T14:48:00.000Z"
182
+ },
183
+ tracking_complete: {
184
+ step: "on_hold",
185
+ status: "tokens_refunded",
186
+ transaction_hash: "0x123...890",
187
+ completed_at: "2011-10-05T14:48:00.000Z"
188
+ },
189
+ tracking_partner_fee: {
190
+ step: "on_hold",
191
+ transaction_hash: "0x123...890",
192
+ completed_at: "2011-10-05T14:48:00.000Z"
193
+ },
194
+ created_at: "2021-01-01T00:00:00Z",
195
+ updated_at: "2021-01-01T00:00:00Z",
196
+ image_url: "https://example.com/image.png",
197
+ first_name: "John",
198
+ last_name: "Doe",
199
+ legal_name: "Company Name Inc.",
200
+ network: "sepolia",
201
+ token: "USDC",
202
+ description: "Memo code or description, only works with USD and BRL",
203
+ sender_amount: 1010,
204
+ receiver_amount: 5240,
205
+ partner_fee_amount: 150,
206
+ commercial_quotation: 495,
207
+ blindpay_quotation: 485,
208
+ total_fee_amount: 1.5,
209
+ receiver_local_amount: 1e3,
210
+ currency: "BRL",
211
+ transaction_document_file: "https://example.com/image.png",
212
+ transaction_document_type: "invoice",
213
+ transaction_document_id: "1234567890",
214
+ name: "Bank Account Name",
215
+ type: "wire",
216
+ pix_key: "14947677768",
217
+ account_number: "1001001234",
218
+ routing_number: "012345678",
219
+ country: "US",
220
+ account_class: "individual",
221
+ address_line_1: "Address line 1",
222
+ address_line_2: "Address line 2",
223
+ city: "City",
224
+ state_province_region: "State/Province/Region",
225
+ postal_code: "Postal code",
226
+ account_type: "checking",
227
+ ach_cop_beneficiary_first_name: "Fernando",
228
+ ach_cop_bank_account: "12345678",
229
+ ach_cop_bank_code: "051",
230
+ ach_cop_beneficiary_last_name: "Guzman Alarc\xF3n",
231
+ ach_cop_document_id: "1661105408",
232
+ ach_cop_document_type: "CC",
233
+ ach_cop_email: "fernando.guzman@gmail.com",
234
+ beneficiary_name: "Individual full name or business name",
235
+ spei_clabe: "5482347403740546",
236
+ spei_protocol: "clabe",
237
+ spei_institution_code: "40002",
238
+ swift_beneficiary_country: "MX",
239
+ swift_code_bic: "123456789",
240
+ swift_account_holder_name: "John Doe",
241
+ swift_account_number_iban: "123456789",
242
+ transfers_account: "BM123123123123",
243
+ transfers_type: "CVU",
244
+ has_virtual_account: true
245
+ };
246
+ fetchMock.mockResponseOnce(JSON.stringify(mockedPayout), {
247
+ headers: { "Content-Type": "application/json" }
248
+ });
249
+ const { data, error } = yield blindpay.payouts.get({
250
+ instanceId: "in_000000000000",
251
+ id: "pa_000000000000"
252
+ });
253
+ globalExpect(error).toBeNull();
254
+ globalExpect(data).toEqual(mockedPayout);
255
+ }));
256
+ });
257
+ describe("Export payouts", () => {
258
+ it("should export payouts", () => __async(null, null, function* () {
259
+ const mockedExportPayouts = [
260
+ {
261
+ receiver_id: "re_000000000000",
262
+ id: "pa_000000000000",
263
+ status: "processing",
264
+ sender_wallet_address: "0x123...890",
265
+ signed_transaction: "AAA...Zey8y0A",
266
+ quote_id: "qu_000000000000",
267
+ instance_id: "in_000000000000",
268
+ tracking_transaction: {
269
+ step: "processing",
270
+ status: "failed",
271
+ transaction_hash: "0x123...890",
272
+ completed_at: "2011-10-05T14:48:00.000Z"
273
+ },
274
+ tracking_payment: {
275
+ step: "on_hold",
276
+ provider_name: "blockchain",
277
+ provider_transaction_id: "0x123...890",
278
+ provider_status: "canceled",
279
+ estimated_time_of_arrival: "5_min",
280
+ completed_at: "2011-10-05T14:48:00.000Z"
281
+ },
282
+ tracking_liquidity: {
283
+ step: "processing",
284
+ provider_transaction_id: "0x123...890",
285
+ provider_status: "deposited",
286
+ estimated_time_of_arrival: "1_business_day",
287
+ completed_at: "2011-10-05T14:48:00.000Z"
288
+ },
289
+ tracking_complete: {
290
+ step: "on_hold",
291
+ status: "tokens_refunded",
292
+ transaction_hash: "0x123...890",
293
+ completed_at: "2011-10-05T14:48:00.000Z"
294
+ },
295
+ tracking_partner_fee: {
296
+ step: "on_hold",
297
+ transaction_hash: "0x123...890",
298
+ completed_at: "2011-10-05T14:48:00.000Z"
299
+ },
300
+ created_at: "2021-01-01T00:00:00Z",
301
+ updated_at: "2021-01-01T00:00:00Z",
302
+ image_url: "https://example.com/image.png",
303
+ first_name: "John",
304
+ last_name: "Doe",
305
+ legal_name: "Company Name Inc.",
306
+ network: "sepolia",
307
+ token: "USDC",
308
+ description: "Memo code or description, only works with USD and BRL",
309
+ sender_amount: 1010,
310
+ receiver_amount: 5240,
311
+ partner_fee_amount: 150,
312
+ commercial_quotation: 495,
313
+ blindpay_quotation: 485,
314
+ total_fee_amount: 1.5,
315
+ receiver_local_amount: 1e3,
316
+ currency: "BRL",
317
+ transaction_document_file: "https://example.com/image.png",
318
+ transaction_document_type: "invoice",
319
+ transaction_document_id: "1234567890",
320
+ name: "Bank Account Name",
321
+ type: "wire",
322
+ pix_key: "14947677768",
323
+ account_number: "1001001234",
324
+ routing_number: "012345678",
325
+ country: "US",
326
+ account_class: "individual",
327
+ address_line_1: "Address line 1",
328
+ address_line_2: "Address line 2",
329
+ city: "City",
330
+ state_province_region: "State/Province/Region",
331
+ postal_code: "Postal code",
332
+ account_type: "checking",
333
+ ach_cop_beneficiary_first_name: "Fernando",
334
+ ach_cop_bank_account: "12345678",
335
+ ach_cop_bank_code: "051",
336
+ ach_cop_beneficiary_last_name: "Guzman Alarc\xF3n",
337
+ ach_cop_document_id: "1661105408",
338
+ ach_cop_document_type: "CC",
339
+ ach_cop_email: "fernando.guzman@gmail.com",
340
+ beneficiary_name: "Individual full name or business name",
341
+ spei_clabe: "5482347403740546",
342
+ spei_protocol: "clabe",
343
+ spei_institution_code: "40002",
344
+ swift_beneficiary_country: "MX",
345
+ swift_code_bic: "123456789",
346
+ swift_account_holder_name: "John Doe",
347
+ swift_account_number_iban: "123456789",
348
+ transfers_account: "BM123123123123",
349
+ transfers_type: "CVU",
350
+ has_virtual_account: true
351
+ }
352
+ ];
353
+ fetchMock.mockResponseOnce(JSON.stringify(mockedExportPayouts), {
354
+ headers: { "Content-Type": "application/json" }
355
+ });
356
+ const { data, error } = yield blindpay.payouts.export({
357
+ instanceId: "in_000000000000"
358
+ });
359
+ globalExpect(error).toBeNull();
360
+ globalExpect(data).toEqual(mockedExportPayouts);
361
+ }));
362
+ });
363
+ describe("Get payout track", () => {
364
+ it("should get payout tracking information", () => __async(null, null, function* () {
365
+ const mockedPayoutTrack = {
366
+ receiver_id: "re_000000000000",
367
+ id: "pa_000000000000",
368
+ status: "processing",
369
+ sender_wallet_address: "0x123...890",
370
+ signed_transaction: "AAA...Zey8y0A",
371
+ quote_id: "qu_000000000000",
372
+ instance_id: "in_000000000000",
373
+ tracking_transaction: {
374
+ step: "processing",
375
+ status: "failed",
376
+ transaction_hash: "0x123...890",
377
+ completed_at: "2011-10-05T14:48:00.000Z"
378
+ },
379
+ tracking_payment: {
380
+ step: "on_hold",
381
+ provider_name: "blockchain",
382
+ provider_transaction_id: "0x123...890",
383
+ provider_status: "canceled",
384
+ estimated_time_of_arrival: "5_min",
385
+ completed_at: "2011-10-05T14:48:00.000Z"
386
+ },
387
+ tracking_liquidity: {
388
+ step: "processing",
389
+ provider_transaction_id: "0x123...890",
390
+ provider_status: "deposited",
391
+ estimated_time_of_arrival: "1_business_day",
392
+ completed_at: "2011-10-05T14:48:00.000Z"
393
+ },
394
+ tracking_complete: {
395
+ step: "on_hold",
396
+ status: "tokens_refunded",
397
+ transaction_hash: "0x123...890",
398
+ completed_at: "2011-10-05T14:48:00.000Z"
399
+ },
400
+ tracking_partner_fee: {
401
+ step: "on_hold",
402
+ transaction_hash: "0x123...890",
403
+ completed_at: "2011-10-05T14:48:00.000Z"
404
+ },
405
+ created_at: "2021-01-01T00:00:00Z",
406
+ updated_at: "2021-01-01T00:00:00Z",
407
+ image_url: "https://example.com/image.png",
408
+ first_name: "John",
409
+ last_name: "Doe",
410
+ legal_name: "Company Name Inc.",
411
+ network: "sepolia",
412
+ token: "USDC",
413
+ description: "Memo code or description, only works with USD and BRL",
414
+ sender_amount: 1010,
415
+ receiver_amount: 5240,
416
+ partner_fee_amount: 150,
417
+ commercial_quotation: 495,
418
+ blindpay_quotation: 485,
419
+ total_fee_amount: 1.5,
420
+ receiver_local_amount: 1e3,
421
+ currency: "BRL",
422
+ transaction_document_file: "https://example.com/image.png",
423
+ transaction_document_type: "invoice",
424
+ transaction_document_id: "1234567890",
425
+ name: "Bank Account Name",
426
+ type: "wire",
427
+ pix_key: "14947677768",
428
+ account_number: "1001001234",
429
+ routing_number: "012345678",
430
+ country: "US",
431
+ account_class: "individual",
432
+ address_line_1: "Address line 1",
433
+ address_line_2: "Address line 2",
434
+ city: "City",
435
+ state_province_region: "State/Province/Region",
436
+ postal_code: "Postal code",
437
+ account_type: "checking",
438
+ ach_cop_beneficiary_first_name: "Fernando",
439
+ ach_cop_bank_account: "12345678",
440
+ ach_cop_bank_code: "051",
441
+ ach_cop_beneficiary_last_name: "Guzman Alarc\xF3n",
442
+ ach_cop_document_id: "1661105408",
443
+ ach_cop_document_type: "CC",
444
+ ach_cop_email: "fernando.guzman@gmail.com",
445
+ beneficiary_name: "Individual full name or business name",
446
+ spei_clabe: "5482347403740546",
447
+ spei_protocol: "clabe",
448
+ spei_institution_code: "40002",
449
+ swift_beneficiary_country: "MX",
450
+ swift_code_bic: "123456789",
451
+ swift_account_holder_name: "John Doe",
452
+ swift_account_number_iban: "123456789",
453
+ transfers_account: "BM123123123123",
454
+ transfers_type: "CVU",
455
+ has_virtual_account: true
456
+ };
457
+ fetchMock.mockResponseOnce(JSON.stringify(mockedPayoutTrack), {
458
+ headers: { "Content-Type": "application/json" }
459
+ });
460
+ const { data, error } = yield blindpay.payouts.getTrack({
461
+ id: "pa_000000000000"
462
+ });
463
+ globalExpect(error).toBeNull();
464
+ globalExpect(data).toEqual(mockedPayoutTrack);
465
+ }));
466
+ });
467
+ describe("Authorize stellar token", () => {
468
+ it("should authorize stellar token", () => __async(null, null, function* () {
469
+ const mockedAuthorizeToken = {
470
+ transaction_hash: "string"
471
+ };
472
+ fetchMock.mockResponseOnce(JSON.stringify(mockedAuthorizeToken), {
473
+ headers: { "Content-Type": "application/json" }
474
+ });
475
+ const { data, error } = yield blindpay.payouts.authorizeStellarToken({
476
+ instanceId: "in_000000000000",
477
+ quote_id: "qu_000000000000",
478
+ sender_wallet_address: "0x123...890"
479
+ });
480
+ globalExpect(error).toBeNull();
481
+ globalExpect(data).toEqual(mockedAuthorizeToken);
482
+ }));
483
+ });
484
+ describe("Create stellar payout", () => {
485
+ it("should create a stellar payout", () => __async(null, null, function* () {
486
+ const mockedStellarPayout = {
487
+ id: "pa_000000000000",
488
+ status: "processing",
489
+ sender_wallet_address: "0x123...890",
490
+ tracking_complete: {
491
+ step: "on_hold",
492
+ status: "tokens_refunded",
493
+ transaction_hash: "0x123...890",
494
+ completed_at: "2011-10-05T14:48:00.000Z"
495
+ },
496
+ tracking_payment: {
497
+ step: "on_hold",
498
+ provider_name: "blockchain",
499
+ provider_transaction_id: "0x123...890",
500
+ provider_status: "canceled",
501
+ estimated_time_of_arrival: "5_min",
502
+ completed_at: "2011-10-05T14:48:00.000Z"
503
+ },
504
+ tracking_transaction: {
505
+ step: "processing",
506
+ status: "failed",
507
+ transaction_hash: "0x123...890",
508
+ completed_at: "2011-10-05T14:48:00.000Z"
509
+ },
510
+ tracking_partner_fee: {
511
+ step: "on_hold",
512
+ transaction_hash: "0x123...890",
513
+ completed_at: "2011-10-05T14:48:00.000Z"
514
+ },
515
+ tracking_liquidity: {
516
+ step: "processing",
517
+ provider_transaction_id: "0x123...890",
518
+ provider_status: "deposited",
519
+ estimated_time_of_arrival: "1_business_day",
520
+ completed_at: "2011-10-05T14:48:00.000Z"
521
+ },
522
+ receiver_id: "re_000000000000"
523
+ };
524
+ fetchMock.mockResponseOnce(JSON.stringify(mockedStellarPayout), {
525
+ headers: { "Content-Type": "application/json" }
526
+ });
527
+ const { data, error } = yield blindpay.payouts.createStellar({
528
+ instanceId: "in_000000000000",
529
+ quote_id: "qu_000000000000",
530
+ sender_wallet_address: "0x123...890"
531
+ });
532
+ globalExpect(error).toBeNull();
533
+ globalExpect(data).toEqual(mockedStellarPayout);
534
+ }));
535
+ });
536
+ describe("Create EVM payout", () => {
537
+ it("should create an EVM payout", () => __async(null, null, function* () {
538
+ const mockedEvmPayout = {
539
+ id: "pa_000000000000",
540
+ status: "processing",
541
+ sender_wallet_address: "0x123...890",
542
+ tracking_complete: {
543
+ step: "on_hold",
544
+ status: "tokens_refunded",
545
+ transaction_hash: "0x123...890",
546
+ completed_at: "2011-10-05T14:48:00.000Z"
547
+ },
548
+ tracking_payment: {
549
+ step: "on_hold",
550
+ provider_name: "blockchain",
551
+ provider_transaction_id: "0x123...890",
552
+ provider_status: "canceled",
553
+ estimated_time_of_arrival: "5_min",
554
+ completed_at: "2011-10-05T14:48:00.000Z"
555
+ },
556
+ tracking_transaction: {
557
+ step: "processing",
558
+ status: "failed",
559
+ transaction_hash: "0x123...890",
560
+ completed_at: "2011-10-05T14:48:00.000Z"
561
+ },
562
+ tracking_partner_fee: {
563
+ step: "on_hold",
564
+ transaction_hash: "0x123...890",
565
+ completed_at: "2011-10-05T14:48:00.000Z"
566
+ },
567
+ tracking_liquidity: {
568
+ step: "processing",
569
+ provider_transaction_id: "0x123...890",
570
+ provider_status: "deposited",
571
+ estimated_time_of_arrival: "1_business_day",
572
+ completed_at: "2011-10-05T14:48:00.000Z"
573
+ },
574
+ receiver_id: "re_000000000000"
575
+ };
576
+ fetchMock.mockResponseOnce(JSON.stringify(mockedEvmPayout), {
577
+ headers: { "Content-Type": "application/json" }
578
+ });
579
+ const { data, error } = yield blindpay.payouts.createEvm({
580
+ instanceId: "in_000000000000",
581
+ quote_id: "qu_000000000000",
582
+ sender_wallet_address: "0x123...890"
583
+ });
584
+ globalExpect(error).toBeNull();
585
+ globalExpect(data).toEqual(mockedEvmPayout);
586
+ }));
587
+ });
588
+ });
589
+ }
590
+ });
591
+ export default require_payouts_test();
@@ -0,0 +1,59 @@
1
+ import { I as InternalApiClient, g as CurrencyType, N as Network, S as StablecoinToken, j as TransactionDocumentType, B as BlindpayApiResponse, h as Currency } from '../../api-client-Cw2mNJeR.mjs';
2
+
3
+ type CreateQuoteInput = {
4
+ instanceId: string;
5
+ bank_account_id: string;
6
+ currency_type: CurrencyType;
7
+ network?: Network | null;
8
+ request_amount: number;
9
+ token?: StablecoinToken | null;
10
+ cover_fees: boolean | null;
11
+ description?: string | null;
12
+ partner_fee_id: string | null;
13
+ transaction_document_file: string | null;
14
+ transaction_document_id: string | null;
15
+ transaction_document_type: TransactionDocumentType;
16
+ };
17
+ type CreateQuoteResponse = {
18
+ id: string;
19
+ expires_at: number;
20
+ commercial_quotation: number;
21
+ blindpay_quotation: number;
22
+ receiver_amount: number;
23
+ sender_amount: number;
24
+ partner_fee_amount: number;
25
+ flat_fee: number;
26
+ contract: {
27
+ abi: Record<string, unknown>[];
28
+ address: string;
29
+ functionName: string;
30
+ blindpayContractAddress: string;
31
+ amount: string;
32
+ network: {
33
+ name: string;
34
+ chainId: number;
35
+ };
36
+ };
37
+ receiver_local_amount: number;
38
+ description: string;
39
+ };
40
+ type GetFxRateInput = {
41
+ instanceId: string;
42
+ currency_type: CurrencyType;
43
+ from: Currency;
44
+ to: Currency;
45
+ request_amount: number;
46
+ };
47
+ type GetFxRateResponse = {
48
+ commercial_quotation: number;
49
+ blindpay_quotation: number;
50
+ result_amount: number;
51
+ instance_flat_fee: number;
52
+ instance_percentage_fee: number;
53
+ };
54
+ declare function createQuotesResource(client: InternalApiClient): {
55
+ create({ instanceId, ...data }: CreateQuoteInput): Promise<BlindpayApiResponse<CreateQuoteResponse>>;
56
+ getFxRate({ instanceId, ...data }: GetFxRateInput): Promise<BlindpayApiResponse<GetFxRateResponse>>;
57
+ };
58
+
59
+ export { type CreateQuoteInput, type CreateQuoteResponse, type GetFxRateInput, type GetFxRateResponse, createQuotesResource };