Skip to main content

Abstract Class: Operation

Defined in: packages/overcast-core/src/operation.ts:80

The signed body of an off-chain operation. Each subclass binds an action discriminant (actionByte) to a payload byte layout (payloadBytes), and digest folds both — with the shared metadata — into the canonical 32-byte message the signer commits to.

The byte layout mirrors Operation/OperationPayload in the on-chain operation.rs; the primitives come from serialization.ts, so both files stay byte-for-byte in sync with the Rust ToBytes serialization.

Extended by

Constructors

Constructor

new Operation(params?): Operation;

Defined in: packages/overcast-core/src/operation.ts:88

Parameters

ParameterType
params?OperationParams

Returns

Operation

Properties

actionByte

abstract readonly actionByte: number;

Defined in: packages/overcast-core/src/operation.ts:84

The action's distinct discriminant byte (see ACTIONS).


params

readonly params: OperationParams;

Defined in: packages/overcast-core/src/operation.ts:86

Methods

digest()

digest(): string;

Defined in: packages/overcast-core/src/operation.ts:105

Build the canonical 32-byte message the signer commits to, returned as a base58 Id (the same encoding getId uses for content ids).

Preimage layout (SHA-256 hashed), mirroring Operation::digest: "overcast_intent" (15B) | version=1 (1B) | action (1B) | expiry LE (8B, i64) | nonce (32B) | payload_bytes (variable)

Returns

string


payloadBytes()

abstract payloadBytes(): Uint8Array;

Defined in: packages/overcast-core/src/operation.ts:95

Serializes the action payload into its explicit ToBytes byte layout.

Returns

Uint8Array