@lifi/sdk
Version:
LI.FI Any-to-Any Cross-Chain-Swap SDK
84 lines (77 loc) • 2.02 kB
text/typescript
import { ChainId, ChainType } from '@lifi/types'
import type { Address } from 'viem'
export const UNS_PROXY_READER_ADDRESSES: Record<number, Address> = {
[]: '0x578853aa776Eef10CeE6c4dd2B5862bdcE767A8B',
[]: '0x91EDd8708062bd4233f4Dd0FCE15A7cb4d500091',
} as const
export const getUNSProxyAddress = (chainId: number): Address | undefined =>
UNS_PROXY_READER_ADDRESSES[chainId]
export const UNSProxyReaderABI = [
{
constant: true,
inputs: [
{
internalType: 'string[]',
name: 'keys',
type: 'string[]',
},
{
internalType: 'uint256',
name: 'tokenId',
type: 'uint256',
},
],
name: 'getData',
outputs: [
{
internalType: 'address',
name: 'resolver',
type: 'address',
},
{
internalType: 'address',
name: 'owner',
type: 'address',
},
{
internalType: 'string[]',
name: 'values',
type: 'string[]',
},
],
payable: false,
stateMutability: 'view',
type: 'function',
},
{
inputs: [{ internalType: 'uint256', name: 'tokenId', type: 'uint256' }],
name: 'exists',
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
stateMutability: 'view',
type: 'function',
},
] as const
export const CHAIN_TYPE_UNS_CHAIN_MAP: Record<ChainType, string> = {
[]: 'ETH',
[]: 'SUI',
[]: 'SOL',
[]: 'BTC',
[]: 'TRON',
}
export const CHAIN_ID_UNS_CHAIN_MAP: Partial<Record<ChainId, string>> = {
[]: 'ETH',
[]: 'BTC',
[]: 'SUI',
[]: 'SOL',
[]: 'BASE',
[]: 'MATIC',
[]: 'ARB1',
[]: 'AVAX',
}
export const CHAIN_TYPE_FAMILY_MAP: Record<ChainType, string> = {
[]: 'EVM',
[]: 'BTC',
[]: 'SOL',
[]: 'SUI',
[]: 'TRON',
}