@blindpay/node 1.0.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +24 -37
  3. package/dist/{chunk-HKFAJXJG.mjs → chunk-3QQCDR3E.mjs} +12 -32
  4. package/dist/{chunk-LUDGZPXY.mjs → chunk-5XJJKYXE.mjs} +9 -16
  5. package/dist/chunk-64EFLUS3.mjs +106 -0
  6. package/dist/chunk-B5T7AQLH.mjs +38 -0
  7. package/dist/{chunk-VKN2AMCW.mjs → chunk-BONN6PYB.mjs} +12 -30
  8. package/dist/{chunk-M6IYYMRW.mjs → chunk-E7M4CJKR.mjs} +4 -12
  9. package/dist/chunk-IZYPRCCV.mjs +82 -0
  10. package/dist/{chunk-QVOSGLUO.mjs → chunk-LRHWT4JU.mjs} +6 -10
  11. package/dist/chunk-QGNLMN6Z.mjs +49 -0
  12. package/dist/{chunk-3CZJEDS5.mjs → chunk-RC5NN5UF.mjs} +5 -14
  13. package/dist/{chunk-GNDAATIJ.mjs → chunk-TBTA7A2P.mjs} +4 -12
  14. package/dist/{chunk-CNNEROQ7.mjs → chunk-UC57SCKQ.mjs} +6 -17
  15. package/dist/{chunk-UCAW3RTZ.mjs → chunk-W7NJUABI.mjs} +12 -20
  16. package/dist/{chunk-ES7RXEM7.mjs → chunk-YPXYUS2X.mjs} +46 -37
  17. package/dist/index.d.mts +14 -10
  18. package/dist/index.d.ts +14 -10
  19. package/dist/index.js +237 -435
  20. package/dist/index.mjs +19 -19
  21. package/dist/resources/api-keys/api-keys.test.js +238 -445
  22. package/dist/resources/api-keys/api-keys.test.mjs +19 -28
  23. package/dist/resources/api-keys/index.d.mts +20 -20
  24. package/dist/resources/api-keys/index.d.ts +20 -20
  25. package/dist/resources/api-keys/index.js +6 -10
  26. package/dist/resources/api-keys/index.mjs +1 -1
  27. package/dist/resources/available/available.test.js +235 -433
  28. package/dist/resources/available/available.test.mjs +16 -16
  29. package/dist/resources/bank-accounts/bank-accounts.test.js +245 -455
  30. package/dist/resources/bank-accounts/bank-accounts.test.mjs +26 -38
  31. package/dist/resources/bank-accounts/index.d.mts +22 -145
  32. package/dist/resources/bank-accounts/index.d.ts +22 -145
  33. package/dist/resources/bank-accounts/index.js +102 -184
  34. package/dist/resources/bank-accounts/index.mjs +1 -1
  35. package/dist/resources/instances/index.d.mts +9 -20
  36. package/dist/resources/instances/index.d.ts +9 -20
  37. package/dist/resources/instances/index.js +11 -20
  38. package/dist/resources/instances/index.mjs +1 -1
  39. package/dist/resources/instances/instances.test.js +239 -446
  40. package/dist/resources/instances/instances.test.mjs +20 -29
  41. package/dist/resources/partner-fees/index.d.mts +8 -18
  42. package/dist/resources/partner-fees/index.d.ts +8 -18
  43. package/dist/resources/partner-fees/index.js +5 -14
  44. package/dist/resources/partner-fees/index.mjs +1 -1
  45. package/dist/resources/partner-fees/partner-fees.test.js +238 -445
  46. package/dist/resources/partner-fees/partner-fees.test.mjs +19 -28
  47. package/dist/resources/payins/index.d.mts +15 -30
  48. package/dist/resources/payins/index.d.ts +15 -30
  49. package/dist/resources/payins/index.js +12 -20
  50. package/dist/resources/payins/index.mjs +1 -1
  51. package/dist/resources/payins/payins-quotes.test.js +235 -435
  52. package/dist/resources/payins/payins-quotes.test.mjs +16 -18
  53. package/dist/resources/payins/payins.test.js +240 -449
  54. package/dist/resources/payins/payins.test.mjs +21 -32
  55. package/dist/resources/payins/quotes.d.mts +3 -5
  56. package/dist/resources/payins/quotes.d.ts +3 -5
  57. package/dist/resources/payins/quotes.js +4 -12
  58. package/dist/resources/payins/quotes.mjs +1 -1
  59. package/dist/resources/payouts/index.d.mts +13 -28
  60. package/dist/resources/payouts/index.d.ts +13 -28
  61. package/dist/resources/payouts/index.js +12 -32
  62. package/dist/resources/payouts/index.mjs +1 -1
  63. package/dist/resources/payouts/payouts.test.js +239 -449
  64. package/dist/resources/payouts/payouts.test.mjs +20 -32
  65. package/dist/resources/quotes/index.d.mts +3 -5
  66. package/dist/resources/quotes/index.d.ts +3 -5
  67. package/dist/resources/quotes/index.js +4 -12
  68. package/dist/resources/quotes/index.mjs +1 -1
  69. package/dist/resources/quotes/quotes.test.js +235 -435
  70. package/dist/resources/quotes/quotes.test.mjs +16 -18
  71. package/dist/resources/receivers/index.d.mts +13 -27
  72. package/dist/resources/receivers/index.d.ts +13 -27
  73. package/dist/resources/receivers/index.js +12 -30
  74. package/dist/resources/receivers/index.mjs +1 -1
  75. package/dist/resources/receivers/receivers.test.js +241 -452
  76. package/dist/resources/receivers/receivers.test.mjs +22 -35
  77. package/dist/resources/virtual-accounts/index.d.mts +7 -12
  78. package/dist/resources/virtual-accounts/index.d.ts +7 -12
  79. package/dist/resources/virtual-accounts/index.js +9 -16
  80. package/dist/resources/virtual-accounts/index.mjs +1 -1
  81. package/dist/resources/virtual-accounts/virtual-accounts.test.js +238 -441
  82. package/dist/resources/virtual-accounts/virtual-accounts.test.mjs +19 -24
  83. package/dist/resources/wallets/blockchain.d.mts +23 -31
  84. package/dist/resources/wallets/blockchain.d.ts +23 -31
  85. package/dist/resources/wallets/blockchain.js +51 -33
  86. package/dist/resources/wallets/blockchain.mjs +1 -1
  87. package/dist/resources/wallets/blockchain.test.js +268 -451
  88. package/dist/resources/wallets/blockchain.test.mjs +49 -34
  89. package/dist/resources/wallets/offramp.d.mts +10 -13
  90. package/dist/resources/wallets/offramp.d.ts +10 -13
  91. package/dist/resources/wallets/offramp.js +14 -14
  92. package/dist/resources/wallets/offramp.mjs +1 -1
  93. package/dist/resources/wallets/offramp.test.js +241 -442
  94. package/dist/resources/wallets/offramp.test.mjs +22 -25
  95. package/dist/resources/webhooks/index.d.mts +9 -22
  96. package/dist/resources/webhooks/index.d.ts +9 -22
  97. package/dist/resources/webhooks/index.js +6 -17
  98. package/dist/resources/webhooks/index.mjs +1 -1
  99. package/dist/resources/webhooks/webhooks.test.js +239 -448
  100. package/dist/resources/webhooks/webhooks.test.mjs +20 -31
  101. package/package.json +2 -4
  102. package/dist/chunk-2DAKB5XK.mjs +0 -212
  103. package/dist/chunk-GEDDLCJY.mjs +0 -77
  104. package/dist/chunk-LK3JPQ6I.mjs +0 -49
  105. package/dist/chunk-LLWEHHKB.mjs +0 -47
