UNPKG

@subasshrestha/zebec-wormhole-sdk

Version:

This sdk can be use to transfer assets across chains and to interact with the Zebec's xchain bridge smart contracts for passing message from EVM chain to solana specially to utilize the features of Zebec Streaming and Zebec Multisig Streaming protocol.

34 lines (33 loc) 991 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getRelayerFee = getRelayerFee; var _utils = require("../utils"); async function getRelayerFee({ address, symbol }) { let tokenToUsd; let relayerFee; try { if (symbol == "SOL") { tokenToUsd = (await (await fetch((0, _utils.getCoinGeckoApi)(symbol))).json())[address]["usd"]; relayerFee = 2 / tokenToUsd * 1e9; return relayerFee; } else if (symbol == "BNB") { tokenToUsd = (await (await fetch((0, _utils.getCoinGeckoApi)(symbol))).json())[address]["usd"]; relayerFee = 2 / tokenToUsd * 1e18; return relayerFee; } else if (symbol == "USDC") { tokenToUsd = (await (await fetch((0, _utils.getCoinGeckoApi)(symbol))).json())[address]["usd"]; relayerFee = 2 / tokenToUsd * 1e18; return relayerFee; } else { throw new _utils.NotSupportedError(); } } catch (e) { throw e; } } //# sourceMappingURL=relayerFee.js.map