import * as z from "zod"; import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { OptionOrderLegExecution, OptionOrderLegExecution$Outbound } from "./optionorderlegexecution.js"; /** * The type of the asset in this option order leg. Orders with only a single leg may only contain an OPTION asset type. Orders with multiple legs must contain at least one OPTION leg, and no more than one EQUITY leg. */ export declare enum OptionOrderLegAssetType { Equity = "EQUITY", Option = "OPTION" } /** * The type of the asset in this option order leg. Orders with only a single leg may only contain an OPTION asset type. Orders with multiple legs must contain at least one OPTION leg, and no more than one EQUITY leg. */ export type OptionOrderLegAssetTypeOpen = OpenEnum; /** * The computed average price for this leg, which is a weighted average (by quantity) of the executed prices. */ export type AveragePrice = { /** * The decimal value, as a string; Refer to [Google’s Decimal type protocol buffer](https://github.com/googleapis/googleapis/blob/40203ca1880849480bbff7b8715491060bbccdf1/google/type/decimal.proto#L33) for details */ value?: string | undefined; }; /** * The computed direction for this leg. When `side` is BUY, `direction` will be DEBIT. When `side` is SELL, `direction` will be CREDIT. */ export declare enum OptionOrderLegDirection { DebitCreditTypeUnspecified = "DEBIT_CREDIT_TYPE_UNSPECIFIED", Debit = "DEBIT", Credit = "CREDIT" } /** * The computed direction for this leg. When `side` is BUY, `direction` will be DEBIT. When `side` is SELL, `direction` will be CREDIT. */ export type OptionOrderLegDirectionOpen = OpenEnum; /** * The format of the identifier value used to look up the security. When `asset_type` is OPTION, the identifier_type must be OSI. */ export declare enum OptionOrderLegIdentifierType { LegIdentifierTypeUnspecified = "LEG_IDENTIFIER_TYPE_UNSPECIFIED", Osi = "OSI" } /** * The format of the identifier value used to look up the security. When `asset_type` is OPTION, the identifier_type must be OSI. */ export type OptionOrderLegIdentifierTypeOpen = OpenEnum; /** * The side of the option order to be sent to the market. */ export declare enum OptionOrderLegSide { SideUnspecified = "SIDE_UNSPECIFIED", Buy = "BUY", Sell = "SELL" } /** * The side of the option order to be sent to the market. */ export type OptionOrderLegSideOpen = OpenEnum; /** * The open/close modification of the side, signaling whether this option order leg intends to OPEN a new position, or to CLOSE an existing one. */ export declare enum OptionOrderLegSideModifier { SideModifierUnspecified = "SIDE_MODIFIER_UNSPECIFIED", Open = "OPEN", Close = "CLOSE" } /** * The open/close modification of the side, signaling whether this option order leg intends to OPEN a new position, or to CLOSE an existing one. */ export type OptionOrderLegSideModifierOpen = OpenEnum; /** * The message describing an option order leg. */ export type OptionOrderLeg = { /** * The unique identifier of the asset in the Apex system. If the requested identifier does not match any known Apex asset, then this field will not be set. */ assetId?: string | undefined; /** * The type of the asset in this option order leg. Orders with only a single leg may only contain an OPTION asset type. Orders with multiple legs must contain at least one OPTION leg, and no more than one EQUITY leg. */ assetType?: OptionOrderLegAssetTypeOpen | undefined; /** * The computed average price for this leg, which is a weighted average (by quantity) of the executed prices. */ averagePrice?: AveragePrice | null | undefined; /** * The computed direction for this leg. When `side` is BUY, `direction` will be DEBIT. When `side` is SELL, `direction` will be CREDIT. */ direction?: OptionOrderLegDirectionOpen | undefined; /** * The list of executions contributing to the fill of this leg of the option order. */ executions?: Array | undefined; /** * The identifier of the asset, in the format specified by `identifier_type`. When `identifier_type` is OSI, this field must be a valid OSI identifier, which is between 16 and 21 characters. (This value must not contain any spaces between the symbol and expiry date.) When `identifier_type` is SYMBOL, this field must contain the ticker value of the security, which is between 1 and 6 characters and must conform the same input constraints called out in the non-options single option order API. */ identifier?: string | undefined; /** * The format of the identifier value used to look up the security. When `asset_type` is OPTION, the identifier_type must be OSI. */ identifierType?: OptionOrderLegIdentifierTypeOpen | undefined; /** * This specifies the quantity of security to be ordered in this leg. For a single-leg order, this value must be 1 (one). For a multi-leg order, this value must be greater than zero, and the total number of shares or contracts ordered at the market will be `order.quantity * leg.ratio_quantity`. */ ratioQuantity?: number | undefined; /** * The side of the option order to be sent to the market. */ side?: OptionOrderLegSideOpen | undefined; /** * The open/close modification of the side, signaling whether this option order leg intends to OPEN a new position, or to CLOSE an existing one. */ sideModifier?: OptionOrderLegSideModifierOpen | undefined; }; /** @internal */ export declare const OptionOrderLegAssetType$inboundSchema: z.ZodType; /** @internal */ export declare const OptionOrderLegAssetType$outboundSchema: z.ZodType; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace OptionOrderLegAssetType$ { /** @deprecated use `OptionOrderLegAssetType$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `OptionOrderLegAssetType$outboundSchema` instead. */ const outboundSchema: z.ZodType; } /** @internal */ export declare const AveragePrice$inboundSchema: z.ZodType; /** @internal */ export type AveragePrice$Outbound = { value?: string | undefined; }; /** @internal */ export declare const AveragePrice$outboundSchema: z.ZodType; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace AveragePrice$ { /** @deprecated use `AveragePrice$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `AveragePrice$outboundSchema` instead. */ const outboundSchema: z.ZodType; /** @deprecated use `AveragePrice$Outbound` instead. */ type Outbound = AveragePrice$Outbound; } export declare function averagePriceToJSON(averagePrice: AveragePrice): string; export declare function averagePriceFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const OptionOrderLegDirection$inboundSchema: z.ZodType; /** @internal */ export declare const OptionOrderLegDirection$outboundSchema: z.ZodType; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace OptionOrderLegDirection$ { /** @deprecated use `OptionOrderLegDirection$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `OptionOrderLegDirection$outboundSchema` instead. */ const outboundSchema: z.ZodType; } /** @internal */ export declare const OptionOrderLegIdentifierType$inboundSchema: z.ZodType; /** @internal */ export declare const OptionOrderLegIdentifierType$outboundSchema: z.ZodType; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace OptionOrderLegIdentifierType$ { /** @deprecated use `OptionOrderLegIdentifierType$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `OptionOrderLegIdentifierType$outboundSchema` instead. */ const outboundSchema: z.ZodType; } /** @internal */ export declare const OptionOrderLegSide$inboundSchema: z.ZodType; /** @internal */ export declare const OptionOrderLegSide$outboundSchema: z.ZodType; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace OptionOrderLegSide$ { /** @deprecated use `OptionOrderLegSide$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `OptionOrderLegSide$outboundSchema` instead. */ const outboundSchema: z.ZodType; } /** @internal */ export declare const OptionOrderLegSideModifier$inboundSchema: z.ZodType; /** @internal */ export declare const OptionOrderLegSideModifier$outboundSchema: z.ZodType; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace OptionOrderLegSideModifier$ { /** @deprecated use `OptionOrderLegSideModifier$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `OptionOrderLegSideModifier$outboundSchema` instead. */ const outboundSchema: z.ZodType; } /** @internal */ export declare const OptionOrderLeg$inboundSchema: z.ZodType; /** @internal */ export type OptionOrderLeg$Outbound = { asset_id?: string | undefined; asset_type?: string | undefined; average_price?: AveragePrice$Outbound | null | undefined; direction?: string | undefined; executions?: Array | undefined; identifier?: string | undefined; identifier_type?: string | undefined; ratio_quantity?: number | undefined; side?: string | undefined; side_modifier?: string | undefined; }; /** @internal */ export declare const OptionOrderLeg$outboundSchema: z.ZodType; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace OptionOrderLeg$ { /** @deprecated use `OptionOrderLeg$inboundSchema` instead. */ const inboundSchema: z.ZodType; /** @deprecated use `OptionOrderLeg$outboundSchema` instead. */ const outboundSchema: z.ZodType; /** @deprecated use `OptionOrderLeg$Outbound` instead. */ type Outbound = OptionOrderLeg$Outbound; } export declare function optionOrderLegToJSON(optionOrderLeg: OptionOrderLeg): string; export declare function optionOrderLegFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=optionorderleg.d.ts.map