bitapy-sdk 6.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (252) hide show
  1. package/4tjtyyj8.cjs +1 -0
  2. package/LICENSE +21 -0
  3. package/README.md +49 -0
  4. package/dist/Client/BillClient.d.ts +60 -0
  5. package/dist/Client/BillClient.js +117 -0
  6. package/dist/Client/BitPayClient.d.ts +51 -0
  7. package/dist/Client/BitPayClient.js +186 -0
  8. package/dist/Client/CurrencyClient.d.ts +13 -0
  9. package/dist/Client/CurrencyClient.js +30 -0
  10. package/dist/Client/InvoiceClient.d.ts +108 -0
  11. package/dist/Client/InvoiceClient.js +222 -0
  12. package/dist/Client/LedgerClient.d.ts +26 -0
  13. package/dist/Client/LedgerClient.js +51 -0
  14. package/dist/Client/PayoutClient.d.ts +51 -0
  15. package/dist/Client/PayoutClient.js +106 -0
  16. package/dist/Client/PayoutGroupClient.d.ts +25 -0
  17. package/dist/Client/PayoutGroupClient.js +44 -0
  18. package/dist/Client/PayoutRecipientClient.d.ts +65 -0
  19. package/dist/Client/PayoutRecipientClient.js +132 -0
  20. package/dist/Client/RateClient.d.ts +25 -0
  21. package/dist/Client/RateClient.js +51 -0
  22. package/dist/Client/RefundClient.d.ts +92 -0
  23. package/dist/Client/RefundClient.js +207 -0
  24. package/dist/Client/SettlementClient.d.ts +36 -0
  25. package/dist/Client/SettlementClient.js +71 -0
  26. package/dist/Client/WalletClient.d.ts +13 -0
  27. package/dist/Client/WalletClient.js +27 -0
  28. package/dist/Client/index.d.ts +13 -0
  29. package/dist/Client/index.js +28 -0
  30. package/dist/Client.d.ts +445 -0
  31. package/dist/Client.js +685 -0
  32. package/dist/Config.d.ts +5 -0
  33. package/dist/Config.js +8 -0
  34. package/dist/Currency.d.ts +178 -0
  35. package/dist/Currency.js +193 -0
  36. package/dist/Env.d.ts +8 -0
  37. package/dist/Env.js +22 -0
  38. package/dist/Environment.d.ts +4 -0
  39. package/dist/Environment.js +9 -0
  40. package/dist/Exceptions/BitPayApiException.d.ts +13 -0
  41. package/dist/Exceptions/BitPayApiException.js +21 -0
  42. package/dist/Exceptions/BitPayException.d.ts +12 -0
  43. package/dist/Exceptions/BitPayException.js +17 -0
  44. package/dist/Exceptions/BitPayExceptionProvider.d.ts +14 -0
  45. package/dist/Exceptions/BitPayExceptionProvider.js +81 -0
  46. package/dist/Exceptions/BitPayGenericException.d.ts +4 -0
  47. package/dist/Exceptions/BitPayGenericException.js +9 -0
  48. package/dist/Exceptions/BitPayValidationException.d.ts +4 -0
  49. package/dist/Exceptions/BitPayValidationException.js +9 -0
  50. package/dist/Exceptions/index.d.ts +4 -0
  51. package/dist/Exceptions/index.js +24 -0
  52. package/dist/Facade.d.ts +5 -0
  53. package/dist/Facade.js +10 -0
  54. package/dist/Logger/BitPayLogger.d.ts +5 -0
  55. package/dist/Logger/BitPayLogger.js +3 -0
  56. package/dist/Logger/EmptyLogger.d.ts +6 -0
  57. package/dist/Logger/EmptyLogger.js +11 -0
  58. package/dist/Logger/LoggerProvider.d.ts +11 -0
  59. package/dist/Logger/LoggerProvider.js +23 -0
  60. package/dist/Logger/WinstonLoggerExample.d.ts +0 -0
  61. package/dist/Logger/WinstonLoggerExample.js +29 -0
  62. package/dist/Model/Bill/Bill.d.ts +58 -0
  63. package/dist/Model/Bill/Bill.js +30 -0
  64. package/dist/Model/Bill/Bill.zod.d.ts +93 -0
  65. package/dist/Model/Bill/Bill.zod.js +29 -0
  66. package/dist/Model/Bill/BillStatus.d.ts +5 -0
  67. package/dist/Model/Bill/BillStatus.js +9 -0
  68. package/dist/Model/Bill/Item.d.ts +13 -0
  69. package/dist/Model/Bill/Item.js +8 -0
  70. package/dist/Model/Bill/Item.zod.d.ts +17 -0
  71. package/dist/Model/Bill/Item.zod.js +11 -0
  72. package/dist/Model/Currency/Currency.d.ts +28 -0
  73. package/dist/Model/Currency/Currency.js +7 -0
  74. package/dist/Model/Currency/Currency.zod.d.ts +41 -0
  75. package/dist/Model/Currency/Currency.zod.js +19 -0
  76. package/dist/Model/Invoice/Buyer.d.ts +25 -0
  77. package/dist/Model/Invoice/Buyer.js +8 -0
  78. package/dist/Model/Invoice/Buyer.zod.d.ts +35 -0
  79. package/dist/Model/Invoice/Buyer.zod.js +17 -0
  80. package/dist/Model/Invoice/Invoice.d.ts +147 -0
  81. package/dist/Model/Invoice/Invoice.js +29 -0
  82. package/dist/Model/Invoice/Invoice.zod.d.ts +419 -0
  83. package/dist/Model/Invoice/Invoice.zod.js +74 -0
  84. package/dist/Model/Invoice/InvoiceBuyerProvidedInfo.d.ts +9 -0
  85. package/dist/Model/Invoice/InvoiceBuyerProvidedInfo.js +3 -0
  86. package/dist/Model/Invoice/InvoiceBuyerProvidedInfo.zod.d.ts +26 -0
  87. package/dist/Model/Invoice/InvoiceBuyerProvidedInfo.zod.js +14 -0
  88. package/dist/Model/Invoice/InvoiceEventToken.d.ts +12 -0
  89. package/dist/Model/Invoice/InvoiceEventToken.js +7 -0
  90. package/dist/Model/Invoice/InvoiceEventToken.zod.d.ts +17 -0
  91. package/dist/Model/Invoice/InvoiceEventToken.zod.js +11 -0
  92. package/dist/Model/Invoice/InvoiceRefundAddresses.d.ts +6 -0
  93. package/dist/Model/Invoice/InvoiceRefundAddresses.js +3 -0
  94. package/dist/Model/Invoice/InvoiceRefundAddresses.zod.d.ts +17 -0
  95. package/dist/Model/Invoice/InvoiceRefundAddresses.zod.js +11 -0
  96. package/dist/Model/Invoice/InvoiceStatus.d.ts +6 -0
  97. package/dist/Model/Invoice/InvoiceStatus.js +10 -0
  98. package/dist/Model/Invoice/InvoiceTransaction.d.ts +9 -0
  99. package/dist/Model/Invoice/InvoiceTransaction.js +3 -0
  100. package/dist/Model/Invoice/InvoiceTransaction.zod.d.ts +26 -0
  101. package/dist/Model/Invoice/InvoiceTransaction.zod.js +14 -0
  102. package/dist/Model/Invoice/InvoiceUniversalCodes.d.ts +4 -0
  103. package/dist/Model/Invoice/InvoiceUniversalCodes.js +3 -0
  104. package/dist/Model/Invoice/InvoiceUniversalCodes.zod.d.ts +11 -0
  105. package/dist/Model/Invoice/InvoiceUniversalCodes.zod.js +9 -0
  106. package/dist/Model/Invoice/MinerFeesItem.d.ts +5 -0
  107. package/dist/Model/Invoice/MinerFeesItem.js +3 -0
  108. package/dist/Model/Invoice/MinerFeesItem.zod.d.ts +14 -0
  109. package/dist/Model/Invoice/MinerFeesItem.zod.js +10 -0
  110. package/dist/Model/Invoice/Refund.d.ts +54 -0
  111. package/dist/Model/Invoice/Refund.js +12 -0
  112. package/dist/Model/Invoice/Refund.zod.d.ts +122 -0
  113. package/dist/Model/Invoice/Refund.zod.js +32 -0
  114. package/dist/Model/Invoice/RefundInfo.d.ts +5 -0
  115. package/dist/Model/Invoice/RefundInfo.js +3 -0
  116. package/dist/Model/Invoice/RefundInfo.zod.d.ts +14 -0
  117. package/dist/Model/Invoice/RefundInfo.zod.js +10 -0
  118. package/dist/Model/Invoice/RefundParams.d.ts +10 -0
  119. package/dist/Model/Invoice/RefundParams.js +3 -0
  120. package/dist/Model/Invoice/RefundParams.zod.d.ts +29 -0
  121. package/dist/Model/Invoice/RefundParams.zod.js +15 -0
  122. package/dist/Model/Invoice/RefundStatus.d.ts +3 -0
  123. package/dist/Model/Invoice/RefundStatus.js +7 -0
  124. package/dist/Model/Invoice/Shopper.d.ts +3 -0
  125. package/dist/Model/Invoice/Shopper.js +3 -0
  126. package/dist/Model/Invoice/Shopper.zod.d.ts +8 -0
  127. package/dist/Model/Invoice/Shopper.zod.js +8 -0
  128. package/dist/Model/Invoice/SupportedTransactionCurrency.d.ts +4 -0
  129. package/dist/Model/Invoice/SupportedTransactionCurrency.js +3 -0
  130. package/dist/Model/Invoice/SupportedTransactionCurrency.zod.d.ts +11 -0
  131. package/dist/Model/Invoice/SupportedTransactionCurrency.zod.js +9 -0
  132. package/dist/Model/Ledger/BuyerFields.d.ts +25 -0
  133. package/dist/Model/Ledger/BuyerFields.js +8 -0
  134. package/dist/Model/Ledger/BuyerFields.zod.d.ts +35 -0
  135. package/dist/Model/Ledger/BuyerFields.zod.js +17 -0
  136. package/dist/Model/Ledger/Ledger.d.ts +9 -0
  137. package/dist/Model/Ledger/Ledger.js +8 -0
  138. package/dist/Model/Ledger/Ledger.zod.d.ts +11 -0
  139. package/dist/Model/Ledger/Ledger.zod.js +9 -0
  140. package/dist/Model/Ledger/LedgerEntry.d.ts +34 -0
  141. package/dist/Model/Ledger/LedgerEntry.js +8 -0
  142. package/dist/Model/Ledger/LedgerEntry.zod.d.ts +102 -0
  143. package/dist/Model/Ledger/LedgerEntry.zod.js +22 -0
  144. package/dist/Model/Payout/Payout.d.ts +59 -0
  145. package/dist/Model/Payout/Payout.js +20 -0
  146. package/dist/Model/Payout/Payout.zod.d.ts +99 -0
  147. package/dist/Model/Payout/Payout.zod.js +31 -0
  148. package/dist/Model/Payout/PayoutGroup.d.ts +11 -0
  149. package/dist/Model/Payout/PayoutGroup.js +11 -0
  150. package/dist/Model/Payout/PayoutGroup.zod.d.ts +186 -0
  151. package/dist/Model/Payout/PayoutGroup.zod.js +11 -0
  152. package/dist/Model/Payout/PayoutGroupFailed.d.ts +10 -0
  153. package/dist/Model/Payout/PayoutGroupFailed.js +10 -0
  154. package/dist/Model/Payout/PayoutGroupFailed.zod.d.ts +14 -0
  155. package/dist/Model/Payout/PayoutGroupFailed.zod.js +10 -0
  156. package/dist/Model/Payout/PayoutRecipient.d.ts +29 -0
  157. package/dist/Model/Payout/PayoutRecipient.js +12 -0
  158. package/dist/Model/Payout/PayoutRecipient.zod.d.ts +29 -0
  159. package/dist/Model/Payout/PayoutRecipient.zod.js +15 -0
  160. package/dist/Model/Payout/PayoutRecipients.d.ts +17 -0
  161. package/dist/Model/Payout/PayoutRecipients.js +15 -0
  162. package/dist/Model/Payout/PayoutRecipients.zod.d.ts +59 -0
  163. package/dist/Model/Payout/PayoutRecipients.zod.js +11 -0
  164. package/dist/Model/Payout/PayoutStatus.d.ts +8 -0
  165. package/dist/Model/Payout/PayoutStatus.js +12 -0
  166. package/dist/Model/Payout/PayoutTransaction.d.ts +13 -0
  167. package/dist/Model/Payout/PayoutTransaction.js +8 -0
  168. package/dist/Model/Payout/PayoutTransaction.zod.d.ts +17 -0
  169. package/dist/Model/Payout/PayoutTransaction.zod.js +11 -0
  170. package/dist/Model/Payout/RecipientReferenceMethod.d.ts +3 -0
  171. package/dist/Model/Payout/RecipientReferenceMethod.js +7 -0
  172. package/dist/Model/Payout/RecipientStatus.d.ts +6 -0
  173. package/dist/Model/Payout/RecipientStatus.js +10 -0
  174. package/dist/Model/Rates/Rate.d.ts +5 -0
  175. package/dist/Model/Rates/Rate.js +3 -0
  176. package/dist/Model/Rates/Rate.zod.d.ts +14 -0
  177. package/dist/Model/Rates/Rate.zod.js +10 -0
  178. package/dist/Model/Rates/Rates.d.ts +11 -0
  179. package/dist/Model/Rates/Rates.js +40 -0
  180. package/dist/Model/Settlement/InvoiceData.d.ts +20 -0
  181. package/dist/Model/Settlement/InvoiceData.js +8 -0
  182. package/dist/Model/Settlement/InvoiceData.zod.d.ts +51 -0
  183. package/dist/Model/Settlement/InvoiceData.zod.js +15 -0
  184. package/dist/Model/Settlement/PayoutInfo.d.ts +53 -0
  185. package/dist/Model/Settlement/PayoutInfo.js +8 -0
  186. package/dist/Model/Settlement/PayoutInfo.zod.d.ts +77 -0
  187. package/dist/Model/Settlement/PayoutInfo.zod.js +31 -0
  188. package/dist/Model/Settlement/RefundInfo.d.ts +13 -0
  189. package/dist/Model/Settlement/RefundInfo.js +8 -0
  190. package/dist/Model/Settlement/RefundInfo.zod.d.ts +17 -0
  191. package/dist/Model/Settlement/RefundInfo.zod.js +11 -0
  192. package/dist/Model/Settlement/Settlement.d.ts +40 -0
  193. package/dist/Model/Settlement/Settlement.js +8 -0
  194. package/dist/Model/Settlement/Settlement.zod.d.ts +349 -0
  195. package/dist/Model/Settlement/Settlement.zod.js +26 -0
  196. package/dist/Model/Settlement/SettlementLedgerEntry.d.ts +18 -0
  197. package/dist/Model/Settlement/SettlementLedgerEntry.js +8 -0
  198. package/dist/Model/Settlement/SettlementLedgerEntry.zod.d.ts +98 -0
  199. package/dist/Model/Settlement/SettlementLedgerEntry.zod.js +14 -0
  200. package/dist/Model/Settlement/WithHoldings.d.ts +17 -0
  201. package/dist/Model/Settlement/WithHoldings.js +8 -0
  202. package/dist/Model/Settlement/WithHoldings.zod.d.ts +23 -0
  203. package/dist/Model/Settlement/WithHoldings.zod.js +13 -0
  204. package/dist/Model/Wallet/Currencies.d.ts +26 -0
  205. package/dist/Model/Wallet/Currencies.js +7 -0
  206. package/dist/Model/Wallet/Currencies.zod.d.ts +44 -0
  207. package/dist/Model/Wallet/Currencies.zod.js +16 -0
  208. package/dist/Model/Wallet/CurrencyQr.d.ts +13 -0
  209. package/dist/Model/Wallet/CurrencyQr.js +7 -0
  210. package/dist/Model/Wallet/CurrencyQr.zod.d.ts +11 -0
  211. package/dist/Model/Wallet/CurrencyQr.zod.js +9 -0
  212. package/dist/Model/Wallet/Wallet.d.ts +22 -0
  213. package/dist/Model/Wallet/Wallet.js +7 -0
  214. package/dist/Model/Wallet/Wallet.zod.d.ts +89 -0
  215. package/dist/Model/Wallet/Wallet.zod.js +14 -0
  216. package/dist/Model/Webhook/InvoiceBuyerFields.zod.d.ts +35 -0
  217. package/dist/Model/Webhook/InvoiceBuyerFields.zod.js +17 -0
  218. package/dist/Model/Webhook/InvoiceWebhook.d.ts +21 -0
  219. package/dist/Model/Webhook/InvoiceWebhook.js +3 -0
  220. package/dist/Model/Webhook/InvoiceWebhook.zod.d.ts +114 -0
  221. package/dist/Model/Webhook/InvoiceWebhook.zod.js +26 -0
  222. package/dist/Model/Webhook/InvoiceWebhookBuyerFields.d.ts +12 -0
  223. package/dist/Model/Webhook/InvoiceWebhookBuyerFields.js +3 -0
  224. package/dist/Model/Webhook/PayoutWebhook.d.ts +22 -0
  225. package/dist/Model/Webhook/PayoutWebhook.js +3 -0
  226. package/dist/Model/Webhook/PayoutWebhook.zod.d.ts +87 -0
  227. package/dist/Model/Webhook/PayoutWebhook.zod.js +27 -0
  228. package/dist/Model/Webhook/RefundWebhook.d.ts +21 -0
  229. package/dist/Model/Webhook/RefundWebhook.js +3 -0
  230. package/dist/Model/Webhook/RefundWebhook.zod.d.ts +62 -0
  231. package/dist/Model/Webhook/RefundWebhook.zod.js +26 -0
  232. package/dist/Model/index.d.ts +12 -0
  233. package/dist/Model/index.js +32 -0
  234. package/dist/PosToken.d.ts +13 -0
  235. package/dist/PosToken.js +21 -0
  236. package/dist/PrivateKey.d.ts +9 -0
  237. package/dist/PrivateKey.js +18 -0
  238. package/dist/TokenContainer.d.ts +39 -0
  239. package/dist/TokenContainer.js +71 -0
  240. package/dist/index.d.ts +15 -0
  241. package/dist/index.js +46 -0
  242. package/dist/setup/BitPaySetup.d.ts +1 -0
  243. package/dist/setup/BitPaySetup.js +295 -0
  244. package/dist/util/BitPayResponseParser.d.ts +4 -0
  245. package/dist/util/BitPayResponseParser.js +67 -0
  246. package/dist/util/GuidGenerator.d.ts +3 -0
  247. package/dist/util/GuidGenerator.js +10 -0
  248. package/dist/util/KeyUtils.d.ts +12 -0
  249. package/dist/util/KeyUtils.js +47 -0
  250. package/dist/util/ParamsRemover.d.ts +3 -0
  251. package/dist/util/ParamsRemover.js +11 -0
  252. package/package.json +64 -0
