Skip to main content

Function: marketOptionInput()

function marketOptionInput(option): object;

Defined in: solana-client/src/utils.ts:160

Map the core MarketOption onto the IDL's camelCase, pubkey/BN layout, for passing a whole option back into a program call (the fee hook's on_create_option quote). The Anchor coder encodes u64/i64 fields through BN, so the core shape's Id strings and bigints have to be converted first — handing it the raw domain object fails with src.toTwos is not a function.

Parameters

ParameterType
optionMarketOption

Returns

object

borrowedCollateral

borrowedCollateral: any;

collateralOffer

collateralOffer: PublicKey;

details

details: object;

details.borrowAllowed

borrowAllowed: boolean = d.borrowAllowed;

details.collateralAmount

collateralAmount: any;

details.collateralAsset

collateralAsset: PublicKey;

details.domain

domain: number = d.domain;

details.endTimestamp

endTimestamp: any;

details.premiumAmount

premiumAmount: any;

details.premiumAsset

premiumAsset: PublicKey;

details.settlementAmount

settlementAmount: any;

details.settlementAsset

settlementAsset: PublicKey;

details.settlementLayer

settlementLayer: PublicKey;

details.startTimestamp

startTimestamp: any;

maker

maker: PublicKey;

settlementOffer

settlementOffer: PublicKey;

taker

taker: PublicKey;