@nadohq/engine-client 0.1.0-alpha.1

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 (142) hide show
  1. package/README.md +2 -0
  2. package/dist/EngineBaseClient.cjs +166 -0
  3. package/dist/EngineBaseClient.cjs.map +1 -0
  4. package/dist/EngineBaseClient.d.cts +75 -0
  5. package/dist/EngineBaseClient.d.ts +75 -0
  6. package/dist/EngineBaseClient.js +133 -0
  7. package/dist/EngineBaseClient.js.map +1 -0
  8. package/dist/EngineClient.cjs +40 -0
  9. package/dist/EngineClient.cjs.map +1 -0
  10. package/dist/EngineClient.d.cts +23 -0
  11. package/dist/EngineClient.d.ts +23 -0
  12. package/dist/EngineClient.js +15 -0
  13. package/dist/EngineClient.js.map +1 -0
  14. package/dist/EngineExecuteBuilder.cjs +304 -0
  15. package/dist/EngineExecuteBuilder.cjs.map +1 -0
  16. package/dist/EngineExecuteBuilder.d.cts +118 -0
  17. package/dist/EngineExecuteBuilder.d.ts +118 -0
  18. package/dist/EngineExecuteBuilder.js +282 -0
  19. package/dist/EngineExecuteBuilder.js.map +1 -0
  20. package/dist/EngineExecuteClient.cjs +114 -0
  21. package/dist/EngineExecuteClient.cjs.map +1 -0
  22. package/dist/EngineExecuteClient.d.cts +28 -0
  23. package/dist/EngineExecuteClient.d.ts +28 -0
  24. package/dist/EngineExecuteClient.js +89 -0
  25. package/dist/EngineExecuteClient.js.map +1 -0
  26. package/dist/EngineQueryClient.cjs +431 -0
  27. package/dist/EngineQueryClient.cjs.map +1 -0
  28. package/dist/EngineQueryClient.d.cts +143 -0
  29. package/dist/EngineQueryClient.d.ts +143 -0
  30. package/dist/EngineQueryClient.js +424 -0
  31. package/dist/EngineQueryClient.js.map +1 -0
  32. package/dist/EngineWebClient.cjs +75 -0
  33. package/dist/EngineWebClient.cjs.map +1 -0
  34. package/dist/EngineWebClient.d.cts +31 -0
  35. package/dist/EngineWebClient.d.ts +31 -0
  36. package/dist/EngineWebClient.js +50 -0
  37. package/dist/EngineWebClient.js.map +1 -0
  38. package/dist/endpoints.cjs +49 -0
  39. package/dist/endpoints.cjs.map +1 -0
  40. package/dist/endpoints.d.cts +7 -0
  41. package/dist/endpoints.d.ts +7 -0
  42. package/dist/endpoints.js +22 -0
  43. package/dist/endpoints.js.map +1 -0
  44. package/dist/index.cjs +31 -0
  45. package/dist/index.cjs.map +1 -0
  46. package/dist/index.d.cts +20 -0
  47. package/dist/index.d.ts +20 -0
  48. package/dist/index.js +6 -0
  49. package/dist/index.js.map +1 -0
  50. package/dist/types/EngineServerFailureError.cjs +36 -0
  51. package/dist/types/EngineServerFailureError.cjs.map +1 -0
  52. package/dist/types/EngineServerFailureError.d.cts +11 -0
  53. package/dist/types/EngineServerFailureError.d.ts +11 -0
  54. package/dist/types/EngineServerFailureError.js +11 -0
  55. package/dist/types/EngineServerFailureError.js.map +1 -0
  56. package/dist/types/clientExecuteTypes.cjs +19 -0
  57. package/dist/types/clientExecuteTypes.cjs.map +1 -0
  58. package/dist/types/clientExecuteTypes.d.cts +74 -0
  59. package/dist/types/clientExecuteTypes.d.ts +74 -0
  60. package/dist/types/clientExecuteTypes.js +1 -0
  61. package/dist/types/clientExecuteTypes.js.map +1 -0
  62. package/dist/types/clientQueryTypes.cjs +19 -0
  63. package/dist/types/clientQueryTypes.cjs.map +1 -0
  64. package/dist/types/clientQueryTypes.d.cts +189 -0
  65. package/dist/types/clientQueryTypes.d.ts +189 -0
  66. package/dist/types/clientQueryTypes.js +1 -0
  67. package/dist/types/clientQueryTypes.js.map +1 -0
  68. package/dist/types/index.cjs +39 -0
  69. package/dist/types/index.cjs.map +1 -0
  70. package/dist/types/index.d.cts +10 -0
  71. package/dist/types/index.d.ts +10 -0
  72. package/dist/types/index.js +10 -0
  73. package/dist/types/index.js.map +1 -0
  74. package/dist/types/serverExecuteTypes.cjs +19 -0
  75. package/dist/types/serverExecuteTypes.cjs.map +1 -0
  76. package/dist/types/serverExecuteTypes.d.cts +91 -0
  77. package/dist/types/serverExecuteTypes.d.ts +91 -0
  78. package/dist/types/serverExecuteTypes.js +1 -0
  79. package/dist/types/serverExecuteTypes.js.map +1 -0
  80. package/dist/types/serverQueryModelTypes.cjs +19 -0
  81. package/dist/types/serverQueryModelTypes.cjs.map +1 -0
  82. package/dist/types/serverQueryModelTypes.d.cts +73 -0
  83. package/dist/types/serverQueryModelTypes.d.ts +73 -0
  84. package/dist/types/serverQueryModelTypes.js +1 -0
  85. package/dist/types/serverQueryModelTypes.js.map +1 -0
  86. package/dist/types/serverQueryTypes.cjs +19 -0
  87. package/dist/types/serverQueryTypes.cjs.map +1 -0
  88. package/dist/types/serverQueryTypes.d.cts +292 -0
  89. package/dist/types/serverQueryTypes.d.ts +292 -0
  90. package/dist/types/serverQueryTypes.js +1 -0
  91. package/dist/types/serverQueryTypes.js.map +1 -0
  92. package/dist/types/serverSubscriptionEventTypes.cjs +19 -0
  93. package/dist/types/serverSubscriptionEventTypes.cjs.map +1 -0
  94. package/dist/types/serverSubscriptionEventTypes.d.cts +71 -0
  95. package/dist/types/serverSubscriptionEventTypes.d.ts +71 -0
  96. package/dist/types/serverSubscriptionEventTypes.js +1 -0
  97. package/dist/types/serverSubscriptionEventTypes.js.map +1 -0
  98. package/dist/types/serverSubscriptionTypes.cjs +19 -0
  99. package/dist/types/serverSubscriptionTypes.cjs.map +1 -0
  100. package/dist/types/serverSubscriptionTypes.d.cts +63 -0
  101. package/dist/types/serverSubscriptionTypes.d.ts +63 -0
  102. package/dist/types/serverSubscriptionTypes.js +1 -0
  103. package/dist/types/serverSubscriptionTypes.js.map +1 -0
  104. package/dist/utils/index.cjs +25 -0
  105. package/dist/utils/index.cjs.map +1 -0
  106. package/dist/utils/index.d.cts +6 -0
  107. package/dist/utils/index.d.ts +6 -0
  108. package/dist/utils/index.js +3 -0
  109. package/dist/utils/index.js.map +1 -0
  110. package/dist/utils/productEngineTypeMappers.cjs +49 -0
  111. package/dist/utils/productEngineTypeMappers.cjs.map +1 -0
  112. package/dist/utils/productEngineTypeMappers.d.cts +7 -0
  113. package/dist/utils/productEngineTypeMappers.d.ts +7 -0
  114. package/dist/utils/productEngineTypeMappers.js +23 -0
  115. package/dist/utils/productEngineTypeMappers.js.map +1 -0
  116. package/dist/utils/queryDataMappers.cjs +282 -0
  117. package/dist/utils/queryDataMappers.cjs.map +1 -0
  118. package/dist/utils/queryDataMappers.d.cts +18 -0
  119. package/dist/utils/queryDataMappers.d.ts +18 -0
  120. package/dist/utils/queryDataMappers.js +258 -0
  121. package/dist/utils/queryDataMappers.js.map +1 -0
  122. package/package.json +52 -0
  123. package/src/EngineBaseClient.ts +223 -0
  124. package/src/EngineClient.ts +13 -0
  125. package/src/EngineExecuteBuilder.ts +381 -0
  126. package/src/EngineExecuteClient.ts +122 -0
  127. package/src/EngineQueryClient.ts +553 -0
  128. package/src/EngineWebClient.ts +72 -0
  129. package/src/endpoints.ts +21 -0
  130. package/src/index.ts +4 -0
  131. package/src/types/EngineServerFailureError.ts +12 -0
  132. package/src/types/clientExecuteTypes.ts +118 -0
  133. package/src/types/clientQueryTypes.ts +267 -0
  134. package/src/types/index.ts +8 -0
  135. package/src/types/serverExecuteTypes.ts +138 -0
  136. package/src/types/serverQueryModelTypes.ts +83 -0
  137. package/src/types/serverQueryTypes.ts +382 -0
  138. package/src/types/serverSubscriptionEventTypes.ts +74 -0
  139. package/src/types/serverSubscriptionTypes.ts +79 -0
  140. package/src/utils/index.ts +1 -0
  141. package/src/utils/productEngineTypeMappers.ts +24 -0
  142. package/src/utils/queryDataMappers.ts +303 -0
