@nadohq/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 (184) hide show
  1. package/README.md +3 -0
  2. package/dist/apis/base.cjs +66 -0
  3. package/dist/apis/base.cjs.map +1 -0
  4. package/dist/apis/base.d.cts +23 -0
  5. package/dist/apis/base.d.ts +23 -0
  6. package/dist/apis/base.js +41 -0
  7. package/dist/apis/base.js.map +1 -0
  8. package/dist/apis/market/MarketExecuteAPI.cjs +169 -0
  9. package/dist/apis/market/MarketExecuteAPI.cjs.map +1 -0
  10. package/dist/apis/market/MarketExecuteAPI.d.cts +57 -0
  11. package/dist/apis/market/MarketExecuteAPI.d.ts +57 -0
  12. package/dist/apis/market/MarketExecuteAPI.js +144 -0
  13. package/dist/apis/market/MarketExecuteAPI.js.map +1 -0
  14. package/dist/apis/market/MarketQueryAPI.cjs +191 -0
  15. package/dist/apis/market/MarketQueryAPI.cjs.map +1 -0
  16. package/dist/apis/market/MarketQueryAPI.d.cts +127 -0
  17. package/dist/apis/market/MarketQueryAPI.d.ts +127 -0
  18. package/dist/apis/market/MarketQueryAPI.js +166 -0
  19. package/dist/apis/market/MarketQueryAPI.js.map +1 -0
  20. package/dist/apis/market/index.cjs +38 -0
  21. package/dist/apis/market/index.cjs.map +1 -0
  22. package/dist/apis/market/index.d.cts +18 -0
  23. package/dist/apis/market/index.d.ts +18 -0
  24. package/dist/apis/market/index.js +11 -0
  25. package/dist/apis/market/index.js.map +1 -0
  26. package/dist/apis/market/types.cjs +19 -0
  27. package/dist/apis/market/types.cjs.map +1 -0
  28. package/dist/apis/market/types.d.cts +26 -0
  29. package/dist/apis/market/types.d.ts +26 -0
  30. package/dist/apis/market/types.js +1 -0
  31. package/dist/apis/market/types.js.map +1 -0
  32. package/dist/apis/perp/PerpExecuteAPI.cjs +36 -0
  33. package/dist/apis/perp/PerpExecuteAPI.cjs.map +1 -0
  34. package/dist/apis/perp/PerpExecuteAPI.d.cts +13 -0
  35. package/dist/apis/perp/PerpExecuteAPI.d.ts +13 -0
  36. package/dist/apis/perp/PerpExecuteAPI.js +11 -0
  37. package/dist/apis/perp/PerpExecuteAPI.js.map +1 -0
  38. package/dist/apis/perp/PerpQueryAPI.cjs +47 -0
  39. package/dist/apis/perp/PerpQueryAPI.cjs.map +1 -0
  40. package/dist/apis/perp/PerpQueryAPI.d.cts +23 -0
  41. package/dist/apis/perp/PerpQueryAPI.d.ts +23 -0
  42. package/dist/apis/perp/PerpQueryAPI.js +22 -0
  43. package/dist/apis/perp/PerpQueryAPI.js.map +1 -0
  44. package/dist/apis/perp/index.cjs +35 -0
  45. package/dist/apis/perp/index.cjs.map +1 -0
  46. package/dist/apis/perp/index.d.cts +16 -0
  47. package/dist/apis/perp/index.d.ts +16 -0
  48. package/dist/apis/perp/index.js +10 -0
  49. package/dist/apis/perp/index.js.map +1 -0
  50. package/dist/apis/spot/BaseSpotAPI.cjs +55 -0
  51. package/dist/apis/spot/BaseSpotAPI.cjs.map +1 -0
  52. package/dist/apis/spot/BaseSpotAPI.d.cts +19 -0
  53. package/dist/apis/spot/BaseSpotAPI.d.ts +19 -0
  54. package/dist/apis/spot/BaseSpotAPI.js +30 -0
  55. package/dist/apis/spot/BaseSpotAPI.js.map +1 -0
  56. package/dist/apis/spot/SpotExecuteAPI.cjs +108 -0
  57. package/dist/apis/spot/SpotExecuteAPI.cjs.map +1 -0
  58. package/dist/apis/spot/SpotExecuteAPI.d.cts +28 -0
  59. package/dist/apis/spot/SpotExecuteAPI.d.ts +28 -0
  60. package/dist/apis/spot/SpotExecuteAPI.js +88 -0
  61. package/dist/apis/spot/SpotExecuteAPI.js.map +1 -0
  62. package/dist/apis/spot/SpotQueryAPI.cjs +74 -0
  63. package/dist/apis/spot/SpotQueryAPI.cjs.map +1 -0
  64. package/dist/apis/spot/SpotQueryAPI.d.cts +35 -0
  65. package/dist/apis/spot/SpotQueryAPI.d.ts +35 -0
  66. package/dist/apis/spot/SpotQueryAPI.js +49 -0
  67. package/dist/apis/spot/SpotQueryAPI.js.map +1 -0
  68. package/dist/apis/spot/index.cjs +38 -0
  69. package/dist/apis/spot/index.cjs.map +1 -0
  70. package/dist/apis/spot/index.d.cts +23 -0
  71. package/dist/apis/spot/index.d.ts +23 -0
  72. package/dist/apis/spot/index.js +11 -0
  73. package/dist/apis/spot/index.js.map +1 -0
  74. package/dist/apis/spot/types.cjs +19 -0
  75. package/dist/apis/spot/types.cjs.map +1 -0
  76. package/dist/apis/spot/types.d.cts +23 -0
  77. package/dist/apis/spot/types.d.ts +23 -0
  78. package/dist/apis/spot/types.js +1 -0
  79. package/dist/apis/spot/types.js.map +1 -0
  80. package/dist/apis/subaccount/SubaccountExecuteAPI.cjs +59 -0
  81. package/dist/apis/subaccount/SubaccountExecuteAPI.cjs.map +1 -0
  82. package/dist/apis/subaccount/SubaccountExecuteAPI.d.cts +26 -0
  83. package/dist/apis/subaccount/SubaccountExecuteAPI.d.ts +26 -0
  84. package/dist/apis/subaccount/SubaccountExecuteAPI.js +34 -0
  85. package/dist/apis/subaccount/SubaccountExecuteAPI.js.map +1 -0
  86. package/dist/apis/subaccount/SubaccountQueryAPI.cjs +84 -0
  87. package/dist/apis/subaccount/SubaccountQueryAPI.cjs.map +1 -0
  88. package/dist/apis/subaccount/SubaccountQueryAPI.d.cts +51 -0
  89. package/dist/apis/subaccount/SubaccountQueryAPI.d.ts +51 -0
  90. package/dist/apis/subaccount/SubaccountQueryAPI.js +61 -0
  91. package/dist/apis/subaccount/SubaccountQueryAPI.js.map +1 -0
  92. package/dist/apis/subaccount/index.cjs +68 -0
  93. package/dist/apis/subaccount/index.cjs.map +1 -0
  94. package/dist/apis/subaccount/index.d.cts +27 -0
  95. package/dist/apis/subaccount/index.d.ts +27 -0
  96. package/dist/apis/subaccount/index.js +41 -0
  97. package/dist/apis/subaccount/index.js.map +1 -0
  98. package/dist/apis/subaccount/types.cjs +19 -0
  99. package/dist/apis/subaccount/types.cjs.map +1 -0
  100. package/dist/apis/subaccount/types.d.cts +9 -0
  101. package/dist/apis/subaccount/types.d.ts +9 -0
  102. package/dist/apis/subaccount/types.js +1 -0
  103. package/dist/apis/subaccount/types.js.map +1 -0
  104. package/dist/apis/types.cjs +19 -0
  105. package/dist/apis/types.cjs.map +1 -0
  106. package/dist/apis/types.d.cts +9 -0
  107. package/dist/apis/types.d.ts +9 -0
  108. package/dist/apis/types.js +1 -0
  109. package/dist/apis/types.js.map +1 -0
  110. package/dist/apis/ws/WebSocketExecuteAPI.cjs +73 -0
  111. package/dist/apis/ws/WebSocketExecuteAPI.cjs.map +1 -0
  112. package/dist/apis/ws/WebSocketExecuteAPI.d.cts +48 -0
  113. package/dist/apis/ws/WebSocketExecuteAPI.d.ts +48 -0
  114. package/dist/apis/ws/WebSocketExecuteAPI.js +48 -0
  115. package/dist/apis/ws/WebSocketExecuteAPI.js.map +1 -0
  116. package/dist/apis/ws/WebSocketQueryAPI.cjs +42 -0
  117. package/dist/apis/ws/WebSocketQueryAPI.cjs.map +1 -0
  118. package/dist/apis/ws/WebSocketQueryAPI.d.cts +23 -0
  119. package/dist/apis/ws/WebSocketQueryAPI.d.ts +23 -0
  120. package/dist/apis/ws/WebSocketQueryAPI.js +17 -0
  121. package/dist/apis/ws/WebSocketQueryAPI.js.map +1 -0
  122. package/dist/apis/ws/WebSocketSubscriptionAPI.cjs +61 -0
  123. package/dist/apis/ws/WebSocketSubscriptionAPI.cjs.map +1 -0
  124. package/dist/apis/ws/WebSocketSubscriptionAPI.d.cts +37 -0
  125. package/dist/apis/ws/WebSocketSubscriptionAPI.d.ts +37 -0
  126. package/dist/apis/ws/WebSocketSubscriptionAPI.js +36 -0
  127. package/dist/apis/ws/WebSocketSubscriptionAPI.js.map +1 -0
  128. package/dist/apis/ws/index.cjs +42 -0
  129. package/dist/apis/ws/index.cjs.map +1 -0
  130. package/dist/apis/ws/index.d.cts +22 -0
  131. package/dist/apis/ws/index.d.ts +22 -0
  132. package/dist/apis/ws/index.js +17 -0
  133. package/dist/apis/ws/index.js.map +1 -0
  134. package/dist/client.cjs +79 -0
  135. package/dist/client.cjs.map +1 -0
  136. package/dist/client.d.cts +57 -0
  137. package/dist/client.d.ts +57 -0
  138. package/dist/client.js +54 -0
  139. package/dist/client.js.map +1 -0
  140. package/dist/context.cjs +125 -0
  141. package/dist/context.cjs.map +1 -0
  142. package/dist/context.d.cts +42 -0
  143. package/dist/context.d.ts +42 -0
  144. package/dist/context.js +109 -0
  145. package/dist/context.js.map +1 -0
  146. package/dist/createNadoClient.cjs +35 -0
  147. package/dist/createNadoClient.cjs.map +1 -0
  148. package/dist/createNadoClient.d.cts +42 -0
  149. package/dist/createNadoClient.d.ts +42 -0
  150. package/dist/createNadoClient.js +12 -0
  151. package/dist/createNadoClient.js.map +1 -0
  152. package/dist/index.cjs +47 -0
  153. package/dist/index.cjs.map +1 -0
  154. package/dist/index.d.cts +32 -0
  155. package/dist/index.d.ts +32 -0
  156. package/dist/index.js +14 -0
  157. package/dist/index.js.map +1 -0
  158. package/package.json +54 -0
  159. package/src/apis/base.ts +52 -0
  160. package/src/apis/market/MarketExecuteAPI.ts +169 -0
  161. package/src/apis/market/MarketQueryAPI.ts +214 -0
  162. package/src/apis/market/index.ts +7 -0
  163. package/src/apis/market/types.ts +58 -0
  164. package/src/apis/perp/PerpExecuteAPI.ts +8 -0
  165. package/src/apis/perp/PerpQueryAPI.ts +25 -0
  166. package/src/apis/perp/index.ts +5 -0
  167. package/src/apis/spot/BaseSpotAPI.ts +30 -0
  168. package/src/apis/spot/SpotExecuteAPI.ts +102 -0
  169. package/src/apis/spot/SpotQueryAPI.ts +53 -0
  170. package/src/apis/spot/index.ts +10 -0
  171. package/src/apis/spot/types.ts +44 -0
  172. package/src/apis/subaccount/SubaccountExecuteAPI.ts +32 -0
  173. package/src/apis/subaccount/SubaccountQueryAPI.ts +78 -0
  174. package/src/apis/subaccount/index.ts +44 -0
  175. package/src/apis/subaccount/types.ts +16 -0
  176. package/src/apis/types.ts +11 -0
  177. package/src/apis/ws/WebSocketExecuteAPI.ts +70 -0
  178. package/src/apis/ws/WebSocketQueryAPI.ts +25 -0
  179. package/src/apis/ws/WebSocketSubscriptionAPI.ts +62 -0
  180. package/src/apis/ws/index.ts +21 -0
  181. package/src/client.ts +67 -0
  182. package/src/context.ts +165 -0
  183. package/src/createNadoClient.ts +20 -0
  184. package/src/index.ts +15 -0
