UNPKG

soso-widget

Version:

LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.

22 lines 750 B
import { isUTXOAddress } from '@bigmi/core'; import { ChainId, ChainType, isSVMAddress } from '@lifi/sdk'; import { isAddress as isEVMAddress } from 'viem'; const chainTypeAddressValidation = { [ChainType.EVM]: isEVMAddress, [ChainType.SVM]: isSVMAddress, [ChainType.UTXO]: isUTXOAddress, }; export const getChainTypeFromAddress = (address) => { for (const chainType in chainTypeAddressValidation) { const isChainType = chainTypeAddressValidation[chainType](address); if (isChainType) { return chainType; } } }; export const defaultChainIdsByType = { [ChainType.EVM]: ChainId.ETH, [ChainType.SVM]: ChainId.SOL, [ChainType.UTXO]: ChainId.BTC, }; //# sourceMappingURL=chainType.js.map