Skip to main content

Status System

SDK responses that expose flow state use LiquidiumStatus:

type LiquidiumStatus = {
operation: "deposit" | "borrow" | "repayment" | "withdrawal" | "liquidation";
state:
| "action_required"
| "confirming"
| "processing"
| "active"
| "completed"
| "failed"
| "expired";
confirmations: number | null;
requiredConfirmations: number | null;
};

Use status.operation to decide which user action or receipt type you are showing. Use status.state to decide the UI treatment.

Operations

OperationMeaning
depositThe user sends funds into Liquidium for supply or initial Simple Loan collateral
borrowLiquidium sends borrowed funds to the configured destination
repaymentThe user sends funds back to repay debt
withdrawalLiquidium sends supplied funds or collateral out
liquidationA liquidation entry from profile history

Activities narrow the operation by direction. Inflow activities use deposit or repayment; outflow activities use borrow or withdrawal.

States

StateMeaningUI treatment
action_requiredThe app needs the user to send funds, sign, or complete the next stepShow the transfer target or wallet action
confirmingLiquidium has a transaction id or detected chain activity and waits for confirmationsShow pending confirmations when present
processingLiquidium is processing the operation after detection or submissionKeep polling and block duplicate submissions
activeThe operation has opened a live position or debt remainsShow the active position and next repayment or withdrawal action
completedThe operation finishedStop prompting for the operation
failedThe operation failedShow recovery copy and let the user retry when the flow supports it
expiredThe user missed the allowed time windowStop showing the expired transfer target

confirmations and requiredConfirmations are null when the SDK cannot report chain confirmation progress or the state does not need confirmations.

Where Status Appears

SurfaceField
client.simpleLoans.create(...) and client.simpleLoans.get(...)loan.status
client.activities.list(...)activity.status
client.activities.getStatus(...)result.activity.status when result.found is true
client.history.getUserTransactionHistory(...)item.status
client.history.getLiquidationHistory(...)item.status
client.lending.supply(...)flow.status
client.lending.borrow(...) and client.lending.withdraw(...)details.status

Poll A Single Activity

Use client.activities.getStatus(...) when your app has a receipt or activity id and needs one latest state.

const result = await client.activities.getStatus({
shortRef: loan.ref,
id: activityId,
});

if (result.found) {
const { operation, state, confirmations, requiredConfirmations } =
result.activity.status;

console.log(operation, state, confirmations, requiredConfirmations);
}

Pass profileId instead of shortRef for account-based profile flows.

List Active Work

client.activities.list(...) defaults to active activities. Pass filter: "completed" for finished work or filter: "all" for both.

const activities = await client.activities.list({
shortRef: loan.ref,
filter: "active",
});

For inflow activities, check activity.topUp. When topUp.required is true, the user must send topUp.shortfallAmount more before processing can continue.