@@ -0,0 +1,74 @@
1
+ import { EIP712BurnVlpParams, EIP712CancelOrdersParams, EIP712OrderParams, EIP712CancelProductOrdersParams, EIP712LinkSignerParams, EIP712LiquidateSubaccountParams, EIP712MintVlpParams, EIP712IsolatedOrderParams, EIP712TransferQuoteParams, EIP712WithdrawCollateralParams } from '@nadohq/contracts';
2
+ import { EngineServerExecuteSuccessResult } from './serverExecuteTypes.js';
3
+ import './serverQueryTypes.js';
4
+ import './serverQueryModelTypes.js';
5
+
6
+ /**
7
+ * Either verifying address or signature must be provided;
8
+ * If signature is not provided, the verifying address with the engine signer will be used to sign.
9
+ */
10
+ type SignatureParams = {
11
+ verifyingAddr: string;
12
+ chainId: number;
13
+ } | {
14
+ signature: string;
15
+ };
16
+ type WithoutNonce<T extends {
17
+ nonce: unknown;
18
+ }> = Omit<T, 'nonce'>;
19
+ type WithSpotLeverage<T> = T & {
20
+ spotLeverage?: boolean;
21
+ };
22
+ type WithSignature<T> = T & {
23
+ signature: string;
24
+ };
25
+ type WithBaseEngineExecuteParams<T> = SignatureParams & Omit<T, 'nonce'> & {
26
+ nonce?: string;
27
+ };
28
+ type EngineOrderParams = WithoutNonce<EIP712OrderParams>;
29
+ type EnginePlaceOrderParams = WithBaseEngineExecuteParams<{
30
+ id?: number;
31
+ productId: number;
32
+ order: EngineOrderParams;
33
+ spotLeverage?: boolean;
34
+ }>;
35
+ type EngineIsolatedOrderParams = WithoutNonce<EIP712IsolatedOrderParams>;
36
+ type EnginePlaceIsolatedOrderParams = WithBaseEngineExecuteParams<{
37
+ id?: number;
38
+ productId: number;
39
+ order: EngineIsolatedOrderParams;
40
+ borrowMargin?: boolean;
41
+ }>;
42
+ type EngineLiquidateSubaccountParams = WithBaseEngineExecuteParams<EIP712LiquidateSubaccountParams>;
43
+ type EngineWithdrawCollateralParams = WithBaseEngineExecuteParams<WithSpotLeverage<EIP712WithdrawCollateralParams>>;
44
+ type EngineCancelOrdersParams = WithBaseEngineExecuteParams<EIP712CancelOrdersParams>;
45
+ type EngineCancelAndPlaceParams = {
46
+ cancelOrders: EngineCancelOrdersParams;
47
+ placeOrder: EnginePlaceOrderParams;
48
+ };
49
+ type EngineCancelProductOrdersParams = WithBaseEngineExecuteParams<EIP712CancelProductOrdersParams>;
50
+ type EngineLinkSignerParams = WithBaseEngineExecuteParams<EIP712LinkSignerParams>;
51
+ type EngineTransferQuoteParams = WithBaseEngineExecuteParams<EIP712TransferQuoteParams>;
52
+ type EngineMintVlpParams = WithBaseEngineExecuteParams<WithSpotLeverage<EIP712MintVlpParams>>;
53
+ type EngineBurnVlpParams = WithBaseEngineExecuteParams<EIP712BurnVlpParams>;
54
+ interface EngineExecuteRequestParamsByType {
55
+ burn_vlp: EngineBurnVlpParams;
56
+ cancel_and_place: EngineCancelAndPlaceParams;
57
+ cancel_orders: EngineCancelOrdersParams;
58
+ cancel_product_orders: EngineCancelProductOrdersParams;
59
+ link_signer: EngineLinkSignerParams;
60
+ liquidate_subaccount: EngineLiquidateSubaccountParams;
61
+ mint_vlp: EngineMintVlpParams;
62
+ place_isolated_order: EnginePlaceIsolatedOrderParams;
63
+ place_order: EnginePlaceOrderParams;
64
+ transfer_quote: EngineTransferQuoteParams;
65
+ withdraw_collateral: EngineWithdrawCollateralParams;
66
+ }
67
+ type EnginePlaceOrderResult = EngineServerExecuteSuccessResult<'place_order'> & {
68
+ orderParams: EIP712OrderParams;
69
+ };
70
+ type EnginePlaceIsolatedOrderResult = EngineServerExecuteSuccessResult<'place_isolated_order'> & {
71
+ orderParams: EIP712IsolatedOrderParams;
72
+ };
73
+
74
+ export type { EngineBurnVlpParams, EngineCancelAndPlaceParams, EngineCancelOrdersParams, EngineCancelProductOrdersParams, EngineExecuteRequestParamsByType, EngineIsolatedOrderParams, EngineLinkSignerParams, EngineLiquidateSubaccountParams, EngineMintVlpParams, EngineOrderParams, EnginePlaceIsolatedOrderParams, EnginePlaceIsolatedOrderResult, EnginePlaceOrderParams, EnginePlaceOrderResult, EngineTransferQuoteParams, EngineWithdrawCollateralParams, SignatureParams, WithBaseEngineExecuteParams, WithSignature };
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=clientExecuteTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/types/clientQueryTypes.ts
17
+ var clientQueryTypes_exports = {};
18
+ module.exports = __toCommonJS(clientQueryTypes_exports);
19
+ //# sourceMappingURL=clientQueryTypes.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/clientQueryTypes.ts"],"sourcesContent":["import {\n BalanceHealthContributions,\n BalanceSide,\n EIP712OrderParams,\n GetAllMarketsResponse,\n GetSubaccountSummaryParams,\n HealthGroup,\n OrderExpirationType,\n PerpBalanceWithProduct,\n ProductEngineType,\n SignedEIP712OrderParams,\n SpotBalanceWithProduct,\n Subaccount,\n SubaccountSummaryResponse,\n} from '@nadohq/contracts';\nimport { BigDecimal } from '@nadohq/utils';\nimport {\n EngineServerNoncesParams,\n EngineServerTimeResponse,\n} from './serverQueryTypes';\n\nexport type GetEngineSubaccountSummaryResponse = SubaccountSummaryResponse;\n\nexport type GetEngineSubaccountSummaryParams = GetSubaccountSummaryParams;\n\nexport type GetEngineIsolatedPositionsParams = Subaccount;\n\nexport interface SubaccountIsolatedPosition {\n subaccount: Subaccount;\n healths: BalanceHealthContributions;\n quoteBalance: SpotBalanceWithProduct;\n baseBalance: PerpBalanceWithProduct;\n}\n\nexport type GetEngineIsolatedPositionsResponse = SubaccountIsolatedPosition[];\n\nexport type SubaccountTx = {\n 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 * Address for the orderbook contract, with the product ID being the index\n */\n orderbookAddrs: string[];\n}\n\nexport type GetEngineEstimatedSubaccountSummaryParams =\n GetSubaccountSummaryParams & {\n txs: SubaccountTx[];\n };\n\nexport type GetEngineNoncesParams = EngineServerNoncesParams;\n\nexport interface GetEngineNoncesResponse {\n orderNonce: string;\n txNonce: string;\n}\n\nexport interface GetEngineSymbolsParams {\n productType?: ProductEngineType;\n productIds?: number[];\n}\n\nexport interface EngineSymbolsResponse {\n // mapping of product symbol to symbols info\n symbols: Record<string, EngineSymbol>;\n}\n\nexport interface EngineSymbol {\n type: ProductEngineType;\n productId: number;\n symbol: string;\n priceIncrement: BigDecimal;\n sizeIncrement: BigDecimal;\n minSize: BigDecimal;\n minDepth: BigDecimal;\n maxSpreadRate: BigDecimal;\n makerFeeRate: BigDecimal;\n takerFeeRate: BigDecimal;\n longWeightInitial: BigDecimal;\n longWeightMaintenance: BigDecimal;\n}\n\nexport type GetEngineAllMarketsResponse = GetAllMarketsResponse;\n\nexport interface GetEngineHealthGroupsResponse {\n healthGroups: HealthGroup[];\n}\n\nexport interface GetEngineOrderParams {\n productId: number;\n digest: string;\n}\n\nexport interface EngineOrder extends Subaccount {\n productId: number;\n price: BigDecimal;\n // Amount initially requested\n totalAmount: BigDecimal;\n // Amount still unfilled\n unfilledAmount: BigDecimal;\n expiration: BigDecimal;\n // Margin being transferred for the order, will be null if not an iso order\n margin: BigDecimal | null;\n nonce: string;\n digest: string;\n orderParams: EIP712OrderParams;\n placementTime: number;\n orderType: OrderExpirationType;\n}\n\nexport type GetEngineOrderResponse = EngineOrder;\n\nexport interface ValidateSignedEngineOrderParams {\n productId: number;\n signedOrder: SignedEIP712OrderParams;\n}\n\nexport interface ValidateEngineOrderParams {\n productId: number;\n orderbookAddr: string;\n chainId: number;\n order: EIP712OrderParams;\n}\n\nexport interface ValidateEngineOrderResponse {\n productId: number;\n valid: boolean;\n}\n\nexport interface GetEngineSubaccountOrdersParams extends Subaccount {\n productId: number;\n}\n\nexport interface EngineSubaccountOrders {\n productId: number;\n orders: EngineOrder[];\n}\n\nexport type GetEngineSubaccountOrdersResponse = EngineSubaccountOrders;\n\nexport interface GetEngineSubaccountProductOrdersParams extends Subaccount {\n productIds: number[];\n}\n\nexport interface GetEngineSubaccountProductOrdersResponse {\n productOrders: EngineSubaccountOrders[];\n}\n\nexport type GetEngineSubaccountFeeRatesParams = Subaccount;\n\nexport interface SubaccountOrderFeeRates {\n maker: BigDecimal;\n taker: BigDecimal;\n}\n\nexport interface GetEngineSubaccountFeeRatesResponse {\n // By Product ID\n orders: Record<number, SubaccountOrderFeeRates>;\n withdrawal: Record<number, BigDecimal>;\n liquidationSequencerFee: BigDecimal;\n healthCheckSequencerFee: BigDecimal;\n takerSequencerFee: BigDecimal;\n}\n\nexport interface EnginePriceTickLiquidity {\n price: BigDecimal;\n liquidity: BigDecimal;\n}\n\nexport interface GetEngineMarketLiquidityParams {\n productId: number;\n // The minimum depth in base price ticks (i.e. per side\n depth: number;\n}\n\nexport interface GetEngineMarketLiquidityResponse {\n bids: EnginePriceTickLiquidity[];\n asks: EnginePriceTickLiquidity[];\n}\n\nexport interface GetEngineMarketPriceParams {\n productId: number;\n}\n\nexport interface EngineMarketPrice {\n productId: number;\n bid: BigDecimal;\n ask: BigDecimal;\n}\n\nexport type GetEngineMarketPriceResponse = EngineMarketPrice;\n\nexport interface GetEngineMarketPricesParams {\n productIds: number[];\n}\n\nexport interface GetEngineMarketPricesResponse {\n marketPrices: EngineMarketPrice[];\n}\n\nexport interface GetEngineMaxOrderSizeParams extends Subaccount {\n price: BigDecimal;\n productId: number;\n // Note: When `reduceOnly` is true, `side` must be opposite of the current position, otherwise it returns 0.\n side: BalanceSide;\n // If not given, engine defaults to true (leverage/borrow enabled) for spot\n // Do not pass this for perp products\n spotLeverage?: boolean;\n // If not given, engine defaults to false. If true, the max order size will be capped to the subaccount's current position size;\n // If no position exists, it will return 0.\n reduceOnly?: boolean;\n}\n\nexport type GetEngineMaxOrderSizeResponse = BigDecimal;\n\nexport interface GetEngineMaxWithdrawableParams extends Subaccount {\n productId: number;\n // If not given, engine defaults to true (leverage/borrow enabled)\n spotLeverage?: boolean;\n}\n\nexport type GetEngineMaxWithdrawableResponse = BigDecimal;\n\nexport type GetEngineTimeResponse = EngineServerTimeResponse;\n\nexport type GetEngineLinkedSignerParams = Subaccount;\n\nexport interface GetEngineLinkedSignerResponse {\n signer: string;\n}\n\nexport type GetEngineInsuranceResponse = BigDecimal;\n\nexport interface EngineMinDepositRate {\n productId: number;\n minDepositRate: BigDecimal;\n}\n\nexport interface GetEngineMinDepositRatesResponse {\n minDepositRates: Record<number, EngineMinDepositRate>;\n}\n\n/**\n * Given an IP, backend will either:\n * - Allow queries only through archive / engine (query_only)\n * - Block all requests (blocked)\n * - Allow all requests (null)\n */\nexport type GetEngineIpBlockStatusResponse = 'query_only' | 'blocked' | null;\n\nexport interface GetEngineMaxMintVlpAmountParams extends Subaccount {\n // If not given, engine defaults to true (leverage/borrow enabled)\n spotLeverage?: boolean;\n}\n\nexport type GetEngineMaxMintVlpAmountResponse = BigDecimal;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1,189 @@
1
+ import { GetSubaccountSummaryParams, SubaccountSummaryResponse, Subaccount, BalanceHealthContributions, SpotBalanceWithProduct, PerpBalanceWithProduct, ProductEngineType, GetAllMarketsResponse, HealthGroup, EIP712OrderParams, OrderExpirationType, SignedEIP712OrderParams, BalanceSide } from '@nadohq/contracts';
2
+ import { BigDecimal } from '@nadohq/utils';
3
+ import { EngineServerNoncesParams, EngineServerTimeResponse } from './serverQueryTypes.cjs';
4
+ import './serverQueryModelTypes.cjs';
5
+
6
+ type GetEngineSubaccountSummaryResponse = SubaccountSummaryResponse;
7
+ type GetEngineSubaccountSummaryParams = GetSubaccountSummaryParams;
8
+ type GetEngineIsolatedPositionsParams = Subaccount;
9
+ interface SubaccountIsolatedPosition {
10
+ subaccount: Subaccount;
11
+ healths: BalanceHealthContributions;
12
+ quoteBalance: SpotBalanceWithProduct;
13
+ baseBalance: PerpBalanceWithProduct;
14
+ }
15
+ type GetEngineIsolatedPositionsResponse = SubaccountIsolatedPosition[];
16
+ type SubaccountTx = {
17
+ type: 'apply_delta';
18
+ tx: SubaccountProductDeltaTx;
19
+ };
20
+ interface SubaccountProductDeltaTx {
21
+ productId: number;
22
+ amountDelta: BigDecimal;
23
+ vQuoteDelta: BigDecimal;
24
+ }
25
+ interface GetEngineContractsResponse {
26
+ chainId: number;
27
+ endpointAddr: string;
28
+ /**
29
+ * Address for the orderbook contract, with the product ID being the index
30
+ */
31
+ orderbookAddrs: string[];
32
+ }
33
+ type GetEngineEstimatedSubaccountSummaryParams = GetSubaccountSummaryParams & {
34
+ txs: SubaccountTx[];
35
+ };
36
+ type GetEngineNoncesParams = EngineServerNoncesParams;
37
+ interface GetEngineNoncesResponse {
38
+ orderNonce: string;
39
+ txNonce: string;
40
+ }
41
+ interface GetEngineSymbolsParams {
42
+ productType?: ProductEngineType;
43
+ productIds?: number[];
44
+ }
45
+ interface EngineSymbolsResponse {
46
+ symbols: Record<string, EngineSymbol>;
47
+ }
48
+ interface EngineSymbol {
49
+ type: ProductEngineType;
50
+ productId: number;
51
+ symbol: string;
52
+ priceIncrement: BigDecimal;
53
+ sizeIncrement: BigDecimal;
54
+ minSize: BigDecimal;
55
+ minDepth: BigDecimal;
56
+ maxSpreadRate: BigDecimal;
57
+ makerFeeRate: BigDecimal;
58
+ takerFeeRate: BigDecimal;
59
+ longWeightInitial: BigDecimal;
60
+ longWeightMaintenance: BigDecimal;
61
+ }
62
+ type GetEngineAllMarketsResponse = GetAllMarketsResponse;
63
+ interface GetEngineHealthGroupsResponse {
64
+ healthGroups: HealthGroup[];
65
+ }
66
+ interface GetEngineOrderParams {
67
+ productId: number;
68
+ digest: string;
69
+ }
70
+ interface EngineOrder extends Subaccount {
71
+ productId: number;
72
+ price: BigDecimal;
73
+ totalAmount: BigDecimal;
74
+ unfilledAmount: BigDecimal;
75
+ expiration: BigDecimal;
76
+ margin: BigDecimal | null;
77
+ nonce: string;
78
+ digest: string;
79
+ orderParams: EIP712OrderParams;
80
+ placementTime: number;
81
+ orderType: OrderExpirationType;
82
+ }
83
+ type GetEngineOrderResponse = EngineOrder;
84
+ interface ValidateSignedEngineOrderParams {
85
+ productId: number;
86
+ signedOrder: SignedEIP712OrderParams;
87
+ }
88
+ interface ValidateEngineOrderParams {
89
+ productId: number;
90
+ orderbookAddr: string;
91
+ chainId: number;
92
+ order: EIP712OrderParams;
93
+ }
94
+ interface ValidateEngineOrderResponse {
95
+ productId: number;
96
+ valid: boolean;
97
+ }
98
+ interface GetEngineSubaccountOrdersParams extends Subaccount {
99
+ productId: number;
100
+ }
101
+ interface EngineSubaccountOrders {
102
+ productId: number;
103
+ orders: EngineOrder[];
104
+ }
105
+ type GetEngineSubaccountOrdersResponse = EngineSubaccountOrders;
106
+ interface GetEngineSubaccountProductOrdersParams extends Subaccount {
107
+ productIds: number[];
108
+ }
109
+ interface GetEngineSubaccountProductOrdersResponse {
110
+ productOrders: EngineSubaccountOrders[];
111
+ }
112
+ type GetEngineSubaccountFeeRatesParams = Subaccount;
113
+ interface SubaccountOrderFeeRates {
114
+ maker: BigDecimal;
115
+ taker: BigDecimal;
116
+ }
117
+ interface GetEngineSubaccountFeeRatesResponse {
118
+ orders: Record<number, SubaccountOrderFeeRates>;
119
+ withdrawal: Record<number, BigDecimal>;
120
+ liquidationSequencerFee: BigDecimal;
121
+ healthCheckSequencerFee: BigDecimal;
122
+ takerSequencerFee: BigDecimal;
123
+ }
124
+ interface EnginePriceTickLiquidity {
125
+ price: BigDecimal;
126
+ liquidity: BigDecimal;
127
+ }
128
+ interface GetEngineMarketLiquidityParams {
129
+ productId: number;
130
+ depth: number;
131
+ }
132
+ interface GetEngineMarketLiquidityResponse {
133
+ bids: EnginePriceTickLiquidity[];
134
+ asks: EnginePriceTickLiquidity[];
135
+ }
136
+ interface GetEngineMarketPriceParams {
137
+ productId: number;
138
+ }
139
+ interface EngineMarketPrice {
140
+ productId: number;
141
+ bid: BigDecimal;
142
+ ask: BigDecimal;
143
+ }
144
+ type GetEngineMarketPriceResponse = EngineMarketPrice;
145
+ interface GetEngineMarketPricesParams {
146
+ productIds: number[];
147
+ }
148
+ interface GetEngineMarketPricesResponse {
149
+ marketPrices: EngineMarketPrice[];
150
+ }
151
+ interface GetEngineMaxOrderSizeParams extends Subaccount {
152
+ price: BigDecimal;
153
+ productId: number;
154
+ side: BalanceSide;
155
+ spotLeverage?: boolean;
156
+ reduceOnly?: boolean;
157
+ }
158
+ type GetEngineMaxOrderSizeResponse = BigDecimal;
159
+ interface GetEngineMaxWithdrawableParams extends Subaccount {
160
+ productId: number;
161
+ spotLeverage?: boolean;
162
+ }
163
+ type GetEngineMaxWithdrawableResponse = BigDecimal;
164
+ type GetEngineTimeResponse = EngineServerTimeResponse;
165
+ type GetEngineLinkedSignerParams = Subaccount;
166
+ interface GetEngineLinkedSignerResponse {
167
+ signer: string;
168
+ }
169
+ type GetEngineInsuranceResponse = BigDecimal;
170
+ interface EngineMinDepositRate {
171
+ productId: number;
172
+ minDepositRate: BigDecimal;
173
+ }
174
+ interface GetEngineMinDepositRatesResponse {
175
+ minDepositRates: Record<number, EngineMinDepositRate>;
176
+ }
177
+ /**
178
+ * Given an IP, backend will either:
179
+ * - Allow queries only through archive / engine (query_only)
180
+ * - Block all requests (blocked)
181
+ * - Allow all requests (null)
182
+ */
183
+ type GetEngineIpBlockStatusResponse = 'query_only' | 'blocked' | null;
184
+ interface GetEngineMaxMintVlpAmountParams extends Subaccount {
185
+ spotLeverage?: boolean;
186
+ }
187
+ type GetEngineMaxMintVlpAmountResponse = BigDecimal;
188
+
189
+ export type { EngineMarketPrice, EngineMinDepositRate, EngineOrder, EnginePriceTickLiquidity, EngineSubaccountOrders, EngineSymbol, EngineSymbolsResponse, GetEngineAllMarketsResponse, GetEngineContractsResponse, GetEngineEstimatedSubaccountSummaryParams, GetEngineHealthGroupsResponse, GetEngineInsuranceResponse, GetEngineIpBlockStatusResponse, GetEngineIsolatedPositionsParams, GetEngineIsolatedPositionsResponse, GetEngineLinkedSignerParams, GetEngineLinkedSignerResponse, GetEngineMarketLiquidityParams, GetEngineMarketLiquidityResponse, GetEngineMarketPriceParams, GetEngineMarketPriceResponse, GetEngineMarketPricesParams, GetEngineMarketPricesResponse, GetEngineMaxMintVlpAmountParams, GetEngineMaxMintVlpAmountResponse, GetEngineMaxOrderSizeParams, GetEngineMaxOrderSizeResponse, GetEngineMaxWithdrawableParams, GetEngineMaxWithdrawableResponse, GetEngineMinDepositRatesResponse, GetEngineNoncesParams, GetEngineNoncesResponse, GetEngineOrderParams, GetEngineOrderResponse, GetEngineSubaccountFeeRatesParams, GetEngineSubaccountFeeRatesResponse, GetEngineSubaccountOrdersParams, GetEngineSubaccountOrdersResponse, GetEngineSubaccountProductOrdersParams, GetEngineSubaccountProductOrdersResponse, GetEngineSubaccountSummaryParams, GetEngineSubaccountSummaryResponse, GetEngineSymbolsParams, GetEngineTimeResponse, SubaccountIsolatedPosition, SubaccountOrderFeeRates, SubaccountProductDeltaTx, SubaccountTx, ValidateEngineOrderParams, ValidateEngineOrderResponse, ValidateSignedEngineOrderParams };
@@ -0,0 +1,189 @@
1
+ import { GetSubaccountSummaryParams, SubaccountSummaryResponse, Subaccount, BalanceHealthContributions, SpotBalanceWithProduct, PerpBalanceWithProduct, ProductEngineType, GetAllMarketsResponse, HealthGroup, EIP712OrderParams, OrderExpirationType, SignedEIP712OrderParams, BalanceSide } from '@nadohq/contracts';
2
+ import { BigDecimal } from '@nadohq/utils';
3
+ import { EngineServerNoncesParams, EngineServerTimeResponse } from './serverQueryTypes.js';
4
+ import './serverQueryModelTypes.js';
5
+
6
+ type GetEngineSubaccountSummaryResponse = SubaccountSummaryResponse;
7
+ type GetEngineSubaccountSummaryParams = GetSubaccountSummaryParams;
8
+ type GetEngineIsolatedPositionsParams = Subaccount;
9
+ interface SubaccountIsolatedPosition {
10
+ subaccount: Subaccount;
11
+ healths: BalanceHealthContributions;
12
+ quoteBalance: SpotBalanceWithProduct;
13
+ baseBalance: PerpBalanceWithProduct;
14
+ }
15
+ type GetEngineIsolatedPositionsResponse = SubaccountIsolatedPosition[];
16
+ type SubaccountTx = {
17
+ type: 'apply_delta';
18
+ tx: SubaccountProductDeltaTx;
19
+ };
20
+ interface SubaccountProductDeltaTx {
21
+ productId: number;
22
+ amountDelta: BigDecimal;
23
+ vQuoteDelta: BigDecimal;
24
+ }
25
+ interface GetEngineContractsResponse {
26
+ chainId: number;
27
+ endpointAddr: string;
28
+ /**
29
+ * Address for the orderbook contract, with the product ID being the index
30
+ */
31
+ orderbookAddrs: string[];
32
+ }
33
+ type GetEngineEstimatedSubaccountSummaryParams = GetSubaccountSummaryParams & {
34
+ txs: SubaccountTx[];
35
+ };
36
+ type GetEngineNoncesParams = EngineServerNoncesParams;
37
+ interface GetEngineNoncesResponse {
38
+ orderNonce: string;
39
+ txNonce: string;
40
+ }
41
+ interface GetEngineSymbolsParams {
42
+ productType?: ProductEngineType;
43
+ productIds?: number[];
44
+ }
45
+ interface EngineSymbolsResponse {
46
+ symbols: Record<string, EngineSymbol>;
47
+ }
48
+ interface EngineSymbol {
49
+ type: ProductEngineType;
50
+ productId: number;
51
+ symbol: string;
52
+ priceIncrement: BigDecimal;
53
+ sizeIncrement: BigDecimal;
54
+ minSize: BigDecimal;
55
+ minDepth: BigDecimal;
56
+ maxSpreadRate: BigDecimal;
57
+ makerFeeRate: BigDecimal;
58
+ takerFeeRate: BigDecimal;
59
+ longWeightInitial: BigDecimal;
60
+ longWeightMaintenance: BigDecimal;
61
+ }
62
+ type GetEngineAllMarketsResponse = GetAllMarketsResponse;
63
+ interface GetEngineHealthGroupsResponse {
64
+ healthGroups: HealthGroup[];
65
+ }
66
+ interface GetEngineOrderParams {
67
+ productId: number;
68
+ digest: string;
69
+ }
70
+ interface EngineOrder extends Subaccount {
71
+ productId: number;
72
+ price: BigDecimal;
73
+ totalAmount: BigDecimal;
74
+ unfilledAmount: BigDecimal;
75
+ expiration: BigDecimal;
76
+ margin: BigDecimal | null;
77
+ nonce: string;
78
+ digest: string;
79
+ orderParams: EIP712OrderParams;
80
+ placementTime: number;
81
+ orderType: OrderExpirationType;
82
+ }
83
+ type GetEngineOrderResponse = EngineOrder;
84
+ interface ValidateSignedEngineOrderParams {
85
+ productId: number;
86
+ signedOrder: SignedEIP712OrderParams;
87
+ }
88
+ interface ValidateEngineOrderParams {
89
+ productId: number;
90
+ orderbookAddr: string;
91
+ chainId: number;
92
+ order: EIP712OrderParams;
93
+ }
94
+ interface ValidateEngineOrderResponse {
95
+ productId: number;
96
+ valid: boolean;
97
+ }
98
+ interface GetEngineSubaccountOrdersParams extends Subaccount {
99
+ productId: number;
100
+ }
101
+ interface EngineSubaccountOrders {
102
+ productId: number;
103
+ orders: EngineOrder[];
104
+ }
105
+ type GetEngineSubaccountOrdersResponse = EngineSubaccountOrders;
106
+ interface GetEngineSubaccountProductOrdersParams extends Subaccount {
107
+ productIds: number[];
108
+ }
109
+ interface GetEngineSubaccountProductOrdersResponse {
110
+ productOrders: EngineSubaccountOrders[];
111
+ }
112
+ type GetEngineSubaccountFeeRatesParams = Subaccount;
113
+ interface SubaccountOrderFeeRates {
114
+ maker: BigDecimal;
115
+ taker: BigDecimal;
116
+ }
117
+ interface GetEngineSubaccountFeeRatesResponse {
118
+ orders: Record<number, SubaccountOrderFeeRates>;
119
+ withdrawal: Record<number, BigDecimal>;
120
+ liquidationSequencerFee: BigDecimal;
121
+ healthCheckSequencerFee: BigDecimal;
122
+ takerSequencerFee: BigDecimal;
123
+ }
124
+ interface EnginePriceTickLiquidity {
125
+ price: BigDecimal;
126
+ liquidity: BigDecimal;
127
+ }
128
+ interface GetEngineMarketLiquidityParams {
129
+ productId: number;
130
+ depth: number;
131
+ }
132
+ interface GetEngineMarketLiquidityResponse {
133
+ bids: EnginePriceTickLiquidity[];
134
+ asks: EnginePriceTickLiquidity[];
135
+ }
136
+ interface GetEngineMarketPriceParams {
137
+ productId: number;
138
+ }
139
+ interface EngineMarketPrice {
140
+ productId: number;
141
+ bid: BigDecimal;
142
+ ask: BigDecimal;
143
+ }
144
+ type GetEngineMarketPriceResponse = EngineMarketPrice;
145
+ interface GetEngineMarketPricesParams {
146
+ productIds: number[];
147
+ }
148
+ interface GetEngineMarketPricesResponse {
149
+ marketPrices: EngineMarketPrice[];
150
+ }
151
+ interface GetEngineMaxOrderSizeParams extends Subaccount {
152
+ price: BigDecimal;
153
+ productId: number;
154
+ side: BalanceSide;
155
+ spotLeverage?: boolean;
156
+ reduceOnly?: boolean;
157
+ }
158
+ type GetEngineMaxOrderSizeResponse = BigDecimal;
159
+ interface GetEngineMaxWithdrawableParams extends Subaccount {
160
+ productId: number;
161
+ spotLeverage?: boolean;
162
+ }
163
+ type GetEngineMaxWithdrawableResponse = BigDecimal;
164
+ type GetEngineTimeResponse = EngineServerTimeResponse;
165
+ type GetEngineLinkedSignerParams = Subaccount;
166
+ interface GetEngineLinkedSignerResponse {
167
+ signer: string;
168
+ }
169
+ type GetEngineInsuranceResponse = BigDecimal;
170
+ interface EngineMinDepositRate {
171
+ productId: number;
172
+ minDepositRate: BigDecimal;
173
+ }
174
+ interface GetEngineMinDepositRatesResponse {
175
+ minDepositRates: Record<number, EngineMinDepositRate>;
176
+ }
177
+ /**
178
+ * Given an IP, backend will either:
179
+ * - Allow queries only through archive / engine (query_only)
180
+ * - Block all requests (blocked)
181
+ * - Allow all requests (null)
182
+ */
183
+ type GetEngineIpBlockStatusResponse = 'query_only' | 'blocked' | null;
184
+ interface GetEngineMaxMintVlpAmountParams extends Subaccount {
185
+ spotLeverage?: boolean;
186
+ }
187
+ type GetEngineMaxMintVlpAmountResponse = BigDecimal;
188
+
189
+ export type { EngineMarketPrice, EngineMinDepositRate, EngineOrder, EnginePriceTickLiquidity, EngineSubaccountOrders, EngineSymbol, EngineSymbolsResponse, GetEngineAllMarketsResponse, GetEngineContractsResponse, GetEngineEstimatedSubaccountSummaryParams, GetEngineHealthGroupsResponse, GetEngineInsuranceResponse, GetEngineIpBlockStatusResponse, GetEngineIsolatedPositionsParams, GetEngineIsolatedPositionsResponse, GetEngineLinkedSignerParams, GetEngineLinkedSignerResponse, GetEngineMarketLiquidityParams, GetEngineMarketLiquidityResponse, GetEngineMarketPriceParams, GetEngineMarketPriceResponse, GetEngineMarketPricesParams, GetEngineMarketPricesResponse, GetEngineMaxMintVlpAmountParams, GetEngineMaxMintVlpAmountResponse, GetEngineMaxOrderSizeParams, GetEngineMaxOrderSizeResponse, GetEngineMaxWithdrawableParams, GetEngineMaxWithdrawableResponse, GetEngineMinDepositRatesResponse, GetEngineNoncesParams, GetEngineNoncesResponse, GetEngineOrderParams, GetEngineOrderResponse, GetEngineSubaccountFeeRatesParams, GetEngineSubaccountFeeRatesResponse, GetEngineSubaccountOrdersParams, GetEngineSubaccountOrdersResponse, GetEngineSubaccountProductOrdersParams, GetEngineSubaccountProductOrdersResponse, GetEngineSubaccountSummaryParams, GetEngineSubaccountSummaryResponse, GetEngineSymbolsParams, GetEngineTimeResponse, SubaccountIsolatedPosition, SubaccountOrderFeeRates, SubaccountProductDeltaTx, SubaccountTx, ValidateEngineOrderParams, ValidateEngineOrderResponse, ValidateSignedEngineOrderParams };
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=clientQueryTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+
17
+ // src/types/index.ts
18
+ var types_exports = {};
19
+ module.exports = __toCommonJS(types_exports);
20
+ __reExport(types_exports, require("./clientQueryTypes.cjs"), module.exports);
21
+ __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);
24
+ __reExport(types_exports, require("./serverExecuteTypes.cjs"), module.exports);
25
+ __reExport(types_exports, require("./serverSubscriptionTypes.cjs"), module.exports);
26
+ __reExport(types_exports, require("./serverSubscriptionEventTypes.cjs"), module.exports);
27
+ __reExport(types_exports, require("./EngineServerFailureError.cjs"), module.exports);
28
+ // Annotate the CommonJS export names for ESM import in node:
29
+ 0 && (module.exports = {
30
+ ...require("./clientQueryTypes.cjs"),
31
+ ...require("./clientExecuteTypes.cjs"),
32
+ ...require("./serverQueryTypes.cjs"),
33
+ ...require("./serverQueryModelTypes.cjs"),
34
+ ...require("./serverExecuteTypes.cjs"),
35
+ ...require("./serverSubscriptionTypes.cjs"),
36
+ ...require("./serverSubscriptionEventTypes.cjs"),
37
+ ...require("./EngineServerFailureError.cjs")
38
+ });
39
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +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":[]}
@@ -0,0 +1,10 @@
1
+ export { EngineMarketPrice, EngineMinDepositRate, EngineOrder, EnginePriceTickLiquidity, EngineSubaccountOrders, EngineSymbol, EngineSymbolsResponse, GetEngineAllMarketsResponse, GetEngineContractsResponse, GetEngineEstimatedSubaccountSummaryParams, GetEngineHealthGroupsResponse, GetEngineInsuranceResponse, GetEngineIpBlockStatusResponse, GetEngineIsolatedPositionsParams, GetEngineIsolatedPositionsResponse, GetEngineLinkedSignerParams, GetEngineLinkedSignerResponse, GetEngineMarketLiquidityParams, GetEngineMarketLiquidityResponse, GetEngineMarketPriceParams, GetEngineMarketPriceResponse, GetEngineMarketPricesParams, GetEngineMarketPricesResponse, GetEngineMaxMintVlpAmountParams, GetEngineMaxMintVlpAmountResponse, GetEngineMaxOrderSizeParams, GetEngineMaxOrderSizeResponse, GetEngineMaxWithdrawableParams, GetEngineMaxWithdrawableResponse, GetEngineMinDepositRatesResponse, 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
+ export { EngineBurnVlpParams, EngineCancelAndPlaceParams, EngineCancelOrdersParams, EngineCancelProductOrdersParams, EngineExecuteRequestParamsByType, EngineIsolatedOrderParams, EngineLinkSignerParams, EngineLiquidateSubaccountParams, EngineMintVlpParams, EngineOrderParams, EnginePlaceIsolatedOrderParams, EnginePlaceIsolatedOrderResult, EnginePlaceOrderParams, EnginePlaceOrderResult, 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, EngineServerMaxMintVlpQueryParams, EngineServerMaxMintVlpResponse, EngineServerMaxOrderSizeQueryParams, EngineServerMaxOrderSizeResponse, EngineServerMaxWithdrawableQueryParams, EngineServerMaxWithdrawableResponse, EngineServerMinDepositRate, EngineServerMinDepositRatesResponse, EngineServerNoncesParams, EngineServerNoncesResponse, EngineServerOrder, EngineServerOrderResponse, EngineServerOrdersQueryParams, EngineServerPriceTickLiquidity, EngineServerProductOrdersResponse, EngineServerQueryFailureResponse, EngineServerQueryRequest, EngineServerQueryRequestByType, EngineServerQueryRequestType, EngineServerQueryResponse, EngineServerQueryResponseByType, EngineServerQuerySuccessResponse, EngineServerStatusResponse, EngineServerSubaccountFeeRatesParams, EngineServerSubaccountInfoQueryParams, EngineServerSubaccountInfoResponse, EngineServerSubaccountOrders, EngineServerSubaccountOrdersQueryParams, EngineServerSubaccountOrdersResponse, EngineServerSymbol, EngineServerSymbolsQueryParams, EngineServerSymbolsResponse, EngineServerTimeResponse, EngineServerValidateOrderQueryParams, EngineServerValidateOrderResponse } 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, EngineServerExecutePlaceIsolatedOrderPayload, EngineServerExecutePlaceOrderPayload, EngineServerExecuteRequestByType, EngineServerExecuteRequestType, EngineServerExecuteResponseDataByType, EngineServerExecuteResult, EngineServerExecuteSuccessResult, EngineServerPlaceIsolatedOrderParams, EngineServerPlaceOrderParams, EngineServerPlaceOrderResponse, 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';
8
+ export { EngineServerFailureError } from './EngineServerFailureError.cjs';
9
+ import '@nadohq/contracts';
10
+ import '@nadohq/utils';
@@ -0,0 +1,10 @@
1
+ export { EngineMarketPrice, EngineMinDepositRate, EngineOrder, EnginePriceTickLiquidity, EngineSubaccountOrders, EngineSymbol, EngineSymbolsResponse, GetEngineAllMarketsResponse, GetEngineContractsResponse, GetEngineEstimatedSubaccountSummaryParams, GetEngineHealthGroupsResponse, GetEngineInsuranceResponse, GetEngineIpBlockStatusResponse, GetEngineIsolatedPositionsParams, GetEngineIsolatedPositionsResponse, GetEngineLinkedSignerParams, GetEngineLinkedSignerResponse, GetEngineMarketLiquidityParams, GetEngineMarketLiquidityResponse, GetEngineMarketPriceParams, GetEngineMarketPriceResponse, GetEngineMarketPricesParams, GetEngineMarketPricesResponse, GetEngineMaxMintVlpAmountParams, GetEngineMaxMintVlpAmountResponse, GetEngineMaxOrderSizeParams, GetEngineMaxOrderSizeResponse, GetEngineMaxWithdrawableParams, GetEngineMaxWithdrawableResponse, GetEngineMinDepositRatesResponse, 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
+ export { EngineBurnVlpParams, EngineCancelAndPlaceParams, EngineCancelOrdersParams, EngineCancelProductOrdersParams, EngineExecuteRequestParamsByType, EngineIsolatedOrderParams, EngineLinkSignerParams, EngineLiquidateSubaccountParams, EngineMintVlpParams, EngineOrderParams, EnginePlaceIsolatedOrderParams, EnginePlaceIsolatedOrderResult, EnginePlaceOrderParams, EnginePlaceOrderResult, 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, EngineServerMaxMintVlpQueryParams, EngineServerMaxMintVlpResponse, EngineServerMaxOrderSizeQueryParams, EngineServerMaxOrderSizeResponse, EngineServerMaxWithdrawableQueryParams, EngineServerMaxWithdrawableResponse, EngineServerMinDepositRate, EngineServerMinDepositRatesResponse, EngineServerNoncesParams, EngineServerNoncesResponse, EngineServerOrder, EngineServerOrderResponse, EngineServerOrdersQueryParams, EngineServerPriceTickLiquidity, EngineServerProductOrdersResponse, EngineServerQueryFailureResponse, EngineServerQueryRequest, EngineServerQueryRequestByType, EngineServerQueryRequestType, EngineServerQueryResponse, EngineServerQueryResponseByType, EngineServerQuerySuccessResponse, EngineServerStatusResponse, EngineServerSubaccountFeeRatesParams, EngineServerSubaccountInfoQueryParams, EngineServerSubaccountInfoResponse, EngineServerSubaccountOrders, EngineServerSubaccountOrdersQueryParams, EngineServerSubaccountOrdersResponse, EngineServerSymbol, EngineServerSymbolsQueryParams, EngineServerSymbolsResponse, EngineServerTimeResponse, EngineServerValidateOrderQueryParams, EngineServerValidateOrderResponse } 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, EngineServerExecutePlaceIsolatedOrderPayload, EngineServerExecutePlaceOrderPayload, EngineServerExecuteRequestByType, EngineServerExecuteRequestType, EngineServerExecuteResponseDataByType, EngineServerExecuteResult, EngineServerExecuteSuccessResult, EngineServerPlaceIsolatedOrderParams, EngineServerPlaceOrderParams, EngineServerPlaceOrderResponse, 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';
8
+ export { EngineServerFailureError } from './EngineServerFailureError.js';
9
+ import '@nadohq/contracts';
10
+ import '@nadohq/utils';
@@ -0,0 +1,10 @@
1
+ // src/types/index.ts
2
+ export * from "./clientQueryTypes.js";
3
+ export * from "./clientExecuteTypes.js";
4
+ export * from "./serverQueryTypes.js";
5
+ export * from "./serverQueryModelTypes.js";
6
+ export * from "./serverExecuteTypes.js";
7
+ export * from "./serverSubscriptionTypes.js";
8
+ export * from "./serverSubscriptionEventTypes.js";
9
+ export * from "./EngineServerFailureError.js";
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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":[]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/types/serverExecuteTypes.ts
17
+ var serverExecuteTypes_exports = {};
18
+ module.exports = __toCommonJS(serverExecuteTypes_exports);
19
+ //# sourceMappingURL=serverExecuteTypes.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/serverExecuteTypes.ts"],"sourcesContent":["import {\n EIP712BurnVlpValues,\n EIP712IsolatedOrderParams,\n EIP712LinkSignerValues,\n EIP712LiquidateSubaccountValues,\n EIP712MintVlpValues,\n EIP712OrderCancellationValues,\n EIP712OrderParams,\n EIP712OrderValues,\n EIP712ProductOrdersCancellationValues,\n EIP712TransferQuoteValues,\n EIP712WithdrawCollateralValues,\n SignedTx,\n} from '@nadohq/contracts';\nimport { EngineServerOrderResponse } from './serverQueryTypes';\n\nexport interface EngineServerPlaceOrderResponse {\n digest: string;\n}\n\nexport interface EngineServerCancelOrdersResponse {\n cancelled_orders: EngineServerOrderResponse[];\n}\n\nexport interface EngineServerExecuteResponseDataByType {\n burn_vlp: 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_vlp: null;\n place_isolated_order: EngineServerPlaceOrderResponse;\n place_order: EngineServerPlaceOrderResponse;\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}\n\nexport interface EngineServerPlaceIsolatedOrderParams {\n id: number | null;\n product_id: number;\n isolated_order: EIP712OrderValues;\n // Bytes\n signature: string;\n // Engine defaults this to false\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_vlp: SignedTx<EIP712BurnVlpValues>;\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_vlp: WithSpotLeverage<SignedTx<EIP712MintVlpValues>>;\n place_isolated_order: EngineServerPlaceIsolatedOrderParams;\n place_order: 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\nexport interface EngineServerExecutePlaceIsolatedOrderPayload {\n payload: EngineServerExecuteRequestByType['place_isolated_order'];\n orderParams: EIP712IsolatedOrderParams;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}