@rabbitio/ui-kit 1.0.0-beta.28 → 1.0.0-beta.29

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.
@@ -4441,6 +4441,43 @@ var PublicSwapService = /*#__PURE__*/function () {
4441
4441
  } catch (e) {
4442
4442
  improveAndRethrow(e, "isAddressValidForAsset");
4443
4443
  }
4444
+ }
4445
+
4446
+ /**
4447
+ * Retrieves token by contract address.
4448
+ *
4449
+ * @param addressString {string}
4450
+ * @return {Promise<Coin|null>}
4451
+ */;
4452
+ _proto.getTokenByContractAddress = function getTokenByContractAddress(addressString) {
4453
+ try {
4454
+ var _exit3;
4455
+ var _this12 = this;
4456
+ var _temp9 = _catch(function () {
4457
+ if (!addressString) {
4458
+ var _temp8 = null;
4459
+ _exit3 = 1;
4460
+ return _temp8;
4461
+ }
4462
+ var addressLowerCase = addressString.toLowerCase();
4463
+ return Promise.resolve(_this12._swapProvider.getAllSupportedCurrencies()).then(function (allCoins) {
4464
+ if (allCoins.result) {
4465
+ var _allCoins$coins$find = allCoins.coins.find(function (coin) {
4466
+ return coin.tokenAddress && coin.tokenAddress.toLowerCase() === addressLowerCase;
4467
+ });
4468
+ _exit3 = 1;
4469
+ return _allCoins$coins$find;
4470
+ }
4471
+ });
4472
+ }, function (e) {
4473
+ Logger.logError(e, "getTokenByContractAddress");
4474
+ });
4475
+ return Promise.resolve(_temp9 && _temp9.then ? _temp9.then(function (_result13) {
4476
+ return _exit3 ? _result13 : null;
4477
+ }) : _exit3 ? _temp9 : null);
4478
+ } catch (e) {
4479
+ return Promise.reject(e);
4480
+ }
4444
4481
  };
4445
4482
  return PublicSwapService;
4446
4483
  }();