Documentation
    Preparing search index...
    • Create a flash loan transaction in the PTB (Programmable Transaction Block)

      This function initiates a flash loan by borrowing the specified amount of assets. The borrowed assets must be repaid within the same transaction using repayFlashLoanPTB.

      Parameters

      • tx: Transaction

        The transaction block to add the flash loan operation to

      • identifier: AssetIdentifier

        Asset identifier to borrow

      • amount: number | TransactionResult

        Amount to borrow (number or transaction result)

      • Optionaloptions: Partial<EnvOption>

        Optional environment configuration

      Returns Promise<{ $kind: "NestedResult"; NestedResult: [number, number] }[]>

      Tuple containing [balance, receipt] where receipt is needed for repayment

      Error if the pool does not support flash loans