@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,71 @@
1
+ import { EngineServerPriceTickLiquidity } from './serverQueryTypes.js';
2
+ import '@nadohq/contracts';
3
+ import './serverQueryModelTypes.js';
4
+
5
+ /**
6
+ * Event from subscribing to a `order_update` stream.
7
+ */
8
+ interface EngineServerSubscriptionOrderUpdateEvent {
9
+ timestamp: string;
10
+ product_id: number;
11
+ digest: string;
12
+ amount: string;
13
+ reason: string;
14
+ }
15
+ /**
16
+ * Event from subscribing to a `trade` stream.
17
+ */
18
+ interface EngineServerSubscriptionTradeEvent {
19
+ timestamp: string;
20
+ product_id: number;
21
+ price: string;
22
+ taker_qty: string;
23
+ maker_qty: string;
24
+ is_taker_buyer: boolean;
25
+ }
26
+ /**
27
+ * Event from subscribing to a `best_bid_offer` stream.
28
+ */
29
+ interface EngineServerSubscriptionBestBidOfferEvent {
30
+ timestamp: string;
31
+ product_id: number;
32
+ bid_price: string;
33
+ bid_qty: string;
34
+ ask_price: string;
35
+ ask_qty: string;
36
+ }
37
+ /**
38
+ * Event from subscribing to a `fill` stream.
39
+ */
40
+ interface EngineServerSubscriptionFillEvent {
41
+ timestamp: string;
42
+ product_id: number;
43
+ subaccount: string;
44
+ order_digest: string;
45
+ filled_qty: string;
46
+ remaining_qty: string;
47
+ price: string;
48
+ is_taker: boolean;
49
+ }
50
+ /**
51
+ * Event from subscribing to a `position_change` stream.
52
+ */
53
+ interface EngineServerSubscriptionPositionChangeEvent {
54
+ timestamp: string;
55
+ product_id: number;
56
+ subaccount: string;
57
+ amount: string;
58
+ v_quote_amount: string;
59
+ }
60
+ /**
61
+ * Event from subscribing to a `book_depth` stream.
62
+ */
63
+ interface EngineServerSubscriptionBookDepthEvent {
64
+ min_timestamp: string;
65
+ max_timestamp: string;
66
+ product_id: number;
67
+ bids: EngineServerPriceTickLiquidity[];
68
+ asks: EngineServerPriceTickLiquidity[];
69
+ }
70
+
71
+ export type { EngineServerSubscriptionBestBidOfferEvent, EngineServerSubscriptionBookDepthEvent, EngineServerSubscriptionFillEvent, EngineServerSubscriptionOrderUpdateEvent, EngineServerSubscriptionPositionChangeEvent, EngineServerSubscriptionTradeEvent };
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=serverSubscriptionEventTypes.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/serverSubscriptionTypes.ts
17
+ var serverSubscriptionTypes_exports = {};
18
+ module.exports = __toCommonJS(serverSubscriptionTypes_exports);
19
+ //# sourceMappingURL=serverSubscriptionTypes.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/serverSubscriptionTypes.ts"],"sourcesContent":["export interface EngineServerOrderUpdateStreamParams {\n product_id: number;\n subaccount: string;\n}\n\nexport interface EngineServerTradeStreamParams {\n product_id: number;\n}\n\nexport interface EngineServerBestBidOfferStreamParams {\n product_id: number;\n}\n\nexport interface EngineServerFillStreamParams {\n product_id: number;\n subaccount: string;\n}\n\nexport interface EngineServerPositionChangeStreamParams {\n product_id: number;\n subaccount: string;\n}\n\nexport interface EngineServerBookDepthStreamParams {\n product_id: number;\n}\n\n/**\n * Available subscription streams\n */\nexport interface EngineServerSubscriptionStreamParamsByType {\n order_update: EngineServerOrderUpdateStreamParams;\n trade: EngineServerTradeStreamParams;\n best_bid_offer: EngineServerBestBidOfferStreamParams;\n fill: EngineServerFillStreamParams;\n position_change: EngineServerPositionChangeStreamParams;\n book_depth: EngineServerBookDepthStreamParams;\n}\n\nexport type EngineServerSubscriptionStreamParamsType =\n keyof EngineServerSubscriptionStreamParamsByType;\n\n/**\n * Describes a stream that can be subscribed to.\n */\nexport type EngineServerSubscriptionStream<\n TStreamType extends EngineServerSubscriptionStreamParamsType,\n> = {\n type: TStreamType;\n} & EngineServerSubscriptionStreamParamsByType[TStreamType];\n\n/**\n * Params to provide to a `subscribe` / `unsubscribe` action.\n */\nexport interface EngineServerSubscriptionParams {\n stream: EngineServerSubscriptionStream<EngineServerSubscriptionStreamParamsType>;\n}\n\n/**\n * Available actions on the subscription API.\n */\nexport interface EngineServerSubscriptionRequestByType {\n subscribe: EngineServerSubscriptionParams;\n unsubscribe: EngineServerSubscriptionParams;\n list: Record<string, never>;\n}\n\nexport type EngineServerSubscriptionRequestType =\n keyof EngineServerSubscriptionRequestByType;\n\n/**\n * Top level request to send to the server.\n */\nexport type EngineServerSubscriptionRequest<\n TRequestType extends EngineServerSubscriptionRequestType,\n> = {\n id: number;\n method: TRequestType;\n} & EngineServerSubscriptionRequestByType[TRequestType];\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1,63 @@
1
+ interface EngineServerOrderUpdateStreamParams {
2
+ product_id: number;
3
+ subaccount: string;
4
+ }
5
+ interface EngineServerTradeStreamParams {
6
+ product_id: number;
7
+ }
8
+ interface EngineServerBestBidOfferStreamParams {
9
+ product_id: number;
10
+ }
11
+ interface EngineServerFillStreamParams {
12
+ product_id: number;
13
+ subaccount: string;
14
+ }
15
+ interface EngineServerPositionChangeStreamParams {
16
+ product_id: number;
17
+ subaccount: string;
18
+ }
19
+ interface EngineServerBookDepthStreamParams {
20
+ product_id: number;
21
+ }
22
+ /**
23
+ * Available subscription streams
24
+ */
25
+ interface EngineServerSubscriptionStreamParamsByType {
26
+ order_update: EngineServerOrderUpdateStreamParams;
27
+ trade: EngineServerTradeStreamParams;
28
+ best_bid_offer: EngineServerBestBidOfferStreamParams;
29
+ fill: EngineServerFillStreamParams;
30
+ position_change: EngineServerPositionChangeStreamParams;
31
+ book_depth: EngineServerBookDepthStreamParams;
32
+ }
33
+ type EngineServerSubscriptionStreamParamsType = keyof EngineServerSubscriptionStreamParamsByType;
34
+ /**
35
+ * Describes a stream that can be subscribed to.
36
+ */
37
+ type EngineServerSubscriptionStream<TStreamType extends EngineServerSubscriptionStreamParamsType> = {
38
+ type: TStreamType;
39
+ } & EngineServerSubscriptionStreamParamsByType[TStreamType];
40
+ /**
41
+ * Params to provide to a `subscribe` / `unsubscribe` action.
42
+ */
43
+ interface EngineServerSubscriptionParams {
44
+ stream: EngineServerSubscriptionStream<EngineServerSubscriptionStreamParamsType>;
45
+ }
46
+ /**
47
+ * Available actions on the subscription API.
48
+ */
49
+ interface EngineServerSubscriptionRequestByType {
50
+ subscribe: EngineServerSubscriptionParams;
51
+ unsubscribe: EngineServerSubscriptionParams;
52
+ list: Record<string, never>;
53
+ }
54
+ type EngineServerSubscriptionRequestType = keyof EngineServerSubscriptionRequestByType;
55
+ /**
56
+ * Top level request to send to the server.
57
+ */
58
+ type EngineServerSubscriptionRequest<TRequestType extends EngineServerSubscriptionRequestType> = {
59
+ id: number;
60
+ method: TRequestType;
61
+ } & EngineServerSubscriptionRequestByType[TRequestType];
62
+
63
+ export type { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams };
@@ -0,0 +1,63 @@
1
+ interface EngineServerOrderUpdateStreamParams {
2
+ product_id: number;
3
+ subaccount: string;
4
+ }
5
+ interface EngineServerTradeStreamParams {
6
+ product_id: number;
7
+ }
8
+ interface EngineServerBestBidOfferStreamParams {
9
+ product_id: number;
10
+ }
11
+ interface EngineServerFillStreamParams {
12
+ product_id: number;
13
+ subaccount: string;
14
+ }
15
+ interface EngineServerPositionChangeStreamParams {
16
+ product_id: number;
17
+ subaccount: string;
18
+ }
19
+ interface EngineServerBookDepthStreamParams {
20
+ product_id: number;
21
+ }
22
+ /**
23
+ * Available subscription streams
24
+ */
25
+ interface EngineServerSubscriptionStreamParamsByType {
26
+ order_update: EngineServerOrderUpdateStreamParams;
27
+ trade: EngineServerTradeStreamParams;
28
+ best_bid_offer: EngineServerBestBidOfferStreamParams;
29
+ fill: EngineServerFillStreamParams;
30
+ position_change: EngineServerPositionChangeStreamParams;
31
+ book_depth: EngineServerBookDepthStreamParams;
32
+ }
33
+ type EngineServerSubscriptionStreamParamsType = keyof EngineServerSubscriptionStreamParamsByType;
34
+ /**
35
+ * Describes a stream that can be subscribed to.
36
+ */
37
+ type EngineServerSubscriptionStream<TStreamType extends EngineServerSubscriptionStreamParamsType> = {
38
+ type: TStreamType;
39
+ } & EngineServerSubscriptionStreamParamsByType[TStreamType];
40
+ /**
41
+ * Params to provide to a `subscribe` / `unsubscribe` action.
42
+ */
43
+ interface EngineServerSubscriptionParams {
44
+ stream: EngineServerSubscriptionStream<EngineServerSubscriptionStreamParamsType>;
45
+ }
46
+ /**
47
+ * Available actions on the subscription API.
48
+ */
49
+ interface EngineServerSubscriptionRequestByType {
50
+ subscribe: EngineServerSubscriptionParams;
51
+ unsubscribe: EngineServerSubscriptionParams;
52
+ list: Record<string, never>;
53
+ }
54
+ type EngineServerSubscriptionRequestType = keyof EngineServerSubscriptionRequestByType;
55
+ /**
56
+ * Top level request to send to the server.
57
+ */
58
+ type EngineServerSubscriptionRequest<TRequestType extends EngineServerSubscriptionRequestType> = {
59
+ id: number;
60
+ method: TRequestType;
61
+ } & EngineServerSubscriptionRequestByType[TRequestType];
62
+
63
+ export type { EngineServerBestBidOfferStreamParams, EngineServerBookDepthStreamParams, EngineServerFillStreamParams, EngineServerOrderUpdateStreamParams, EngineServerPositionChangeStreamParams, EngineServerSubscriptionParams, EngineServerSubscriptionRequest, EngineServerSubscriptionRequestByType, EngineServerSubscriptionRequestType, EngineServerSubscriptionStream, EngineServerSubscriptionStreamParamsByType, EngineServerSubscriptionStreamParamsType, EngineServerTradeStreamParams };
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=serverSubscriptionTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,25 @@
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/utils/index.ts
18
+ var utils_exports = {};
19
+ module.exports = __toCommonJS(utils_exports);
20
+ __reExport(utils_exports, require("./queryDataMappers.cjs"), module.exports);
21
+ // Annotate the CommonJS export names for ESM import in node:
22
+ 0 && (module.exports = {
23
+ ...require("./queryDataMappers.cjs")
24
+ });
25
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './queryDataMappers';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,mCAAd;","names":[]}
@@ -0,0 +1,6 @@
1
+ export { mapEngineMarketPrice, mapEngineServerBalanceHealthContributions, mapEngineServerIsolatedPositions, mapEngineServerOrder, mapEngineServerPerpProduct, mapEngineServerSpotProduct, mapEngineServerSymbol, mapEngineServerSymbols, mapEngineServerTickLiquidity, mapSubaccountSummary } from './queryDataMappers.cjs';
2
+ import '@nadohq/contracts';
3
+ import '../types/clientQueryTypes.cjs';
4
+ import '@nadohq/utils';
5
+ import '../types/serverQueryTypes.cjs';
6
+ import '../types/serverQueryModelTypes.cjs';
@@ -0,0 +1,6 @@
1
+ export { mapEngineMarketPrice, mapEngineServerBalanceHealthContributions, mapEngineServerIsolatedPositions, mapEngineServerOrder, mapEngineServerPerpProduct, mapEngineServerSpotProduct, mapEngineServerSymbol, mapEngineServerSymbols, mapEngineServerTickLiquidity, mapSubaccountSummary } from './queryDataMappers.js';
2
+ import '@nadohq/contracts';
3
+ import '../types/clientQueryTypes.js';
4
+ import '@nadohq/utils';
5
+ import '../types/serverQueryTypes.js';
6
+ import '../types/serverQueryModelTypes.js';
@@ -0,0 +1,3 @@
1
+ // src/utils/index.ts
2
+ export * from "./queryDataMappers.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './queryDataMappers';\n"],"mappings":";AAAA,cAAc;","names":[]}
@@ -0,0 +1,49 @@
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 __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/utils/productEngineTypeMappers.ts
21
+ var productEngineTypeMappers_exports = {};
22
+ __export(productEngineTypeMappers_exports, {
23
+ mapEngineServerProductType: () => mapEngineServerProductType,
24
+ mapProductEngineType: () => mapProductEngineType
25
+ });
26
+ module.exports = __toCommonJS(productEngineTypeMappers_exports);
27
+ var import_contracts = require("@nadohq/contracts");
28
+ function mapProductEngineType(productEngineType) {
29
+ switch (productEngineType) {
30
+ case import_contracts.ProductEngineType.SPOT:
31
+ return "spot";
32
+ case import_contracts.ProductEngineType.PERP:
33
+ return "perp";
34
+ }
35
+ }
36
+ function mapEngineServerProductType(productEngineServerType) {
37
+ switch (productEngineServerType) {
38
+ case "spot":
39
+ return import_contracts.ProductEngineType.SPOT;
40
+ case "perp":
41
+ return import_contracts.ProductEngineType.PERP;
42
+ }
43
+ }
44
+ // Annotate the CommonJS export names for ESM import in node:
45
+ 0 && (module.exports = {
46
+ mapEngineServerProductType,
47
+ mapProductEngineType
48
+ });
49
+ //# sourceMappingURL=productEngineTypeMappers.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/productEngineTypeMappers.ts"],"sourcesContent":["import { ProductEngineType } from '@nadohq/contracts';\nimport { EngineServerProductType } from '../types';\n\nexport function mapProductEngineType(\n productEngineType: ProductEngineType,\n): EngineServerProductType {\n switch (productEngineType) {\n case ProductEngineType.SPOT:\n return 'spot';\n case ProductEngineType.PERP:\n return 'perp';\n }\n}\n\nexport function mapEngineServerProductType(\n productEngineServerType: EngineServerProductType,\n): ProductEngineType {\n switch (productEngineServerType) {\n case 'spot':\n return ProductEngineType.SPOT;\n case 'perp':\n return ProductEngineType.PERP;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAkC;AAG3B,SAAS,qBACd,mBACyB;AACzB,UAAQ,mBAAmB;AAAA,IACzB,KAAK,mCAAkB;AACrB,aAAO;AAAA,IACT,KAAK,mCAAkB;AACrB,aAAO;AAAA,EACX;AACF;AAEO,SAAS,2BACd,yBACmB;AACnB,UAAQ,yBAAyB;AAAA,IAC/B,KAAK;AACH,aAAO,mCAAkB;AAAA,IAC3B,KAAK;AACH,aAAO,mCAAkB;AAAA,EAC7B;AACF;","names":[]}
@@ -0,0 +1,7 @@
1
+ import { ProductEngineType } from '@nadohq/contracts';
2
+ import { EngineServerProductType } from '../types/serverQueryModelTypes.cjs';
3
+
4
+ declare function mapProductEngineType(productEngineType: ProductEngineType): EngineServerProductType;
5
+ declare function mapEngineServerProductType(productEngineServerType: EngineServerProductType): ProductEngineType;
6
+
7
+ export { mapEngineServerProductType, mapProductEngineType };
@@ -0,0 +1,7 @@
1
+ import { ProductEngineType } from '@nadohq/contracts';
2
+ import { EngineServerProductType } from '../types/serverQueryModelTypes.js';
3
+
4
+ declare function mapProductEngineType(productEngineType: ProductEngineType): EngineServerProductType;
5
+ declare function mapEngineServerProductType(productEngineServerType: EngineServerProductType): ProductEngineType;
6
+
7
+ export { mapEngineServerProductType, mapProductEngineType };
@@ -0,0 +1,23 @@
1
+ // src/utils/productEngineTypeMappers.ts
2
+ import { ProductEngineType } from "@nadohq/contracts";
3
+ function mapProductEngineType(productEngineType) {
4
+ switch (productEngineType) {
5
+ case ProductEngineType.SPOT:
6
+ return "spot";
7
+ case ProductEngineType.PERP:
8
+ return "perp";
9
+ }
10
+ }
11
+ function mapEngineServerProductType(productEngineServerType) {
12
+ switch (productEngineServerType) {
13
+ case "spot":
14
+ return ProductEngineType.SPOT;
15
+ case "perp":
16
+ return ProductEngineType.PERP;
17
+ }
18
+ }
19
+ export {
20
+ mapEngineServerProductType,
21
+ mapProductEngineType
22
+ };
23
+ //# sourceMappingURL=productEngineTypeMappers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/productEngineTypeMappers.ts"],"sourcesContent":["import { ProductEngineType } from '@nadohq/contracts';\nimport { EngineServerProductType } from '../types';\n\nexport function mapProductEngineType(\n productEngineType: ProductEngineType,\n): EngineServerProductType {\n switch (productEngineType) {\n case ProductEngineType.SPOT:\n return 'spot';\n case ProductEngineType.PERP:\n return 'perp';\n }\n}\n\nexport function mapEngineServerProductType(\n productEngineServerType: EngineServerProductType,\n): ProductEngineType {\n switch (productEngineServerType) {\n case 'spot':\n return ProductEngineType.SPOT;\n case 'perp':\n return ProductEngineType.PERP;\n }\n}\n"],"mappings":";AAAA,SAAS,yBAAyB;AAG3B,SAAS,qBACd,mBACyB;AACzB,UAAQ,mBAAmB;AAAA,IACzB,KAAK,kBAAkB;AACrB,aAAO;AAAA,IACT,KAAK,kBAAkB;AACrB,aAAO;AAAA,EACX;AACF;AAEO,SAAS,2BACd,yBACmB;AACnB,UAAQ,yBAAyB;AAAA,IAC/B,KAAK;AACH,aAAO,kBAAkB;AAAA,IAC3B,KAAK;AACH,aAAO,kBAAkB;AAAA,EAC7B;AACF;","names":[]}