Bridge adapter for DAI.

Hierarchy (view full)

Constructors

Properties

estimateGas: {
    approve: ((l1Token, l2Token, amount, opts?) => Promise<BigNumber>);
    deposit: ((l1Token, l2Token, amount, opts?) => Promise<BigNumber>);
    withdraw: ((l1Token, l2Token, amount, opts?) => Promise<BigNumber>);
} = ...

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

Type declaration

  • approve: ((l1Token, l2Token, amount, opts?) => Promise<BigNumber>)
      • (l1Token, l2Token, amount, opts?): Promise<BigNumber>
      • Parameters

        Returns Promise<BigNumber>

  • deposit: ((l1Token, l2Token, amount, opts?) => Promise<BigNumber>)
  • withdraw: ((l1Token, l2Token, amount, opts?) => Promise<BigNumber>)
      • (l1Token, l2Token, amount, opts?): Promise<BigNumber>
      • Parameters

        Returns Promise<BigNumber>

l1Bridge: Contract

L1 bridge contract.

l2Bridge: Contract

L2 bridge contract.

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

populateTransaction: {
    approve: ((l1Token, l2Token, amount, opts?) => Promise<TransactionRequest>);
    deposit: ((l1Token, l2Token, amount, opts?) => Promise<TransactionRequest>);
    withdraw: ((l1Token, l2Token, amount, opts?) => Promise<TransactionRequest>);
} = ...

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

Type declaration

  • approve: ((l1Token, l2Token, amount, opts?) => Promise<TransactionRequest>)
      • (l1Token, l2Token, amount, opts?): Promise<TransactionRequest>
      • Parameters

        Returns Promise<TransactionRequest>

  • deposit: ((l1Token, l2Token, amount, opts?) => Promise<TransactionRequest>)
      • (l1Token, l2Token, amount, opts?): Promise<TransactionRequest>
      • Parameters

        Returns Promise<TransactionRequest>

  • withdraw: ((l1Token, l2Token, amount, opts?) => Promise<TransactionRequest>)
      • (l1Token, l2Token, amount, opts?): Promise<TransactionRequest>
      • Parameters

        Returns Promise<TransactionRequest>

Methods

  • Queries the account's approval amount for a given L1 token.

    Parameters

    • l1Token: AddressLike

      The L1 token address.

    • l2Token: AddressLike

      The L2 token address.

    • signer: Signer

      Signer to query the approval for.

    Returns Promise<BigNumber>

    Amount of tokens approved for deposits from the account.

  • Approves a deposit into the L2 chain.

    Parameters

    • l1Token: AddressLike

      The L1 token address.

    • l2Token: AddressLike

      The L2 token address.

    • amount: NumberLike

      Amount of the token to approve.

    • signer: Signer

      Signer used to sign and send the transaction.

    • Optional opts: {
          overrides?: Overrides;
      }

      Additional options.

      • Optional overrides?: Overrides

    Returns Promise<TransactionResponse>

    Transaction response for the approval transaction.

  • Deposits some tokens into the L2 chain.

    Parameters

    • l1Token: AddressLike

      The L1 token address.

    • l2Token: AddressLike

      The L2 token address.

    • amount: NumberLike

      Amount of the token to deposit.

    • signer: Signer

      Signer used to sign and send the transaction.

    • Optional opts: {
          l2GasLimit?: NumberLike;
          overrides?: Overrides;
          recipient?: AddressLike;
      }

      Additional options.

    Returns Promise<TransactionResponse>

    Transaction response for the deposit transaction.

  • 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
      • Optional toBlock?: BlockTag

    Returns Promise<TokenBridgeMessage[]>

    All deposit token bridge messages sent by the given address.

  • 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
      • Optional toBlock?: BlockTag

    Returns Promise<TokenBridgeMessage[]>

    All withdrawal token bridge messages sent by the given address.

  • Checks whether the given token pair is supported by the bridge.

    Parameters

    Returns Promise<boolean>

    Whether the given token pair is supported by the bridge.

  • Withdraws some tokens back to the L1 chain.

    Parameters

    • l1Token: AddressLike

      The L1 token address.

    • l2Token: AddressLike

      The L2 token address.

    • amount: NumberLike

      Amount of the token to withdraw.

    • signer: Signer

      Signer used to sign and send the transaction.

    • Optional opts: {
          overrides?: Overrides;
          recipient?: AddressLike;
      }

      Additional options.

      • Optional overrides?: Overrides
      • Optional recipient?: AddressLike

    Returns Promise<TransactionResponse>

    Transaction response for the withdraw transaction.

Generated using TypeDoc