@rabbitio/ui-kit 1.0.0-beta.12 → 1.0.0-beta.13

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.
@@ -2500,6 +2500,40 @@ var Cache = /*#__PURE__*/function () {
2500
2500
  return Cache;
2501
2501
  }();
2502
2502
 
2503
+ function _catch$1(body, recover) {
2504
+ try {
2505
+ var result = body();
2506
+ } catch (e) {
2507
+ return recover(e);
2508
+ }
2509
+ if (result && result.then) {
2510
+ return result.then(void 0, recover);
2511
+ }
2512
+ return result;
2513
+ }
2514
+ var EmailsApi = /*#__PURE__*/function () {
2515
+ function EmailsApi() {}
2516
+ EmailsApi.sendEmail = function sendEmail(subject, body) {
2517
+ try {
2518
+ var _this = this;
2519
+ var _temp = _catch$1(function () {
2520
+ var url = window.location.protocol + "//" + window.location.host + "/api/v1/" + _this.serverEndpointEntity;
2521
+ return Promise.resolve(axios.post(url, {
2522
+ subject: subject,
2523
+ body: body
2524
+ })).then(function () {});
2525
+ }, function (e) {
2526
+ improveAndRethrow(e, "sendEmail", subject + body);
2527
+ });
2528
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
2529
+ } catch (e) {
2530
+ return Promise.reject(e);
2531
+ }
2532
+ };
2533
+ return EmailsApi;
2534
+ }();
2535
+ EmailsApi.serverEndpointEntity = "emails";
2536
+
2503
2537
  var ExistingSwap =
