crisp.waitForWithdrawal()
Wait for a withdrawal to reach a stopping state.
Stops at confirmed, failed or manual review: inspect the result. Confirmation is source-chain only. Timeout or abort stops the wait, not the withdrawal.
funding workflow · All SDK methods
Import and runtime
@crisp-trade/partner-sdk — server only; never expose credentials to the browser.
Client setup and shared behavior
Arguments
| Argument | Presence | Released TypeScript type |
|---|---|---|
user | Required | |
withdrawalId | Required | |
options | Optional | |
Named types are expanded under “Exact released types” below. Parameters are in call order; optional does not imply nullable.
Example
Example IDs and intent keys are illustrative. Replace them with authenticated account resources and your persisted intent. Browser route names are example routes you implement on your own backend.
// Use a reused, server-only CrispClient (see client setup).
const result = await crisp.waitForWithdrawal(
'user-123',
'11111111-1111-4111-8111-111111111111',
{ timeoutMs: 60_000 },
);
console.log(result.data);Returns
Returns a promise for a typed response wrapper. Inspect data and its state; a resolved request is not necessarily a successful financial outcome.
Return type
Promise<Response<{
crispAccountId: string;
externalUserId: string;
withdrawal: {
"id": string;
"amountBaseUnit": string;
"recipientAddress": string;
"toChainId": string;
"toTokenAddress": string;
"bridgeAddress": string | null;
"state": "queued" | "submitting" | "submitted" | "confirmed" | "failed" | "manual_review";
"relayTransactionId": string | null;
"transactionHash": string | null;
"failureCode": string | null;
"finalDestinationStatus": string | null;
"createdAt": string;
"updatedAt": string;
"submittedAt": string | null;
"confirmedAt": string | null;
};
}>>Errors and lifecycle
Waits default to 60 seconds (1–600,000 ms configurable). They retry transient reads with bounded backoff and Retry-After. Aborting or timing out never cancels the underlying action.
Errors and retry policy. Financial uncertainty requires recovery with the original intent, never a new key. Realtime helpers must be stopped on logout/account switch.
Related HTTP operations
Exact released types
Extracted from the shipped SDK 0.13.0, not separately maintained signatures.
Full signature
crisp.waitForWithdrawal(user: string, withdrawalId: string, options?: WaitOptions): Promise<Response<{
crispAccountId: string;
externalUserId: string;
withdrawal: {
"id": string;
"amountBaseUnit": string;
"recipientAddress": string;
"toChainId": string;
"toTokenAddress": string;
"bridgeAddress": string | null;
"state": "queued" | "submitting" | "submitted" | "confirmed" | "failed" | "manual_review";
"relayTransactionId": string | null;
"transactionHash": string | null;
"failureCode": string | null;
"finalDestinationStatus": string | null;
"createdAt": string;
"updatedAt": string;
"submittedAt": string | null;
"confirmedAt": string | null;
};
}>>WaitOptions
export type WaitOptions = {
timeoutMs?: number;
signal?: AbortSignal;
};Response
export interface Response<T> {
data: T;
status: number;
requestId: string;
retryAfterMs: number | null;
asOf?: string | null;
freshness?: string | null;
}