Skip to main content

Class: RedeemOperation

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

A maker delegating redeem_option. Mirrors ExerciseOperation: the maker commits to the two offer ids, the redeemed amount, and the opaque settlement metadata. Its payload layout is identical to the exercise payload — the action discriminant keeps their signed messages disjoint.

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

Extends

Constructors

Constructor

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

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

Parameters

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

Returns

RedeemOperation

Overrides

Operation.constructor

Properties

actionByte

readonly actionByte: number = ACTIONS.Redeem;

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

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

Overrides

Operation.actionByte


amount

readonly amount: bigint;

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

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


collateralOffer

readonly collateralOffer: string;

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

The redeemed option's collateral offer id.


metadata

readonly metadata: Metadata;

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

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:280

The redeemed 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:306

Serializes the action payload into its explicit ToBytes byte layout.

Returns

Uint8Array

Overrides

Operation.payloadBytes


forOption()

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

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

Build directly from a MarketOption and the redeem arguments.

Parameters

ParameterType
optionMarketOption
amountbigint
metadataMetadata
params?OperationParams

Returns

RedeemOperation