2504
2538
  /**
2505
2539
  * @param swapId {string}
@@ -2541,6 +2575,81 @@ partner) {
2541
2575
  this.partner = partner;
2542
2576
  };
2543
2577
 
2578
+ var ExistingSwapWithFiatData = /*#__PURE__*/function (_ExistingSwap) {
2579
+ _inheritsLoose(ExistingSwapWithFiatData, _ExistingSwap);
2580
+ /**
2581
+ * @param swapId {string}
2582
+ * @param status {SwapProvider.SWAP_STATUSES}
2583
+ * @param createdAt {number}
2584
+ * @param expiresAt {number}
2585
+ * @param confirmations {number}
2586
+ * @param rate {string}
2587
+ * @param refundAddress {string}
2588
+ * @param fromCoin {Coin}
2589
+ * @param fromAmount {string}
2590
+ * @param fromTransactionId {string}
2591
+ * @param toCoin {Coin}
2592
+ * @param toAmount {string}
2593
+ * @param toTransactionId {string|null}
2594
+ * @param toAddress {string}
2595
+ * @param partner {string}
2596
+ * @param fromAmountFiat {number}
2597
+ * @param toAmountFiat {number}
2598
+ * @param fiatCurrencyCode {string}
2599
+ * @param fiatCurrencyDecimals {number}
2600
+ */
2601
+ function ExistingSwapWithFiatData(swapId, status, createdAt, expiresAt, confirmations, rate, refundAddress, payToAddress, fromCoin, fromAmount, fromTransactionId, fromTransactionLink, toCoin, toAmount, toTransactionId, toTransactionLink, toAddress, partner, fromAmountFiat, toAmountFiat, fiatCurrencyCode, fiatCurrencyDecimals) {
2602
+ var _this;
2603
+ _this = _ExistingSwap.call(this, swapId, status, createdAt, expiresAt, confirmations, rate, refundAddress, payToAddress, fromCoin, fromAmount, fromTransactionId, fromTransactionLink, toCoin, toAmount, toTransactionId, toTransactionLink, toAddress, partner) || this;
2604
+ _this.fromAmountFiat = fromAmountFiat;
2605
+ _this.toAmountFiat = toAmountFiat;
2606
+ _this.fiatCurrencyCode = fiatCurrencyCode;
2607
+ _this.fiatCurrencyDecimals = fiatCurrencyDecimals;
2608
+ return _this;
2609
+ }
2610
+
2611
+ /**
2612
+ * @param existingSwap {ExistingSwap}
2613
+ * @param fromAmountFiat {number}
2614
+ * @param toAmountFiat {number}
2615
+ * @param fiatCurrencyCode {string}
2616
+ * @param fiatCurrencyDecimals {number}
2617
+ * @return {ExistingSwapWithFiatData}
2618
+ */
2619
+ ExistingSwapWithFiatData.fromExistingSwap = function fromExistingSwap(existingSwap, fromAmountFiat, toAmountFiat, fiatCurrencyCode, fiatCurrencyDecimals) {
2620
+ return new ExistingSwapWithFiatData(existingSwap.swapId, existingSwap.status, existingSwap.createdAt, existingSwap.expiresAt, existingSwap.confirmations, existingSwap.rate, existingSwap.refundAddress, existingSwap.payToAddress, existingSwap.fromCoin, existingSwap.fromAmount, existingSwap.fromTransactionId, existingSwap.fromTransactionLink, existingSwap.toCoin, existingSwap.toAmount, existingSwap.toTransactionId, existingSwap.toTransactionLink, existingSwap.toAddress, existingSwap.partner, fromAmountFiat, toAmountFiat, fiatCurrencyCode, fiatCurrencyDecimals);
2621
+ };
2622
+ return ExistingSwapWithFiatData;
2623
+ }(ExistingSwap);
2624
+
2625
+ var PublicSwapCreationInfo =
2626
+ /**
2627
+ * @param fromCoin {Coin}
2628
+ * @param toCoin {Coin}
2629
+ * @param fromAmountCoins {string}
2630
+ * @param toAmountCoins {string}
2631
+ * @param rate {string}
2632
+ * @param rawSwapData {Object}
2633
+ * @param min {string}
2634
+ * @param fiatMin {number}
2635
+ * @param max {string}
2636
+ * @param fiatMax {number}
2637
+ * @param durationMinutesRange {string}
2638
+ */
2639
+ function PublicSwapCreationInfo(fromCoin, toCoin, fromAmountCoins, toAmountCoins, rate, rawSwapData, min, fiatMin, max, fiatMax, durationMinutesRange) {
2640
+ this.fromCoin = fromCoin;
2641
+ this.toCoin = toCoin;
2642
+ this.fromAmountCoins = fromAmountCoins;
2643
+ this.toAmountCoins = toAmountCoins;
2644
+ this.rate = rate;
2645
+ this.rawSwapData = rawSwapData;
2646
+ this.min = min;
2647
+ this.fiatMin = fiatMin;
2648
+ this.max = max;
2649
+ this.fiatMax = fiatMax;
2650
+ this.durationMinutesRange = durationMinutesRange;
2651
+ };
2652
+
2544
2653
  var SwapProvider = /*#__PURE__*/function () {
2545
2654
  function SwapProvider() {}
2546
2655
  var _proto = SwapProvider.prototype;
@@ -3353,5 +3462,5 @@ var SwapspaceSwapProvider = /*#__PURE__*/function (_SwapProvider) {
3353
3462
  return SwapspaceSwapProvider;
3354
3463
  }(SwapProvider);
3355
3464
 
3356
- export { AmountUtils, AssetIcon, Blockchain, Button, Cache, Coin, ExistingSwap, FiatCurrenciesService, LoadingDots, Logger, LogsStorage, Protocol, SupportChat, SwapProvider, SwapspaceSwapProvider, improveAndRethrow, safeStringify };
3465
+ export { AmountUtils, AssetIcon, Blockchain, Button, Cache, Coin, EmailsApi, ExistingSwap, ExistingSwapWithFiatData, FiatCurrenciesService, LoadingDots, Logger, LogsStorage, Protocol, PublicSwapCreationInfo, SupportChat, SwapProvider, SwapspaceSwapProvider, improveAndRethrow, safeStringify };
3357
3466
  //# sourceMappingURL=index.module.js.map