Class for finding wrapped tokens on EVM chains

With code 'UNSUPPORTED_CHAIN_ID' if chain ID is not supported

With code 'INVALID_ADDRESS' if token address is invalid

With code 'CONTRACT_NOT_FOUND' if token contract doesn't exist

Constructors

Methods

  • Finds native ETH and WETH addresses for given chain IDs

    Parameters

    • targetChainIds: number[]

      Array of supported chain IDs

    Returns Promise<Record<number, EvmTokenPair>>

    With code 'UNSUPPORTED_CHAIN_ID' if any chain ID is not supported

  • Finds wrapped token addresses across different chains

    Parameters

    • tokenAddress: string

      Token address on source chain

    • sourceChainId: number

      Chain ID where token exists

    • targetChainIds: number[]

      Chain IDs to find wrapped versions

    Returns Promise<Record<number, EvmTokenPair>>

    Map of chain IDs to token addresses

    With various error codes for different failure cases

  • Finds the wrapped assets for the given chain IDs

    Parameters

    • targetChainIds: number[]

      The chain IDs to find wrapped assets for

    Returns Promise<Record<number, EvmTokenPair>>

    An object with the wrapped assets for each chain ID or false if not found

  • Finds the native address for the given chain ID

    Parameters

    • chain: string

      The chain to find the native address for

    • targetChainId: number

      The chain ID to find the native address for

    Returns string

    The native address for the given chain ID