@nadohq/engine-client 0.1.0-alpha.8 → 0.1.0

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 (87) hide show
  1. package/dist/EngineBaseClient.d.cts +2 -1
  2. package/dist/EngineBaseClient.d.ts +2 -1
  3. package/dist/EngineClient.d.cts +1 -0
  4. package/dist/EngineClient.d.ts +1 -0
  5. package/dist/EngineExecuteBuilder.cjs +9 -6
  6. package/dist/EngineExecuteBuilder.cjs.map +1 -1
  7. package/dist/EngineExecuteBuilder.d.cts +1 -0
  8. package/dist/EngineExecuteBuilder.d.ts +1 -0
  9. package/dist/EngineExecuteBuilder.js +9 -6
  10. package/dist/EngineExecuteBuilder.js.map +1 -1
  11. package/dist/EngineExecuteClient.cjs +6 -6
  12. package/dist/EngineExecuteClient.cjs.map +1 -1
  13. package/dist/EngineExecuteClient.d.cts +2 -1
  14. package/dist/EngineExecuteClient.d.ts +2 -1
  15. package/dist/EngineExecuteClient.js +6 -6
  16. package/dist/EngineExecuteClient.js.map +1 -1
  17. package/dist/EngineQueryClient.cjs +54 -11
  18. package/dist/EngineQueryClient.cjs.map +1 -1
  19. package/dist/EngineQueryClient.d.cts +19 -2
  20. package/dist/EngineQueryClient.d.ts +19 -2
  21. package/dist/EngineQueryClient.js +57 -12
  22. package/dist/EngineQueryClient.js.map +1 -1
  23. package/dist/EngineWebClient.d.cts +1 -0
  24. package/dist/EngineWebClient.d.ts +1 -0
  25. package/dist/endpoints.cjs +6 -6
  26. package/dist/endpoints.cjs.map +1 -1
  27. package/dist/endpoints.js +6 -6
  28. package/dist/endpoints.js.map +1 -1
  29. package/dist/index.cjs +4 -4
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.cts +9 -8
  32. package/dist/index.d.ts +9 -8
  33. package/dist/index.js +2 -2
  34. package/dist/index.js.map +1 -1
  35. package/dist/types/clientExecuteTypes.cjs.map +1 -1
  36. package/dist/types/clientExecuteTypes.d.cts +8 -1
  37. package/dist/types/clientExecuteTypes.d.ts +8 -1
  38. package/dist/types/clientQueryTypes.cjs.map +1 -1
  39. package/dist/types/clientQueryTypes.d.cts +66 -33
  40. package/dist/types/clientQueryTypes.d.ts +66 -33
  41. package/dist/types/index.cjs +10 -10
  42. package/dist/types/index.cjs.map +1 -1
  43. package/dist/types/index.d.cts +6 -5
  44. package/dist/types/index.d.ts +6 -5
  45. package/dist/types/index.js +5 -5
  46. package/dist/types/index.js.map +1 -1
  47. package/dist/types/serverExecuteTypes.cjs.map +1 -1
  48. package/dist/types/serverExecuteTypes.d.cts +8 -1
  49. package/dist/types/serverExecuteTypes.d.ts +8 -1
  50. package/dist/types/serverQueryModelTypes.cjs.map +1 -1
  51. package/dist/types/serverQueryModelTypes.d.cts +24 -1
  52. package/dist/types/serverQueryModelTypes.d.ts +24 -1
  53. package/dist/types/serverQueryTypes.cjs +19 -0
  54. package/dist/types/serverQueryTypes.cjs.map +1 -1
  55. package/dist/types/serverQueryTypes.d.cts +49 -23
  56. package/dist/types/serverQueryTypes.d.ts +49 -23
  57. package/dist/types/serverQueryTypes.js +12 -0
  58. package/dist/types/serverQueryTypes.js.map +1 -1
  59. package/dist/types/serverSubscriptionEventTypes.cjs.map +1 -1
  60. package/dist/types/serverSubscriptionEventTypes.d.cts +5 -0
  61. package/dist/types/serverSubscriptionEventTypes.d.ts +5 -0
  62. package/dist/types/serverSubscriptionTypes.cjs.map +1 -1
  63. package/dist/types/serverSubscriptionTypes.d.cts +4 -2
  64. package/dist/types/serverSubscriptionTypes.d.ts +4 -2
  65. package/dist/utils/index.d.cts +3 -2
  66. package/dist/utils/index.d.ts +3 -2
  67. package/dist/utils/queryDataMappers.cjs +95 -47
  68. package/dist/utils/queryDataMappers.cjs.map +1 -1
  69. package/dist/utils/queryDataMappers.d.cts +8 -5
  70. package/dist/utils/queryDataMappers.d.ts +8 -5
  71. package/dist/utils/queryDataMappers.js +94 -48
  72. package/dist/utils/queryDataMappers.js.map +1 -1
  73. package/package.json +13 -7
  74. package/src/EngineExecuteBuilder.ts +9 -6
  75. package/src/EngineExecuteClient.ts +7 -7
  76. package/src/EngineQueryClient.ts +73 -12
  77. package/src/endpoints.ts +6 -6
  78. package/src/index.ts +2 -2
  79. package/src/types/clientExecuteTypes.ts +9 -2
  80. package/src/types/clientQueryTypes.ts +76 -32
  81. package/src/types/index.ts +5 -5
  82. package/src/types/serverExecuteTypes.ts +9 -2
  83. package/src/types/serverQueryModelTypes.ts +25 -0
  84. package/src/types/serverQueryTypes.ts +74 -31
  85. package/src/types/serverSubscriptionEventTypes.ts +16 -20
  86. package/src/types/serverSubscriptionTypes.ts +4 -2
  87. package/src/utils/queryDataMappers.ts +115 -49
@@ -1,9 +1,10 @@
1
- export { EngineMarketPrice, EngineOrder, EnginePriceTickLiquidity, EngineSubaccountOrders, EngineSymbol, EngineSymbolsResponse, GetEngineAllMarketsResponse, GetEngineContractsResponse, GetEngineEstimatedSubaccountSummaryParams, GetEngineHealthGroupsResponse, GetEngineInsuranceResponse, GetEngineIpBlockStatusResponse, GetEngineIsolatedPositionsParams, GetEngineIsolatedPositionsResponse, GetEngineLinkedSignerParams, GetEngineLinkedSignerResponse, GetEngineMarketLiquidityParams, GetEngineMarketLiquidityResponse, GetEngineMarketPriceParams, GetEngineMarketPriceResponse, GetEngineMarketPricesParams, GetEngineMarketPricesResponse, GetEngineMaxMintNlpAmountParams, GetEngineMaxMintNlpAmountResponse, GetEngineMaxOrderSizeParams, GetEngineMaxOrderSizeResponse, GetEngineMaxWithdrawableParams, GetEngineMaxWithdrawableResponse, GetEngineNoncesParams, GetEngineNoncesResponse, GetEngineOrderParams, GetEngineOrderResponse, GetEngineSubaccountFeeRatesParams, GetEngineSubaccountFeeRatesResponse, GetEngineSubaccountOrdersParams, GetEngineSubaccountOrdersResponse, GetEngineSubaccountProductOrdersParams, GetEngineSubaccountProductOrdersResponse, GetEngineSubaccountSummaryParams, GetEngineSubaccountSummaryResponse, GetEngineSymbolsParams, GetEngineTimeResponse, SubaccountIsolatedPosition, SubaccountOrderFeeRates, SubaccountProductDeltaTx, SubaccountTx, ValidateEngineOrderParams, ValidateEngineOrderResponse, ValidateSignedEngineOrderParams } from './clientQueryTypes.cjs';
2
1
  export { EngineBurnNlpParams, EngineCancelAndPlaceParams, EngineCancelOrdersParams, EngineCancelProductOrdersParams, EngineExecuteRequestParamsByType, EngineLinkSignerParams, EngineLiquidateSubaccountParams, EngineMintNlpParams, EngineOrderParams, EnginePlaceOrderParams, EnginePlaceOrderResult, EnginePlaceOrdersParams, EngineTransferQuoteParams, EngineWithdrawCollateralParams, SignatureParams, WithBaseEngineExecuteParams, WithSignature } from './clientExecuteTypes.cjs';
