A ChainContext for the EVM platform

Type Parameters

  • N extends Network = Network

  • C extends Chain = EvmChains

Hierarchy

Properties

supportsAutomaticCircleBridge: (() => boolean)

Type declaration

    • (): boolean
    • Check to see if the Automatic Circle Bridge protocol is supported by this chain

      Returns boolean

      a boolean indicating if this chain supports the Automatic Circle Bridge protocol

supportsAutomaticTokenBridge: (() => boolean)

Type declaration

    • (): boolean
    • Check to see if the Automatic Token Bridge protocol is supported by this chain

      Returns boolean

      a boolean indicating if this chain supports the Automatic Token Bridge protocol

supportsCircleBridge: (() => boolean)

Type declaration

    • (): boolean
    • Check to see if the Circle Bridge protocol is supported by this chain

      Returns boolean

      a boolean indicating if this chain supports the Circle Bridge protocol

supportsIbcBridge: (() => boolean)

Type declaration

    • (): boolean
    • Check to see if the IBC Bridge protocol is supported by this chain

      Returns boolean

      a boolean indicating if this chain supports the IBC Bridge protocol

supportsPorticoBridge: (() => boolean)

Type declaration

    • (): boolean
    • Check to see if the Portico Bridge protocol is supported by this chain

      Returns boolean

      a boolean indicating if this chain supports the Portico Bridge protocol

supportsTokenBridge: (() => boolean)

Type declaration

    • (): boolean
    • Check to see if the Token Bridge protocol is supported by this chain

      Returns boolean

      a boolean indicating if this chain supports the Token Bridge protocol

supportsWormholeCore: (() => boolean)

Type declaration

    • (): boolean
    • Check to see if the Wormhole Core protocol is supported by this chain

      Returns boolean

      a boolean indicating if this chain supports the Wormhole Core protocol

Methods

  • Get the balance of a token for a given address

    Parameters

    • walletAddr: string

      the address to get the balance for

    • token: TokenAddress<C>

      the token to get the balance for

    Returns Promise<null | bigint>

    the balance of the token for the address

  • Get the Circle Bridge protocol client for this chain

    Returns Promise<CircleBridge<N, C>>

    the Circle Bridge protocol client for this chain

  • Get the number of decimals for a token

    Parameters

    Returns Promise<number>

    the number of decimals for the token

  • Get the IBC Bridge protocol client for this chain

    Returns Promise<IbcBridge<N, C>>

    the IBC Bridge protocol client for this chain

  • Get the latest block number seen by the chain according to the RPC

    Returns Promise<number>

    the latest block number

  • Get the latest finalized block number seen by the chain according to the RPC

    Returns Promise<number>

    the latest finalized block number

  • Get the token id of the wrapped token for the native gas token

    Returns Promise<TokenId<C>>

    the wrapped token for the native gas token

  • Get the Portico Bridge protocol client for this chain

    Returns Promise<PorticoBridge<N, C>>

    the Portico Bridge protocol client for this chain

  • Get an RPC connection for this chain, uses the configuration passed in the initial constructor

    Returns Promise<any>

    the RPC connection for this chain

  • Get the token data from the local cache if available

    Parameters

    • symbol: string

      the symbol of the token to get

    Returns undefined | Token

    the token data if available

  • Get the token account for a given address and token

    Parameters

    Returns Promise<ChainAddress<C>>

    the token account for the address and token

    Remarks

    This is really only useful in the context of Solana but in order to provide a consistent interface, we provide it here.

  • Get the Token Bridge protocol client for this chain

    Returns Promise<TokenBridge<N, C>>

    the Token Bridge protocol client for this chain

  • Get the Wormhole Core protocol client for this chain

    Returns Promise<WormholeCore<N, C>>

    the Wormhole Core protocol client for this chain

  • Parse the Wormhole Core messages from a transaction

    Parameters

    • txid: string

      the transaction to parse

    Returns Promise<WormholeMessageId[]>

    the Wormhole Core messages emitted by the transaction

  • Send a transaction and wait for it to be confirmed

    Parameters

    • stxns: any[]

      the signed transaction to send

    Returns Promise<string[]>

    the transaction hashes of the sent transactions

  • Check to see if a given protocol is supported by this chain by checking if it is registered in the platform and the configuration is available and correct

    Parameters

    • protocolName: keyof ProtocolToPlatformMapping

      the name of the Protocol to check for support

    Returns boolean

    a boolean indicating if this protocol is supported

Generated using TypeDoc