depth
Trading

Resume an operation

Use canonical receipts to recover after a timeout, reload, or interrupted submission.

On this page

Keep the same nonce

Assign a unique clientNonce to each intended trade and retain it before signing. After uncertain submission, inspect that flow before creating another order.

Restore a trade
const flow = depth.trade.flow(savedNonce);
const progress = await flow.status();

const operation = depth.trade.operation(savedNonce);
const status = await operation.status();

flow.status() distinguishes an allocation from an order. If allocation completed but the order was never submitted, resuming requires the original private order terms. Do not store decrypted terms or wallet keys in public logs.

Discover pending receipts

Read canonical history
const pending = await depth.account.pending();
const history = await depth.account.history();
const allocations = await depth.trade.unpairedAllocations();

An unpaired allocation remains market collateral. Inspect it and release available funds through the normal account flow.

Handle errors

Field on DepthErrorMeaning
stagevalidation, submission, or confirmation.
retryableWhether reconciliation or a later retry may succeed.
operationIdThe saved operation to inspect, when available.
nextActionThe specific recovery action.

Recover execution PnL

Read a closed execution
const execution = await depth.history.execution(savedNonce);

The SDK reconstructs the prior position, margin, and funding from authorized fills in settlement order. Missing archival transactions are reported explicitly.

Documentation
8 results