@nadohq/engine-client 0.1.0-alpha.3 → 0.1.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/EngineBaseClient.cjs +8 -7
  2. package/dist/EngineBaseClient.cjs.map +1 -1
  3. package/dist/EngineBaseClient.d.cts +1 -2
  4. package/dist/EngineBaseClient.d.ts +1 -2
  5. package/dist/EngineBaseClient.js +7 -5
  6. package/dist/EngineBaseClient.js.map +1 -1
  7. package/dist/EngineClient.d.cts +1 -2
  8. package/dist/EngineClient.d.ts +1 -2
  9. package/dist/EngineExecuteBuilder.cjs +23 -51
  10. package/dist/EngineExecuteBuilder.cjs.map +1 -1
  11. package/dist/EngineExecuteBuilder.d.cts +6 -17
  12. package/dist/EngineExecuteBuilder.d.ts +6 -17
  13. package/dist/EngineExecuteBuilder.js +13 -41
  14. package/dist/EngineExecuteBuilder.js.map +1 -1
  15. package/dist/EngineExecuteClient.cjs +6 -10
  16. package/dist/EngineExecuteClient.cjs.map +1 -1
  17. package/dist/EngineExecuteClient.d.cts +3 -4
  18. package/dist/EngineExecuteClient.d.ts +3 -4
  19. package/dist/EngineExecuteClient.js +6 -10
  20. package/dist/EngineExecuteClient.js.map +1 -1
  21. package/dist/EngineQueryClient.cjs +28 -53
  22. package/dist/EngineQueryClient.cjs.map +1 -1
  23. package/dist/EngineQueryClient.d.cts +2 -13
  24. package/dist/EngineQueryClient.d.ts +2 -13
  25. package/dist/EngineQueryClient.js +6 -31
  26. package/dist/EngineQueryClient.js.map +1 -1
  27. package/dist/EngineWebClient.cjs +0 -2
  28. package/dist/EngineWebClient.cjs.map +1 -1
  29. package/dist/EngineWebClient.d.cts +1 -2
  30. package/dist/EngineWebClient.d.ts +1 -2
  31. package/dist/EngineWebClient.js +0 -2
  32. package/dist/EngineWebClient.js.map +1 -1
  33. package/dist/endpoints.cjs +6 -6
  34. package/dist/endpoints.cjs.map +1 -1
  35. package/dist/endpoints.d.cts +1 -1
  36. package/dist/endpoints.d.ts +1 -1
  37. package/dist/endpoints.js +6 -6
  38. package/dist/endpoints.js.map +1 -1
  39. package/dist/index.d.cts +5 -6
  40. package/dist/index.d.ts +5 -6
  41. package/dist/types/EngineServerFailureError.cjs +1 -1
  42. package/dist/types/EngineServerFailureError.cjs.map +1 -1
  43. package/dist/types/EngineServerFailureError.d.cts +2 -2
  44. package/dist/types/EngineServerFailureError.d.ts +2 -2
  45. package/dist/types/EngineServerFailureError.js +1 -1
  46. package/dist/types/EngineServerFailureError.js.map +1 -1
  47. package/dist/types/clientExecuteTypes.cjs.map +1 -1
  48. package/dist/types/clientExecuteTypes.d.cts +4 -12
  49. package/dist/types/clientExecuteTypes.d.ts +4 -12
  50. package/dist/types/clientQueryTypes.cjs.map +1 -1
  51. package/dist/types/clientQueryTypes.d.cts +12 -23
  52. package/dist/types/clientQueryTypes.d.ts +12 -23
  53. package/dist/types/index.d.cts +5 -6
  54. package/dist/types/index.d.ts +5 -6
  55. package/dist/types/serverExecuteTypes.cjs.map +1 -1
  56. package/dist/types/serverExecuteTypes.d.cts +6 -14
  57. package/dist/types/serverExecuteTypes.d.ts +6 -14
  58. package/dist/types/serverQueryModelTypes.cjs.map +1 -1
  59. package/dist/types/serverQueryModelTypes.d.cts +1 -1
  60. package/dist/types/serverQueryModelTypes.d.ts +1 -1
  61. package/dist/types/serverQueryTypes.cjs.map +1 -1
  62. package/dist/types/serverQueryTypes.d.cts +3 -13
  63. package/dist/types/serverQueryTypes.d.ts +3 -13
  64. package/dist/types/serverSubscriptionEventTypes.d.cts +1 -1
  65. package/dist/types/serverSubscriptionEventTypes.d.ts +1 -1
  66. package/dist/utils/index.d.cts +1 -2
  67. package/dist/utils/index.d.ts +1 -2
  68. package/dist/utils/productEngineTypeMappers.cjs +5 -5
  69. package/dist/utils/productEngineTypeMappers.cjs.map +1 -1
  70. package/dist/utils/productEngineTypeMappers.d.cts +1 -1
  71. package/dist/utils/productEngineTypeMappers.d.ts +1 -1
  72. package/dist/utils/productEngineTypeMappers.js +1 -1
  73. package/dist/utils/productEngineTypeMappers.js.map +1 -1
  74. package/dist/utils/queryDataMappers.cjs +79 -90
  75. package/dist/utils/queryDataMappers.cjs.map +1 -1
  76. package/dist/utils/queryDataMappers.d.cts +1 -2
  77. package/dist/utils/queryDataMappers.d.ts +1 -2
  78. package/dist/utils/queryDataMappers.js +7 -19
  79. package/dist/utils/queryDataMappers.js.map +1 -1
  80. package/package.json +3 -4
  81. package/src/EngineBaseClient.ts +5 -3
  82. package/src/EngineExecuteBuilder.ts +14 -54
  83. package/src/EngineExecuteClient.ts +7 -15
  84. package/src/EngineQueryClient.ts +6 -35
  85. package/src/EngineWebClient.ts +0 -2
  86. package/src/endpoints.ts +4 -5
  87. package/src/types/EngineServerFailureError.ts +2 -2
  88. package/src/types/clientExecuteTypes.ts +5 -17
  89. package/src/types/clientQueryTypes.ts +18 -32
  90. package/src/types/serverExecuteTypes.ts +7 -18
  91. package/src/types/serverQueryModelTypes.ts +1 -1
  92. package/src/types/serverQueryTypes.ts +2 -16
  93. package/src/utils/productEngineTypeMappers.ts +1 -1
  94. package/src/utils/queryDataMappers.ts +7 -20
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/serverQueryTypes.ts"],"sourcesContent":["import { HealthStatus } from '@nadohq/contracts';\nimport {\n EngineServerHealthBreakdown,\n EngineServerPerpBalance,\n EngineServerPerpProduct,\n EngineServerProductType,\n EngineServerSpotBalance,\n EngineServerSpotProduct,\n} from './serverQueryModelTypes';\n\nexport interface EngineServerNoncesParams {\n address: string;\n}\n\nexport interface EngineServerSubaccountInfoQueryParams {\n subaccount: string;\n txns?: Array<{\n apply_delta: {\n product_id: number;\n subaccount: string;\n amount_delta: string;\n v_quote_delta: string;\n };\n }>;\n}\n\nexport interface EngineServerIsolatedPositionsQueryParams {\n subaccount: string;\n}\n\nexport interface EngineServerSymbolsQueryParams {\n product_type?: EngineServerProductType;\n product_ids?: number[];\n}\n\nexport interface EngineServerMarketPriceQueryParams {\n product_id: number;\n}\n\nexport interface EngineServerMarketPricesQueryParams {\n product_ids: number[];\n}\n\nexport interface EngineServerGetOrderQueryParams {\n product_id: number;\n digest: string;\n}\n\nexport interface EngineServerValidateOrderQueryParams {\n product_id: number;\n // Bytes for order, does not need to be signed\n order: string;\n}\n\nexport interface EngineServerOrdersQueryParams {\n sender: string;\n product_ids: number[];\n}\n\nexport interface EngineServerSubaccountOrdersQueryParams {\n sender: string;\n product_id: number;\n}\n\nexport interface EngineServerSubaccountFeeRatesParams {\n sender: string;\n}\n\nexport interface EngineServerMarketLiquidityQueryParams {\n product_id: number;\n depth: number;\n}\n\nexport interface EngineServerMaxWithdrawableQueryParams {\n sender: string;\n product_id: number;\n // If not given, engine defaults to true (leverage/borrow enabled)\n spot_leverage: string | null;\n}\n\nexport interface EngineServerMaxOrderSizeQueryParams {\n sender: string;\n product_id: number;\n price_x18: string;\n // Note: When `reduce_only` is true, `direction` must be opposite of the current position, otherwise it returns 0.\n direction: 'long' | 'short';\n // If not given, engine defaults to true (leverage/borrow enabled)\n spot_leverage: string | null;\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 reduce_only: string | null;\n}\n\nexport interface EngineServerLinkedSignerParams {\n subaccount: string;\n}\n\nexport interface EngineServerMaxMintNlpQueryParams {\n sender: string;\n // If not given, engine defaults to true (leverage/borrow enabled)\n spot_leverage: string | null;\n}\n\nexport interface EngineServerQueryRequestByType {\n all_products: Record<string, never>;\n contracts: Record<string, never>;\n edge_all_products: Record<string, never>;\n fee_rates: EngineServerSubaccountFeeRatesParams;\n health_groups: Record<string, never>;\n insurance: Record<string, never>;\n isolated_positions: EngineServerIsolatedPositionsQueryParams;\n linked_signer: EngineServerLinkedSignerParams;\n market_liquidity: EngineServerMarketLiquidityQueryParams;\n market_price: EngineServerMarketPriceQueryParams;\n market_prices: EngineServerMarketPricesQueryParams;\n max_nlp_mintable: EngineServerMaxMintNlpQueryParams;\n max_order_size: EngineServerMaxOrderSizeQueryParams;\n max_withdrawable: EngineServerMaxWithdrawableQueryParams;\n min_deposit_rates: Record<string, never>;\n nonces: EngineServerNoncesParams;\n order: EngineServerGetOrderQueryParams;\n orders: EngineServerOrdersQueryParams;\n status: Record<string, never>;\n subaccount_info: Omit<EngineServerSubaccountInfoQueryParams, 'txns'> & {\n // JSON serialized txns\n txns?: string;\n };\n subaccount_orders: EngineServerSubaccountOrdersQueryParams;\n symbols: EngineServerSymbolsQueryParams;\n validate_order: EngineServerValidateOrderQueryParams;\n}\n\nexport type EngineServerQueryRequestType = keyof EngineServerQueryRequestByType;\n\nexport type EngineServerQueryRequest<\n TRequestType extends EngineServerQueryRequestType,\n> = {\n type: TRequestType;\n} & EngineServerQueryRequestByType[TRequestType];\n\nexport interface EngineServerContractsResponse {\n chain_id: string;\n endpoint_addr: string;\n // Index is product ID\n book_addrs: string[];\n}\n\n// Unless in active state, engine is not fully operational\nexport type EngineServerStatusResponse =\n | 'started'\n | 'active'\n | 'stopping'\n | 'syncing'\n | 'live_syncing'\n | 'failed';\n\nexport interface EngineServerNoncesResponse {\n order_nonce: string;\n tx_nonce: string;\n}\n\nexport interface EngineServerSubaccountInfoResponse {\n exists: boolean;\n subaccount: string;\n healths: [\n initial: EngineServerHealthBreakdown,\n maintenance: EngineServerHealthBreakdown,\n unweighted: EngineServerHealthBreakdown,\n ];\n // First index is product ID, each subarray is of length 3 [initial, maintenance, unweighted]\n health_contributions: string[][];\n spot_count: number;\n perp_count: number;\n spot_balances: EngineServerSpotBalance[];\n perp_balances: EngineServerPerpBalance[];\n spot_products: EngineServerSpotProduct[];\n perp_products: EngineServerPerpProduct[];\n}\n\nexport interface EngineServerIsolatedPosition {\n subaccount: string;\n healths: [\n initial: HealthStatus,\n maintenance: HealthStatus,\n unweighted: HealthStatus,\n ];\n quote_healths: [initial: string, maintenance: string, unweighted: string];\n base_healths: [initial: string, maintenance: string, unweighted: string];\n quote_balance: EngineServerSpotBalance;\n base_balance: EngineServerPerpBalance;\n quote_product: EngineServerSpotProduct;\n base_product: EngineServerPerpProduct;\n}\n\nexport type EngineServerIsolatedPositionsResponse = {\n isolated_positions: EngineServerIsolatedPosition[];\n};\n\nexport interface EngineServerSymbol {\n type: EngineServerProductType;\n product_id: number;\n symbol: string;\n price_increment_x18: string;\n size_increment: string;\n min_size: string;\n min_depth_x18: string;\n max_spread_rate_x18: string;\n maker_fee_rate_x18: string;\n taker_fee_rate_x18: string;\n long_weight_initial_x18: string;\n long_weight_maintenance_x18: string;\n}\n\nexport interface EngineServerSymbolsResponse {\n symbols: Record<string, EngineServerSymbol>;\n}\n\nexport interface EngineServerAllProductsResponse {\n spot_products: EngineServerSpotProduct[];\n perp_products: EngineServerPerpProduct[];\n}\n\nexport interface EngineServerHealthGroupsResponse {\n health_groups: [spotProductId: number, perpProductId: number][];\n}\n\n// Price, liquidity pairs\nexport type EngineServerPriceTickLiquidity = [\n priceX18: string,\n liquidity: string,\n];\n\nexport interface EngineServerMarketLiquidityResponse {\n bids: EngineServerPriceTickLiquidity[];\n asks: EngineServerPriceTickLiquidity[];\n}\n\nexport interface EngineServerSubaccountOrders {\n sender: string;\n product_id: number;\n orders: EngineServerOrder[];\n}\n\nexport type EngineServerSubaccountOrdersResponse = EngineServerSubaccountOrders;\n\nexport interface EngineServerProductOrdersResponse {\n sender: string;\n product_orders: EngineServerSubaccountOrders[];\n}\n\nexport interface EngineServerFeeRatesResponse {\n liquidation_sequencer_fee: string;\n health_check_sequencer_fee: string;\n taker_sequencer_fee: string;\n // Product ID is the index\n withdraw_sequencer_fees: string[];\n taker_fee_rates_x18: string[];\n maker_fee_rates_x18: string[];\n}\n\nexport interface EngineServerMarketPrice {\n product_id: number;\n bid_x18: string;\n ask_x18: string;\n}\n\nexport type EngineServerMarketPriceResponse = EngineServerMarketPrice;\n\nexport interface EngineServerMarketPricesResponse {\n market_prices: EngineServerMarketPrice[];\n}\n\nexport interface EngineServerOrder {\n product_id: number;\n sender: string;\n price_x18: string;\n amount: string;\n expiration: string;\n nonce: string;\n unfilled_amount: string;\n digest: string;\n placed_at: number;\n order_type: string;\n margin: string | null;\n}\n\nexport type EngineServerOrderResponse = EngineServerOrder;\n\nexport interface EngineServerValidateOrderResponse {\n product_id: number;\n order: string;\n valid: boolean;\n}\n\nexport interface EngineServerMaxOrderSizeResponse {\n max_order_size: string;\n}\n\nexport interface EngineServerMaxWithdrawableResponse {\n max_withdrawable: string;\n}\n\nexport type EngineServerTimeResponse = number;\n\nexport interface EngineServerIpBlockResponse {\n blocked: boolean;\n reason: string;\n}\n\nexport interface EngineServerLinkedSignerResponse {\n linked_signer: string;\n}\n\nexport interface EngineInsuranceResponse {\n insurance: string;\n}\n\nexport interface EngineServerMinDepositRate {\n product_id: number;\n min_deposit_rate_x18: string;\n}\n\nexport interface EngineServerMinDepositRatesResponse {\n // product_id -> EngineServerMinDepositRate\n min_deposit_rates: Record<number, EngineServerMinDepositRate>;\n}\n\nexport interface EngineServerEdgeAllProductsResponse {\n // chain_id -> EngineServerAllProductsResponse\n edge_all_products: Record<number, EngineServerAllProductsResponse>;\n}\n\nexport interface EngineServerMaxMintNlpResponse {\n max_quote_amount: string;\n}\n\nexport interface EngineServerQueryResponseByType {\n all_products: EngineServerAllProductsResponse;\n contracts: EngineServerContractsResponse;\n edge_all_products: EngineServerEdgeAllProductsResponse;\n fee_rates: EngineServerFeeRatesResponse;\n health_groups: EngineServerHealthGroupsResponse;\n insurance: EngineInsuranceResponse;\n isolated_positions: EngineServerIsolatedPositionsResponse;\n linked_signer: EngineServerLinkedSignerResponse;\n market_liquidity: EngineServerMarketLiquidityResponse;\n market_price: EngineServerMarketPriceResponse;\n market_prices: EngineServerMarketPricesResponse;\n max_nlp_mintable: EngineServerMaxMintNlpResponse;\n max_order_size: EngineServerMaxOrderSizeResponse;\n max_withdrawable: EngineServerMaxWithdrawableResponse;\n min_deposit_rates: EngineServerMinDepositRatesResponse;\n nonces: EngineServerNoncesResponse;\n order: EngineServerOrderResponse;\n orders: EngineServerProductOrdersResponse;\n status: EngineServerStatusResponse;\n subaccount_info: EngineServerSubaccountInfoResponse;\n subaccount_orders: EngineServerSubaccountOrdersResponse;\n symbols: EngineServerSymbolsResponse;\n validate_order: EngineServerValidateOrderResponse;\n}\n\nexport interface EngineServerQuerySuccessResponse<\n TQueryType extends\n keyof EngineServerQueryResponseByType = EngineServerQueryRequestType,\n> {\n status: 'success';\n data: EngineServerQueryResponseByType[TQueryType];\n}\n\nexport interface EngineServerQueryFailureResponse {\n status: 'failure';\n error: string;\n error_code: number;\n}\n\nexport type EngineServerQueryResponse<\n TQueryType extends\n keyof EngineServerQueryResponseByType = EngineServerQueryRequestType,\n> =\n | EngineServerQuerySuccessResponse<TQueryType>\n | EngineServerQueryFailureResponse;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/types/serverQueryTypes.ts"],"sourcesContent":["import { HealthStatus } from '@nadohq/shared';\nimport {\n EngineServerHealthBreakdown,\n EngineServerPerpBalance,\n EngineServerPerpProduct,\n EngineServerProductType,\n EngineServerSpotBalance,\n EngineServerSpotProduct,\n} from './serverQueryModelTypes';\n\nexport interface EngineServerNoncesParams {\n address: string;\n}\n\nexport interface EngineServerSubaccountInfoQueryParams {\n subaccount: string;\n txns?: Array<{\n apply_delta: {\n product_id: number;\n subaccount: string;\n amount_delta: string;\n v_quote_delta: string;\n };\n }>;\n}\n\nexport interface EngineServerIsolatedPositionsQueryParams {\n subaccount: string;\n}\n\nexport interface EngineServerSymbolsQueryParams {\n product_type?: EngineServerProductType;\n product_ids?: number[];\n}\n\nexport interface EngineServerMarketPriceQueryParams {\n product_id: number;\n}\n\nexport interface EngineServerMarketPricesQueryParams {\n product_ids: number[];\n}\n\nexport interface EngineServerGetOrderQueryParams {\n product_id: number;\n digest: string;\n}\n\nexport interface EngineServerValidateOrderQueryParams {\n product_id: number;\n // Bytes for order, does not need to be signed\n order: string;\n}\n\nexport interface EngineServerOrdersQueryParams {\n sender: string;\n product_ids: number[];\n}\n\nexport interface EngineServerSubaccountOrdersQueryParams {\n sender: string;\n product_id: number;\n}\n\nexport interface EngineServerSubaccountFeeRatesParams {\n sender: string;\n}\n\nexport interface EngineServerMarketLiquidityQueryParams {\n product_id: number;\n depth: number;\n}\n\nexport interface EngineServerMaxWithdrawableQueryParams {\n sender: string;\n product_id: number;\n // If not given, engine defaults to true (leverage/borrow enabled)\n spot_leverage: string | null;\n}\n\nexport interface EngineServerMaxOrderSizeQueryParams {\n sender: string;\n product_id: number;\n price_x18: string;\n // Note: When `reduce_only` is true, `direction` must be opposite of the current position, otherwise it returns 0.\n direction: 'long' | 'short';\n // If not given, engine defaults to true (leverage/borrow enabled)\n spot_leverage: string | null;\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 reduce_only: string | null;\n}\n\nexport interface EngineServerLinkedSignerParams {\n subaccount: string;\n}\n\nexport interface EngineServerMaxMintNlpQueryParams {\n sender: string;\n // If not given, engine defaults to true (leverage/borrow enabled)\n spot_leverage: string | null;\n}\n\nexport interface EngineServerQueryRequestByType {\n all_products: Record<string, never>;\n contracts: Record<string, never>;\n edge_all_products: Record<string, never>;\n fee_rates: EngineServerSubaccountFeeRatesParams;\n health_groups: Record<string, never>;\n insurance: Record<string, never>;\n isolated_positions: EngineServerIsolatedPositionsQueryParams;\n linked_signer: EngineServerLinkedSignerParams;\n market_liquidity: EngineServerMarketLiquidityQueryParams;\n market_price: EngineServerMarketPriceQueryParams;\n market_prices: EngineServerMarketPricesQueryParams;\n max_nlp_mintable: EngineServerMaxMintNlpQueryParams;\n max_order_size: EngineServerMaxOrderSizeQueryParams;\n max_withdrawable: EngineServerMaxWithdrawableQueryParams;\n nonces: EngineServerNoncesParams;\n order: EngineServerGetOrderQueryParams;\n orders: EngineServerOrdersQueryParams;\n status: Record<string, never>;\n subaccount_info: Omit<EngineServerSubaccountInfoQueryParams, 'txns'> & {\n // JSON serialized txns\n txns?: string;\n };\n subaccount_orders: EngineServerSubaccountOrdersQueryParams;\n symbols: EngineServerSymbolsQueryParams;\n validate_order: EngineServerValidateOrderQueryParams;\n}\n\nexport type EngineServerQueryRequestType = keyof EngineServerQueryRequestByType;\n\nexport type EngineServerQueryRequest<\n TRequestType extends EngineServerQueryRequestType,\n> = {\n type: TRequestType;\n} & EngineServerQueryRequestByType[TRequestType];\n\nexport interface EngineServerContractsResponse {\n chain_id: string;\n endpoint_addr: string;\n}\n\n// Unless in active state, engine is not fully operational\nexport type EngineServerStatusResponse =\n | 'started'\n | 'active'\n | 'stopping'\n | 'syncing'\n | 'live_syncing'\n | 'failed';\n\nexport interface EngineServerNoncesResponse {\n order_nonce: string;\n tx_nonce: string;\n}\n\nexport interface EngineServerSubaccountInfoResponse {\n exists: boolean;\n subaccount: string;\n healths: [\n initial: EngineServerHealthBreakdown,\n maintenance: EngineServerHealthBreakdown,\n unweighted: EngineServerHealthBreakdown,\n ];\n // First index is product ID, each subarray is of length 3 [initial, maintenance, unweighted]\n health_contributions: string[][];\n spot_count: number;\n perp_count: number;\n spot_balances: EngineServerSpotBalance[];\n perp_balances: EngineServerPerpBalance[];\n spot_products: EngineServerSpotProduct[];\n perp_products: EngineServerPerpProduct[];\n}\n\nexport interface EngineServerIsolatedPosition {\n subaccount: string;\n healths: [\n initial: HealthStatus,\n maintenance: HealthStatus,\n unweighted: HealthStatus,\n ];\n quote_healths: [initial: string, maintenance: string, unweighted: string];\n base_healths: [initial: string, maintenance: string, unweighted: string];\n quote_balance: EngineServerSpotBalance;\n base_balance: EngineServerPerpBalance;\n quote_product: EngineServerSpotProduct;\n base_product: EngineServerPerpProduct;\n}\n\nexport type EngineServerIsolatedPositionsResponse = {\n isolated_positions: EngineServerIsolatedPosition[];\n};\n\nexport interface EngineServerSymbol {\n type: EngineServerProductType;\n product_id: number;\n symbol: string;\n price_increment_x18: string;\n size_increment: string;\n min_size: string;\n min_depth_x18: string;\n max_spread_rate_x18: string;\n maker_fee_rate_x18: string;\n taker_fee_rate_x18: string;\n long_weight_initial_x18: string;\n long_weight_maintenance_x18: string;\n}\n\nexport interface EngineServerSymbolsResponse {\n symbols: Record<string, EngineServerSymbol>;\n}\n\nexport interface EngineServerAllProductsResponse {\n spot_products: EngineServerSpotProduct[];\n perp_products: EngineServerPerpProduct[];\n}\n\nexport interface EngineServerHealthGroupsResponse {\n health_groups: [spotProductId: number, perpProductId: number][];\n}\n\n// Price, liquidity pairs\nexport type EngineServerPriceTickLiquidity = [\n priceX18: string,\n liquidity: string,\n];\n\nexport interface EngineServerMarketLiquidityResponse {\n bids: EngineServerPriceTickLiquidity[];\n asks: EngineServerPriceTickLiquidity[];\n}\n\nexport interface EngineServerSubaccountOrders {\n sender: string;\n product_id: number;\n orders: EngineServerOrder[];\n}\n\nexport type EngineServerSubaccountOrdersResponse = EngineServerSubaccountOrders;\n\nexport interface EngineServerProductOrdersResponse {\n sender: string;\n product_orders: EngineServerSubaccountOrders[];\n}\n\nexport interface EngineServerFeeRatesResponse {\n liquidation_sequencer_fee: string;\n health_check_sequencer_fee: string;\n taker_sequencer_fee: string;\n // Product ID is the index\n withdraw_sequencer_fees: string[];\n taker_fee_rates_x18: string[];\n maker_fee_rates_x18: string[];\n}\n\nexport interface EngineServerMarketPrice {\n product_id: number;\n bid_x18: string;\n ask_x18: string;\n}\n\nexport type EngineServerMarketPriceResponse = EngineServerMarketPrice;\n\nexport interface EngineServerMarketPricesResponse {\n market_prices: EngineServerMarketPrice[];\n}\n\nexport interface EngineServerOrder {\n product_id: number;\n sender: string;\n price_x18: string;\n amount: string;\n expiration: string;\n nonce: string;\n unfilled_amount: string;\n digest: string;\n placed_at: number;\n order_type: string;\n appendix: string;\n}\n\nexport type EngineServerOrderResponse = EngineServerOrder;\n\nexport interface EngineServerValidateOrderResponse {\n product_id: number;\n order: string;\n valid: boolean;\n}\n\nexport interface EngineServerMaxOrderSizeResponse {\n max_order_size: string;\n}\n\nexport interface EngineServerMaxWithdrawableResponse {\n max_withdrawable: string;\n}\n\nexport type EngineServerTimeResponse = number;\n\nexport interface EngineServerIpBlockResponse {\n blocked: boolean;\n reason: string;\n}\n\nexport interface EngineServerLinkedSignerResponse {\n linked_signer: string;\n}\n\nexport interface EngineInsuranceResponse {\n insurance: string;\n}\n\nexport interface EngineServerEdgeAllProductsResponse {\n // chain_id -> EngineServerAllProductsResponse\n edge_all_products: Record<number, EngineServerAllProductsResponse>;\n}\n\nexport interface EngineServerMaxMintNlpResponse {\n max_quote_amount: string;\n}\n\nexport interface EngineServerQueryResponseByType {\n all_products: EngineServerAllProductsResponse;\n contracts: EngineServerContractsResponse;\n edge_all_products: EngineServerEdgeAllProductsResponse;\n fee_rates: EngineServerFeeRatesResponse;\n health_groups: EngineServerHealthGroupsResponse;\n insurance: EngineInsuranceResponse;\n isolated_positions: EngineServerIsolatedPositionsResponse;\n linked_signer: EngineServerLinkedSignerResponse;\n market_liquidity: EngineServerMarketLiquidityResponse;\n market_price: EngineServerMarketPriceResponse;\n market_prices: EngineServerMarketPricesResponse;\n max_nlp_mintable: EngineServerMaxMintNlpResponse;\n max_order_size: EngineServerMaxOrderSizeResponse;\n max_withdrawable: EngineServerMaxWithdrawableResponse;\n nonces: EngineServerNoncesResponse;\n order: EngineServerOrderResponse;\n orders: EngineServerProductOrdersResponse;\n status: EngineServerStatusResponse;\n subaccount_info: EngineServerSubaccountInfoResponse;\n subaccount_orders: EngineServerSubaccountOrdersResponse;\n symbols: EngineServerSymbolsResponse;\n validate_order: EngineServerValidateOrderResponse;\n}\n\nexport interface EngineServerQuerySuccessResponse<\n TQueryType extends\n keyof EngineServerQueryResponseByType = EngineServerQueryRequestType,\n> {\n status: 'success';\n data: EngineServerQueryResponseByType[TQueryType];\n}\n\nexport interface EngineServerQueryFailureResponse {\n status: 'failure';\n error: string;\n error_code: number;\n}\n\nexport type EngineServerQueryResponse<\n TQueryType extends\n keyof EngineServerQueryResponseByType = EngineServerQueryRequestType,\n> =\n | EngineServerQuerySuccessResponse<TQueryType>\n | EngineServerQueryFailureResponse;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,4 +1,4 @@
1
- import { HealthStatus } from '@nadohq/contracts';
1
+ import { HealthStatus } from '@nadohq/shared';
2
2
  import { EngineServerProductType, EngineServerSpotProduct, EngineServerPerpProduct, EngineServerSpotBalance, EngineServerPerpBalance, EngineServerHealthBreakdown } from './serverQueryModelTypes.cjs';
3
3
 
4
4
  interface EngineServerNoncesParams {
@@ -86,7 +86,6 @@ interface EngineServerQueryRequestByType {
86
86
  max_nlp_mintable: EngineServerMaxMintNlpQueryParams;
87
87
  max_order_size: EngineServerMaxOrderSizeQueryParams;
88
88
  max_withdrawable: EngineServerMaxWithdrawableQueryParams;
89
- min_deposit_rates: Record<string, never>;
90
89
  nonces: EngineServerNoncesParams;
91
90
  order: EngineServerGetOrderQueryParams;
92
91
  orders: EngineServerOrdersQueryParams;
@@ -105,7 +104,6 @@ type EngineServerQueryRequest<TRequestType extends EngineServerQueryRequestType>
105
104
  interface EngineServerContractsResponse {
106
105
  chain_id: string;
107
106
  endpoint_addr: string;
108
- book_addrs: string[];
109
107
  }
110
108
  type EngineServerStatusResponse = 'started' | 'active' | 'stopping' | 'syncing' | 'live_syncing' | 'failed';
111
109
  interface EngineServerNoncesResponse {
@@ -215,7 +213,7 @@ interface EngineServerOrder {
215
213
  digest: string;
216
214
  placed_at: number;
217
215
  order_type: string;
218
- margin: string | null;
216
+ appendix: string;
219
217
  }
220
218
  type EngineServerOrderResponse = EngineServerOrder;
221
219
  interface EngineServerValidateOrderResponse {
@@ -240,13 +238,6 @@ interface EngineServerLinkedSignerResponse {
240
238
  interface EngineInsuranceResponse {
241
239
  insurance: string;
242
240
  }
243
- interface EngineServerMinDepositRate {
244
- product_id: number;
245
- min_deposit_rate_x18: string;
246
- }
247
- interface EngineServerMinDepositRatesResponse {
248
- min_deposit_rates: Record<number, EngineServerMinDepositRate>;
249
- }
250
241
  interface EngineServerEdgeAllProductsResponse {
251
242
  edge_all_products: Record<number, EngineServerAllProductsResponse>;
252
243
  }
@@ -268,7 +259,6 @@ interface EngineServerQueryResponseByType {
268
259
  max_nlp_mintable: EngineServerMaxMintNlpResponse;
269
260
  max_order_size: EngineServerMaxOrderSizeResponse;
270
261
  max_withdrawable: EngineServerMaxWithdrawableResponse;
271
- min_deposit_rates: EngineServerMinDepositRatesResponse;
272
262
  nonces: EngineServerNoncesResponse;
273
263
  order: EngineServerOrderResponse;
274
264
  orders: EngineServerProductOrdersResponse;
@@ -289,4 +279,4 @@ interface EngineServerQueryFailureResponse {
289
279
  }
290
280
  type EngineServerQueryResponse<TQueryType extends keyof EngineServerQueryResponseByType = EngineServerQueryRequestType> = EngineServerQuerySuccessResponse<TQueryType> | EngineServerQueryFailureResponse;
291
281
 
292
- export type { EngineInsuranceResponse, EngineServerAllProductsResponse, EngineServerContractsResponse, EngineServerEdgeAllProductsResponse, EngineServerFeeRatesResponse, EngineServerGetOrderQueryParams, EngineServerHealthGroupsResponse, EngineServerIpBlockResponse, EngineServerIsolatedPosition, EngineServerIsolatedPositionsQueryParams, EngineServerIsolatedPositionsResponse, EngineServerLinkedSignerParams, EngineServerLinkedSignerResponse, EngineServerMarketLiquidityQueryParams, EngineServerMarketLiquidityResponse, EngineServerMarketPrice, EngineServerMarketPriceQueryParams, EngineServerMarketPriceResponse, EngineServerMarketPricesQueryParams, EngineServerMarketPricesResponse, EngineServerMaxMintNlpQueryParams, EngineServerMaxMintNlpResponse, EngineServerMaxOrderSizeQueryParams, EngineServerMaxOrderSizeResponse, EngineServerMaxWithdrawableQueryParams, EngineServerMaxWithdrawableResponse, EngineServerMinDepositRate, EngineServerMinDepositRatesResponse, EngineServerNoncesParams, EngineServerNoncesResponse, EngineServerOrder, EngineServerOrderResponse, EngineServerOrdersQueryParams, EngineServerPriceTickLiquidity, EngineServerProductOrdersResponse, EngineServerQueryFailureResponse, EngineServerQueryRequest, EngineServerQueryRequestByType, EngineServerQueryRequestType, EngineServerQueryResponse, EngineServerQueryResponseByType, EngineServerQuerySuccessResponse, EngineServerStatusResponse, EngineServerSubaccountFeeRatesParams, EngineServerSubaccountInfoQueryParams, EngineServerSubaccountInfoResponse, EngineServerSubaccountOrders, EngineServerSubaccountOrdersQueryParams, EngineServerSubaccountOrdersResponse, EngineServerSymbol, EngineServerSymbolsQueryParams, EngineServerSymbolsResponse, EngineServerTimeResponse, EngineServerValidateOrderQueryParams, EngineServerValidateOrderResponse };
282
+ export type { EngineInsuranceResponse, EngineServerAllProductsResponse, EngineServerContractsResponse, EngineServerEdgeAllProductsResponse, EngineServerFeeRatesResponse, EngineServerGetOrderQueryParams, EngineServerHealthGroupsResponse, EngineServerIpBlockResponse, EngineServerIsolatedPosition, EngineServerIsolatedPositionsQueryParams, EngineServerIsolatedPositionsResponse, EngineServerLinkedSignerParams, EngineServerLinkedSignerResponse, EngineServerMarketLiquidityQueryParams, EngineServerMarketLiquidityResponse, EngineServerMarketPrice, EngineServerMarketPriceQueryParams, EngineServerMarketPriceResponse, EngineServerMarketPricesQueryParams, EngineServerMarketPricesResponse, EngineServerMaxMintNlpQueryParams, EngineServerMaxMintNlpResponse, EngineServerMaxOrderSizeQueryParams, EngineServerMaxOrderSizeResponse, EngineServerMaxWithdrawableQueryParams, EngineServerMaxWithdrawableResponse, EngineServerNoncesParams, EngineServerNoncesResponse, EngineServerOrder, EngineServerOrderResponse, EngineServerOrdersQueryParams, EngineServerPriceTickLiquidity, EngineServerProductOrdersResponse, EngineServerQueryFailureResponse, EngineServerQueryRequest, EngineServerQueryRequestByType, EngineServerQueryRequestType, EngineServerQueryResponse, EngineServerQueryResponseByType, EngineServerQuerySuccessResponse, EngineServerStatusResponse, EngineServerSubaccountFeeRatesParams, EngineServerSubaccountInfoQueryParams, EngineServerSubaccountInfoResponse, EngineServerSubaccountOrders, EngineServerSubaccountOrdersQueryParams, EngineServerSubaccountOrdersResponse, EngineServerSymbol, EngineServerSymbolsQueryParams, EngineServerSymbolsResponse, EngineServerTimeResponse, EngineServerValidateOrderQueryParams, EngineServerValidateOrderResponse };
@@ -1,4 +1,4 @@
1
- import { HealthStatus } from '@nadohq/contracts';
1
+ import { HealthStatus } from '@nadohq/shared';
2
2
  import { EngineServerProductType, EngineServerSpotProduct, EngineServerPerpProduct, EngineServerSpotBalance, EngineServerPerpBalance, EngineServerHealthBreakdown } from './serverQueryModelTypes.js';
3
3
 
4
4
  interface EngineServerNoncesParams {
@@ -86,7 +86,6 @@ interface EngineServerQueryRequestByType {
86
86
  max_nlp_mintable: EngineServerMaxMintNlpQueryParams;
87
87
  max_order_size: EngineServerMaxOrderSizeQueryParams;
88
88
  max_withdrawable: EngineServerMaxWithdrawableQueryParams;
89
- min_deposit_rates: Record<string, never>;
90
89
  nonces: EngineServerNoncesParams;
91
90
  order: EngineServerGetOrderQueryParams;
92
91
  orders: EngineServerOrdersQueryParams;
@@ -105,7 +104,6 @@ type EngineServerQueryRequest<TRequestType extends EngineServerQueryRequestType>
105
104
  interface EngineServerContractsResponse {
106
105
  chain_id: string;
107
106
  endpoint_addr: string;
108
- book_addrs: string[];
109
107
  }
110
108
  type EngineServerStatusResponse = 'started' | 'active' | 'stopping' | 'syncing' | 'live_syncing' | 'failed';
111
109
  interface EngineServerNoncesResponse {
@@ -215,7 +213,7 @@ interface EngineServerOrder {
215
213
  digest: string;
216
214
  placed_at: number;
217
215
  order_type: string;
218
- margin: string | null;
216
+ appendix: string;
219
217
  }
220
218
  type EngineServerOrderResponse = EngineServerOrder;
221
219
  interface EngineServerValidateOrderResponse {
@@ -240,13 +238,6 @@ interface EngineServerLinkedSignerResponse {
240
238
  interface EngineInsuranceResponse {
241
239
  insurance: string;
242
240
  }
243
- interface EngineServerMinDepositRate {
244
- product_id: number;
245
- min_deposit_rate_x18: string;
246
- }
247
- interface EngineServerMinDepositRatesResponse {
248
- min_deposit_rates: Record<number, EngineServerMinDepositRate>;
249
- }
250
241
  interface EngineServerEdgeAllProductsResponse {
251
242
  edge_all_products: Record<number, EngineServerAllProductsResponse>;
252
243
  }
@@ -268,7 +259,6 @@ interface EngineServerQueryResponseByType {
268
259
  max_nlp_mintable: EngineServerMaxMintNlpResponse;
269
260
  max_order_size: EngineServerMaxOrderSizeResponse;
270
261
  max_withdrawable: EngineServerMaxWithdrawableResponse;
271
- min_deposit_rates: EngineServerMinDepositRatesResponse;
272
262
  nonces: EngineServerNoncesResponse;
273
263
  order: EngineServerOrderResponse;
274
264
  orders: EngineServerProductOrdersResponse;
@@ -289,4 +279,4 @@ interface EngineServerQueryFailureResponse {
289
279
  }
290
280
  type EngineServerQueryResponse<TQueryType extends keyof EngineServerQueryResponseByType = EngineServerQueryRequestType> = EngineServerQuerySuccessResponse<TQueryType> | EngineServerQueryFailureResponse;
291
281
 
292
- export type { EngineInsuranceResponse, EngineServerAllProductsResponse, EngineServerContractsResponse, EngineServerEdgeAllProductsResponse, EngineServerFeeRatesResponse, EngineServerGetOrderQueryParams, EngineServerHealthGroupsResponse, EngineServerIpBlockResponse, EngineServerIsolatedPosition, EngineServerIsolatedPositionsQueryParams, EngineServerIsolatedPositionsResponse, EngineServerLinkedSignerParams, EngineServerLinkedSignerResponse, EngineServerMarketLiquidityQueryParams, EngineServerMarketLiquidityResponse, EngineServerMarketPrice, EngineServerMarketPriceQueryParams, EngineServerMarketPriceResponse, EngineServerMarketPricesQueryParams, EngineServerMarketPricesResponse, EngineServerMaxMintNlpQueryParams, EngineServerMaxMintNlpResponse, EngineServerMaxOrderSizeQueryParams, EngineServerMaxOrderSizeResponse, EngineServerMaxWithdrawableQueryParams, EngineServerMaxWithdrawableResponse, EngineServerMinDepositRate, EngineServerMinDepositRatesResponse, EngineServerNoncesParams, EngineServerNoncesResponse, EngineServerOrder, EngineServerOrderResponse, EngineServerOrdersQueryParams, EngineServerPriceTickLiquidity, EngineServerProductOrdersResponse, EngineServerQueryFailureResponse, EngineServerQueryRequest, EngineServerQueryRequestByType, EngineServerQueryRequestType, EngineServerQueryResponse, EngineServerQueryResponseByType, EngineServerQuerySuccessResponse, EngineServerStatusResponse, EngineServerSubaccountFeeRatesParams, EngineServerSubaccountInfoQueryParams, EngineServerSubaccountInfoResponse, EngineServerSubaccountOrders, EngineServerSubaccountOrdersQueryParams, EngineServerSubaccountOrdersResponse, EngineServerSymbol, EngineServerSymbolsQueryParams, EngineServerSymbolsResponse, EngineServerTimeResponse, EngineServerValidateOrderQueryParams, EngineServerValidateOrderResponse };
282
+ export type { EngineInsuranceResponse, EngineServerAllProductsResponse, EngineServerContractsResponse, EngineServerEdgeAllProductsResponse, EngineServerFeeRatesResponse, EngineServerGetOrderQueryParams, EngineServerHealthGroupsResponse, EngineServerIpBlockResponse, EngineServerIsolatedPosition, EngineServerIsolatedPositionsQueryParams, EngineServerIsolatedPositionsResponse, EngineServerLinkedSignerParams, EngineServerLinkedSignerResponse, EngineServerMarketLiquidityQueryParams, EngineServerMarketLiquidityResponse, EngineServerMarketPrice, EngineServerMarketPriceQueryParams, EngineServerMarketPriceResponse, EngineServerMarketPricesQueryParams, EngineServerMarketPricesResponse, EngineServerMaxMintNlpQueryParams, EngineServerMaxMintNlpResponse, EngineServerMaxOrderSizeQueryParams, EngineServerMaxOrderSizeResponse, EngineServerMaxWithdrawableQueryParams, EngineServerMaxWithdrawableResponse, EngineServerNoncesParams, EngineServerNoncesResponse, EngineServerOrder, EngineServerOrderResponse, EngineServerOrdersQueryParams, EngineServerPriceTickLiquidity, EngineServerProductOrdersResponse, EngineServerQueryFailureResponse, EngineServerQueryRequest, EngineServerQueryRequestByType, EngineServerQueryRequestType, EngineServerQueryResponse, EngineServerQueryResponseByType, EngineServerQuerySuccessResponse, EngineServerStatusResponse, EngineServerSubaccountFeeRatesParams, EngineServerSubaccountInfoQueryParams, EngineServerSubaccountInfoResponse, EngineServerSubaccountOrders, EngineServerSubaccountOrdersQueryParams, EngineServerSubaccountOrdersResponse, EngineServerSymbol, EngineServerSymbolsQueryParams, EngineServerSymbolsResponse, EngineServerTimeResponse, EngineServerValidateOrderQueryParams, EngineServerValidateOrderResponse };
@@ -1,5 +1,5 @@
1
1
  import { EngineServerPriceTickLiquidity } from './serverQueryTypes.cjs';
2
- import '@nadohq/contracts';
2
+ import '@nadohq/shared';
3
3
  import './serverQueryModelTypes.cjs';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { EngineServerPriceTickLiquidity } from './serverQueryTypes.js';
2
- import '@nadohq/contracts';
2
+ import '@nadohq/shared';
3
3
  import './serverQueryModelTypes.js';
4
4
 
5
5
  /**
@@ -1,6 +1,5 @@
1
1
  export { mapEngineMarketPrice, mapEngineServerBalanceHealthContributions, mapEngineServerIsolatedPositions, mapEngineServerOrder, mapEngineServerPerpProduct, mapEngineServerSpotProduct, mapEngineServerSymbol, mapEngineServerSymbols, mapEngineServerTickLiquidity, mapSubaccountSummary } from './queryDataMappers.cjs';
2
- import '@nadohq/contracts';
2
+ import '@nadohq/shared';
3
3
  import '../types/clientQueryTypes.cjs';
4
- import '@nadohq/utils';
5
4
  import '../types/serverQueryTypes.cjs';
6
5
  import '../types/serverQueryModelTypes.cjs';
@@ -1,6 +1,5 @@
1
1
  export { mapEngineMarketPrice, mapEngineServerBalanceHealthContributions, mapEngineServerIsolatedPositions, mapEngineServerOrder, mapEngineServerPerpProduct, mapEngineServerSpotProduct, mapEngineServerSymbol, mapEngineServerSymbols, mapEngineServerTickLiquidity, mapSubaccountSummary } from './queryDataMappers.js';
2
- import '@nadohq/contracts';
2
+ import '@nadohq/shared';
3
3
  import '../types/clientQueryTypes.js';
4
- import '@nadohq/utils';
5
4
  import '../types/serverQueryTypes.js';
6
5
  import '../types/serverQueryModelTypes.js';
@@ -24,21 +24,21 @@ __export(productEngineTypeMappers_exports, {
24
24
  mapProductEngineType: () => mapProductEngineType
25
25
  });
26
26
  module.exports = __toCommonJS(productEngineTypeMappers_exports);
27
- var import_contracts = require("@nadohq/contracts");
27
+ var import_shared = require("@nadohq/shared");
28
28
  function mapProductEngineType(productEngineType) {
29
29
  switch (productEngineType) {
30
- case import_contracts.ProductEngineType.SPOT:
30
+ case import_shared.ProductEngineType.SPOT:
31
31
  return "spot";
32
- case import_contracts.ProductEngineType.PERP:
32
+ case import_shared.ProductEngineType.PERP:
33
33
  return "perp";
34
34
  }
35
35
  }
36
36
  function mapEngineServerProductType(productEngineServerType) {
37
37
  switch (productEngineServerType) {
38
38
  case "spot":
39
- return import_contracts.ProductEngineType.SPOT;
39
+ return import_shared.ProductEngineType.SPOT;
40
40
  case "perp":
41
- return import_contracts.ProductEngineType.PERP;
41
+ return import_shared.ProductEngineType.PERP;
42
42
  }
43
43
  }
44
44
  // Annotate the CommonJS export names for ESM import in node:
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/productEngineTypeMappers.ts"],"sourcesContent":["import { ProductEngineType } from '@nadohq/contracts';\nimport { EngineServerProductType } from '../types';\n\nexport function mapProductEngineType(\n productEngineType: ProductEngineType,\n): EngineServerProductType {\n switch (productEngineType) {\n case ProductEngineType.SPOT:\n return 'spot';\n case ProductEngineType.PERP:\n return 'perp';\n }\n}\n\nexport function mapEngineServerProductType(\n productEngineServerType: EngineServerProductType,\n): ProductEngineType {\n switch (productEngineServerType) {\n case 'spot':\n return ProductEngineType.SPOT;\n case 'perp':\n return ProductEngineType.PERP;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAkC;AAG3B,SAAS,qBACd,mBACyB;AACzB,UAAQ,mBAAmB;AAAA,IACzB,KAAK,mCAAkB;AACrB,aAAO;AAAA,IACT,KAAK,mCAAkB;AACrB,aAAO;AAAA,EACX;AACF;AAEO,SAAS,2BACd,yBACmB;AACnB,UAAQ,yBAAyB;AAAA,IAC/B,KAAK;AACH,aAAO,mCAAkB;AAAA,IAC3B,KAAK;AACH,aAAO,mCAAkB;AAAA,EAC7B;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/utils/productEngineTypeMappers.ts"],"sourcesContent":["import { ProductEngineType } from '@nadohq/shared';\nimport { EngineServerProductType } from '../types';\n\nexport function mapProductEngineType(\n productEngineType: ProductEngineType,\n): EngineServerProductType {\n switch (productEngineType) {\n case ProductEngineType.SPOT:\n return 'spot';\n case ProductEngineType.PERP:\n return 'perp';\n }\n}\n\nexport function mapEngineServerProductType(\n productEngineServerType: EngineServerProductType,\n): ProductEngineType {\n switch (productEngineServerType) {\n case 'spot':\n return ProductEngineType.SPOT;\n case 'perp':\n return ProductEngineType.PERP;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAkC;AAG3B,SAAS,qBACd,mBACyB;AACzB,UAAQ,mBAAmB;AAAA,IACzB,KAAK,gCAAkB;AACrB,aAAO;AAAA,IACT,KAAK,gCAAkB;AACrB,aAAO;AAAA,EACX;AACF;AAEO,SAAS,2BACd,yBACmB;AACnB,UAAQ,yBAAyB;AAAA,IAC/B,KAAK;AACH,aAAO,gCAAkB;AAAA,IAC3B,KAAK;AACH,aAAO,gCAAkB;AAAA,EAC7B;AACF;","names":[]}
@@ -1,4 +1,4 @@
1
- import { ProductEngineType } from '@nadohq/contracts';
1
+ import { ProductEngineType } from '@nadohq/shared';
2
2
  import { EngineServerProductType } from '../types/serverQueryModelTypes.cjs';
3
3
 
4
4
  declare function mapProductEngineType(productEngineType: ProductEngineType): EngineServerProductType;
@@ -1,4 +1,4 @@
1
- import { ProductEngineType } from '@nadohq/contracts';
1
+ import { ProductEngineType } from '@nadohq/shared';
2
2
  import { EngineServerProductType } from '../types/serverQueryModelTypes.js';
3
3
 
4
4
  declare function mapProductEngineType(productEngineType: ProductEngineType): EngineServerProductType;
@@ -1,5 +1,5 @@
1
1
  // src/utils/productEngineTypeMappers.ts
2
- import { ProductEngineType } from "@nadohq/contracts";
2
+ import { ProductEngineType } from "@nadohq/shared";
3
3
  function mapProductEngineType(productEngineType) {
4
4
  switch (productEngineType) {
5
5
  case ProductEngineType.SPOT:
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/productEngineTypeMappers.ts"],"sourcesContent":["import { ProductEngineType } from '@nadohq/contracts';\nimport { EngineServerProductType } from '../types';\n\nexport function mapProductEngineType(\n productEngineType: ProductEngineType,\n): EngineServerProductType {\n switch (productEngineType) {\n case ProductEngineType.SPOT:\n return 'spot';\n case ProductEngineType.PERP:\n return 'perp';\n }\n}\n\nexport function mapEngineServerProductType(\n productEngineServerType: EngineServerProductType,\n): ProductEngineType {\n switch (productEngineServerType) {\n case 'spot':\n return ProductEngineType.SPOT;\n case 'perp':\n return ProductEngineType.PERP;\n }\n}\n"],"mappings":";AAAA,SAAS,yBAAyB;AAG3B,SAAS,qBACd,mBACyB;AACzB,UAAQ,mBAAmB;AAAA,IACzB,KAAK,kBAAkB;AACrB,aAAO;AAAA,IACT,KAAK,kBAAkB;AACrB,aAAO;AAAA,EACX;AACF;AAEO,SAAS,2BACd,yBACmB;AACnB,UAAQ,yBAAyB;AAAA,IAC/B,KAAK;AACH,aAAO,kBAAkB;AAAA,IAC3B,KAAK;AACH,aAAO,kBAAkB;AAAA,EAC7B;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/utils/productEngineTypeMappers.ts"],"sourcesContent":["import { ProductEngineType } from '@nadohq/shared';\nimport { EngineServerProductType } from '../types';\n\nexport function mapProductEngineType(\n productEngineType: ProductEngineType,\n): EngineServerProductType {\n switch (productEngineType) {\n case ProductEngineType.SPOT:\n return 'spot';\n case ProductEngineType.PERP:\n return 'perp';\n }\n}\n\nexport function mapEngineServerProductType(\n productEngineServerType: EngineServerProductType,\n): ProductEngineType {\n switch (productEngineServerType) {\n case 'spot':\n return ProductEngineType.SPOT;\n case 'perp':\n return ProductEngineType.PERP;\n }\n}\n"],"mappings":";AAAA,SAAS,yBAAyB;AAG3B,SAAS,qBACd,mBACyB;AACzB,UAAQ,mBAAmB;AAAA,IACzB,KAAK,kBAAkB;AACrB,aAAO;AAAA,IACT,KAAK,kBAAkB;AACrB,aAAO;AAAA,EACX;AACF;AAEO,SAAS,2BACd,yBACmB;AACnB,UAAQ,yBAAyB;AAAA,IAC/B,KAAK;AACH,aAAO,kBAAkB;AAAA,IAC3B,KAAK;AACH,aAAO,kBAAkB;AAAA,EAC7B;AACF;","names":[]}
@@ -32,73 +32,62 @@ __export(queryDataMappers_exports, {
32
32
  mapSubaccountSummary: () => mapSubaccountSummary
33
33
  });
34
34
  module.exports = __toCommonJS(queryDataMappers_exports);
35
- var import_contracts = require("@nadohq/contracts");
36
- var import_utils = require("@nadohq/utils");
35
+ var import_shared = require("@nadohq/shared");
37
36
  var import_productEngineTypeMappers = require("./productEngineTypeMappers.cjs");
38
37
  function mapEngineServerTickLiquidity(tick) {
39
38
  return {
40
- price: (0, import_utils.removeDecimals)(tick[0]),
41
- liquidity: (0, import_utils.toBigDecimal)(tick[1])
39
+ price: (0, import_shared.removeDecimals)(tick[0]),
40
+ liquidity: (0, import_shared.toBigDecimal)(tick[1])
42
41
  };
43
42
  }
44
43
  function mapEngineServerOrder(order) {
45
- const subaccount = (0, import_contracts.subaccountFromHex)(order.sender);
44
+ const subaccount = (0, import_shared.subaccountFromHex)(order.sender);
46
45
  return {
47
46
  digest: order.digest,
48
- expiration: (0, import_utils.toBigDecimal)(order.expiration),
47
+ expiration: Number(order.expiration),
49
48
  nonce: order.nonce,
50
- price: (0, import_utils.removeDecimals)(order.price_x18),
49
+ price: (0, import_shared.removeDecimals)(order.price_x18),
51
50
  productId: order.product_id,
52
51
  subaccountOwner: subaccount.subaccountOwner,
53
52
  subaccountName: subaccount.subaccountName,
54
- totalAmount: (0, import_utils.toBigDecimal)(order.amount),
55
- unfilledAmount: (0, import_utils.toBigDecimal)(order.unfilled_amount),
56
- margin: order.margin ? (0, import_utils.toBigDecimal)(order.margin) : null,
57
- // Standardizes from hex
58
- // toFixed is required as toString gives values with `e`
59
- orderParams: {
60
- amount: (0, import_utils.toIntegerString)(order.amount),
61
- expiration: (0, import_utils.toIntegerString)(order.expiration),
62
- nonce: order.nonce,
63
- price: (0, import_utils.toIntegerString)((0, import_utils.removeDecimals)(order.price_x18)),
64
- subaccountOwner: subaccount.subaccountOwner,
65
- subaccountName: subaccount.subaccountName
66
- },
53
+ totalAmount: (0, import_shared.toBigDecimal)(order.amount),
54
+ unfilledAmount: (0, import_shared.toBigDecimal)(order.unfilled_amount),
67
55
  placementTime: order.placed_at,
68
- orderType: order.order_type
56
+ appendix: (0, import_shared.unpackOrderAppendix)(order.appendix)
69
57
  };
70
58
  }
71
59
  function mapEngineServerSpotProduct(product) {
72
60
  return {
73
- type: import_contracts.ProductEngineType.SPOT,
61
+ type: import_shared.ProductEngineType.SPOT,
74
62
  productId: product.product_id,
75
- minSize: (0, import_utils.toBigDecimal)(product.book_info.min_size),
76
- priceIncrement: (0, import_utils.removeDecimals)(product.book_info.price_increment_x18),
77
- sizeIncrement: (0, import_utils.toBigDecimal)(product.book_info.size_increment),
63
+ minSize: (0, import_shared.toBigDecimal)(product.book_info.min_size),
64
+ priceIncrement: (0, import_shared.removeDecimals)(product.book_info.price_increment_x18),
65
+ sizeIncrement: (0, import_shared.toBigDecimal)(product.book_info.size_increment),
78
66
  product: {
79
67
  productId: product.product_id,
80
- type: import_contracts.ProductEngineType.SPOT,
81
- totalBorrowed: (0, import_contracts.calcTotalBorrowed)(
68
+ type: import_shared.ProductEngineType.SPOT,
69
+ totalBorrowed: (0, import_shared.calcTotalBorrowed)(
82
70
  product.state.total_borrows_normalized,
83
71
  product.state.cumulative_borrows_multiplier_x18
84
72
  ),
85
- totalDeposited: (0, import_contracts.calcTotalDeposited)(
73
+ totalDeposited: (0, import_shared.calcTotalDeposited)(
86
74
  product.state.total_deposits_normalized,
87
75
  product.state.cumulative_deposits_multiplier_x18
88
76
  ),
89
- oraclePrice: (0, import_utils.removeDecimals)(product.oracle_price_x18),
90
- interestFloor: (0, import_utils.removeDecimals)(product.config.interest_floor_x18),
91
- interestInflectionUtil: (0, import_utils.removeDecimals)(
77
+ oraclePrice: (0, import_shared.removeDecimals)(product.oracle_price_x18),
78
+ interestFloor: (0, import_shared.removeDecimals)(product.config.interest_floor_x18),
79
+ interestInflectionUtil: (0, import_shared.removeDecimals)(
92
80
  product.config.interest_inflection_util_x18
93
81
  ),
94
- interestLargeCap: (0, import_utils.removeDecimals)(product.config.interest_large_cap_x18),
95
- interestSmallCap: (0, import_utils.removeDecimals)(product.config.interest_small_cap_x18),
96
- longWeightInitial: (0, import_utils.removeDecimals)(product.risk.long_weight_initial_x18),
97
- longWeightMaintenance: (0, import_utils.removeDecimals)(
82
+ interestLargeCap: (0, import_shared.removeDecimals)(product.config.interest_large_cap_x18),
83
+ interestSmallCap: (0, import_shared.removeDecimals)(product.config.interest_small_cap_x18),
84
+ minDepositRate: (0, import_shared.removeDecimals)(product.config.min_deposit_rate_x18),
85
+ longWeightInitial: (0, import_shared.removeDecimals)(product.risk.long_weight_initial_x18),
86
+ longWeightMaintenance: (0, import_shared.removeDecimals)(
98
87
  product.risk.long_weight_maintenance_x18
99
88
  ),
100
- shortWeightInitial: (0, import_utils.removeDecimals)(product.risk.short_weight_initial_x18),
101
- shortWeightMaintenance: (0, import_utils.removeDecimals)(
89
+ shortWeightInitial: (0, import_shared.removeDecimals)(product.risk.short_weight_initial_x18),
90
+ shortWeightMaintenance: (0, import_shared.removeDecimals)(
102
91
  product.risk.short_weight_maintenance_x18
103
92
  ),
104
93
  tokenAddr: product.config.token
@@ -107,28 +96,28 @@ function mapEngineServerSpotProduct(product) {
107
96
  }
108
97
  function mapEngineServerPerpProduct(product) {
109
98
  return {
110
- type: import_contracts.ProductEngineType.PERP,
99
+ type: import_shared.ProductEngineType.PERP,
111
100
  productId: product.product_id,
112
- minSize: (0, import_utils.toBigDecimal)(product.book_info.min_size),
113
- priceIncrement: (0, import_utils.removeDecimals)(product.book_info.price_increment_x18),
114
- sizeIncrement: (0, import_utils.toBigDecimal)(product.book_info.size_increment),
101
+ minSize: (0, import_shared.toBigDecimal)(product.book_info.min_size),
102
+ priceIncrement: (0, import_shared.removeDecimals)(product.book_info.price_increment_x18),
103
+ sizeIncrement: (0, import_shared.toBigDecimal)(product.book_info.size_increment),
115
104
  product: {
116
105
  productId: product.product_id,
117
- type: import_contracts.ProductEngineType.PERP,
118
- oraclePrice: (0, import_utils.removeDecimals)(product.oracle_price_x18),
119
- longWeightInitial: (0, import_utils.removeDecimals)(product.risk.long_weight_initial_x18),
120
- longWeightMaintenance: (0, import_utils.removeDecimals)(
106
+ type: import_shared.ProductEngineType.PERP,
107
+ oraclePrice: (0, import_shared.removeDecimals)(product.oracle_price_x18),
108
+ longWeightInitial: (0, import_shared.removeDecimals)(product.risk.long_weight_initial_x18),
109
+ longWeightMaintenance: (0, import_shared.removeDecimals)(
121
110
  product.risk.long_weight_maintenance_x18
122
111
  ),
123
- shortWeightInitial: (0, import_utils.removeDecimals)(product.risk.short_weight_initial_x18),
124
- shortWeightMaintenance: (0, import_utils.removeDecimals)(
112
+ shortWeightInitial: (0, import_shared.removeDecimals)(product.risk.short_weight_initial_x18),
113
+ shortWeightMaintenance: (0, import_shared.removeDecimals)(
125
114
  product.risk.short_weight_maintenance_x18
126
115
  ),
127
- openInterest: (0, import_utils.toBigDecimal)(product.state.open_interest),
128
- cumulativeFundingLong: (0, import_utils.removeDecimals)(
116
+ openInterest: (0, import_shared.toBigDecimal)(product.state.open_interest),
117
+ cumulativeFundingLong: (0, import_shared.removeDecimals)(
129
118
  product.state.cumulative_funding_long_x18
130
119
  ),
131
- cumulativeFundingShort: (0, import_utils.removeDecimals)(
120
+ cumulativeFundingShort: (0, import_shared.removeDecimals)(
132
121
  product.state.cumulative_funding_short_x18
133
122
  )
134
123
  }
@@ -136,9 +125,9 @@ function mapEngineServerPerpProduct(product) {
136
125
  }
137
126
  function mapEngineServerBalanceHealthContributions(healthContributionsForBalance) {
138
127
  return {
139
- initial: (0, import_utils.toBigDecimal)(healthContributionsForBalance[0]),
140
- maintenance: (0, import_utils.toBigDecimal)(healthContributionsForBalance[1]),
141
- unweighted: (0, import_utils.toBigDecimal)(healthContributionsForBalance[2])
128
+ initial: (0, import_shared.toBigDecimal)(healthContributionsForBalance[0]),
129
+ maintenance: (0, import_shared.toBigDecimal)(healthContributionsForBalance[1]),
130
+ unweighted: (0, import_shared.toBigDecimal)(healthContributionsForBalance[2])
142
131
  };
143
132
  }
144
133
  function mapSubaccountSummary(baseResponse) {
@@ -151,7 +140,7 @@ function mapSubaccountSummary(baseResponse) {
151
140
  throw Error(`Could not find product ${spotBalance.product_id}`);
152
141
  }
153
142
  balances.push({
154
- amount: (0, import_utils.toBigDecimal)(spotBalance.balance.amount),
143
+ amount: (0, import_shared.toBigDecimal)(spotBalance.balance.amount),
155
144
  healthContributions: mapEngineServerBalanceHealthContributions(
156
145
  baseResponse.health_contributions[spotBalance.product_id]
157
146
  ),
@@ -166,8 +155,8 @@ function mapSubaccountSummary(baseResponse) {
166
155
  throw Error(`Could not find product ${perpBalance.product_id}`);
167
156
  }
168
157
  balances.push({
169
- amount: (0, import_utils.toBigDecimal)(perpBalance.balance.amount),
170
- vQuoteBalance: (0, import_utils.toBigDecimal)(perpBalance.balance.v_quote_balance),
158
+ amount: (0, import_shared.toBigDecimal)(perpBalance.balance.amount),
159
+ vQuoteBalance: (0, import_shared.toBigDecimal)(perpBalance.balance.v_quote_balance),
171
160
  healthContributions: mapEngineServerBalanceHealthContributions(
172
161
  baseResponse.health_contributions[perpBalance.product_id]
173
162
  ),
@@ -179,19 +168,19 @@ function mapSubaccountSummary(baseResponse) {
179
168
  exists: baseResponse.exists,
180
169
  health: {
181
170
  initial: {
182
- health: (0, import_utils.toBigDecimal)(baseResponse.healths[0].health),
183
- assets: (0, import_utils.toBigDecimal)(baseResponse.healths[0].assets),
184
- liabilities: (0, import_utils.toBigDecimal)(baseResponse.healths[0].liabilities)
171
+ health: (0, import_shared.toBigDecimal)(baseResponse.healths[0].health),
172
+ assets: (0, import_shared.toBigDecimal)(baseResponse.healths[0].assets),
173
+ liabilities: (0, import_shared.toBigDecimal)(baseResponse.healths[0].liabilities)
185
174
  },
186
175
  maintenance: {
187
- health: (0, import_utils.toBigDecimal)(baseResponse.healths[1].health),
188
- assets: (0, import_utils.toBigDecimal)(baseResponse.healths[1].assets),
189
- liabilities: (0, import_utils.toBigDecimal)(baseResponse.healths[1].liabilities)
176
+ health: (0, import_shared.toBigDecimal)(baseResponse.healths[1].health),
177
+ assets: (0, import_shared.toBigDecimal)(baseResponse.healths[1].assets),
178
+ liabilities: (0, import_shared.toBigDecimal)(baseResponse.healths[1].liabilities)
190
179
  },
191
180
  unweighted: {
192
- health: (0, import_utils.toBigDecimal)(baseResponse.healths[2].health),
193
- assets: (0, import_utils.toBigDecimal)(baseResponse.healths[2].assets),
194
- liabilities: (0, import_utils.toBigDecimal)(baseResponse.healths[2].liabilities)
181
+ health: (0, import_shared.toBigDecimal)(baseResponse.healths[2].health),
182
+ assets: (0, import_shared.toBigDecimal)(baseResponse.healths[2].assets),
183
+ liabilities: (0, import_shared.toBigDecimal)(baseResponse.healths[2].liabilities)
195
184
  }
196
185
  }
197
186
  };
@@ -201,29 +190,29 @@ function mapEngineServerIsolatedPositions(baseResponse) {
201
190
  const perpBalance = position.base_balance;
202
191
  const quoteBalance = position.quote_balance;
203
192
  return {
204
- subaccount: (0, import_contracts.subaccountFromHex)(position.subaccount),
193
+ subaccount: (0, import_shared.subaccountFromHex)(position.subaccount),
205
194
  healths: {
206
- initial: (0, import_utils.toBigDecimal)(position.healths[0].health),
207
- maintenance: (0, import_utils.toBigDecimal)(position.healths[1].health),
208
- unweighted: (0, import_utils.toBigDecimal)(position.healths[2].health)
195
+ initial: (0, import_shared.toBigDecimal)(position.healths[0].health),
196
+ maintenance: (0, import_shared.toBigDecimal)(position.healths[1].health),
197
+ unweighted: (0, import_shared.toBigDecimal)(position.healths[2].health)
209
198
  },
210
199
  baseBalance: {
211
- amount: (0, import_utils.toBigDecimal)(perpBalance.balance.amount),
212
- vQuoteBalance: (0, import_utils.toBigDecimal)(perpBalance.balance.v_quote_balance),
200
+ amount: (0, import_shared.toBigDecimal)(perpBalance.balance.amount),
201
+ vQuoteBalance: (0, import_shared.toBigDecimal)(perpBalance.balance.v_quote_balance),
213
202
  // Health contributions === healths for an isolated position
214
203
  healthContributions: {
215
- initial: (0, import_utils.toBigDecimal)(position.base_healths[0]),
216
- maintenance: (0, import_utils.toBigDecimal)(position.base_healths[1]),
217
- unweighted: (0, import_utils.toBigDecimal)(position.base_healths[2])
204
+ initial: (0, import_shared.toBigDecimal)(position.base_healths[0]),
205
+ maintenance: (0, import_shared.toBigDecimal)(position.base_healths[1]),
206
+ unweighted: (0, import_shared.toBigDecimal)(position.base_healths[2])
218
207
  },
219
208
  ...mapEngineServerPerpProduct(position.base_product).product
220
209
  },
221
210
  quoteBalance: {
222
- amount: (0, import_utils.toBigDecimal)(quoteBalance.balance.amount),
211
+ amount: (0, import_shared.toBigDecimal)(quoteBalance.balance.amount),
223
212
  healthContributions: {
224
- initial: (0, import_utils.toBigDecimal)(position.quote_healths[0]),
225
- maintenance: (0, import_utils.toBigDecimal)(position.quote_healths[1]),
226
- unweighted: (0, import_utils.toBigDecimal)(position.quote_healths[2])
213
+ initial: (0, import_shared.toBigDecimal)(position.quote_healths[0]),
214
+ maintenance: (0, import_shared.toBigDecimal)(position.quote_healths[1]),
215
+ unweighted: (0, import_shared.toBigDecimal)(position.quote_healths[2])
227
216
  },
228
217
  ...mapEngineServerSpotProduct(position.quote_product).product
229
218
  }
@@ -231,7 +220,7 @@ function mapEngineServerIsolatedPositions(baseResponse) {
231
220
  });
232
221
  }
233
222
  function mapEngineServerSymbols(baseResponse) {
234
- const symbols = (0, import_utils.mapValues)(
223
+ const symbols = (0, import_shared.mapValues)(
235
224
  baseResponse.symbols,
236
225
  mapEngineServerSymbol
237
226
  );
@@ -244,25 +233,25 @@ function mapEngineServerSymbol(engineServerSymbol) {
244
233
  type: (0, import_productEngineTypeMappers.mapEngineServerProductType)(engineServerSymbol.type),
245
234
  productId: engineServerSymbol.product_id,
246
235
  symbol: engineServerSymbol.symbol,
247
- priceIncrement: (0, import_utils.removeDecimals)(engineServerSymbol.price_increment_x18),
248
- sizeIncrement: (0, import_utils.toBigDecimal)(engineServerSymbol.size_increment),
249
- minSize: (0, import_utils.toBigDecimal)(engineServerSymbol.min_size),
250
- minDepth: (0, import_utils.removeDecimals)(engineServerSymbol.min_depth_x18),
251
- maxSpreadRate: (0, import_utils.removeDecimals)(engineServerSymbol.max_spread_rate_x18),
252
- makerFeeRate: (0, import_utils.removeDecimals)(engineServerSymbol.maker_fee_rate_x18),
253
- takerFeeRate: (0, import_utils.removeDecimals)(engineServerSymbol.taker_fee_rate_x18),
254
- longWeightInitial: (0, import_utils.removeDecimals)(
236
+ priceIncrement: (0, import_shared.removeDecimals)(engineServerSymbol.price_increment_x18),
237
+ sizeIncrement: (0, import_shared.toBigDecimal)(engineServerSymbol.size_increment),
238
+ minSize: (0, import_shared.toBigDecimal)(engineServerSymbol.min_size),
239
+ minDepth: (0, import_shared.removeDecimals)(engineServerSymbol.min_depth_x18),
240
+ maxSpreadRate: (0, import_shared.removeDecimals)(engineServerSymbol.max_spread_rate_x18),
241
+ makerFeeRate: (0, import_shared.removeDecimals)(engineServerSymbol.maker_fee_rate_x18),
242
+ takerFeeRate: (0, import_shared.removeDecimals)(engineServerSymbol.taker_fee_rate_x18),
243
+ longWeightInitial: (0, import_shared.removeDecimals)(
255
244
  engineServerSymbol.long_weight_initial_x18
256
245
  ),
257
- longWeightMaintenance: (0, import_utils.removeDecimals)(
246
+ longWeightMaintenance: (0, import_shared.removeDecimals)(
258
247
  engineServerSymbol.long_weight_maintenance_x18
259
248
  )
260
249
  };
261
250
  }
262
251
  function mapEngineMarketPrice(baseResponse) {
263
252
  return {
264
- ask: (0, import_utils.removeDecimals)(baseResponse.ask_x18),
265
- bid: (0, import_utils.removeDecimals)(baseResponse.bid_x18),
253
+ ask: (0, import_shared.removeDecimals)(baseResponse.ask_x18),
254
+ bid: (0, import_shared.removeDecimals)(baseResponse.bid_x18),
266
255
  productId: baseResponse.product_id
267
256
  };
268
257
  }