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,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WalletClient = exports.SettlementClient = exports.RefundClient = exports.RateClient = exports.PayoutRecipientClient = exports.PayoutGroupClient = exports.PayoutClient = exports.LedgerClient = exports.InvoiceClient = exports.CurrencyClient = exports.BitPayClient = exports.BillClient = void 0;
4
+ const BillClient_1 = require("./BillClient");
5
+ Object.defineProperty(exports, "BillClient", { enumerable: true, get: function () { return BillClient_1.BillClient; } });
6
+ const BitPayClient_1 = require("./BitPayClient");
7
+ Object.defineProperty(exports, "BitPayClient", { enumerable: true, get: function () { return BitPayClient_1.BitPayClient; } });
8
+ const CurrencyClient_1 = require("./CurrencyClient");
9
+ Object.defineProperty(exports, "CurrencyClient", { enumerable: true, get: function () { return CurrencyClient_1.CurrencyClient; } });
10
+ const InvoiceClient_1 = require("./InvoiceClient");
11
+ Object.defineProperty(exports, "InvoiceClient", { enumerable: true, get: function () { return InvoiceClient_1.InvoiceClient; } });
12
+ const LedgerClient_1 = require("./LedgerClient");
13
+ Object.defineProperty(exports, "LedgerClient", { enumerable: true, get: function () { return LedgerClient_1.LedgerClient; } });
14
+ const PayoutClient_1 = require("./PayoutClient");
15
+ Object.defineProperty(exports, "PayoutClient", { enumerable: true, get: function () { return PayoutClient_1.PayoutClient; } });
16
+ const PayoutGroupClient_1 = require("./PayoutGroupClient");
17
+ Object.defineProperty(exports, "PayoutGroupClient", { enumerable: true, get: function () { return PayoutGroupClient_1.PayoutGroupClient; } });
18
+ const PayoutRecipientClient_1 = require("./PayoutRecipientClient");
19
+ Object.defineProperty(exports, "PayoutRecipientClient", { enumerable: true, get: function () { return PayoutRecipientClient_1.PayoutRecipientClient; } });
20
+ const RateClient_1 = require("./RateClient");
21
+ Object.defineProperty(exports, "RateClient", { enumerable: true, get: function () { return RateClient_1.RateClient; } });
22
+ const RefundClient_1 = require("./RefundClient");
23
+ Object.defineProperty(exports, "RefundClient", { enumerable: true, get: function () { return RefundClient_1.RefundClient; } });
24
+ const SettlementClient_1 = require("./SettlementClient");
25
+ Object.defineProperty(exports, "SettlementClient", { enumerable: true, get: function () { return SettlementClient_1.SettlementClient; } });
26
+ const WalletClient_1 = require("./WalletClient");
27
+ Object.defineProperty(exports, "WalletClient", { enumerable: true, get: function () { return WalletClient_1.WalletClient; } });
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,445 @@
1
+ import { Facade } from './index';
2
+ import { BillInterface, InvoiceInterface, LedgerEntryInterface, LedgerInterface, PayoutInterface, PayoutGroupInterface, PayoutRecipientInterface, PayoutRecipients, RateInterface, Rates } from './Model';
3
+ import { BitPayClient } from './Client/index';
4
+ import { TokenContainer } from './TokenContainer';
5
+ import { Environment } from './Environment';
6
+ import { GuidGenerator } from './util/GuidGenerator';
7
+ import { InvoiceEventTokenInterface } from './Model/Invoice/InvoiceEventToken';
8
+ import { RefundInterface } from './Model/Invoice/Refund';
9
+ import { WalletInterface } from './Model/Wallet/Wallet';
10
+ import { SettlementInterface } from './Model/Settlement/Settlement';
11
+ import { PosToken } from './PosToken';
12
+ import { PrivateKey } from './PrivateKey';
13
+ import { CurrencyInterface } from './Model/Currency/Currency';
14
+ export declare class Client {
15
+ private bitPayClient;
16
+ private keyUtils;
17
+ private guidGenerator;
18
+ private tokenContainer;
19
+ constructor(configFilePath: string | null, privateKey: PrivateKey | null, tokenContainer: TokenContainer | null, posToken: PosToken | null, environment?: Environment, platformInfo?: string, bitPayClient?: BitPayClient, // using for tests
20
+ guidGenerator?: GuidGenerator);
21
+ /**
22
+ * Client factory for POS
23
+ * @param posToken
24
+ * @param environment
25
+ */
26
+ static createPosClient(posToken: string, environment?: Environment, platformInfo?: string): Client;
27
+ /**
28
+ * Client factory based on config file
29
+ *
30
+ * @param configFilePath
31
+ */
32
+ static createClientByConfig(configFilePath: string, platformInfo?: string): Client;
33
+ /**
34
+ * Client factory based on private key and tokens
35
+ * @param privateKey
36
+ * @param tokenContainer
37
+ * @param environment
38
+ */
39
+ static createClientByPrivateKey(privateKey: string, tokenContainer: TokenContainer, environment?: Environment, platformInfo?: string): Client;
40
+ getToken(facade: Facade): string;
41
+ /**
42
+ * Retrieve the rates for a cryptocurrency / fiat pair. See https://bitpay.com/bitcoin-exchange-rates.
43
+ *
44
+ * @param baseCurrency the cryptocurrency for which you want to fetch the rates.
45
+ * Current supported values are BTC and BCH.
46
+ * @param currency the fiat currency for which you want to fetch the baseCurrency rates
47
+ * @return A Rate object populated with the BitPay exchange rate table.
48
+ */
49
+ getRate(baseCurrency: string, currency: string): Promise<RateInterface>;
50
+ /**
51
+ * Retrieve the exchange rate table maintained by BitPay. See https://bitpay.com/bitcoin-exchange-rates.
52
+ * @param currency the cryptocurrency for which you want to fetch the rates.
53
+ * Current supported values are BTC and BCH.
54
+ * @return A Rates object populated with the BitPay exchange rate table.
55
+ */
56
+ getRates(currency: string | null): Promise<Rates>;
57
+ /**
58
+ * Create a BitPay invoice using the Merchant facade.
59
+ *
60
+ * @param invoice An Invoice object with request parameters defined.
61
+ * @param facade Facade for request.
62
+ * @param signRequest Signed request.
63
+ */
64
+ createInvoice(invoice: InvoiceInterface, facade?: Facade, signRequest?: boolean): Promise<InvoiceInterface>;
65
+ /**
66
+ * Retrieve a BitPay invoice by invoice id using the public facade.
67
+ *
68
+ * @param invoiceId The id of the invoice to retrieve.
69
+ * @param facade Facade for request.
70
+ * @param signRequest Signed request.
71
+ */
72
+ getInvoice(invoiceId: string, facade?: Facade, signRequest?: boolean): Promise<InvoiceInterface>;
73
+ /**
74
+ * Retrieve a BitPay invoice by guid using the specified facade.
75
+ * The client must have been previously authorized for the specified facade.
76
+ *
77
+ * @param guid The guid of the invoice to retrieve.
78
+ * @param facade Facade for request.
79
+ * @param signRequest Signed request.
80
+ */
81
+ getInvoiceByGuid(guid: string, facade?: Facade, signRequest?: boolean): Promise<InvoiceInterface>;
82
+ /**
83
+ * Retrieve a collection of BitPay invoices.
84
+ *
85
+ * @param params Available params:
86
+ * dateStart The first date for the query filter.
87
+ * dateEnd The last date for the query filter.
88
+ * status The invoice status you want to query on.
89
+ * orderId The optional order id specified at time of invoice creation.
90
+ * limit Maximum results that the query will return (useful for paging results).
91
+ * offset Number of results to offset (ex. skip 10 will give you results starting with the 11th.
92
+ */
93
+ getInvoices(params: {
94
+ dateStart: string | null;
95
+ dateEnd: string | null;
96
+ status: string | null;
97
+ orderId: string | null;
98
+ limit: number | null;
99
+ offset: number | null;
100
+ }): Promise<InvoiceInterface[]>;
101
+ /**
102
+ * Retrieves a bus token which can be used to subscribe to invoice events.
103
+ *
104
+ * @param invoiceId the id of the invoice for which you want to fetch an event token.
105
+ */
106
+ getInvoiceEventToken(invoiceId: string): Promise<InvoiceEventTokenInterface>;
107
+ /**
108
+ * Pay a BitPay invoice with a mock transaction. Available only on test env.
109
+ *
110
+ * @param invoiceId The id of the invoice to updated.
111
+ * @param status The status of the invoice to be updated, can be "confirmed" or "complete".
112
+ * @return A BitPay generated Invoice object.
113
+ */
114
+ payInvoice(invoiceId: string, status: string): Promise<InvoiceInterface>;
115
+ /**
116
+ * Update a BitPay invoice with communication method.
117
+ * @param invoiceId The id of the invoice to updated.
118
+ * @param params Available parameters:
119
+ * buyerSms The buyer's cell number.
120
+ * smsCode The buyer's received verification code.
121
+ * buyerEmail The buyer's email address.
122
+ * autoVerify Skip the user verification on sandbox ONLY.
123
+ * @return A BitPay generated Invoice object.
124
+ */
125
+ updateInvoice(invoiceId: string, params: object): Promise<InvoiceInterface>;
126
+ /**
127
+ * Delete a previously created BitPay invoice.
128
+ *
129
+ * @param invoiceId The Id of the BitPay invoice to be canceled.
130
+ * @param forceCancel Force cancel.
131
+ * @return A BitPay generated Invoice object.
132
+ */
133
+ cancelInvoice(invoiceId: string, forceCancel?: boolean): Promise<InvoiceInterface>;
134
+ /**
135
+ * Cancellation will require EITHER an SMS or E-mail to have already been set if the invoice has proceeded to
136
+ * the point where it may have been paid, unless using forceCancel parameter.
137
+ * @param guid GUID A passthru variable provided by the merchant and designed to be used by the merchant to
138
+ * correlate the invoice with an order ID in their system, which can be used as a lookup variable
139
+ * in Retrieve Invoice by GUID.
140
+ * @param forceCancel If 'true' it will cancel the invoice even if no contact information is present.
141
+ * @return Invoice Invoice
142
+ */
143
+ cancelInvoiceByGuid(guid: string, forceCancel?: boolean): Promise<InvoiceInterface>;
144
+ /**
145
+ * The intent of this call is to address issues when BitPay sends a webhook but the client doesn't receive it,
146
+ * so the client can request that BitPay resend it.
147
+ * @param invoiceId The id of the invoice for which you want the last webhook to be resent.
148
+ * @return Boolean status of request
149
+ */
150
+ requestInvoiceWebhookToBeResent(invoiceId: string): Promise<boolean>;
151
+ /**
152
+ * Create a refund for a BitPay invoice.
153
+ * @param refund. Parameters from Refund object used in request:
154
+ * invoiceId The BitPay invoice Id having the associated refund to be created.
155
+ * amount Amount to be refunded in the currency indicated.
156
+ * preview Whether to create the refund request as a preview (which will not be acted on until status is updated)
157
+ * immediate Whether funds should be removed from merchant ledger immediately on submission or at time of processing
158
+ * buyerPaysRefundFee Whether the buyer should pay the refund fee (default is merchant)
159
+ * reference Present only if specified. Used as reference label for the refund. Max str length = 100
160
+ * guid Variable provided by the merchant and designed to be used by the merchant to correlate the refund with a refund ID in their system
161
+ * @return An updated Refund Object
162
+ */
163
+ createRefund(refund: RefundInterface): Promise<RefundInterface>;
164
+ /**
165
+ * Retrieve a previously made refund request on a BitPay invoice.
166
+ *
167
+ * @param refundId The BitPay refund ID.
168
+ * @return A BitPay Refund object with the associated Refund object.
169
+ */
170
+ getRefund(refundId: string): Promise<RefundInterface>;
171
+ /**
172
+ * Retrieve a previously made refund request on a BitPay invoice.
173
+ *
174
+ * @param guid The BitPay refund GUID.
175
+ * @return A BitPay Refund object with the associated Refund object.
176
+ */
177
+ getRefundByGuid(guid: string): Promise<RefundInterface>;
178
+ /**
179
+ * Retrieve all refund requests on a BitPay invoice.
180
+ *
181
+ * @param invoiceId The BitPay invoice object having the associated refunds.
182
+ * @return A list of BitPay Refund objects with the associated Refund objects.
183
+ */
184
+ getRefunds(invoiceId: string): Promise<RefundInterface[]>;
185
+ /**
186
+ * Update the status of a BitPay invoice.
187
+ *
188
+ * @param refundId A BitPay refund ID.
189
+ * @param status The new status for the refund to be updated.
190
+ * @return A BitPay generated Refund object.
191
+ */
192
+ updateRefund(refundId: string, status: string): Promise<RefundInterface>;
193
+ /**
194
+ * Update the status of a BitPay invoice.
195
+ *
196
+ * @param guid A BitPay refund Guid.
197
+ * @param status The new status for the refund to be updated.
198
+ * @return A BitPay generated Refund object.
199
+ */
200
+ updateRefundByGuid(guid: string, status: string): Promise<RefundInterface>;
201
+ /**
202
+ * Send a refund notification.
203
+ *
204
+ * @param refundId A BitPay refund ID.
205
+ * @return An updated Refund Object
206
+ */
207
+ sendRefundNotification(refundId: string): Promise<boolean>;
208
+ /**
209
+ * Cancel a previously submitted refund request on a BitPay invoice.
210
+ *
211
+ * @param refundId The refund Id for the refund to be canceled.
212
+ * @return An updated Refund Object.
213
+ */
214
+ cancelRefund(refundId: string): Promise<RefundInterface>;
215
+ /**
216
+ * Cancel a previously submitted refund request on a BitPay invoice.
217
+ *
218
+ * @param guid The refund Guid for the refund to be canceled.
219
+ * @return An updated Refund Object.
220
+ */
221
+ cancelRefundByGuid(guid: string): Promise<RefundInterface>;
222
+ /**
223
+ * Submit BitPay Payout Recipients.
224
+ *
225
+ * @param recipients PayoutRecipients A PayoutRecipients object with request parameters defined.
226
+ * @return array A list of BitPay PayoutRecipients objects.
227
+ */
228
+ submitPayoutRecipients(recipients: PayoutRecipients): Promise<PayoutRecipientInterface[]>;
229
+ /**
230
+ * Retrieve a collection of BitPay Payout Recipients.
231
+ * @param params Available parameters:
232
+ * status String|null The recipient status you want to query on.
233
+ * limit int Maximum results that the query will return (useful for
234
+ * paging results). result).
235
+ * offset int Offset for paging.
236
+ * @return array A list of BitPayRecipient objects.
237
+ */
238
+ getPayoutRecipients(params?: {}): Promise<PayoutRecipientInterface[]>;
239
+ /**
240
+ * Retrieve a BitPay payout recipient by batch id using. The client must have been previously authorized for the
241
+ * payout facade.
242
+ *
243
+ * @param recipientId String The id of the recipient to retrieve.
244
+ * @return PayoutRecipient A BitPay PayoutRecipient object.
245
+ */
246
+ getPayoutRecipient(recipientId: string): Promise<PayoutRecipientInterface>;
247
+ /**
248
+ * Update a Payout Recipient.
249
+ *
250
+ * @param recipientId String The recipient id for the recipient to be updated.
251
+ * @param recipient PayoutRecipients A PayoutRecipient object with updated
252
+ * parameters defined.
253
+ * @return PayoutRecipientInterface The updated recipient object.
254
+ */
255
+ updatePayoutRecipient(recipientId: string, recipient: PayoutRecipientInterface): Promise<PayoutRecipientInterface>;
256
+ /**
257
+ * Cancel a BitPay Payout recipient.
258
+ *
259
+ * @param recipientId String The id of the recipient to cancel.
260
+ * @return Boolean True if the delete operation was successful, false otherwise.
261
+ */
262
+ deletePayoutRecipient(recipientId: string): Promise<boolean>;
263
+ /**
264
+ * Request a payout recipient notification
265
+ *
266
+ * @param recipientId String A BitPay recipient ID.
267
+ * @return Boolean True if the notification was successfully sent, false otherwise.
268
+ */
269
+ requestPayoutRecipientNotification(recipientId: string): Promise<boolean>;
270
+ /**
271
+ * Submit a BitPay Payout.
272
+ *
273
+ * @param payout Payout A Payout object with request parameters defined.
274
+ * @return PayoutInterface A BitPay generated Payout object.
275
+ */
276
+ submitPayout(payout: PayoutInterface): Promise<PayoutInterface>;
277
+ /**
278
+ * Retrieve a BitPay payout by payout id using. The client must have been
279
+ * previously authorized for the payout facade.
280
+ *
281
+ * @param payoutId String The id of the payout to retrieve.
282
+ * @return PayoutInterface BitPay Payout object.
283
+ */
284
+ getPayout(payoutId: string): Promise<PayoutInterface>;
285
+ /**
286
+ * Retrieve a collection of BitPay payouts.
287
+ *
288
+ * @param params Available parameters:
289
+ * startDate String The start date for the query.
290
+ * endDate String The end date for the query.
291
+ * status String The status to filter(optional).
292
+ * reference String The optional reference specified at payout request creation.
293
+ * limit int Maximum results that the query will return (useful for
294
+ * paging results).
295
+ * offset int Offset for paging.
296
+ * @return A list of BitPay Payout objects.
297
+ * @param params
298
+ */
299
+ getPayouts(params?: {}): Promise<PayoutInterface[]>;
300
+ /**
301
+ * @see <a href="https://developer.bitpay.com/reference/create-payout-group">Create Payout Group</>
302
+ *
303
+ * @param payouts
304
+ */
305
+ submitPayouts(payouts: PayoutInterface[]): Promise<PayoutGroupInterface>;
306
+ /**
307
+ * @see <a href="https://developer.bitpay.com/reference/cancel-a-payout-group">Cancel a Payout Group</>
308
+ *
309
+ * @param payoutGroupId
310
+ */
311
+ cancelPayouts(payoutGroupId: string): Promise<PayoutGroupInterface>;
312
+ /**
313
+ * Request a payout notification
314
+ *
315
+ * @param payoutId String The id of the payout to notify..
316
+ * @return Boolean True if the notification was successfully sent, false otherwise.
317
+ */
318
+ requestPayoutNotification(payoutId: string): Promise<boolean>;
319
+ /**
320
+ * Cancel a BitPay Payout.
321
+ *
322
+ * @param payoutId String The id of the payout to cancel.
323
+ * @return Boolean True if the refund was successfully canceled, false otherwise.
324
+ */
325
+ cancelPayout(payoutId: string): Promise<boolean>;
326
+ /**
327
+ * Retrieve a list of ledgers using the merchant facade.
328
+ *
329
+ * @return array A list of Ledger objects populated with the currency and current balance of each one.
330
+ */
331
+ getLedgers(): Promise<LedgerInterface[]>;
332
+ /**
333
+ * Retrieve a list of ledgers entries by currency and date range using the merchant facade.
334
+ *
335
+ * @param currency The three digit currency string for the ledger to retrieve.
336
+ * @param dateStart The first date for the query filter.
337
+ * @param dateEnd The last date for the query filter.
338
+ * @return array Ledger entries list.
339
+ */
340
+ getLedgerEntries(currency: string, dateStart: Date | null, dateEnd: Date | null): Promise<LedgerEntryInterface[]>;
341
+ /**
342
+ * Create a BitPay Bill.
343
+ *
344
+ * @param bill A Bill object with request parameters defined.
345
+ * @param facade The facade used to create it.
346
+ * @param signRequest Signed request.
347
+ * @return BillInterface A BitPay generated Bill object.
348
+ */
349
+ createBill(bill: BillInterface, facade?: Facade, signRequest?: boolean): Promise<BillInterface>;
350
+ /**
351
+ * Retrieve a BitPay bill by bill id using the specified facade.
352
+ *
353
+ * @param billId The id of the bill to retrieve.
354
+ * @param facade The facade used to retrieve it.
355
+ * @param signRequest Signed request.
356
+ * @return BillInterface A BitPay Bill object.
357
+ */
358
+ getBill(billId: string, facade?: Facade, signRequest?: boolean): Promise<BillInterface>;
359
+ /**
360
+ * Retrieve a collection of BitPay bills.
361
+ *
362
+ * @param status The status to filter the bills.
363
+ * @return BillInterface A list of BitPay Bill objects.
364
+ */
365
+ getBills(status: string | null): Promise<BillInterface[]>;
366
+ /**
367
+ * Update a BitPay Bill.
368
+ *
369
+ * @param bill A Bill object with the parameters to update defined.
370
+ * @param billId The Id of the Bill to udpate.
371
+ * @return BillInterface An updated Bill object.
372
+ */
373
+ updateBill(bill: BillInterface, billId: string): Promise<BillInterface>;
374
+ /**
375
+ * Deliver a BitPay Bill.
376
+ *
377
+ * @param billId The id of the requested bill.
378
+ * @param billToken The token of the requested bill.
379
+ * @return Boolean A response status returned from the API.
380
+ */
381
+ deliverBill(billId: string, billToken: string): Promise<boolean>;
382
+ /**
383
+ * Retrieve all supported wallets.
384
+ *
385
+ * @return array A list of wallet objets.
386
+ */
387
+ getSupportedWallets(): Promise<WalletInterface[]>;
388
+ /**
389
+ * Retrieves a summary of the specified settlement.
390
+ *
391
+ * @param settlementId Settlement Id.
392
+ * @return SettlementInterface A BitPay Settlement object.
393
+ */
394
+ getSettlement(settlementId: string): Promise<SettlementInterface>;
395
+ /**
396
+ * Retrieves settlement reports for the calling merchant filtered by query.
397
+ * The `limit` and `offset` parameters
398
+ * specify pages for large query sets.
399
+ * @params params Available params:
400
+ * currency The three digit currency string for the ledger to retrieve.
401
+ * dateStart The start date for the query.
402
+ * dateEnd The end date for the query.
403
+ * status Can be `processing`, `completed`, or `failed`.
404
+ * limit Maximum number of settlements to retrieve.
405
+ * offset Offset for paging.
406
+ * @return array A list of BitPay Settlement objects.
407
+ */
408
+ getSettlements(params?: {}): Promise<SettlementInterface[]>;
409
+ /**
410
+ * Gets a detailed reconciliation report of the activity within the settlement period.
411
+ * Required id and settlement token.
412
+ *
413
+ * @param settlementId Settlement ID.
414
+ * @param token Settlement token.
415
+ * @return SettlementInterface A detailed BitPay Settlement object.
416
+ */
417
+ getSettlementReconciliationReport(settlementId: string, token: string): Promise<SettlementInterface>;
418
+ /**
419
+ * Gets info for specific currency.
420
+ *
421
+ * @param currencyCode String Currency code for which the info will be retrieved.
422
+ * @return CurrencyInterface|null Currency info.
423
+ */
424
+ getCurrencyInfo(currencyCode: string): Promise<CurrencyInterface | null>;
425
+ private getEcKeyByPrivateKey;
426
+ private getEcKeyByConfig;
427
+ private static getBaseUrl;
428
+ private getIdentity;
429
+ private createRateClient;
430
+ private getCurrencyClient;
431
+ private createInvoiceClient;
432
+ private createRefundClient;
433
+ private createPayoutRecipientClient;
434
+ private createPayoutClient;
435
+ private createPayoutGroupClient;
436
+ private createLedgerClient;
437
+ private createBillClient;
438
+ private createWalletClient;
439
+ private createSettlementClient;
440
+ private getFacadeBasedOnTokenContainer;
441
+ private static isSignRequest;
442
+ private static getDateAsString;
443
+ private initByConfigFilePath;
444
+ private initForTests;
445
+ }