waitForDeletePieces
waitForDeletePieces(
options):Promise<OutputType>
Defined in: packages/synapse-core/src/sp/wait-for-receipt.ts:329
Wait for a schedule piece deletions transaction on chain, following replace-by-fee replacements.
The pieces are scheduled for removal, not removed: PDPVerifier removes them later, through
processPieceDeletions. Resolves once PiecesScheduledForRemoval events for the data set cover
every requested piece. PDPVerifier emits the IDs in chunks, so all matching events are collected.
If the receipt wait times out, or a replacement with different calldata landed, it checks the data set’s scheduled removals instead. That check cannot see pieces that were already removed: after a timeout it rethrows the timeout, and after a replacement it throws TransactionNotAppliedError.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options |
OptionsType |
waitForDeletePieces.OptionsType |
Returns
Section titled “Returns”The outcome waitForDeletePieces.OutputType
Example
Section titled “Example”const result = await SP.schedulePieceDeletions(client, options)
const { pieceIds, confirmedTxHash } = await SP.waitForDeletePieces({ client, ...result })Throws
Section titled “Throws”Errors waitForDeletePieces.ErrorType. TransactionNotAppliedError when the landed transaction reverted or was a cancellation.