/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { optionOrdersCancelOptionOrder } from "../funcs/optionOrdersCancelOptionOrder.js"; import { optionOrdersCreateOptionOrder } from "../funcs/optionOrdersCreateOptionOrder.js"; import { optionOrdersGetOptionOrder } from "../funcs/optionOrdersGetOptionOrder.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class OptionOrders extends ClientSDK { /** * Create Option Order * * @remarks * Creates a new option order. * * Currently only single-leg option orders are supported, but the data structures will support multi-leg orders in the future. The single-leg constraint will be repeated in this documentation, but validation rules related to the initial (future) multi-leg support are also documented. * * Upon successful submission, if the request is a duplicate, returns the existing order in its current state in the system. If the request is not a duplicate, returns the summary of the newly submitted order. */ async createOptionOrder( optionOrderCreate: components.OptionOrderCreate, accountId: string, options?: RequestOptions, ): Promise { return unwrapAsync(optionOrdersCreateOptionOrder( this, optionOrderCreate, accountId, options, )); } /** * Get Option Order * * @remarks * Gets an option order by option order ID. * * Upon successful submission, returns the details of the queried order. */ async getOptionOrder( accountId: string, optionOrderId: string, options?: RequestOptions, ): Promise { return unwrapAsync(optionOrdersGetOptionOrder( this, accountId, optionOrderId, options, )); } /** * Cancel Option Order * * @remarks * Submits an order cancellation request by option order ID. Confirmation of order cancellation requests are provided through asynchronous events. * * Upon successful submission, returns the details of the order pending cancellation. */ async cancelOptionOrder( cancelOptionOrderRequestCreate: components.CancelOptionOrderRequestCreate, accountId: string, optionOrderId: string, options?: RequestOptions, ): Promise { return unwrapAsync(optionOrdersCancelOptionOrder( this, cancelOptionOrderRequestCreate, accountId, optionOrderId, options, )); } }