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.
Object that holds the functions that estimates the gas required for a given transaction. Follows the pattern used by ethers.js.
L1 bridge contract.
L2 bridge contract.
Provider used to make queries related to cross-chain interactions.
Object that holds the functions that generate transactions to be signed by the user. Follows the pattern used by ethers.js.
Gets all deposits for a given address.
Address to search for messages from.
Options object.
Block to start searching for messages from. If not provided, will start from the first block (block #0).
Block to stop searching for messages at. If not provided, will stop at the latest known block ("latest").
All deposit token bridge messages sent by the given address.
Gets all withdrawals for a given address.
Address to search for messages from.
Options object.
Block to start searching for messages from. If not provided, will start from the first block (block #0).
Block to stop searching for messages at. If not provided, will stop at the latest known block ("latest").
All withdrawal token bridge messages sent by the given address.
Checks whether the given token pair is supported by the bridge.
The L1 token address.
The L2 token address.
Whether the given token pair is supported by the bridge.
Generated using TypeDoc
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.