Error codes

TRANSACTION_FAILED

The transaction did not complete on chain.

Exit code: 5 · Who acts: Depends on the error's mode · From: the CLI, the SDK and the backend

What it means

The transaction did not complete on chain.

Common causes

  • The chain reverted it because the state changed after the checks.
  • The network did not include it in time.

Fix it

  1. Read mode in the error: revert means the state changed; read it again before you retry.
  2. A timeout can still settle: wait with capxul payment wait before you send again.

In JSON and the SDK

With --json, the CLI prints:

{
  "outcome": "failed",
  "error": {
    "code": "TRANSACTION_FAILED",
    "message": "…"
  }
}

In the SDK, a failed result has result.error.code === "TRANSACTION_FAILED". Branch on the code, not on the message: the message is written for people and can change.

Commands that can answer with it

On this page