@@ -0,0 +1,38 @@
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/apis/market/index.ts
22
+ var market_exports = {};
23
+ __export(market_exports, {
24
+ MarketAPI: () => MarketAPI
25
+ });
26
+ module.exports = __toCommonJS(market_exports);
27
+ var import_ts_mixer = require("ts-mixer");
28
+ var import_MarketExecuteAPI = require("./MarketExecuteAPI.cjs");
29
+ var import_MarketQueryAPI = require("./MarketQueryAPI.cjs");
30
+ __reExport(market_exports, require("./types.cjs"), module.exports);
31
+ var MarketAPI = class extends (0, import_ts_mixer.Mixin)(import_MarketExecuteAPI.MarketExecuteAPI, import_MarketQueryAPI.MarketQueryAPI) {
32
+ };
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ MarketAPI,
36
+ ...require("./types.cjs")
37
+ });
38
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/apis/market/index.ts"],"sourcesContent":["import { Mixin } from 'ts-mixer';\nimport { MarketExecuteAPI } from './MarketExecuteAPI';\nimport { MarketQueryAPI } from './MarketQueryAPI';\n\nexport * from './types';\n\nexport class MarketAPI extends Mixin(MarketExecuteAPI, MarketQueryAPI) {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAsB;AACtB,8BAAiC;AACjC,4BAA+B;AAE/B,2BAAc,wBAJd;AAMO,IAAM,YAAN,kBAAwB,uBAAM,0CAAkB,oCAAc,EAAE;AAAC;","names":[]}
@@ -0,0 +1,18 @@
1
+ import * as ts_mixer_dist_types_types from 'ts-mixer/dist/types/types';
2
+ import { MarketExecuteAPI } from './MarketExecuteAPI.cjs';
3
+ import { MarketQueryAPI } from './MarketQueryAPI.cjs';
4
+ export { CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, GetTriggerOrdersParams, PlaceIsolatedOrderParams, PlaceOrderParams, PlaceTriggerOrderParams } from './types.cjs';
5
+ import '@nadohq/trigger-client';
6
+ import '@nadohq/engine-client';
7
+ import '../base.cjs';
8
+ import '@nadohq/contracts';
9
+ import '../../context.cjs';
10
+ import '@nadohq/indexer-client';
11
+ import 'viem';
12
+ import '../types.cjs';
13
+
14
+ declare const MarketAPI_base: ts_mixer_dist_types_types.Class<any[], MarketExecuteAPI & MarketQueryAPI, typeof MarketExecuteAPI & typeof MarketQueryAPI>;
15
+ declare class MarketAPI extends MarketAPI_base {
16
+ }
17
+
18
+ export { MarketAPI };
@@ -0,0 +1,18 @@
1
+ import * as ts_mixer_dist_types_types from 'ts-mixer/dist/types/types';
2
+ import { MarketExecuteAPI } from './MarketExecuteAPI.js';
3
+ import { MarketQueryAPI } from './MarketQueryAPI.js';
4
+ export { CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, GetTriggerOrdersParams, PlaceIsolatedOrderParams, PlaceOrderParams, PlaceTriggerOrderParams } from './types.js';
5
+ import '@nadohq/trigger-client';
6
+ import '@nadohq/engine-client';
7
+ import '../base.js';
8
+ import '@nadohq/contracts';
9
+ import '../../context.js';
10
+ import '@nadohq/indexer-client';
11
+ import 'viem';
12
+ import '../types.js';
13
+
14
+ declare const MarketAPI_base: ts_mixer_dist_types_types.Class<any[], MarketExecuteAPI & MarketQueryAPI, typeof MarketExecuteAPI & typeof MarketQueryAPI>;
15
+ declare class MarketAPI extends MarketAPI_base {
16
+ }
17
+
18
+ export { MarketAPI };
@@ -0,0 +1,11 @@
1
+ // src/apis/market/index.ts
2
+ import { Mixin } from "ts-mixer";
3
+ import { MarketExecuteAPI } from "./MarketExecuteAPI.js";
4
+ import { MarketQueryAPI } from "./MarketQueryAPI.js";
5
+ export * from "./types.js";
6
+ var MarketAPI = class extends Mixin(MarketExecuteAPI, MarketQueryAPI) {
7
+ };
8
+ export {
9
+ MarketAPI
10
+ };
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/apis/market/index.ts"],"sourcesContent":["import { Mixin } from 'ts-mixer';\nimport { MarketExecuteAPI } from './MarketExecuteAPI';\nimport { MarketQueryAPI } from './MarketQueryAPI';\n\nexport * from './types';\n\nexport class MarketAPI extends Mixin(MarketExecuteAPI, MarketQueryAPI) {}\n"],"mappings":";AAAA,SAAS,aAAa;AACtB,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAE/B,cAAc;AAEP,IAAM,YAAN,cAAwB,MAAM,kBAAkB,cAAc,EAAE;AAAC;","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/apis/market/types.ts
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
19
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/apis/market/types.ts"],"sourcesContent":["import {\n EngineCancelOrdersParams,\n EngineCancelProductOrdersParams,\n EngineIsolatedOrderParams,\n EngineOrderParams,\n EnginePlaceIsolatedOrderParams,\n EnginePlaceOrderParams,\n} from '@nadohq/engine-client';\nimport {\n TriggerCancelOrdersParams,\n TriggerCancelProductOrdersParams,\n TriggerListOrdersParams,\n TriggerPlaceOrderParams,\n} from '@nadohq/trigger-client';\nimport { OptionalSignatureParams, OptionalSubaccountOwner } from '../types';\n\ntype ClientOrderParams<T> = Omit<OptionalSignatureParams<T>, 'order'> & {\n order: OptionalSubaccountOwner<EngineOrderParams>;\n};\n\nexport type PlaceOrderParams = ClientOrderParams<EnginePlaceOrderParams>;\n\n/**\n * Same as PlaceOrderParams but with isolated fields for isolated margin trading\n */\nexport type PlaceIsolatedOrderParams = Omit<\n OptionalSignatureParams<EnginePlaceIsolatedOrderParams>,\n 'order'\n> & {\n order: OptionalSubaccountOwner<EngineIsolatedOrderParams>;\n};\n\nexport type CancelOrdersParams = OptionalSignatureParams<\n OptionalSubaccountOwner<EngineCancelOrdersParams>\n>;\n\nexport type CancelProductOrdersParams = OptionalSignatureParams<\n OptionalSubaccountOwner<EngineCancelProductOrdersParams>\n>;\n\nexport interface CancelAndPlaceOrderParams {\n placeOrder: PlaceOrderParams;\n cancelOrders: CancelOrdersParams;\n}\n\nexport type PlaceTriggerOrderParams =\n ClientOrderParams<TriggerPlaceOrderParams>;\n\nexport type CancelTriggerOrdersParams = OptionalSignatureParams<\n OptionalSubaccountOwner<TriggerCancelOrdersParams>\n>;\n\nexport type CancelTriggerProductOrdersParams = OptionalSignatureParams<\n OptionalSubaccountOwner<TriggerCancelProductOrdersParams>\n>;\n\nexport type GetTriggerOrdersParams =\n OptionalSignatureParams<TriggerListOrdersParams>;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1,26 @@
1
+ import { EngineOrderParams, EnginePlaceOrderParams, EnginePlaceIsolatedOrderParams, EngineIsolatedOrderParams, EngineCancelOrdersParams, EngineCancelProductOrdersParams } from '@nadohq/engine-client';
2
+ import { TriggerPlaceOrderParams, TriggerCancelOrdersParams, TriggerCancelProductOrdersParams, TriggerListOrdersParams } from '@nadohq/trigger-client';
3
+ import { OptionalSignatureParams, OptionalSubaccountOwner } from '../types.cjs';
4
+
5
+ type ClientOrderParams<T> = Omit<OptionalSignatureParams<T>, 'order'> & {
6
+ order: OptionalSubaccountOwner<EngineOrderParams>;
7
+ };
8
+ type PlaceOrderParams = ClientOrderParams<EnginePlaceOrderParams>;
9
+ /**
10
+ * Same as PlaceOrderParams but with isolated fields for isolated margin trading
11
+ */
12
+ type PlaceIsolatedOrderParams = Omit<OptionalSignatureParams<EnginePlaceIsolatedOrderParams>, 'order'> & {
13
+ order: OptionalSubaccountOwner<EngineIsolatedOrderParams>;
14
+ };
15
+ type CancelOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineCancelOrdersParams>>;
16
+ type CancelProductOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineCancelProductOrdersParams>>;
17
+ interface CancelAndPlaceOrderParams {
18
+ placeOrder: PlaceOrderParams;
19
+ cancelOrders: CancelOrdersParams;
20
+ }
21
+ type PlaceTriggerOrderParams = ClientOrderParams<TriggerPlaceOrderParams>;
22
+ type CancelTriggerOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner<TriggerCancelOrdersParams>>;
23
+ type CancelTriggerProductOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner<TriggerCancelProductOrdersParams>>;
24
+ type GetTriggerOrdersParams = OptionalSignatureParams<TriggerListOrdersParams>;
25
+
26
+ export type { CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, GetTriggerOrdersParams, PlaceIsolatedOrderParams, PlaceOrderParams, PlaceTriggerOrderParams };
@@ -0,0 +1,26 @@
1
+ import { EngineOrderParams, EnginePlaceOrderParams, EnginePlaceIsolatedOrderParams, EngineIsolatedOrderParams, EngineCancelOrdersParams, EngineCancelProductOrdersParams } from '@nadohq/engine-client';
2
+ import { TriggerPlaceOrderParams, TriggerCancelOrdersParams, TriggerCancelProductOrdersParams, TriggerListOrdersParams } from '@nadohq/trigger-client';
3
+ import { OptionalSignatureParams, OptionalSubaccountOwner } from '../types.js';
4
+
5
+ type ClientOrderParams<T> = Omit<OptionalSignatureParams<T>, 'order'> & {
6
+ order: OptionalSubaccountOwner<EngineOrderParams>;
7
+ };
8
+ type PlaceOrderParams = ClientOrderParams<EnginePlaceOrderParams>;
9
+ /**
10
+ * Same as PlaceOrderParams but with isolated fields for isolated margin trading
11
+ */
12
+ type PlaceIsolatedOrderParams = Omit<OptionalSignatureParams<EnginePlaceIsolatedOrderParams>, 'order'> & {
13
+ order: OptionalSubaccountOwner<EngineIsolatedOrderParams>;
14
+ };
15
+ type CancelOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineCancelOrdersParams>>;
16
+ type CancelProductOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineCancelProductOrdersParams>>;
17
+ interface CancelAndPlaceOrderParams {
18
+ placeOrder: PlaceOrderParams;
19
+ cancelOrders: CancelOrdersParams;
20
+ }
21
+ type PlaceTriggerOrderParams = ClientOrderParams<TriggerPlaceOrderParams>;
22
+ type CancelTriggerOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner<TriggerCancelOrdersParams>>;
23
+ type CancelTriggerProductOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner<TriggerCancelProductOrdersParams>>;
24
+ type GetTriggerOrdersParams = OptionalSignatureParams<TriggerListOrdersParams>;
25
+
26
+ export type { CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, GetTriggerOrdersParams, PlaceIsolatedOrderParams, PlaceOrderParams, PlaceTriggerOrderParams };
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,36 @@
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/apis/perp/PerpExecuteAPI.ts
21
+ var PerpExecuteAPI_exports = {};
22
+ __export(PerpExecuteAPI_exports, {
23
+ PerpExecuteAPI: () => PerpExecuteAPI
24
+ });
25
+ module.exports = __toCommonJS(PerpExecuteAPI_exports);
26
+ var import_base = require("../base.cjs");
27
+ var PerpExecuteAPI = class extends import_base.BaseNadoAPI {
28
+ settlePnl(_params) {
29
+ throw Error("Not implemented");
30
+ }
31
+ };
32
+ // Annotate the CommonJS export names for ESM import in node:
33
+ 0 && (module.exports = {
34
+ PerpExecuteAPI
35
+ });
36
+ //# sourceMappingURL=PerpExecuteAPI.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/apis/perp/PerpExecuteAPI.ts"],"sourcesContent":["import { SettlePnlParams } from '@nadohq/contracts';\nimport { BaseNadoAPI } from '../base';\n\nexport class PerpExecuteAPI extends BaseNadoAPI {\n settlePnl(_params: SettlePnlParams) {\n throw Error('Not implemented');\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAA4B;AAErB,IAAM,iBAAN,cAA6B,wBAAY;AAAA,EAC9C,UAAU,SAA0B;AAClC,UAAM,MAAM,iBAAiB;AAAA,EAC/B;AACF;","names":[]}
@@ -0,0 +1,13 @@
1
+ import { SettlePnlParams } from '@nadohq/contracts';
2
+ import { BaseNadoAPI } from '../base.cjs';
3
+ import '../../context.cjs';
4
+ import '@nadohq/engine-client';
5
+ import '@nadohq/indexer-client';
6
+ import '@nadohq/trigger-client';
7
+ import 'viem';
8
+
9
+ declare class PerpExecuteAPI extends BaseNadoAPI {
10
+ settlePnl(_params: SettlePnlParams): void;
11
+ }
12
+
13
+ export { PerpExecuteAPI };
@@ -0,0 +1,13 @@
1
+ import { SettlePnlParams } from '@nadohq/contracts';
2
+ import { BaseNadoAPI } from '../base.js';
3
+ import '../../context.js';
4
+ import '@nadohq/engine-client';
5
+ import '@nadohq/indexer-client';
6
+ import '@nadohq/trigger-client';
7
+ import 'viem';
8
+
9
+ declare class PerpExecuteAPI extends BaseNadoAPI {
10
+ settlePnl(_params: SettlePnlParams): void;
11
+ }
12
+
13
+ export { PerpExecuteAPI };
@@ -0,0 +1,11 @@
1
+ // src/apis/perp/PerpExecuteAPI.ts
2
+ import { BaseNadoAPI } from "../base.js";
3
+ var PerpExecuteAPI = class extends BaseNadoAPI {
4
+ settlePnl(_params) {
5
+ throw Error("Not implemented");
6
+ }
7
+ };
8
+ export {
9
+ PerpExecuteAPI
10
+ };
11
+ //# sourceMappingURL=PerpExecuteAPI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/apis/perp/PerpExecuteAPI.ts"],"sourcesContent":["import { SettlePnlParams } from '@nadohq/contracts';\nimport { BaseNadoAPI } from '../base';\n\nexport class PerpExecuteAPI extends BaseNadoAPI {\n settlePnl(_params: SettlePnlParams) {\n throw Error('Not implemented');\n }\n}\n"],"mappings":";AACA,SAAS,mBAAmB;AAErB,IAAM,iBAAN,cAA6B,YAAY;AAAA,EAC9C,UAAU,SAA0B;AAClC,UAAM,MAAM,iBAAiB;AAAA,EAC/B;AACF;","names":[]}
@@ -0,0 +1,47 @@
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/apis/perp/PerpQueryAPI.ts
21
+ var PerpQueryAPI_exports = {};
22
+ __export(PerpQueryAPI_exports, {
23
+ PerpQueryAPI: () => PerpQueryAPI
24
+ });
25
+ module.exports = __toCommonJS(PerpQueryAPI_exports);
26
+ var import_base = require("../base.cjs");
27
+ var PerpQueryAPI = class extends import_base.BaseNadoAPI {
28
+ /**
29
+ * Gets the latest index & mark price for a perp product
30
+ * @param params
31
+ */
32
+ async getPerpPrices(params) {
33
+ return this.context.indexerClient.getPerpPrices(params);
34
+ }
35
+ /**
36
+ * Gets the latest index & mark price for multiple perp products
37
+ * @param params
38
+ */
39
+ async getMultiProductPerpPrices(params) {
40
+ return this.context.indexerClient.getMultiProductPerpPrices(params);
41
+ }
42
+ };
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ PerpQueryAPI
46
+ });
47
+ //# sourceMappingURL=PerpQueryAPI.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/apis/perp/PerpQueryAPI.ts"],"sourcesContent":["import {\n GetIndexerMultiProductPerpPricesParams,\n GetIndexerPerpPricesParams,\n} from '@nadohq/indexer-client';\nimport { BaseNadoAPI } from '../base';\n\nexport class PerpQueryAPI extends BaseNadoAPI {\n /**\n * Gets the latest index & mark price for a perp product\n * @param params\n */\n async getPerpPrices(params: GetIndexerPerpPricesParams) {\n return this.context.indexerClient.getPerpPrices(params);\n }\n\n /**\n * Gets the latest index & mark price for multiple perp products\n * @param params\n */\n async getMultiProductPerpPrices(\n params: GetIndexerMultiProductPerpPricesParams,\n ) {\n return this.context.indexerClient.getMultiProductPerpPrices(params);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAA4B;AAErB,IAAM,eAAN,cAA2B,wBAAY;AAAA;AAAA;AAAA;AAAA;AAAA,EAK5C,MAAM,cAAc,QAAoC;AACtD,WAAO,KAAK,QAAQ,cAAc,cAAc,MAAM;AAAA,EACxD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,0BACJ,QACA;AACA,WAAO,KAAK,QAAQ,cAAc,0BAA0B,MAAM;AAAA,EACpE;AACF;","names":[]}
@@ -0,0 +1,23 @@
1
+ import * as _nadohq_indexer_client from '@nadohq/indexer-client';
2
+ import { GetIndexerPerpPricesParams, GetIndexerMultiProductPerpPricesParams } from '@nadohq/indexer-client';
3
+ import { BaseNadoAPI } from '../base.cjs';
4
+ import '@nadohq/contracts';
5
+ import '../../context.cjs';
6
+ import '@nadohq/engine-client';
7
+ import '@nadohq/trigger-client';
8
+ import 'viem';
9
+
10
+ declare class PerpQueryAPI extends BaseNadoAPI {
11
+ /**
12
+ * Gets the latest index & mark price for a perp product
13
+ * @param params
14
+ */
15
+ getPerpPrices(params: GetIndexerPerpPricesParams): Promise<_nadohq_indexer_client.IndexerPerpPrices>;
16
+ /**
17
+ * Gets the latest index & mark price for multiple perp products
18
+ * @param params
19
+ */
20
+ getMultiProductPerpPrices(params: GetIndexerMultiProductPerpPricesParams): Promise<_nadohq_indexer_client.GetIndexerMultiProductPerpPricesResponse>;
21
+ }
22
+
23
+ export { PerpQueryAPI };
@@ -0,0 +1,23 @@
1
+ import * as _nadohq_indexer_client from '@nadohq/indexer-client';
2
+ import { GetIndexerPerpPricesParams, GetIndexerMultiProductPerpPricesParams } from '@nadohq/indexer-client';
3
+ import { BaseNadoAPI } from '../base.js';
4
+ import '@nadohq/contracts';
5
+ import '../../context.js';
6
+ import '@nadohq/engine-client';
7
+ import '@nadohq/trigger-client';
8
+ import 'viem';
9
+
10
+ declare class PerpQueryAPI extends BaseNadoAPI {
11
+ /**
12
+ * Gets the latest index & mark price for a perp product
13
+ * @param params
14
+ */
15
+ getPerpPrices(params: GetIndexerPerpPricesParams): Promise<_nadohq_indexer_client.IndexerPerpPrices>;
16
+ /**
17
+ * Gets the latest index & mark price for multiple perp products
18
+ * @param params
19
+ */
20
+ getMultiProductPerpPrices(params: GetIndexerMultiProductPerpPricesParams): Promise<_nadohq_indexer_client.GetIndexerMultiProductPerpPricesResponse>;
21
+ }
22
+
23
+ export { PerpQueryAPI };
@@ -0,0 +1,22 @@
1
+ // src/apis/perp/PerpQueryAPI.ts
2
+ import { BaseNadoAPI } from "../base.js";
3
+ var PerpQueryAPI = class extends BaseNadoAPI {
4
+ /**
5
+ * Gets the latest index & mark price for a perp product
6
+ * @param params
7
+ */
8
+ async getPerpPrices(params) {
9
+ return this.context.indexerClient.getPerpPrices(params);
10
+ }
11
+ /**
12
+ * Gets the latest index & mark price for multiple perp products
13
+ * @param params
14
+ */
15
+ async getMultiProductPerpPrices(params) {
16
+ return this.context.indexerClient.getMultiProductPerpPrices(params);
17
+ }
18
+ };
19
+ export {
20
+ PerpQueryAPI
21
+ };
22
+ //# sourceMappingURL=PerpQueryAPI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/apis/perp/PerpQueryAPI.ts"],"sourcesContent":["import {\n GetIndexerMultiProductPerpPricesParams,\n GetIndexerPerpPricesParams,\n} from '@nadohq/indexer-client';\nimport { BaseNadoAPI } from '../base';\n\nexport class PerpQueryAPI extends BaseNadoAPI {\n /**\n * Gets the latest index & mark price for a perp product\n * @param params\n */\n async getPerpPrices(params: GetIndexerPerpPricesParams) {\n return this.context.indexerClient.getPerpPrices(params);\n }\n\n /**\n * Gets the latest index & mark price for multiple perp products\n * @param params\n */\n async getMultiProductPerpPrices(\n params: GetIndexerMultiProductPerpPricesParams,\n ) {\n return this.context.indexerClient.getMultiProductPerpPrices(params);\n }\n}\n"],"mappings":";AAIA,SAAS,mBAAmB;AAErB,IAAM,eAAN,cAA2B,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,EAK5C,MAAM,cAAc,QAAoC;AACtD,WAAO,KAAK,QAAQ,cAAc,cAAc,MAAM;AAAA,EACxD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,0BACJ,QACA;AACA,WAAO,KAAK,QAAQ,cAAc,0BAA0B,MAAM;AAAA,EACpE;AACF;","names":[]}
@@ -0,0 +1,35 @@
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/apis/perp/index.ts
21
+ var perp_exports = {};
22
+ __export(perp_exports, {
23
+ PerpAPI: () => PerpAPI
24
+ });
25
+ module.exports = __toCommonJS(perp_exports);
26
+ var import_ts_mixer = require("ts-mixer");
27
+ var import_PerpExecuteAPI = require("./PerpExecuteAPI.cjs");
28
+ var import_PerpQueryAPI = require("./PerpQueryAPI.cjs");
29
+ var PerpAPI = class extends (0, import_ts_mixer.Mixin)(import_PerpExecuteAPI.PerpExecuteAPI, import_PerpQueryAPI.PerpQueryAPI) {
30
+ };
31
+ // Annotate the CommonJS export names for ESM import in node:
32
+ 0 && (module.exports = {
33
+ PerpAPI
34
+ });
35
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/apis/perp/index.ts"],"sourcesContent":["import { Mixin } from 'ts-mixer';\nimport { PerpExecuteAPI } from './PerpExecuteAPI';\nimport { PerpQueryAPI } from './PerpQueryAPI';\n\nexport class PerpAPI extends Mixin(PerpExecuteAPI, PerpQueryAPI) {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAsB;AACtB,4BAA+B;AAC/B,0BAA6B;AAEtB,IAAM,UAAN,kBAAsB,uBAAM,sCAAgB,gCAAY,EAAE;AAAC;","names":[]}
@@ -0,0 +1,16 @@
1
+ import * as ts_mixer_dist_types_types from 'ts-mixer/dist/types/types';
2
+ import { PerpExecuteAPI } from './PerpExecuteAPI.cjs';
3
+ import { PerpQueryAPI } from './PerpQueryAPI.cjs';
4
+ import '@nadohq/contracts';
5
+ import '../base.cjs';
6
+ import '../../context.cjs';
7
+ import '@nadohq/engine-client';
8
+ import '@nadohq/indexer-client';
9
+ import '@nadohq/trigger-client';
10
+ import 'viem';
11
+
12
+ declare const PerpAPI_base: ts_mixer_dist_types_types.Class<any[], PerpExecuteAPI & PerpQueryAPI, typeof PerpExecuteAPI & typeof PerpQueryAPI>;
13
+ declare class PerpAPI extends PerpAPI_base {
14
+ }
15
+
16
+ export { PerpAPI };
@@ -0,0 +1,16 @@
1
+ import * as ts_mixer_dist_types_types from 'ts-mixer/dist/types/types';
2
+ import { PerpExecuteAPI } from './PerpExecuteAPI.js';
3
+ import { PerpQueryAPI } from './PerpQueryAPI.js';
4
+ import '@nadohq/contracts';
5
+ import '../base.js';
6
+ import '../../context.js';
7
+ import '@nadohq/engine-client';
8
+ import '@nadohq/indexer-client';
9
+ import '@nadohq/trigger-client';
10
+ import 'viem';
11
+
12
+ declare const PerpAPI_base: ts_mixer_dist_types_types.Class<any[], PerpExecuteAPI & PerpQueryAPI, typeof PerpExecuteAPI & typeof PerpQueryAPI>;
13
+ declare class PerpAPI extends PerpAPI_base {
14
+ }
15
+
16
+ export { PerpAPI };
@@ -0,0 +1,10 @@
1
+ // src/apis/perp/index.ts
2
+ import { Mixin } from "ts-mixer";
3
+ import { PerpExecuteAPI } from "./PerpExecuteAPI.js";
4
+ import { PerpQueryAPI } from "./PerpQueryAPI.js";
5
+ var PerpAPI = class extends Mixin(PerpExecuteAPI, PerpQueryAPI) {
6
+ };
7
+ export {
8
+ PerpAPI
9
+ };
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/apis/perp/index.ts"],"sourcesContent":["import { Mixin } from 'ts-mixer';\nimport { PerpExecuteAPI } from './PerpExecuteAPI';\nimport { PerpQueryAPI } from './PerpQueryAPI';\n\nexport class PerpAPI extends Mixin(PerpExecuteAPI, PerpQueryAPI) {}\n"],"mappings":";AAAA,SAAS,aAAa;AACtB,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAEtB,IAAM,UAAN,cAAsB,MAAM,gBAAgB,YAAY,EAAE;AAAC;","names":[]}
@@ -0,0 +1,55 @@
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/apis/spot/BaseSpotAPI.ts
21
+ var BaseSpotAPI_exports = {};
22
+ __export(BaseSpotAPI_exports, {
23
+ BaseSpotAPI: () => BaseSpotAPI
24
+ });
25
+ module.exports = __toCommonJS(BaseSpotAPI_exports);
26
+ var import_contracts = require("@nadohq/contracts");
27
+ var import_utils = require("@nadohq/utils");
28
+ var import_viem = require("viem");
29
+ var import_base = require("../base.cjs");
30
+ var BaseSpotAPI = class extends import_base.BaseNadoAPI {
31
+ /**
32
+ * Retrieves the ERC20 token contract for a spot product
33
+ */
34
+ async getTokenContractForProduct(params) {
35
+ let tokenAddress;
36
+ if ("productId" in params) {
37
+ const config = await this.context.contracts.spotEngine.read.getConfig([
38
+ params.productId
39
+ ]);
40
+ tokenAddress = config.token;
41
+ } else {
42
+ tokenAddress = params.tokenAddress;
43
+ }
44
+ return (0, import_viem.getContract)({
45
+ abi: import_contracts.ERC20_ABI,
46
+ address: (0, import_utils.getValidatedAddress)(tokenAddress),
47
+ client: this.context.walletClient ?? this.context.publicClient
48
+ });
49
+ }
50
+ };
51
+ // Annotate the CommonJS export names for ESM import in node:
52
+ 0 && (module.exports = {
53
+ BaseSpotAPI
54
+ });
55
+ //# sourceMappingURL=BaseSpotAPI.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/apis/spot/BaseSpotAPI.ts"],"sourcesContent":["import { ContractInstance, ERC20_ABI } from '@nadohq/contracts';\nimport { getValidatedAddress } from '@nadohq/utils';\nimport { getContract } from 'viem';\nimport { BaseNadoAPI } from '../base';\nimport { ProductIdOrTokenAddress } from './types';\n\nexport class BaseSpotAPI extends BaseNadoAPI {\n /**\n * Retrieves the ERC20 token contract for a spot product\n */\n async getTokenContractForProduct(\n params: ProductIdOrTokenAddress,\n ): Promise<ContractInstance<typeof ERC20_ABI>> {\n let tokenAddress: string;\n if ('productId' in params) {\n const config = await this.context.contracts.spotEngine.read.getConfig([\n params.productId,\n ]);\n tokenAddress = config.token;\n } else {\n tokenAddress = params.tokenAddress;\n }\n\n return getContract({\n abi: ERC20_ABI,\n address: getValidatedAddress(tokenAddress),\n client: this.context.walletClient ?? this.context.publicClient,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA4C;AAC5C,mBAAoC;AACpC,kBAA4B;AAC5B,kBAA4B;AAGrB,IAAM,cAAN,cAA0B,wBAAY;AAAA;AAAA;AAAA;AAAA,EAI3C,MAAM,2BACJ,QAC6C;AAC7C,QAAI;AACJ,QAAI,eAAe,QAAQ;AACzB,YAAM,SAAS,MAAM,KAAK,QAAQ,UAAU,WAAW,KAAK,UAAU;AAAA,QACpE,OAAO;AAAA,MACT,CAAC;AACD,qBAAe,OAAO;AAAA,IACxB,OAAO;AACL,qBAAe,OAAO;AAAA,IACxB;AAEA,eAAO,yBAAY;AAAA,MACjB,KAAK;AAAA,MACL,aAAS,kCAAoB,YAAY;AAAA,MACzC,QAAQ,KAAK,QAAQ,gBAAgB,KAAK,QAAQ;AAAA,IACpD,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -0,0 +1,19 @@
1
+ import { ContractInstance, ERC20_ABI } from '@nadohq/contracts';
2
+ import { BaseNadoAPI } from '../base.cjs';
3
+ import { ProductIdOrTokenAddress } from './types.cjs';
4
+ import '../../context.cjs';
5
+ import '@nadohq/engine-client';
6
+ import '@nadohq/indexer-client';
7
+ import '@nadohq/trigger-client';
8
+ import 'viem';
9
+ import '@nadohq/utils';
10
+ import '../types.cjs';
11
+
12
+ declare class BaseSpotAPI extends BaseNadoAPI {
13
+ /**
14
+ * Retrieves the ERC20 token contract for a spot product
15
+ */
16
+ getTokenContractForProduct(params: ProductIdOrTokenAddress): Promise<ContractInstance<typeof ERC20_ABI>>;
17
+ }
18
+
19
+ export { BaseSpotAPI };
@@ -0,0 +1,19 @@
1
+ import { ContractInstance, ERC20_ABI } from '@nadohq/contracts';
2
+ import { BaseNadoAPI } from '../base.js';
3
+ import { ProductIdOrTokenAddress } from './types.js';
4
+ import '../../context.js';
5
+ import '@nadohq/engine-client';
6
+ import '@nadohq/indexer-client';
7
+ import '@nadohq/trigger-client';
8
+ import 'viem';
9
+ import '@nadohq/utils';
10
+ import '../types.js';
11
+
12
+ declare class BaseSpotAPI extends BaseNadoAPI {
13
+ /**
14
+ * Retrieves the ERC20 token contract for a spot product
15
+ */
16
+ getTokenContractForProduct(params: ProductIdOrTokenAddress): Promise<ContractInstance<typeof ERC20_ABI>>;
17
+ }
18
+
19
+ export { BaseSpotAPI };
@@ -0,0 +1,30 @@
1
+ // src/apis/spot/BaseSpotAPI.ts
2
+ import { ERC20_ABI } from "@nadohq/contracts";
3
+ import { getValidatedAddress } from "@nadohq/utils";
4
+ import { getContract } from "viem";
5
+ import { BaseNadoAPI } from "../base.js";
6
+ var BaseSpotAPI = class extends BaseNadoAPI {
7
+ /**
8
+ * Retrieves the ERC20 token contract for a spot product
9
+ */
10
+ async getTokenContractForProduct(params) {
11
+ let tokenAddress;
12
+ if ("productId" in params) {
13
+ const config = await this.context.contracts.spotEngine.read.getConfig([
14
+ params.productId
15
+ ]);
16
+ tokenAddress = config.token;
17
+ } else {
18
+ tokenAddress = params.tokenAddress;
19
+ }
20
+ return getContract({
21
+ abi: ERC20_ABI,
22
+ address: getValidatedAddress(tokenAddress),
23
+ client: this.context.walletClient ?? this.context.publicClient
24
+ });
25
+ }
26
+ };
27
+ export {
28
+ BaseSpotAPI
29
+ };
30
+ //# sourceMappingURL=BaseSpotAPI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/apis/spot/BaseSpotAPI.ts"],"sourcesContent":["import { ContractInstance, ERC20_ABI } from '@nadohq/contracts';\nimport { getValidatedAddress } from '@nadohq/utils';\nimport { getContract } from 'viem';\nimport { BaseNadoAPI } from '../base';\nimport { ProductIdOrTokenAddress } from './types';\n\nexport class BaseSpotAPI extends BaseNadoAPI {\n /**\n * Retrieves the ERC20 token contract for a spot product\n */\n async getTokenContractForProduct(\n params: ProductIdOrTokenAddress,\n ): Promise<ContractInstance<typeof ERC20_ABI>> {\n let tokenAddress: string;\n if ('productId' in params) {\n const config = await this.context.contracts.spotEngine.read.getConfig([\n params.productId,\n ]);\n tokenAddress = config.token;\n } else {\n tokenAddress = params.tokenAddress;\n }\n\n return getContract({\n abi: ERC20_ABI,\n address: getValidatedAddress(tokenAddress),\n client: this.context.walletClient ?? this.context.publicClient,\n });\n }\n}\n"],"mappings":";AAAA,SAA2B,iBAAiB;AAC5C,SAAS,2BAA2B;AACpC,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAGrB,IAAM,cAAN,cAA0B,YAAY;AAAA;AAAA;AAAA;AAAA,EAI3C,MAAM,2BACJ,QAC6C;AAC7C,QAAI;AACJ,QAAI,eAAe,QAAQ;AACzB,YAAM,SAAS,MAAM,KAAK,QAAQ,UAAU,WAAW,KAAK,UAAU;AAAA,QACpE,OAAO;AAAA,MACT,CAAC;AACD,qBAAe,OAAO;AAAA,IACxB,OAAO;AACL,qBAAe,OAAO;AAAA,IACxB;AAEA,WAAO,YAAY;AAAA,MACjB,KAAK;AAAA,MACL,SAAS,oBAAoB,YAAY;AAAA,MACzC,QAAQ,KAAK,QAAQ,gBAAgB,KAAK,QAAQ;AAAA,IACpD,CAAC;AAAA,EACH;AACF;","names":[]}