Skip to main content
Gets a cooperative exit request by ID for the SparkWallet.

Method Signature

async getCoopExitRequest(id: string): Promise<CoopExitRequest | null>

Parameters

id
string
required
The withdrawal request ID returned by withdraw(). Not the on-chain transaction ID.Format: SparkCoopExitRequest:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Returns

request
CoopExitRequest | null
required
The cooperative exit request details or null if not found
The transfer field in the response will be empty until the SSP has claimed the inbound Spark transfer. Poll until populated if you need the on-chain transaction details.

Example

// Use the ID returned from withdraw(), not the on-chain txid
const exitRequest = await wallet.getCoopExitRequest(withdrawal.id);
if (exitRequest) {
  console.log("Status:", exitRequest.status);
  console.log("On-chain txid:", exitRequest.coopExitTxid);
}