3
- export { 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 } from './serverQueryTypes.cjs';
4
- export { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState } from './serverQueryModelTypes.cjs';
2
+ export { EngineMarketPrice, EngineNlpBalance, EngineNlpLockedBalance, EngineOrder, EnginePriceTickLiquidity, EngineSubaccountOrders, EngineSymbol, EngineSymbolsResponse, GetEngineAllMarketsResponse, GetEngineContractsResponse, GetEngineEstimatedSubaccountSummaryParams, GetEngineHealthGroupsResponse, GetEngineInsuranceResponse, GetEngineIpBlockStatusResponse, GetEngineIsolatedPositionsParams, GetEngineIsolatedPositionsResponse, GetEngineLinkedSignerParams, GetEngineLinkedSignerResponse, GetEngineMarketLiquidityParams, GetEngineMarketLiquidityResponse, GetEngineMarketPriceParams, GetEngineMarketPriceResponse, GetEngineMarketPricesParams, GetEngineMarketPricesResponse, GetEngineMaxBurnNlpAmountParams, GetEngineMaxBurnNlpAmountResponse, GetEngineMaxMintNlpAmountParams, GetEngineMaxMintNlpAmountResponse, GetEngineMaxOrderSizeParams, GetEngineMaxOrderSizeResponse, GetEngineMaxWithdrawableParams, GetEngineMaxWithdrawableResponse, GetEngineNlpLockedBalancesParams, GetEngineNlpLockedBalancesResponse, GetEngineNlpPoolInfoResponse, GetEngineNoncesParams, GetEngineNoncesResponse, GetEngineOrderParams, GetEngineOrderResponse, GetEngineSubaccountFeeRatesParams, GetEngineSubaccountFeeRatesResponse, GetEngineSubaccountOrdersParams, GetEngineSubaccountOrdersResponse, GetEngineSubaccountProductOrdersParams, GetEngineSubaccountProductOrdersResponse, GetEngineSubaccountSummaryParams, GetEngineSubaccountSummaryResponse, GetEngineSymbolsParams, GetEngineTimeResponse, NlpPool, SubaccountIsolatedPosition, SubaccountOrderFeeRates, SubaccountProductDeltaTx, SubaccountSummaryState, SubaccountTx, ValidateEngineOrderParams, ValidateEngineOrderResponse, ValidateSignedEngineOrderParams } from './clientQueryTypes.cjs';
3
+ export { EngineServerFailureError } from './EngineServerFailureError.cjs';
5
4
  export { EngineServerCancelOrdersParams, EngineServerCancelOrdersResponse, EngineServerExecuteFailureResult, EngineServerExecutePlaceOrderPayload, EngineServerExecuteRequestByType, EngineServerExecuteRequestType, EngineServerExecuteResponseDataByType, EngineServerExecuteResult, EngineServerExecuteSuccessResult, EngineServerPlaceOrderParams, EngineServerPlaceOrderResponse, EngineServerPlaceOrdersResponse, EngineServiceCancelAndPlaceParams } from './serverExecuteTypes.cjs';
6
- export { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerFundingPaymentStreamParams, EngineServerLatestCandlestickStreamParams, EngineServerLiquidationStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams } from './serverSubscriptionTypes.cjs';
5
+ export { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerNlpBalance, EngineServerNlpLockedBalance, EngineServerOrder, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState } from './serverQueryModelTypes.cjs';
6
+ export { ENGINE_SERVER_STATUS_VALUES, EngineInsuranceResponse, EngineServerAllProductsResponse, EngineServerContractsResponse, EngineServerEdgeAllProductsResponse, EngineServerFeeRatesResponse, EngineServerGetOrderQueryParams, EngineServerHealthGroupsResponse, EngineServerIpBlockResponse, EngineServerIsolatedPosition, EngineServerIsolatedPositionsQueryParams, EngineServerIsolatedPositionsResponse, EngineServerLinkedSignerParams, EngineServerLinkedSignerResponse, EngineServerMarketLiquidityQueryParams, EngineServerMarketLiquidityResponse, EngineServerMarketPrice, EngineServerMarketPriceQueryParams, EngineServerMarketPriceResponse, EngineServerMarketPricesQueryParams, EngineServerMarketPricesResponse, EngineServerMaxBurnNlpQueryParams, EngineServerMaxBurnNlpResponse, EngineServerMaxMintNlpQueryParams, EngineServerMaxMintNlpResponse, EngineServerMaxOrderSizeQueryParams, EngineServerMaxOrderSizeResponse, EngineServerMaxWithdrawableQueryParams, EngineServerMaxWithdrawableResponse, EngineServerNlpLockedBalancesQueryParams, EngineServerNlpLockedBalancesResponse, EngineServerNlpPool, EngineServerNlpPoolInfoResponse, EngineServerNoncesParams, EngineServerNoncesResponse, EngineServerOrderResponse, EngineServerOrdersQueryParams, EngineServerPriceTickLiquidity, EngineServerProductOrdersResponse, EngineServerQueryFailureResponse, EngineServerQueryRequest, EngineServerQueryRequestByType, EngineServerQueryRequestType, EngineServerQueryResponse, EngineServerQueryResponseByType, EngineServerQuerySuccessResponse, EngineServerStatusResponse, EngineServerSubaccountFeeRatesParams, EngineServerSubaccountInfoQueryParams, EngineServerSubaccountInfoResponse, EngineServerSubaccountInfoState, EngineServerSubaccountOrders, EngineServerSubaccountOrdersQueryParams, EngineServerSubaccountOrdersResponse, EngineServerSymbol, EngineServerSymbolsQueryParams, EngineServerSymbolsResponse, EngineServerTimeResponse, EngineServerValidateOrderQueryParams, EngineServerValidateOrderResponse } from './serverQueryTypes.cjs';
7
7
  export { EngineServerSubscriptionBaseEvent, EngineServerSubscriptionBestBidOfferEvent, EngineServerSubscriptionBookDepthEvent, EngineServerSubscriptionEvent, EngineServerSubscriptionEventType, EngineServerSubscriptionFillEvent, EngineServerSubscriptionFundingPaymentEvent, EngineServerSubscriptionLatestCandlestickEvent, EngineServerSubscriptionLiquidationEvent, EngineServerSubscriptionOrderUpdateEvent, EngineServerSubscriptionPositionChangeEvent, EngineServerSubscriptionTradeEvent, OrderUpdateReason, PositionChangeReason } from './serverSubscriptionEventTypes.cjs';
8
- export { EngineServerFailureError } from './EngineServerFailureError.cjs';
8
+ export { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerFundingPaymentStreamParams, EngineServerLatestCandlestickStreamParams, EngineServerLiquidationStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams } from './serverSubscriptionTypes.cjs';
9
9
  import '@nadohq/shared';
