@lifi/widget
Version:
LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.
25 lines • 879 B
JavaScript
import { isUTXOAddress } from '@bigmi/core';
import { ChainId, ChainType, isSVMAddress } from '@lifi/sdk';
import { isValidSuiAddress } from '@mysten/sui/utils';
import { isAddress as isEVMAddress } from 'viem';
const chainTypeAddressValidation = {
[]: isEVMAddress,
[]: isSVMAddress,
[]: isValidSuiAddress,
[]: isUTXOAddress,
};
export const getChainTypeFromAddress = (address) => {
for (const chainType in chainTypeAddressValidation) {
const isChainType = chainTypeAddressValidation[chainType](address);
if (isChainType) {
return chainType;
}
}
};
export const defaultChainIdsByType = {
[]: ChainId.ETH,
[]: ChainId.SOL,
[]: ChainId.BTC,
[]: ChainId.SUI,
};
//# sourceMappingURL=chainType.js.map