{"version":3,"sources":["../../src/types/clientExecuteTypes.ts"],"sourcesContent":["import {\n  EIP712BurnLpParams,\n  EIP712BurnVlpParams,\n  EIP712CancelOrdersParams,\n  EIP712CancelProductOrdersParams,\n  EIP712IsolatedOrderParams,\n  EIP712LinkSignerParams,\n  EIP712LiquidateSubaccountParams,\n  EIP712MintLpParams,\n  EIP712MintVlpParams,\n  EIP712OrderParams,\n  EIP712TransferQuoteParams,\n  EIP712WithdrawCollateralParams,\n} from '@vertex-protocol/contracts';\nimport { EngineServerExecuteSuccessResult } from './serverExecuteTypes';\n\n/**\n * Either verifying address or signature must be provided;\n * If signature is not provided, the verifying address with the engine signer will be used to sign.\n */\nexport type SignatureParams =\n  | {\n      // Endpoint address for all executes except order placement\n      verifyingAddr: string;\n      chainId: number;\n    }\n  | {\n      signature: string;\n    };\n\ntype WithoutNonce<T extends { nonce: unknown }> = Omit<T, 'nonce'>;\n\ntype WithSpotLeverage<T> = T & {\n  spotLeverage?: boolean;\n};\n\nexport type WithSignature<T> = T & {\n  signature: string;\n};\n\n// Params associated with all engine executes\nexport type WithBaseEngineExecuteParams<T> = SignatureParams &\n  Omit<T, 'nonce'> & {\n    nonce?: string;\n  };\n\nexport type EngineOrderParams = WithoutNonce<EIP712OrderParams>;\n\nexport type EnginePlaceOrderParams = WithBaseEngineExecuteParams<{\n  id?: number;\n  productId: number;\n  order: EngineOrderParams;\n  // If not given, engine defaults to true (leverage/borrow enabled)\n  spotLeverage?: boolean;\n}>;\n\nexport type EngineIsolatedOrderParams = WithoutNonce<EIP712IsolatedOrderParams>;\n\nexport type EnginePlaceIsolatedOrderParams = WithBaseEngineExecuteParams<{\n  id?: number;\n  productId: number;\n  order: EngineIsolatedOrderParams;\n  // Whether the cross subaccount can borrow quote for the margin transfer into the isolated subaccount. If not given, engine defaults to true.\n  borrowMargin?: boolean;\n}>;\n\nexport type EngineLiquidateSubaccountParams =\n  WithBaseEngineExecuteParams<EIP712LiquidateSubaccountParams>;\n\nexport type EngineMintLpParams = WithBaseEngineExecuteParams<\n  WithSpotLeverage<EIP712MintLpParams>\n>;\n\nexport type EngineBurnLpParams =\n  WithBaseEngineExecuteParams<EIP712BurnLpParams>;\n\nexport type EngineWithdrawCollateralParams = WithBaseEngineExecuteParams<\n  WithSpotLeverage<EIP712WithdrawCollateralParams>\n>;\n\nexport type EngineCancelOrdersParams =\n  WithBaseEngineExecuteParams<EIP712CancelOrdersParams>;\n\nexport type EngineCancelAndPlaceParams = {\n  cancelOrders: EngineCancelOrdersParams;\n  placeOrder: EnginePlaceOrderParams;\n};\n\nexport type EngineCancelProductOrdersParams =\n  WithBaseEngineExecuteParams<EIP712CancelProductOrdersParams>;\n\nexport type EngineLinkSignerParams =\n  WithBaseEngineExecuteParams<EIP712LinkSignerParams>;\n\nexport type EngineTransferQuoteParams =\n  WithBaseEngineExecuteParams<EIP712TransferQuoteParams>;\n\nexport type EngineMintVlpParams = WithBaseEngineExecuteParams<\n  WithSpotLeverage<EIP712MintVlpParams>\n>;\n\nexport type EngineBurnVlpParams =\n  WithBaseEngineExecuteParams<EIP712BurnVlpParams>;\n\nexport interface EngineExecuteRequestParamsByType {\n  burn_lp: EngineBurnLpParams;\n  burn_vlp: EngineBurnVlpParams;\n  cancel_and_place: EngineCancelAndPlaceParams;\n  cancel_orders: EngineCancelOrdersParams;\n  cancel_product_orders: EngineCancelProductOrdersParams;\n  link_signer: EngineLinkSignerParams;\n  liquidate_subaccount: EngineLiquidateSubaccountParams;\n  mint_lp: EngineMintLpParams;\n  mint_vlp: EngineMintVlpParams;\n  place_isolated_order: EnginePlaceIsolatedOrderParams;\n  place_order: EnginePlaceOrderParams;\n  transfer_quote: EngineTransferQuoteParams;\n  withdraw_collateral: EngineWithdrawCollateralParams;\n}\n\nexport type EnginePlaceOrderResult =\n  EngineServerExecuteSuccessResult<'place_order'> & {\n    orderParams: EIP712OrderParams;\n  };\n\nexport type EnginePlaceIsolatedOrderResult =\n  EngineServerExecuteSuccessResult<'place_isolated_order'> & {\n    orderParams: EIP712IsolatedOrderParams;\n  };\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}