@reservoir0x/relay-kit-ui
Version:
Relay is the Fastest and Cheapest Way to Bridge and Transact Across Chains.
11 lines • 465 B
JavaScript
const getChainBlockExplorerUrl = (chainId, chains) => {
let blockExplorerUrl = chains?.find((chain) => chain.id === chainId)?.explorerUrl ||
'https://etherscan.io';
// Ensure the URL does not end with a trailing slash
if (blockExplorerUrl.endsWith('/')) {
blockExplorerUrl = blockExplorerUrl.slice(0, -1);
}
return blockExplorerUrl;
};
export default getChainBlockExplorerUrl;
//# sourceMappingURL=getChainBlockExplorerUrl.js.map