Documentation
    Preparing search index...

    FlashLoanContract class for managing flash loans.

    Index

    Constructors

    Methods

    • Parameters

      • poolKey: string

        The key to identify the pool

      • borrowAmount: number

        The amount to borrow

      Returns (
          tx: Transaction,
      ) => readonly [
          { $kind: "NestedResult"; NestedResult: [number, number] },
          { $kind: "NestedResult"; NestedResult: [number, number] },
      ]

      A function that takes a Transaction object

      Borrow base asset from the pool

    • Parameters

      • poolKey: string

        The key to identify the pool

      • borrowAmount: number

        The amount to borrow

      Returns (
          tx: Transaction,
      ) => readonly [
          { $kind: "NestedResult"; NestedResult: [number, number] },
          { $kind: "NestedResult"; NestedResult: [number, number] },
      ]

      A function that takes a Transaction object

      Borrow quote asset from the pool

    • Parameters

      • poolKey: string

        The key to identify the pool

      • borrowAmount: number

        The amount of the base asset to return

      • baseCoinInput: TransactionObjectArgument

        Coin object representing the base asset to be returned

      • flashLoan: TransactionObjectArgument

        FlashLoan object representing the loan to be settled

      Returns (tx: Transaction) => TransactionObjectArgument

      A function that takes a Transaction object

      Return base asset to the pool after a flash loan.

    • Parameters

      • poolKey: string

        The key to identify the pool

      • borrowAmount: number

        The amount of the quote asset to return

      • quoteCoinInput: TransactionObjectArgument

        Coin object representing the quote asset to be returned

      • flashLoan: TransactionObjectArgument

        FlashLoan object representing the loan to be settled

      Returns (tx: Transaction) => TransactionObjectArgument

      A function that takes a Transaction object

      Return quote asset to the pool after a flash loan.