• Return a human-readable error name decoded from the backend's error response.

    Tries multiple strategies in priority order:

    1. Extract the error variant from the backend's decoded LogResult
    2. Parse the LogData receipt (logId + discriminant) from embedded receipts
    3. Recognize Fuel VM signal constants
    4. Extract PanicInstruction reason
    5. Extract and error: summary
    6. Truncate raw reason as last resort

    Parameters

    • message: string

      The full error message field from the API response.

    • reason: undefined | string

      The reason field (may be undefined or empty).

    • receipts: undefined | unknown[]

      The receipts field (array or undefined). Serialised to text for pattern matching.

    Returns string

    The decoded error name when a revert code is found, or the original reason (or "") when no code can be decoded.