Skip to content

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.

Parameter Type Description
options OptionsType waitForDeletePieces.OptionsType

Promise<OutputType>

The outcome waitForDeletePieces.OutputType

const result = await SP.schedulePieceDeletions(client, options)
const { pieceIds, confirmedTxHash } = await SP.waitForDeletePieces({ client, ...result })

Errors waitForDeletePieces.ErrorType. TransactionNotAppliedError when the landed transaction reverted or was a cancellation.