@blindpay/node 2.4.0 → 3.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 (77) hide show
  1. package/dist/{api-client-Cw2mNJeR.d.mts → api-client-B7VQkM_4.d.mts} +96 -35
  2. package/dist/{api-client-Cw2mNJeR.d.ts → api-client-B7VQkM_4.d.ts} +96 -35
  3. package/dist/{chunk-5XJJKYXE.mjs → chunk-LEPGLH7Q.mjs} +20 -10
  4. package/dist/{chunk-3QQCDR3E.mjs → chunk-VBZHAPK7.mjs} +8 -0
  5. package/dist/{chunk-OTRFWEEC.mjs → chunk-VRA5HP7F.mjs} +4 -0
  6. package/dist/{chunk-4DVSRRBP.mjs → chunk-WH2VNZE7.mjs} +25 -22
  7. package/dist/index.d.mts +14 -14
  8. package/dist/index.d.ts +14 -14
  9. package/dist/index.js +50 -25
  10. package/dist/index.mjs +8 -8
  11. package/dist/resources/api-keys/api-keys.test.js +50 -25
  12. package/dist/resources/api-keys/api-keys.test.mjs +5 -5
  13. package/dist/resources/api-keys/index.d.mts +1 -1
  14. package/dist/resources/api-keys/index.d.ts +1 -1
  15. package/dist/resources/available/available.test.js +50 -25
  16. package/dist/resources/available/available.test.mjs +5 -5
  17. package/dist/resources/available/index.d.mts +1 -1
  18. package/dist/resources/available/index.d.ts +1 -1
  19. package/dist/resources/bank-accounts/bank-accounts.test.js +50 -25
  20. package/dist/resources/bank-accounts/bank-accounts.test.mjs +5 -5
  21. package/dist/resources/bank-accounts/index.d.mts +2 -4
  22. package/dist/resources/bank-accounts/index.d.ts +2 -4
  23. package/dist/resources/instances/index.d.mts +1 -1
  24. package/dist/resources/instances/index.d.ts +1 -1
  25. package/dist/resources/instances/instances.test.js +50 -25
  26. package/dist/resources/instances/instances.test.mjs +5 -5
  27. package/dist/resources/partner-fees/index.d.mts +1 -1
  28. package/dist/resources/partner-fees/index.d.ts +1 -1
  29. package/dist/resources/partner-fees/partner-fees.test.js +50 -25
  30. package/dist/resources/partner-fees/partner-fees.test.mjs +5 -5
  31. package/dist/resources/payins/index.d.mts +9 -33
  32. package/dist/resources/payins/index.d.ts +9 -33
  33. package/dist/resources/payins/payins-quotes.test.js +100 -25
  34. package/dist/resources/payins/payins-quotes.test.mjs +55 -5
  35. package/dist/resources/payins/payins.test.js +164 -52
  36. package/dist/resources/payins/payins.test.mjs +119 -32
  37. package/dist/resources/payins/quotes.d.mts +38 -2
  38. package/dist/resources/payins/quotes.d.ts +38 -2
  39. package/dist/resources/payins/quotes.js +4 -0
  40. package/dist/resources/payins/quotes.mjs +1 -1
  41. package/dist/resources/payouts/index.d.mts +42 -17
  42. package/dist/resources/payouts/index.d.ts +42 -17
  43. package/dist/resources/payouts/index.js +8 -0
  44. package/dist/resources/payouts/index.mjs +1 -1
  45. package/dist/resources/payouts/payouts.test.js +162 -27
  46. package/dist/resources/payouts/payouts.test.mjs +117 -7
  47. package/dist/resources/quotes/index.d.mts +1 -1
  48. package/dist/resources/quotes/index.d.ts +1 -1
  49. package/dist/resources/quotes/quotes.test.js +50 -25
  50. package/dist/resources/quotes/quotes.test.mjs +5 -5
  51. package/dist/resources/receivers/index.d.mts +9 -7
  52. package/dist/resources/receivers/index.d.ts +9 -7
  53. package/dist/resources/receivers/receivers.test.js +57 -33
  54. package/dist/resources/receivers/receivers.test.mjs +12 -13
  55. package/dist/resources/terms-of-service/index.d.mts +1 -1
  56. package/dist/resources/terms-of-service/index.d.ts +1 -1
  57. package/dist/resources/terms-of-service/terms-of-service.test.js +50 -25
  58. package/dist/resources/terms-of-service/terms-of-service.test.mjs +5 -5
  59. package/dist/resources/virtual-accounts/index.d.mts +22 -7
  60. package/dist/resources/virtual-accounts/index.d.ts +22 -7
  61. package/dist/resources/virtual-accounts/index.js +20 -10
  62. package/dist/resources/virtual-accounts/index.mjs +1 -1
  63. package/dist/resources/virtual-accounts/virtual-accounts.test.js +169 -44
  64. package/dist/resources/virtual-accounts/virtual-accounts.test.mjs +124 -24
  65. package/dist/resources/wallets/blockchain.d.mts +1 -1
  66. package/dist/resources/wallets/blockchain.d.ts +1 -1
  67. package/dist/resources/wallets/blockchain.test.js +50 -25
  68. package/dist/resources/wallets/blockchain.test.mjs +5 -5
  69. package/dist/resources/wallets/offramp.d.mts +1 -1
  70. package/dist/resources/wallets/offramp.d.ts +1 -1
  71. package/dist/resources/wallets/offramp.test.js +50 -25
  72. package/dist/resources/wallets/offramp.test.mjs +5 -5
  73. package/dist/resources/webhooks/index.d.mts +1 -1
  74. package/dist/resources/webhooks/index.d.ts +1 -1
  75. package/dist/resources/webhooks/webhooks.test.js +50 -25
  76. package/dist/resources/webhooks/webhooks.test.mjs +5 -5
  77. package/package.json +6 -2
