@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.
- package/LICENSE +1 -1
- package/README.md +24 -37
- package/dist/{chunk-HKFAJXJG.mjs → chunk-3QQCDR3E.mjs} +12 -32
- package/dist/{chunk-LUDGZPXY.mjs → chunk-5XJJKYXE.mjs} +9 -16
- package/dist/chunk-64EFLUS3.mjs +106 -0
- package/dist/chunk-B5T7AQLH.mjs +38 -0
- package/dist/{chunk-VKN2AMCW.mjs → chunk-BONN6PYB.mjs} +12 -30
- package/dist/{chunk-M6IYYMRW.mjs → chunk-E7M4CJKR.mjs} +4 -12
- package/dist/chunk-IZYPRCCV.mjs +82 -0
- package/dist/{chunk-QVOSGLUO.mjs → chunk-LRHWT4JU.mjs} +6 -10
- package/dist/chunk-QGNLMN6Z.mjs +49 -0
- package/dist/{chunk-3CZJEDS5.mjs → chunk-RC5NN5UF.mjs} +5 -14
- package/dist/{chunk-GNDAATIJ.mjs → chunk-TBTA7A2P.mjs} +4 -12
- package/dist/{chunk-CNNEROQ7.mjs → chunk-UC57SCKQ.mjs} +6 -17
- package/dist/{chunk-UCAW3RTZ.mjs → chunk-W7NJUABI.mjs} +12 -20
- package/dist/{chunk-ES7RXEM7.mjs → chunk-YPXYUS2X.mjs} +46 -37
- package/dist/index.d.mts +14 -10
- package/dist/index.d.ts +14 -10
- package/dist/index.js +237 -435
- package/dist/index.mjs +19 -19
- package/dist/resources/api-keys/api-keys.test.js +238 -445
- package/dist/resources/api-keys/api-keys.test.mjs +19 -28
- package/dist/resources/api-keys/index.d.mts +20 -20
- package/dist/resources/api-keys/index.d.ts +20 -20
- package/dist/resources/api-keys/index.js +6 -10
- package/dist/resources/api-keys/index.mjs +1 -1
- package/dist/resources/available/available.test.js +235 -433
- package/dist/resources/available/available.test.mjs +16 -16
- package/dist/resources/bank-accounts/bank-accounts.test.js +245 -455
- package/dist/resources/bank-accounts/bank-accounts.test.mjs +26 -38
- package/dist/resources/bank-accounts/index.d.mts +22 -145
- package/dist/resources/bank-accounts/index.d.ts +22 -145
- package/dist/resources/bank-accounts/index.js +102 -184
- package/dist/resources/bank-accounts/index.mjs +1 -1
- package/dist/resources/instances/index.d.mts +9 -20
- package/dist/resources/instances/index.d.ts +9 -20
- package/dist/resources/instances/index.js +11 -20
- package/dist/resources/instances/index.mjs +1 -1
- package/dist/resources/instances/instances.test.js +239 -446
- package/dist/resources/instances/instances.test.mjs +20 -29
- package/dist/resources/partner-fees/index.d.mts +8 -18
- package/dist/resources/partner-fees/index.d.ts +8 -18
- package/dist/resources/partner-fees/index.js +5 -14
- package/dist/resources/partner-fees/index.mjs +1 -1
- package/dist/resources/partner-fees/partner-fees.test.js +238 -445
- package/dist/resources/partner-fees/partner-fees.test.mjs +19 -28
- package/dist/resources/payins/index.d.mts +15 -30
- package/dist/resources/payins/index.d.ts +15 -30
- package/dist/resources/payins/index.js +12 -20
- package/dist/resources/payins/index.mjs +1 -1
- package/dist/resources/payins/payins-quotes.test.js +235 -435
- package/dist/resources/payins/payins-quotes.test.mjs +16 -18
- package/dist/resources/payins/payins.test.js +240 -449
- package/dist/resources/payins/payins.test.mjs +21 -32
- package/dist/resources/payins/quotes.d.mts +3 -5
- package/dist/resources/payins/quotes.d.ts +3 -5
- package/dist/resources/payins/quotes.js +4 -12
- package/dist/resources/payins/quotes.mjs +1 -1
- package/dist/resources/payouts/index.d.mts +13 -28
- package/dist/resources/payouts/index.d.ts +13 -28
- package/dist/resources/payouts/index.js +12 -32
- package/dist/resources/payouts/index.mjs +1 -1
- package/dist/resources/payouts/payouts.test.js +239 -449
- package/dist/resources/payouts/payouts.test.mjs +20 -32
- package/dist/resources/quotes/index.d.mts +3 -5
- package/dist/resources/quotes/index.d.ts +3 -5
- package/dist/resources/quotes/index.js +4 -12
- package/dist/resources/quotes/index.mjs +1 -1
- package/dist/resources/quotes/quotes.test.js +235 -435
- package/dist/resources/quotes/quotes.test.mjs +16 -18
- package/dist/resources/receivers/index.d.mts +13 -27
- package/dist/resources/receivers/index.d.ts +13 -27
- package/dist/resources/receivers/index.js +12 -30
- package/dist/resources/receivers/index.mjs +1 -1
- package/dist/resources/receivers/receivers.test.js +241 -452
- package/dist/resources/receivers/receivers.test.mjs +22 -35
- package/dist/resources/virtual-accounts/index.d.mts +7 -12
- package/dist/resources/virtual-accounts/index.d.ts +7 -12
- package/dist/resources/virtual-accounts/index.js +9 -16
- package/dist/resources/virtual-accounts/index.mjs +1 -1
- package/dist/resources/virtual-accounts/virtual-accounts.test.js +238 -441
- package/dist/resources/virtual-accounts/virtual-accounts.test.mjs +19 -24
- package/dist/resources/wallets/blockchain.d.mts +23 -31
- package/dist/resources/wallets/blockchain.d.ts +23 -31
- package/dist/resources/wallets/blockchain.js +51 -33
- package/dist/resources/wallets/blockchain.mjs +1 -1
- package/dist/resources/wallets/blockchain.test.js +268 -451
- package/dist/resources/wallets/blockchain.test.mjs +49 -34
- package/dist/resources/wallets/offramp.d.mts +10 -13
- package/dist/resources/wallets/offramp.d.ts +10 -13
- package/dist/resources/wallets/offramp.js +14 -14
- package/dist/resources/wallets/offramp.mjs +1 -1
- package/dist/resources/wallets/offramp.test.js +241 -442
- package/dist/resources/wallets/offramp.test.mjs +22 -25
- package/dist/resources/webhooks/index.d.mts +9 -22
- package/dist/resources/webhooks/index.d.ts +9 -22
- package/dist/resources/webhooks/index.js +6 -17
- package/dist/resources/webhooks/index.mjs +1 -1
- package/dist/resources/webhooks/webhooks.test.js +239 -448
- package/dist/resources/webhooks/webhooks.test.mjs +20 -31
- package/package.json +2 -4
- package/dist/chunk-2DAKB5XK.mjs +0 -212
- package/dist/chunk-GEDDLCJY.mjs +0 -77
- package/dist/chunk-LK3JPQ6I.mjs +0 -49
- 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
|
-
|
|
9
|
+
BlindPay,
|
|
10
10
|
init_client
|
|
11
|
-
} from "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
16
|
-
import "../../chunk-
|
|
17
|
-
import "../../chunk-
|
|
18
|
-
import "../../chunk-
|
|
19
|
-
import "../../chunk-
|
|
20
|
-
import "../../chunk-
|
|
21
|
-
import "../../chunk-
|
|
22
|
-
import "../../chunk-
|
|
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-
|
|
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_offramp_test = __commonJS({
|
|
|
35
35
|
init_client();
|
|
36
36
|
describe("Offramp wallets", () => {
|
|
37
37
|
afterEach(() => fetchMock.resetMocks());
|
|
38
|
-
const blindpay = new
|
|
38
|
+
const blindpay = new BlindPay({ apiKey: "test-key", instanceId: "in_000000000000" });
|
|
39
39
|
describe("List offramp wallets", () => {
|
|
40
40
|
it("should list offramp wallets", () => __async(null, null, function* () {
|
|
41
41
|
const mockedOfframpWallets = [
|
|
@@ -55,9 +55,8 @@ var require_offramp_test = __commonJS({
|
|
|
55
55
|
headers: { "Content-Type": "application/json" }
|
|
56
56
|
});
|
|
57
57
|
const { data, error } = yield blindpay.wallets.offramp.list({
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
bankAccountId: "ba_000000000000"
|
|
58
|
+
receiver_id: "re_000000000000",
|
|
59
|
+
bank_account_id: "ba_000000000000"
|
|
61
60
|
});
|
|
62
61
|
globalExpect(error).toBeNull();
|
|
63
62
|
globalExpect(data).toEqual(mockedOfframpWallets);
|
|
@@ -75,11 +74,10 @@ var require_offramp_test = __commonJS({
|
|
|
75
74
|
headers: { "Content-Type": "application/json" }
|
|
76
75
|
});
|
|
77
76
|
const { data, error } = yield blindpay.wallets.offramp.create({
|
|
78
|
-
instanceId: "in_000000000000",
|
|
79
77
|
external_id: "your_external_id",
|
|
80
78
|
network: "tron",
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
receiver_id: "re_000000000000",
|
|
80
|
+
bank_account_id: "ba_000000000000"
|
|
83
81
|
});
|
|
84
82
|
globalExpect(error).toBeNull();
|
|
85
83
|
globalExpect(data).toEqual(mockedOfframpWallet);
|
|
@@ -102,10 +100,9 @@ var require_offramp_test = __commonJS({
|
|
|
102
100
|
headers: { "Content-Type": "application/json" }
|
|
103
101
|
});
|
|
104
102
|
const { data, error } = yield blindpay.wallets.offramp.get({
|
|
105
|
-
instanceId: "in_000000000000",
|
|
106
103
|
id: "ow_000000000000",
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
bank_account_id: "ba_000000000000",
|
|
105
|
+
receiver_id: "re_000000000000"
|
|
109
106
|
});
|
|
110
107
|
globalExpect(error).toBeNull();
|
|
111
108
|
globalExpect(data).toEqual(mockedOfframpWallet);
|
|
@@ -2,20 +2,13 @@ import { I as InternalApiClient, B as BlindpayApiResponse } from '../../api-clie
|
|
|
2
2
|
|
|
3
3
|
type WebhookEvents = "receiver.new" | "receiver.update" | "bankAccount.new" | "payout.new" | "payout.update" | "payout.complete" | "payout.partnerFee" | "blockchainWallet.new" | "payin.new" | "payin.update" | "payin.complete" | "payin.partnerFee";
|
|
4
4
|
type CreateWebhookEndpointInput = {
|
|
5
|
-
instanceId: string;
|
|
6
5
|
url: string;
|
|
7
6
|
events: WebhookEvents[];
|
|
8
7
|
};
|
|
9
8
|
type CreateWebhookEndpointResponse = {
|
|
10
9
|
id: string;
|
|
11
10
|
};
|
|
12
|
-
type
|
|
13
|
-
instanceId: string;
|
|
14
|
-
};
|
|
15
|
-
type DeleteWebhookEndpointInput = {
|
|
16
|
-
instanceId: string;
|
|
17
|
-
id: string;
|
|
18
|
-
};
|
|
11
|
+
type DeleteWebhookEndpointInput = string;
|
|
19
12
|
type ListWebhookEndpointsResponse = Array<{
|
|
20
13
|
id: string;
|
|
21
14
|
url: string;
|
|
@@ -25,25 +18,19 @@ type ListWebhookEndpointsResponse = Array<{
|
|
|
25
18
|
created_at: string;
|
|
26
19
|
updated_at: string;
|
|
27
20
|
}>;
|
|
28
|
-
type GetWebhookEndpointSecretInput =
|
|
29
|
-
instanceId: string;
|
|
30
|
-
id: string;
|
|
31
|
-
};
|
|
21
|
+
type GetWebhookEndpointSecretInput = string;
|
|
32
22
|
type GetWebhookEndpointSecretResponse = {
|
|
33
23
|
key: string;
|
|
34
24
|
};
|
|
35
|
-
type GetPortalAccessUrlInput = {
|
|
36
|
-
instanceId: string;
|
|
37
|
-
};
|
|
38
25
|
type GetPortalAccessUrlResponse = {
|
|
39
26
|
url: string;
|
|
40
27
|
};
|
|
41
|
-
declare function createWebhookEndpointsResource(client: InternalApiClient): {
|
|
42
|
-
list(
|
|
43
|
-
create({
|
|
44
|
-
delete(
|
|
45
|
-
getSecret(
|
|
46
|
-
getPortalAccessUrl(
|
|
28
|
+
declare function createWebhookEndpointsResource(instanceId: string, client: InternalApiClient): {
|
|
29
|
+
list(): Promise<BlindpayApiResponse<ListWebhookEndpointsResponse>>;
|
|
30
|
+
create({ ...data }: CreateWebhookEndpointInput): Promise<BlindpayApiResponse<CreateWebhookEndpointResponse>>;
|
|
31
|
+
delete(id: DeleteWebhookEndpointInput): Promise<BlindpayApiResponse<void>>;
|
|
32
|
+
getSecret(id: GetWebhookEndpointSecretInput): Promise<BlindpayApiResponse<GetWebhookEndpointSecretResponse>>;
|
|
33
|
+
getPortalAccessUrl(): Promise<BlindpayApiResponse<GetPortalAccessUrlResponse>>;
|
|
47
34
|
};
|
|
48
35
|
|
|
49
|
-
export { type CreateWebhookEndpointInput, type CreateWebhookEndpointResponse, type DeleteWebhookEndpointInput, type
|
|
36
|
+
export { type CreateWebhookEndpointInput, type CreateWebhookEndpointResponse, type DeleteWebhookEndpointInput, type GetPortalAccessUrlResponse, type GetWebhookEndpointSecretInput, type GetWebhookEndpointSecretResponse, type ListWebhookEndpointsResponse, type WebhookEvents, createWebhookEndpointsResource };
|
|
@@ -2,20 +2,13 @@ import { I as InternalApiClient, B as BlindpayApiResponse } from '../../api-clie
|
|
|
2
2
|
|
|
3
3
|
type WebhookEvents = "receiver.new" | "receiver.update" | "bankAccount.new" | "payout.new" | "payout.update" | "payout.complete" | "payout.partnerFee" | "blockchainWallet.new" | "payin.new" | "payin.update" | "payin.complete" | "payin.partnerFee";
|
|
4
4
|
type CreateWebhookEndpointInput = {
|
|
5
|
-
instanceId: string;
|
|
6
5
|
url: string;
|
|
7
6
|
events: WebhookEvents[];
|
|
8
7
|
};
|
|
9
8
|
type CreateWebhookEndpointResponse = {
|
|
10
9
|
id: string;
|
|
11
10
|
};
|
|
12
|
-
type
|
|
13
|
-
instanceId: string;
|
|
14
|
-
};
|
|
15
|
-
type DeleteWebhookEndpointInput = {
|
|
16
|
-
instanceId: string;
|
|
17
|
-
id: string;
|
|
18
|
-
};
|
|
11
|
+
type DeleteWebhookEndpointInput = string;
|
|
19
12
|
type ListWebhookEndpointsResponse = Array<{
|
|
20
13
|
id: string;
|
|
21
14
|
url: string;
|
|
@@ -25,25 +18,19 @@ type ListWebhookEndpointsResponse = Array<{
|
|
|
25
18
|
created_at: string;
|
|
26
19
|
updated_at: string;
|
|
27
20
|
}>;
|
|
28
|
-
type GetWebhookEndpointSecretInput =
|
|
29
|
-
instanceId: string;
|
|
30
|
-
id: string;
|
|
31
|
-
};
|
|
21
|
+
type GetWebhookEndpointSecretInput = string;
|
|
32
22
|
type GetWebhookEndpointSecretResponse = {
|
|
33
23
|
key: string;
|
|
34
24
|
};
|
|
35
|
-
type GetPortalAccessUrlInput = {
|
|
36
|
-
instanceId: string;
|
|
37
|
-
};
|
|
38
25
|
type GetPortalAccessUrlResponse = {
|
|
39
26
|
url: string;
|
|
40
27
|
};
|
|
41
|
-
declare function createWebhookEndpointsResource(client: InternalApiClient): {
|
|
42
|
-
list(
|
|
43
|
-
create({
|
|
44
|
-
delete(
|
|
45
|
-
getSecret(
|
|
46
|
-
getPortalAccessUrl(
|
|
28
|
+
declare function createWebhookEndpointsResource(instanceId: string, client: InternalApiClient): {
|
|
29
|
+
list(): Promise<BlindpayApiResponse<ListWebhookEndpointsResponse>>;
|
|
30
|
+
create({ ...data }: CreateWebhookEndpointInput): Promise<BlindpayApiResponse<CreateWebhookEndpointResponse>>;
|
|
31
|
+
delete(id: DeleteWebhookEndpointInput): Promise<BlindpayApiResponse<void>>;
|
|
32
|
+
getSecret(id: GetWebhookEndpointSecretInput): Promise<BlindpayApiResponse<GetWebhookEndpointSecretResponse>>;
|
|
33
|
+
getPortalAccessUrl(): Promise<BlindpayApiResponse<GetPortalAccessUrlResponse>>;
|
|
47
34
|
};
|
|
48
35
|
|
|
49
|
-
export { type CreateWebhookEndpointInput, type CreateWebhookEndpointResponse, type DeleteWebhookEndpointInput, type
|
|
36
|
+
export { type CreateWebhookEndpointInput, type CreateWebhookEndpointResponse, type DeleteWebhookEndpointInput, type GetPortalAccessUrlResponse, type GetWebhookEndpointSecretInput, type GetWebhookEndpointSecretResponse, type ListWebhookEndpointsResponse, type WebhookEvents, createWebhookEndpointsResource };
|
|
@@ -37,33 +37,22 @@ __export(webhooks_exports, {
|
|
|
37
37
|
createWebhookEndpointsResource: () => createWebhookEndpointsResource
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(webhooks_exports);
|
|
40
|
-
function createWebhookEndpointsResource(client) {
|
|
40
|
+
function createWebhookEndpointsResource(instanceId, client) {
|
|
41
41
|
return {
|
|
42
|
-
list({
|
|
43
|
-
instanceId
|
|
44
|
-
}) {
|
|
42
|
+
list() {
|
|
45
43
|
return client.get(`/instances/${instanceId}/webhook-endpoints`);
|
|
46
44
|
},
|
|
47
45
|
create(_a) {
|
|
48
|
-
var
|
|
49
|
-
instanceId
|
|
50
|
-
} = _b, data = __objRest(_b, [
|
|
51
|
-
"instanceId"
|
|
52
|
-
]);
|
|
46
|
+
var data = __objRest(_a, []);
|
|
53
47
|
return client.post(`/instances/${instanceId}/webhook-endpoints`, data);
|
|
54
48
|
},
|
|
55
|
-
delete(
|
|
49
|
+
delete(id) {
|
|
56
50
|
return client.delete(`/instances/${instanceId}/webhook-endpoints/${id}`);
|
|
57
51
|
},
|
|
58
|
-
getSecret({
|
|
59
|
-
instanceId,
|
|
60
|
-
id
|
|
61
|
-
}) {
|
|
52
|
+
getSecret(id) {
|
|
62
53
|
return client.get(`/instances/${instanceId}/webhook-endpoints/${id}/secret`);
|
|
63
54
|
},
|
|
64
|
-
getPortalAccessUrl({
|
|
65
|
-
instanceId
|
|
66
|
-
}) {
|
|
55
|
+
getPortalAccessUrl() {
|
|
67
56
|
return client.get(`/instances/${instanceId}/webhook-endpoints/portal-access`);
|
|
68
57
|
}
|
|
69
58
|
};
|