Skip to main content

FlashCashHelper

@totemsdk/core


@totemsdk/core / FlashCashHelper

Class: FlashCashHelper

Flash Cash Helper

Creates flash loan contracts for single-transaction borrowing.

Constructors​

Constructor​

new FlashCashHelper(): FlashCashHelper

Returns​

FlashCashHelper

Methods​

buildBorrowDescriptor()​

static buildBorrowDescriptor(address, ownerPublicKey, interestMultiplier?): ScriptDescriptor

Build ScriptDescriptor for borrowing flash cash.

Parameters​

address​

string

ownerPublicKey​

string

interestMultiplier?​

string = '1.01'

Returns​

ScriptDescriptor


calculateReturn()​

static calculateReturn(borrowAmount, interestMultiplier): bigint

Calculate return amount with interest.

Parameters​

borrowAmount​

bigint

interestMultiplier​

number

Returns​

bigint


createFlashCash()​

static createFlashCash(ownerPublicKey, interestMultiplier?): object

Create a flash cash contract.

Parameters​

ownerPublicKey​

string

interestMultiplier?​

string = '1.01'

Returns​

object

address​

address: string

script​

script: string