UNPKG

@fireblocks/fireblocks-web3-provider

Version:
22 lines 675 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.promiseToFunction = exports.getAssetByChain = void 0; const constants_1 = require("./constants"); function getAssetByChain(chain) { return constants_1.ASSETS[chain]; } exports.getAssetByChain = getAssetByChain; function promiseToFunction(func) { let exceptionThrown = false; const promise = func().catch((e) => { exceptionThrown = true; return e; }); return async () => { const result = await promise; if (exceptionThrown) throw result; }; } exports.promiseToFunction = promiseToFunction; //# sourceMappingURL=utils.js.map