@blindpay/node 2.2.0 → 2.4.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 (53) hide show
  1. package/dist/{chunk-QCRVXYWF.mjs → chunk-4DVSRRBP.mjs} +10 -4
  2. package/dist/{chunk-IZYPRCCV.mjs → chunk-FG25JHDX.mjs} +8 -0
  3. package/dist/{chunk-E7M4CJKR.mjs → chunk-OTRFWEEC.mjs} +3 -0
  4. package/dist/chunk-Z6EYX4D3.mjs +29 -0
  5. package/dist/index.d.mts +4 -2
  6. package/dist/index.d.ts +4 -2
  7. package/dist/index.js +31 -2
  8. package/dist/index.mjs +4 -3
  9. package/dist/resources/api-keys/api-keys.test.js +31 -2
  10. package/dist/resources/api-keys/api-keys.test.mjs +4 -3
  11. package/dist/resources/available/available.test.js +31 -2
  12. package/dist/resources/available/available.test.mjs +4 -3
  13. package/dist/resources/bank-accounts/bank-accounts.test.js +31 -2
  14. package/dist/resources/bank-accounts/bank-accounts.test.mjs +4 -3
  15. package/dist/resources/instances/instances.test.js +31 -2
  16. package/dist/resources/instances/instances.test.mjs +4 -3
  17. package/dist/resources/partner-fees/partner-fees.test.js +31 -2
  18. package/dist/resources/partner-fees/partner-fees.test.mjs +4 -3
  19. package/dist/resources/payins/payins-quotes.test.js +67 -2
  20. package/dist/resources/payins/payins-quotes.test.mjs +40 -3
  21. package/dist/resources/payins/payins.test.js +31 -2
  22. package/dist/resources/payins/payins.test.mjs +4 -3
  23. package/dist/resources/payins/quotes.d.mts +31 -2
  24. package/dist/resources/payins/quotes.d.ts +31 -2
  25. package/dist/resources/payins/quotes.js +3 -0
  26. package/dist/resources/payins/quotes.mjs +1 -1
  27. package/dist/resources/payouts/payouts.test.js +31 -2
  28. package/dist/resources/payouts/payouts.test.mjs +4 -3
  29. package/dist/resources/quotes/quotes.test.js +31 -2
  30. package/dist/resources/quotes/quotes.test.mjs +4 -3
  31. package/dist/resources/receivers/receivers.test.js +31 -2
  32. package/dist/resources/receivers/receivers.test.mjs +4 -3
  33. package/dist/resources/terms-of-service/index.d.mts +15 -0
  34. package/dist/resources/terms-of-service/index.d.ts +15 -0
  35. package/dist/resources/terms-of-service/index.js +44 -0
  36. package/dist/resources/terms-of-service/index.mjs +9 -0
  37. package/dist/resources/terms-of-service/terms-of-service.test.d.mts +2 -0
  38. package/dist/resources/terms-of-service/terms-of-service.test.d.ts +2 -0
  39. package/dist/resources/terms-of-service/terms-of-service.test.js +19674 -0
  40. package/dist/resources/terms-of-service/terms-of-service.test.mjs +60 -0
  41. package/dist/resources/virtual-accounts/virtual-accounts.test.js +31 -2
  42. package/dist/resources/virtual-accounts/virtual-accounts.test.mjs +4 -3
  43. package/dist/resources/wallets/blockchain.d.mts +21 -1
  44. package/dist/resources/wallets/blockchain.d.ts +21 -1
  45. package/dist/resources/wallets/blockchain.js +8 -0
  46. package/dist/resources/wallets/blockchain.mjs +1 -1
  47. package/dist/resources/wallets/blockchain.test.js +96 -2
  48. package/dist/resources/wallets/blockchain.test.mjs +69 -3
  49. package/dist/resources/wallets/offramp.test.js +31 -2
  50. package/dist/resources/wallets/offramp.test.mjs +4 -3
  51. package/dist/resources/webhooks/webhooks.test.js +31 -2
  52. package/dist/resources/webhooks/webhooks.test.mjs +4 -3
  53. package/package.json +1 -1
