TransactionRejected

class TransactionRejected(val reason: String, val txHash: String? = null, val customErrorCode: Int? = null) : NodeRpcException

Transaction rejected by node (validation failed).

Reasons:

  • Invalid signature

  • Double-spend (UTXO already spent)

  • Insufficient balance

  • TTL expired

  • Invalid format

Custom Error Codes (authoritative, from midnight-node):

  • 115: InvalidProof (the ZK proof failed verification — regenerate the proof / check the proving-key & contract verifier-key versions match)

  • 186: EffectsCheckFailure

  • 171: OutOfDustValidityWindow (the dust spend's ctime fell outside the node's [tblock - grace, tblock] validity window — typically an idle dust state on a long chain whose sync_time drifted more than dust_grace_period behind the tip; re-sync dust to the tip so its sync_time advances, then retry)

  • 195: InputNotInUtxos (an unshielded UTXO input is already spent or missing)

  • 196: DustDoubleSpend (the dust UTXO paying the fee was already spent on-chain — re-sync dust to the tip, reselect an unspent dust UTXO, and retry)

Recovery: Don't retry (fix transaction)

Constructors

Link copied to clipboard
constructor(reason: String, txHash: String? = null, customErrorCode: Int? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val cause: Throwable?
Link copied to clipboard
val customErrorCode: Int? = null
Link copied to clipboard

True if the dust UTXO paying the fee was already spent on-chain (node error 196).

Link copied to clipboard

True if the dust spend's root was stale / rejected (node error 170).

Link copied to clipboard

True if the node rejected the transaction's ZK proof (node error 115).

Link copied to clipboard

True if the dust spend's ctime fell outside the node's validity window (node error 171).

Link copied to clipboard

True if an unshielded UTXO input was already spent / missing (node error 195).

Link copied to clipboard
open val message: String?
Link copied to clipboard
Link copied to clipboard
val txHash: String? = null