10
+ import 'bignumber.js';
@@ -1,9 +1,10 @@
1
- export { EngineMarketPrice, EngineOrder, EnginePriceTickLiquidity, EngineSubaccountOrders, EngineSymbol, EngineSymbolsResponse, GetEngineAllMarketsResponse, GetEngineContractsResponse, GetEngineEstimatedSubaccountSummaryParams, GetEngineHealthGroupsResponse, GetEngineInsuranceResponse, GetEngineIpBlockStatusResponse, GetEngineIsolatedPositionsParams, GetEngineIsolatedPositionsResponse, GetEngineLinkedSignerParams, GetEngineLinkedSignerResponse, GetEngineMarketLiquidityParams, GetEngineMarketLiquidityResponse, GetEngineMarketPriceParams, GetEngineMarketPriceResponse, GetEngineMarketPricesParams, GetEngineMarketPricesResponse, GetEngineMaxMintNlpAmountParams, GetEngineMaxMintNlpAmountResponse, GetEngineMaxOrderSizeParams, GetEngineMaxOrderSizeResponse, GetEngineMaxWithdrawableParams, GetEngineMaxWithdrawableResponse, GetEngineNoncesParams, GetEngineNoncesResponse, GetEngineOrderParams, GetEngineOrderResponse, GetEngineSubaccountFeeRatesParams, GetEngineSubaccountFeeRatesResponse, GetEngineSubaccountOrdersParams, GetEngineSubaccountOrdersResponse, GetEngineSubaccountProductOrdersParams, GetEngineSubaccountProductOrdersResponse, GetEngineSubaccountSummaryParams, GetEngineSubaccountSummaryResponse, GetEngineSymbolsParams, GetEngineTimeResponse, SubaccountIsolatedPosition, SubaccountOrderFeeRates, SubaccountProductDeltaTx, SubaccountTx, ValidateEngineOrderParams, ValidateEngineOrderResponse, ValidateSignedEngineOrderParams } from './clientQueryTypes.js';
2
1
  export { EngineBurnNlpParams, EngineCancelAndPlaceParams, EngineCancelOrdersParams, EngineCancelProductOrdersParams, EngineExecuteRequestParamsByType, EngineLinkSignerParams, EngineLiquidateSubaccountParams, EngineMintNlpParams, EngineOrderParams, EnginePlaceOrderParams, EnginePlaceOrderResult, EnginePlaceOrdersParams, EngineTransferQuoteParams, EngineWithdrawCollateralParams, SignatureParams, WithBaseEngineExecuteParams, WithSignature } from './clientExecuteTypes.js';
3
- export { 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 } from './serverQueryTypes.js';
4
- export { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState } from './serverQueryModelTypes.js';
2
+ export { EngineMarketPrice, EngineNlpBalance, EngineNlpLockedBalance, EngineOrder, EnginePriceTickLiquidity, EngineSubaccountOrders, EngineSymbol, EngineSymbolsResponse, GetEngineAllMarketsResponse, GetEngineContractsResponse, GetEngineEstimatedSubaccountSummaryParams, GetEngineHealthGroupsResponse, GetEngineInsuranceResponse, GetEngineIpBlockStatusResponse, GetEngineIsolatedPositionsParams, GetEngineIsolatedPositionsResponse, GetEngineLinkedSignerParams, GetEngineLinkedSignerResponse, GetEngineMarketLiquidityParams, GetEngineMarketLiquidityResponse, GetEngineMarketPriceParams, GetEngineMarketPriceResponse, GetEngineMarketPricesParams, GetEngineMarketPricesResponse, GetEngineMaxBurnNlpAmountParams, GetEngineMaxBurnNlpAmountResponse, GetEngineMaxMintNlpAmountParams, GetEngineMaxMintNlpAmountResponse, GetEngineMaxOrderSizeParams, GetEngineMaxOrderSizeResponse, GetEngineMaxWithdrawableParams, GetEngineMaxWithdrawableResponse, GetEngineNlpLockedBalancesParams, GetEngineNlpLockedBalancesResponse, GetEngineNlpPoolInfoResponse, GetEngineNoncesParams, GetEngineNoncesResponse, GetEngineOrderParams, GetEngineOrderResponse, GetEngineSubaccountFeeRatesParams, GetEngineSubaccountFeeRatesResponse, GetEngineSubaccountOrdersParams, GetEngineSubaccountOrdersResponse, GetEngineSubaccountProductOrdersParams, GetEngineSubaccountProductOrdersResponse, GetEngineSubaccountSummaryParams, GetEngineSubaccountSummaryResponse, GetEngineSymbolsParams, GetEngineTimeResponse, NlpPool, SubaccountIsolatedPosition, SubaccountOrderFeeRates, SubaccountProductDeltaTx, SubaccountSummaryState, SubaccountTx, ValidateEngineOrderParams, ValidateEngineOrderResponse, ValidateSignedEngineOrderParams } from './clientQueryTypes.js';
3
+ export { EngineServerFailureError } from './EngineServerFailureError.js';
5
4
  export { EngineServerCancelOrdersParams, EngineServerCancelOrdersResponse, EngineServerExecuteFailureResult, EngineServerExecutePlaceOrderPayload, EngineServerExecuteRequestByType, EngineServerExecuteRequestType, EngineServerExecuteResponseDataByType, EngineServerExecuteResult, EngineServerExecuteSuccessResult, EngineServerPlaceOrderParams, EngineServerPlaceOrderResponse, EngineServerPlaceOrdersResponse, EngineServiceCancelAndPlaceParams } from './serverExecuteTypes.js';
6
- export { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerFundingPaymentStreamParams, EngineServerLatestCandlestickStreamParams, EngineServerLiquidationStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams } from './serverSubscriptionTypes.js';
5
+ export { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerNlpBalance, EngineServerNlpLockedBalance, EngineServerOrder, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState } from './serverQueryModelTypes.js';
6
+ export { ENGINE_SERVER_STATUS_VALUES, EngineInsuranceResponse, EngineServerAllProductsResponse, EngineServerContractsResponse, EngineServerEdgeAllProductsResponse, EngineServerFeeRatesResponse, EngineServerGetOrderQueryParams, EngineServerHealthGroupsResponse, EngineServerIpBlockResponse, EngineServerIsolatedPosition, EngineServerIsolatedPositionsQueryParams, EngineServerIsolatedPositionsResponse, EngineServerLinkedSignerParams, EngineServerLinkedSignerResponse, EngineServerMarketLiquidityQueryParams, EngineServerMarketLiquidityResponse, EngineServerMarketPrice, EngineServerMarketPriceQueryParams, EngineServerMarketPriceResponse, EngineServerMarketPricesQueryParams, EngineServerMarketPricesResponse, EngineServerMaxBurnNlpQueryParams, EngineServerMaxBurnNlpResponse, EngineServerMaxMintNlpQueryParams, EngineServerMaxMintNlpResponse, EngineServerMaxOrderSizeQueryParams, EngineServerMaxOrderSizeResponse, EngineServerMaxWithdrawableQueryParams, EngineServerMaxWithdrawableResponse, EngineServerNlpLockedBalancesQueryParams, EngineServerNlpLockedBalancesResponse, EngineServerNlpPool, EngineServerNlpPoolInfoResponse, EngineServerNoncesParams, EngineServerNoncesResponse, EngineServerOrderResponse, EngineServerOrdersQueryParams, EngineServerPriceTickLiquidity, EngineServerProductOrdersResponse, EngineServerQueryFailureResponse, EngineServerQueryRequest, EngineServerQueryRequestByType, EngineServerQueryRequestType, EngineServerQueryResponse, EngineServerQueryResponseByType, EngineServerQuerySuccessResponse, EngineServerStatusResponse, EngineServerSubaccountFeeRatesParams, EngineServerSubaccountInfoQueryParams, EngineServerSubaccountInfoResponse, EngineServerSubaccountInfoState, EngineServerSubaccountOrders, EngineServerSubaccountOrdersQueryParams, EngineServerSubaccountOrdersResponse, EngineServerSymbol, EngineServerSymbolsQueryParams, EngineServerSymbolsResponse, EngineServerTimeResponse, EngineServerValidateOrderQueryParams, EngineServerValidateOrderResponse } from './serverQueryTypes.js';
7
7
  export { EngineServerSubscriptionBaseEvent, EngineServerSubscriptionBestBidOfferEvent, EngineServerSubscriptionBookDepthEvent, EngineServerSubscriptionEvent, EngineServerSubscriptionEventType, EngineServerSubscriptionFillEvent, EngineServerSubscriptionFundingPaymentEvent, EngineServerSubscriptionLatestCandlestickEvent, EngineServerSubscriptionLiquidationEvent, EngineServerSubscriptionOrderUpdateEvent, EngineServerSubscriptionPositionChangeEvent, EngineServerSubscriptionTradeEvent, OrderUpdateReason, PositionChangeReason } from './serverSubscriptionEventTypes.js';
