@fireblocks/fireblocks-web3-provider
Version:
EIP-1193 Compatible Ethereum provider for Fireblocks
22 lines • 675 B
JavaScript
;
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