salt-sdk - v0.0.45
    Preparing search index...

    Class TransactionReplacedErrorSealed

    Thrown by a transaction ceremony when another transaction from the account with the same nonce was mined instead of this one — typically a second submission made while this one was still pending. This transaction can no longer execute.

    The record is marked failure with code replaced. Check the replacement (when known) before acting: if it was a resubmission of the same transfer, the transfer has already happened.

    Subclasses SaltCeremonyError.

    import { TransactionReplacedError } from 'salt-sdk';

    try {
    await (await salt.submitTx(params)).wait();
    } catch (err) {
    if (err instanceof TransactionReplacedError) {
    console.warn(`${err.txHash} was replaced by ${err.replacementTxHash ?? 'another transaction'}`);
    } else {
    throw err;
    }
    }

    Hierarchy (View Summary)

    Index
    cause?: Error
    chainId: number

    Destination chain the transaction was sent to.

    data?: unknown

    Optional structured data attached to the failure (e.g. on-chain receipt).

    failureCode: "replaced" = ...

    The code recorded as the transaction's TransactionFailureReason when this error fails a transaction. Set by the subclasses that have one; any other failure is recorded as unknown.

    message: string
    name: string
    replacementTxHash?: `0x${string}`

    Hash of the transaction mined in its place. Unknown when the RPC refused this transaction outright because its nonce was already used.

    stack?: string
    txHash: `0x${string}`

    Hash of this (replaced) transaction.