@blindpay/node 1.0.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +24 -37
  3. package/dist/{chunk-HKFAJXJG.mjs → chunk-3QQCDR3E.mjs} +12 -32
  4. package/dist/{chunk-LUDGZPXY.mjs → chunk-5XJJKYXE.mjs} +9 -16
  5. package/dist/chunk-64EFLUS3.mjs +106 -0
  6. package/dist/chunk-B5T7AQLH.mjs +38 -0
  7. package/dist/{chunk-VKN2AMCW.mjs → chunk-BONN6PYB.mjs} +12 -30
  8. package/dist/{chunk-M6IYYMRW.mjs → chunk-E7M4CJKR.mjs} +4 -12
  9. package/dist/chunk-IZYPRCCV.mjs +82 -0
  10. package/dist/{chunk-QVOSGLUO.mjs → chunk-LRHWT4JU.mjs} +6 -10
  11. package/dist/chunk-QGNLMN6Z.mjs +49 -0
  12. package/dist/{chunk-3CZJEDS5.mjs → chunk-RC5NN5UF.mjs} +5 -14
  13. package/dist/{chunk-GNDAATIJ.mjs → chunk-TBTA7A2P.mjs} +4 -12
  14. package/dist/{chunk-CNNEROQ7.mjs → chunk-UC57SCKQ.mjs} +6 -17
  15. package/dist/{chunk-UCAW3RTZ.mjs → chunk-W7NJUABI.mjs} +12 -20
  16. package/dist/{chunk-ES7RXEM7.mjs → chunk-YPXYUS2X.mjs} +46 -37
  17. package/dist/index.d.mts +14 -10
  18. package/dist/index.d.ts +14 -10
  19. package/dist/index.js +237 -435
  20. package/dist/index.mjs +19 -19
  21. package/dist/resources/api-keys/api-keys.test.js +238 -445
  22. package/dist/resources/api-keys/api-keys.test.mjs +19 -28
  23. package/dist/resources/api-keys/index.d.mts +20 -20
  24. package/dist/resources/api-keys/index.d.ts +20 -20
  25. package/dist/resources/api-keys/index.js +6 -10
  26. package/dist/resources/api-keys/index.mjs +1 -1
  27. package/dist/resources/available/available.test.js +235 -433
  28. package/dist/resources/available/available.test.mjs +16 -16
  29. package/dist/resources/bank-accounts/bank-accounts.test.js +245 -455
  30. package/dist/resources/bank-accounts/bank-accounts.test.mjs +26 -38
  31. package/dist/resources/bank-accounts/index.d.mts +22 -145
  32. package/dist/resources/bank-accounts/index.d.ts +22 -145
  33. package/dist/resources/bank-accounts/index.js +102 -184
  34. package/dist/resources/bank-accounts/index.mjs +1 -1
  35. package/dist/resources/instances/index.d.mts +9 -20
  36. package/dist/resources/instances/index.d.ts +9 -20
  37. package/dist/resources/instances/index.js +11 -20
  38. package/dist/resources/instances/index.mjs +1 -1
  39. package/dist/resources/instances/instances.test.js +239 -446
  40. package/dist/resources/instances/instances.test.mjs +20 -29
  41. package/dist/resources/partner-fees/index.d.mts +8 -18
  42. package/dist/resources/partner-fees/index.d.ts +8 -18
  43. package/dist/resources/partner-fees/index.js +5 -14
  44. package/dist/resources/partner-fees/index.mjs +1 -1
  45. package/dist/resources/partner-fees/partner-fees.test.js +238 -445
  46. package/dist/resources/partner-fees/partner-fees.test.mjs +19 -28
  47. package/dist/resources/payins/index.d.mts +15 -30
  48. package/dist/resources/payins/index.d.ts +15 -30
  49. package/dist/resources/payins/index.js +12 -20
  50. package/dist/resources/payins/index.mjs +1 -1
  51. package/dist/resources/payins/payins-quotes.test.js +235 -435
  52. package/dist/resources/payins/payins-quotes.test.mjs +16 -18
  53. package/dist/resources/payins/payins.test.js +240 -449
  54. package/dist/resources/payins/payins.test.mjs +21 -32
  55. package/dist/resources/payins/quotes.d.mts +3 -5
  56. package/dist/resources/payins/quotes.d.ts +3 -5
  57. package/dist/resources/payins/quotes.js +4 -12
  58. package/dist/resources/payins/quotes.mjs +1 -1
  59. package/dist/resources/payouts/index.d.mts +13 -28
  60. package/dist/resources/payouts/index.d.ts +13 -28
  61. package/dist/resources/payouts/index.js +12 -32
  62. package/dist/resources/payouts/index.mjs +1 -1
  63. package/dist/resources/payouts/payouts.test.js +239 -449
  64. package/dist/resources/payouts/payouts.test.mjs +20 -32
  65. package/dist/resources/quotes/index.d.mts +3 -5
  66. package/dist/resources/quotes/index.d.ts +3 -5
  67. package/dist/resources/quotes/index.js +4 -12
  68. package/dist/resources/quotes/index.mjs +1 -1
  69. package/dist/resources/quotes/quotes.test.js +235 -435
  70. package/dist/resources/quotes/quotes.test.mjs +16 -18
  71. package/dist/resources/receivers/index.d.mts +13 -27
  72. package/dist/resources/receivers/index.d.ts +13 -27
  73. package/dist/resources/receivers/index.js +12 -30
  74. package/dist/resources/receivers/index.mjs +1 -1
  75. package/dist/resources/receivers/receivers.test.js +241 -452
  76. package/dist/resources/receivers/receivers.test.mjs +22 -35
  77. package/dist/resources/virtual-accounts/index.d.mts +7 -12
  78. package/dist/resources/virtual-accounts/index.d.ts +7 -12
  79. package/dist/resources/virtual-accounts/index.js +9 -16
  80. package/dist/resources/virtual-accounts/index.mjs +1 -1
  81. package/dist/resources/virtual-accounts/virtual-accounts.test.js +238 -441
  82. package/dist/resources/virtual-accounts/virtual-accounts.test.mjs +19 -24
  83. package/dist/resources/wallets/blockchain.d.mts +23 -31
  84. package/dist/resources/wallets/blockchain.d.ts +23 -31
  85. package/dist/resources/wallets/blockchain.js +51 -33
  86. package/dist/resources/wallets/blockchain.mjs +1 -1
  87. package/dist/resources/wallets/blockchain.test.js +268 -451
  88. package/dist/resources/wallets/blockchain.test.mjs +49 -34
  89. package/dist/resources/wallets/offramp.d.mts +10 -13
  90. package/dist/resources/wallets/offramp.d.ts +10 -13
  91. package/dist/resources/wallets/offramp.js +14 -14
  92. package/dist/resources/wallets/offramp.mjs +1 -1
  93. package/dist/resources/wallets/offramp.test.js +241 -442
  94. package/dist/resources/wallets/offramp.test.mjs +22 -25
  95. package/dist/resources/webhooks/index.d.mts +9 -22
  96. package/dist/resources/webhooks/index.d.ts +9 -22
  97. package/dist/resources/webhooks/index.js +6 -17
  98. package/dist/resources/webhooks/index.mjs +1 -1
  99. package/dist/resources/webhooks/webhooks.test.js +239 -448
  100. package/dist/resources/webhooks/webhooks.test.mjs +20 -31
  101. package/package.json +2 -4
  102. package/dist/chunk-2DAKB5XK.mjs +0 -212
  103. package/dist/chunk-GEDDLCJY.mjs +0 -77
  104. package/dist/chunk-LK3JPQ6I.mjs +0 -49
  105. package/dist/chunk-LLWEHHKB.mjs +0 -47