@@ -1,4 +1,6 @@
1
- import { I as InternalApiClient, B as BlindpayApiResponse, A as AccountClass, C as Country } from '../../api-client-Cw2mNJeR.mjs';
1
+ import { I as InternalApiClient, B as BlindpayApiResponse, A as AccountClass, C as Country } from '../../api-client-B7VQkM_4.mjs';
2
+
3
+ type StrictOmit<T, K extends keyof T> = Omit<T, K>;
2
4
 
3
5
  type ProofOfAddressDocType = "UTILITY_BILL" | "BANK_STATEMENT" | "RENTAL_AGREEMENT" | "TAX_DOCUMENT" | "GOVERNMENT_CORRESPONDENCE";
4
6
  type PurposeOfTransactions = "business_transactions" | "charitable_donations" | "investment_purposes" | "payments_to_friends_or_family_abroad" | "personal_or_living_expenses" | "protect_wealth" | "purchase_good_and_services" | "receive_payment_for_freelancing" | "receive_salary" | "other";
@@ -8,8 +10,6 @@ type KycType = "light" | "standard" | "enhanced";
8
10
  type OwnerRole = "beneficial_controlling" | "beneficial_owner" | "controlling_person";
9
11
  type Owner = {
10
12
  id: string;
11
- instance_id: string;
12
- receiver_id: string;
13
13
  role: OwnerRole;
14
14
  first_name: string;
15
15
  last_name: string;
@@ -30,6 +30,7 @@ type Owner = {
30
30
  };
31
31
  type IndividualWithStandardKYC = {
32
32
  id: string;
33
+ is_tos_accepted: boolean;
33
34
  type: Extract<AccountClass, "individual">;
34
35
  kyc_type: Extract<KycType, "standard">;
35
36
  kyc_status: string;
@@ -72,6 +73,7 @@ type IndividualWithStandardKYC = {
72
73
  };
73
74
  type IndividualWithEnhancedKYC = {
74
75
  id: string;
76
+ is_tos_accepted: boolean;
75
77
  type: Extract<AccountClass, "individual">;
76
78
  kyc_type: Extract<KycType, "enhanced">;
77
79
  kyc_status: string;
@@ -119,6 +121,8 @@ type IndividualWithEnhancedKYC = {
119
121
  };
120
122
  type BusinessWithStandardKYB = {
121
123
  id: string;
124
+ is_tos_accepted: boolean;
125
+ is_fbo: boolean;
122
126
  type: Extract<AccountClass, "business">;
123
127
  kyc_type: Extract<KycType, "standard">;
124
128
  kyc_status: string;
@@ -226,7 +230,7 @@ type CreateBusinessWithStandardKYBInput = {
226
230
  formation_date: string;
227
231
  incorporation_doc_file: string;
228
232
  legal_name: string;
229
- owners: Owner[];
233
+ owners: Array<StrictOmit<Owner, "id">>;
230
234
  postal_code: string;
231
235
  proof_of_address_doc_file: string;
232
236
  proof_of_address_doc_type: ProofOfAddressDocType;
@@ -268,9 +272,7 @@ type UpdateReceiverInput = {
268
272
  alternate_name?: string;
269
273
  formation_date?: string;
270
274
  website?: string;
271
- owners?: Array<{
272
- id: string;
273
- } & Pick<Owner, "first_name" | "last_name" | "role" | "date_of_birth" | "tax_id" | "address_line_1" | "address_line_2" | "city" | "state_province_region" | "country" | "postal_code" | "id_doc_country" | "id_doc_type" | "id_doc_front_file" | "id_doc_back_file">>;
275
+ owners?: Array<Pick<Owner, "first_name" | "last_name" | "role" | "date_of_birth" | "tax_id" | "address_line_1" | "address_line_2" | "city" | "state_province_region" | "country" | "postal_code" | "id_doc_country" | "id_doc_type" | "id_doc_front_file" | "id_doc_back_file">>;
274
276
  incorporation_doc_file?: string;
275
277
  proof_of_ownership_doc_file?: string;
276
278
  source_of_funds_doc_type?: SourceOfFundsDocType;
@@ -1,4 +1,6 @@
1
- import { I as InternalApiClient, B as BlindpayApiResponse, A as AccountClass, C as Country } from '../../api-client-Cw2mNJeR.js';
1
+ import { I as InternalApiClient, B as BlindpayApiResponse, A as AccountClass, C as Country } from '../../api-client-B7VQkM_4.js';
2
+
3
+ type StrictOmit<T, K extends keyof T> = Omit<T, K>;
2
4
 
3
5
  type ProofOfAddressDocType = "UTILITY_BILL" | "BANK_STATEMENT" | "RENTAL_AGREEMENT" | "TAX_DOCUMENT" | "GOVERNMENT_CORRESPONDENCE";
4
6
  type PurposeOfTransactions = "business_transactions" | "charitable_donations" | "investment_purposes" | "payments_to_friends_or_family_abroad" | "personal_or_living_expenses" | "protect_wealth" | "purchase_good_and_services" | "receive_payment_for_freelancing" | "receive_salary" | "other";
@@ -8,8 +10,6 @@ type KycType = "light" | "standard" | "enhanced";
8
10
  type OwnerRole = "beneficial_controlling" | "beneficial_owner" | "controlling_person";
9
11
  type Owner = {
10
12
  id: string;
11
- instance_id: string;
12
- receiver_id: string;
13
13
  role: OwnerRole;
14
14
  first_name: string;
15
15
  last_name: string;
@@ -30,6 +30,7 @@ type Owner = {
30
30
  };
31
31
  type IndividualWithStandardKYC = {
32
32
  id: string;
33
+ is_tos_accepted: boolean;
33
34
  type: Extract<AccountClass, "individual">;
34
35
  kyc_type: Extract<KycType, "standard">;
35
36
  kyc_status: string;
@@ -72,6 +73,7 @@ type IndividualWithStandardKYC = {
72
73
  };
73
74
  type IndividualWithEnhancedKYC = {
74
75
  id: string;
76
+ is_tos_accepted: boolean;
75
77
  type: Extract<AccountClass, "individual">;
76
78
  kyc_type: Extract<KycType, "enhanced">;
77
79
  kyc_status: string;
@@ -119,6 +121,8 @@ type IndividualWithEnhancedKYC = {
119
121
  };
120
122
  type BusinessWithStandardKYB = {
121
123
  id: string;
124
+ is_tos_accepted: boolean;
125
+ is_fbo: boolean;
122
126
  type: Extract<AccountClass, "business">;
123
127
  kyc_type: Extract<KycType, "standard">;
124
128
  kyc_status: string;
@@ -226,7 +230,7 @@ type CreateBusinessWithStandardKYBInput = {
226
230
  formation_date: string;
227
231
  incorporation_doc_file: string;
228
232
  legal_name: string;
229
- owners: Owner[];
233
+ owners: Array<StrictOmit<Owner, "id">>;
230
234
  postal_code: string;
231
235
  proof_of_address_doc_file: string;
232
236
  proof_of_address_doc_type: ProofOfAddressDocType;
@@ -268,9 +272,7 @@ type UpdateReceiverInput = {
268
272
  alternate_name?: string;
269
273
  formation_date?: string;
270
274
  website?: string;
271
- owners?: Array<{
272
- id: string;
273
- } & Pick<Owner, "first_name" | "last_name" | "role" | "date_of_birth" | "tax_id" | "address_line_1" | "address_line_2" | "city" | "state_province_region" | "country" | "postal_code" | "id_doc_country" | "id_doc_type" | "id_doc_front_file" | "id_doc_back_file">>;
275
+ owners?: Array<Pick<Owner, "first_name" | "last_name" | "role" | "date_of_birth" | "tax_id" | "address_line_1" | "address_line_2" | "city" | "state_province_region" | "country" | "postal_code" | "id_doc_country" | "id_doc_type" | "id_doc_front_file" | "id_doc_back_file">>;
274
276
  incorporation_doc_file?: string;
275
277
  proof_of_ownership_doc_file?: string;
276
278
  source_of_funds_doc_type?: SourceOfFundsDocType;
@@ -18699,10 +18699,10 @@ function getImporter(name) {
18699
18699
  var import_expect_type = __toESM(require_dist(), 1);
18700
18700
 
18701
18701
  // src/client.ts
18702
- var import_node_crypto = require("crypto");
18702
+ var import_svix = require("svix");
18703
18703
 
18704
18704
  // package.json
18705
- var version = "2.4.0";
18705
+ var version = "3.0.0";
18706
18706
 
18707
18707
  // src/internal/blindpay-error.ts
18708
18708
  var BlindPayError = class extends Error {
@@ -18931,6 +18931,10 @@ function createPayinQuotesResource(instanceId, client) {
18931
18931
  },
18932
18932
  get(id) {
18933
18933
  return client.get(`/instances/${instanceId}/payin-quotes/${id}`);
18934
+ },
18935
+ list(params) {
18936
+ const queryParams = params ? `?${new URLSearchParams(params)}` : "";
18937
+ return client.get(`/instances/${instanceId}/payin-quotes${queryParams}`);
18934
18938
  }
18935
18939
  };
18936
18940
  }
@@ -18963,6 +18967,14 @@ function createPayoutsResource(instanceId, client) {
18963
18967
  createEvm(_c) {
18964
18968
  var data = __objRest(_c, []);
18965
18969
  return client.post(`/instances/${instanceId}/payouts/evm`, data);
18970
+ },
18971
+ authorizeSolana(_d) {
18972
+ var data = __objRest(_d, []);
18973
+ return client.post(`/instances/${instanceId}/payouts/solana/authorize`, data);
18974
+ },
18975
+ createSolana(_e) {
18976
+ var data = __objRest(_e, []);
18977
+ return client.post(`/instances/${instanceId}/payouts/solana`, data);
18966
18978
  }
18967
18979
  };
18968
18980
  }
@@ -19055,30 +19067,40 @@ function createTermsOfServiceResource(instanceId, client) {
19055
19067
  // src/resources/virtual-accounts/index.ts
19056
19068
  function createVirtualAccountsResource(instanceId, client) {
19057
19069
  return {
19058
- update(_a3) {
19070
+ list(receiver_id) {
19071
+ return client.get(`/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`);
19072
+ },
19073
+ get({
19074
+ receiver_id,
19075
+ id
19076
+ }) {
19077
+ return client.get(
19078
+ `/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts/${id}`
19079
+ );
19080
+ },
19081
+ create(_a3) {
19059
19082
  var _b = _a3, {
19060
19083
  receiver_id
19061
19084
  } = _b, data = __objRest(_b, [
19062
19085
  "receiver_id"
19063
19086
  ]);
19064
- return client.put(
19087
+ return client.post(
19065
19088
  `/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`,
19066
19089
  data
19067
19090
  );
19068
19091
  },
19069
- create(_c) {
19092
+ update(_c) {
19070
19093
  var _d = _c, {
19071
- receiver_id
19094
+ receiver_id,
19095
+ id
19072
19096
  } = _d, data = __objRest(_d, [
19073
- "receiver_id"
19097
+ "receiver_id",
19098
+ "id"
19074
19099
  ]);
19075
- return client.post(
19076
- `/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`,
19100
+ return client.put(
19101
+ `/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts/${id}`,
19077
19102
  data
19078
19103
  );
19079
- },
19080
- get(receiver_id) {
19081
- return client.get(`/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`);
19082
19104
  }
19083
19105
  };
19084
19106
  }
@@ -19336,26 +19358,29 @@ var BlindPay = class {
19336
19358
  });
19337
19359
  }
19338
19360
  /**
19339
- * Verifies the BlindPay webhook signature
19361
+ * Verifies the BlindPay webhook signature using Svix
19340
19362
  *
19341
19363
  * @param params.secret The webhook secret from BlindPay dashboard
19342
- * @param params.id The value of the `svix-id` header
19343
- * @param params.timestamp The value of the `svix-timestamp` header
19344
- * @param params.payload The raw request body
19345
- * @param params.svixSignature The value of the `svix-signature` header
19364
+ * @param params.headers The webhook headers object containing svix-id, svix-timestamp, and svix-signature
19365
+ * @param params.payload The raw request body as a string
19346
19366
  * @returns {boolean} True if the signature is valid, false otherwise
19347
19367
  */
19348
19368
  verifyWebhookSignature({
19349
19369
  secret,
19350
- id,
19351
- timestamp,
19352
- payload,
19353
- svixSignature
19370
+ headers,
19371
+ payload
19354
19372
  }) {
19355
- const signedContent = `${id}.${timestamp}.${payload}`;
19356
- const secretBytes = Buffer.from(secret.split("_")[1], "base64");
19357
- const expectedSignature = (0, import_node_crypto.createHmac)("sha256", secretBytes).update(signedContent).digest("base64");
19358
- return svixSignature.length === expectedSignature.length && (0, import_node_crypto.timingSafeEqual)(Buffer.from(svixSignature), Buffer.from(expectedSignature));
19373
+ try {
19374
+ const webhook = new import_svix.Webhook(secret);
19375
+ webhook.verify(payload, {
19376
+ "svix-id": headers.id,
19377
+ "svix-timestamp": headers.timestamp,
19378
+ "svix-signature": headers.signature
19379
+ });
19380
+ return true;
19381
+ } catch (e) {
19382
+ return false;
19383
+ }
19359
19384
  }
19360
19385
  };
19361
19386
 
@@ -19371,6 +19396,7 @@ describe("Receivers", () => {
19371
19396
  type: "individual",
19372
19397
  kyc_type: "standard",
19373
19398
  kyc_status: "verifying",
19399
+ is_tos_accepted: true,
19374
19400
  kyc_warnings: [
19375
19401
  {
19376
19402
  code: null,
@@ -19413,6 +19439,7 @@ describe("Receivers", () => {
19413
19439
  {
19414
19440
  id: "re_YuaMcI2B8zbQ",
19415
19441
  type: "individual",
19442
+ is_tos_accepted: true,
19416
19443
  kyc_type: "enhanced",
19417
19444
  kyc_status: "approved",
19418
19445
  kyc_warnings: null,
@@ -19456,6 +19483,8 @@ describe("Receivers", () => {
19456
19483
  id: "re_IOxAUL24LG7P",
19457
19484
  type: "business",
19458
19485
  kyc_type: "standard",
19486
+ is_tos_accepted: true,
19487
+ is_fbo: false,
19459
19488
  kyc_status: "pending",
19460
19489
  kyc_warnings: null,
19461
19490
  email: "business@example.com",
@@ -19494,9 +19523,7 @@ describe("Receivers", () => {
19494
19523
  id_doc_back_file: "https://example.com/image.png",
19495
19524
  proof_of_address_doc_type: "UTILITY_BILL",
19496
19525
  proof_of_address_doc_file: "https://example.com/image.png",
19497
- id: "ub_000000000000",
19498
- instance_id: "in_000000000000",
19499
- receiver_id: "re_IOxAUL24LG7P"
19526
+ id: "ub_000000000000"
19500
19527
  }
19501
19528
  ],
19502
19529
  incorporation_doc_file: "https://example.com/image.png",
@@ -19633,10 +19660,7 @@ describe("Receivers", () => {
19633
19660
  id_doc_front_file: "https://example.com/image.png",
19634
19661
  id_doc_back_file: "https://example.com/image.png",
19635
19662
  proof_of_address_doc_type: "UTILITY_BILL",
19636
- proof_of_address_doc_file: "https://example.com/image.png",
19637
- id: "ub_000000000000",
19638
- instance_id: "in_000000000000",
19639
- receiver_id: "re_IOxAUL24LG7P"
19663
+ proof_of_address_doc_file: "https://example.com/image.png"
19640
19664
  }
19641
19665
  ]
19642
19666
  });
@@ -19648,6 +19672,7 @@ describe("Receivers", () => {
19648
19672
  it("should get a receiver", () => __async(null, null, function* () {
19649
19673
  const mockedReceiver = {
19650
19674
  id: "re_YuaMcI2B8zbQ",
19675
+ is_tos_accepted: true,
19651
19676
  type: "individual",
19652
19677
  kyc_type: "enhanced",
19653
19678
  kyc_status: "verifying",
@@ -19735,7 +19760,6 @@ describe("Receivers", () => {
19735
19760
  website: "https://site.com",
19736
19761
  owners: [
19737
19762
  {
19738
- id: "ub_000000000000",
19739
19763
  first_name: "Carlos",
19740
19764
  last_name: "Silva",
19741
19765
  role: "beneficial_owner",
@@ -8,21 +8,21 @@ import {
8
8
  import {
9
9
  BlindPay,
10
10
  init_client
11
- } from "../../chunk-4DVSRRBP.mjs";
11
+ } from "../../chunk-WH2VNZE7.mjs";
12
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
17
  import "../../chunk-Z6EYX4D3.mjs";
18
- import "../../chunk-5XJJKYXE.mjs";
18
+ import "../../chunk-LEPGLH7Q.mjs";
19
19
  import "../../chunk-RC5NN5UF.mjs";
20
20
  import "../../chunk-W7NJUABI.mjs";
21
- import "../../chunk-OTRFWEEC.mjs";
22
- import "../../chunk-3QQCDR3E.mjs";
21
+ import "../../chunk-VRA5HP7F.mjs";
22
+ import "../../chunk-VBZHAPK7.mjs";
23
23
  import "../../chunk-LRHWT4JU.mjs";
24
- import "../../chunk-U7CKUUO7.mjs";
25
24
  import "../../chunk-CPOSU35L.mjs";
25
+ import "../../chunk-U7CKUUO7.mjs";
26
26
  import "../../chunk-B5T7AQLH.mjs";
27
27
  import {
28
28
  __async,
@@ -45,6 +45,7 @@ var require_receivers_test = __commonJS({
45
45
  type: "individual",
46
46
  kyc_type: "standard",
47
47
  kyc_status: "verifying",
48
+ is_tos_accepted: true,
48
49
  kyc_warnings: [
49
50
  {
50
51
  code: null,
@@ -87,6 +88,7 @@ var require_receivers_test = __commonJS({
87
88
  {
88
89
  id: "re_YuaMcI2B8zbQ",
89
90
  type: "individual",
91
+ is_tos_accepted: true,
90
92
  kyc_type: "enhanced",
91
93
  kyc_status: "approved",
92
94
  kyc_warnings: null,
@@ -130,6 +132,8 @@ var require_receivers_test = __commonJS({
130
132
  id: "re_IOxAUL24LG7P",
131
133
  type: "business",
132
134
  kyc_type: "standard",
135
+ is_tos_accepted: true,
136
+ is_fbo: false,
133
137
  kyc_status: "pending",
134
138
  kyc_warnings: null,
135
139
  email: "business@example.com",
@@ -168,9 +172,7 @@ var require_receivers_test = __commonJS({
168
172
  id_doc_back_file: "https://example.com/image.png",
169
173
  proof_of_address_doc_type: "UTILITY_BILL",
170
174
  proof_of_address_doc_file: "https://example.com/image.png",
171
- id: "ub_000000000000",
172
- instance_id: "in_000000000000",
173
- receiver_id: "re_IOxAUL24LG7P"
175
+ id: "ub_000000000000"
174
176
  }
175
177
  ],
176
178
  incorporation_doc_file: "https://example.com/image.png",
@@ -307,10 +309,7 @@ var require_receivers_test = __commonJS({
307
309
  id_doc_front_file: "https://example.com/image.png",
308
310
  id_doc_back_file: "https://example.com/image.png",
309
311
  proof_of_address_doc_type: "UTILITY_BILL",
310
- proof_of_address_doc_file: "https://example.com/image.png",
311
- id: "ub_000000000000",
312
- instance_id: "in_000000000000",
313
- receiver_id: "re_IOxAUL24LG7P"
312
+ proof_of_address_doc_file: "https://example.com/image.png"
314
313
  }
315
314
  ]
316
315
  });
@@ -322,6 +321,7 @@ var require_receivers_test = __commonJS({
322
321
  it("should get a receiver", () => __async(null, null, function* () {
323
322
  const mockedReceiver = {
324
323
  id: "re_YuaMcI2B8zbQ",
324
+ is_tos_accepted: true,
325
325
  type: "individual",
326
326
  kyc_type: "enhanced",
327
327
  kyc_status: "verifying",
@@ -409,7 +409,6 @@ var require_receivers_test = __commonJS({
409
409
  website: "https://site.com",
410
410
  owners: [
411
411
  {
412
- id: "ub_000000000000",
413
412
  first_name: "Carlos",
414
413
  last_name: "Silva",
415
414
  role: "beneficial_owner",
@@ -1,4 +1,4 @@
1
- import { I as InternalApiClient, B as BlindpayApiResponse } from '../../api-client-Cw2mNJeR.mjs';
1
+ import { I as InternalApiClient, B as BlindpayApiResponse } from '../../api-client-B7VQkM_4.mjs';
2
2
 
3
3
  type InitiateInput = {
4
4
  idempotency_key: string;
@@ -1,4 +1,4 @@
1
- import { I as InternalApiClient, B as BlindpayApiResponse } from '../../api-client-Cw2mNJeR.js';
1
+ import { I as InternalApiClient, B as BlindpayApiResponse } from '../../api-client-B7VQkM_4.js';
2
2
 
3
3
  type InitiateInput = {
4
4
  idempotency_key: string;
@@ -18699,10 +18699,10 @@ function getImporter(name) {
18699
18699
  var import_expect_type = __toESM(require_dist(), 1);
18700
18700
 
18701
18701
  // src/client.ts
18702
- var import_node_crypto = require("crypto");
18702
+ var import_svix = require("svix");
18703
18703
 
18704
18704
  // package.json
18705
- var version = "2.4.0";
18705
+ var version = "3.0.0";
18706
18706
 
18707
18707
  // src/internal/blindpay-error.ts
18708
18708
  var BlindPayError = class extends Error {
@@ -18931,6 +18931,10 @@ function createPayinQuotesResource(instanceId, client) {
18931
18931
  },
18932
18932
  get(id) {
18933
18933
  return client.get(`/instances/${instanceId}/payin-quotes/${id}`);
18934
+ },
18935
+ list(params) {
18936
+ const queryParams = params ? `?${new URLSearchParams(params)}` : "";
18937
+ return client.get(`/instances/${instanceId}/payin-quotes${queryParams}`);
18934
18938
  }
18935
18939
  };
18936
18940
  }
@@ -18963,6 +18967,14 @@ function createPayoutsResource(instanceId, client) {
18963
18967
  createEvm(_c) {
18964
18968
  var data = __objRest(_c, []);
18965
18969
  return client.post(`/instances/${instanceId}/payouts/evm`, data);
18970
+ },
18971
+ authorizeSolana(_d) {
18972
+ var data = __objRest(_d, []);
18973
+ return client.post(`/instances/${instanceId}/payouts/solana/authorize`, data);
18974
+ },
18975
+ createSolana(_e) {
18976
+ var data = __objRest(_e, []);
18977
+ return client.post(`/instances/${instanceId}/payouts/solana`, data);
18966
18978
  }
18967
18979
  };
18968
18980
  }
@@ -19055,30 +19067,40 @@ function createTermsOfServiceResource(instanceId, client) {
19055
19067
  // src/resources/virtual-accounts/index.ts
19056
19068
  function createVirtualAccountsResource(instanceId, client) {
19057
19069
  return {
19058
- update(_a3) {
19070
+ list(receiver_id) {
19071
+ return client.get(`/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`);
19072
+ },
19073
+ get({
19074
+ receiver_id,
19075
+ id
19076
+ }) {
19077
+ return client.get(
19078
+ `/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts/${id}`
19079
+ );
19080
+ },
19081
+ create(_a3) {
19059
19082
  var _b = _a3, {
19060
19083
  receiver_id
19061
19084
  } = _b, data = __objRest(_b, [
19062
19085
  "receiver_id"
19063
19086
  ]);
19064
- return client.put(
19087
+ return client.post(
19065
19088
  `/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`,
19066
19089
  data
19067
19090
  );
19068
19091
  },
19069
- create(_c) {
19092
+ update(_c) {
19070
19093
  var _d = _c, {
19071
- receiver_id
19094
+ receiver_id,
19095
+ id
19072
19096
  } = _d, data = __objRest(_d, [
19073
- "receiver_id"
19097
+ "receiver_id",
19098
+ "id"
19074
19099
  ]);
19075
- return client.post(
19076
- `/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`,
19100
+ return client.put(
19101
+ `/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts/${id}`,
19077
19102
  data
19078
19103
  );
19079
- },
19080
- get(receiver_id) {
19081
- return client.get(`/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`);
19082
19104
  }
19083
19105
  };
19084
19106
  }
@@ -19336,26 +19358,29 @@ var BlindPay = class {
19336
19358
  });
19337
19359
  }
19338
19360
  /**
19339
- * Verifies the BlindPay webhook signature
19361
+ * Verifies the BlindPay webhook signature using Svix
19340
19362
  *
19341
19363
  * @param params.secret The webhook secret from BlindPay dashboard
19342
- * @param params.id The value of the `svix-id` header
19343
- * @param params.timestamp The value of the `svix-timestamp` header
19344
- * @param params.payload The raw request body
19345
- * @param params.svixSignature The value of the `svix-signature` header
19364
+ * @param params.headers The webhook headers object containing svix-id, svix-timestamp, and svix-signature
19365
+ * @param params.payload The raw request body as a string
19346
19366
  * @returns {boolean} True if the signature is valid, false otherwise
19347
19367
  */
19348
19368
  verifyWebhookSignature({
19349
19369
  secret,
19350
- id,
19351
- timestamp,
19352
- payload,
19353
- svixSignature
19370
+ headers,
19371
+ payload
19354
19372
  }) {
19355
- const signedContent = `${id}.${timestamp}.${payload}`;
19356
- const secretBytes = Buffer.from(secret.split("_")[1], "base64");
19357
- const expectedSignature = (0, import_node_crypto.createHmac)("sha256", secretBytes).update(signedContent).digest("base64");
19358
- return svixSignature.length === expectedSignature.length && (0, import_node_crypto.timingSafeEqual)(Buffer.from(svixSignature), Buffer.from(expectedSignature));
19373
+ try {
19374
+ const webhook = new import_svix.Webhook(secret);
19375
+ webhook.verify(payload, {
19376
+ "svix-id": headers.id,
19377
+ "svix-timestamp": headers.timestamp,
19378
+ "svix-signature": headers.signature
19379
+ });
19380
+ return true;
19381
+ } catch (e) {
19382
+ return false;
19383
+ }
19359
19384
  }
19360
19385
  };
19361
19386
 
@@ -8,21 +8,21 @@ import {
8
8
  import {
9
9
  BlindPay,
10
10
  init_client
11
- } from "../../chunk-4DVSRRBP.mjs";
11
+ } from "../../chunk-WH2VNZE7.mjs";
12
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
17
  import "../../chunk-Z6EYX4D3.mjs";
18
- import "../../chunk-5XJJKYXE.mjs";
18
+ import "../../chunk-LEPGLH7Q.mjs";
19
19
  import "../../chunk-RC5NN5UF.mjs";
20
20
  import "../../chunk-W7NJUABI.mjs";
21
- import "../../chunk-OTRFWEEC.mjs";
22
- import "../../chunk-3QQCDR3E.mjs";
21
+ import "../../chunk-VRA5HP7F.mjs";
22
+ import "../../chunk-VBZHAPK7.mjs";
23
23
  import "../../chunk-LRHWT4JU.mjs";
24
- import "../../chunk-U7CKUUO7.mjs";
25
24
  import "../../chunk-CPOSU35L.mjs";
25
+ import "../../chunk-U7CKUUO7.mjs";
26
26
  import "../../chunk-B5T7AQLH.mjs";
27
27
  import {
28
28
  __async,
@@ -1,7 +1,10 @@
1
- import { I as InternalApiClient, S as StablecoinToken, B as BlindpayApiResponse } from '../../api-client-Cw2mNJeR.mjs';
1
+ import { I as InternalApiClient, B as BlindpayApiResponse, S as StablecoinToken, N as Network } from '../../api-client-B7VQkM_4.mjs';
2
2
 
3
+ type BankingPartner = "jpmorgan" | "citi";
3
4
  type VirtualAccount = {
4
5
  id: string;
6
+ banking_partner: BankingPartner;
7
+ kyc_status: string;
5
8
  us: {
6
9
  ach: {
7
10
  routing_number: string;
@@ -30,24 +33,36 @@ type VirtualAccount = {
30
33
  };
31
34
  token: StablecoinToken;
32
35
  blockchain_wallet_id: string;
36
+ blockchain_wallet: {
37
+ network: Network;
38
+ address: string;
39
+ } | null;
33
40
  };
41
+ type ListVirtualAccountsInput = string;
42
+ type ListVirtualAccountsResponse = VirtualAccount[];
34
43
  type CreateVirtualAccountInput = {
35
44
  receiver_id: string;
36
- blockchain_wallet_id: string;
45
+ banking_partner: BankingPartner;
37
46
  token: StablecoinToken;
47
+ blockchain_wallet_id: string;
38
48
  };
39
49
  type CreateVirtualAccountResponse = VirtualAccount;
40
- type GetVirtualAccountInput = string;
50
+ type GetVirtualAccountInput = {
51
+ receiver_id: string;
52
+ id: string;
53
+ };
41
54
  type GetVirtualAccountResponse = VirtualAccount;
42
55
  type UpdateVirtualAccountInput = {
43
56
  receiver_id: string;
44
- blockchain_wallet_id: string;
57
+ id: string;
45
58
  token: StablecoinToken;
59
+ blockchain_wallet_id: string;
46
60
  };
47
61
  declare function createVirtualAccountsResource(instanceId: string, client: InternalApiClient): {
48
- update({ receiver_id, ...data }: UpdateVirtualAccountInput): Promise<BlindpayApiResponse<void>>;
62
+ list(receiver_id: ListVirtualAccountsInput): Promise<BlindpayApiResponse<ListVirtualAccountsResponse>>;
63
+ get({ receiver_id, id, }: GetVirtualAccountInput): Promise<BlindpayApiResponse<GetVirtualAccountResponse>>;
49
64
  create({ receiver_id, ...data }: CreateVirtualAccountInput): Promise<BlindpayApiResponse<CreateVirtualAccountResponse>>;
50
- get(receiver_id: GetVirtualAccountInput): Promise<BlindpayApiResponse<GetVirtualAccountResponse>>;
65
+ update({ receiver_id, id, ...data }: UpdateVirtualAccountInput): Promise<BlindpayApiResponse<void>>;
51
66
  };
52
67
 
53
- export { type CreateVirtualAccountInput, type CreateVirtualAccountResponse, type GetVirtualAccountInput, type GetVirtualAccountResponse, type UpdateVirtualAccountInput, type VirtualAccount, createVirtualAccountsResource };
68
+ export { type BankingPartner, type CreateVirtualAccountInput, type CreateVirtualAccountResponse, type GetVirtualAccountInput, type GetVirtualAccountResponse, type ListVirtualAccountsInput, type ListVirtualAccountsResponse, type UpdateVirtualAccountInput, type VirtualAccount, createVirtualAccountsResource };