{"version":3,"sources":["../../src/types/clientQueryTypes.ts"],"sourcesContent":["import {\n  BalanceHealthContributions,\n  BalanceSide,\n  EIP712OrderParams,\n  GetAllMarketsResponse,\n  GetSubaccountSummaryParams,\n  HealthGroup,\n  OrderExpirationType,\n  PerpBalanceWithProduct,\n  ProductEngineType,\n  SignedEIP712OrderParams,\n  SpotBalanceWithProduct,\n  Subaccount,\n  SubaccountSummaryResponse,\n} from '@vertex-protocol/contracts';\nimport { BigDecimal } from '@vertex-protocol/utils';\nimport {\n  EngineServerNoncesParams,\n  EngineServerTimeResponse,\n} from './serverQueryTypes';\n\nexport type GetEngineSubaccountSummaryResponse = SubaccountSummaryResponse;\n\nexport type GetEngineSubaccountSummaryParams = GetSubaccountSummaryParams;\n\nexport type GetEngineIsolatedPositionsParams = Subaccount;\n\nexport interface SubaccountIsolatedPosition {\n  subaccount: Subaccount;\n  healths: BalanceHealthContributions;\n  quoteBalance: SpotBalanceWithProduct;\n  baseBalance: PerpBalanceWithProduct;\n}\n\nexport type GetEngineIsolatedPositionsResponse = SubaccountIsolatedPosition[];\n\nexport type SubaccountTx =\n  | {\n      type: 'mint_lp';\n      tx: SubaccountMintLpTx;\n    }\n  | {\n      type: 'burn_lp';\n      tx: SubaccountBurnLpTx;\n    }\n  | {\n      type: 'apply_delta';\n      tx: SubaccountProductDeltaTx;\n    };\n\nexport interface SubaccountMintLpTx {\n  productId: number;\n  amountBase: BigDecimal;\n  amountQuoteLow: BigDecimal;\n  amountQuoteHigh: BigDecimal;\n}\n\nexport interface SubaccountBurnLpTx {\n  productId: number;\n  amountLp: BigDecimal;\n}\n\nexport interface SubaccountProductDeltaTx {\n  productId: number;\n  amountDelta: BigDecimal;\n  vQuoteDelta: BigDecimal;\n}\n\nexport interface GetEngineContractsResponse {\n  chainId: number;\n  endpointAddr: string;\n  /**\n   * Address for the orderbook contract, with the product ID being the index\n   */\n  orderbookAddrs: string[];\n}\n\nexport type GetEngineEstimatedSubaccountSummaryParams =\n  GetSubaccountSummaryParams & {\n    txs: SubaccountTx[];\n  };\n\nexport type GetEngineNoncesParams = EngineServerNoncesParams;\n\nexport interface GetEngineNoncesResponse {\n  orderNonce: string;\n  txNonce: string;\n}\n\nexport interface GetEngineSymbolsParams {\n  productType?: ProductEngineType;\n  productIds?: number[];\n}\n\nexport interface EngineSymbolsResponse {\n  // mapping of product symbol to symbols info\n  symbols: Record<string, EngineSymbol>;\n}\n\nexport interface EngineSymbol {\n  type: ProductEngineType;\n  productId: number;\n  symbol: string;\n  priceIncrement: BigDecimal;\n  sizeIncrement: BigDecimal;\n  minSize: BigDecimal;\n  minDepth: BigDecimal;\n  maxSpreadRate: BigDecimal;\n  makerFeeRate: BigDecimal;\n  takerFeeRate: BigDecimal;\n  longWeightInitial: BigDecimal;\n  longWeightMaintenance: BigDecimal;\n}\n\nexport type GetEngineAllMarketsResponse = GetAllMarketsResponse;\n\nexport interface GetEngineHealthGroupsResponse {\n  healthGroups: HealthGroup[];\n}\n\nexport interface GetEngineOrderParams {\n  productId: number;\n  digest: string;\n}\n\nexport interface EngineOrder extends Subaccount {\n  productId: number;\n  price: BigDecimal;\n  // Amount initially requested\n  totalAmount: BigDecimal;\n  // Amount still unfilled\n  unfilledAmount: BigDecimal;\n  expiration: BigDecimal;\n  // Margin being transferred for the order, will be null if not an iso order\n  margin: BigDecimal | null;\n  nonce: string;\n  digest: string;\n  orderParams: EIP712OrderParams;\n  placementTime: number;\n  orderType: OrderExpirationType;\n}\n\nexport type GetEngineOrderResponse = EngineOrder;\n\nexport interface ValidateSignedEngineOrderParams {\n  productId: number;\n  signedOrder: SignedEIP712OrderParams;\n}\n\nexport interface ValidateEngineOrderParams {\n  productId: number;\n  orderbookAddr: string;\n  chainId: number;\n  order: EIP712OrderParams;\n}\n\nexport interface ValidateEngineOrderResponse {\n  productId: number;\n  valid: boolean;\n}\n\nexport interface GetEngineSubaccountOrdersParams extends Subaccount {\n  productId: number;\n}\n\nexport interface EngineSubaccountOrders {\n  productId: number;\n  orders: EngineOrder[];\n}\n\nexport type GetEngineSubaccountOrdersResponse = EngineSubaccountOrders;\n\nexport interface GetEngineSubaccountProductOrdersParams extends Subaccount {\n  productIds: number[];\n}\n\nexport interface GetEngineSubaccountProductOrdersResponse {\n  productOrders: EngineSubaccountOrders[];\n}\n\nexport type GetEngineSubaccountFeeRatesParams = Subaccount;\n\nexport interface SubaccountOrderFeeRates {\n  maker: BigDecimal;\n  taker: BigDecimal;\n}\n\nexport interface GetEngineSubaccountFeeRatesResponse {\n  // By Product ID\n  orders: Record<number, SubaccountOrderFeeRates>;\n  withdrawal: Record<number, BigDecimal>;\n  liquidationSequencerFee: BigDecimal;\n  healthCheckSequencerFee: BigDecimal;\n  takerSequencerFee: BigDecimal;\n}\n\nexport interface EnginePriceTickLiquidity {\n  price: BigDecimal;\n  liquidity: BigDecimal;\n}\n\nexport interface GetEngineMarketLiquidityParams {\n  productId: number;\n  // The minimum depth in base price ticks (i.e. per side\n  depth: number;\n}\n\nexport interface GetEngineMarketLiquidityResponse {\n  bids: EnginePriceTickLiquidity[];\n  asks: EnginePriceTickLiquidity[];\n}\n\nexport interface GetEngineMarketPriceParams {\n  productId: number;\n}\n\nexport interface EngineMarketPrice {\n  productId: number;\n  bid: BigDecimal;\n  ask: BigDecimal;\n}\n\nexport type GetEngineMarketPriceResponse = EngineMarketPrice;\n\nexport interface GetEngineMarketPricesParams {\n  productIds: number[];\n}\n\nexport interface GetEngineMarketPricesResponse {\n  marketPrices: EngineMarketPrice[];\n}\n\nexport interface GetEngineMaxOrderSizeParams extends Subaccount {\n  price: BigDecimal;\n  productId: number;\n  // Note: When `reduceOnly` is true, `side` must be opposite of the current position, otherwise it returns 0.\n  side: BalanceSide;\n  // If not given, engine defaults to true (leverage/borrow enabled) for spot\n  // Do not pass this for perp products\n  spotLeverage?: boolean;\n  // If not given, engine defaults to false. If true, the max order size will be capped to the subaccount's current position size;\n  // If no position exists, it will return 0.\n  reduceOnly?: boolean;\n}\n\nexport type GetEngineMaxOrderSizeResponse = BigDecimal;\n\nexport interface GetEngineMaxWithdrawableParams extends Subaccount {\n  productId: number;\n  // If not given, engine defaults to true (leverage/borrow enabled)\n  spotLeverage?: boolean;\n}\n\nexport type GetEngineMaxWithdrawableResponse = BigDecimal;\n\nexport interface GetEngineMaxMintLpAmountParams extends Subaccount {\n  productId: number;\n  // If not given, engine defaults to true (leverage/borrow enabled) for spot\n  // Do not pass this for perp products\n  spotLeverage?: boolean;\n}\n\nexport interface GetEngineMaxMintLpAmountResponse {\n  maxBaseAmount: BigDecimal;\n  maxQuoteAmount: BigDecimal;\n}\n\nexport type GetEngineTimeResponse = EngineServerTimeResponse;\n\nexport type GetEngineLinkedSignerParams = Subaccount;\n\nexport interface GetEngineLinkedSignerResponse {\n  signer: string;\n}\n\nexport type GetEngineInsuranceResponse = BigDecimal;\n\nexport interface EngineMinDepositRate {\n  productId: number;\n  minDepositRate: BigDecimal;\n}\n\nexport interface GetEngineMinDepositRatesResponse {\n  minDepositRates: Record<number, EngineMinDepositRate>;\n}\n\n/**\n * Given an IP, backend will either:\n * - Allow queries only through archive / engine (query_only)\n * - Block all requests (blocked)\n * - Allow all requests (null)\n */\nexport type GetEngineIpBlockStatusResponse = 'query_only' | 'blocked' | null;\n\nexport interface GetEngineMaxMintVlpAmountParams extends Subaccount {\n  // If not given, engine defaults to true (leverage/borrow enabled)\n  spotLeverage?: boolean;\n}\n\nexport type GetEngineMaxMintVlpAmountResponse = BigDecimal;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}