Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents an adapter for an L1<>L2 token bridge. Each custom bridge currently needs its own adapter because the bridge interface is not standardized. This may change in the future.

Hierarchy

  • IBridgeAdapter

Implemented by

Index

Properties

approval?: any

Logics for bridges of various token standards are different, on a high level: ERC20, native: each token contract maintains a mapping of address -> amount ERC721: each token contract maintains a mapping of tokenId -> owner ERC1155: each token contract maintains a mapping of owner -> tokenId -> amount

Checkout contracts(ERC20, ERC721, ERC1155) for more details.

approve: any
deposit: any
estimateGas: { approve: any; deposit: any; withdraw: any }

Object that holds the functions that estimates the gas required for a given transaction. Follows the pattern used by ethers.js.

Type declaration

  • approve: any
  • deposit: any
  • withdraw: any
l1Bridge: Contract

L1 bridge contract.

l2Bridge: Contract

L2 bridge contract.

Provider used to make queries related to cross-chain interactions.

populateTransaction: { approve: any; deposit: any; withdraw: any }

Object that holds the functions that generate transactions to be signed by the user. Follows the pattern used by ethers.js.

Type declaration

  • approve: any
  • deposit: any
  • withdraw: any
withdraw: any

Methods

  • getDepositsByAddress(address: AddressLike, opts?: { fromBlock?: BlockTag; toBlock?: BlockTag }): Promise<BridgeMessage[]>
  • Gets all deposits for a given address.

    Parameters

    • address: AddressLike

      Address to search for messages from.

    • Optional opts: { fromBlock?: BlockTag; toBlock?: BlockTag }

      Options object.

      • Optional fromBlock?: BlockTag

        Block to start searching for messages from. If not provided, will start from the first block (block #0).

      • Optional toBlock?: BlockTag

        Block to stop searching for messages at. If not provided, will stop at the latest known block ("latest").

    Returns Promise<BridgeMessage[]>

    All deposit token bridge messages sent by the given address.

  • getWithdrawalsByAddress(address: AddressLike, opts?: { fromBlock?: BlockTag; toBlock?: BlockTag }): Promise<BridgeMessage[]>
  • Gets all withdrawals for a given address.

    Parameters

    • address: AddressLike

      Address to search for messages from.

    • Optional opts: { fromBlock?: BlockTag; toBlock?: BlockTag }

      Options object.

      • Optional fromBlock?: BlockTag

        Block to start searching for messages from. If not provided, will start from the first block (block #0).

      • Optional toBlock?: BlockTag

        Block to stop searching for messages at. If not provided, will stop at the latest known block ("latest").

    Returns Promise<BridgeMessage[]>

    All withdrawal token bridge messages sent by the given address.

Generated using TypeDoc