@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
@@ -18709,10 +18709,10 @@ var import_expect_type = __toESM(require_dist(), 1);
18709
18709
  var import_node_crypto = require("crypto");
18710
18710
 
18711
18711
  // package.json
18712
- var version = "1.0.0";
18712
+ var version = "1.1.1";
18713
18713
 
18714
18714
  // src/internal/blindpay-error.ts
18715
- var BlindpayError = class extends Error {
18715
+ var BlindPayError = class extends Error {
18716
18716
  constructor(message) {
18717
18717
  super(message);
18718
18718
  this.name = "BlindpayError";
@@ -18720,23 +18720,19 @@ var BlindpayError = class extends Error {
18720
18720
  };
18721
18721
 
18722
18722
  // src/resources/api-keys/index.ts
18723
- function createApiKeysResource(client) {
18723
+ function createApiKeysResource(instanceId, client) {
18724
18724
  return {
18725
- list({ instanceId }) {
18725
+ list() {
18726
18726
  return client.get(`/instances/${instanceId}/api-keys`);
18727
18727
  },
18728
18728
  create(_a3) {
18729
- var _b = _a3, {
18730
- instanceId
18731
- } = _b, data = __objRest(_b, [
18732
- "instanceId"
18733
- ]);
18729
+ var data = __objRest(_a3, []);
18734
18730
  return client.post(`/instances/${instanceId}/api-keys`, data);
18735
18731
  },
18736
- get({ instanceId, id }) {
18737
- return client.get(`/instances/${instanceId}/api_keys/${id}`);
18732
+ get(id) {
18733
+ return client.get(`/instances/${instanceId}/api-keys/${id}`);
18738
18734
  },
18739
- delete({ instanceId, id }) {
18735
+ delete(id) {
18740
18736
  return client.delete(`/instances/${instanceId}/api-keys/${id}`);
18741
18737
  }
18742
18738
  };
@@ -18755,621 +18751,427 @@ function createAvailableResource(client) {
18755
18751
  }
18756
18752
 
18757
18753
  // src/resources/bank-accounts/index.ts
18758
- function createBankAccountsResource(client) {
18754
+ function createBankAccountsResource(instanceId, client) {
18759
18755
  return {
18760
- list({
18761
- instanceId,
18762
- receiverId
18763
- }) {
18764
- return client.get(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`);
18756
+ list(receiver_id) {
18757
+ return client.get(`/instances/${instanceId}/receivers/${receiver_id}/bank-accounts`);
18765
18758
  },
18766
- createPix({
18767
- instanceId,
18768
- receiverId,
18769
- name,
18770
- pix_key
18759
+ get({
18760
+ receiver_id,
18761
+ id
18771
18762
  }) {
18772
- return client.post(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`, {
18773
- type: "pix",
18774
- name,
18775
- pix_key
18776
- });
18763
+ return client.get(
18764
+ `/instances/${instanceId}/receivers/${receiver_id}/bank-accounts/${id}`
18765
+ );
18777
18766
  },
18778
- createArgentinaTransfers({
18779
- instanceId,
18780
- receiverId,
18781
- beneficiary_name,
18782
- name,
18783
- transfers_account,
18784
- transfers_type
18785
- }) {
18786
- return client.post(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`, {
18787
- type: "transfers_bitso",
18788
- beneficiary_name,
18789
- name,
18790
- transfers_account,
18791
- transfers_type
18792
- });
18767
+ delete({ receiver_id, id }) {
18768
+ return client.delete(
18769
+ `/instances/${instanceId}/receivers/${receiver_id}/bank-accounts/${id}`
18770
+ );
18793
18771
  },
18794
- createSpei({
18795
- instanceId,
18796
- receiverId,
18797
- beneficiary_name,
18798
- name,
18799
- spei_clabe,
18800
- spei_institution_code,
18801
- spei_protocol
18802
- }) {
18803
- return client.post(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`, {
18804
- type: "spei_bitso",
18805
- beneficiary_name,
18806
- name,
18807
- spei_clabe,
18808
- spei_institution_code,
18809
- spei_protocol
18810
- });
18772
+ createPix(_a3) {
18773
+ var _b = _a3, {
18774
+ receiver_id
18775
+ } = _b, data = __objRest(_b, [
18776
+ "receiver_id"
18777
+ ]);
18778
+ return client.post(`/instances/${instanceId}/receivers/${receiver_id}/bank-accounts`, __spreadValues({
18779
+ type: "pix"
18780
+ }, data));
18811
18781
  },
18812
- createColombiaAch({
18813
- instanceId,
18814
- receiverId,
18815
- name,
18816
- account_type,
18817
- ach_cop_beneficiary_first_name,
18818
- ach_cop_beneficiary_last_name,
18819
- ach_cop_document_id,
18820
- ach_cop_document_type,
18821
- ach_cop_email,
18822
- ach_cop_bank_code,
18823
- ach_cop_bank_account
18824
- }) {
18825
- return client.post(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`, {
18826
- type: "ach_cop_bitso",
18827
- name,
18828
- account_type,
18829
- ach_cop_beneficiary_first_name,
18830
- ach_cop_beneficiary_last_name,
18831
- ach_cop_document_id,
18832
- ach_cop_document_type,
18833
- ach_cop_email,
18834
- ach_cop_bank_code,
18835
- ach_cop_bank_account
18836
- });
18782
+ createArgentinaTransfers(_c) {
18783
+ var _d = _c, {
18784
+ receiver_id
18785
+ } = _d, data = __objRest(_d, [
18786
+ "receiver_id"
18787
+ ]);
18788
+ return client.post(`/instances/${instanceId}/receivers/${receiver_id}/bank-accounts`, __spreadValues({
18789
+ type: "transfers_bitso"
18790
+ }, data));
18837
18791
  },
18838
- createAch({
18839
- instanceId,
18840
- receiverId,
18841
- name,
18842
- account_class,
18843
- account_number,
18844
- account_type,
18845
- beneficiary_name,
18846
- routing_number
18847
- }) {
18848
- return client.post(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`, {
18849
- type: "ach",
18850
- name,
18851
- account_class,
18852
- account_number,
18853
- account_type,
18854
- beneficiary_name,
18855
- routing_number
18856
- });
18792
+ createSpei(_e) {
18793
+ var _f = _e, {
18794
+ receiver_id
18795
+ } = _f, data = __objRest(_f, [
18796
+ "receiver_id"
18797
+ ]);
18798
+ return client.post(`/instances/${instanceId}/receivers/${receiver_id}/bank-accounts`, __spreadValues({
18799
+ type: "spei_bitso"
18800
+ }, data));
18857
18801
  },
18858
- createWire({
18859
- instanceId,
18860
- receiverId,
18861
- name,
18862
- account_number,
18863
- beneficiary_name,
18864
- routing_number,
18865
- address_line_1,
18866
- address_line_2,
18867
- city,
18868
- state_province_region,
18869
- country,
18870
- postal_code
18871
- }) {
18872
- return client.post(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`, {
18873
- type: "wire",
18874
- name,
18875
- account_number,
18876
- beneficiary_name,
18877
- routing_number,
18878
- address_line_1,
18879
- address_line_2,
18880
- city,
18881
- state_province_region,
18882
- country,
18883
- postal_code
18884
- });
18802
+ createColombiaAch(_g) {
18803
+ var _h = _g, {
18804
+ receiver_id
18805
+ } = _h, data = __objRest(_h, [
18806
+ "receiver_id"
18807
+ ]);
18808
+ return client.post(`/instances/${instanceId}/receivers/${receiver_id}/bank-accounts`, __spreadValues({
18809
+ type: "ach_cop_bitso"
18810
+ }, data));
18885
18811
  },
18886
- createInternationalSwift({
18887
- instanceId,
18888
- receiverId,
18889
- name,
18890
- swift_account_holder_name,
18891
- swift_account_number_iban,
18892
- swift_bank_address_line_1,
18893
- swift_bank_address_line_2,
18894
- swift_bank_city,
18895
- swift_bank_country,
18896
- swift_bank_name,
18897
- swift_bank_postal_code,
18898
- swift_bank_state_province_region,
18899
- swift_beneficiary_address_line_1,
18900
- swift_beneficiary_address_line_2,
18901
- swift_beneficiary_city,
18902
- swift_beneficiary_country,
18903
- swift_beneficiary_postal_code,
18904
- swift_beneficiary_state_province_region,
18905
- swift_code_bic,
18906
- swift_intermediary_bank_account_number_iban,
18907
- swift_intermediary_bank_country,
18908
- swift_intermediary_bank_name,
18909
- swift_intermediary_bank_swift_code_bic
18910
- }) {
18911
- return client.post(`/instances/${instanceId}/receivers/${receiverId}/bank-accounts`, {
18912
- type: "international_swift",
18913
- name,
18914
- swift_account_holder_name,
18915
- swift_account_number_iban,
18916
- swift_bank_address_line_1,
18917
- swift_bank_address_line_2,
18918
- swift_bank_city,
18919
- swift_bank_country,
18920
- swift_bank_name,
18921
- swift_bank_postal_code,
18922
- swift_bank_state_province_region,
18923
- swift_beneficiary_address_line_1,
18924
- swift_beneficiary_address_line_2,
18925
- swift_beneficiary_city,
18926
- swift_beneficiary_country,
18927
- swift_beneficiary_postal_code,
18928
- swift_beneficiary_state_province_region,
18929
- swift_code_bic,
18930
- swift_intermediary_bank_account_number_iban,
18931
- swift_intermediary_bank_country,
18932
- swift_intermediary_bank_name,
18933
- swift_intermediary_bank_swift_code_bic
18934
- });
18812
+ createAch(_i) {
18813
+ var _j = _i, {
18814
+ receiver_id
18815
+ } = _j, data = __objRest(_j, [
18816
+ "receiver_id"
18817
+ ]);
18818
+ return client.post(`/instances/${instanceId}/receivers/${receiver_id}/bank-accounts`, __spreadValues({
18819
+ type: "ach"
18820
+ }, data));
18935
18821
  },
18936
- get({
18937
- instanceId,
18938
- receiverId,
18939
- id
18940
- }) {
18941
- return client.get(
18942
- `/instances/${instanceId}/receivers/${receiverId}/bank-accounts/${id}`
18943
- );
18822
+ createWire(_k) {
18823
+ var _l = _k, {
18824
+ receiver_id
18825
+ } = _l, data = __objRest(_l, [
18826
+ "receiver_id"
18827
+ ]);
18828
+ return client.post(`/instances/${instanceId}/receivers/${receiver_id}/bank-accounts`, __spreadValues({
18829
+ type: "wire"
18830
+ }, data));
18944
18831
  },
18945
- delete({
18946
- instanceId,
18947
- receiverId,
18948
- id
18949
- }) {
18950
- return client.delete(
18951
- `/instances/${instanceId}/receivers/${receiverId}/bank-accounts/${id}`
18952
- );
18832
+ createInternationalSwift(_m) {
18833
+ var _n = _m, {
18834
+ receiver_id
18835
+ } = _n, data = __objRest(_n, [
18836
+ "receiver_id"
18837
+ ]);
18838
+ return client.post(`/instances/${instanceId}/receivers/${receiver_id}/bank-accounts`, __spreadValues({
18839
+ type: "international_swift"
18840
+ }, data));
18953
18841
  }
18954
18842
  };
18955
18843
  }
18956
18844
 
18957
18845
  // src/resources/instances/index.ts
18958
- function createInstancesResource(client) {
18846
+ function createInstancesResource(instanceId, client) {
18959
18847
  return {
18960
- getMembers({
18961
- instanceId
18962
- }) {
18848
+ getMembers() {
18963
18849
  return client.get(`/instances/${instanceId}/members`);
18964
18850
  },
18965
18851
  update(_a3) {
18966
- var _b = _a3, { instanceId } = _b, data = __objRest(_b, ["instanceId"]);
18852
+ var data = __objRest(_a3, []);
18967
18853
  return client.put(`/instances/${instanceId}`, data);
18968
18854
  },
18969
- delete({ instanceId }) {
18855
+ delete() {
18970
18856
  return client.delete(`/instances/${instanceId}`);
18971
18857
  },
18972
- deleteMember({
18973
- instanceId,
18974
- id
18975
- }) {
18976
- return client.delete(`/instances/${instanceId}/members/${id}`);
18858
+ deleteMember(memberId) {
18859
+ return client.delete(`/instances/${instanceId}/members/${memberId}`);
18977
18860
  },
18978
- updateMemberRole(_c) {
18979
- var _d = _c, {
18980
- instanceId,
18981
- id
18982
- } = _d, data = __objRest(_d, [
18983
- "instanceId",
18984
- "id"
18985
- ]);
18986
- return client.put(`/instances/${instanceId}/members/${id}`, data);
18861
+ updateMemberRole({
18862
+ memberId,
18863
+ role
18864
+ }) {
18865
+ return client.put(`/instances/${instanceId}/members/${memberId}`, { role });
18987
18866
  }
18988
18867
  };
18989
18868
  }
18990
18869
 
18991
18870
  // src/resources/partner-fees/index.ts
18992
- function createPartnerFeesResource(client) {
18871
+ function createPartnerFeesResource(instanceId, client) {
18993
18872
  return {
18994
- list({
18995
- instanceId
18996
- }) {
18873
+ list() {
18997
18874
  return client.get(`/instances/${instanceId}/partner-fees`);
18998
18875
  },
18999
18876
  create(_a3) {
19000
- var _b = _a3, {
19001
- instanceId
19002
- } = _b, data = __objRest(_b, [
19003
- "instanceId"
19004
- ]);
18877
+ var data = __objRest(_a3, []);
19005
18878
  return client.post(`/instances/${instanceId}/partner-fees`, data);
19006
18879
  },
19007
- get({
19008
- instanceId,
19009
- id
19010
- }) {
18880
+ get(id) {
19011
18881
  return client.get(`/instances/${instanceId}/partner-fees/${id}`);
19012
18882
  },
19013
- delete({ instanceId, id }) {
18883
+ delete(id) {
19014
18884
  return client.delete(`/instances/${instanceId}/partner-fees/${id}`);
19015
18885
  }
19016
18886
  };
19017
18887
  }
19018
18888
 
19019
18889
  // src/resources/payins/index.ts
19020
- function createPayinsResource(client) {
18890
+ function createPayinsResource(instanceId, client) {
19021
18891
  return {
19022
- list({
19023
- instanceId,
19024
- params
19025
- }) {
18892
+ list(params) {
19026
18893
  const queryParams = params ? `?${new URLSearchParams(params)}` : "";
19027
18894
  return client.get(`/instances/${instanceId}/payins${queryParams}`);
19028
18895
  },
19029
- get({ instanceId, id }) {
19030
- return client.get(`/instances/${instanceId}/payins/${id}`);
18896
+ get(payinId) {
18897
+ return client.get(`/instances/${instanceId}/payins/${payinId}`);
19031
18898
  },
19032
- getTrack({ id }) {
19033
- return client.get(`/e/payins/${id}`);
18899
+ getTrack(payinId) {
18900
+ return client.get(`/e/payins/${payinId}`);
19034
18901
  },
19035
- export({
19036
- instanceId,
19037
- params
19038
- }) {
18902
+ export(_a3) {
18903
+ var params = __objRest(_a3, []);
19039
18904
  const queryParams = params ? `?${new URLSearchParams(params)}` : "";
19040
18905
  return client.get(`/instances/${instanceId}/export/payins${queryParams}`);
19041
18906
  },
19042
- createEvm(_a3) {
19043
- var _b = _a3, {
19044
- instanceId
19045
- } = _b, data = __objRest(_b, [
19046
- "instanceId"
19047
- ]);
19048
- return client.post(`/instances/${instanceId}/payins/evm`, data);
18907
+ createEvm(payin_quote_id) {
18908
+ return client.post(`/instances/${instanceId}/payins/evm`, {
18909
+ payin_quote_id
18910
+ });
19049
18911
  }
19050
18912
  };
19051
18913
  }
19052
18914
 
19053
18915
  // src/resources/payins/quotes.ts
19054
- function createPayinQuotesResource(client) {
18916
+ function createPayinQuotesResource(instanceId, client) {
19055
18917
  return {
19056
18918
  create(_a3) {
19057
- var _b = _a3, {
19058
- instanceId
19059
- } = _b, data = __objRest(_b, [
19060
- "instanceId"
19061
- ]);
18919
+ var data = __objRest(_a3, []);
19062
18920
  return client.post(`/instances/${instanceId}/payin-quotes`, data);
19063
18921
  },
19064
- getFxRate(_c) {
19065
- var _d = _c, {
19066
- instanceId
19067
- } = _d, data = __objRest(_d, [
19068
- "instanceId"
19069
- ]);
18922
+ getFxRate(_b) {
18923
+ var data = __objRest(_b, []);
19070
18924
  return client.post(`/instances/${instanceId}/payin-quotes/fx`, data);
19071
18925
  }
19072
18926
  };
19073
18927
  }
19074
18928
 
19075
18929
  // src/resources/payouts/index.ts
19076
- function createPayoutsResource(client) {
18930
+ function createPayoutsResource(instanceId, client) {
19077
18931
  return {
19078
- list({
19079
- instanceId,
19080
- params
19081
- }) {
18932
+ list(params) {
19082
18933
  const queryParams = params ? `?${new URLSearchParams(params)}` : "";
19083
18934
  return client.get(`/instances/${instanceId}/payouts${queryParams}`);
19084
18935
  },
19085
- export({
19086
- instanceId,
19087
- params
19088
- }) {
18936
+ export(params) {
19089
18937
  const queryParams = params ? `?${new URLSearchParams(params)}` : "";
19090
18938
  return client.get(`/instances/${instanceId}/export/payouts${queryParams}`);
19091
18939
  },
19092
- get({ instanceId, id }) {
19093
- return client.get(`/instances/${instanceId}/payouts/${id}`);
18940
+ get(payoutId) {
18941
+ return client.get(`/instances/${instanceId}/payouts/${payoutId}`);
19094
18942
  },
19095
- getTrack({
19096
- id
19097
- }) {
19098
- return client.get(`/e/payouts/${id}`);
18943
+ getTrack(payoutId) {
18944
+ return client.get(`/e/payouts/${payoutId}`);
19099
18945
  },
19100
18946
  authorizeStellarToken(_a3) {
19101
- var _b = _a3, {
19102
- instanceId
19103
- } = _b, data = __objRest(_b, [
19104
- "instanceId"
19105
- ]);
18947
+ var data = __objRest(_a3, []);
19106
18948
  return client.post(`/instances/${instanceId}/payouts/stellar/authorize`, data);
19107
18949
  },
19108
- createStellar(_c) {
19109
- var _d = _c, {
19110
- instanceId
19111
- } = _d, data = __objRest(_d, [
19112
- "instanceId"
19113
- ]);
18950
+ createStellar(_b) {
18951
+ var data = __objRest(_b, []);
19114
18952
  return client.post(`/instances/${instanceId}/payouts/stellar`, data);
19115
18953
  },
19116
- createEvm(_e) {
19117
- var _f = _e, {
19118
- instanceId
19119
- } = _f, data = __objRest(_f, [
19120
- "instanceId"
19121
- ]);
18954
+ createEvm(_c) {
18955
+ var data = __objRest(_c, []);
19122
18956
  return client.post(`/instances/${instanceId}/payouts/evm`, data);
19123
18957
  }
19124
18958
  };
19125
18959
  }
19126
18960
 
19127
18961
  // src/resources/quotes/index.ts
19128
- function createQuotesResource(client) {
18962
+ function createQuotesResource(instanceId, client) {
19129
18963
  return {
19130
18964
  create(_a3) {
19131
- var _b = _a3, {
19132
- instanceId
19133
- } = _b, data = __objRest(_b, [
19134
- "instanceId"
19135
- ]);
18965
+ var data = __objRest(_a3, []);
19136
18966
  return client.post(`/instances/${instanceId}/quotes`, data);
19137
18967
  },
19138
- getFxRate(_c) {
19139
- var _d = _c, {
19140
- instanceId
19141
- } = _d, data = __objRest(_d, [
19142
- "instanceId"
19143
- ]);
18968
+ getFxRate(_b) {
18969
+ var data = __objRest(_b, []);
19144
18970
  return client.post(`/instances/${instanceId}/quotes/fx`, data);
19145
18971
  }
19146
18972
  };
19147
18973
  }
19148
18974
 
19149
18975
  // src/resources/receivers/index.ts
19150
- function createReceiversResource(client) {
18976
+ function createReceiversResource(instanceId, client) {
19151
18977
  return {
19152
- list({
19153
- instanceId
19154
- }) {
18978
+ list() {
19155
18979
  return client.get(`/instances/${instanceId}/receivers`);
19156
18980
  },
19157
18981
  create(_a3) {
19158
- var _b = _a3, {
19159
- instanceId
19160
- } = _b, data = __objRest(_b, [
19161
- "instanceId"
19162
- ]);
18982
+ var data = __objRest(_a3, []);
19163
18983
  return client.post(`/instances/${instanceId}/receivers`, data);
19164
18984
  },
19165
- get({
19166
- instanceId,
19167
- id
19168
- }) {
19169
- return client.get(`/instances/${instanceId}/receivers/${id}`);
18985
+ get(receiver_id) {
18986
+ return client.get(`/instances/${instanceId}/receivers/${receiver_id}`);
19170
18987
  },
19171
- update(_c) {
19172
- var _d = _c, {
19173
- instanceId,
19174
- id
19175
- } = _d, data = __objRest(_d, [
19176
- "instanceId",
19177
- "id"
19178
- ]);
19179
- return client.patch(`/instances/${instanceId}/receivers/${id}`, data);
18988
+ update(_b) {
18989
+ var _c = _b, { receiver_id } = _c, data = __objRest(_c, ["receiver_id"]);
18990
+ return client.patch(`/instances/${instanceId}/receivers/${receiver_id}`, data);
19180
18991
  },
19181
- delete({ instanceId, id }) {
19182
- return client.delete(`/instances/${instanceId}/receivers/${id}`);
18992
+ delete(receiver_id) {
18993
+ return client.delete(`/instances/${instanceId}/receivers/${receiver_id}`);
19183
18994
  },
19184
- getLimits({
19185
- instanceId,
19186
- id
19187
- }) {
19188
- return client.get(`/instances/${instanceId}/limits/receivers/${id}`);
18995
+ getLimits(receiver_id) {
18996
+ return client.get(`/instances/${instanceId}/limits/receivers/${receiver_id}`);
19189
18997
  }
19190
18998
  };
19191
18999
  }
19192
19000
 
19193
19001
  // src/resources/virtual-accounts/index.ts
19194
- function createVirtualAccountsResource(client) {
19002
+ function createVirtualAccountsResource(instanceId, client) {
19195
19003
  return {
19196
19004
  update(_a3) {
19197
19005
  var _b = _a3, {
19198
- instanceId,
19199
- receiverId
19006
+ receiver_id
19200
19007
  } = _b, data = __objRest(_b, [
19201
- "instanceId",
19202
- "receiverId"
19008
+ "receiver_id"
19203
19009
  ]);
19204
19010
  return client.put(
19205
- `/instances/${instanceId}/receivers/${receiverId}/virtual-accounts`,
19011
+ `/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`,
19206
19012
  data
19207
19013
  );
19208
19014
  },
19209
19015
  create(_c) {
19210
19016
  var _d = _c, {
19211
- instanceId,
19212
- receiverId
19017
+ receiver_id
19213
19018
  } = _d, data = __objRest(_d, [
19214
- "instanceId",
19215
- "receiverId"
19019
+ "receiver_id"
19216
19020
  ]);
19217
19021
  return client.post(
19218
- `/instances/${instanceId}/receivers/${receiverId}/virtual-accounts`,
19022
+ `/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`,
19219
19023
  data
19220
19024
  );
19221
19025
  },
19222
- get({
19223
- instanceId,
19224
- receiverId
19225
- }) {
19226
- return client.get(`/instances/${instanceId}/receivers/${receiverId}/virtual-accounts`);
19026
+ get(receiver_id) {
19027
+ return client.get(`/instances/${instanceId}/receivers/${receiver_id}/virtual-accounts`);
19227
19028
  }
19228
19029
  };
19229
19030
  }
19230
19031
 
19231
19032
  // src/resources/wallets/blockchain.ts
19232
- function createBlockchainWalletsResource(client) {
19033
+ function createBlockchainWalletsResource(instanceId, client) {
19233
19034
  return {
19234
- list({
19235
- instanceId,
19236
- receiverId
19237
- }) {
19035
+ list(receiver_id) {
19238
19036
  return client.get(
19239
- `/instances/${instanceId}/receivers/${receiverId}/blockchain-wallets`
19037
+ `/instances/${instanceId}/receivers/${receiver_id}/blockchain-wallets`
19240
19038
  );
19241
19039
  },
19242
- create(_a3) {
19040
+ createWithAddress(_a3) {
19243
19041
  var _b = _a3, {
19244
- instanceId
19042
+ receiver_id
19245
19043
  } = _b, data = __objRest(_b, [
19246
- "instanceId"
19044
+ "receiver_id"
19247
19045
  ]);
19248
- return client.post(`/instances/${instanceId}/blockchain-wallets`, data);
19046
+ return client.post(
19047
+ `/instances/${instanceId}/receivers/${receiver_id}/blockchain-wallets`,
19048
+ __spreadProps(__spreadValues({}, data), {
19049
+ is_account_abstraction: true
19050
+ })
19051
+ );
19249
19052
  },
19250
- getWalletMessage({
19251
- receiverId,
19252
- instanceId
19253
- }) {
19053
+ createWithHash(_c) {
19054
+ var _d = _c, {
19055
+ receiver_id
19056
+ } = _d, data = __objRest(_d, [
19057
+ "receiver_id"
19058
+ ]);
19059
+ return client.post(
19060
+ `/instances/${instanceId}/receivers/${receiver_id}/blockchain-wallets`,
19061
+ __spreadProps(__spreadValues({}, data), {
19062
+ is_account_abstraction: false
19063
+ })
19064
+ );
19065
+ },
19066
+ getWalletMessage(receiver_id) {
19254
19067
  return client.get(
19255
- `/instances/${instanceId}/receivers/${receiverId}/blockchain-wallets/sign-message`
19068
+ `/instances/${instanceId}/receivers/${receiver_id}/blockchain-wallets/sign-message`
19256
19069
  );
19257
19070
  },
19258
19071
  get({
19259
- instanceId,
19260
- receiverId,
19072
+ receiver_id,
19261
19073
  id
19262
19074
  }) {
19263
19075
  return client.get(
19264
- `/instances/${instanceId}/receivers/${receiverId}/blockchain-wallets/${id}`
19076
+ `/instances/${instanceId}/receivers/${receiver_id}/blockchain-wallets/${id}`
19265
19077
  );
19266
19078
  },
19267
19079
  delete({
19268
- instanceId,
19269
- receiverId,
19080
+ receiver_id,
19270
19081
  id
19271
19082
  }) {
19272
19083
  return client.delete(
19273
- `/instances/${instanceId}/receivers/${receiverId}/blockchain-wallets/${id}`
19084
+ `/instances/${instanceId}/receivers/${receiver_id}/blockchain-wallets/${id}`
19274
19085
  );
19275
19086
  },
19276
- createAssetTrustline(_c) {
19277
- var _d = _c, {
19278
- instanceId
19279
- } = _d, data = __objRest(_d, [
19280
- "instanceId"
19281
- ]);
19282
- return client.post(`/instances/${instanceId}/create-asset-trustline`, data);
19087
+ createAssetTrustline(address) {
19088
+ return client.post(`/instances/${instanceId}/create-asset-trustline`, {
19089
+ address
19090
+ });
19283
19091
  },
19284
19092
  mintUsdbStellar(_e) {
19285
- var _f = _e, {
19286
- instanceId
19287
- } = _f, data = __objRest(_f, [
19288
- "instanceId"
19289
- ]);
19093
+ var data = __objRest(_e, []);
19290
19094
  return client.post(`/instances/${instanceId}/mint-usdb-stellar`, data);
19291
19095
  }
19292
19096
  };
19293
19097
  }
19294
19098
 
19295
19099
  // src/resources/wallets/offramp.ts
19296
- function createOfframpWalletsResource(client) {
19100
+ function createOfframpWalletsResource(instanceId, client) {
19297
19101
  return {
19298
19102
  list({
19299
- instanceId
19103
+ bank_account_id,
19104
+ receiver_id
19300
19105
  }) {
19301
- return client.get(`/instances/${instanceId}/offramp_wallets`);
19106
+ return client.get(
19107
+ `/instances/${instanceId}/receivers/${receiver_id}/bank-accounts/${bank_account_id}/offramp-wallets`
19108
+ );
19302
19109
  },
19303
19110
  create(_a3) {
19304
19111
  var _b = _a3, {
19305
- receiverId,
19306
- instanceId,
19307
- bankAccountId
19112
+ receiver_id,
19113
+ bank_account_id
19308
19114
  } = _b, data = __objRest(_b, [
19309
- "receiverId",
19310
- "instanceId",
19311
- "bankAccountId"
19115
+ "receiver_id",
19116
+ "bank_account_id"
19312
19117
  ]);
19313
19118
  return client.post(
19314
- `/instances/${instanceId}/receivers/${receiverId}/bank-accounts/${bankAccountId}/offramp_wallets`,
19119
+ `/instances/${instanceId}/receivers/${receiver_id}/bank-accounts/${bank_account_id}/offramp-wallets`,
19315
19120
  data
19316
19121
  );
19317
19122
  },
19318
19123
  get({
19319
- receiverId,
19320
- instanceId,
19321
- bankAccountId,
19124
+ receiver_id,
19125
+ bank_account_id,
19322
19126
  id
19323
19127
  }) {
19324
19128
  return client.get(
19325
- `/instances/${instanceId}/receivers/${receiverId}/bank-accounts/${bankAccountId}/offramp_wallets/${id}`
19129
+ `/instances/${instanceId}/receivers/${receiver_id}/bank-accounts/${bank_account_id}/offramp-wallets/${id}`
19326
19130
  );
19327
19131
  }
19328
19132
  };
19329
19133
  }
19330
19134
 
19331
19135
  // src/resources/webhooks/index.ts
19332
- function createWebhookEndpointsResource(client) {
19136
+ function createWebhookEndpointsResource(instanceId, client) {
19333
19137
  return {
19334
- list({
19335
- instanceId
19336
- }) {
19138
+ list() {
19337
19139
  return client.get(`/instances/${instanceId}/webhook-endpoints`);
19338
19140
  },
19339
19141
  create(_a3) {
19340
- var _b = _a3, {
19341
- instanceId
19342
- } = _b, data = __objRest(_b, [
19343
- "instanceId"
19344
- ]);
19142
+ var data = __objRest(_a3, []);
19345
19143
  return client.post(`/instances/${instanceId}/webhook-endpoints`, data);
19346
19144
  },
19347
- delete({ instanceId, id }) {
19145
+ delete(id) {
19348
19146
  return client.delete(`/instances/${instanceId}/webhook-endpoints/${id}`);
19349
19147
  },
19350
- getSecret({
19351
- instanceId,
19352
- id
19353
- }) {
19148
+ getSecret(id) {
19354
19149
  return client.get(`/instances/${instanceId}/webhook-endpoints/${id}/secret`);
19355
19150
  },
19356
- getPortalAccessUrl({
19357
- instanceId
19358
- }) {
19151
+ getPortalAccessUrl() {
19359
19152
  return client.get(`/instances/${instanceId}/webhook-endpoints/portal-access`);
19360
19153
  }
19361
19154
  };
19362
19155
  }
19363
19156
 
19364
19157
  // src/client.ts
19365
- var Blindpay = class {
19366
- constructor(apiKey) {
19158
+ var BlindPay = class {
19159
+ constructor({
19160
+ apiKey,
19161
+ instanceId
19162
+ }) {
19367
19163
  // Options
19368
19164
  this.baseUrl = "https://api.blindpay.com/v1";
19369
19165
  if (!apiKey) {
19370
- throw new BlindpayError("Api key not provided, get your api key on blindpay dashboard");
19166
+ throw new BlindPayError("Api key not provided, get your api key on blindpay dashboard");
19167
+ }
19168
+ if (!instanceId) {
19169
+ throw new BlindPayError(
19170
+ "Instance id not provided, get your instance id on blindpay dashboard"
19171
+ );
19371
19172
  }
19372
19173
  this.apiKey = apiKey;
19174
+ this.instanceId = instanceId;
19373
19175
  this.headers = {
19374
19176
  "Content-Type": "application/json",
19375
19177
  Accept: "application/json",
@@ -19384,23 +19186,23 @@ var Blindpay = class {
19384
19186
  delete: this.delete.bind(this)
19385
19187
  };
19386
19188
  this.available = createAvailableResource(this.api);
19387
- this.instances = __spreadProps(__spreadValues({}, createInstancesResource(this.api)), {
19388
- apiKeys: createApiKeysResource(this.api),
19389
- webhookEndpoints: createWebhookEndpointsResource(this.api)
19189
+ this.instances = __spreadProps(__spreadValues({}, createInstancesResource(this.instanceId, this.api)), {
19190
+ apiKeys: createApiKeysResource(this.instanceId, this.api),
19191
+ webhookEndpoints: createWebhookEndpointsResource(this.instanceId, this.api)
19390
19192
  });
19391
- this.partnerFees = createPartnerFeesResource(this.api);
19392
- this.payins = __spreadProps(__spreadValues({}, createPayinsResource(this.api)), {
19393
- quotes: createPayinQuotesResource(this.api)
19193
+ this.partnerFees = createPartnerFeesResource(this.instanceId, this.api);
19194
+ this.payins = __spreadProps(__spreadValues({}, createPayinsResource(this.instanceId, this.api)), {
19195
+ quotes: createPayinQuotesResource(this.instanceId, this.api)
19394
19196
  });
19395
- this.quotes = createQuotesResource(this.api);
19396
- this.payouts = createPayoutsResource(this.api);
19397
- this.receivers = __spreadProps(__spreadValues({}, createReceiversResource(this.api)), {
19398
- bankAccounts: createBankAccountsResource(this.api)
19197
+ this.quotes = createQuotesResource(this.instanceId, this.api);
19198
+ this.payouts = createPayoutsResource(this.instanceId, this.api);
19199
+ this.receivers = __spreadProps(__spreadValues({}, createReceiversResource(this.instanceId, this.api)), {
19200
+ bankAccounts: createBankAccountsResource(this.instanceId, this.api)
19399
19201
  });
19400
- this.virtualAccounts = createVirtualAccountsResource(this.api);
19202
+ this.virtualAccounts = createVirtualAccountsResource(this.instanceId, this.api);
19401
19203
  this.wallets = {
19402
- blockchain: createBlockchainWalletsResource(this.api),
19403
- offramp: createOfframpWalletsResource(this.api)
19204
+ blockchain: createBlockchainWalletsResource(this.instanceId, this.api),
19205
+ offramp: createOfframpWalletsResource(this.instanceId, this.api)
19404
19206
  };
19405
19207
  }
19406
19208
  request(method, path, body) {
@@ -19497,7 +19299,7 @@ var Blindpay = class {
19497
19299
  // src/resources/api-keys/api-keys.test.ts
19498
19300
  describe("Api keys", () => {
19499
19301
  afterEach(() => fetchMock.resetMocks());
19500
- const blindpay = new Blindpay("test-key");
19302
+ const blindpay = new BlindPay({ apiKey: "test-key", instanceId: "in_000000000000" });
19501
19303
  describe("Create api key", () => {
19502
19304
  it("should create an api key", () => __async(null, null, function* () {
19503
19305
  const mockedApiKey = {
@@ -19508,7 +19310,6 @@ describe("Api keys", () => {
19508
19310
  headers: { "Content-Type": "application/json" }
19509
19311
  });
19510
19312
  const { data, error } = yield blindpay.instances.apiKeys.create({
19511
- instanceId: "in_000000000000",
19512
19313
  name: "test",
19513
19314
  permission: "full_access"
19514
19315
  });
@@ -19533,10 +19334,7 @@ describe("Api keys", () => {
19533
19334
  fetchMock.mockResponseOnce(JSON.stringify(mockedApiKey), {
19534
19335
  headers: { "Content-Type": "application/json" }
19535
19336
  });
19536
- const { data, error } = yield blindpay.instances.apiKeys.get({
19537
- instanceId: "in_000000000000",
19538
- id: "ap_000000000000"
19539
- });
19337
+ const { data, error } = yield blindpay.instances.apiKeys.get("ap_000000000000");
19540
19338
  globalExpect(error).toBeNull();
19541
19339
  globalExpect(data).toEqual(mockedApiKey);
19542
19340
  }));
@@ -19560,9 +19358,7 @@ describe("Api keys", () => {
19560
19358
  fetchMock.mockResponseOnce(JSON.stringify(mockedApiKeys), {
19561
19359
  headers: { "Content-Type": "application/json" }
19562
19360
  });
19563
- const { data, error } = yield blindpay.instances.apiKeys.list({
19564
- instanceId: "in_000000000000"
19565
- });
19361
+ const { data, error } = yield blindpay.instances.apiKeys.list();
19566
19362
  globalExpect(error).toBeNull();
19567
19363
  globalExpect(data).toEqual(mockedApiKeys);
19568
19364
  }));
@@ -19577,10 +19373,7 @@ describe("Api keys", () => {
19577
19373
  headers: { "Content-Type": "application/json" }
19578
19374
  }
19579
19375
  );
19580
- const { data, error } = yield blindpay.instances.apiKeys.delete({
19581
- instanceId: "in_000000000000",
19582
- id: "ap_000000000000"
19583
- });
19376
+ const { data, error } = yield blindpay.instances.apiKeys.delete("ap_000000000000");
19584
19377
  globalExpect(error).toBeNull();
19585
19378
  globalExpect(data).toEqual({
19586
19379
  data: null