@@ -0,0 +1,60 @@
1
+ import {
2
+ afterEach,
3
+ describe,
4
+ globalExpect,
5
+ init_dist,
6
+ it
7
+ } from "../../chunk-D6N3USMR.mjs";
8
+ import {
9
+ BlindPay,
10
+ init_client
11
+ } from "../../chunk-4DVSRRBP.mjs";
12
+ import "../../chunk-FG25JHDX.mjs";
13
+ import "../../chunk-QGNLMN6Z.mjs";
14
+ import "../../chunk-UC57SCKQ.mjs";
15
+ import "../../chunk-TBTA7A2P.mjs";
16
+ import "../../chunk-67XECGMJ.mjs";
17
+ import "../../chunk-Z6EYX4D3.mjs";
18
+ import "../../chunk-5XJJKYXE.mjs";
19
+ import "../../chunk-RC5NN5UF.mjs";
20
+ import "../../chunk-W7NJUABI.mjs";
21
+ import "../../chunk-OTRFWEEC.mjs";
22
+ import "../../chunk-3QQCDR3E.mjs";
23
+ import "../../chunk-LRHWT4JU.mjs";
24
+ import "../../chunk-U7CKUUO7.mjs";
25
+ import "../../chunk-CPOSU35L.mjs";
26
+ import "../../chunk-B5T7AQLH.mjs";
27
+ import {
28
+ __async,
29
+ __commonJS
30
+ } from "../../chunk-OBKEW4AQ.mjs";
31
+
32
+ // src/resources/terms-of-service/terms-of-service.test.ts
33
+ var require_terms_of_service_test = __commonJS({
34
+ "src/resources/terms-of-service/terms-of-service.test.ts"(exports) {
35
+ init_dist();
36
+ init_client();
37
+ describe("Terms of Service", () => {
38
+ afterEach(() => fetchMock.resetMocks());
39
+ const blindpay = new BlindPay({ apiKey: "test-key", instanceId: "in_000000000000" });
40
+ describe("Initiate Terms of Service", () => {
41
+ it("should initiate terms of service and return a URL", () => __async(null, null, function* () {
42
+ const mockedUrl = {
43
+ url: "https://app.blindpay.com/e/terms-of-service?session_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
44
+ };
45
+ fetchMock.mockResponseOnce(JSON.stringify(mockedUrl), {
46
+ headers: { "Content-Type": "application/json" }
47
+ });
48
+ const { data, error } = yield blindpay.instances.tos.initiate({
49
+ idempotency_key: "123e4567-e89b-12d3-a456-426614174000",
50
+ receiver_id: null,
51
+ redirect_url: null
52
+ });
53
+ globalExpect(error).toBeNull();
54
+ globalExpect(data).toEqual(mockedUrl);
55
+ }));
56
+ });
57
+ });
58
+ }
59
+ });
60
+ export default require_terms_of_service_test();
@@ -18702,7 +18702,7 @@ var import_expect_type = __toESM(require_dist(), 1);
18702
18702
  var import_node_crypto = require("crypto");
18703
18703
 
18704
18704
  // package.json
18705
- var version = "2.2.0";
18705
+ var version = "2.4.0";
18706
18706
 
18707
18707
  // src/internal/blindpay-error.ts
18708
18708
  var BlindPayError = class extends Error {
@@ -18928,6 +18928,9 @@ function createPayinQuotesResource(instanceId, client) {
18928
18928
  getFxRate(_b) {
18929
18929
  var data = __objRest(_b, []);
18930
18930
  return client.post(`/instances/${instanceId}/payin-quotes/fx`, data);
18931
+ },
18932
+ get(id) {
18933
+ return client.get(`/instances/${instanceId}/payin-quotes/${id}`);
18931
18934
  }
18932
18935
  };
18933
18936
  }
@@ -19032,6 +19035,23 @@ function createReceiversResource(instanceId, client) {
19032
19035
  };
19033
19036
  }
19034
19037
 
19038
+ // src/resources/terms-of-service/index.ts
19039
+ function createTermsOfServiceResource(instanceId, client) {
19040
+ return {
19041
+ initiate({
19042
+ idempotency_key,
19043
+ receiver_id,
19044
+ redirect_url
19045
+ }) {
19046
+ return client.post(`/e/instances/${instanceId}/tos`, {
19047
+ idempotency_key,
19048
+ receiver_id,
19049
+ redirect_url
19050
+ });
19051
+ }
19052
+ };
19053
+ }
19054
+
19035
19055
  // src/resources/virtual-accounts/index.ts
