@blindpay/node 1.0.0 → 1.1.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 (104) hide show
  1. package/README.md +24 -37
  2. package/dist/{chunk-HKFAJXJG.mjs → chunk-3QQCDR3E.mjs} +12 -32
  3. package/dist/{chunk-LUDGZPXY.mjs → chunk-5XJJKYXE.mjs} +9 -16
  4. package/dist/chunk-64EFLUS3.mjs +106 -0
  5. package/dist/chunk-B5T7AQLH.mjs +38 -0
  6. package/dist/{chunk-VKN2AMCW.mjs → chunk-BONN6PYB.mjs} +12 -30
  7. package/dist/{chunk-M6IYYMRW.mjs → chunk-E7M4CJKR.mjs} +4 -12
  8. package/dist/chunk-IZYPRCCV.mjs +82 -0
  9. package/dist/{chunk-QVOSGLUO.mjs → chunk-LRHWT4JU.mjs} +6 -10
  10. package/dist/chunk-QGNLMN6Z.mjs +49 -0
  11. package/dist/{chunk-3CZJEDS5.mjs → chunk-RC5NN5UF.mjs} +5 -14
  12. package/dist/{chunk-GNDAATIJ.mjs → chunk-TBTA7A2P.mjs} +4 -12
  13. package/dist/{chunk-CNNEROQ7.mjs → chunk-UC57SCKQ.mjs} +6 -17
  14. package/dist/{chunk-UCAW3RTZ.mjs → chunk-W7NJUABI.mjs} +12 -20
  15. package/dist/{chunk-ES7RXEM7.mjs → chunk-ZPGWM4VJ.mjs} +46 -37
  16. package/dist/index.d.mts +14 -10
  17. package/dist/index.d.ts +14 -10
  18. package/dist/index.js +237 -435
  19. package/dist/index.mjs +19 -19
  20. package/dist/resources/api-keys/api-keys.test.js +238 -445
  21. package/dist/resources/api-keys/api-keys.test.mjs +19 -28
  22. package/dist/resources/api-keys/index.d.mts +20 -20
  23. package/dist/resources/api-keys/index.d.ts +20 -20
  24. package/dist/resources/api-keys/index.js +6 -10
  25. package/dist/resources/api-keys/index.mjs +1 -1
  26. package/dist/resources/available/available.test.js +235 -433
  27. package/dist/resources/available/available.test.mjs +16 -16
  28. package/dist/resources/bank-accounts/bank-accounts.test.js +245 -455
  29. package/dist/resources/bank-accounts/bank-accounts.test.mjs +26 -38
  30. package/dist/resources/bank-accounts/index.d.mts +22 -145
  31. package/dist/resources/bank-accounts/index.d.ts +22 -145
  32. package/dist/resources/bank-accounts/index.js +102 -184
  33. package/dist/resources/bank-accounts/index.mjs +1 -1
  34. package/dist/resources/instances/index.d.mts +9 -20
  35. package/dist/resources/instances/index.d.ts +9 -20
  36. package/dist/resources/instances/index.js +11 -20
  37. package/dist/resources/instances/index.mjs +1 -1
  38. package/dist/resources/instances/instances.test.js +239 -446
  39. package/dist/resources/instances/instances.test.mjs +20 -29
  40. package/dist/resources/partner-fees/index.d.mts +8 -18
  41. package/dist/resources/partner-fees/index.d.ts +8 -18
  42. package/dist/resources/partner-fees/index.js +5 -14
  43. package/dist/resources/partner-fees/index.mjs +1 -1
  44. package/dist/resources/partner-fees/partner-fees.test.js +238 -445
  45. package/dist/resources/partner-fees/partner-fees.test.mjs +19 -28
  46. package/dist/resources/payins/index.d.mts +15 -30
  47. package/dist/resources/payins/index.d.ts +15 -30
  48. package/dist/resources/payins/index.js +12 -20
  49. package/dist/resources/payins/index.mjs +1 -1
  50. package/dist/resources/payins/payins-quotes.test.js +235 -435
  51. package/dist/resources/payins/payins-quotes.test.mjs +16 -18
  52. package/dist/resources/payins/payins.test.js +240 -449
  53. package/dist/resources/payins/payins.test.mjs +21 -32
  54. package/dist/resources/payins/quotes.d.mts +3 -5
  55. package/dist/resources/payins/quotes.d.ts +3 -5
  56. package/dist/resources/payins/quotes.js +4 -12
  57. package/dist/resources/payins/quotes.mjs +1 -1
  58. package/dist/resources/payouts/index.d.mts +13 -28
  59. package/dist/resources/payouts/index.d.ts +13 -28
  60. package/dist/resources/payouts/index.js +12 -32
  61. package/dist/resources/payouts/index.mjs +1 -1
  62. package/dist/resources/payouts/payouts.test.js +239 -449
  63. package/dist/resources/payouts/payouts.test.mjs +20 -32
  64. package/dist/resources/quotes/index.d.mts +3 -5
  65. package/dist/resources/quotes/index.d.ts +3 -5
  66. package/dist/resources/quotes/index.js +4 -12
  67. package/dist/resources/quotes/index.mjs +1 -1
  68. package/dist/resources/quotes/quotes.test.js +235 -435
  69. package/dist/resources/quotes/quotes.test.mjs +16 -18
  70. package/dist/resources/receivers/index.d.mts +13 -27
  71. package/dist/resources/receivers/index.d.ts +13 -27
  72. package/dist/resources/receivers/index.js +12 -30
  73. package/dist/resources/receivers/index.mjs +1 -1
  74. package/dist/resources/receivers/receivers.test.js +241 -452
  75. package/dist/resources/receivers/receivers.test.mjs +22 -35
  76. package/dist/resources/virtual-accounts/index.d.mts +7 -12
  77. package/dist/resources/virtual-accounts/index.d.ts +7 -12
  78. package/dist/resources/virtual-accounts/index.js +9 -16
  79. package/dist/resources/virtual-accounts/index.mjs +1 -1
  80. package/dist/resources/virtual-accounts/virtual-accounts.test.js +238 -441
  81. package/dist/resources/virtual-accounts/virtual-accounts.test.mjs +19 -24
  82. package/dist/resources/wallets/blockchain.d.mts +23 -31
  83. package/dist/resources/wallets/blockchain.d.ts +23 -31
  84. package/dist/resources/wallets/blockchain.js +51 -33
  85. package/dist/resources/wallets/blockchain.mjs +1 -1
  86. package/dist/resources/wallets/blockchain.test.js +268 -451
  87. package/dist/resources/wallets/blockchain.test.mjs +49 -34
  88. package/dist/resources/wallets/offramp.d.mts +10 -13
  89. package/dist/resources/wallets/offramp.d.ts +10 -13
  90. package/dist/resources/wallets/offramp.js +14 -14
  91. package/dist/resources/wallets/offramp.mjs +1 -1
  92. package/dist/resources/wallets/offramp.test.js +241 -442
  93. package/dist/resources/wallets/offramp.test.mjs +22 -25
  94. package/dist/resources/webhooks/index.d.mts +9 -22
  95. package/dist/resources/webhooks/index.d.ts +9 -22
  96. package/dist/resources/webhooks/index.js +6 -17
  97. package/dist/resources/webhooks/index.mjs +1 -1
  98. package/dist/resources/webhooks/webhooks.test.js +239 -448
  99. package/dist/resources/webhooks/webhooks.test.mjs +20 -31
  100. package/package.json +2 -4
  101. package/dist/chunk-2DAKB5XK.mjs +0 -212
  102. package/dist/chunk-GEDDLCJY.mjs +0 -77
  103. package/dist/chunk-LK3JPQ6I.mjs +0 -49
  104. 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-ZPGWM4VJ.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,17 +35,14 @@ var require_blockchain_test = __commonJS({
35
35
  init_client();
36
36
  describe("Blockchain wallets", () => {
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("Get blockchain wallet message", () => {
40
40
  it("should get blockchain wallet message", () => __async(null, null, function* () {
41
41
  const mockedMessage = { message: "random" };
42
42
  fetchMock.mockResponseOnce(JSON.stringify(mockedMessage), {
43
43
  headers: { "Content-Type": "application/json" }
44
44
  });
45
- const { data, error } = yield blindpay.wallets.blockchain.getWalletMessage({
46
- instanceId: "in_000000000000",
47
- receiverId: "re_000000000000"
48
- });
45
+ const { data, error } = yield blindpay.wallets.blockchain.getWalletMessage("re_000000000000");
49
46
  globalExpect(error).toBeNull();
50
47
  globalExpect(data).toEqual(mockedMessage);
51
48
  }));
@@ -66,16 +63,37 @@ var require_blockchain_test = __commonJS({
66
63
  fetchMock.mockResponseOnce(JSON.stringify(mockedWallets), {
67
64
  headers: { "Content-Type": "application/json" }
68
65
  });
69
- const { data, error } = yield blindpay.wallets.blockchain.list({
70
- instanceId: "in_000000000000",
71
- receiverId: "re_000000000000"
72
- });
66
+ const { data, error } = yield blindpay.wallets.blockchain.list("re_000000000000");
73
67
  globalExpect(error).toBeNull();
74
68
  globalExpect(data).toEqual(mockedWallets);
75
69
  }));
76
70
  });
77
- describe("Create blockchain wallet", () => {
78
- it("should create a blockchain wallet", () => __async(null, null, function* () {
71
+ describe("Create blockchain wallet with address", () => {
72
+ it("should create a blockchain wallet with address (account abstraction)", () => __async(null, null, function* () {
73
+ const mockedWallet = {
74
+ id: "bw_000000000000",
75
+ name: "Wallet Display Name",
76
+ network: "polygon",
77
+ address: "0xDD6a3aD0949396e57C7738ba8FC1A46A5a1C372C",
78
+ signature_tx_hash: void 0,
79
+ is_account_abstraction: true,
80
+ receiver_id: "re_000000000000"
81
+ };
82
+ fetchMock.mockResponseOnce(JSON.stringify(mockedWallet), {
83
+ headers: { "Content-Type": "application/json" }
84
+ });
85
+ const { data, error } = yield blindpay.wallets.blockchain.createWithAddress({
86
+ receiver_id: "re_000000000000",
87
+ name: "Wallet Display Name",
88
+ network: "polygon",
89
+ address: "0xDD6a3aD0949396e57C7738ba8FC1A46A5a1C372C"
90
+ });
91
+ globalExpect(error).toBeNull();
92
+ globalExpect(data).toEqual(mockedWallet);
93
+ }));
94
+ });
95
+ describe("Create blockchain wallet with hash", () => {
96
+ it("should create a blockchain wallet with hash (without account abstraction)", () => __async(null, null, function* () {
79
97
  const mockedWallet = {
80
98
  id: "bw_000000000000",
81
99
  name: "Wallet Display Name",
@@ -88,12 +106,11 @@ var require_blockchain_test = __commonJS({
88
106
  fetchMock.mockResponseOnce(JSON.stringify(mockedWallet), {
89
107
  headers: { "Content-Type": "application/json" }
90
108
  });
91
- const { data, error } = yield blindpay.wallets.blockchain.create({
92
- instanceId: "in_000000000000",
93
- receiverId: "re_000000000000",
109
+ const { data, error } = yield blindpay.wallets.blockchain.createWithHash({
110
+ receiver_id: "re_000000000000",
94
111
  name: "Wallet Display Name",
95
112
  network: "polygon",
96
- address: "0xDD6a3aD0949396e57C7738ba8FC1A46A5a1C372C"
113
+ signature_tx_hash: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359"
97
114
  });
98
115
  globalExpect(error).toBeNull();
99
116
  globalExpect(data).toEqual(mockedWallet);
@@ -114,8 +131,7 @@ var require_blockchain_test = __commonJS({
114
131
  headers: { "Content-Type": "application/json" }
115
132
  });
116
133
  const { data, error } = yield blindpay.wallets.blockchain.get({
117
- instanceId: "in_000000000000",
118
- receiverId: "re_000000000000",
134
+ receiver_id: "re_000000000000",
119
135
  id: "bw_000000000000"
120
136
  });
121
137
  globalExpect(error).toBeNull();
@@ -128,8 +144,7 @@ var require_blockchain_test = __commonJS({
128
144
  headers: { "Content-Type": "application/json" }
129
145
  });
130
146
  const { data, error } = yield blindpay.wallets.blockchain.delete({
131
- instanceId: "in_000000000000",
132
- receiverId: "re_000000000000",
147
+ receiver_id: "re_000000000000",
133
148
  id: "bw_000000000000"
134
149
  });
135
150
  globalExpect(error).toBeNull();
@@ -12,15 +12,13 @@ type OfframpWallet = {
12
12
  updated_at: string;
13
13
  };
14
14
  type ListOfframpWalletsInput = {
15
- instanceId: string;
16
- receiverId: string;
17
- bankAccountId: string;
15
+ receiver_id: string;
16
+ bank_account_id: string;
18
17
  };
19
18
  type ListOfframpWalletsResponse = OfframpWallet[];
20
19
  type CreateOfframpWalletInput = {
21
- receiverId: string;
22
- instanceId: string;
23
- bankAccountId: string;
20
+ receiver_id: string;
21
+ bank_account_id: string;
24
22
  external_id: string;
25
23
  network: "tron";
26
24
  };
@@ -31,16 +29,15 @@ type CreateOfframpWalletResponse = {
31
29
  address: string;
32
30
  };
33
31
  type GetOfframpWalletInput = {
34
- receiverId: string;
35
- instanceId: string;
36
- bankAccountId: string;
32
+ receiver_id: string;
33
+ bank_account_id: string;
37
34
  id: string;
38
35
  };
39
36
  type GetOfframpWalletResponse = OfframpWallet;
40
- declare function createOfframpWalletsResource(client: InternalApiClient): {
41
- list({ instanceId, }: ListOfframpWalletsInput): Promise<BlindpayApiResponse<ListOfframpWalletsResponse>>;
42
- create({ receiverId, instanceId, bankAccountId, ...data }: CreateOfframpWalletInput): Promise<BlindpayApiResponse<CreateOfframpWalletResponse>>;
43
- get({ receiverId, instanceId, bankAccountId, id, }: GetOfframpWalletInput): Promise<BlindpayApiResponse<GetOfframpWalletResponse>>;
37
+ declare function createOfframpWalletsResource(instanceId: string, client: InternalApiClient): {
38
+ list({ bank_account_id, receiver_id, }: ListOfframpWalletsInput): Promise<BlindpayApiResponse<ListOfframpWalletsResponse>>;
39
+ create({ receiver_id, bank_account_id, ...data }: CreateOfframpWalletInput): Promise<BlindpayApiResponse<CreateOfframpWalletResponse>>;
40
+ get({ receiver_id, bank_account_id, id, }: GetOfframpWalletInput): Promise<BlindpayApiResponse<GetOfframpWalletResponse>>;
44
41
  };
45
42
 
46
43
  export { type CreateOfframpWalletInput, type CreateOfframpWalletResponse, type GetOfframpWalletInput, type GetOfframpWalletResponse, type ListOfframpWalletsInput, type ListOfframpWalletsResponse, type OfframpWallet, createOfframpWalletsResource };
@@ -12,15 +12,13 @@ type OfframpWallet = {
12
12
  updated_at: string;
13
13
  };
14
14
  type ListOfframpWalletsInput = {
15
- instanceId: string;
16
- receiverId: string;
17
- bankAccountId: string;
15
+ receiver_id: string;
16
+ bank_account_id: string;
18
17
  };
19
18
  type ListOfframpWalletsResponse = OfframpWallet[];
20
19
  type CreateOfframpWalletInput = {
21
- receiverId: string;
22
- instanceId: string;
23
- bankAccountId: string;
20
+ receiver_id: string;
21
+ bank_account_id: string;
24
22
  external_id: string;
25
23
  network: "tron";
26
24
  };
@@ -31,16 +29,15 @@ type CreateOfframpWalletResponse = {
31
29
  address: string;
32
30
  };
33
31
  type GetOfframpWalletInput = {
34
- receiverId: string;
35
- instanceId: string;
36
- bankAccountId: string;
32
+ receiver_id: string;
33
+ bank_account_id: string;
37
34
  id: string;
38
35
  };
39
36
  type GetOfframpWalletResponse = OfframpWallet;
40
- declare function createOfframpWalletsResource(client: InternalApiClient): {
41
- list({ instanceId, }: ListOfframpWalletsInput): Promise<BlindpayApiResponse<ListOfframpWalletsResponse>>;
42
- create({ receiverId, instanceId, bankAccountId, ...data }: CreateOfframpWalletInput): Promise<BlindpayApiResponse<CreateOfframpWalletResponse>>;
43
- get({ receiverId, instanceId, bankAccountId, id, }: GetOfframpWalletInput): Promise<BlindpayApiResponse<GetOfframpWalletResponse>>;
37
+ declare function createOfframpWalletsResource(instanceId: string, client: InternalApiClient): {
38
+ list({ bank_account_id, receiver_id, }: ListOfframpWalletsInput): Promise<BlindpayApiResponse<ListOfframpWalletsResponse>>;
39
+ create({ receiver_id, bank_account_id, ...data }: CreateOfframpWalletInput): Promise<BlindpayApiResponse<CreateOfframpWalletResponse>>;
40
+ get({ receiver_id, bank_account_id, id, }: GetOfframpWalletInput): Promise<BlindpayApiResponse<GetOfframpWalletResponse>>;
44
41
  };
45
42
 
46
43
  export { type CreateOfframpWalletInput, type CreateOfframpWalletResponse, type GetOfframpWalletInput, type GetOfframpWalletResponse, type ListOfframpWalletsInput, type ListOfframpWalletsResponse, type OfframpWallet, createOfframpWalletsResource };
@@ -37,36 +37,36 @@ __export(offramp_exports, {
37
37
  createOfframpWalletsResource: () => createOfframpWalletsResource
38
38
  });
39
39
  module.exports = __toCommonJS(offramp_exports);
40
- function createOfframpWalletsResource(client) {
40
+ function createOfframpWalletsResource(instanceId, client) {
41
41
  return {
42
42
  list({
43
- instanceId
43
+ bank_account_id,
44
+ receiver_id
44
45
  }) {
45
- return client.get(`/instances/${instanceId}/offramp_wallets`);
46
+ return client.get(
47
+ `/instances/${instanceId}/receivers/${receiver_id}/bank-accounts/${bank_account_id}/offramp-wallets`
48
+ );
46
49
  },
47
50
  create(_a) {
48
51
  var _b = _a, {
49
- receiverId,
50
- instanceId,
51
- bankAccountId
52
+ receiver_id,
53
+ bank_account_id
52
54
  } = _b, data = __objRest(_b, [
53
- "receiverId",
54
- "instanceId",
55
- "bankAccountId"
55
+ "receiver_id",
56
+ "bank_account_id"
56
57
  ]);
57
58
  return client.post(
58
- `/instances/${instanceId}/receivers/${receiverId}/bank-accounts/${bankAccountId}/offramp_wallets`,
59
+ `/instances/${instanceId}/receivers/${receiver_id}/bank-accounts/${bank_account_id}/offramp-wallets`,
59
60
  data
60
61
  );
61
62
  },
62
63
  get({
63
- receiverId,
64
- instanceId,
65
- bankAccountId,
64
+ receiver_id,
65
+ bank_account_id,
66
66
  id
67
67
  }) {
68
68
  return client.get(
69
- `/instances/${instanceId}/receivers/${receiverId}/bank-accounts/${bankAccountId}/offramp_wallets/${id}`
69
+ `/instances/${instanceId}/receivers/${receiver_id}/bank-accounts/${bank_account_id}/offramp-wallets/${id}`
70
70
  );
71
71
  }
72
72
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createOfframpWalletsResource,
3
3
  init_offramp
4
- } from "../../chunk-LK3JPQ6I.mjs";
4
+ } from "../../chunk-QGNLMN6Z.mjs";
5
5
  import "../../chunk-OBKEW4AQ.mjs";
6
6
  init_offramp();
7
7
  export {