LendingModule
@liquidium/client / LendingModule
Class: LendingModule
Defined in: external/liquidium-sdk/packages/client/src/modules/lending/lending.ts:116
Borrow, withdraw, supply, inflow reporting, and fee-estimation helpers.
Constructors
Constructor
new LendingModule(
canisterContext,apiClient,evmReadClient):LendingModule
Defined in: external/liquidium-sdk/packages/client/src/modules/lending/lending.ts:117
Parameters
canisterContext
CanisterContext
apiClient
ApiClient | undefined
evmReadClient
EvmReadClient | undefined
Returns
LendingModule
Methods
borrow()
borrow(
params):Promise<BorrowOutflowDetails>
Defined in: external/liquidium-sdk/packages/client/src/modules/lending/lending.ts:378
Creates a borrow outflow using the provided wallet adapter.
This is the convenience form of prepareBorrow(...) plus execution.
Parameters
params
CreateBorrowRequest & WalletExecutionParams
Borrow request fields plus signerChain and signerWalletAdapter.
Returns
Promise<BorrowOutflowDetails>
The lending canister receipt as OutflowDetails.
Remarks
id is always present. txid may be missing on the first response; the SDK does not
poll for it. Use history or app-level polling if you need the chain transaction id.
estimateInflowFee()
estimateInflowFee(
request):Promise<InflowFeeEstimate>
Defined in: external/liquidium-sdk/packages/client/src/modules/lending/lending.ts:602
Estimates the network/deposit fee for an inflow target.
ETH stablecoin deposit-address estimates are served by the deposit-address canister. BTC estimates are not exposed by this SDK yet and return zero.
Parameters
request
Asset and chain pair to estimate for.
Returns
Promise<InflowFeeEstimate>
Total fee estimate in the asset's base units.
getDepositAddress()
getDepositAddress(
request):Promise<string>
Defined in: external/liquidium-sdk/packages/client/src/modules/lending/lending.ts:557
Returns the read-only deposit address for an ETH stablecoin inflow target.
This is a query call that does not create or mutate state. Use it when you need the deposit address without hitting the authorization-gated update path.
Parameters
request
Profile, pool, asset, and supply action.
action
asset
string
poolId
string
profileId
string
Returns
Promise<string>
The EVM deposit address for the derived account.
getEvmSupplyContext()
getEvmSupplyContext(
request):Promise<EvmSupplyContext>
Defined in: external/liquidium-sdk/packages/client/src/modules/lending/lending.ts:469
Fetches ERC-20 supply planning data with the configured EVM read client.
Requires evmRpcUrl or evmPublicClient on the client. Used internally by
contract-interaction supply.
Parameters
request
Profile, pool, wallet, amount (token base units), and action.
Returns
Promise<EvmSupplyContext>
Locally computed EvmSupplyContext for approvals and deposit.
isBorrowingDisabled()
isBorrowingDisabled():
Promise<boolean>
Defined in: external/liquidium-sdk/packages/client/src/modules/lending/lending.ts:947
Returns whether borrowing is currently disabled by the protocol.
Returns
Promise<boolean>
true when the lending canister reports borrowing disabled.
prepareBorrow()
prepareBorrow(
request):Promise<BorrowAction>
Defined in: external/liquidium-sdk/packages/client/src/modules/lending/lending.ts:264
Prepares a borrow action that can be signed and submitted later.
Use this when you need explicit control over signing and submission.
Parameters
request
Profile, pool, amount (borrow asset base units), outflow address, and signer wallet.
Returns
Promise<BorrowAction>
A signable BorrowAction with submit wired to the canister.
prepareWithdraw()
prepareWithdraw(
request):Promise<WithdrawAction>
Defined in: external/liquidium-sdk/packages/client/src/modules/lending/lending.ts:131
Prepares a withdraw action that can be signed and submitted later.
Use this when you need explicit control over signing and submission.
Parameters
request
Profile, pool, amount (pool asset base units), outflow address, and signer wallet.
Returns
Promise<WithdrawAction>
A signable WithdrawAction with submit wired to the canister.
submitInflow()
submitInflow(
request):Promise<SubmitInflowResponse>
Defined in: external/liquidium-sdk/packages/client/src/modules/lending/lending.ts:931
Submits an inflow transaction id for faster indexing.
Uses the Liquidium SDK API.
Parameters
request
Broadcast txid plus optional chain and inflow type.
Returns
Promise<SubmitInflowResponse>
Acknowledgement including the submitted txid.
supply()
supply(
request):Promise<SupplyFlow>
Defined in: external/liquidium-sdk/packages/client/src/modules/lending/lending.ts:403
Resolves a supply target for a deposit or repayment and optionally broadcasts it.
Transfer mode can return manual broadcast instructions when wallet fields are
omitted. Contract-interaction mode always requires walletAdapter, account,
and amount because it must prepare and submit approval/deposit calls.
The SDK does not poll for inflow status. When a txid is returned, it is the
caller's responsibility to track confirmation state using their own polling.
Parameters
request
Returns
Promise<SupplyFlow>
A SupplyFlow receipt with type, target, submit, and
an optional txid present when the SDK broadcast for you.
withdraw()
withdraw(
params):Promise<WithdrawOutflowDetails>
Defined in: external/liquidium-sdk/packages/client/src/modules/lending/lending.ts:244
Creates a withdraw outflow using the provided wallet adapter.
This is the convenience form of prepareWithdraw(...) plus execution.
Parameters
params
CreateWithdrawRequest & WalletExecutionParams
Withdraw request fields plus signerChain and signerWalletAdapter.
Returns
Promise<WithdrawOutflowDetails>
The canister OutflowDetails for the completed withdraw.