8
- export { EngineServerFailureError } from './EngineServerFailureError.js';
8
+ export { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerFundingPaymentStreamParams, EngineServerLatestCandlestickStreamParams, EngineServerLiquidationStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams } from './serverSubscriptionTypes.js';
9
9
  import '@nadohq/shared';
10
+ import 'bignumber.js';
@@ -1,10 +1,10 @@
1
1
  // src/types/index.ts
2
- export * from "./clientQueryTypes.js";
3
2
  export * from "./clientExecuteTypes.js";
4
- export * from "./serverQueryTypes.js";
5
- export * from "./serverQueryModelTypes.js";
3
+ export * from "./clientQueryTypes.js";
4
+ export * from "./EngineServerFailureError.js";
6
5
  export * from "./serverExecuteTypes.js";
7
- export * from "./serverSubscriptionTypes.js";
6
+ export * from "./serverQueryModelTypes.js";
7
+ export * from "./serverQueryTypes.js";
8
8
  export * from "./serverSubscriptionEventTypes.js";
9
- export * from "./EngineServerFailureError.js";
9
+ export * from "./serverSubscriptionTypes.js";
10
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export * from './clientQueryTypes';\nexport * from './clientExecuteTypes';\nexport * from './serverQueryTypes';\nexport * from './serverQueryModelTypes';\nexport * from './serverExecuteTypes';\nexport * from './serverSubscriptionTypes';\nexport * from './serverSubscriptionEventTypes';\nexport * from './EngineServerFailureError';\n"],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export * from './clientExecuteTypes';\nexport * from './clientQueryTypes';\nexport * from './EngineServerFailureError';\nexport * from './serverExecuteTypes';\nexport * from './serverQueryModelTypes';\nexport * from './serverQueryTypes';\nexport * from './serverSubscriptionEventTypes';\nexport * from './serverSubscriptionTypes';\n"],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/serverExecuteTypes.ts"],"sourcesContent":["import {\n EIP712BurnNlpValues,\n EIP712LinkSignerValues,\n EIP712LiquidateSubaccountValues,\n EIP712MintNlpValues,\n EIP712OrderCancellationValues,\n EIP712OrderParams,\n EIP712OrderValues,\n EIP712ProductOrdersCancellationValues,\n EIP712TransferQuoteValues,\n EIP712WithdrawCollateralValues,\n SignedTx,\n} from '@nadohq/shared';\nimport { EngineServerOrderResponse } from './serverQueryTypes';\n\nexport interface EngineServerPlaceOrderResponse {\n digest: string;\n error: string | null;\n}\n\nexport type EngineServerPlaceOrdersResponse = EngineServerPlaceOrderResponse[];\n\nexport interface EngineServerCancelOrdersResponse {\n cancelled_orders: EngineServerOrderResponse[];\n}\n\nexport interface EngineServerExecuteResponseDataByType {\n burn_nlp: null;\n cancel_and_place: EngineServerPlaceOrderResponse;\n cancel_orders: EngineServerCancelOrdersResponse;\n cancel_product_orders: EngineServerCancelOrdersResponse;\n link_signer: null;\n liquidate_subaccount: null;\n mint_nlp: null;\n place_order: EngineServerPlaceOrderResponse;\n place_orders: EngineServerPlaceOrdersResponse;\n transfer_quote: null;\n withdraw_collateral: null;\n}\n\nexport interface EngineServerExecuteSuccessResult<\n T extends EngineServerExecuteRequestType = EngineServerExecuteRequestType,\n> {\n status: 'success';\n data: EngineServerExecuteResponseDataByType[T];\n signature: string;\n request_type: EngineServerExecuteResultRequestType;\n // NOTE: `id` is excluded from the response to avoid parsing issues.\n // type of `id` on the backend is `u64` which can overflow until we introduce proper parsing on the SDK.\n}\n\nexport interface EngineServerExecuteFailureResult {\n status: 'failure';\n signature: string;\n error: string;\n error_code: number;\n request_type: EngineServerExecuteResultRequestType;\n}\n\nexport type EngineServerExecuteResult<\n T extends EngineServerExecuteRequestType = EngineServerExecuteRequestType,\n> = EngineServerExecuteSuccessResult<T> | EngineServerExecuteFailureResult;\n\ntype EngineServerExecuteResultRequestType = {\n [K in keyof EngineServerExecuteRequestByType]: `execute_${K}`;\n}[keyof EngineServerExecuteRequestByType];\n\nexport interface EngineServerPlaceOrderParams {\n id: number | null;\n product_id: number;\n order: EIP712OrderValues;\n // Bytes\n signature: string;\n // Engine defaults this to true\n spot_leverage: boolean | null;\n // For isolated orders, this specifies whether margin can be borrowed (i.e. whether the cross account can have a negative USDC balance)\n borrow_margin: boolean | null;\n}\n\nexport type EngineServerCancelOrdersParams = SignedTx<\n Omit<EIP712OrderCancellationValues, 'productIds'> & {\n // number[] is technically assignable to \"Bytes\", so we need to override the ByteFieldsToHex result here\n productIds: number[];\n }\n>;\n\nexport type EngineServiceCancelAndPlaceParams = Omit<\n EngineServerCancelOrdersParams,\n 'tx' | 'signature'\n> & {\n cancel_tx: EngineServerCancelOrdersParams['tx'];\n cancel_signature: EngineServerCancelOrdersParams['signature'];\n place_order: EngineServerPlaceOrderParams;\n};\n\ntype WithSpotLeverage<T> = T & {\n spot_leverage: boolean | null;\n};\n\nexport interface EngineServerExecuteRequestByType {\n burn_nlp: SignedTx<EIP712BurnNlpValues>;\n cancel_and_place: EngineServiceCancelAndPlaceParams;\n cancel_orders: EngineServerCancelOrdersParams;\n cancel_product_orders: SignedTx<\n Omit<EIP712ProductOrdersCancellationValues, 'productIds'> & {\n // number[] is technically assignable to \"Bytes\", so we need to override the ByteFieldsToHex result here\n productIds: number[];\n }\n >;\n link_signer: SignedTx<EIP712LinkSignerValues>;\n liquidate_subaccount: SignedTx<EIP712LiquidateSubaccountValues>;\n mint_nlp: WithSpotLeverage<SignedTx<EIP712MintNlpValues>>;\n place_order: EngineServerPlaceOrderParams;\n place_orders: EngineServerPlaceOrderParams[];\n transfer_quote: SignedTx<EIP712TransferQuoteValues>;\n withdraw_collateral: WithSpotLeverage<\n SignedTx<EIP712WithdrawCollateralValues>\n >;\n}\n\nexport type EngineServerExecuteRequestType =\n keyof EngineServerExecuteRequestByType;\n\nexport interface EngineServerExecutePlaceOrderPayload {\n payload: EngineServerExecuteRequestByType['place_order'];\n orderParams: EIP712OrderParams;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/types/serverExecuteTypes.ts"],"sourcesContent":["import {\n EIP712BurnNlpValues,\n EIP712LinkSignerValues,\n EIP712LiquidateSubaccountValues,\n EIP712MintNlpValues,\n EIP712OrderCancellationValues,\n EIP712OrderParams,\n EIP712OrderValues,\n EIP712ProductOrdersCancellationValues,\n EIP712TransferQuoteValues,\n EIP712WithdrawCollateralValues,\n SignedTx,\n} from '@nadohq/shared';\nimport { EngineServerOrderResponse } from './serverQueryTypes';\n\nexport interface EngineServerPlaceOrderResponse {\n digest: string;\n error: string | null;\n}\n\nexport type EngineServerPlaceOrdersResponse = EngineServerPlaceOrderResponse[];\n\nexport interface EngineServerCancelOrdersResponse {\n cancelled_orders: EngineServerOrderResponse[];\n}\n\nexport interface EngineServerExecuteResponseDataByType {\n burn_nlp: null;\n cancel_and_place: EngineServerPlaceOrderResponse;\n cancel_orders: EngineServerCancelOrdersResponse;\n cancel_product_orders: EngineServerCancelOrdersResponse;\n link_signer: null;\n liquidate_subaccount: null;\n mint_nlp: null;\n place_order: EngineServerPlaceOrderResponse;\n place_orders: EngineServerPlaceOrdersResponse;\n transfer_quote: null;\n withdraw_collateral: null;\n}\n\nexport interface EngineServerExecuteSuccessResult<\n T extends EngineServerExecuteRequestType = EngineServerExecuteRequestType,\n> {\n status: 'success';\n data: EngineServerExecuteResponseDataByType[T];\n signature: string;\n request_type: EngineServerExecuteResultRequestType;\n // NOTE: `id` is excluded from the response to avoid parsing issues.\n // type of `id` on the backend is `u64` which can overflow until we introduce proper parsing on the SDK.\n}\n\nexport interface EngineServerExecuteFailureResult {\n status: 'failure';\n signature: string;\n error: string;\n error_code: number;\n request_type: EngineServerExecuteResultRequestType;\n}\n\nexport type EngineServerExecuteResult<\n T extends EngineServerExecuteRequestType = EngineServerExecuteRequestType,\n> = EngineServerExecuteSuccessResult<T> | EngineServerExecuteFailureResult;\n\ntype EngineServerExecuteResultRequestType = {\n [K in keyof EngineServerExecuteRequestByType]: `execute_${K}`;\n}[keyof EngineServerExecuteRequestByType];\n\nexport interface EngineServerPlaceOrderParams {\n id: number | null;\n product_id: number;\n order: EIP712OrderValues;\n // Bytes\n signature: string;\n // Engine defaults this to true\n spot_leverage: boolean | null;\n // For isolated orders, this specifies whether margin can be borrowed (i.e. whether the cross account can have a negative USDT balance)\n borrow_margin: boolean | null;\n}\n\nexport type EngineServerCancelOrdersParams = SignedTx<\n Omit<EIP712OrderCancellationValues, 'productIds'> & {\n // number[] is technically assignable to \"Bytes\", so we need to override the ByteFieldsToHex result here\n productIds: number[];\n }\n>;\n\nexport type EngineServiceCancelAndPlaceParams = Omit<\n EngineServerCancelOrdersParams,\n 'tx' | 'signature'\n> & {\n cancel_tx: EngineServerCancelOrdersParams['tx'];\n cancel_signature: EngineServerCancelOrdersParams['signature'];\n place_order: EngineServerPlaceOrderParams;\n};\n\ntype WithSpotLeverage<T> = T & {\n spot_leverage: boolean | null;\n};\n\nexport interface EngineServerExecuteRequestByType {\n burn_nlp: SignedTx<EIP712BurnNlpValues>;\n cancel_and_place: EngineServiceCancelAndPlaceParams;\n cancel_orders: EngineServerCancelOrdersParams;\n cancel_product_orders: SignedTx<\n Omit<EIP712ProductOrdersCancellationValues, 'productIds'> & {\n // number[] is technically assignable to \"Bytes\", so we need to override the ByteFieldsToHex result here\n productIds: number[];\n }\n >;\n link_signer: SignedTx<EIP712LinkSignerValues>;\n liquidate_subaccount: SignedTx<EIP712LiquidateSubaccountValues>;\n mint_nlp: WithSpotLeverage<SignedTx<EIP712MintNlpValues>>;\n place_order: EngineServerPlaceOrderParams;\n place_orders: {\n orders: EngineServerPlaceOrderParams[];\n /**\n * If `true`, aborts the batch after the first failed order; if `false`, remaining orders continue to execute.\n * If `null`, the default value is `false`.\n */\n stop_on_failure: boolean | null;\n };\n transfer_quote: SignedTx<EIP712TransferQuoteValues>;\n withdraw_collateral: WithSpotLeverage<\n SignedTx<EIP712WithdrawCollateralValues>\n >;\n}\n\nexport type EngineServerExecuteRequestType =\n keyof EngineServerExecuteRequestByType;\n\nexport interface EngineServerExecutePlaceOrderPayload {\n payload: EngineServerExecuteRequestByType['place_order'];\n orderParams: EIP712OrderParams;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -70,7 +70,14 @@ interface EngineServerExecuteRequestByType {
70
70
  liquidate_subaccount: SignedTx<EIP712LiquidateSubaccountValues>;
71
71
  mint_nlp: WithSpotLeverage<SignedTx<EIP712MintNlpValues>>;
72
72
  place_order: EngineServerPlaceOrderParams;
73
- place_orders: EngineServerPlaceOrderParams[];
73
+ place_orders: {
74
+ orders: EngineServerPlaceOrderParams[];
75
+ /**
76
+ * If `true`, aborts the batch after the first failed order; if `false`, remaining orders continue to execute.
77
+ * If `null`, the default value is `false`.
78
+ */
79
+ stop_on_failure: boolean | null;
80
+ };
74
81
  transfer_quote: SignedTx<EIP712TransferQuoteValues>;
75
82
  withdraw_collateral: WithSpotLeverage<SignedTx<EIP712WithdrawCollateralValues>>;
76
83
  }
