Skip to main content

Class: CreateOfferOperation

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

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.

Extends

Constructors

Constructor

new CreateOfferOperation(offer, params?): CreateOfferOperation;

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

Parameters

ParameterType
offerOffer
params?OperationParams

Returns

CreateOfferOperation

Overrides

Operation.constructor

Properties

actionByte

readonly actionByte: number = ACTIONS.CreateOffer;

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

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

Overrides

Operation.actionByte


domain

readonly domain: number;

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

The domain that this operation is intended for

Inherited from

Operation.domain


offer

readonly offer: Offer;

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


params

readonly params: OperationParams;

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

Inherited from

Operation.params

Methods

digest()

digest(): Bytes32;

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

Build the canonical 32-byte message the signer commits to — the same encoding getId uses for content-addresses, and for the same reason: the preimage is cross-chain, so the digest is identical on every layer and belongs to none of them.

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

Returns

Bytes32

Inherited from

Operation.digest


payloadBytes()

payloadBytes(): Uint8Array;

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

Serializes the action payload into its explicit ToBytes byte layout.

Returns

Uint8Array

Overrides

Operation.payloadBytes


sign()

sign(signer): Promise<SignedOperation>;

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

Parameters

ParameterType
signerOvercastProtocolSigner

Returns

Promise<SignedOperation>

Inherited from

Operation.sign