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.
Extends
Section titled “Extends”ProtocolBase<TConfig>
Type Parameters
Section titled “Type Parameters”TConfig
Section titled “TConfig”TConfig extends object = Record<string, never>
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new LendingProtocol<
TConfig>(account,config?):LendingProtocol<TConfig>
Defined in: protocols/lending.ts:52
Parameters
Section titled “Parameters”account
Section titled “account”IWalletAccountReadOnly | IWalletAccount
config?
Section titled “config?”TConfig = ...
Returns
Section titled “Returns”LendingProtocol<TConfig>
Overrides
Section titled “Overrides”Properties
Section titled “Properties”_account
Section titled “_account”
protectedreadonly_account:IWalletAccountReadOnly|IWalletAccount
Defined in: protocols/base.ts:8
Inherited from
Section titled “Inherited from”_config
Section titled “_config”
protectedreadonly_config:TConfig
Defined in: protocols/base.ts:9
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”borrow()
Section titled “borrow()”borrow(
_o):Promise<LendingResult>
Defined in: protocols/lending.ts:59
Borrow against collateral.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<LendingResult>
Implementation of
Section titled “Implementation of”describeActivity()
Section titled “describeActivity()”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”ActivityItem | null
Inherited from
Section titled “Inherited from”quoteBorrow()
Section titled “quoteBorrow()”quoteBorrow(
_o):Promise<LendingQuote>
Defined in: protocols/lending.ts:60
Network fee of borrow.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<LendingQuote>
Implementation of
Section titled “Implementation of”quoteRepay()
Section titled “quoteRepay()”quoteRepay(
_o):Promise<LendingQuote>
Defined in: protocols/lending.ts:62
Network fee of repay.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<LendingQuote>
Implementation of
Section titled “Implementation of”quoteSupply()
Section titled “quoteSupply()”quoteSupply(
_o):Promise<LendingQuote>
Defined in: protocols/lending.ts:56
Network fee of supply.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<LendingQuote>
Implementation of
Section titled “Implementation of”quoteWithdraw()
Section titled “quoteWithdraw()”quoteWithdraw(
_o):Promise<LendingQuote>
Defined in: protocols/lending.ts:58
Network fee of withdraw.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<LendingQuote>
Implementation of
Section titled “Implementation of”ILendingProtocol.quoteWithdraw
repay()
Section titled “repay()”repay(
_o):Promise<LendingResult>
Defined in: protocols/lending.ts:61
Repay a borrow.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<LendingResult>
Implementation of
Section titled “Implementation of”requireSigningAccount()
Section titled “requireSigningAccount()”
protectedrequireSigningAccount(methodName):IWalletAccount
Defined in: protocols/base.ts:29
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
Parameters
Section titled “Parameters”methodName
Section titled “methodName”string
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”ProtocolBase.requireSigningAccount
supply()
Section titled “supply()”supply(
_o):Promise<LendingResult>
Defined in: protocols/lending.ts:55
Deposit into the market or vault. Sends an approval first when needed.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<LendingResult>
Implementation of
Section titled “Implementation of”withdraw()
Section titled “withdraw()”withdraw(
_o):Promise<LendingResult>
Defined in: protocols/lending.ts:57
Withdraw a deposit.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<LendingResult>