Skip to content

Serialized Action

A serialized action is an action that encapsulates the execution and confirmation status along with logs and errors encountered during the execution of the acton.

Serialized Action

A serialized action looks like this

interface SerializedAction {
  name: string;
  signature: string;
  msgSender: string;
  payload: AllowedInputTypes;
  executionStatus: ActionExecutionStatus | null;
  confirmationStatus: ActionConfirmationStatus | null;
  isReverted: boolean;
  hash: string;
  logs: ExecutionLog[] | null;
  errors: ExecutionError[] | null;
}
  • name: The name of the action sent.
  • signature: The signature of the action. This is used to authenticate the user who signed the action.
  • msgSender: The address of the user who sent the action.
  • payload: The data of the action. This is the actual data that the action is supposed to mutate the state with.
  • executionStatus: The status of the execution of the action (Defaults to CREATED). More on this here.
  • confirmationStatus: The confirmation status for the action (Defaults to CX). More on this here.
  • isReverted: A boolean flag to indicate if the action is reverted or not at the execution level.
  • hash: The keccak256 hash of the action.
  • logs: The logs generated for the action's execution.
  • errors: The errors generated of the action's execution. Contains the code and message for the error occurred.

Action Attributes

Every action contains Logs and Errors generated during the action execution.

action.logs

Returns the execution logs for the action. If not null, the execution succeeded without any errors. It is null if the action has not yet been executed. Here the action is of type SerializedAction.

Type: ExecutionLog[] | null

action.errors

Returns any errors that occurred during the execution of the action. It is null if the action has not yet been executed. Here the action is of type SerializedAction.

Type: ExecutionError[] | null;

Serialized Block

When using the MicroRollupResponse.actions.query method, the SerializedAction also includes block details. Then its datatype is SerializedActionAndBlock and looks like

interface SerializedBlock {
  height: number;
  hash: string;
  timestamp: number;
  status: BlockStatus;
  batchInfo?: BatchInfo;
}
 
interface SerializedActionAndBlock extends SerializedAction {
  block: SerializedBlock | null;
}

These fields are described in the Block section.