@nadohq/engine-client 0.1.0-alpha.4 → 0.1.0-alpha.40

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 (83) hide show
  1. package/dist/EngineBaseClient.d.cts +1 -1
  2. package/dist/EngineBaseClient.d.ts +1 -1
  3. package/dist/EngineExecuteBuilder.cjs +9 -6
  4. package/dist/EngineExecuteBuilder.cjs.map +1 -1
  5. package/dist/EngineExecuteBuilder.js +9 -6
  6. package/dist/EngineExecuteBuilder.js.map +1 -1
  7. package/dist/EngineExecuteClient.cjs +6 -6
  8. package/dist/EngineExecuteClient.cjs.map +1 -1
  9. package/dist/EngineExecuteClient.d.cts +1 -1
  10. package/dist/EngineExecuteClient.d.ts +1 -1
  11. package/dist/EngineExecuteClient.js +6 -6
  12. package/dist/EngineExecuteClient.js.map +1 -1
  13. package/dist/EngineQueryClient.cjs +48 -4
  14. package/dist/EngineQueryClient.cjs.map +1 -1
  15. package/dist/EngineQueryClient.d.cts +18 -2
  16. package/dist/EngineQueryClient.d.ts +18 -2
  17. package/dist/EngineQueryClient.js +50 -4
  18. package/dist/EngineQueryClient.js.map +1 -1
  19. package/dist/endpoints.cjs +6 -6
  20. package/dist/endpoints.cjs.map +1 -1
  21. package/dist/endpoints.js +6 -6
  22. package/dist/endpoints.js.map +1 -1
  23. package/dist/index.cjs +4 -4
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +9 -9
  26. package/dist/index.d.ts +9 -9
  27. package/dist/index.js +2 -2
  28. package/dist/index.js.map +1 -1
  29. package/dist/types/EngineServerFailureError.cjs +1 -1
  30. package/dist/types/EngineServerFailureError.cjs.map +1 -1
  31. package/dist/types/EngineServerFailureError.js +1 -1
  32. package/dist/types/EngineServerFailureError.js.map +1 -1
  33. package/dist/types/clientExecuteTypes.cjs.map +1 -1
  34. package/dist/types/clientExecuteTypes.d.cts +8 -1
  35. package/dist/types/clientExecuteTypes.d.ts +8 -1
  36. package/dist/types/clientQueryTypes.cjs.map +1 -1
  37. package/dist/types/clientQueryTypes.d.cts +37 -5
  38. package/dist/types/clientQueryTypes.d.ts +37 -5
  39. package/dist/types/index.cjs +10 -10
  40. package/dist/types/index.cjs.map +1 -1
  41. package/dist/types/index.d.cts +6 -6
  42. package/dist/types/index.d.ts +6 -6
  43. package/dist/types/index.js +5 -5
  44. package/dist/types/index.js.map +1 -1
  45. package/dist/types/serverExecuteTypes.cjs.map +1 -1
  46. package/dist/types/serverExecuteTypes.d.cts +8 -1
  47. package/dist/types/serverExecuteTypes.d.ts +8 -1
  48. package/dist/types/serverQueryModelTypes.cjs.map +1 -1
  49. package/dist/types/serverQueryModelTypes.d.cts +24 -1
  50. package/dist/types/serverQueryModelTypes.d.ts +24 -1
  51. package/dist/types/serverQueryTypes.cjs.map +1 -1
  52. package/dist/types/serverQueryTypes.d.cts +47 -22
  53. package/dist/types/serverQueryTypes.d.ts +47 -22
  54. package/dist/types/serverSubscriptionEventTypes.cjs.map +1 -1
  55. package/dist/types/serverSubscriptionEventTypes.d.cts +86 -22
  56. package/dist/types/serverSubscriptionEventTypes.d.ts +86 -22
  57. package/dist/types/serverSubscriptionTypes.cjs.map +1 -1
  58. package/dist/types/serverSubscriptionTypes.d.cts +21 -4
  59. package/dist/types/serverSubscriptionTypes.d.ts +21 -4
  60. package/dist/utils/index.d.cts +2 -2
  61. package/dist/utils/index.d.ts +2 -2
  62. package/dist/utils/queryDataMappers.cjs +66 -19
  63. package/dist/utils/queryDataMappers.cjs.map +1 -1
  64. package/dist/utils/queryDataMappers.d.cts +5 -3
  65. package/dist/utils/queryDataMappers.d.ts +5 -3
  66. package/dist/utils/queryDataMappers.js +64 -19
  67. package/dist/utils/queryDataMappers.js.map +1 -1
  68. package/package.json +7 -3
  69. package/src/EngineExecuteBuilder.ts +9 -6
  70. package/src/EngineExecuteClient.ts +7 -7
  71. package/src/EngineQueryClient.ts +63 -1
  72. package/src/endpoints.ts +6 -6
  73. package/src/index.ts +2 -2
  74. package/src/types/EngineServerFailureError.ts +1 -1
  75. package/src/types/clientExecuteTypes.ts +9 -2
  76. package/src/types/clientQueryTypes.ts +49 -4
  77. package/src/types/index.ts +5 -5
  78. package/src/types/serverExecuteTypes.ts +9 -2
  79. package/src/types/serverQueryModelTypes.ts +25 -0
  80. package/src/types/serverQueryTypes.ts +61 -21
  81. package/src/types/serverSubscriptionEventTypes.ts +131 -21
  82. package/src/types/serverSubscriptionTypes.ts +23 -3
  83. package/src/utils/queryDataMappers.ts +85 -20
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/clientQueryTypes.ts"],"sourcesContent":["import {\n BalanceHealthContributions,\n BalanceSide,\n BalanceWithProduct,\n BigDecimal,\n EIP712OrderParams,\n HealthGroup,\n HealthStatusByType,\n MarketWithProduct,\n OrderAppendix,\n PerpBalanceWithProduct,\n ProductEngineType,\n SignedEIP712OrderParams,\n SpotBalanceWithProduct,\n Subaccount,\n} from '@nadohq/shared';\nimport {\n EngineServerNoncesParams,\n EngineServerTimeResponse,\n} from './serverQueryTypes';\n\nexport type GetEngineSubaccountSummaryResponse = {\n exists: boolean;\n balances: BalanceWithProduct[];\n health: HealthStatusByType;\n};\n\nexport type GetEngineSubaccountSummaryParams = Subaccount;\n\nexport type GetEngineIsolatedPositionsParams = Subaccount;\n\nexport interface SubaccountIsolatedPosition {\n subaccount: Subaccount;\n healths: BalanceHealthContributions;\n quoteBalance: SpotBalanceWithProduct;\n baseBalance: PerpBalanceWithProduct;\n}\n\nexport type GetEngineIsolatedPositionsResponse = SubaccountIsolatedPosition[];\n\nexport type SubaccountTx = {\n type: 'apply_delta';\n tx: SubaccountProductDeltaTx;\n};\n\nexport interface SubaccountProductDeltaTx {\n productId: number;\n amountDelta: BigDecimal;\n vQuoteDelta: BigDecimal;\n}\n\nexport interface GetEngineContractsResponse {\n chainId: number;\n endpointAddr: string;\n}\n\nexport type GetEngineEstimatedSubaccountSummaryParams = Subaccount & {\n txs: SubaccountTx[];\n};\n\nexport type GetEngineNoncesParams = EngineServerNoncesParams;\n\nexport interface GetEngineNoncesResponse {\n orderNonce: string;\n txNonce: string;\n}\n\nexport interface GetEngineSymbolsParams {\n productType?: ProductEngineType;\n productIds?: number[];\n}\n\nexport interface EngineSymbolsResponse {\n // mapping of product symbol to symbols info\n symbols: Record<string, EngineSymbol>;\n}\n\nexport interface EngineSymbol {\n type: ProductEngineType;\n productId: number;\n symbol: string;\n priceIncrement: BigDecimal;\n sizeIncrement: BigDecimal;\n minSize: BigDecimal;\n minDepth: BigDecimal;\n maxSpreadRate: BigDecimal;\n makerFeeRate: BigDecimal;\n takerFeeRate: BigDecimal;\n longWeightInitial: BigDecimal;\n longWeightMaintenance: BigDecimal;\n}\n\nexport type GetEngineAllMarketsResponse = MarketWithProduct[];\n\nexport interface GetEngineHealthGroupsResponse {\n healthGroups: HealthGroup[];\n}\n\nexport interface GetEngineOrderParams {\n productId: number;\n digest: string;\n}\n\nexport interface EngineOrder extends Subaccount {\n productId: number;\n price: BigDecimal;\n // Amount initially requested\n totalAmount: BigDecimal;\n // Amount still unfilled\n unfilledAmount: BigDecimal;\n expiration: number;\n nonce: string;\n digest: string;\n placementTime: number;\n appendix: OrderAppendix;\n}\n\nexport type GetEngineOrderResponse = EngineOrder;\n\nexport interface ValidateSignedEngineOrderParams {\n productId: number;\n signedOrder: SignedEIP712OrderParams;\n}\n\nexport interface ValidateEngineOrderParams {\n productId: number;\n chainId: number;\n order: EIP712OrderParams;\n}\n\nexport interface ValidateEngineOrderResponse {\n productId: number;\n valid: boolean;\n}\n\nexport interface GetEngineSubaccountOrdersParams extends Subaccount {\n productId: number;\n}\n\nexport interface EngineSubaccountOrders {\n productId: number;\n orders: EngineOrder[];\n}\n\nexport type GetEngineSubaccountOrdersResponse = EngineSubaccountOrders;\n\nexport interface GetEngineSubaccountProductOrdersParams extends Subaccount {\n productIds: number[];\n}\n\nexport interface GetEngineSubaccountProductOrdersResponse {\n productOrders: EngineSubaccountOrders[];\n}\n\nexport type GetEngineSubaccountFeeRatesParams = Subaccount;\n\nexport interface SubaccountOrderFeeRates {\n maker: BigDecimal;\n taker: BigDecimal;\n}\n\nexport interface GetEngineSubaccountFeeRatesResponse {\n // By Product ID\n orders: Record<number, SubaccountOrderFeeRates>;\n withdrawal: Record<number, BigDecimal>;\n liquidationSequencerFee: BigDecimal;\n healthCheckSequencerFee: BigDecimal;\n takerSequencerFee: BigDecimal;\n}\n\nexport interface EnginePriceTickLiquidity {\n price: BigDecimal;\n liquidity: BigDecimal;\n}\n\nexport interface GetEngineMarketLiquidityParams {\n productId: number;\n // The minimum depth in base price ticks (i.e. per side\n depth: number;\n}\n\nexport interface GetEngineMarketLiquidityResponse {\n bids: EnginePriceTickLiquidity[];\n asks: EnginePriceTickLiquidity[];\n}\n\nexport interface GetEngineMarketPriceParams {\n productId: number;\n}\n\nexport interface EngineMarketPrice {\n productId: number;\n bid: BigDecimal;\n ask: BigDecimal;\n}\n\nexport type GetEngineMarketPriceResponse = EngineMarketPrice;\n\nexport interface GetEngineMarketPricesParams {\n productIds: number[];\n}\n\nexport interface GetEngineMarketPricesResponse {\n marketPrices: EngineMarketPrice[];\n}\n\nexport interface GetEngineMaxOrderSizeParams extends Subaccount {\n price: BigDecimal;\n productId: number;\n // Note: When `reduceOnly` is true, `side` must be opposite of the current position, otherwise it returns 0.\n side: BalanceSide;\n // If not given, engine defaults to true (leverage/borrow enabled) for spot\n // Do not pass this for perp products\n spotLeverage?: boolean;\n // If not given, engine defaults to false. If true, the max order size will be capped to the subaccount's current position size;\n // If no position exists, it will return 0.\n reduceOnly?: boolean;\n}\n\nexport type GetEngineMaxOrderSizeResponse = BigDecimal;\n\nexport interface GetEngineMaxWithdrawableParams extends Subaccount {\n productId: number;\n // If not given, engine defaults to true (leverage/borrow enabled)\n spotLeverage?: boolean;\n}\n\nexport type GetEngineMaxWithdrawableResponse = BigDecimal;\n\nexport type GetEngineTimeResponse = EngineServerTimeResponse;\n\nexport type GetEngineLinkedSignerParams = Subaccount;\n\nexport interface GetEngineLinkedSignerResponse {\n signer: string;\n}\n\nexport type GetEngineInsuranceResponse = BigDecimal;\n\n/**\n * Given an IP, backend will either:\n * - Allow queries only through archive / engine (query_only)\n * - Block all requests (blocked)\n * - Allow all requests (null)\n */\nexport type GetEngineIpBlockStatusResponse = 'query_only' | 'blocked' | null;\n\nexport interface GetEngineMaxMintNlpAmountParams extends Subaccount {\n // If not given, engine defaults to true (leverage/borrow enabled)\n spotLeverage?: boolean;\n}\n\nexport type GetEngineMaxMintNlpAmountResponse = BigDecimal;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/types/clientQueryTypes.ts"],"sourcesContent":["import {\n BalanceHealthContributions,\n BalanceSide,\n BalanceWithProduct,\n BigDecimal,\n EIP712OrderParams,\n HealthGroup,\n HealthStatusByType,\n MarketWithProduct,\n OrderAppendix,\n PerpBalanceWithProduct,\n ProductEngineType,\n SignedEIP712OrderParams,\n SpotBalanceWithProduct,\n Subaccount,\n} from '@nadohq/shared';\nimport {\n EngineServerNoncesParams,\n EngineServerTimeResponse,\n} from './serverQueryTypes';\n\nexport interface GetEngineSubaccountSummaryResponse\n extends SubaccountSummaryState {\n exists: boolean;\n preState?: SubaccountSummaryState;\n}\n\nexport interface SubaccountSummaryState {\n balances: BalanceWithProduct[];\n health: HealthStatusByType;\n}\n\nexport type GetEngineSubaccountSummaryParams = Subaccount;\n\nexport type GetEngineIsolatedPositionsParams = Subaccount;\n\nexport interface SubaccountIsolatedPosition {\n subaccount: Subaccount;\n healths: BalanceHealthContributions;\n quoteBalance: SpotBalanceWithProduct;\n baseBalance: PerpBalanceWithProduct;\n}\n\nexport type GetEngineIsolatedPositionsResponse = SubaccountIsolatedPosition[];\n\nexport type SubaccountTx = {\n type: 'apply_delta';\n tx: SubaccountProductDeltaTx;\n};\n\nexport interface SubaccountProductDeltaTx {\n productId: number;\n amountDelta: BigDecimal;\n vQuoteDelta: BigDecimal;\n}\n\nexport interface GetEngineContractsResponse {\n chainId: number;\n endpointAddr: string;\n}\n\nexport type GetEngineEstimatedSubaccountSummaryParams = Subaccount & {\n txs: SubaccountTx[];\n preState?: boolean;\n};\n\nexport type GetEngineNoncesParams = EngineServerNoncesParams;\n\nexport interface GetEngineNoncesResponse {\n orderNonce: string;\n txNonce: string;\n}\n\nexport interface GetEngineSymbolsParams {\n productType?: ProductEngineType;\n productIds?: number[];\n}\n\nexport interface EngineSymbolsResponse {\n // mapping of product symbol to symbols info\n symbols: Record<string, EngineSymbol>;\n}\n\nexport interface EngineSymbol {\n type: ProductEngineType;\n productId: number;\n symbol: string;\n priceIncrement: BigDecimal;\n sizeIncrement: BigDecimal;\n minSize: BigDecimal;\n makerFeeRate: BigDecimal;\n takerFeeRate: BigDecimal;\n longWeightInitial: BigDecimal;\n longWeightMaintenance: BigDecimal;\n // undefined when there is no max open interest limit (always undefined for spot products)\n maxOpenInterest: BigDecimal | undefined;\n}\n\nexport type GetEngineAllMarketsResponse = MarketWithProduct[];\n\nexport interface GetEngineHealthGroupsResponse {\n healthGroups: HealthGroup[];\n}\n\nexport interface GetEngineOrderParams {\n productId: number;\n digest: string;\n}\n\nexport interface EngineOrder extends Subaccount {\n productId: number;\n price: BigDecimal;\n // Amount initially requested\n totalAmount: BigDecimal;\n // Amount still unfilled\n unfilledAmount: BigDecimal;\n expiration: number;\n nonce: string;\n digest: string;\n placementTime: number;\n appendix: OrderAppendix;\n}\n\nexport type GetEngineOrderResponse = EngineOrder;\n\nexport interface ValidateSignedEngineOrderParams {\n productId: number;\n signedOrder: SignedEIP712OrderParams;\n}\n\nexport interface ValidateEngineOrderParams {\n productId: number;\n chainId: number;\n order: EIP712OrderParams;\n}\n\nexport interface ValidateEngineOrderResponse {\n productId: number;\n valid: boolean;\n}\n\nexport interface GetEngineSubaccountOrdersParams extends Subaccount {\n productId: number;\n}\n\nexport interface EngineSubaccountOrders {\n productId: number;\n orders: EngineOrder[];\n}\n\nexport type GetEngineSubaccountOrdersResponse = EngineSubaccountOrders;\n\nexport interface GetEngineSubaccountProductOrdersParams extends Subaccount {\n productIds: number[];\n}\n\nexport interface GetEngineSubaccountProductOrdersResponse {\n productOrders: EngineSubaccountOrders[];\n}\n\nexport type GetEngineSubaccountFeeRatesParams = Subaccount;\n\nexport interface SubaccountOrderFeeRates {\n maker: BigDecimal;\n taker: BigDecimal;\n}\n\nexport interface GetEngineSubaccountFeeRatesResponse {\n // By Product ID\n orders: Record<number, SubaccountOrderFeeRates>;\n withdrawal: Record<number, BigDecimal>;\n liquidationSequencerFee: BigDecimal;\n healthCheckSequencerFee: BigDecimal;\n takerSequencerFee: BigDecimal;\n feeTier: number;\n}\n\nexport interface EnginePriceTickLiquidity {\n price: BigDecimal;\n liquidity: BigDecimal;\n}\n\nexport interface GetEngineMarketLiquidityParams {\n productId: number;\n // The minimum depth in base price ticks (i.e. per side\n depth: number;\n}\n\nexport interface GetEngineMarketLiquidityResponse {\n bids: EnginePriceTickLiquidity[];\n asks: EnginePriceTickLiquidity[];\n}\n\nexport interface GetEngineMarketPriceParams {\n productId: number;\n}\n\nexport interface EngineMarketPrice {\n productId: number;\n bid: BigDecimal;\n ask: BigDecimal;\n}\n\nexport type GetEngineMarketPriceResponse = EngineMarketPrice;\n\nexport interface GetEngineMarketPricesParams {\n productIds: number[];\n}\n\nexport interface GetEngineMarketPricesResponse {\n marketPrices: EngineMarketPrice[];\n}\n\nexport interface GetEngineMaxOrderSizeParams extends Subaccount {\n price: BigDecimal;\n productId: number;\n // Note: When `reduceOnly` is true, `side` must be opposite of the current position, otherwise it returns 0.\n side: BalanceSide;\n // If not given, engine defaults to true (leverage/borrow enabled) for spot\n // Do not pass this for perp products\n spotLeverage?: boolean;\n // If not given, engine defaults to false. If true, the max order size will be capped to the subaccount's current position size;\n // If no position exists, it will return 0.\n reduceOnly?: boolean;\n isolated?: boolean;\n // If not given, engine defaults to true (do not borrow margin for isolated orders)\n // Max order size query for `isolated` includes available transfer from the cross subaccount\n isoBorrowMargin?: boolean;\n}\n\nexport type GetEngineMaxOrderSizeResponse = BigDecimal;\n\nexport interface GetEngineMaxWithdrawableParams extends Subaccount {\n productId: number;\n // If not given, engine defaults to true (leverage/borrow enabled)\n spotLeverage?: boolean;\n}\n\nexport type GetEngineMaxWithdrawableResponse = BigDecimal;\n\nexport type GetEngineTimeResponse = EngineServerTimeResponse;\n\nexport type GetEngineLinkedSignerParams = Subaccount;\n\nexport interface GetEngineLinkedSignerResponse {\n signer: string;\n}\n\nexport type GetEngineInsuranceResponse = BigDecimal;\n\n/**\n * Given an IP, backend will either:\n * - Allow queries only through archive / engine (query_only)\n * - Block all requests (blocked)\n * - Allow all requests (null)\n */\nexport type GetEngineIpBlockStatusResponse = 'query_only' | 'blocked' | null;\n\nexport interface GetEngineMaxMintNlpAmountParams extends Subaccount {\n // If not given, engine defaults to true (leverage/borrow enabled)\n spotLeverage?: boolean;\n}\n\nexport type GetEngineMaxMintNlpAmountResponse = BigDecimal;\n\nexport type GetEngineMaxBurnNlpAmountParams = Subaccount;\n\nexport type GetEngineMaxBurnNlpAmountResponse = BigDecimal;\n\nexport type GetEngineNlpLockedBalancesParams = Subaccount;\n\nexport interface EngineNlpBalance {\n productId: number;\n balance: BigDecimal;\n}\n\nexport interface EngineNlpLockedBalance extends EngineNlpBalance {\n unlockedAt: number;\n}\n\nexport interface GetEngineNlpLockedBalancesResponse {\n lockedBalances: EngineNlpLockedBalance[];\n balanceLocked: EngineNlpBalance;\n balanceUnlocked: EngineNlpBalance;\n}\n\nexport interface NlpPool {\n poolId: number;\n subaccountHex: string;\n ownerAddress: string;\n balanceWeight: BigDecimal;\n subaccountInfo: GetEngineSubaccountSummaryResponse;\n openOrders: EngineOrder[];\n}\n\nexport interface GetEngineNlpPoolInfoResponse {\n nlpPools: NlpPool[];\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -2,11 +2,14 @@ import { Subaccount, BalanceWithProduct, HealthStatusByType, BalanceHealthContri
2
2
  import { EngineServerNoncesParams, EngineServerTimeResponse } from './serverQueryTypes.cjs';
3
3
  import './serverQueryModelTypes.cjs';
4
4
 
5
- type GetEngineSubaccountSummaryResponse = {
5
+ interface GetEngineSubaccountSummaryResponse extends SubaccountSummaryState {
6
6
  exists: boolean;
7
+ preState?: SubaccountSummaryState;
8
+ }
9
+ interface SubaccountSummaryState {
7
10
  balances: BalanceWithProduct[];
8
11
  health: HealthStatusByType;
9
- };
12
+ }
10
13
  type GetEngineSubaccountSummaryParams = Subaccount;
11
14
  type GetEngineIsolatedPositionsParams = Subaccount;
12
15
  interface SubaccountIsolatedPosition {
@@ -31,6 +34,7 @@ interface GetEngineContractsResponse {
31
34
  }
32
35
  type GetEngineEstimatedSubaccountSummaryParams = Subaccount & {
33
36
  txs: SubaccountTx[];
37
+ preState?: boolean;
34
38
  };
35
39
  type GetEngineNoncesParams = EngineServerNoncesParams;
36
40
  interface GetEngineNoncesResponse {
@@ -51,12 +55,11 @@ interface EngineSymbol {
51
55
  priceIncrement: BigDecimal;
52
56
  sizeIncrement: BigDecimal;
53
57
  minSize: BigDecimal;
54
- minDepth: BigDecimal;
55
- maxSpreadRate: BigDecimal;
56
58
  makerFeeRate: BigDecimal;
57
59
  takerFeeRate: BigDecimal;
58
60
  longWeightInitial: BigDecimal;
59
61
  longWeightMaintenance: BigDecimal;
62
+ maxOpenInterest: BigDecimal | undefined;
60
63
  }
61
64
  type GetEngineAllMarketsResponse = MarketWithProduct[];
62
65
  interface GetEngineHealthGroupsResponse {
@@ -116,6 +119,7 @@ interface GetEngineSubaccountFeeRatesResponse {
116
119
  liquidationSequencerFee: BigDecimal;
117
120
  healthCheckSequencerFee: BigDecimal;
118
121
  takerSequencerFee: BigDecimal;
122
+ feeTier: number;
119
123
  }
120
124
  interface EnginePriceTickLiquidity {
121
125
  price: BigDecimal;
@@ -150,6 +154,8 @@ interface GetEngineMaxOrderSizeParams extends Subaccount {
150
154
  side: BalanceSide;
151
155
  spotLeverage?: boolean;
152
156
  reduceOnly?: boolean;
157
+ isolated?: boolean;
158
+ isoBorrowMargin?: boolean;
153
159
  }
154
160
  type GetEngineMaxOrderSizeResponse = BigDecimal;
155
161
  interface GetEngineMaxWithdrawableParams extends Subaccount {
@@ -174,5 +180,31 @@ interface GetEngineMaxMintNlpAmountParams extends Subaccount {
174
180
  spotLeverage?: boolean;
175
181
  }
176
182
  type GetEngineMaxMintNlpAmountResponse = BigDecimal;
183
+ type GetEngineMaxBurnNlpAmountParams = Subaccount;
184
+ type GetEngineMaxBurnNlpAmountResponse = BigDecimal;
185
+ type GetEngineNlpLockedBalancesParams = Subaccount;
186
+ interface EngineNlpBalance {
187
+ productId: number;
188
+ balance: BigDecimal;
189
+ }
190
+ interface EngineNlpLockedBalance extends EngineNlpBalance {
191
+ unlockedAt: number;
192
+ }
193
+ interface GetEngineNlpLockedBalancesResponse {
194
+ lockedBalances: EngineNlpLockedBalance[];
195
+ balanceLocked: EngineNlpBalance;
196
+ balanceUnlocked: EngineNlpBalance;
197
+ }
198
+ interface NlpPool {
199
+ poolId: number;
200
+ subaccountHex: string;
201
+ ownerAddress: string;
202
+ balanceWeight: BigDecimal;
203
+ subaccountInfo: GetEngineSubaccountSummaryResponse;
204
+ openOrders: EngineOrder[];
205
+ }
206
+ interface GetEngineNlpPoolInfoResponse {
207
+ nlpPools: NlpPool[];
208
+ }
177
209
 
178
- export type { 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 };
210
+ export type { 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 };
@@ -2,11 +2,14 @@ import { Subaccount, BalanceWithProduct, HealthStatusByType, BalanceHealthContri
2
2
  import { EngineServerNoncesParams, EngineServerTimeResponse } from './serverQueryTypes.js';
3
3
  import './serverQueryModelTypes.js';
4
4
 
5
- type GetEngineSubaccountSummaryResponse = {
5
+ interface GetEngineSubaccountSummaryResponse extends SubaccountSummaryState {
6
6
  exists: boolean;
7
+ preState?: SubaccountSummaryState;
8
+ }
9
+ interface SubaccountSummaryState {
7
10
  balances: BalanceWithProduct[];
8
11
  health: HealthStatusByType;
9
- };
12
+ }
10
13
  type GetEngineSubaccountSummaryParams = Subaccount;
11
14
  type GetEngineIsolatedPositionsParams = Subaccount;
12
15
  interface SubaccountIsolatedPosition {
@@ -31,6 +34,7 @@ interface GetEngineContractsResponse {
31
34
  }
32
35
  type GetEngineEstimatedSubaccountSummaryParams = Subaccount & {
33
36
  txs: SubaccountTx[];
37
+ preState?: boolean;
34
38
  };
35
39
  type GetEngineNoncesParams = EngineServerNoncesParams;
36
40
  interface GetEngineNoncesResponse {
@@ -51,12 +55,11 @@ interface EngineSymbol {
51
55
  priceIncrement: BigDecimal;
52
56
  sizeIncrement: BigDecimal;
53
57
  minSize: BigDecimal;
54
- minDepth: BigDecimal;
55
- maxSpreadRate: BigDecimal;
56
58
  makerFeeRate: BigDecimal;
57
59
  takerFeeRate: BigDecimal;
58
60
  longWeightInitial: BigDecimal;
59
61
  longWeightMaintenance: BigDecimal;
62
+ maxOpenInterest: BigDecimal | undefined;
60
63
  }
61
64
  type GetEngineAllMarketsResponse = MarketWithProduct[];
62
65
  interface GetEngineHealthGroupsResponse {
@@ -116,6 +119,7 @@ interface GetEngineSubaccountFeeRatesResponse {
116
119
  liquidationSequencerFee: BigDecimal;
117
120
  healthCheckSequencerFee: BigDecimal;
118
121
  takerSequencerFee: BigDecimal;
122
+ feeTier: number;
119
123
  }
120
124
  interface EnginePriceTickLiquidity {
121
125
  price: BigDecimal;
@@ -150,6 +154,8 @@ interface GetEngineMaxOrderSizeParams extends Subaccount {
150
154
  side: BalanceSide;
151
155
  spotLeverage?: boolean;
152
156
  reduceOnly?: boolean;
157
+ isolated?: boolean;
158
+ isoBorrowMargin?: boolean;
153
159
  }
154
160
  type GetEngineMaxOrderSizeResponse = BigDecimal;
155
161
  interface GetEngineMaxWithdrawableParams extends Subaccount {
@@ -174,5 +180,31 @@ interface GetEngineMaxMintNlpAmountParams extends Subaccount {
174
180
  spotLeverage?: boolean;
175
181
  }
176
182
  type GetEngineMaxMintNlpAmountResponse = BigDecimal;
183
+ type GetEngineMaxBurnNlpAmountParams = Subaccount;
184
+ type GetEngineMaxBurnNlpAmountResponse = BigDecimal;
185
+ type GetEngineNlpLockedBalancesParams = Subaccount;
186
+ interface EngineNlpBalance {
187
+ productId: number;
188
+ balance: BigDecimal;
189
+ }
190
+ interface EngineNlpLockedBalance extends EngineNlpBalance {
191
+ unlockedAt: number;
192
+ }
193
+ interface GetEngineNlpLockedBalancesResponse {
194
+ lockedBalances: EngineNlpLockedBalance[];
195
+ balanceLocked: EngineNlpBalance;
196
+ balanceUnlocked: EngineNlpBalance;
197
+ }
198
+ interface NlpPool {
199
+ poolId: number;
200
+ subaccountHex: string;
201
+ ownerAddress: string;
202
+ balanceWeight: BigDecimal;
203
+ subaccountInfo: GetEngineSubaccountSummaryResponse;
204
+ openOrders: EngineOrder[];
205
+ }
206
+ interface GetEngineNlpPoolInfoResponse {
207
+ nlpPools: NlpPool[];
208
+ }
177
209
 
178
- export type { 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 };
210
+ export type { 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 };
@@ -17,23 +17,23 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
17
17
  // src/types/index.ts
18
18
  var types_exports = {};
19
19
  module.exports = __toCommonJS(types_exports);
20
- __reExport(types_exports, require("./clientQueryTypes.cjs"), module.exports);
21
20
  __reExport(types_exports, require("./clientExecuteTypes.cjs"), module.exports);
22
- __reExport(types_exports, require("./serverQueryTypes.cjs"), module.exports);
23
- __reExport(types_exports, require("./serverQueryModelTypes.cjs"), module.exports);
21
+ __reExport(types_exports, require("./clientQueryTypes.cjs"), module.exports);
22
+ __reExport(types_exports, require("./EngineServerFailureError.cjs"), module.exports);
24
23
  __reExport(types_exports, require("./serverExecuteTypes.cjs"), module.exports);
25
- __reExport(types_exports, require("./serverSubscriptionTypes.cjs"), module.exports);
24
+ __reExport(types_exports, require("./serverQueryModelTypes.cjs"), module.exports);
25
+ __reExport(types_exports, require("./serverQueryTypes.cjs"), module.exports);
26
26
  __reExport(types_exports, require("./serverSubscriptionEventTypes.cjs"), module.exports);
27
- __reExport(types_exports, require("./EngineServerFailureError.cjs"), module.exports);
27
+ __reExport(types_exports, require("./serverSubscriptionTypes.cjs"), module.exports);
28
28
  // Annotate the CommonJS export names for ESM import in node:
29
29
  0 && (module.exports = {
30
- ...require("./clientQueryTypes.cjs"),
31
30
  ...require("./clientExecuteTypes.cjs"),
32
- ...require("./serverQueryTypes.cjs"),
33
- ...require("./serverQueryModelTypes.cjs"),
31
+ ...require("./clientQueryTypes.cjs"),
32
+ ...require("./EngineServerFailureError.cjs"),
34
33
  ...require("./serverExecuteTypes.cjs"),
35
- ...require("./serverSubscriptionTypes.cjs"),
34
+ ...require("./serverQueryModelTypes.cjs"),
35
+ ...require("./serverQueryTypes.cjs"),
36
36
  ...require("./serverSubscriptionEventTypes.cjs"),
37
- ...require("./EngineServerFailureError.cjs")
37
+ ...require("./serverSubscriptionTypes.cjs")
38
38
  });
39
39
  //# sourceMappingURL=index.cjs.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;AAAA;AAAA,0BAAc,mCAAd;AACA,0BAAc,qCADd;AAEA,0BAAc,mCAFd;AAGA,0BAAc,wCAHd;AAIA,0BAAc,qCAJd;AAKA,0BAAc,0CALd;AAMA,0BAAc,+CANd;AAOA,0BAAc,2CAPd;","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;AAAA;AAAA,0BAAc,qCAAd;AACA,0BAAc,mCADd;AAEA,0BAAc,2CAFd;AAGA,0BAAc,qCAHd;AAIA,0BAAc,wCAJd;AAKA,0BAAc,mCALd;AAMA,0BAAc,+CANd;AAOA,0BAAc,0CAPd;","names":[]}
@@ -1,9 +1,9 @@
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';
5
- export { EngineServerCancelOrdersParams, EngineServerCancelOrdersResponse, EngineServerExecuteFailureResult, EngineServerExecutePlaceOrderPayload, EngineServerExecuteRequestByType, EngineServerExecuteRequestType, EngineServerExecuteResponseDataByType, EngineServerExecuteResult, EngineServerExecuteSuccessResult, EngineServerPlaceOrderParams, EngineServerPlaceOrderResponse, EngineServerPlaceOrdersResponse, EngineServiceCancelAndPlaceParams } from './serverExecuteTypes.cjs';
6
- export { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams } from './serverSubscriptionTypes.cjs';
7
- export { EngineServerSubscriptionBestBidOfferEvent, EngineServerSubscriptionBookDepthEvent, EngineServerSubscriptionFillEvent, EngineServerSubscriptionOrderUpdateEvent, EngineServerSubscriptionPositionChangeEvent, EngineServerSubscriptionTradeEvent } from './serverSubscriptionEventTypes.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';
8
3
  export { EngineServerFailureError } from './EngineServerFailureError.cjs';
4
+ export { EngineServerCancelOrdersParams, EngineServerCancelOrdersResponse, EngineServerExecuteFailureResult, EngineServerExecutePlaceOrderPayload, EngineServerExecuteRequestByType, EngineServerExecuteRequestType, EngineServerExecuteResponseDataByType, EngineServerExecuteResult, EngineServerExecuteSuccessResult, EngineServerPlaceOrderParams, EngineServerPlaceOrderResponse, EngineServerPlaceOrdersResponse, EngineServiceCancelAndPlaceParams } from './serverExecuteTypes.cjs';
5
+ export { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerNlpBalance, EngineServerNlpLockedBalance, EngineServerOrder, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState } from './serverQueryModelTypes.cjs';
6
+ export { 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
+ export { EngineServerSubscriptionBaseEvent, EngineServerSubscriptionBestBidOfferEvent, EngineServerSubscriptionBookDepthEvent, EngineServerSubscriptionEvent, EngineServerSubscriptionEventType, EngineServerSubscriptionFillEvent, EngineServerSubscriptionFundingPaymentEvent, EngineServerSubscriptionLatestCandlestickEvent, EngineServerSubscriptionLiquidationEvent, EngineServerSubscriptionOrderUpdateEvent, EngineServerSubscriptionPositionChangeEvent, EngineServerSubscriptionTradeEvent, OrderUpdateReason, PositionChangeReason } from './serverSubscriptionEventTypes.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';
@@ -1,9 +1,9 @@
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';
5
- export { EngineServerCancelOrdersParams, EngineServerCancelOrdersResponse, EngineServerExecuteFailureResult, EngineServerExecutePlaceOrderPayload, EngineServerExecuteRequestByType, EngineServerExecuteRequestType, EngineServerExecuteResponseDataByType, EngineServerExecuteResult, EngineServerExecuteSuccessResult, EngineServerPlaceOrderParams, EngineServerPlaceOrderResponse, EngineServerPlaceOrdersResponse, EngineServiceCancelAndPlaceParams } from './serverExecuteTypes.js';
6
- export { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams } from './serverSubscriptionTypes.js';
7
- export { EngineServerSubscriptionBestBidOfferEvent, EngineServerSubscriptionBookDepthEvent, EngineServerSubscriptionFillEvent, EngineServerSubscriptionOrderUpdateEvent, EngineServerSubscriptionPositionChangeEvent, EngineServerSubscriptionTradeEvent } from './serverSubscriptionEventTypes.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';
8
3
  export { EngineServerFailureError } from './EngineServerFailureError.js';
4
+ export { EngineServerCancelOrdersParams, EngineServerCancelOrdersResponse, EngineServerExecuteFailureResult, EngineServerExecutePlaceOrderPayload, EngineServerExecuteRequestByType, EngineServerExecuteRequestType, EngineServerExecuteResponseDataByType, EngineServerExecuteResult, EngineServerExecuteSuccessResult, EngineServerPlaceOrderParams, EngineServerPlaceOrderResponse, EngineServerPlaceOrdersResponse, EngineServiceCancelAndPlaceParams } from './serverExecuteTypes.js';
5
+ export { EngineServerBookInfo, EngineServerHealthBreakdown, EngineServerNlpBalance, EngineServerNlpLockedBalance, EngineServerOrder, EngineServerPerpBalance, EngineServerPerpBalanceData, EngineServerPerpProduct, EngineServerPerpState, EngineServerProductType, EngineServerRisk, EngineServerSpotBalance, EngineServerSpotBalanceData, EngineServerSpotConfig, EngineServerSpotProduct, EngineServerSpotState } from './serverQueryModelTypes.js';
6
+ export { 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
+ export { EngineServerSubscriptionBaseEvent, EngineServerSubscriptionBestBidOfferEvent, EngineServerSubscriptionBookDepthEvent, EngineServerSubscriptionEvent, EngineServerSubscriptionEventType, EngineServerSubscriptionFillEvent, EngineServerSubscriptionFundingPaymentEvent, EngineServerSubscriptionLatestCandlestickEvent, EngineServerSubscriptionLiquidationEvent, EngineServerSubscriptionOrderUpdateEvent, EngineServerSubscriptionPositionChangeEvent, EngineServerSubscriptionTradeEvent, OrderUpdateReason, PositionChangeReason } from './serverSubscriptionEventTypes.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';
@@ -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 };
@@ -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}\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 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 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}\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\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":[]}