@@ -70,7 +70,14 @@ interface EngineServerExecuteRequestByType {
70
70
  liquidate_subaccount: SignedTx<EIP712LiquidateSubaccountValues>;
71
71
  mint_nlp: WithSpotLeverage<SignedTx<EIP712MintNlpValues>>;
72
72
  place_order: EngineServerPlaceOrderParams;
73
- place_orders: EngineServerPlaceOrderParams[];
73
+ place_orders: {
74
+ orders: EngineServerPlaceOrderParams[];
75
+ /**
76
+ * If `true`, aborts the batch after the first failed order; if `false`, remaining orders continue to execute.
77
+ * If `null`, the default value is `false`.
78
+ */
79
+ stop_on_failure: boolean | null;
80
+ };
74
81
  transfer_quote: SignedTx<EIP712TransferQuoteValues>;
75
82
  withdraw_collateral: WithSpotLeverage<SignedTx<EIP712WithdrawCollateralValues>>;
76
83
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/serverQueryModelTypes.ts"],"sourcesContent":["export interface EngineServerHealthBreakdown {\n health: string;\n assets: string;\n liabilities: string;\n}\n\nexport interface EngineServerSpotBalanceData {\n amount: string;\n}\n\nexport interface EngineServerPerpBalanceData {\n amount: string;\n v_quote_balance: string;\n last_cumulative_funding_x18: string;\n}\n\nexport interface EngineServerRisk {\n long_weight_initial_x18: string;\n short_weight_initial_x18: string;\n long_weight_maintenance_x18: string;\n short_weight_maintenance_x18: string;\n large_position_penalty_x18: string;\n}\n\nexport interface EngineServerBookInfo {\n size_increment: string;\n price_increment_x18: string;\n min_size: string;\n collected_fees: string;\n}\n\nexport interface EngineServerSpotConfig {\n token: string;\n interest_inflection_util_x18: string;\n interest_floor_x18: string;\n interest_small_cap_x18: string;\n interest_large_cap_x18: string;\n min_deposit_rate_x18: string;\n}\n\nexport interface EngineServerSpotState {\n cumulative_deposits_multiplier_x18: string;\n cumulative_borrows_multiplier_x18: string;\n total_deposits_normalized: string;\n total_borrows_normalized: string;\n}\n\nexport interface EngineServerPerpState {\n cumulative_funding_long_x18: string;\n cumulative_funding_short_x18: string;\n available_settle: string;\n open_interest: string;\n}\n\nexport interface EngineServerSpotProduct {\n product_id: number;\n oracle_price_x18: string;\n risk: EngineServerRisk;\n config: EngineServerSpotConfig;\n state: EngineServerSpotState;\n book_info: EngineServerBookInfo;\n}\n\nexport interface EngineServerSpotBalance {\n product_id: number;\n balance: EngineServerSpotBalanceData;\n}\n\nexport interface EngineServerPerpProduct {\n product_id: number;\n oracle_price_x18: string;\n index_price_x18: string;\n risk: EngineServerRisk;\n state: EngineServerPerpState;\n book_info: EngineServerBookInfo;\n}\n\nexport interface EngineServerPerpBalance {\n product_id: number;\n balance: EngineServerPerpBalanceData;\n}\n\nexport type EngineServerProductType = 'perp' | 'spot';\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/types/serverQueryModelTypes.ts"],"sourcesContent":["export interface EngineServerHealthBreakdown {\n health: string;\n assets: string;\n liabilities: string;\n}\n\nexport interface EngineServerSpotBalanceData {\n amount: string;\n}\n\nexport interface EngineServerPerpBalanceData {\n amount: string;\n v_quote_balance: string;\n last_cumulative_funding_x18: string;\n}\n\nexport interface EngineServerRisk {\n long_weight_initial_x18: string;\n short_weight_initial_x18: string;\n long_weight_maintenance_x18: string;\n short_weight_maintenance_x18: string;\n large_position_penalty_x18: string;\n}\n\nexport interface EngineServerBookInfo {\n size_increment: string;\n price_increment_x18: string;\n min_size: string;\n collected_fees: string;\n}\n\nexport interface EngineServerSpotConfig {\n token: string;\n interest_inflection_util_x18: string;\n interest_floor_x18: string;\n interest_small_cap_x18: string;\n interest_large_cap_x18: string;\n min_deposit_rate_x18: string;\n}\n\nexport interface EngineServerSpotState {\n cumulative_deposits_multiplier_x18: string;\n cumulative_borrows_multiplier_x18: string;\n total_deposits_normalized: string;\n total_borrows_normalized: string;\n}\n\nexport interface EngineServerPerpState {\n cumulative_funding_long_x18: string;\n cumulative_funding_short_x18: string;\n available_settle: string;\n open_interest: string;\n}\n\nexport interface EngineServerSpotProduct {\n product_id: number;\n oracle_price_x18: string;\n risk: EngineServerRisk;\n config: EngineServerSpotConfig;\n state: EngineServerSpotState;\n book_info: EngineServerBookInfo;\n}\n\nexport interface EngineServerSpotBalance {\n product_id: number;\n balance: EngineServerSpotBalanceData;\n}\n\nexport interface EngineServerPerpProduct {\n product_id: number;\n oracle_price_x18: string;\n index_price_x18: string;\n risk: EngineServerRisk;\n state: EngineServerPerpState;\n book_info: EngineServerBookInfo;\n}\n\nexport interface EngineServerPerpBalance {\n product_id: number;\n balance: EngineServerPerpBalanceData;\n}\n\nexport type EngineServerProductType = 'perp' | 'spot';\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 interface EngineServerNlpBalance {\n product_id: number;\n balance: {\n amount: string;\n };\n}\nexport interface EngineServerNlpLockedBalance {\n unlocked_at: number;\n balance: EngineServerNlpBalance;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -69,5 +69,28 @@ interface EngineServerPerpBalance {
69
69
  balance: EngineServerPerpBalanceData;
70
70
  }
71
71
  type EngineServerProductType = 'perp' | 'spot';
72
+ interface EngineServerOrder {
73
+ product_id: number;
74
+ sender: string;
75
+ price_x18: string;
76
+ amount: string;
77
+ expiration: string;
78
+ nonce: string;
79
+ unfilled_amount: string;
80
+ digest: string;
81
+ placed_at: number;
82
+ order_type: string;
83
+ appendix: string;
84
+ }
85
+ interface EngineServerNlpBalance {
86
+ product_id: number;
87
+ balance: {
88
+ amount: string;
89
+ };
90
+ }
91
+ interface EngineServerNlpLockedBalance {
92
+ unlocked_at: number;
93
+ balance: EngineServerNlpBalance;
94
+ }
72
95
 
73
- export type { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState };
96
+ export type { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerNlpBalance, EngineServerNlpLockedBalance, EngineServerOrder, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState };
@@ -69,5 +69,28 @@ interface EngineServerPerpBalance {
69
69
  balance: EngineServerPerpBalanceData;
70
70
  }
71
71
  type EngineServerProductType = 'perp' | 'spot';
72
+ interface EngineServerOrder {
73
+ product_id: number;
74
+ sender: string;
75
+ price_x18: string;
76
+ amount: string;
77
+ expiration: string;
78
+ nonce: string;
79
+ unfilled_amount: string;
80
+ digest: string;
81
+ placed_at: number;
82
+ order_type: string;
83
+ appendix: string;
84
+ }
85
+ interface EngineServerNlpBalance {
86
+ product_id: number;
87
+ balance: {
88
+ amount: string;
89
+ };
90
+ }
91
+ interface EngineServerNlpLockedBalance {
92
+ unlocked_at: number;
93
+ balance: EngineServerNlpBalance;
94
+ }
72
95
 
73
- export type { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState };
96
+ export type { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerNlpBalance, EngineServerNlpLockedBalance, EngineServerOrder, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState };
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
6
10
  var __copyProps = (to, from, except, desc) => {
7
11
  if (from && typeof from === "object" || typeof from === "function") {
8
12
  for (let key of __getOwnPropNames(from))
@@ -15,5 +19,20 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
15
19
 
16
20
  // src/types/serverQueryTypes.ts
17
21
  var serverQueryTypes_exports = {};
22
+ __export(serverQueryTypes_exports, {
23
+ ENGINE_SERVER_STATUS_VALUES: () => ENGINE_SERVER_STATUS_VALUES
24
+ });
18
25
  module.exports = __toCommonJS(serverQueryTypes_exports);
26
+ var ENGINE_SERVER_STATUS_VALUES = [
27
+ "started",
28
+ "active",
29
+ "stopping",
30
+ "syncing",
31
+ "live_syncing",
32
+ "failed"
33
+ ];
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ ENGINE_SERVER_STATUS_VALUES
37
+ });
19
38
  //# sourceMappingURL=serverQueryTypes.cjs.map
@@ -1 +1 @@
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 fee_tier: number;\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
+ {"version":3,"sources":["../../src/types/serverQueryTypes.ts"],"sourcesContent":["import { HealthStatus } from '@nadohq/shared';\nimport {\n EngineServerHealthBreakdown,\n EngineServerNlpBalance,\n EngineServerNlpLockedBalance,\n EngineServerOrder,\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 // If not given, engine defaults to 'false'\n pre_state?: string;\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 isolated: string | null;\n // For isolated, max order size includes available collateral to transfer from parent cross subaccount\n // If not given, engine defaults to true (borrow enabled)\n borrow_margin: 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 EngineServerMaxBurnNlpQueryParams {\n sender: string;\n}\n\nexport interface EngineServerNlpLockedBalancesQueryParams {\n subaccount: string;\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_burnable: EngineServerMaxBurnNlpQueryParams;\n max_nlp_mintable: EngineServerMaxMintNlpQueryParams;\n max_order_size: EngineServerMaxOrderSizeQueryParams;\n nlp_locked_balances: EngineServerNlpLockedBalancesQueryParams;\n nlp_pool_info: Record<string, never>;\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 const ENGINE_SERVER_STATUS_VALUES = [\n 'started',\n 'active',\n 'stopping',\n 'syncing',\n 'live_syncing',\n 'failed',\n] as const;\n\nexport type EngineServerStatusResponse =\n (typeof ENGINE_SERVER_STATUS_VALUES)[number];\n\nexport interface EngineServerNoncesResponse {\n order_nonce: string;\n tx_nonce: string;\n}\n\nexport interface EngineServerSubaccountInfoResponse extends EngineServerSubaccountInfoState {\n exists: boolean;\n subaccount: string;\n spot_count: number;\n perp_count: number;\n spot_products: EngineServerSpotProduct[];\n perp_products: EngineServerPerpProduct[];\n\n /** This is set if request has `pre_state` flag set to 'true' */\n pre_state: EngineServerSubaccountInfoState | undefined;\n}\n\nexport interface EngineServerSubaccountInfoState {\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_balances: EngineServerSpotBalance[];\n perp_balances: EngineServerPerpBalance[];\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 maker_fee_rate_x18: string;\n taker_fee_rate_x18: string;\n long_weight_initial_x18: string;\n long_weight_maintenance_x18: string;\n // undefined when there is no max open interest limit (always undefined for spot products)\n max_open_interest_x18: string | undefined;\n isolated_only: boolean;\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 fee_tier: number;\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 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 EngineServerMaxBurnNlpResponse {\n max_nlp_amount: string;\n}\n\nexport interface EngineServerMaxMintNlpResponse {\n max_quote_amount: string;\n}\n\nexport interface EngineServerNlpLockedBalancesResponse {\n balance_locked: EngineServerNlpBalance;\n balance_unlocked: EngineServerNlpBalance;\n locked_balances: EngineServerNlpLockedBalance[];\n}\n\nexport interface EngineServerNlpPool {\n pool_id: number;\n subaccount: string;\n owner: string;\n balance_weight_x18: string;\n subaccount_info: EngineServerSubaccountInfoResponse;\n open_orders: EngineServerOrder[];\n}\n\nexport interface EngineServerNlpPoolInfoResponse {\n nlp_pools: EngineServerNlpPool[];\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_burnable: EngineServerMaxBurnNlpResponse;\n max_nlp_mintable: EngineServerMaxMintNlpResponse;\n max_order_size: EngineServerMaxOrderSizeResponse;\n nlp_locked_balances: EngineServerNlpLockedBalancesResponse;\n nlp_pool_info: EngineServerNlpPoolInfoResponse;\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 keyof EngineServerQueryResponseByType =\n 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 keyof EngineServerQueryResponseByType =\n EngineServerQueryRequestType,\n> =\n | EngineServerQuerySuccessResponse<TQueryType>\n | EngineServerQueryFailureResponse;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqKO,IAAM,8BAA8B;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":[]}
@@ -1,5 +1,5 @@
1
1
  import { HealthStatus } from '@nadohq/shared';
2
- import { EngineServerProductType, EngineServerSpotProduct, EngineServerPerpProduct, EngineServerSpotBalance, EngineServerPerpBalance, EngineServerHealthBreakdown } from './serverQueryModelTypes.cjs';
2
+ import { EngineServerProductType, EngineServerSpotProduct, EngineServerPerpProduct, EngineServerSpotBalance, EngineServerPerpBalance, EngineServerNlpBalance, EngineServerNlpLockedBalance, EngineServerHealthBreakdown, EngineServerOrder } from './serverQueryModelTypes.cjs';
3
3
 
4
4
  interface EngineServerNoncesParams {
5
5
  address: string;
@@ -14,6 +14,7 @@ interface EngineServerSubaccountInfoQueryParams {
14
14
  v_quote_delta: string;
15
15
  };
16
16
  }>;
17
+ pre_state?: string;
17
18
  }
18
19
  interface EngineServerIsolatedPositionsQueryParams {
19
20
  subaccount: string;
@@ -63,6 +64,8 @@ interface EngineServerMaxOrderSizeQueryParams {
63
64
  direction: 'long' | 'short';
64
65
  spot_leverage: string | null;
65
66
  reduce_only: string | null;
67
+ isolated: string | null;
68
+ borrow_margin: string | null;
66
69
  }
67
70
  interface EngineServerLinkedSignerParams {
68
71
  subaccount: string;
@@ -71,6 +74,12 @@ interface EngineServerMaxMintNlpQueryParams {
71
74
  sender: string;
72
75
  spot_leverage: string | null;
73
76
  }
77
+ interface EngineServerMaxBurnNlpQueryParams {
78
+ sender: string;
79
+ }
80
+ interface EngineServerNlpLockedBalancesQueryParams {
81
+ subaccount: string;
82
+ }
74
83
  interface EngineServerQueryRequestByType {
75
84
  all_products: Record<string, never>;
76
85
  contracts: Record<string, never>;
@@ -83,8 +92,11 @@ interface EngineServerQueryRequestByType {
83
92
  market_liquidity: EngineServerMarketLiquidityQueryParams;
84
93
  market_price: EngineServerMarketPriceQueryParams;
85
94
  market_prices: EngineServerMarketPricesQueryParams;
95
+ max_nlp_burnable: EngineServerMaxBurnNlpQueryParams;
86
96
  max_nlp_mintable: EngineServerMaxMintNlpQueryParams;
87
97
  max_order_size: EngineServerMaxOrderSizeQueryParams;
98
+ nlp_locked_balances: EngineServerNlpLockedBalancesQueryParams;
99
+ nlp_pool_info: Record<string, never>;
88
100
  max_withdrawable: EngineServerMaxWithdrawableQueryParams;
89
101
  nonces: EngineServerNoncesParams;
90
102
  order: EngineServerGetOrderQueryParams;
@@ -105,26 +117,31 @@ interface EngineServerContractsResponse {
105
117
  chain_id: string;
106
118
  endpoint_addr: string;
107
119
  }
108
- type EngineServerStatusResponse = 'started' | 'active' | 'stopping' | 'syncing' | 'live_syncing' | 'failed';
120
+ declare const ENGINE_SERVER_STATUS_VALUES: readonly ["started", "active", "stopping", "syncing", "live_syncing", "failed"];
121
+ type EngineServerStatusResponse = (typeof ENGINE_SERVER_STATUS_VALUES)[number];
109
122
  interface EngineServerNoncesResponse {
110
123
  order_nonce: string;
111
124
  tx_nonce: string;
112
125
  }
113
- interface EngineServerSubaccountInfoResponse {
126
+ interface EngineServerSubaccountInfoResponse extends EngineServerSubaccountInfoState {
114
127
  exists: boolean;
115
128
  subaccount: string;
129
+ spot_count: number;
130
+ perp_count: number;
131
+ spot_products: EngineServerSpotProduct[];
132
+ perp_products: EngineServerPerpProduct[];
133
+ /** This is set if request has `pre_state` flag set to 'true' */
134
+ pre_state: EngineServerSubaccountInfoState | undefined;
135
+ }
136
+ interface EngineServerSubaccountInfoState {
116
137
  healths: [
117
138
  initial: EngineServerHealthBreakdown,
118
139
  maintenance: EngineServerHealthBreakdown,
119
140
  unweighted: EngineServerHealthBreakdown
120
141
  ];
121
142
  health_contributions: string[][];
122
- spot_count: number;
123
- perp_count: number;
124
143
  spot_balances: EngineServerSpotBalance[];
125
144
  perp_balances: EngineServerPerpBalance[];
126
- spot_products: EngineServerSpotProduct[];
127
- perp_products: EngineServerPerpProduct[];
128
145
  }
129
146
  interface EngineServerIsolatedPosition {
130
147
  subaccount: string;
@@ -150,12 +167,12 @@ interface EngineServerSymbol {
150
167
  price_increment_x18: string;
151
168
  size_increment: string;
152
169
  min_size: string;
153
- min_depth_x18: string;
154
- max_spread_rate_x18: string;
155
170
  maker_fee_rate_x18: string;
156
171
  taker_fee_rate_x18: string;
157
172
  long_weight_initial_x18: string;
158
173
  long_weight_maintenance_x18: string;
174
+ max_open_interest_x18: string | undefined;
175
+ isolated_only: boolean;
159
176
  }
160
177
  interface EngineServerSymbolsResponse {
161
178
  symbols: Record<string, EngineServerSymbol>;
@@ -203,19 +220,6 @@ type EngineServerMarketPriceResponse = EngineServerMarketPrice;
203
220
  interface EngineServerMarketPricesResponse {
204
221
  market_prices: EngineServerMarketPrice[];
205
222
  }
206
- interface EngineServerOrder {
207
- product_id: number;
208
- sender: string;
209
- price_x18: string;
210
- amount: string;
211
- expiration: string;
212
- nonce: string;
213
- unfilled_amount: string;
214
- digest: string;
215
- placed_at: number;
216
- order_type: string;
217
- appendix: string;
218
- }
219
223
  type EngineServerOrderResponse = EngineServerOrder;
220
224
  interface EngineServerValidateOrderResponse {
221
225
  product_id: number;
@@ -242,9 +246,28 @@ interface EngineInsuranceResponse {
242
246
  interface EngineServerEdgeAllProductsResponse {
243
247
  edge_all_products: Record<number, EngineServerAllProductsResponse>;
244
248
  }
249
+ interface EngineServerMaxBurnNlpResponse {
250
+ max_nlp_amount: string;
251
+ }
245
252
  interface EngineServerMaxMintNlpResponse {
246
253
  max_quote_amount: string;
247
254
  }
255
+ interface EngineServerNlpLockedBalancesResponse {
256
+ balance_locked: EngineServerNlpBalance;
257
+ balance_unlocked: EngineServerNlpBalance;
258
+ locked_balances: EngineServerNlpLockedBalance[];
259
+ }
260
+ interface EngineServerNlpPool {
261
+ pool_id: number;
262
+ subaccount: string;
263
+ owner: string;
264
+ balance_weight_x18: string;
265
+ subaccount_info: EngineServerSubaccountInfoResponse;
266
+ open_orders: EngineServerOrder[];
267
+ }
268
+ interface EngineServerNlpPoolInfoResponse {
269
+ nlp_pools: EngineServerNlpPool[];
270
+ }
248
271
  interface EngineServerQueryResponseByType {
249
272
  all_products: EngineServerAllProductsResponse;
250
273
  contracts: EngineServerContractsResponse;
@@ -257,8 +280,11 @@ interface EngineServerQueryResponseByType {
257
280
  market_liquidity: EngineServerMarketLiquidityResponse;
258
281
  market_price: EngineServerMarketPriceResponse;
259
282
  market_prices: EngineServerMarketPricesResponse;
283
+ max_nlp_burnable: EngineServerMaxBurnNlpResponse;
260
284
  max_nlp_mintable: EngineServerMaxMintNlpResponse;
261
285
  max_order_size: EngineServerMaxOrderSizeResponse;
286
+ nlp_locked_balances: EngineServerNlpLockedBalancesResponse;
287
+ nlp_pool_info: EngineServerNlpPoolInfoResponse;
262
288
  max_withdrawable: EngineServerMaxWithdrawableResponse;
263
289
  nonces: EngineServerNoncesResponse;
264
290
  order: EngineServerOrderResponse;
@@ -280,4 +306,4 @@ interface EngineServerQueryFailureResponse {
280
306
  }
281
307
  type EngineServerQueryResponse<TQueryType extends keyof EngineServerQueryResponseByType = EngineServerQueryRequestType> = EngineServerQuerySuccessResponse<TQueryType> | EngineServerQueryFailureResponse;
282
308
 
283
- 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 };
309
+ export { ENGINE_SERVER_STATUS_VALUES, type EngineInsuranceResponse, type EngineServerAllProductsResponse, type EngineServerContractsResponse, type EngineServerEdgeAllProductsResponse, type EngineServerFeeRatesResponse, type EngineServerGetOrderQueryParams, type EngineServerHealthGroupsResponse, type EngineServerIpBlockResponse, type EngineServerIsolatedPosition, type EngineServerIsolatedPositionsQueryParams, type EngineServerIsolatedPositionsResponse, type EngineServerLinkedSignerParams, type EngineServerLinkedSignerResponse, type EngineServerMarketLiquidityQueryParams, type EngineServerMarketLiquidityResponse, type EngineServerMarketPrice, type EngineServerMarketPriceQueryParams, type EngineServerMarketPriceResponse, type EngineServerMarketPricesQueryParams, type EngineServerMarketPricesResponse, type EngineServerMaxBurnNlpQueryParams, type EngineServerMaxBurnNlpResponse, type EngineServerMaxMintNlpQueryParams, type EngineServerMaxMintNlpResponse, type EngineServerMaxOrderSizeQueryParams, type EngineServerMaxOrderSizeResponse, type EngineServerMaxWithdrawableQueryParams, type EngineServerMaxWithdrawableResponse, type EngineServerNlpLockedBalancesQueryParams, type EngineServerNlpLockedBalancesResponse, type EngineServerNlpPool, type EngineServerNlpPoolInfoResponse, type EngineServerNoncesParams, type EngineServerNoncesResponse, type EngineServerOrderResponse, type EngineServerOrdersQueryParams, type EngineServerPriceTickLiquidity, type EngineServerProductOrdersResponse, type EngineServerQueryFailureResponse, type EngineServerQueryRequest, type EngineServerQueryRequestByType, type EngineServerQueryRequestType, type EngineServerQueryResponse, type EngineServerQueryResponseByType, type EngineServerQuerySuccessResponse, type EngineServerStatusResponse, type EngineServerSubaccountFeeRatesParams, type EngineServerSubaccountInfoQueryParams, type EngineServerSubaccountInfoResponse, type EngineServerSubaccountInfoState, type EngineServerSubaccountOrders, type EngineServerSubaccountOrdersQueryParams, type EngineServerSubaccountOrdersResponse, type EngineServerSymbol, type EngineServerSymbolsQueryParams, type EngineServerSymbolsResponse, type EngineServerTimeResponse, type EngineServerValidateOrderQueryParams, type EngineServerValidateOrderResponse };