Skip to content
docs

LendingProtocol

Defined in: protocols/lending.ts:48

Base class for lending modules: holds the account and config, and throws NotImplementedError for every method a module leaves out.

TConfig extends object = Record<string, never>

new LendingProtocol<TConfig>(account, config?): LendingProtocol<TConfig>

Defined in: protocols/lending.ts:52

IWalletAccountReadOnly | IWalletAccount

TConfig = ...

LendingProtocol<TConfig>

ProtocolBase.constructor

protected readonly _account: IWalletAccountReadOnly | IWalletAccount

Defined in: protocols/base.ts:8

ProtocolBase._account


protected readonly _config: TConfig

Defined in: protocols/base.ts:9

ProtocolBase._config

borrow(_o): Promise<LendingResult>

Defined in: protocols/lending.ts:59

Borrow against collateral.

BorrowOptions

Promise<LendingResult>

ILendingProtocol.borrow


describeActivity(_tx, _ctx): ActivityItem | null

Defined in: protocols/base.ts:24

Recognize one of this protocol’s own transactions in an address’s history and describe it for the wallet’s activity feed (“Supplied 100 USDC · Aave v3”). Return null when the transaction is not this protocol’s: the kit then asks the next module and finally falls back to send / receive / approve / contract call. Must be pure and synchronous: no network, no account state. The conformance suite feeds every module its recorded fixtures through this method.

ChainTx

DescribeActivityContext

ActivityItem | null

ProtocolBase.describeActivity


quoteBorrow(_o): Promise<LendingQuote>

Defined in: protocols/lending.ts:60

Network fee of borrow.

BorrowOptions

Promise<LendingQuote>

ILendingProtocol.quoteBorrow


quoteRepay(_o): Promise<LendingQuote>

Defined in: protocols/lending.ts:62

Network fee of repay.

RepayOptions

Promise<LendingQuote>

ILendingProtocol.quoteRepay


quoteSupply(_o): Promise<LendingQuote>

Defined in: protocols/lending.ts:56

Network fee of supply.

SupplyOptions

Promise<LendingQuote>

ILendingProtocol.quoteSupply


quoteWithdraw(_o): Promise<LendingQuote>

Defined in: protocols/lending.ts:58

Network fee of withdraw.

WithdrawOptions

Promise<LendingQuote>

ILendingProtocol.quoteWithdraw


repay(_o): Promise<LendingResult>

Defined in: protocols/lending.ts:61

Repay a borrow.

RepayOptions

Promise<LendingResult>

ILendingProtocol.repay


protected requireSigningAccount(methodName): IWalletAccount

Defined in: protocols/base.ts:29

The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.

string

IWalletAccount

ProtocolBase.requireSigningAccount


supply(_o): Promise<LendingResult>

Defined in: protocols/lending.ts:55

Deposit into the market or vault. Sends an approval first when needed.

SupplyOptions

Promise<LendingResult>

ILendingProtocol.supply


withdraw(_o): Promise<LendingResult>

Defined in: protocols/lending.ts:57

Withdraw a deposit.

WithdrawOptions

Promise<LendingResult>

ILendingProtocol.withdraw