Skip to main content

Class: ExerciseOperation

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

A taker delegating exercise_option. Unlike the offer operations this is not a content-addressed struct: the taker commits to the two offer ids, the exercise amount, and the opaque settlement metadata.

Payload byte layout (ExerciseOperationPayload::to_bytes): collateral_offer (32B) | settlement_offer (32B) | amount (8B LE) | metadata_len (4B LE) | metadata (N B)

Extends

Constructors

Constructor

new ExerciseOperation(
collateralOffer,
settlementOffer,
amount,
metadata,
params?): ExerciseOperation;

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

Parameters

ParameterTypeDescription
collateralOfferstringThe exercised option's collateral offer id.
settlementOfferstringThe exercised option's settlement offer id.
amountbigintExercised amount, in the collateral asset's native units.
metadataMetadataOpaque settlement-layer metadata (empty for the physical layer).
params?OperationParams-

Returns

ExerciseOperation

Overrides

Operation.constructor

Properties

actionByte

readonly actionByte: number = ACTIONS.Exercise;

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

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

Overrides

Operation.actionByte


amount

readonly amount: bigint;

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

Exercised amount, in the collateral asset's native units.


collateralOffer

readonly collateralOffer: string;

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

The exercised option's collateral offer id.


metadata

readonly metadata: Metadata;

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

Opaque settlement-layer metadata (empty for the physical layer).


params

readonly params: OperationParams;

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

Inherited from

Operation.params


settlementOffer

readonly settlementOffer: string;

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

The exercised option's settlement offer id.

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

Inherited from

Operation.digest


payloadBytes()

payloadBytes(): Uint8Array;

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

Serializes the action payload into its explicit ToBytes byte layout.

Returns

Uint8Array

Overrides

Operation.payloadBytes


forOption()

static forOption(
option,
amount,
metadata,
params?): ExerciseOperation;

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

Build directly from a MarketOption and the exercise arguments.

Parameters

ParameterType
optionMarketOption
amountbigint
metadataMetadata
params?OperationParams

Returns

ExerciseOperation