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

    Class BroadcastRejectedErrorSealed

    Thrown by a transaction ceremony when the destination chain's RPC refuses the signed transaction — it is underpriced, its gas limit is too low, its nonce is ahead of the account's, or the RPC could not be reached after retrying.

    The transaction was not accepted, and the record is marked failure with code broadcast_rejected. Submitting it again is safe: a fresh submission reuses the same nonce, so at most one of the two can ever execute.

    Subclasses SaltCeremonyError.

    import { BroadcastRejectedError } from 'salt-sdk';

    try {
    await (await salt.submitTx(params)).wait();
    } catch (err) {
    if (err instanceof BroadcastRejectedError) {
    console.warn(`RPC refused ${err.txHash}:`, err.cause?.message);
    await (await salt.submitTx(params)).wait();
    } 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: "broadcast_rejected" = ...

    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
    stack?: string
    txHash: `0x${string}`

    Hash of the signed transaction that was refused.