19036
19056
  function createVirtualAccountsResource(instanceId, client) {
19037
19057
  return {
@@ -19126,6 +19146,14 @@ function createBlockchainWalletsResource(instanceId, client) {
19126
19146
  mintUsdbStellar(_e) {
19127
19147
  var data = __objRest(_e, []);
19128
19148
  return client.post(`/instances/${instanceId}/mint-usdb-stellar`, data);
19149
+ },
19150
+ mintUsdbSolana(_f) {
19151
+ var data = __objRest(_f, []);
19152
+ return client.post(`/instances/${instanceId}/mint-usdb-solana`, data);
19153
+ },
19154
+ prepareSolanaDelegationTransaction(_g) {
19155
+ var data = __objRest(_g, []);
19156
+ return client.post(`/instances/${instanceId}/prepare-delegate-solana`, data);
19129
19157
  }
19130
19158
  };
19131
19159
  }
@@ -19222,7 +19250,8 @@ var BlindPay = class {
19222
19250
  this.available = createAvailableResource(this.api);
19223
19251
  this.instances = __spreadProps(__spreadValues({}, createInstancesResource(this.instanceId, this.api)), {
19224
19252
  apiKeys: createApiKeysResource(this.instanceId, this.api),
19225
- webhookEndpoints: createWebhookEndpointsResource(this.instanceId, this.api)
19253
+ webhookEndpoints: createWebhookEndpointsResource(this.instanceId, this.api),
19254
+ tos: createTermsOfServiceResource(this.instanceId, this.api)
19226
19255
  });
19227
19256
  this.partnerFees = createPartnerFeesResource(this.instanceId, this.api);
19228
19257
  this.payins = __spreadProps(__spreadValues({}, createPayinsResource(this.instanceId, this.api)), {
@@ -8,16 +8,17 @@ import {
8
8
  import {
9
9
  BlindPay,
10
10
  init_client
11
- } from "../../chunk-QCRVXYWF.mjs";
12
- import "../../chunk-IZYPRCCV.mjs";
11
+ } from "../../chunk-4DVSRRBP.mjs";
12
+ import "../../chunk-FG25JHDX.mjs";
13
13
  import "../../chunk-QGNLMN6Z.mjs";
14
14
  import "../../chunk-UC57SCKQ.mjs";
15
15
  import "../../chunk-TBTA7A2P.mjs";
16
16
  import "../../chunk-67XECGMJ.mjs";
17
+ import "../../chunk-Z6EYX4D3.mjs";
17
18
  import "../../chunk-5XJJKYXE.mjs";
18
19
  import "../../chunk-RC5NN5UF.mjs";
19
20
  import "../../chunk-W7NJUABI.mjs";
20
- import "../../chunk-E7M4CJKR.mjs";
21
+ import "../../chunk-OTRFWEEC.mjs";
21
22
  import "../../chunk-3QQCDR3E.mjs";
22
23
  import "../../chunk-LRHWT4JU.mjs";
23
24
  import "../../chunk-U7CKUUO7.mjs";
@@ -61,6 +61,24 @@ type MintUsdbStellarInput = {
61
61
  amount: string;
62
62
  signedXdr: string;
63
63
  };
64
+ type PrepareSolanaDelegationTransactionInput = {
65
+ token_address: string;
66
+ amount: string;
67
+ owner_address: string;
68
+ };
69
+ type PrepareSolanaDelegationTransactionResponse = {
70
+ success: boolean;
71
+ transaction: string;
72
+ };
73
+ type MintUsdbSolanaInput = {
74
+ address: string;
75
+ amount: string;
76
+ };
77
+ type MintUsdbSolanaResponse = {
78
+ success: boolean;
79
+ signature: string;
80
+ error: string;
81
+ };
64
82
  declare function createBlockchainWalletsResource(instanceId: string, client: InternalApiClient): {
65
83
  list(receiver_id: ListBlockchainWalletsInput): Promise<BlindpayApiResponse<ListBlockchainWalletsResponse>>;
66
84
  createWithAddress({ receiver_id, ...data }: CreateBlockchainWalletWithAddressInput): Promise<BlindpayApiResponse<CreateBlockchainWalletResponse>>;
@@ -70,6 +88,8 @@ declare function createBlockchainWalletsResource(instanceId: string, client: Int
70
88
  delete({ receiver_id, id, }: DeleteBlockchainWalletInput): Promise<BlindpayApiResponse<void>>;
71
89
  createAssetTrustline(address: CreateAssetTrustlineInput): Promise<BlindpayApiResponse<CreateAssetTrustlineResponse>>;
72
90
  mintUsdbStellar({ ...data }: MintUsdbStellarInput): Promise<BlindpayApiResponse<void>>;
91
+ mintUsdbSolana({ ...data }: MintUsdbSolanaInput): Promise<BlindpayApiResponse<void>>;
92
+ prepareSolanaDelegationTransaction({ ...data }: PrepareSolanaDelegationTransactionInput): Promise<BlindpayApiResponse<PrepareSolanaDelegationTransactionResponse>>;
73
93
  };
74
94
 
75
- export { type CreateAssetTrustlineInput, type CreateAssetTrustlineResponse, type CreateBlockchainWalletResponse, type CreateBlockchainWalletWithAddressInput, type CreateBlockchainWalletWithHashInput, type DeleteBlockchainWalletInput, type GetBlockchainWalletInput, type GetBlockchainWalletMessage, type GetBlockchainWalletMessageResponse, type GetBlockchainWalletResponse, type ListBlockchainWalletsInput, type ListBlockchainWalletsResponse, type MintUsdbStellarInput, createBlockchainWalletsResource };
95
+ export { type CreateAssetTrustlineInput, type CreateAssetTrustlineResponse, type CreateBlockchainWalletResponse, type CreateBlockchainWalletWithAddressInput, type CreateBlockchainWalletWithHashInput, type DeleteBlockchainWalletInput, type GetBlockchainWalletInput, type GetBlockchainWalletMessage, type GetBlockchainWalletMessageResponse, type GetBlockchainWalletResponse, type ListBlockchainWalletsInput, type ListBlockchainWalletsResponse, type MintUsdbSolanaInput, type MintUsdbSolanaResponse, type MintUsdbStellarInput, type PrepareSolanaDelegationTransactionInput, type PrepareSolanaDelegationTransactionResponse, createBlockchainWalletsResource };
@@ -61,6 +61,24 @@ type MintUsdbStellarInput = {
61
61
  amount: string;
62
62
  signedXdr: string;
63
63
  };
64
+ type PrepareSolanaDelegationTransactionInput = {
65
+ token_address: string;
66
+ amount: string;
67
+ owner_address: string;
68
+ };
69
+ type PrepareSolanaDelegationTransactionResponse = {
70
+ success: boolean;
71
+ transaction: string;
72
+ };
73
+ type MintUsdbSolanaInput = {
74
+ address: string;
75
+ amount: string;
76
+ };
77
+ type MintUsdbSolanaResponse = {
78
+ success: boolean;
79
+ signature: string;
80
+ error: string;
81
+ };
64
82
  declare function createBlockchainWalletsResource(instanceId: string, client: InternalApiClient): {
65
83
  list(receiver_id: ListBlockchainWalletsInput): Promise<BlindpayApiResponse<ListBlockchainWalletsResponse>>;
66
84
  createWithAddress({ receiver_id, ...data }: CreateBlockchainWalletWithAddressInput): Promise<BlindpayApiResponse<CreateBlockchainWalletResponse>>;
@@ -70,6 +88,8 @@ declare function createBlockchainWalletsResource(instanceId: string, client: Int
70
88
  delete({ receiver_id, id, }: DeleteBlockchainWalletInput): Promise<BlindpayApiResponse<void>>;
71
89
  createAssetTrustline(address: CreateAssetTrustlineInput): Promise<BlindpayApiResponse<CreateAssetTrustlineResponse>>;
72
90
  mintUsdbStellar({ ...data }: MintUsdbStellarInput): Promise<BlindpayApiResponse<void>>;
91
+ mintUsdbSolana({ ...data }: MintUsdbSolanaInput): Promise<BlindpayApiResponse<void>>;
92
+ prepareSolanaDelegationTransaction({ ...data }: PrepareSolanaDelegationTransactionInput): Promise<BlindpayApiResponse<PrepareSolanaDelegationTransactionResponse>>;
73
93
  };
74
94
 
75
- export { type CreateAssetTrustlineInput, type CreateAssetTrustlineResponse, type CreateBlockchainWalletResponse, type CreateBlockchainWalletWithAddressInput, type CreateBlockchainWalletWithHashInput, type DeleteBlockchainWalletInput, type GetBlockchainWalletInput, type GetBlockchainWalletMessage, type GetBlockchainWalletMessageResponse, type GetBlockchainWalletResponse, type ListBlockchainWalletsInput, type ListBlockchainWalletsResponse, type MintUsdbStellarInput, createBlockchainWalletsResource };
95
+ export { type CreateAssetTrustlineInput, type CreateAssetTrustlineResponse, type CreateBlockchainWalletResponse, type CreateBlockchainWalletWithAddressInput, type CreateBlockchainWalletWithHashInput, type DeleteBlockchainWalletInput, type GetBlockchainWalletInput, type GetBlockchainWalletMessage, type GetBlockchainWalletMessageResponse, type GetBlockchainWalletResponse, type ListBlockchainWalletsInput, type ListBlockchainWalletsResponse, type MintUsdbSolanaInput, type MintUsdbSolanaResponse, type MintUsdbStellarInput, type PrepareSolanaDelegationTransactionInput, type PrepareSolanaDelegationTransactionResponse, createBlockchainWalletsResource };
@@ -114,6 +114,14 @@ function createBlockchainWalletsResource(instanceId, client) {
114
114
  mintUsdbStellar(_e) {
115
115
  var data = __objRest(_e, []);
116
116
  return client.post(`/instances/${instanceId}/mint-usdb-stellar`, data);
117
+ },
118
+ mintUsdbSolana(_f) {
119
+ var data = __objRest(_f, []);
120
+ return client.post(`/instances/${instanceId}/mint-usdb-solana`, data);
121
+ },
122
+ prepareSolanaDelegationTransaction(_g) {
123
+ var data = __objRest(_g, []);
124
+ return client.post(`/instances/${instanceId}/prepare-delegate-solana`, data);
117
125
  }
118
126
  };
119
127
  }
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createBlockchainWalletsResource,
3
3
  init_blockchain
4
- } from "../../chunk-IZYPRCCV.mjs";
4
+ } from "../../chunk-FG25JHDX.mjs";
5
5
  import "../../chunk-OBKEW4AQ.mjs";
6
6
  init_blockchain();
7
7
  export {
@@ -18702,7 +18702,7 @@ var import_expect_type = __toESM(require_dist(), 1);
18702
18702
  var import_node_crypto = require("crypto");
18703
18703
 
18704
18704
  // package.json
18705
- var version = "2.2.0";
18705
+ var version = "2.4.0";
18706
18706
 
18707
18707
  // src/internal/blindpay-error.ts
18708
18708
  var BlindPayError = class extends Error {
@@ -18928,6 +18928,9 @@ function createPayinQuotesResource(instanceId, client) {
18928
18928
  getFxRate(_b) {
18929
18929
  var data = __objRest(_b, []);
18930
18930
  return client.post(`/instances/${instanceId}/payin-quotes/fx`, data);
18931
+ },
18932
+ get(id) {
18933
+ return client.get(`/instances/${instanceId}/payin-quotes/${id}`);
18931
18934
  }
18932
18935
  };
18933
18936
  }
@@ -19032,6 +19035,23 @@ function createReceiversResource(instanceId, client) {
19032
19035
  };
19033
19036
  }
19034
19037
 
19038
+ // src/resources/terms-of-service/index.ts
19039
+ function createTermsOfServiceResource(instanceId, client) {
19040
+ return {
19041
+ initiate({
19042
+ idempotency_key,
19043
+ receiver_id,
19044
+ redirect_url
19045
+ }) {
19046
+ return client.post(`/e/instances/${instanceId}/tos`, {
19047
+ idempotency_key,
19048
+ receiver_id,
19049
+ redirect_url
19050
+ });
19051
+ }
19052
+ };
19053
+ }
19054
+
19035
19055
  // src/resources/virtual-accounts/index.ts
19036
19056
  function createVirtualAccountsResource(instanceId, client) {
19037
19057
  return {
@@ -19126,6 +19146,14 @@ function createBlockchainWalletsResource(instanceId, client) {
19126
19146
  mintUsdbStellar(_e) {
19127
19147
  var data = __objRest(_e, []);
19128
19148
  return client.post(`/instances/${instanceId}/mint-usdb-stellar`, data);
19149
+ },
19150
+ mintUsdbSolana(_f) {
19151
+ var data = __objRest(_f, []);
19152
+ return client.post(`/instances/${instanceId}/mint-usdb-solana`, data);
19153
+ },
19154
+ prepareSolanaDelegationTransaction(_g) {
19155
+ var data = __objRest(_g, []);
19156
+ return client.post(`/instances/${instanceId}/prepare-delegate-solana`, data);
19129
19157
  }
19130
19158
  };
19131
19159
  }
@@ -19222,7 +19250,8 @@ var BlindPay = class {
19222
19250
  this.available = createAvailableResource(this.api);
19223
19251
  this.instances = __spreadProps(__spreadValues({}, createInstancesResource(this.instanceId, this.api)), {
19224
19252
  apiKeys: createApiKeysResource(this.instanceId, this.api),
19225
- webhookEndpoints: createWebhookEndpointsResource(this.instanceId, this.api)
19253
+ webhookEndpoints: createWebhookEndpointsResource(this.instanceId, this.api),
19254
+ tos: createTermsOfServiceResource(this.instanceId, this.api)
19226
19255
  });
19227
19256
  this.partnerFees = createPartnerFeesResource(this.instanceId, this.api);
19228
19257
  this.payins = __spreadProps(__spreadValues({}, createPayinsResource(this.instanceId, this.api)), {
@@ -19449,6 +19478,71 @@ describe("Blockchain wallets", () => {
19449
19478
  globalExpect(data).toEqual({ data: null });
19450
19479
  }));
19451
19480
  });
19481
+ describe("Create asset trustline", () => {
19482
+ it("should create asset trustline", () => __async(null, null, function* () {
19483
+ const mockedResponse = {
19484
+ xdr: "AAAAAgAAAABqVFqpZzXx+KxRjXXFGO3sKwHCEYdHsWxDRrJTLGPDowAAAGQABVECAAAAAQAAAAEAAAAAAAAAAAAAAABmWFbUAAAAAAAAAAEAAAAAAAAABgAAAAFVU0RCAAAAAABbjPEfrLNLCLjNQyaWWgTeFn4tnbFnNd9FTJ3HgkLUCwAAAAAAAAAAAAAAAAAAAAE="
19485
+ };
19486
+ fetchMock.mockResponseOnce(JSON.stringify(mockedResponse), {
19487
+ headers: { "Content-Type": "application/json" }
19488
+ });
19489
+ const { data, error } = yield blindpay.wallets.blockchain.createAssetTrustline(
19490
+ "GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B"
19491
+ );
19492
+ globalExpect(error).toBeNull();
19493
+ globalExpect(data).toEqual(mockedResponse);
19494
+ }));
19495
+ });
19496
+ describe("Mint USDB Stellar", () => {
19497
+ it("should mint usdb on stellar", () => __async(null, null, function* () {
19498
+ fetchMock.mockResponseOnce(JSON.stringify({}), {
19499
+ headers: { "Content-Type": "application/json" }
19500
+ });
19501
+ const { data, error } = yield blindpay.wallets.blockchain.mintUsdbStellar({
19502
+ address: "GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B",
19503
+ amount: "1000000",
19504
+ signedXdr: "AAAAAgAAAABqVFqpZzXx+KxRjXXFGO3sKwHCEYdHsWxDRrJTLGPDowAAAGQABVECAAAAAQAAAAEAAAAAAAAAAAAAAABmWFbUAAAAAAAAAAEAAAAAAAAABgAAAAFVU0RCAAAAAABbjPEfrLNLCLjNQyaWWgTeFn4tnbFnNd9FTJ3HgkLUCwAAAAAAAAAAAAAAAAAAAAE="
19505
+ });
19506
+ globalExpect(error).toBeNull();
19507
+ globalExpect(data).toBeDefined();
19508
+ }));
19509
+ });
19510
+ describe("Mint USDB Solana", () => {
19511
+ it("should mint usdb on solana", () => __async(null, null, function* () {
19512
+ const mockedResponse = {
19513
+ success: true,
19514
+ signature: "4wceVEQeJG4vpS4k2o1dHU5cFWeWTQU8iaCEpRaV5KkqSxPfbdAc8hzXa7nNYG6rvqgAmDkzBycbcXkKKAeK8Jtu",
19515
+ error: ""
19516
+ };
19517
+ fetchMock.mockResponseOnce(JSON.stringify(mockedResponse), {
19518
+ headers: { "Content-Type": "application/json" }
19519
+ });
19520
+ const { data, error } = yield blindpay.wallets.blockchain.mintUsdbSolana({
19521
+ address: "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5",
19522
+ amount: "1000000"
19523
+ });
19524
+ globalExpect(error).toBeNull();
19525
+ globalExpect(data).toEqual(mockedResponse);
19526
+ }));
19527
+ });
19528
+ describe("Prepare Solana delegation transaction", () => {
19529
+ it("should prepare a solana delegation transaction", () => __async(null, null, function* () {
19530
+ const mockedResponse = {
19531
+ success: true,
19532
+ transaction: "AAGBf4K95Gp5i6f0BAEYAgABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEiIw=="
19533
+ };
19534
+ fetchMock.mockResponseOnce(JSON.stringify(mockedResponse), {
19535
+ headers: { "Content-Type": "application/json" }
19536
+ });
19537
+ const { data, error } = yield blindpay.wallets.blockchain.prepareSolanaDelegationTransaction({
19538
+ token_address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
19539
+ amount: "1000000",
19540
+ owner_address: "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5"
19541
+ });
19542
+ globalExpect(error).toBeNull();
19543
+ globalExpect(data).toEqual(mockedResponse);
19544
+ }));
19545
+ });
19452
19546
  });
19453
19547
  /*! Bundled license information:
19454
19548
 
@@ -8,16 +8,17 @@ import {
8
8
  import {
9
9
  BlindPay,
10
10
  init_client
11
- } from "../../chunk-QCRVXYWF.mjs";
12
- import "../../chunk-IZYPRCCV.mjs";
11
+ } from "../../chunk-4DVSRRBP.mjs";
12
+ import "../../chunk-FG25JHDX.mjs";
13
13
  import "../../chunk-QGNLMN6Z.mjs";
14
14
  import "../../chunk-UC57SCKQ.mjs";
15
15
  import "../../chunk-TBTA7A2P.mjs";
16
16
  import "../../chunk-67XECGMJ.mjs";
17
+ import "../../chunk-Z6EYX4D3.mjs";
17
18
  import "../../chunk-5XJJKYXE.mjs";
18
19
  import "../../chunk-RC5NN5UF.mjs";
19
20
  import "../../chunk-W7NJUABI.mjs";
20
- import "../../chunk-E7M4CJKR.mjs";
21
+ import "../../chunk-OTRFWEEC.mjs";
21
22
  import "../../chunk-3QQCDR3E.mjs";
22
23
  import "../../chunk-LRHWT4JU.mjs";
23
24
  import "../../chunk-U7CKUUO7.mjs";
@@ -151,6 +152,71 @@ var require_blockchain_test = __commonJS({
151
152
  globalExpect(data).toEqual({ data: null });
152
153
  }));
153
154
  });
155
+ describe("Create asset trustline", () => {
156
+ it("should create asset trustline", () => __async(null, null, function* () {
157
+ const mockedResponse = {
158
+ xdr: "AAAAAgAAAABqVFqpZzXx+KxRjXXFGO3sKwHCEYdHsWxDRrJTLGPDowAAAGQABVECAAAAAQAAAAEAAAAAAAAAAAAAAABmWFbUAAAAAAAAAAEAAAAAAAAABgAAAAFVU0RCAAAAAABbjPEfrLNLCLjNQyaWWgTeFn4tnbFnNd9FTJ3HgkLUCwAAAAAAAAAAAAAAAAAAAAE="
159
+ };
160
+ fetchMock.mockResponseOnce(JSON.stringify(mockedResponse), {
161
+ headers: { "Content-Type": "application/json" }
162
+ });
163
+ const { data, error } = yield blindpay.wallets.blockchain.createAssetTrustline(
164
+ "GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B"
165
+ );
166
+ globalExpect(error).toBeNull();
167
+ globalExpect(data).toEqual(mockedResponse);
168
+ }));
169
+ });
170
+ describe("Mint USDB Stellar", () => {
171
+ it("should mint usdb on stellar", () => __async(null, null, function* () {
172
+ fetchMock.mockResponseOnce(JSON.stringify({}), {
173
+ headers: { "Content-Type": "application/json" }
174
+ });
175
+ const { data, error } = yield blindpay.wallets.blockchain.mintUsdbStellar({
176
+ address: "GCDNJUBQSX7AJWLJACMJ7I4BC3Z47BQUTMHEICZLE6MU4KQBRYG5JY6B",
177
+ amount: "1000000",
178
+ signedXdr: "AAAAAgAAAABqVFqpZzXx+KxRjXXFGO3sKwHCEYdHsWxDRrJTLGPDowAAAGQABVECAAAAAQAAAAEAAAAAAAAAAAAAAABmWFbUAAAAAAAAAAEAAAAAAAAABgAAAAFVU0RCAAAAAABbjPEfrLNLCLjNQyaWWgTeFn4tnbFnNd9FTJ3HgkLUCwAAAAAAAAAAAAAAAAAAAAE="
179
+ });
180
+ globalExpect(error).toBeNull();
181
+ globalExpect(data).toBeDefined();
182
+ }));
183
+ });
184
+ describe("Mint USDB Solana", () => {
185
+ it("should mint usdb on solana", () => __async(null, null, function* () {
186
+ const mockedResponse = {
187
+ success: true,
188
+ signature: "4wceVEQeJG4vpS4k2o1dHU5cFWeWTQU8iaCEpRaV5KkqSxPfbdAc8hzXa7nNYG6rvqgAmDkzBycbcXkKKAeK8Jtu",
189
+ error: ""
190
+ };
191
+ fetchMock.mockResponseOnce(JSON.stringify(mockedResponse), {
192
+ headers: { "Content-Type": "application/json" }
193
+ });
194
+ const { data, error } = yield blindpay.wallets.blockchain.mintUsdbSolana({
195
+ address: "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5",
196
+ amount: "1000000"
197
+ });
198
+ globalExpect(error).toBeNull();
199
+ globalExpect(data).toEqual(mockedResponse);
200
+ }));
201
+ });
202
+ describe("Prepare Solana delegation transaction", () => {
203
+ it("should prepare a solana delegation transaction", () => __async(null, null, function* () {
204
+ const mockedResponse = {
205
+ success: true,
206
+ transaction: "AAGBf4K95Gp5i6f0BAEYAgABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEiIw=="
207
+ };
208
+ fetchMock.mockResponseOnce(JSON.stringify(mockedResponse), {
209
+ headers: { "Content-Type": "application/json" }
210
+ });
211
+ const { data, error } = yield blindpay.wallets.blockchain.prepareSolanaDelegationTransaction({
212
+ token_address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
213
+ amount: "1000000",
214
+ owner_address: "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5"
215
+ });
216
+ globalExpect(error).toBeNull();
217
+ globalExpect(data).toEqual(mockedResponse);
218
+ }));
219
+ });
154
220
  });
155
221
  }
156
222
  });
@@ -18702,7 +18702,7 @@ var import_expect_type = __toESM(require_dist(), 1);
18702
18702
  var import_node_crypto = require("crypto");
18703
18703
 
18704
18704
  // package.json
18705
- var version = "2.2.0";
18705
+ var version = "2.4.0";
18706
18706
 
18707
18707
  // src/internal/blindpay-error.ts
18708
18708
  var BlindPayError = class extends Error {
@@ -18928,6 +18928,9 @@ function createPayinQuotesResource(instanceId, client) {
18928
18928
  getFxRate(_b) {
18929
18929
  var data = __objRest(_b, []);
18930
18930
  return client.post(`/instances/${instanceId}/payin-quotes/fx`, data);
18931
+ },
18932
+ get(id) {
18933
+ return client.get(`/instances/${instanceId}/payin-quotes/${id}`);
18931
18934
  }
18932
18935
  };
18933
18936
  }
@@ -19032,6 +19035,23 @@ function createReceiversResource(instanceId, client) {
19032
19035
  };
19033
19036
  }
19034
19037
 
19038
+ // src/resources/terms-of-service/index.ts
19039
+ function createTermsOfServiceResource(instanceId, client) {
19040
+ return {
19041
+ initiate({
19042
+ idempotency_key,
19043
+ receiver_id,
19044
+ redirect_url
19045
+ }) {
19046
+ return client.post(`/e/instances/${instanceId}/tos`, {
19047
+ idempotency_key,
19048
+ receiver_id,
19049
+ redirect_url
19050
+ });
19051
+ }
19052
+ };
19053
+ }
19054
+
19035
19055
  // src/resources/virtual-accounts/index.ts
19036
19056
  function createVirtualAccountsResource(instanceId, client) {
19037
19057
  return {
@@ -19126,6 +19146,14 @@ function createBlockchainWalletsResource(instanceId, client) {
19126
19146
  mintUsdbStellar(_e) {
19127
19147
  var data = __objRest(_e, []);
19128
19148
  return client.post(`/instances/${instanceId}/mint-usdb-stellar`, data);
19149
+ },
19150
+ mintUsdbSolana(_f) {
19151
+ var data = __objRest(_f, []);
19152
+ return client.post(`/instances/${instanceId}/mint-usdb-solana`, data);
19153
+ },
19154
+ prepareSolanaDelegationTransaction(_g) {
19155
+ var data = __objRest(_g, []);
19156
+ return client.post(`/instances/${instanceId}/prepare-delegate-solana`, data);
19129
19157
  }
19130
19158
  };
19131
19159
  }
@@ -19222,7 +19250,8 @@ var BlindPay = class {
19222
19250
  this.available = createAvailableResource(this.api);
19223
19251
  this.instances = __spreadProps(__spreadValues({}, createInstancesResource(this.instanceId, this.api)), {
19224
19252
  apiKeys: createApiKeysResource(this.instanceId, this.api),
19225
- webhookEndpoints: createWebhookEndpointsResource(this.instanceId, this.api)
19253
+ webhookEndpoints: createWebhookEndpointsResource(this.instanceId, this.api),
19254
+ tos: createTermsOfServiceResource(this.instanceId, this.api)
19226
19255
  });
19227
19256
  this.partnerFees = createPartnerFeesResource(this.instanceId, this.api);
19228
19257
  this.payins = __spreadProps(__spreadValues({}, createPayinsResource(this.instanceId, this.api)), {
@@ -8,16 +8,17 @@ import {
8
8
  import {
9
9
  BlindPay,
10
10
  init_client
11
- } from "../../chunk-QCRVXYWF.mjs";
12
- import "../../chunk-IZYPRCCV.mjs";
11
+ } from "../../chunk-4DVSRRBP.mjs";
12
+ import "../../chunk-FG25JHDX.mjs";
13
13
  import "../../chunk-QGNLMN6Z.mjs";
14
14
  import "../../chunk-UC57SCKQ.mjs";
15
15
  import "../../chunk-TBTA7A2P.mjs";
16
16
  import "../../chunk-67XECGMJ.mjs";
17
+ import "../../chunk-Z6EYX4D3.mjs";
17
18
  import "../../chunk-5XJJKYXE.mjs";
18
19
  import "../../chunk-RC5NN5UF.mjs";
19
20
  import "../../chunk-W7NJUABI.mjs";
20
- import "../../chunk-E7M4CJKR.mjs";
21
+ import "../../chunk-OTRFWEEC.mjs";
21
22
  import "../../chunk-3QQCDR3E.mjs";
22
23
  import "../../chunk-LRHWT4JU.mjs";
23
24
  import "../../chunk-U7CKUUO7.mjs";
@@ -18702,7 +18702,7 @@ var import_expect_type = __toESM(require_dist(), 1);
18702
18702
  var import_node_crypto = require("crypto");
18703
18703
 
18704
18704
  // package.json
18705
- var version = "2.2.0";
18705
+ var version = "2.4.0";
18706
18706
 
18707
18707
  // src/internal/blindpay-error.ts
18708
18708
  var BlindPayError = class extends Error {
@@ -18928,6 +18928,9 @@ function createPayinQuotesResource(instanceId, client) {
18928
18928
  getFxRate(_b) {
18929
18929
  var data = __objRest(_b, []);
18930
18930
  return client.post(`/instances/${instanceId}/payin-quotes/fx`, data);
18931
+ },
18932
+ get(id) {
18933
+ return client.get(`/instances/${instanceId}/payin-quotes/${id}`);
18931
18934
  }
18932
18935
  };
18933
18936
  }
@@ -19032,6 +19035,23 @@ function createReceiversResource(instanceId, client) {
19032
19035
  };
19033
19036
  }
19034
19037
 
19038
+ // src/resources/terms-of-service/index.ts
19039
+ function createTermsOfServiceResource(instanceId, client) {
19040
+ return {
19041
+ initiate({
19042
+ idempotency_key,
19043
+ receiver_id,
19044
+ redirect_url
19045
+ }) {
19046
+ return client.post(`/e/instances/${instanceId}/tos`, {
19047
+ idempotency_key,
19048
+ receiver_id,
19049
+ redirect_url
19050
+ });
19051
+ }
19052
+ };
19053
+ }
19054
+
19035
19055
  // src/resources/virtual-accounts/index.ts
19036
19056
  function createVirtualAccountsResource(instanceId, client) {
19037
19057
  return {
@@ -19126,6 +19146,14 @@ function createBlockchainWalletsResource(instanceId, client) {
19126
19146
  mintUsdbStellar(_e) {
19127
19147
  var data = __objRest(_e, []);
19128
19148
  return client.post(`/instances/${instanceId}/mint-usdb-stellar`, data);
19149
+ },
19150
+ mintUsdbSolana(_f) {
19151
+ var data = __objRest(_f, []);
19152
+ return client.post(`/instances/${instanceId}/mint-usdb-solana`, data);
19153
+ },
19154
+ prepareSolanaDelegationTransaction(_g) {
19155
+ var data = __objRest(_g, []);
19156
+ return client.post(`/instances/${instanceId}/prepare-delegate-solana`, data);
19129
19157
  }
19130
19158
  };
19131
19159
  }
@@ -19222,7 +19250,8 @@ var BlindPay = class {
19222
19250
  this.available = createAvailableResource(this.api);
19223
19251
  this.instances = __spreadProps(__spreadValues({}, createInstancesResource(this.instanceId, this.api)), {
19224
19252
  apiKeys: createApiKeysResource(this.instanceId, this.api),
19225
- webhookEndpoints: createWebhookEndpointsResource(this.instanceId, this.api)
19253
+ webhookEndpoints: createWebhookEndpointsResource(this.instanceId, this.api),
19254
+ tos: createTermsOfServiceResource(this.instanceId, this.api)
19226
19255
  });
19227
19256
  this.partnerFees = createPartnerFeesResource(this.instanceId, this.api);
19228
19257
  this.payins = __spreadProps(__spreadValues({}, createPayinsResource(this.instanceId, this.api)), {
@@ -8,16 +8,17 @@ import {
8
8
  import {
9
9
  BlindPay,
10
10
  init_client
11
- } from "../../chunk-QCRVXYWF.mjs";
12
- import "../../chunk-IZYPRCCV.mjs";
11
+ } from "../../chunk-4DVSRRBP.mjs";
12
+ import "../../chunk-FG25JHDX.mjs";
13
13
  import "../../chunk-QGNLMN6Z.mjs";
14
14
  import "../../chunk-UC57SCKQ.mjs";
15
15
  import "../../chunk-TBTA7A2P.mjs";
16
16
  import "../../chunk-67XECGMJ.mjs";
17
+ import "../../chunk-Z6EYX4D3.mjs";
17
18
  import "../../chunk-5XJJKYXE.mjs";
18
19
  import "../../chunk-RC5NN5UF.mjs";
19
20
  import "../../chunk-W7NJUABI.mjs";
20
- import "../../chunk-E7M4CJKR.mjs";
21
+ import "../../chunk-OTRFWEEC.mjs";
21
22
  import "../../chunk-3QQCDR3E.mjs";
22
23
  import "../../chunk-LRHWT4JU.mjs";
23
24
  import "../../chunk-U7CKUUO7.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blindpay/node",
3
- "version": "2.2.0",
3
+ "version": "2.4.0",
4
4
  "description": "Official Node.js SDK for Blindpay API - Global payments infrastructure",
5
5
  "keywords": [
6
6
  "blindpay",