@@ -18714,10 +18714,10 @@ var import_expect_type = __toESM(require_dist(), 1);
18714
18714
  var import_node_crypto = require("crypto");
18715
18715
 
18716
18716
  // package.json
18717
- var version = "1.0.0";
18717
+ var version = "1.1.1";
18718
18718
 
18719
18719
  // src/internal/blindpay-error.ts
18720
- var BlindpayError = class extends Error {
18720
+ var BlindPayError = class extends Error {
18721
18721
  constructor(message) {
18722
18722
  super(message);
18723
18723
  this.name = "BlindpayError";
@@ -18725,23 +18725,19 @@ var BlindpayError = class extends Error {
18725
18725
  };
18726
18726
 
18727
18727
  // src/resources/api-keys/index.ts
18728
- function createApiKeysResource(client) {
18728
+ function createApiKeysResource(instanceId, client) {
18729
18729
  return {
18730
- list({ instanceId }) {
18730
+ list() {
18731
18731
  return client.get(`/instances/${instanceId}/api-keys`);
18732
18732
  },
18733
18733
  create(_a3) {
18734
- var _b = _a3, {
18735
- instanceId
18736
- } = _b, data = __objRest(_b, [
18737
- "instanceId"
18738
- ]);
18734
+ var data = __objRest(_a3, []);
18739
18735
  return client.post(`/instances/${instanceId}/api-keys`, data);
18740
18736
  },
18741
- get({ instanceId, id }) {
18742
- return client.get(`/instances/${instanceId}/api_keys/${id}`);
18737
+ get(id) {
18738
+ return client.get(`/instances/${instanceId}/api-keys/${id}`);
18743
18739
  },
18744
- delete({ instanceId, id }) {
18740
+ delete(id) {
18745
18741
  return client.delete(`/instances/${instanceId}/api-keys/${id}`);
18746
18742
  }
18747
18743
  };
@@ -18760,621 +18756,427 @@ function createAvailableResource(client) {
18760
18756
  }
18761
18757
 
18762
18758
  // src/resources/bank-accounts/index.ts
18763
- function createBankAccountsResource(client) {
18759
+ function createBankAccountsResource(instanceId, client) {
18764
18760
  return {
18765
- list({
18766
- instanceId,
18767
- receiverId
18768
- }) {
18769
- return client.get(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`);
18761
+ list(receiver_id) {
18762
+ return client.get(`/instances/${instanceId}/receivers/${receiver_id}/bank-accounts`);
18770
18763
  },
18771
- createPix({
18772
- instanceId,
18773
- receiverId,
18774
- name,
18775
- pix_key
18764
+ get({
18765
+ receiver_id,
18766
+ id
18776
18767
  }) {
18777
- return client.post(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`, {
18778
- type: "pix",
18779
- name,
18780
- pix_key
18781
- });
18768
+ return client.get(
18769
+ `/instances/${instanceId}/receivers/${receiver_id}/bank-accounts/${id}`
18770
+ );
18782
18771
  },
18783
- createArgentinaTransfers({
18784
- instanceId,
18785
- receiverId,
18786
- beneficiary_name,
18787
- name,
18788
- transfers_account,
18789
- transfers_type
18790
- }) {
18791
- return client.post(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`, {
18792
- type: "transfers_bitso",
18793
- beneficiary_name,
18794
- name,
18795
- transfers_account,
18796
- transfers_type
18797
- });
18772
+ delete({ receiver_id, id }) {
18773
+ return client.delete(
18774
+ `/instances/${instanceId}/receivers/${receiver_id}/bank-accounts/${id}`
18775
+ );
18798
18776
  },
18799
- createSpei({
18800
- instanceId,
18801
- receiverId,
18802
- beneficiary_name,
18803
- name,
18804
- spei_clabe,
18805
- spei_institution_code,
18806
- spei_protocol
18807
- }) {
18808
- return client.post(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`, {
18809
- type: "spei_bitso",
18810
- beneficiary_name,
18811
- name,
18812
- spei_clabe,
18813
- spei_institution_code,
18814
- spei_protocol
18815
- });
18777
+ createPix(_a3) {
18778
+ var _b = _a3, {
18779
+ receiver_id
18780
+ } = _b, data = __objRest(_b, [
18781
+ "receiver_id"
18782
+ ]);
18783
+ return client.post(`/instances/${instanceId}/receivers/${receiver_id}/bank-accounts`, __spreadValues({
18784
+ type: "pix"
18785
+ }, data));
18816
18786
  },
18817
- createColombiaAch({
18818
- instanceId,
18819
- receiverId,
18820
- name,
18821
- account_type,
18822
- ach_cop_beneficiary_first_name,
18823
- ach_cop_beneficiary_last_name,
18824
- ach_cop_document_id,
18825
- ach_cop_document_type,
18826
- ach_cop_email,
18827
- ach_cop_bank_code,
18828
- ach_cop_bank_account
18829
- }) {
18830
- return client.post(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`, {
18831
- type: "ach_cop_bitso",
18832
- name,
18833
- account_type,
18834
- ach_cop_beneficiary_first_name,
18835
- ach_cop_beneficiary_last_name,
18836
- ach_cop_document_id,
18837
- ach_cop_document_type,
18838
- ach_cop_email,
18839
- ach_cop_bank_code,
18840
- ach_cop_bank_account
18841
- });
18787
+ createArgentinaTransfers(_c) {
18788
+ var _d = _c, {
18789
+ receiver_id
18790
+ } = _d, data = __objRest(_d, [
18791
+ "receiver_id"
18792
+ ]);
18793
+ return client.post(`/instances/${instanceId}/receivers/${receiver_id}/bank-accounts`, __spreadValues({
18794
+ type: "transfers_bitso"
18795
+ }, data));
18842
18796
  },
18843
- createAch({
18844
- instanceId,
18845
- receiverId,
18846
- name,
18847
- account_class,
18848
- account_number,
18849
- account_type,
18850
- beneficiary_name,
18851
- routing_number
18852
- }) {
18853
- return client.post(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`, {
18854
- type: "ach",
18855
- name,
18856
- account_class,
18857
- account_number,
18858
- account_type,
18859
- beneficiary_name,
18860
- routing_number
18861
- });
18797
+ createSpei(_e) {
18798
+ var _f = _e, {
18799
+ receiver_id
18800
+ } = _f, data = __objRest(_f, [
18801
+ "receiver_id"
18802
+ ]);
18803
+ return client.post(`/instances/${instanceId}/receivers/${receiver_id}/bank-accounts`, __spreadValues({
18804
+ type: "spei_bitso"
18805
+ }, data));
18862
18806
  },
18863
- createWire({
18864
- instanceId,
18865
- receiverId,
18866
- name,
18867
- account_number,
18868
- beneficiary_name,
18869
- routing_number,
18870
- address_line_1,
18871
- address_line_2,
18872
- city,
18873
- state_province_region,
18874
- country,
18875
- postal_code
18876
- }) {
18877
- return client.post(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`, {
18878
- type: "wire",
18879
- name,
18880
- account_number,
18881
- beneficiary_name,
18882
- routing_number,
18883
- address_line_1,
18884
- address_line_2,
18885
- city,
18886
- state_province_region,
18887
- country,
18888
- postal_code
18889
- });
18807
+ createColombiaAch(_g) {
18808
+ var _h = _g, {
18809
+ receiver_id
18810
+ } = _h, data = __objRest(_h, [
18811
+ "receiver_id"
18812
+ ]);
18813
+ return client.post(`/instances/${instanceId}/receivers/${receiver_id}/bank-accounts`, __spreadValues({
18814
+ type: "ach_cop_bitso"
18815
+ }, data));
18890
18816
  },
18891
- createInternationalSwift({
18892
- instanceId,
18893
- receiverId,
18894
- name,
18895
- swift_account_holder_name,
18896
- swift_account_number_iban,
18897
- swift_bank_address_line_1,
18898
- swift_bank_address_line_2,
18899
- swift_bank_city,
18900
- swift_bank_country,
18901
- swift_bank_name,
18902
- swift_bank_postal_code,
18903
- swift_bank_state_province_region,
18904
- swift_beneficiary_address_line_1,
18905
- swift_beneficiary_address_line_2,
18906
- swift_beneficiary_city,
18907
- swift_beneficiary_country,
18908
- swift_beneficiary_postal_code,
18909
- swift_beneficiary_state_province_region,
18910
- swift_code_bic,
18911
- swift_intermediary_bank_account_number_iban,
18912
- swift_intermediary_bank_country,
18913
- swift_intermediary_bank_name,
18914
- swift_intermediary_bank_swift_code_bic
18915
- }) {
18916
- return client.post(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`, {
18917
- type: "international_swift",
18918
- name,
18919
- swift_account_holder_name,
18920
- swift_account_number_iban,
18921
- swift_bank_address_line_1,
18922
- swift_bank_address_line_2,
18923
- swift_bank_city,
18924
- swift_bank_country,
18925
- swift_bank_name,
18926
- swift_bank_postal_code,
18927
- swift_bank_state_province_region,
18928
- swift_beneficiary_address_line_1,
18929
- swift_beneficiary_address_line_2,
18930
- swift_beneficiary_city,
18931
- swift_beneficiary_country,
18932
- swift_beneficiary_postal_code,
18933
- swift_beneficiary_state_province_region,
18934
- swift_code_bic,
18935
- swift_intermediary_bank_account_number_iban,
18936
- swift_intermediary_bank_country,
18937
- swift_intermediary_bank_name,
18938
- swift_intermediary_bank_swift_code_bic
18939
- });
18817
+ createAch(_i) {
18818
+ var _j = _i, {
18819
+ receiver_id
18820
+ } = _j, data = __objRest(_j, [
18821
+ "receiver_id"
18822
+ ]);
18823
+ return client.post(`/instances/${instanceId}/receivers/${receiver_id}/bank-accounts`, __spreadValues({
18824
+ type: "ach"
18825
+ }, data));
18940
18826
  },
18941
- get({
18942
- instanceId,
18943
- receiverId,
18944
- id
18945
- }) {
18946
- return client.get(
18947
- `/instances/${instanceId}/receivers/${receiverId}/bank-accounts/${id}`
18948
- );
18827
+ createWire(_k) {
18828
+ var _l = _k, {
18829
+ receiver_id
18830
+ } = _l, data = __objRest(_l, [
18831
+ "receiver_id"
18832
+ ]);
18833
+ return client.post(`/instances/${instanceId}/receivers/${receiver_id}/bank-accounts`, __spreadValues({
18834
+ type: "wire"
18835
+ }, data));
18949
18836
  },
18950
- delete({
18951
- instanceId,
18952
- receiverId,
18953
- id
18954
- }) {
18955
- return client.delete(
18956
- `/instances/${instanceId}/receivers/${receiverId}/bank-accounts/${id}`
18957
- );
18837
+ createInternationalSwift(_m) {
18838
+ var _n = _m, {
18839
+ receiver_id
18840
+ } = _n, data = __objRest(_n, [
18841
+ "receiver_id"
18842
+ ]);
18843
+ return client.post(`/instances/${instanceId}/receivers/${receiver_id}/bank-accounts`, __spreadValues({
18844
+ type: "international_swift"
18845
+ }, data));
18958
18846
  }
18959
18847
  };
18960
18848
  }
18961
18849
 
18962
18850
  // src/resources/instances/index.ts
18963
- function createInstancesResource(client) {
18851
+ function createInstancesResource(instanceId, client) {
18964
18852
  return {
18965
- getMembers({
18966
- instanceId
18967
- }) {
18853
+ getMembers() {
18968
18854
  return client.get(`/instances/${instanceId}/members`);
18969
18855
  },
18970
18856
  update(_a3) {
18971
- var _b = _a3, { instanceId } = _b, data = __objRest(_b, ["instanceId"]);
18857
+ var data = __objRest(_a3, []);
18972
18858
  return client.put(`/instances/${instanceId}`, data);
18973
18859
  },
18974
- delete({ instanceId }) {
18860
+ delete() {
18975
18861
  return client.delete(`/instances/${instanceId}`);
18976
18862
  },
18977
- deleteMember({
18978
- instanceId,
18979
- id
18980
- }) {
18981
- return client.delete(`/instances/${instanceId}/members/${id}`);
18863
+ deleteMember(memberId) {
18864
+ return client.delete(`/instances/${instanceId}/members/${memberId}`);
18982
18865
  },
18983
- updateMemberRole(_c) {
18984
- var _d = _c, {
18985
- instanceId,
18986
- id
18987
- } = _d, data = __objRest(_d, [
18988
- "instanceId",
18989
- "id"
18990
- ]);
18991
- return client.put(`/instances/${instanceId}/members/${id}`, data);
18866
+ updateMemberRole({
18867
+ memberId,
18868
+ role
18869
+ }) {
18870
+ return client.put(`/instances/${instanceId}/members/${memberId}`, { role });
18992
18871
  }
18993
18872
  };
18994
18873
  }
18995
18874
 
18996
18875
  // src/resources/partner-fees/index.ts
18997
- function createPartnerFeesResource(client) {
18876
+ function createPartnerFeesResource(instanceId, client) {
18998
18877
  return {
18999
- list({
19000
- instanceId
19001
- }) {
18878
+ list() {
19002
18879
  return client.get(`/instances/${instanceId}/partner-fees`);
19003
18880
  },
19004
18881
  create(_a3) {
19005
- var _b = _a3, {
19006
- instanceId
19007
- } = _b, data = __objRest(_b, [
19008
- "instanceId"
19009
- ]);
18882
+ var data = __objRest(_a3, []);
19010
18883
  return client.post(`/instances/${instanceId}/partner-fees`, data);
19011
18884
  },
19012
- get({
19013
- instanceId,
19014
- id
19015
- }) {
18885
+ get(id) {
19016
18886
  return client.get(`/instances/${instanceId}/partner-fees/${id}`);
19017
18887
  },
19018
- delete({ instanceId, id }) {
18888
+ delete(id) {
19019
18889
  return client.delete(`/instances/${instanceId}/partner-fees/${id}`);
19020
18890
  }
19021
18891
  };
19022
18892
  }
19023
18893
 
19024
18894
  // src/resources/payins/index.ts
19025
- function createPayinsResource(client) {
18895
+ function createPayinsResource(instanceId, client) {
19026
18896
  return {
19027
- list({
19028
- instanceId,
19029
- params
19030
- }) {
18897
+ list(params) {
19031
18898
  const queryParams = params ? `?${new URLSearchParams(params)}` : "";
19032
18899
  return client.get(`/instances/${instanceId}/payins${queryParams}`);
19033
18900
  },
19034
- get({ instanceId, id }) {
19035
- return client.get(`/instances/${instanceId}/payins/${id}`);
18901
+ get(payinId) {
18902
+ return client.get(`/instances/${instanceId}/payins/${payinId}`);
19036
18903
  },
19037
- getTrack({ id }) {
19038
- return client.get(`/e/payins/${id}`);
18904
+ getTrack(payinId) {
18905
+ return client.get(`/e/payins/${payinId}`);
19039
18906
  },
19040
- export({
19041
- instanceId,
19042
- params
19043
- }) {
18907
+ export(_a3) {
18908
+ var params = __objRest(_a3, []);
19044
18909
  const queryParams = params ? `?${new URLSearchParams(params)}` : "";
19045
18910
  return client.get(`/instances/${instanceId}/export/payins${queryParams}`);
19046
18911
  },
19047
- createEvm(_a3) {
19048
- var _b = _a3, {
19049
- instanceId
19050
- } = _b, data = __objRest(_b, [
19051
- "instanceId"
19052
- ]);
19053
- return client.post(`/instances/${instanceId}/payins/evm`, data);
18912
+ createEvm(payin_quote_id) {
18913
+ return client.post(`/instances/${instanceId}/payins/evm`, {
18914
+ payin_quote_id
18915
+ });
19054
18916
  }
19055
18917
  };
19056
18918
  }
19057
18919
 
19058
18920
  // src/resources/payins/quotes.ts
19059
- function createPayinQuotesResource(client) {
18921
+ function createPayinQuotesResource(instanceId, client) {
19060
18922
  return {
19061
18923
  create(_a3) {
19062
- var _b = _a3, {
19063
- instanceId
19064
- } = _b, data = __objRest(_b, [
19065
- "instanceId"
19066
- ]);
18924
+ var data = __objRest(_a3, []);
19067
18925
  return client.post(`/instances/${instanceId}/payin-quotes`, data);
19068
18926
  },
19069
- getFxRate(_c) {
19070
- var _d = _c, {
19071
- instanceId
19072
- } = _d, data = __objRest(_d, [
19073
- "instanceId"
19074
- ]);
18927
+ getFxRate(_b) {
18928
+ var data = __objRest(_b, []);
19075
18929
  return client.post(`/instances/${instanceId}/payin-quotes/fx`, data);
19076
18930
  }
19077
18931
  };
19078
18932
  }
19079
18933
 
19080
18934
  // src/resources/payouts/index.ts
19081
- function createPayoutsResource(client) {
18935
+ function createPayoutsResource(instanceId, client) {
19082
18936
  return {
19083
- list({
19084
- instanceId,
19085
- params
19086
- }) {
18937
+ list(params) {
19087
18938
  const queryParams = params ? `?${new URLSearchParams(params)}` : "";
19088
18939
  return client.get(`/instances/${instanceId}/payouts${queryParams}`);
19089
18940
  },
19090
- export({
19091
- instanceId,
19092
- params
19093
- }) {
18941
+ export(params) {
19094
18942
  const queryParams = params ? `?${new URLSearchParams(params)}` : "";
19095
18943
  return client.get(`/instances/${instanceId}/export/payouts${queryParams}`);
19096
18944
  },
19097
- get({ instanceId, id }) {
19098
- return client.get(`/instances/${instanceId}/payouts/${id}`);
18945
+ get(payoutId) {
18946
+ return client.get(`/instances/${instanceId}/payouts/${payoutId}`);
19099
18947
  },
19100
- getTrack({
19101
- id
19102
- }) {
19103
- return client.get(`/e/payouts/${id}`);
18948
+ getTrack(payoutId) {
18949
+ return client.get(`/e/payouts/${payoutId}`);
19104
18950
  },
19105
18951
  authorizeStellarToken(_a3) {
19106
- var _b = _a3, {
19107
- instanceId
19108
- } = _b, data = __objRest(_b, [
19109
- "instanceId"
19110
- ]);
18952
+ var data = __objRest(_a3, []);
19111
18953
  return client.post(`/instances/${instanceId}/payouts/stellar/authorize`, data);
19112
18954
  },
19113
- createStellar(_c) {
19114
- var _d = _c, {
19115
- instanceId
19116
- } = _d, data = __objRest(_d, [
19117
- "instanceId"
19118
- ]);
18955
+ createStellar(_b) {
18956
+ var data = __objRest(_b, []);
19119
18957
  return client.post(`/instances/${instanceId}/payouts/stellar`, data);
19120
18958
  },
19121
- createEvm(_e) {
19122
- var _f = _e, {
19123
- instanceId
19124
- } = _f, data = __objRest(_f, [
19125
- "instanceId"
19126
- ]);
18959
+ createEvm(_c) {
18960
+ var data = __objRest(_c, []);
19127
18961
  return client.post(`/instances/${instanceId}/payouts/evm`, data);
19128
18962
  }
19129
18963
  };
19130
18964
  }
19131
18965
 
19132
18966
  // src/resources/quotes/index.ts
19133
- function createQuotesResource(client) {
18967
+ function createQuotesResource(instanceId, client) {
19134
18968
  return {
19135
18969
  create(_a3) {
19136
- var _b = _a3, {
19137
- instanceId
19138
- } = _b, data = __objRest(_b, [
19139
- "instanceId"
19140
- ]);
18970
+ var data = __objRest(_a3, []);
19141
18971
  return client.post(`/instances/${instanceId}/quotes`, data);
19142
18972
  },
19143
- getFxRate(_c) {
19144
- var _d = _c, {
19145
- instanceId
19146
- } = _d, data = __objRest(_d, [
19147
- "instanceId"
19148
- ]);
18973
+ getFxRate(_b) {
18974
+ var data = __objRest(_b, []);
19149
18975
  return client.post(`/instances/${instanceId}/quotes/fx`, data);
19150
18976
  }
19151
18977
  };
19152
18978
  }
19153
18979
 
19154
18980
  // src/resources/receivers/index.ts
19155
- function createReceiversResource(client) {
18981
+ function createReceiversResource(instanceId, client) {
19156
18982
  return {
19157
- list({
19158
- instanceId
19159
- }) {
18983
+ list() {
19160
18984
  return client.get(`/instances/${instanceId}/receivers`);
19161
18985
  },
19162
18986
  create(_a3) {
19163
- var _b = _a3, {
19164
- instanceId
19165
- } = _b, data = __objRest(_b, [
19166
- "instanceId"
19167
- ]);
18987
+ var data = __objRest(_a3, []);
19168
18988
  return client.post(`/instances/${instanceId}/receivers`, data);
19169
18989
  },
19170
- get({
19171
- instanceId,
19172
- id
19173
- }) {
19174
- return client.get(`/instances/${instanceId}/receivers/${id}`);
18990
+ get(receiver_id) {
18991
+ return client.get(`/instances/${instanceId}/receivers/${receiver_id}`);
19175
18992
  },
19176
- update(_c) {
19177
- var _d = _c, {
19178
- instanceId,
19179
- id
19180
- } = _d, data = __objRest(_d, [
19181
- "instanceId",
19182
- "id"
19183
- ]);
19184
- return client.patch(`/instances/${instanceId}/receivers/${id}`, data);
18993
+ update(_b) {
18994
+ var _c = _b, { receiver_id } = _c, data = __objRest(_c, ["receiver_id"]);
18995
+ return client.patch(`/instances/${instanceId}/receivers/${receiver_id}`, data);
19185
18996
  },
19186
- delete({ instanceId, id }) {
19187
- return client.delete(`/instances/${instanceId}/receivers/${id}`);
18997
+ delete(receiver_id) {
18998
+ return client.delete(`/instances/${instanceId}/receivers/${receiver_id}`);
19188
18999
  },
19189
- getLimits({
19190
- instanceId,
19191
- id
19192
- }) {
19193
- return client.get(`/instances/${instanceId}/limits/receivers/${id}`);
19000
+ getLimits(receiver_id) {
19001
+ return client.get(`/instances/${instanceId}/limits/receivers/${receiver_id}`);
19194
19002
  }
19195
19003
  };
19196
19004
  }
19197
19005
 
19198
19006
  // src/resources/virtual-accounts/index.ts
19199
- function createVirtualAccountsResource(client) {
19007
+ function createVirtualAccountsResource(instanceId, client) {
19200
19008
  return {
19201
19009
  update(_a3) {
19202
19010
  var _b = _a3, {
19203
- instanceId,
19204
- receiverId
19011
+ receiver_id
19205
19012
  } = _b, data = __objRest(_b, [
19206
- "instanceId",
19207
- "receiverId"
19013
+ "receiver_id"
19208
19014
  ]);
19209
19015
  return client.put(
19210
- `/instances/${instanceId}/receivers/${receiverId}/virtual-accounts`,
19016
+ `/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`,
19211
19017
  data
19212
19018
  );
19213
19019
  },
19214
19020
  create(_c) {
19215
19021
  var _d = _c, {
19216
- instanceId,
19217
- receiverId
19022
+ receiver_id
19218
19023
  } = _d, data = __objRest(_d, [
19219
- "instanceId",
19220
- "receiverId"
19024
+ "receiver_id"
19221
19025
  ]);
19222
19026
  return client.post(
19223
- `/instances/${instanceId}/receivers/${receiverId}/virtual-accounts`,
19027
+ `/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`,
19224
19028
  data
19225
19029
  );
19226
19030
  },
19227
- get({
19228
- instanceId,
19229
- receiverId
19230
- }) {
19231
- return client.get(`/instances/${instanceId}/receivers/${receiverId}/virtual-accounts`);
19031
+ get(receiver_id) {
19032
+ return client.get(`/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`);
19232
19033
  }
19233
19034
  };
19234
19035
  }
19235
19036
 
19236
19037
  // src/resources/wallets/blockchain.ts
19237
- function createBlockchainWalletsResource(client) {
19038
+ function createBlockchainWalletsResource(instanceId, client) {
19238
19039
  return {
19239
- list({
19240
- instanceId,
19241
- receiverId
19242
- }) {
19040
+ list(receiver_id) {
19243
19041
  return client.get(
19244
- `/instances/${instanceId}/receivers/${receiverId}/blockchain-wallets`
19042
+ `/instances/${instanceId}/receivers/${receiver_id}/blockchain-wallets`
19245
19043
  );
19246
19044
  },
19247
- create(_a3) {
19045
+ createWithAddress(_a3) {
19248
19046
  var _b = _a3, {
19249
- instanceId
19047
+ receiver_id
19250
19048
  } = _b, data = __objRest(_b, [
19251
- "instanceId"
19049
+ "receiver_id"
19252
19050
  ]);
19253
- return client.post(`/instances/${instanceId}/blockchain-wallets`, data);
19051
+ return client.post(
19052
+ `/instances/${instanceId}/receivers/${receiver_id}/blockchain-wallets`,
19053
+ __spreadProps(__spreadValues({}, data), {
19054
+ is_account_abstraction: true
19055
+ })
19056
+ );
19254
19057
  },
19255
- getWalletMessage({
19256
- receiverId,
19257
- instanceId
19258
- }) {
19058
+ createWithHash(_c) {
19059
+ var _d = _c, {
19060
+ receiver_id
19061
+ } = _d, data = __objRest(_d, [
19062
+ "receiver_id"
19063
+ ]);
19064
+ return client.post(
19065
+ `/instances/${instanceId}/receivers/${receiver_id}/blockchain-wallets`,
19066
+ __spreadProps(__spreadValues({}, data), {
19067
+ is_account_abstraction: false
19068
+ })
19069
+ );
19070
+ },
19071
+ getWalletMessage(receiver_id) {
19259
19072
  return client.get(
19260
- `/instances/${instanceId}/receivers/${receiverId}/blockchain-wallets/sign-message`
19073
+ `/instances/${instanceId}/receivers/${receiver_id}/blockchain-wallets/sign-message`
19261
19074
  );
19262
19075
  },
19263
19076
  get({
19264
- instanceId,
19265
- receiverId,
19077
+ receiver_id,
19266
19078
  id
19267
19079
  }) {
19268
19080
  return client.get(
19269
- `/instances/${instanceId}/receivers/${receiverId}/blockchain-wallets/${id}`
19081
+ `/instances/${instanceId}/receivers/${receiver_id}/blockchain-wallets/${id}`
19270
19082
  );
19271
19083
  },
19272
19084
  delete({
19273
- instanceId,
19274
- receiverId,
19085
+ receiver_id,
19275
19086
  id
19276
19087
  }) {
19277
19088
  return client.delete(
19278
- `/instances/${instanceId}/receivers/${receiverId}/blockchain-wallets/${id}`
19089
+ `/instances/${instanceId}/receivers/${receiver_id}/blockchain-wallets/${id}`
19279
19090
  );
19280
19091
  },
19281
- createAssetTrustline(_c) {
19282
- var _d = _c, {
19283
- instanceId
19284
- } = _d, data = __objRest(_d, [
19285
- "instanceId"
19286
- ]);
19287
- return client.post(`/instances/${instanceId}/create-asset-trustline`, data);
19092
+ createAssetTrustline(address) {
19093
+ return client.post(`/instances/${instanceId}/create-asset-trustline`, {
19094
+ address
19095
+ });
19288
19096
  },
19289
19097
  mintUsdbStellar(_e) {
19290
- var _f = _e, {
19291
- instanceId
19292
- } = _f, data = __objRest(_f, [
19293
- "instanceId"
19294
- ]);
19098
+ var data = __objRest(_e, []);
19295
19099
  return client.post(`/instances/${instanceId}/mint-usdb-stellar`, data);
19296
19100
  }
19297
19101
  };
19298
19102
  }
19299
19103
 
19300
19104
  // src/resources/wallets/offramp.ts
19301
- function createOfframpWalletsResource(client) {
19105
+ function createOfframpWalletsResource(instanceId, client) {
19302
19106
  return {
19303
19107
  list({
19304
- instanceId
19108
+ bank_account_id,
19109
+ receiver_id
19305
19110
  }) {
19306
- return client.get(`/instances/${instanceId}/offramp_wallets`);
19111
+ return client.get(
19112
+ `/instances/${instanceId}/receivers/${receiver_id}/bank-accounts/${bank_account_id}/offramp-wallets`
19113
+ );
19307
19114
  },
19308
19115
  create(_a3) {
19309
19116
  var _b = _a3, {
19310
- receiverId,
19311
- instanceId,
19312
- bankAccountId
19117
+ receiver_id,
19118
+ bank_account_id
19313
19119
  } = _b, data = __objRest(_b, [
19314
- "receiverId",
19315
- "instanceId",
19316
- "bankAccountId"
19120
+ "receiver_id",
19121
+ "bank_account_id"
19317
19122
  ]);
19318
19123
  return client.post(
19319
- `/instances/${instanceId}/receivers/${receiverId}/bank-accounts/${bankAccountId}/offramp_wallets`,
19124
+ `/instances/${instanceId}/receivers/${receiver_id}/bank-accounts/${bank_account_id}/offramp-wallets`,
19320
19125
  data
19321
19126
  );
19322
19127
  },
19323
19128
  get({
19324
- receiverId,
19325
- instanceId,
19326
- bankAccountId,
19129
+ receiver_id,
19130
+ bank_account_id,
19327
19131
  id
19328
19132
  }) {
19329
19133
  return client.get(
19330
- `/instances/${instanceId}/receivers/${receiverId}/bank-accounts/${bankAccountId}/offramp_wallets/${id}`
19134
+ `/instances/${instanceId}/receivers/${receiver_id}/bank-accounts/${bank_account_id}/offramp-wallets/${id}`
19331
19135
  );
19332
19136
  }
19333
19137
  };
19334
19138
  }
19335
19139
 
19336
19140
  // src/resources/webhooks/index.ts
19337
- function createWebhookEndpointsResource(client) {
19141
+ function createWebhookEndpointsResource(instanceId, client) {
19338
19142
  return {
19339
- list({
19340
- instanceId
19341
- }) {
19143
+ list() {
19342
19144
  return client.get(`/instances/${instanceId}/webhook-endpoints`);
19343
19145
  },
19344
19146
  create(_a3) {
19345
- var _b = _a3, {
19346
- instanceId
19347
- } = _b, data = __objRest(_b, [
19348
- "instanceId"
19349
- ]);
19147
+ var data = __objRest(_a3, []);
19350
19148
  return client.post(`/instances/${instanceId}/webhook-endpoints`, data);
19351
19149
  },
19352
- delete({ instanceId, id }) {
19150
+ delete(id) {
19353
19151
  return client.delete(`/instances/${instanceId}/webhook-endpoints/${id}`);
19354
19152
  },
19355
- getSecret({
19356
- instanceId,
19357
- id
19358
- }) {
19153
+ getSecret(id) {
19359
19154
  return client.get(`/instances/${instanceId}/webhook-endpoints/${id}/secret`);
19360
19155
  },
19361
- getPortalAccessUrl({
19362
- instanceId
19363
- }) {
19156
+ getPortalAccessUrl() {
19364
19157
  return client.get(`/instances/${instanceId}/webhook-endpoints/portal-access`);
19365
19158
  }
19366
19159
  };
19367
19160
  }
19368
19161
 
19369
19162
  // src/client.ts
19370
- var Blindpay = class {
19371
- constructor(apiKey) {
19163
+ var BlindPay = class {
19164
+ constructor({
19165
+ apiKey,
19166
+ instanceId
19167
+ }) {
19372
19168
  // Options
19373
19169
  this.baseUrl = "https://api.blindpay.com/v1";
19374
19170
  if (!apiKey) {
19375
- throw new BlindpayError("Api key not provided, get your api key on blindpay dashboard");
19171
+ throw new BlindPayError("Api key not provided, get your api key on blindpay dashboard");
19172
+ }
19173
+ if (!instanceId) {
19174
+ throw new BlindPayError(
19175
+ "Instance id not provided, get your instance id on blindpay dashboard"
19176
+ );
19376
19177
  }
19377
19178
  this.apiKey = apiKey;
19179
+ this.instanceId = instanceId;
19378
19180
  this.headers = {
19379
19181
  "Content-Type": "application/json",
19380
19182
  Accept: "application/json",
@@ -19389,23 +19191,23 @@ var Blindpay = class {
19389
19191
  delete: this.delete.bind(this)
19390
19192
  };
19391
19193
  this.available = createAvailableResource(this.api);
19392
- this.instances = __spreadProps(__spreadValues({}, createInstancesResource(this.api)), {
19393
- apiKeys: createApiKeysResource(this.api),
19394
- webhookEndpoints: createWebhookEndpointsResource(this.api)
19194
+ this.instances = __spreadProps(__spreadValues({}, createInstancesResource(this.instanceId, this.api)), {
19195
+ apiKeys: createApiKeysResource(this.instanceId, this.api),
19196
+ webhookEndpoints: createWebhookEndpointsResource(this.instanceId, this.api)
19395
19197
  });
19396
- this.partnerFees = createPartnerFeesResource(this.api);
19397
- this.payins = __spreadProps(__spreadValues({}, createPayinsResource(this.api)), {
19398
- quotes: createPayinQuotesResource(this.api)
19198
+ this.partnerFees = createPartnerFeesResource(this.instanceId, this.api);
19199
+ this.payins = __spreadProps(__spreadValues({}, createPayinsResource(this.instanceId, this.api)), {
19200
+ quotes: createPayinQuotesResource(this.instanceId, this.api)
19399
19201
  });
19400
- this.quotes = createQuotesResource(this.api);
19401
- this.payouts = createPayoutsResource(this.api);
19402
- this.receivers = __spreadProps(__spreadValues({}, createReceiversResource(this.api)), {
19403
- bankAccounts: createBankAccountsResource(this.api)
19202
+ this.quotes = createQuotesResource(this.instanceId, this.api);
19203
+ this.payouts = createPayoutsResource(this.instanceId, this.api);
19204
+ this.receivers = __spreadProps(__spreadValues({}, createReceiversResource(this.instanceId, this.api)), {
19205
+ bankAccounts: createBankAccountsResource(this.instanceId, this.api)
19404
19206
  });
19405
- this.virtualAccounts = createVirtualAccountsResource(this.api);
19207
+ this.virtualAccounts = createVirtualAccountsResource(this.instanceId, this.api);
19406
19208
  this.wallets = {
19407
- blockchain: createBlockchainWalletsResource(this.api),
19408
- offramp: createOfframpWalletsResource(this.api)
19209
+ blockchain: createBlockchainWalletsResource(this.instanceId, this.api),
19210
+ offramp: createOfframpWalletsResource(this.instanceId, this.api)
19409
19211
  };
19410
19212
  }
19411
19213
  request(method, path, body) {
@@ -19502,7 +19304,7 @@ var Blindpay = class {
19502
19304
  // src/resources/webhooks/webhooks.test.ts
19503
19305
  describe("Webhooks", () => {
19504
19306
  afterEach(() => fetchMock.resetMocks());
19505
- const blindpay = new Blindpay("test-key");
19307
+ const blindpay = new BlindPay({ apiKey: "test-key", instanceId: "in_000000000000" });
19506
19308
  describe("Create webhook endpoint", () => {
19507
19309
  it("should create a webhook endpoint", () => __async(null, null, function* () {
19508
19310
  const mockedWebhookEndpoint = {
@@ -19512,7 +19314,6 @@ describe("Webhooks", () => {
19512
19314
  headers: { "Content-Type": "application/json" }
19513
19315
  });
19514
19316
  const { data, error } = yield blindpay.instances.webhookEndpoints.create({
19515
- instanceId: "in_000000000000",
19516
19317
  url: "https://example.com/webhook",
19517
19318
  events: ["receiver.new"]
19518
19319
  });
@@ -19536,9 +19337,7 @@ describe("Webhooks", () => {
19536
19337
  fetchMock.mockResponseOnce(JSON.stringify(mockedWebhookEndpoints), {
19537
19338
  headers: { "Content-Type": "application/json" }
19538
19339
  });
19539
- const { data, error } = yield blindpay.instances.webhookEndpoints.list({
19540
- instanceId: "in_000000000000"
19541
- });
19340
+ const { data, error } = yield blindpay.instances.webhookEndpoints.list();
19542
19341
  globalExpect(error).toBeNull();
19543
19342
  globalExpect(data).toEqual(mockedWebhookEndpoints);
19544
19343
  }));
@@ -19549,10 +19348,7 @@ describe("Webhooks", () => {
19549
19348
  fetchMock.mockResponseOnce(JSON.stringify(mockedResponse), {
19550
19349
  headers: { "Content-Type": "application/json" }
19551
19350
  });
19552
- const { data, error } = yield blindpay.instances.webhookEndpoints.delete({
19553
- instanceId: "in_000000000000",
19554
- id: "we_000000000000"
19555
- });
19351
+ const { data, error } = yield blindpay.instances.webhookEndpoints.delete("we_000000000000");
19556
19352
  globalExpect(error).toBeNull();
19557
19353
  globalExpect(data).toEqual(mockedResponse);
19558
19354
  }));
@@ -19563,10 +19359,7 @@ describe("Webhooks", () => {
19563
19359
  fetchMock.mockResponseOnce(JSON.stringify(mockedWebhookSecret), {
19564
19360
  headers: { "Content-Type": "application/json" }
19565
19361
  });
19566
- const { data, error } = yield blindpay.instances.webhookEndpoints.getSecret({
19567
- instanceId: "in_000000000000",
19568
- id: "we_000000000000"
19569
- });
19362
+ const { data, error } = yield blindpay.instances.webhookEndpoints.getSecret("we_000000000000");
19570
19363
  globalExpect(error).toBeNull();
19571
19364
  globalExpect(data).toEqual(mockedWebhookSecret);
19572
19365
  }));
@@ -19577,9 +19370,7 @@ describe("Webhooks", () => {
19577
19370
  fetchMock.mockResponseOnce(JSON.stringify(mockedWebhookUrl), {
19578
19371
  headers: { "Content-Type": "application/json" }
19579
19372
  });
19580
- const { data, error } = yield blindpay.instances.webhookEndpoints.getPortalAccessUrl({
19581
- instanceId: "in_000000000000"
19582
- });
19373
+ const { data, error } = yield blindpay.instances.webhookEndpoints.getPortalAccessUrl();
19583
19374
  globalExpect(error).toBeNull();
19584
19375
  globalExpect(data).toEqual(mockedWebhookUrl);
19585
19376
  }));