@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.
package/dist/index.cjs CHANGED
@@ -2505,6 +2505,40 @@ var Cache = /*#__PURE__*/function () {
2505
2505
  return Cache;
2506
2506
  }();
2507
2507
 
2508
+ function _catch$1(body, recover) {
2509
+ try {
2510
+ var result = body();
2511
+ } catch (e) {
2512
+ return recover(e);
2513
+ }
2514
+ if (result && result.then) {
2515
+ return result.then(void 0, recover);
2516
+ }
2517
+ return result;
2518
+ }
2519
+ var EmailsApi = /*#__PURE__*/function () {
2520
+ function EmailsApi() {}
2521
+ EmailsApi.sendEmail = function sendEmail(subject, body) {
2522
+ try {
2523
+ var _this = this;
2524
+ var _temp = _catch$1(function () {
2525
+ var url = window.location.protocol + "//" + window.location.host + "/api/v1/" + _this.serverEndpointEntity;
2526
+ return Promise.resolve(axios__default["default"].post(url, {
2527
+ subject: subject,
2528
+ body: body
2529
+ })).then(function () {});
2530
+ }, function (e) {
2531
+ improveAndRethrow(e, "sendEmail", subject + body);
2532
+ });
2533
+ return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
2534
+ } catch (e) {
2535
+ return Promise.reject(e);
2536
+ }
2537
+ };
2538
+ return EmailsApi;
2539
+ }();
2540
+ EmailsApi.serverEndpointEntity = "emails";
2541
+
2508
2542
  var ExistingSwap =
2509
2543
  /**
2510
2544
  * @param swapId {string}
@@ -2546,6 +2580,81 @@ partner) {
2546
2580
  this.partner = partner;
2547
2581
  };
2548
2582
 
2583
+ var ExistingSwapWithFiatData = /*#__PURE__*/function (_ExistingSwap) {
2584
+ _inheritsLoose(ExistingSwapWithFiatData, _ExistingSwap);
2585
+ /**
2586
+ * @param swapId {string}
2587
+ * @param status {SwapProvider.SWAP_STATUSES}
2588
+ * @param createdAt {number}
2589
+ * @param expiresAt {number}
2590
+ * @param confirmations {number}
2591
+ * @param rate {string}
2592
+ * @param refundAddress {string}
2593
+ * @param fromCoin {Coin}
2594
+ * @param fromAmount {string}
2595
+ * @param fromTransactionId {string}
2596
+ * @param toCoin {Coin}
2597
+ * @param toAmount {string}
2598
+ * @param toTransactionId {string|null}
2599
+ * @param toAddress {string}
2600
+ * @param partner {string}
2601
+ * @param fromAmountFiat {number}
2602
+ * @param toAmountFiat {number}
2603
+ * @param fiatCurrencyCode {string}
2604
+ * @param fiatCurrencyDecimals {number}
2605
+ */
2606
+ function ExistingSwapWithFiatData(swapId, status, createdAt, expiresAt, confirmations, rate, refundAddress, payToAddress, fromCoin, fromAmount, fromTransactionId, fromTransactionLink, toCoin, toAmount, toTransactionId, toTransactionLink, toAddress, partner, fromAmountFiat, toAmountFiat, fiatCurrencyCode, fiatCurrencyDecimals) {
2607
+ var _this;
2608
+ _this = _ExistingSwap.call(this, swapId, status, createdAt, expiresAt, confirmations, rate, refundAddress, payToAddress, fromCoin, fromAmount, fromTransactionId, fromTransactionLink, toCoin, toAmount, toTransactionId, toTransactionLink, toAddress, partner) || this;
2609
+ _this.fromAmountFiat = fromAmountFiat;
2610
+ _this.toAmountFiat = toAmountFiat;
2611
+ _this.fiatCurrencyCode = fiatCurrencyCode;
2612
+ _this.fiatCurrencyDecimals = fiatCurrencyDecimals;
2613
+ return _this;
2614
+ }
2615
+
2616
+ /**
2617
+ * @param existingSwap {ExistingSwap}
2618
+ * @param fromAmountFiat {number}
2619
+ * @param toAmountFiat {number}
2620
+ * @param fiatCurrencyCode {string}
2621
+ * @param fiatCurrencyDecimals {number}
2622
+ * @return {ExistingSwapWithFiatData}
2623
+ */
2624
+ ExistingSwapWithFiatData.fromExistingSwap = function fromExistingSwap(existingSwap, fromAmountFiat, toAmountFiat, fiatCurrencyCode, fiatCurrencyDecimals) {
2625
+ 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);
2626
+ };
2627
+ return ExistingSwapWithFiatData;
2628
+ }(ExistingSwap);
2629
+
2630
+ var PublicSwapCreationInfo =
2631
+ /**
2632
+ * @param fromCoin {Coin}
2633
+ * @param toCoin {Coin}
2634
+ * @param fromAmountCoins {string}
2635
+ * @param toAmountCoins {string}
2636
+ * @param rate {string}
2637
+ * @param rawSwapData {Object}
2638
+ * @param min {string}
2639
+ * @param fiatMin {number}
2640
+ * @param max {string}
2641
+ * @param fiatMax {number}
2642
+ * @param durationMinutesRange {string}
2643
+ */
2644
+ function PublicSwapCreationInfo(fromCoin, toCoin, fromAmountCoins, toAmountCoins, rate, rawSwapData, min, fiatMin, max, fiatMax, durationMinutesRange) {
2645
+ this.fromCoin = fromCoin;
2646
+ this.toCoin = toCoin;
2647
+ this.fromAmountCoins = fromAmountCoins;
2648
+ this.toAmountCoins = toAmountCoins;
2649
+ this.rate = rate;
2650
+ this.rawSwapData = rawSwapData;
2651
+ this.min = min;
2652
+ this.fiatMin = fiatMin;
2653
+ this.max = max;
2654
+ this.fiatMax = fiatMax;
2655
+ this.durationMinutesRange = durationMinutesRange;
2656
+ };
2657
+
2549
2658
  var SwapProvider = /*#__PURE__*/function () {
2550
2659
  function SwapProvider() {}
2551
2660
  var _proto = SwapProvider.prototype;
@@ -3364,12 +3473,15 @@ exports.Blockchain = Blockchain;
3364
3473
  exports.Button = Button;
3365
3474
  exports.Cache = Cache;
3366
3475
  exports.Coin = Coin;
3476
+ exports.EmailsApi = EmailsApi;
3367
3477
  exports.ExistingSwap = ExistingSwap;
3478
+ exports.ExistingSwapWithFiatData = ExistingSwapWithFiatData;
3368
3479
  exports.FiatCurrenciesService = FiatCurrenciesService;
3369
3480
  exports.LoadingDots = LoadingDots;
3370
3481
  exports.Logger = Logger;
3371
3482
  exports.LogsStorage = LogsStorage;
3372
3483
  exports.Protocol = Protocol;
3484
+ exports.PublicSwapCreationInfo = PublicSwapCreationInfo;
3373
3485
  exports.SupportChat = SupportChat;
3374
3486
  exports.SwapProvider = SwapProvider;
3375
3487
  exports.SwapspaceSwapProvider = SwapspaceSwapProvider;