const getBaseBlockExplorerUrl = (chain) => {
    const result = chain.blockExplorers?.['blockscout']?.url ||
        chain.blockExplorers?.default?.url ||
        '';
    // trim / at the end
    return result.endsWith('/') ? result.slice(0, -1) : result;
};
export const getBlockExplorerAddressLink = (chain, address) => {
    return `${getBaseBlockExplorerUrl(chain)}/address/${address}`;
};
export const getBlockExplorerTxHashLink = (chain, txHash) => {
    return `${getBaseBlockExplorerUrl(chain)}/tx/${txHash}`;
};