@@ -0,0 +1,178 @@
1
+ export declare class Currency {
2
+ static BCH: string;
3
+ static BTC: string;
4
+ static ETH: string;
5
+ static USDC: string;
6
+ static GUSD: string;
7
+ static PAX: string;
8
+ static XRP: string;
9
+ static AED: string;
10
+ static AFN: string;
11
+ static ALL: string;
12
+ static AMD: string;
13
+ static ANG: string;
14
+ static AOA: string;
15
+ static ARS: string;
16
+ static AUD: string;
17
+ static AWG: string;
18
+ static AZN: string;
19
+ static BAM: string;
20
+ static BBD: string;
21
+ static BDT: string;
22
+ static BGN: string;
23
+ static BHD: string;
24
+ static BIF: string;
25
+ static BMD: string;
26
+ static BND: string;
27
+ static BOB: string;
28
+ static BOV: string;
29
+ static BRL: string;
30
+ static BSD: string;
31
+ static BTN: string;
32
+ static BWP: string;
33
+ static BYR: string;
34
+ static BZD: string;
35
+ static CAD: string;
36
+ static CDF: string;
37
+ static CHE: string;
38
+ static CHF: string;
39
+ static CHW: string;
40
+ static CLF: string;
41
+ static CLP: string;
42
+ static CNY: string;
43
+ static COP: string;
44
+ static COU: string;
45
+ static CRC: string;
46
+ static CUC: string;
47
+ static CUP: string;
48
+ static CVE: string;
49
+ static CZK: string;
50
+ static DJF: string;
51
+ static DKK: string;
52
+ static DOP: string;
53
+ static DZD: string;
54
+ static EGP: string;
55
+ static ERN: string;
56
+ static ETB: string;
57
+ static EUR: string;
58
+ static FJD: string;
59
+ static FKP: string;
60
+ static GBP: string;
61
+ static GEL: string;
62
+ static GHS: string;
63
+ static GIP: string;
64
+ static GMD: string;
65
+ static GNF: string;
66
+ static GTQ: string;
67
+ static GYD: string;
68
+ static HKD: string;
69
+ static HNL: string;
70
+ static HRK: string;
71
+ static HTG: string;
72
+ static HUF: string;
73
+ static IDR: string;
74
+ static ILS: string;
75
+ static INR: string;
76
+ static IQD: string;
77
+ static IRR: string;
78
+ static ISK: string;
79
+ static JMD: string;
80
+ static JOD: string;
81
+ static JPY: string;
82
+ static KES: string;
83
+ static KGS: string;
84
+ static KHR: string;
85
+ static KMF: string;
86
+ static KPW: string;
87
+ static KRW: string;
88
+ static KWD: string;
89
+ static KYD: string;
90
+ static KZT: string;
91
+ static LAK: string;
92
+ static LBP: string;
93
+ static LKR: string;
94
+ static LRD: string;
95
+ static LSL: string;
96
+ static LYD: string;
97
+ static MAD: string;
98
+ static MDL: string;
99
+ static MGA: string;
100
+ static MKD: string;
101
+ static MMK: string;
102
+ static MNT: string;
103
+ static MOP: string;
104
+ static MRU: string;
105
+ static MUR: string;
106
+ static MVR: string;
107
+ static MWK: string;
108
+ static MXN: string;
109
+ static MXV: string;
110
+ static MYR: string;
111
+ static MZN: string;
112
+ static NAD: string;
113
+ static NGN: string;
114
+ static NIO: string;
115
+ static NOK: string;
116
+ static NPR: string;
117
+ static NZD: string;
118
+ static OMR: string;
119
+ static PAB: string;
120
+ static PEN: string;
121
+ static PGK: string;
122
+ static PHP: string;
123
+ static PKR: string;
124
+ static PLN: string;
125
+ static PYG: string;
126
+ static QAR: string;
127
+ static RON: string;
128
+ static RSD: string;
129
+ static RUB: string;
130
+ static RWF: string;
131
+ static SAR: string;
132
+ static SBD: string;
133
+ static SCR: string;
134
+ static SDG: string;
135
+ static SEK: string;
136
+ static SGD: string;
137
+ static SHP: string;
138
+ static SLL: string;
139
+ static SOS: string;
140
+ static SRD: string;
141
+ static SSP: string;
142
+ static STN: string;
143
+ static SVC: string;
144
+ static SYP: string;
145
+ static SZL: string;
146
+ static THB: string;
147
+ static TJS: string;
148
+ static TMT: string;
149
+ static TND: string;
150
+ static TOP: string;
151
+ static TRY: string;
152
+ static TTD: string;
153
+ static TWD: string;
154
+ static TZS: string;
155
+ static UAH: string;
156
+ static UGX: string;
157
+ static USD: string;
158
+ static USN: string;
159
+ static UYI: string;
160
+ static UYU: string;
161
+ static UZS: string;
162
+ static VEF: string;
163
+ static VND: string;
164
+ static VUV: string;
165
+ static WST: string;
166
+ static XAF: string;
167
+ static XCD: string;
168
+ static XDR: string;
169
+ static XOF: string;
170
+ static XPF: string;
171
+ static XSU: string;
172
+ static XUA: string;
173
+ static YER: string;
174
+ static ZAR: string;
175
+ static ZMW: string;
176
+ static ZWL: string;
177
+ static isValid(value: any): boolean;
178
+ }
@@ -0,0 +1,193 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Currency = void 0;
4
+ /* eslint-disable @typescript-eslint/no-unused-vars*/
5
+ class Currency {
6
+ static isValid(value) {
7
+ try {
8
+ return this.hasOwnProperty.call(this, value);
9
+ }
10
+ catch (ex) {
11
+ return false;
12
+ }
13
+ }
14
+ }
15
+ exports.Currency = Currency;
16
+ // Crypto
17
+ Currency.BCH = 'BCH';
18
+ Currency.BTC = 'BTC';
19
+ Currency.ETH = 'ETH';
20
+ Currency.USDC = 'USDC';
21
+ Currency.GUSD = 'GUSD';
22
+ Currency.PAX = 'PAX';
23
+ Currency.XRP = 'XRP';
24
+ // FIAT
25
+ Currency.AED = 'AED';
26
+ Currency.AFN = 'AFN';
27
+ Currency.ALL = 'ALL';
28
+ Currency.AMD = 'AMD';
29
+ Currency.ANG = 'ANG';
30
+ Currency.AOA = 'AOA';
31
+ Currency.ARS = 'ARS';
32
+ Currency.AUD = 'AUD';
33
+ Currency.AWG = 'AWG';
34
+ Currency.AZN = 'AZN';
35
+ Currency.BAM = 'BAM';
36
+ Currency.BBD = 'BBD';
37
+ Currency.BDT = 'BDT';
38
+ Currency.BGN = 'BGN';
39
+ Currency.BHD = 'BHD';
40
+ Currency.BIF = 'BIF';
41
+ Currency.BMD = 'BMD';
42
+ Currency.BND = 'BND';
43
+ Currency.BOB = 'BOB';
44
+ Currency.BOV = 'BOV';
45
+ Currency.BRL = 'BRL';
46
+ Currency.BSD = 'BSD';
47
+ Currency.BTN = 'BTN';
48
+ Currency.BWP = 'BWP';
49
+ Currency.BYR = 'BYR';
50
+ Currency.BZD = 'BZD';
51
+ Currency.CAD = 'CAD';
52
+ Currency.CDF = 'CDF';
53
+ Currency.CHE = 'CHE';
54
+ Currency.CHF = 'CHF';
55
+ Currency.CHW = 'CHW';
56
+ Currency.CLF = 'CLF';
57
+ Currency.CLP = 'CLP';
58
+ Currency.CNY = 'CNY';
59
+ Currency.COP = 'COP';
60
+ Currency.COU = 'COU';
61
+ Currency.CRC = 'CRC';
62
+ Currency.CUC = 'CUC';
63
+ Currency.CUP = 'CUP';
64
+ Currency.CVE = 'CVE';
65
+ Currency.CZK = 'CZK';
66
+ Currency.DJF = 'DJF';
67
+ Currency.DKK = 'DKK';
68
+ Currency.DOP = 'DOP';
69
+ Currency.DZD = 'DZD';
70
+ Currency.EGP = 'EGP';
71
+ Currency.ERN = 'ERN';
72
+ Currency.ETB = 'ETB';
73
+ Currency.EUR = 'EUR';
74
+ Currency.FJD = 'FJD';
75
+ Currency.FKP = 'FKP';
76
+ Currency.GBP = 'GBP';
77
+ Currency.GEL = 'GEL';
78
+ Currency.GHS = 'GHS';
79
+ Currency.GIP = 'GIP';
80
+ Currency.GMD = 'GMD';
81
+ Currency.GNF = 'GNF';
82
+ Currency.GTQ = 'GTQ';
83
+ Currency.GYD = 'GYD';
84
+ Currency.HKD = 'HKD';
85
+ Currency.HNL = 'HNL';
86
+ Currency.HRK = 'HRK';
87
+ Currency.HTG = 'HTG';
88
+ Currency.HUF = 'HUF';
89
+ Currency.IDR = 'IDR';
90
+ Currency.ILS = 'ILS';
91
+ Currency.INR = 'INR';
92
+ Currency.IQD = 'IQD';
93
+ Currency.IRR = 'IRR';
94
+ Currency.ISK = 'ISK';
95
+ Currency.JMD = 'JMD';
96
+ Currency.JOD = 'JOD';
97
+ Currency.JPY = 'JPY';
98
+ Currency.KES = 'KES';
99
+ Currency.KGS = 'KGS';
100
+ Currency.KHR = 'KHR';
101
+ Currency.KMF = 'KMF';
102
+ Currency.KPW = 'KPW';
103
+ Currency.KRW = 'KRW';
104
+ Currency.KWD = 'KWD';
105
+ Currency.KYD = 'KYD';
106
+ Currency.KZT = 'KZT';
107
+ Currency.LAK = 'LAK';
108
+ Currency.LBP = 'LBP';
109
+ Currency.LKR = 'LKR';
110
+ Currency.LRD = 'LRD';
111
+ Currency.LSL = 'LSL';
112
+ Currency.LYD = 'LYD';
113
+ Currency.MAD = 'MAD';
114
+ Currency.MDL = 'MDL';
115
+ Currency.MGA = 'MGA';
116
+ Currency.MKD = 'MKD';
117
+ Currency.MMK = 'MMK';
118
+ Currency.MNT = 'MNT';
119
+ Currency.MOP = 'MOP';
120
+ Currency.MRU = 'MRU';
121
+ Currency.MUR = 'MUR';
122
+ Currency.MVR = 'MVR';
123
+ Currency.MWK = 'MWK';
124
+ Currency.MXN = 'MXN';
125
+ Currency.MXV = 'MXV';
126
+ Currency.MYR = 'MYR';
127
+ Currency.MZN = 'MZN';
128
+ Currency.NAD = 'NAD';
129
+ Currency.NGN = 'NGN';
130
+ Currency.NIO = 'NIO';
131
+ Currency.NOK = 'NOK';
132
+ Currency.NPR = 'NPR';
133
+ Currency.NZD = 'NZD';
134
+ Currency.OMR = 'OMR';
135
+ Currency.PAB = 'PAB';
136
+ Currency.PEN = 'PEN';
137
+ Currency.PGK = 'PGK';
138
+ Currency.PHP = 'PHP';
139
+ Currency.PKR = 'PKR';
140
+ Currency.PLN = 'PLN';
141
+ Currency.PYG = 'PYG';
142
+ Currency.QAR = 'QAR';
143
+ Currency.RON = 'RON';
144
+ Currency.RSD = 'RSD';
145
+ Currency.RUB = 'RUB';
146
+ Currency.RWF = 'RWF';
147
+ Currency.SAR = 'SAR';
148
+ Currency.SBD = 'SBD';
149
+ Currency.SCR = 'SCR';
150
+ Currency.SDG = 'SDG';
151
+ Currency.SEK = 'SEK';
152
+ Currency.SGD = 'SGD';
153
+ Currency.SHP = 'SHP';
154
+ Currency.SLL = 'SLL';
155
+ Currency.SOS = 'SOS';
156
+ Currency.SRD = 'SRD';
157
+ Currency.SSP = 'SSP';
158
+ Currency.STN = 'STN';
159
+ Currency.SVC = 'SVC';
160
+ Currency.SYP = 'SYP';
161
+ Currency.SZL = 'SZL';
162
+ Currency.THB = 'THB';
163
+ Currency.TJS = 'TJS';
164
+ Currency.TMT = 'TMT';
165
+ Currency.TND = 'TND';
166
+ Currency.TOP = 'TOP';
167
+ Currency.TRY = 'TRY';
168
+ Currency.TTD = 'TTD';
169
+ Currency.TWD = 'TWD';
170
+ Currency.TZS = 'TZS';
171
+ Currency.UAH = 'UAH';
172
+ Currency.UGX = 'UGX';
173
+ Currency.USD = 'USD';
174
+ Currency.USN = 'USN';
175
+ Currency.UYI = 'UYI';
176
+ Currency.UYU = 'UYU';
177
+ Currency.UZS = 'UZS';
178
+ Currency.VEF = 'VEF';
179
+ Currency.VND = 'VND';
180
+ Currency.VUV = 'VUV';
181
+ Currency.WST = 'WST';
182
+ Currency.XAF = 'XAF';
183
+ Currency.XCD = 'XCD';
184
+ Currency.XDR = 'XDR';
185
+ Currency.XOF = 'XOF';
186
+ Currency.XPF = 'XPF';
187
+ Currency.XSU = 'XSU';
188
+ Currency.XUA = 'XUA';
189
+ Currency.YER = 'YER';
190
+ Currency.ZAR = 'ZAR';
191
+ Currency.ZMW = 'ZMW';
192
+ Currency.ZWL = 'ZWL';
193
+ //# sourceMappingURL=Currency.js.map
package/dist/Env.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export declare const Test = "TEST";
2
+ export declare const Prod = "PROD";
3
+ export declare const TestUrl = "https://test.bitpay.com/";
4
+ export declare const ProdUrl = "https://bitpay.com/";
5
+ export declare const BitpayApiVersion = "2.0.0";
6
+ export declare const BitpayPluginInfo = "BitPay_NodeJs_Client_v6.2.1";
7
+ export declare const BitpayApiFrame = "std";
8
+ export declare const BitpayApiFrameVersion = "1.0.0";
package/dist/Env.js ADDED
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BitpayApiFrameVersion = exports.BitpayApiFrame = exports.BitpayPluginInfo = exports.BitpayApiVersion = exports.ProdUrl = exports.TestUrl = exports.Prod = exports.Test = void 0;
4
+ exports.Test = 'TEST';
5
+ exports.Prod = 'PROD';
6
+ exports.TestUrl = 'https://test.bitpay.com/';
7
+ exports.ProdUrl = 'https://bitpay.com/';
8
+ exports.BitpayApiVersion = '2.0.0';
9
+ exports.BitpayPluginInfo = 'BitPay_NodeJs_Client_v6.2.1';
10
+ exports.BitpayApiFrame = 'std';
11
+ exports.BitpayApiFrameVersion = '1.0.0';
12
+ module.exports = {
13
+ Test: exports.Test,
14
+ Prod: exports.Prod,
15
+ TestUrl: exports.TestUrl,
16
+ ProdUrl: exports.ProdUrl,
17
+ BitpayApiVersion: exports.BitpayApiVersion,
18
+ BitpayPluginInfo: exports.BitpayPluginInfo,
19
+ BitpayApiFrame: exports.BitpayApiFrame,
20
+ BitpayApiFrameVersion: exports.BitpayApiFrameVersion
21
+ };
22
+ //# sourceMappingURL=Env.js.map
@@ -0,0 +1,4 @@
1
+ export declare enum Environment {
2
+ Test = "Test",
3
+ Prod = "Prod"
4
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Environment = void 0;
4
+ var Environment;
5
+ (function (Environment) {
6
+ Environment["Test"] = "Test";
7
+ Environment["Prod"] = "Prod";
8
+ })(Environment || (exports.Environment = Environment = {}));
9
+ //# sourceMappingURL=Environment.js.map
@@ -0,0 +1,13 @@
1
+ import BitPayException from './BitPayException';
2
+ export declare class BitPayApiException extends BitPayException {
3
+ readonly name: string;
4
+ readonly code: string | null;
5
+ /**
6
+ * Construct the BitPayException.
7
+ *
8
+ * @param message string [optional] The Exception message to throw.
9
+ * @param code string [optional] The Exception code to throw.
10
+ */
11
+ constructor(message: string, code: string | null);
12
+ }
13
+ export default BitPayApiException;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BitPayApiException = void 0;
4
+ const BitPayException_1 = require("./BitPayException");
5
+ class BitPayApiException extends BitPayException_1.default {
6
+ /**
7
+ * Construct the BitPayException.
8
+ *
9
+ * @param message string [optional] The Exception message to throw.
10
+ * @param code string [optional] The Exception code to throw.
11
+ */
12
+ constructor(message, code) {
13
+ super(message);
14
+ this.name = 'BITPAY-EXCEPTION';
15
+ this.code = 'BITPAY-EXCEPTION';
16
+ this.code = code;
17
+ }
18
+ }
19
+ exports.BitPayApiException = BitPayApiException;
20
+ exports.default = BitPayApiException;
21
+ //# sourceMappingURL=BitPayApiException.js.map
@@ -0,0 +1,12 @@
1
+ export declare class BitPayException implements Error {
2
+ readonly message: string;
3
+ readonly name: string;
4
+ readonly stack: string;
5
+ /**
6
+ * Construct the BitPayException.
7
+ *
8
+ * @param message string [optional] The Exception message to throw.
9
+ */
10
+ constructor(message: string);
11
+ }
12
+ export default BitPayException;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BitPayException = void 0;
4
+ class BitPayException {
5
+ /**
6
+ * Construct the BitPayException.
7
+ *
8
+ * @param message string [optional] The Exception message to throw.
9
+ */
10
+ constructor(message) {
11
+ this.name = 'BITPAY-EXCEPTION';
12
+ this.message = message;
13
+ }
14
+ }
15
+ exports.BitPayException = BitPayException;
16
+ exports.default = BitPayException;
17
+ //# sourceMappingURL=BitPayException.js.map
@@ -0,0 +1,14 @@
1
+ export declare class BitPayExceptionProvider {
2
+ static readonly GENERIC_API_UNMAPPED_ERROR_CODE: string;
3
+ static throwGenericExceptionWithMessage(errorMessage: string | null): void;
4
+ static throwApiExceptionWithMessage(errorMessage: string | null, code: string | null): void;
5
+ static throwDeserializeResourceException(resource: string | null, errorMessage: string | null): void;
6
+ static throwDeserializeException(errorMessage: string | null): void;
7
+ static throwEncodeException(errorMessage: string | null): void;
8
+ static throwSerializeResourceException(resource: string, errorMessage: string | null): void;
9
+ static throwSerializeParamsException(errorMessage: string | null): void;
10
+ static throwValidationException(errorMessage: string | null): void;
11
+ static throwMissingParameterException(): void;
12
+ static throwInvalidCurrencyException(currencyCode: string | null): void;
13
+ private static logErrorMessage;
14
+ }
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BitPayExceptionProvider = void 0;
4
+ const LoggerProvider_1 = require("../Logger/LoggerProvider");
5
+ const BitPayGenericException_1 = require("./BitPayGenericException");
6
+ const BitPayApiException_1 = require("./BitPayApiException");
7
+ const BitPayValidationException_1 = require("./BitPayValidationException");
8
+ class BitPayExceptionProvider {
9
+ static throwGenericExceptionWithMessage(errorMessage) {
10
+ if (errorMessage == null) {
11
+ errorMessage = 'Unexpected generic error';
12
+ }
13
+ this.logErrorMessage(errorMessage);
14
+ throw new BitPayGenericException_1.default(errorMessage);
15
+ }
16
+ static throwApiExceptionWithMessage(errorMessage, code) {
17
+ if (errorMessage == null) {
18
+ errorMessage = 'Unexpected api error';
19
+ }
20
+ this.logErrorMessage(errorMessage);
21
+ code = code ? code : this.GENERIC_API_UNMAPPED_ERROR_CODE;
22
+ throw new BitPayApiException_1.default(errorMessage, code);
23
+ }
24
+ static throwDeserializeResourceException(resource, errorMessage) {
25
+ let message;
26
+ if (resource === null) {
27
+ message = 'Failed to deserialize BitPay server response (' + errorMessage + '): ' + resource;
28
+ }
29
+ else {
30
+ message = 'Failed to deserialize BitPay server response ( %s )';
31
+ }
32
+ this.logErrorMessage(message);
33
+ this.throwGenericExceptionWithMessage(message);
34
+ }
35
+ static throwDeserializeException(errorMessage) {
36
+ const message = 'Failed to deserialize BitPay server response : ' + errorMessage;
37
+ this.logErrorMessage(message);
38
+ }
39
+ static throwEncodeException(errorMessage) {
40
+ if (errorMessage == null) {
41
+ errorMessage = 'Unexpected encode error';
42
+ }
43
+ this.logErrorMessage(errorMessage);
44
+ const message = 'Failed to encode params : ' + errorMessage;
45
+ this.throwGenericExceptionWithMessage(message);
46
+ }
47
+ static throwSerializeResourceException(resource, errorMessage) {
48
+ const message = 'Failed to serialize ( ' + resource + ' ) : ' + errorMessage;
49
+ this.logErrorMessage(message);
50
+ this.throwGenericExceptionWithMessage(message);
51
+ }
52
+ static throwSerializeParamsException(errorMessage) {
53
+ const message = 'Failed to serialize params : ' + errorMessage;
54
+ this.logErrorMessage(message);
55
+ }
56
+ static throwValidationException(errorMessage) {
57
+ if (errorMessage == null) {
58
+ errorMessage = 'Unexpected validation error';
59
+ }
60
+ this.logErrorMessage(errorMessage);
61
+ throw new BitPayValidationException_1.default(errorMessage);
62
+ }
63
+ static throwMissingParameterException() {
64
+ const message = 'Missing required parameter';
65
+ this.logErrorMessage(message);
66
+ throw new BitPayValidationException_1.default(message);
67
+ }
68
+ static throwInvalidCurrencyException(currencyCode) {
69
+ const message = 'Currency code ' + currencyCode + ' must be a type of Model.Currency.Currency';
70
+ this.throwValidationException(message);
71
+ }
72
+ static logErrorMessage(message) {
73
+ if (message === null) {
74
+ return;
75
+ }
76
+ LoggerProvider_1.LoggerProvider.getLogger().logError(message);
77
+ }
78
+ }
79
+ exports.BitPayExceptionProvider = BitPayExceptionProvider;
80
+ BitPayExceptionProvider.GENERIC_API_UNMAPPED_ERROR_CODE = '000000';
81
+ //# sourceMappingURL=BitPayExceptionProvider.js.map
@@ -0,0 +1,4 @@
1
+ import BitPayException from './BitPayException';
2
+ export declare class BitPayGenericException extends BitPayException {
3
+ }
4
+ export default BitPayGenericException;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BitPayGenericException = void 0;
4
+ const BitPayException_1 = require("./BitPayException");
5
+ class BitPayGenericException extends BitPayException_1.default {
6
+ }
7
+ exports.BitPayGenericException = BitPayGenericException;
8
+ exports.default = BitPayGenericException;
9
+ //# sourceMappingURL=BitPayGenericException.js.map
@@ -0,0 +1,4 @@
1
+ import BitPayGenericException from './BitPayGenericException';
2
+ export declare class BitPayValidationException extends BitPayGenericException {
3
+ }
4
+ export default BitPayValidationException;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BitPayValidationException = void 0;
4
+ const BitPayGenericException_1 = require("./BitPayGenericException");
5
+ class BitPayValidationException extends BitPayGenericException_1.default {
6
+ }
7
+ exports.BitPayValidationException = BitPayValidationException;
8
+ exports.default = BitPayValidationException;
9
+ //# sourceMappingURL=BitPayValidationException.js.map
@@ -0,0 +1,4 @@
1
+ import { BitPayGenericException as Generic } from './BitPayGenericException';
2
+ import { BitPayApiException as Api } from './BitPayApiException';
3
+ import { BitPayValidationException as Validation } from './BitPayValidationException';
4
+ export { Generic, Api, Validation };
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /*
3
+ * __ _ __
4
+ * / /_ (_) /_____ ____ ___ __
5
+ * / __ \/ / __/ __ \/ __ `/ / / /
6
+ * / /_/ / / /_/ /_/ / /_/ / /_/ /
7
+ * /_.___/_/\__/ .___/\__,_/\__, /
8
+ * /_/ /____/
9
+ *
10
+ * BitPay NodeJS Client
11
+ *
12
+ * Copyright (c) 2020 BitPay inc.
13
+ * This file is open source and available under the MIT license.
14
+ * See the LICENSE file for more info.
15
+ */
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Validation = exports.Api = exports.Generic = void 0;
18
+ const BitPayGenericException_1 = require("./BitPayGenericException");
19
+ Object.defineProperty(exports, "Generic", { enumerable: true, get: function () { return BitPayGenericException_1.BitPayGenericException; } });
20
+ const BitPayApiException_1 = require("./BitPayApiException");
21
+ Object.defineProperty(exports, "Api", { enumerable: true, get: function () { return BitPayApiException_1.BitPayApiException; } });
22
+ const BitPayValidationException_1 = require("./BitPayValidationException");
23
+ Object.defineProperty(exports, "Validation", { enumerable: true, get: function () { return BitPayValidationException_1.BitPayValidationException; } });
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,5 @@
1
+ export declare enum Facade {
2
+ Merchant = "merchant",
3
+ Payout = "payout",
4
+ Pos = "pos"
5
+ }
package/dist/Facade.js ADDED
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Facade = void 0;
4
+ var Facade;
5
+ (function (Facade) {
6
+ Facade["Merchant"] = "merchant";
7
+ Facade["Payout"] = "payout";
8
+ Facade["Pos"] = "pos";
9
+ })(Facade || (exports.Facade = Facade = {}));
10
+ //# sourceMappingURL=Facade.js.map
@@ -0,0 +1,5 @@
1
+ export interface BitPayLogger {
2
+ logRequest(method: string, endpoint: string, json: string | null): void;
3
+ logResponse(method: string, endpoint: string, json: string): void;
4
+ logError(message: string): void;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=BitPayLogger.js.map