@kagamidigital/salt-sdk-mirror
    Preparing search index...

    Class PayloadMismatchError

    Thrown when the unsigned transaction shared in a signing ceremony does not match the transaction record the ceremony claims to be for.

    The relay is a routing layer, not an authority: it forwards whatever payload a party puts on the wire. A co-signer therefore hashes the payload it is asked to sign and compares it against unsignedTxHash on the record — the digest the backend derived from the params it ran the policy check against. A mismatch means the ceremony would produce a signature over a transaction that no policy check ever saw, so signing stops here.

    mismatchedFields names which fields drifted, for diagnosis; the hashes are the authority.

    import { PayloadMismatchError } from 'salt-sdk';

    listener.on('nudgeReceived', async ({ kind, join }) => {
    if (kind !== 'signing') return;
    try {
    await (await join()).wait();
    } catch (err) {
    if (err instanceof PayloadMismatchError) {
    console.error(
    `Refused to sign ${err.transactionId}: ${err.mismatchedFields.join(', ')} drifted`
    );
    }
    }
    });

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    cause?: Error
    data?: unknown

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

    expectedHash: string | null

    The digest the backend derives from the policy-checked params, or null when the record's params cannot be serialized at all.

    message: string
    mismatchedFields: MismatchedTxField[]

    Which transaction fields differ between the record and the payload.

    name: string
    receivedHash: string | null

    The hash of the payload that actually arrived on the wire, or null when that payload is not a serializable transaction at all.

    stack?: string
    transactionId: string

    Database id of the transaction record the payload was checked against.