waitForAddPieces
waitForAddPieces(
options):Promise<OutputType>
Defined in: packages/synapse-core/src/sp/wait-for-receipt.ts:186
Wait for an add pieces transaction on chain, following replace-by-fee replacements.
Uses viem’s waitForTransactionReceipt on the hash the SP returned, so a sped-up or repriced
replacement resolves with its own hash in confirmedTxHash. If the wait times out, it checks the
nonce FWSS records before failing, in case a replacement landed unnoticed.
For recovery after a crash, call getAddPiecesResult with the persisted extraData instead:
after a replacement the original hash can no longer be looked up.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options |
OptionsType |
waitForAddPieces.OptionsType |
Returns
Section titled “Returns”The outcome waitForAddPieces.OutputType
Example
Section titled “Example”const result = await SP.addPieces(client, options)
const { dataSetId, pieceIds, confirmedTxHash } = await SP.waitForAddPieces({ client, ...result })Throws
Section titled “Throws”Errors waitForAddPieces.ErrorType. TransactionNotAppliedError when the landed transaction reverted or was a cancellation.