@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.
- package/dist/index.cjs +37 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +20 -0
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +37 -0
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +37 -0
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/swaps-lib/services/publicSwapService.js +25 -0
package/dist/index.umd.js
CHANGED
|
@@ -4447,6 +4447,43 @@
|
|
|
4447
4447
|
} catch (e) {
|
|
4448
4448
|
improveAndRethrow(e, "isAddressValidForAsset");
|
|
4449
4449
|
}
|
|
4450
|
+
}
|
|
4451
|
+
|
|
4452
|
+
/**
|
|
4453
|
+
* Retrieves token by contract address.
|
|
4454
|
+
*
|
|
4455
|
+
* @param addressString {string}
|
|
4456
|
+
* @return {Promise<Coin|null>}
|
|
4457
|
+
*/;
|
|
4458
|
+
_proto.getTokenByContractAddress = function getTokenByContractAddress(addressString) {
|
|
4459
|
+
try {
|
|
4460
|
+
var _exit3;
|
|
4461
|
+
var _this12 = this;
|
|
4462
|
+
var _temp9 = _catch(function () {
|
|
4463
|
+
if (!addressString) {
|
|
4464
|
+
var _temp8 = null;
|
|
4465
|
+
_exit3 = 1;
|
|
4466
|
+
return _temp8;
|
|
4467
|
+
}
|
|
4468
|
+
var addressLowerCase = addressString.toLowerCase();
|
|
4469
|
+
return Promise.resolve(_this12._swapProvider.getAllSupportedCurrencies()).then(function (allCoins) {
|
|
4470
|
+
if (allCoins.result) {
|
|
4471
|
+
var _allCoins$coins$find = allCoins.coins.find(function (coin) {
|
|
4472
|
+
return coin.tokenAddress && coin.tokenAddress.toLowerCase() === addressLowerCase;
|
|
4473
|
+
});
|
|
4474
|
+
_exit3 = 1;
|
|
4475
|
+
return _allCoins$coins$find;
|
|
4476
|
+
}
|
|
4477
|
+
});
|
|
4478
|
+
}, function (e) {
|
|
4479
|
+
Logger.logError(e, "getTokenByContractAddress");
|
|
4480
|
+
});
|
|
4481
|
+
return Promise.resolve(_temp9 && _temp9.then ? _temp9.then(function (_result13) {
|
|
4482
|
+
return _exit3 ? _result13 : null;
|
|
4483
|
+
}) : _exit3 ? _temp9 : null);
|
|
4484
|
+
} catch (e) {
|
|
4485
|
+
return Promise.reject(e);
|
|
4486
|
+
}
|
|
4450
4487
|
};
|
|
4451
4488
|
return PublicSwapService;
|
|
4452
4489
|
}();
|