UNPKG

@tristeroresearch/mach-sdk

Version:

A TypeScript SDK for integrating with Mach's API.

10 lines (9 loc) 411 B
import { SOLANA_CHAIN_ID } from '../chains/solana/utils'; import { supportedChains } from '../configs/supportedChains'; export const getBlockExplorerUrlFromId = (chainId) => { if (chainId === SOLANA_CHAIN_ID) { return 'https://solscan.io/tx/'; } const chainInfo = supportedChains.find((chain) => +chain.id === +chainId); return `${chainInfo?.blockExplorers['default'].url || ''}/tx`; };