@@ -6,23 +6,23 @@ import {
6
6
  it
7
7
  } from "../../chunk-GCCHFONX.mjs";
8
8
  import {
9
- Blindpay,
9
+ BlindPay,
10
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";
11
+ } from "../../chunk-YPXYUS2X.mjs";
12
+ import "../../chunk-IZYPRCCV.mjs";
13
+ import "../../chunk-QGNLMN6Z.mjs";
14
+ import "../../chunk-UC57SCKQ.mjs";
15
+ import "../../chunk-TBTA7A2P.mjs";
16
+ import "../../chunk-BONN6PYB.mjs";
17
+ import "../../chunk-5XJJKYXE.mjs";
18
+ import "../../chunk-RC5NN5UF.mjs";
19
+ import "../../chunk-W7NJUABI.mjs";
20
+ import "../../chunk-E7M4CJKR.mjs";
21
+ import "../../chunk-3QQCDR3E.mjs";
22
+ import "../../chunk-LRHWT4JU.mjs";
24
23
  import "../../chunk-QHMIK7U3.mjs";
25
- import "../../chunk-LLWEHHKB.mjs";
24
+ import "../../chunk-64EFLUS3.mjs";
25
+ import "../../chunk-B5T7AQLH.mjs";
26
26
  import {
27
27
  __async,
28
28
  __commonJS
@@ -35,7 +35,7 @@ var require_partner_fees_test = __commonJS({
35
35
  init_client();
36
36
  describe("Partner fees", () => {
37
37
  afterEach(() => fetchMock.resetMocks());
38
- const blindpay = new Blindpay("test-key");
38
+ const blindpay = new BlindPay({ apiKey: "test-key", instanceId: "in_000000000000" });
39
39
  describe("List partner fees", () => {
40
40
  it("should list partner fees", () => __async(null, null, function* () {
41
41
  const mockedList = [
@@ -54,9 +54,7 @@ var require_partner_fees_test = __commonJS({
54
54
  fetchMock.mockResponseOnce(JSON.stringify(mockedList), {
55
55
  headers: { "Content-Type": "application/json" }
56
56
  });
57
- const { data, error } = yield blindpay.partnerFees.list({
58
- instanceId: "in_000000000000"
59
- });
57
+ const { data, error } = yield blindpay.partnerFees.list();
60
58
  globalExpect(error).toBeNull();
61
59
  globalExpect(data).toEqual(mockedList);
62
60
  }));
@@ -78,7 +76,6 @@ var require_partner_fees_test = __commonJS({
78
76
  headers: { "Content-Type": "application/json" }
79
77
  });
80
78
  const { data, error } = yield blindpay.partnerFees.create({
81
- instanceId: "in_000000000000",
82
79
  name: "Display Name",
83
80
  payout_percentage_fee: 0,
84
81
  payout_flat_fee: 0,
@@ -107,10 +104,7 @@ var require_partner_fees_test = __commonJS({
107
104
  fetchMock.mockResponseOnce(JSON.stringify(mockedFee), {
108
105
  headers: { "Content-Type": "application/json" }
109
106
  });
110
- const { data, error } = yield blindpay.partnerFees.get({
111
- instanceId: "in_000000000000",
112
- id: "fe_000000000000"
113
- });
107
+ const { data, error } = yield blindpay.partnerFees.get("fe_000000000000");
114
108
  globalExpect(error).toBeNull();
115
109
  globalExpect(data).toEqual(mockedFee);
116
110
  }));
@@ -120,10 +114,7 @@ var require_partner_fees_test = __commonJS({
120
114
  fetchMock.mockResponseOnce(JSON.stringify({ data: null }), {
121
115
  headers: { "Content-Type": "application/json" }
122
116
  });
123
- const { data, error } = yield blindpay.partnerFees.delete({
124
- instanceId: "in_000000000000",
125
- id: "fe_000000000000"
126
- });
117
+ const { data, error } = yield blindpay.partnerFees.delete("fe_000000000000");
127
118
  globalExpect(error).toBeNull();
128
119
  globalExpect(data).toEqual({ data: null });
129
120
  }));
@@ -1,4 +1,4 @@
1
- import { I as InternalApiClient, P as PaginationParams, T as TransactionStatus, N as Network, B as BlindpayApiResponse, b as TrackingTransaction, c as TrackingPayment, d as TrackingComplete, e as TrackingPartnerFee, S as StablecoinToken, f as PaginationMetadata } from '../../api-client-Cw2mNJeR.mjs';
1
+ import { I as InternalApiClient, P as PaginationParams, T as TransactionStatus, B as BlindpayApiResponse, b as TrackingTransaction, c as TrackingPayment, d as TrackingComplete, e as TrackingPartnerFee, S as StablecoinToken, N as Network, f as PaginationMetadata } from '../../api-client-Cw2mNJeR.mjs';
2
2
 
3
3
  type Payin = {
4
4
  receiver_id: string;
@@ -62,19 +62,15 @@ type Payin = {
62
62
  };
63
63
  };
64
64
  };
65
- type ListPayinsInput = {
66
- instanceId: string;
67
- params?: PaginationParams & {
68
- status?: TransactionStatus;
69
- receiver_id?: Network;
70
- };
65
+ type ListPayinsInput = PaginationParams & {
66
+ status?: TransactionStatus;
67
+ receiver_id?: string;
71
68
  };
72
69
  type ListPayinsResponse = {
73
70
  data: Payin[];
74
71
  pagination: PaginationMetadata;
75
72
  };
76
73
  type CreatePayinInput = {
77
- instanceId: string;
78
74
  quote_id: string;
79
75
  sender_address: string;
80
76
  receiver_address: string;
@@ -83,14 +79,9 @@ type CreatePayinInput = {
83
79
  network: Network;
84
80
  description?: string | null;
85
81
  };
86
- type GetPayinInput = {
87
- instanceId: string;
88
- id: string;
89
- };
82
+ type GetPayinInput = string;
90
83
  type GetPayinResponse = Payin;
91
- type GetPayinTrackInput = {
92
- id: string;
93
- };
84
+ type GetPayinTrackInput = string;
94
85
  type GetPayinTrackResponse = {
95
86
  receiver_id: string;
96
87
  id: string;
@@ -177,24 +168,18 @@ type GetPayinTrackResponse = {
177
168
  };
178
169
  };
179
170
  };
180
- type ExportPayinsInput = {
181
- instanceId: string;
182
- params?: Pick<PaginationParams, "limit" | "offset"> & {
183
- status: TransactionStatus;
184
- };
171
+ type ExportPayinsInput = Pick<PaginationParams, "limit" | "offset"> & {
172
+ status: TransactionStatus;
185
173
  };
186
174
  type ExportPayinsResponse = Payin[];
187
- type CreateEvmPayinInput = {
188
- instanceId: string;
189
- payin_quote_id: string;
190
- };
175
+ type CreateEvmPayinInput = string;
191
176
  type CreateEvmPayinResponse = Pick<Payin, "id" | "status" | "pix_code" | "memo_code" | "clabe" | "tracking_complete" | "tracking_payment" | "tracking_transaction" | "tracking_partner_fee" | "blindpay_bank_details" | "receiver_id" | "receiver_amount">;
192
- declare function createPayinsResource(client: InternalApiClient): {
193
- list({ instanceId, params, }: ListPayinsInput): Promise<BlindpayApiResponse<ListPayinsResponse>>;
194
- get({ instanceId, id }: GetPayinInput): Promise<BlindpayApiResponse<GetPayinResponse>>;
195
- getTrack({ id }: GetPayinTrackInput): Promise<BlindpayApiResponse<GetPayinTrackResponse>>;
196
- export({ instanceId, params, }: ExportPayinsInput): Promise<BlindpayApiResponse<ExportPayinsResponse>>;
197
- createEvm({ instanceId, ...data }: CreateEvmPayinInput): Promise<BlindpayApiResponse<CreateEvmPayinResponse>>;
177
+ declare function createPayinsResource(instanceId: string, client: InternalApiClient): {
178
+ list(params?: ListPayinsInput): Promise<BlindpayApiResponse<ListPayinsResponse>>;
179
+ get(payinId: GetPayinInput): Promise<BlindpayApiResponse<GetPayinResponse>>;
180
+ getTrack(payinId: GetPayinTrackInput): Promise<BlindpayApiResponse<GetPayinTrackResponse>>;
181
+ export({ ...params }: ExportPayinsInput): Promise<BlindpayApiResponse<ExportPayinsResponse>>;
182
+ createEvm(payin_quote_id: CreateEvmPayinInput): Promise<BlindpayApiResponse<CreateEvmPayinResponse>>;
198
183
  };
199
184
 
200
185
  export { type CreateEvmPayinInput, type CreateEvmPayinResponse, type CreatePayinInput, type ExportPayinsInput, type ExportPayinsResponse, type GetPayinInput, type GetPayinResponse, type GetPayinTrackInput, type GetPayinTrackResponse, type ListPayinsInput, type ListPayinsResponse, type Payin, createPayinsResource };
@@ -1,4 +1,4 @@
1
- import { I as InternalApiClient, P as PaginationParams, T as TransactionStatus, N as Network, B as BlindpayApiResponse, b as TrackingTransaction, c as TrackingPayment, d as TrackingComplete, e as TrackingPartnerFee, S as StablecoinToken, f as PaginationMetadata } from '../../api-client-Cw2mNJeR.js';
1
+ import { I as InternalApiClient, P as PaginationParams, T as TransactionStatus, B as BlindpayApiResponse, b as TrackingTransaction, c as TrackingPayment, d as TrackingComplete, e as TrackingPartnerFee, S as StablecoinToken, N as Network, f as PaginationMetadata } from '../../api-client-Cw2mNJeR.js';
2
2
 
3
3
  type Payin = {
4
4
  receiver_id: string;
@@ -62,19 +62,15 @@ type Payin = {
62
62
  };
63
63
  };
64
64
  };
65
- type ListPayinsInput = {
66
- instanceId: string;
67
- params?: PaginationParams & {
68
- status?: TransactionStatus;
69
- receiver_id?: Network;
70
- };
65
+ type ListPayinsInput = PaginationParams & {
66
+ status?: TransactionStatus;
67
+ receiver_id?: string;
71
68
  };
72
69
  type ListPayinsResponse = {
73
70
  data: Payin[];
74
71
  pagination: PaginationMetadata;
75
72
  };
76
73
  type CreatePayinInput = {
77
- instanceId: string;
78
74
  quote_id: string;
79
75
  sender_address: string;
80
76
  receiver_address: string;
@@ -83,14 +79,9 @@ type CreatePayinInput = {
83
79
  network: Network;
84
80
  description?: string | null;
85
81
  };
86
- type GetPayinInput = {
87
- instanceId: string;
88
- id: string;
89
- };
82
+ type GetPayinInput = string;
90
83
  type GetPayinResponse = Payin;
91
- type GetPayinTrackInput = {
92
- id: string;
93
- };
84
+ type GetPayinTrackInput = string;
94
85
  type GetPayinTrackResponse = {
95
86
  receiver_id: string;
96
87
  id: string;
@@ -177,24 +168,18 @@ type GetPayinTrackResponse = {
177
168
  };
178
169
  };
179
170
  };
180
- type ExportPayinsInput = {
181
- instanceId: string;
182
- params?: Pick<PaginationParams, "limit" | "offset"> & {
183
- status: TransactionStatus;
184
- };
171
+ type ExportPayinsInput = Pick<PaginationParams, "limit" | "offset"> & {
172
+ status: TransactionStatus;
185
173
  };
186
174
  type ExportPayinsResponse = Payin[];
187
- type CreateEvmPayinInput = {
188
- instanceId: string;
189
- payin_quote_id: string;
190
- };
175
+ type CreateEvmPayinInput = string;
191
176
  type CreateEvmPayinResponse = Pick<Payin, "id" | "status" | "pix_code" | "memo_code" | "clabe" | "tracking_complete" | "tracking_payment" | "tracking_transaction" | "tracking_partner_fee" | "blindpay_bank_details" | "receiver_id" | "receiver_amount">;
192
- declare function createPayinsResource(client: InternalApiClient): {
193
- list({ instanceId, params, }: ListPayinsInput): Promise<BlindpayApiResponse<ListPayinsResponse>>;
194
- get({ instanceId, id }: GetPayinInput): Promise<BlindpayApiResponse<GetPayinResponse>>;
195
- getTrack({ id }: GetPayinTrackInput): Promise<BlindpayApiResponse<GetPayinTrackResponse>>;
196
- export({ instanceId, params, }: ExportPayinsInput): Promise<BlindpayApiResponse<ExportPayinsResponse>>;
197
- createEvm({ instanceId, ...data }: CreateEvmPayinInput): Promise<BlindpayApiResponse<CreateEvmPayinResponse>>;
177
+ declare function createPayinsResource(instanceId: string, client: InternalApiClient): {
178
+ list(params?: ListPayinsInput): Promise<BlindpayApiResponse<ListPayinsResponse>>;
179
+ get(payinId: GetPayinInput): Promise<BlindpayApiResponse<GetPayinResponse>>;
180
+ getTrack(payinId: GetPayinTrackInput): Promise<BlindpayApiResponse<GetPayinTrackResponse>>;
181
+ export({ ...params }: ExportPayinsInput): Promise<BlindpayApiResponse<ExportPayinsResponse>>;
182
+ createEvm(payin_quote_id: CreateEvmPayinInput): Promise<BlindpayApiResponse<CreateEvmPayinResponse>>;
198
183
  };
199
184
 
200
185
  export { type CreateEvmPayinInput, type CreateEvmPayinResponse, type CreatePayinInput, type ExportPayinsInput, type ExportPayinsResponse, type GetPayinInput, type GetPayinResponse, type GetPayinTrackInput, type GetPayinTrackResponse, type ListPayinsInput, type ListPayinsResponse, type Payin, createPayinsResource };
@@ -37,35 +37,27 @@ __export(payins_exports, {
37
37
  createPayinsResource: () => createPayinsResource
38
38
  });
39
39
  module.exports = __toCommonJS(payins_exports);
40
- function createPayinsResource(client) {
40
+ function createPayinsResource(instanceId, client) {
41
41
  return {
42
- list({
43
- instanceId,
44
- params
45
- }) {
42
+ list(params) {
46
43
  const queryParams = params ? `?${new URLSearchParams(params)}` : "";
47
44
  return client.get(`/instances/${instanceId}/payins${queryParams}`);
48
45
  },
49
- get({ instanceId, id }) {
50
- return client.get(`/instances/${instanceId}/payins/${id}`);
46
+ get(payinId) {
47
+ return client.get(`/instances/${instanceId}/payins/${payinId}`);
51
48
  },
52
- getTrack({ id }) {
53
- return client.get(`/e/payins/${id}`);
49
+ getTrack(payinId) {
50
+ return client.get(`/e/payins/${payinId}`);
54
51
  },
55
- export({
56
- instanceId,
57
- params
58
- }) {
52
+ export(_a) {
53
+ var params = __objRest(_a, []);
59
54
  const queryParams = params ? `?${new URLSearchParams(params)}` : "";
60
55
  return client.get(`/instances/${instanceId}/export/payins${queryParams}`);
61
56
  },
62
- createEvm(_a) {
63
- var _b = _a, {
64
- instanceId
65
- } = _b, data = __objRest(_b, [
66
- "instanceId"
67
- ]);
68
- return client.post(`/instances/${instanceId}/payins/evm`, data);
57
+ createEvm(payin_quote_id) {
58
+ return client.post(`/instances/${instanceId}/payins/evm`, {
59
+ payin_quote_id
60
+ });
69
61
  }
70
62
  };
71
63
  }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createPayinsResource,
3
3
  init_payins
4
- } from "../../chunk-UCAW3RTZ.mjs";
4
+ } from "../../chunk-W7NJUABI.mjs";
5
5
  import "../../chunk-OBKEW4AQ.mjs";
6
6
  init_payins();
7
7
  export {