Skip to main content

API reference

The SDK exports LiquidiumClient, error types, constants, module request types, response types, and wallet action types from @liquidium/client.

Client modules

The client provides the following modules:

ModulePurpose
client.accountsProfile lifecycle, account lookup, and linked wallets
client.activitiesActivity lists and receipt-oriented status
client.historyUser history and confirmed protocol-wide activity through the Liquidium SDK API
client.simpleLoansAccountless Simple Loans with generated deposit and repayment targets
client.lendingSupply, borrow, withdraw, and inflow reporting
client.marketPools, prices, and pool rate lookups
client.positionsPer-pool positions, health, and aggregate stats
client.quotePure quote helpers from market inputs

Shared status types

Use LiquidiumStatus for flow state across Simple Loans, activities, lending responses, and history entries.

The following types define shared status data:

TypePurpose
LiquidiumStatusOperation, state, and optional confirmation progress
LiquidiumOperationdeposit, borrow, repayment, withdrawal, or liquidation
LiquidiumStateaction_required, confirming, processing, active, completed, failed, or expired
ActivityInflow or outflow activity returned by activity APIs
GetActivityStatusResponseFound or missing result from client.activities.getStatus(...)

For UI guidance, see the status system.

For APR and estimated APY semantics, see market data.

Error behavior

Public SDK methods can reject with LiquidiumError. Branch on its stable LiquidiumErrorCode value instead of parsing message.

client.simpleLoans.create(...) can also reject with SimpleLoanCreatedError after the remote loan is created but before the SDK loads its hydrated state. Recover the loan with the error's loanId or ref. Do not call create(...) again.

For retry decisions and recovery code, see Handle errors.

History

Use client.history.getUserTransactionHistory(profileId, filters?) for paginated profile transaction history. It accepts cursor, limit, market, poolId, operations, states, from, and to.

Use client.history.getLiquidationHistory(profileId, filters?) for paginated liquidation history. It accepts cursor, limit, market, poolId, from, and to.

Continue pagination with the opaque nextCursor value.

Use client.history.getProtocolActivity(filters?) for recent confirmed activity across the protocol. It calls GET /v2/history/activities, accepts poolId, operations, and limit, and returns an unpaginated array with each pool's asset, decimals, and base-unit amount. History and protocol activity entries expose txids?: string[].

Asset identifiers

AssetIdentifier is a union of named types for each supported asset and transfer-chain pair.

TypeAssetChain
BtcOnBtcAssetIdentifierBTCBTC
EthOnEthAssetIdentifierETHETH
UsdcOnEthAssetIdentifierUSDCETH
UsdtOnEthAssetIdentifierUSDTETH
BtcOnIcpAssetIdentifierBTCICP
EthOnIcpAssetIdentifierETHICP
IcpOnIcpAssetIdentifierICPICP
UsdcOnIcpAssetIdentifierUSDCICP
UsdtOnIcpAssetIdentifierUSDTICP

Generated reference

The generated API reference is built from the @liquidium/client exports.

Regenerate it with TypeDoc and typedoc-plugin-markdown after changing exported APIs:

pnpm docs:api