@nadohq/client 0.1.0-alpha.3 → 0.1.0-alpha.4

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 (118) hide show
  1. package/dist/apis/base.cjs +3 -6
  2. package/dist/apis/base.cjs.map +1 -1
  3. package/dist/apis/base.d.cts +1 -2
  4. package/dist/apis/base.d.ts +1 -2
  5. package/dist/apis/base.js +1 -4
  6. package/dist/apis/base.js.map +1 -1
  7. package/dist/apis/market/MarketExecuteAPI.cjs +4 -27
  8. package/dist/apis/market/MarketExecuteAPI.cjs.map +1 -1
  9. package/dist/apis/market/MarketExecuteAPI.d.cts +3 -11
  10. package/dist/apis/market/MarketExecuteAPI.d.ts +3 -11
  11. package/dist/apis/market/MarketExecuteAPI.js +4 -27
  12. package/dist/apis/market/MarketExecuteAPI.js.map +1 -1
  13. package/dist/apis/market/MarketQueryAPI.cjs +2 -9
  14. package/dist/apis/market/MarketQueryAPI.cjs.map +1 -1
  15. package/dist/apis/market/MarketQueryAPI.d.cts +4 -8
  16. package/dist/apis/market/MarketQueryAPI.d.ts +4 -8
  17. package/dist/apis/market/MarketQueryAPI.js +2 -9
  18. package/dist/apis/market/MarketQueryAPI.js.map +1 -1
  19. package/dist/apis/market/index.d.cts +2 -2
  20. package/dist/apis/market/index.d.ts +2 -2
  21. package/dist/apis/market/types.cjs.map +1 -1
  22. package/dist/apis/market/types.d.cts +5 -9
  23. package/dist/apis/market/types.d.ts +5 -9
  24. package/dist/apis/perp/PerpExecuteAPI.cjs +0 -3
  25. package/dist/apis/perp/PerpExecuteAPI.cjs.map +1 -1
  26. package/dist/apis/perp/PerpExecuteAPI.d.cts +1 -2
  27. package/dist/apis/perp/PerpExecuteAPI.d.ts +1 -2
  28. package/dist/apis/perp/PerpExecuteAPI.js +0 -3
  29. package/dist/apis/perp/PerpExecuteAPI.js.map +1 -1
  30. package/dist/apis/perp/PerpQueryAPI.d.cts +1 -1
  31. package/dist/apis/perp/PerpQueryAPI.d.ts +1 -1
  32. package/dist/apis/perp/index.d.cts +1 -1
  33. package/dist/apis/perp/index.d.ts +1 -1
  34. package/dist/apis/spot/BaseSpotAPI.cjs +4 -4
  35. package/dist/apis/spot/BaseSpotAPI.cjs.map +1 -1
  36. package/dist/apis/spot/BaseSpotAPI.d.cts +1 -2
  37. package/dist/apis/spot/BaseSpotAPI.d.ts +1 -2
  38. package/dist/apis/spot/BaseSpotAPI.js +2 -2
  39. package/dist/apis/spot/BaseSpotAPI.js.map +1 -1
  40. package/dist/apis/spot/SpotExecuteAPI.cjs +8 -8
  41. package/dist/apis/spot/SpotExecuteAPI.cjs.map +1 -1
  42. package/dist/apis/spot/SpotExecuteAPI.d.cts +2 -3
  43. package/dist/apis/spot/SpotExecuteAPI.d.ts +2 -3
  44. package/dist/apis/spot/SpotExecuteAPI.js +2 -2
  45. package/dist/apis/spot/SpotExecuteAPI.js.map +1 -1
  46. package/dist/apis/spot/SpotQueryAPI.cjs +4 -4
  47. package/dist/apis/spot/SpotQueryAPI.cjs.map +1 -1
  48. package/dist/apis/spot/SpotQueryAPI.d.cts +1 -2
  49. package/dist/apis/spot/SpotQueryAPI.d.ts +1 -2
  50. package/dist/apis/spot/SpotQueryAPI.js +1 -1
  51. package/dist/apis/spot/SpotQueryAPI.js.map +1 -1
  52. package/dist/apis/spot/index.d.cts +2 -3
  53. package/dist/apis/spot/index.d.ts +2 -3
  54. package/dist/apis/spot/types.cjs.map +1 -1
  55. package/dist/apis/spot/types.d.cts +6 -2
  56. package/dist/apis/spot/types.d.ts +6 -2
  57. package/dist/apis/subaccount/SubaccountExecuteAPI.d.cts +1 -1
  58. package/dist/apis/subaccount/SubaccountExecuteAPI.d.ts +1 -1
  59. package/dist/apis/subaccount/SubaccountQueryAPI.cjs +1 -10
  60. package/dist/apis/subaccount/SubaccountQueryAPI.cjs.map +1 -1
  61. package/dist/apis/subaccount/SubaccountQueryAPI.d.cts +3 -10
  62. package/dist/apis/subaccount/SubaccountQueryAPI.d.ts +3 -10
  63. package/dist/apis/subaccount/SubaccountQueryAPI.js +1 -12
  64. package/dist/apis/subaccount/SubaccountQueryAPI.js.map +1 -1
  65. package/dist/apis/subaccount/index.cjs +4 -4
  66. package/dist/apis/subaccount/index.cjs.map +1 -1
  67. package/dist/apis/subaccount/index.d.cts +1 -1
  68. package/dist/apis/subaccount/index.d.ts +1 -1
  69. package/dist/apis/subaccount/index.js +2 -2
  70. package/dist/apis/subaccount/index.js.map +1 -1
  71. package/dist/apis/subaccount/types.cjs.map +1 -1
  72. package/dist/apis/subaccount/types.d.cts +1 -1
  73. package/dist/apis/subaccount/types.d.ts +1 -1
  74. package/dist/apis/ws/WebSocketExecuteAPI.cjs.map +1 -1
  75. package/dist/apis/ws/WebSocketExecuteAPI.d.cts +4 -4
  76. package/dist/apis/ws/WebSocketExecuteAPI.d.ts +4 -4
  77. package/dist/apis/ws/WebSocketExecuteAPI.js.map +1 -1
  78. package/dist/apis/ws/WebSocketQueryAPI.d.cts +1 -1
  79. package/dist/apis/ws/WebSocketQueryAPI.d.ts +1 -1
  80. package/dist/apis/ws/WebSocketSubscriptionAPI.d.cts +1 -1
  81. package/dist/apis/ws/WebSocketSubscriptionAPI.d.ts +1 -1
  82. package/dist/apis/ws/index.d.cts +1 -1
  83. package/dist/apis/ws/index.d.ts +1 -1
  84. package/dist/client.cjs.map +1 -1
  85. package/dist/client.d.cts +2 -3
  86. package/dist/client.d.ts +2 -3
  87. package/dist/client.js.map +1 -1
  88. package/dist/context.cjs +3 -3
  89. package/dist/context.cjs.map +1 -1
  90. package/dist/context.d.cts +1 -1
  91. package/dist/context.d.ts +1 -1
  92. package/dist/context.js +1 -1
  93. package/dist/context.js.map +1 -1
  94. package/dist/createNadoClient.d.cts +1 -2
  95. package/dist/createNadoClient.d.ts +1 -2
  96. package/dist/index.cjs +2 -4
  97. package/dist/index.cjs.map +1 -1
  98. package/dist/index.d.cts +3 -4
  99. package/dist/index.d.ts +3 -4
  100. package/dist/index.js +1 -2
  101. package/dist/index.js.map +1 -1
  102. package/package.json +6 -7
  103. package/src/apis/base.ts +2 -6
  104. package/src/apis/market/MarketExecuteAPI.ts +4 -38
  105. package/src/apis/market/MarketQueryAPI.ts +4 -11
  106. package/src/apis/market/types.ts +7 -13
  107. package/src/apis/perp/PerpExecuteAPI.ts +1 -6
  108. package/src/apis/spot/BaseSpotAPI.ts +3 -2
  109. package/src/apis/spot/SpotExecuteAPI.ts +3 -3
  110. package/src/apis/spot/SpotQueryAPI.ts +1 -1
  111. package/src/apis/spot/types.ts +6 -1
  112. package/src/apis/subaccount/SubaccountQueryAPI.ts +1 -14
  113. package/src/apis/subaccount/index.ts +2 -2
  114. package/src/apis/subaccount/types.ts +1 -1
  115. package/src/apis/ws/WebSocketExecuteAPI.ts +1 -1
  116. package/src/client.ts +1 -1
  117. package/src/context.ts +1 -1
  118. package/src/index.ts +1 -2
@@ -1,11 +1,11 @@
1
1
  import * as ts_mixer_dist_types_types from 'ts-mixer/dist/types/types';
2
2
  import { MarketExecuteAPI } from './MarketExecuteAPI.js';
3
3
  import { MarketQueryAPI } from './MarketQueryAPI.js';
4
- export { CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, GetTriggerOrdersParams, PlaceIsolatedOrderParams, PlaceOrderParams, PlaceTriggerOrderParams } from './types.js';
4
+ export { CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, GetTriggerOrdersParams, PlaceOrderParams, PlaceTriggerOrderParams } from './types.js';
5
5
  import '@nadohq/trigger-client';
6
6
  import '@nadohq/engine-client';
7
7
  import '../base.js';
8
- import '@nadohq/contracts';
8
+ import '@nadohq/shared';
9
9
  import '../../context.js';
10
10
  import '@nadohq/indexer-client';
11
11
  import 'viem';
@@ -1 +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":[]}
1
+ {"version":3,"sources":["../../../src/apis/market/types.ts"],"sourcesContent":["import {\n EngineCancelOrdersParams,\n EngineCancelProductOrdersParams,\n EngineOrderParams,\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 extends { order: EngineOrderParams }> = Omit<\n OptionalSignatureParams<T>,\n // Order is overridden to make subaccount owner optional\n | 'order'\n // Verifying address can be derived from product ID\n | 'verifyingAddr'\n> & {\n order: OptionalSubaccountOwner<EngineOrderParams>;\n};\n\nexport type PlaceOrderParams = ClientOrderParams<EnginePlaceOrderParams>;\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":[]}
@@ -1,17 +1,13 @@
1
- import { EngineOrderParams, EnginePlaceOrderParams, EnginePlaceIsolatedOrderParams, EngineIsolatedOrderParams, EngineCancelOrdersParams, EngineCancelProductOrdersParams } from '@nadohq/engine-client';
1
+ import { EngineOrderParams, EnginePlaceOrderParams, EngineCancelOrdersParams, EngineCancelProductOrdersParams } from '@nadohq/engine-client';
2
2
  import { TriggerPlaceOrderParams, TriggerCancelOrdersParams, TriggerCancelProductOrdersParams, TriggerListOrdersParams } from '@nadohq/trigger-client';
3
3
  import { OptionalSignatureParams, OptionalSubaccountOwner } from '../types.cjs';
4
4
 
5
- type ClientOrderParams<T> = Omit<OptionalSignatureParams<T>, 'order'> & {
5
+ type ClientOrderParams<T extends {
6
+ order: EngineOrderParams;
7
+ }> = Omit<OptionalSignatureParams<T>, 'order' | 'verifyingAddr'> & {
6
8
  order: OptionalSubaccountOwner<EngineOrderParams>;
7
9
  };
8
10
  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
11
  type CancelOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineCancelOrdersParams>>;
16
12
  type CancelProductOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineCancelProductOrdersParams>>;
17
13
  interface CancelAndPlaceOrderParams {
@@ -23,4 +19,4 @@ type CancelTriggerOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner
23
19
  type CancelTriggerProductOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner<TriggerCancelProductOrdersParams>>;
24
20
  type GetTriggerOrdersParams = OptionalSignatureParams<TriggerListOrdersParams>;
25
21
 
26
- export type { CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, GetTriggerOrdersParams, PlaceIsolatedOrderParams, PlaceOrderParams, PlaceTriggerOrderParams };
22
+ export type { CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, GetTriggerOrdersParams, PlaceOrderParams, PlaceTriggerOrderParams };
@@ -1,17 +1,13 @@
1
- import { EngineOrderParams, EnginePlaceOrderParams, EnginePlaceIsolatedOrderParams, EngineIsolatedOrderParams, EngineCancelOrdersParams, EngineCancelProductOrdersParams } from '@nadohq/engine-client';
1
+ import { EngineOrderParams, EnginePlaceOrderParams, EngineCancelOrdersParams, EngineCancelProductOrdersParams } from '@nadohq/engine-client';
2
2
  import { TriggerPlaceOrderParams, TriggerCancelOrdersParams, TriggerCancelProductOrdersParams, TriggerListOrdersParams } from '@nadohq/trigger-client';
3
3
  import { OptionalSignatureParams, OptionalSubaccountOwner } from '../types.js';
4
4
 
5
- type ClientOrderParams<T> = Omit<OptionalSignatureParams<T>, 'order'> & {
5
+ type ClientOrderParams<T extends {
6
+ order: EngineOrderParams;
7
+ }> = Omit<OptionalSignatureParams<T>, 'order' | 'verifyingAddr'> & {
6
8
  order: OptionalSubaccountOwner<EngineOrderParams>;
7
9
  };
8
10
  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
11
  type CancelOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineCancelOrdersParams>>;
16
12
  type CancelProductOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineCancelProductOrdersParams>>;
17
13
  interface CancelAndPlaceOrderParams {
@@ -23,4 +19,4 @@ type CancelTriggerOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner
23
19
  type CancelTriggerProductOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner<TriggerCancelProductOrdersParams>>;
24
20
  type GetTriggerOrdersParams = OptionalSignatureParams<TriggerListOrdersParams>;
25
21
 
26
- export type { CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, GetTriggerOrdersParams, PlaceIsolatedOrderParams, PlaceOrderParams, PlaceTriggerOrderParams };
22
+ export type { CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, GetTriggerOrdersParams, PlaceOrderParams, PlaceTriggerOrderParams };
@@ -25,9 +25,6 @@ __export(PerpExecuteAPI_exports, {
25
25
  module.exports = __toCommonJS(PerpExecuteAPI_exports);
26
26
  var import_base = require("../base.cjs");
27
27
  var PerpExecuteAPI = class extends import_base.BaseNadoAPI {
28
- settlePnl(_params) {
29
- throw Error("Not implemented");
30
- }
31
28
  };
32
29
  // Annotate the CommonJS export names for ESM import in node:
33
30
  0 && (module.exports = {
@@ -1 +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":[]}
1
+ {"version":3,"sources":["../../../src/apis/perp/PerpExecuteAPI.ts"],"sourcesContent":["import { BaseNadoAPI } from '../base';\n\nexport class PerpExecuteAPI extends BaseNadoAPI {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA4B;AAErB,IAAM,iBAAN,cAA6B,wBAAY;AAAC;","names":[]}
@@ -1,5 +1,5 @@
1
- import { SettlePnlParams } from '@nadohq/contracts';
2
1
  import { BaseNadoAPI } from '../base.cjs';
2
+ import '@nadohq/shared';
3
3
  import '../../context.cjs';
4
4
  import '@nadohq/engine-client';
5
5
  import '@nadohq/indexer-client';
@@ -7,7 +7,6 @@ import '@nadohq/trigger-client';
7
7
  import 'viem';
8
8
 
9
9
  declare class PerpExecuteAPI extends BaseNadoAPI {
10
- settlePnl(_params: SettlePnlParams): void;
11
10
  }
12
11
 
13
12
  export { PerpExecuteAPI };
@@ -1,5 +1,5 @@
1
- import { SettlePnlParams } from '@nadohq/contracts';
2
1
  import { BaseNadoAPI } from '../base.js';
2
+ import '@nadohq/shared';
3
3
  import '../../context.js';
4
4
  import '@nadohq/engine-client';
5
5
  import '@nadohq/indexer-client';
@@ -7,7 +7,6 @@ import '@nadohq/trigger-client';
7
7
  import 'viem';
8
8
 
9
9
  declare class PerpExecuteAPI extends BaseNadoAPI {
10
- settlePnl(_params: SettlePnlParams): void;
11
10
  }
12
11
 
13
12
  export { PerpExecuteAPI };
@@ -1,9 +1,6 @@
1
1
  // src/apis/perp/PerpExecuteAPI.ts
2
2
  import { BaseNadoAPI } from "../base.js";
3
3
  var PerpExecuteAPI = class extends BaseNadoAPI {
4
- settlePnl(_params) {
5
- throw Error("Not implemented");
6
- }
7
4
  };
8
5
  export {
9
6
  PerpExecuteAPI
@@ -1 +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":[]}
1
+ {"version":3,"sources":["../../../src/apis/perp/PerpExecuteAPI.ts"],"sourcesContent":["import { BaseNadoAPI } from '../base';\n\nexport class PerpExecuteAPI extends BaseNadoAPI {}\n"],"mappings":";AAAA,SAAS,mBAAmB;AAErB,IAAM,iBAAN,cAA6B,YAAY;AAAC;","names":[]}
@@ -1,7 +1,7 @@
1
1
  import * as _nadohq_indexer_client from '@nadohq/indexer-client';
2
2
  import { GetIndexerPerpPricesParams, GetIndexerMultiProductPerpPricesParams } from '@nadohq/indexer-client';
3
3
  import { BaseNadoAPI } from '../base.cjs';
4
- import '@nadohq/contracts';
4
+ import '@nadohq/shared';
5
5
  import '../../context.cjs';
6
6
  import '@nadohq/engine-client';
7
7
  import '@nadohq/trigger-client';
@@ -1,7 +1,7 @@
1
1
  import * as _nadohq_indexer_client from '@nadohq/indexer-client';
2
2
  import { GetIndexerPerpPricesParams, GetIndexerMultiProductPerpPricesParams } from '@nadohq/indexer-client';
3
3
  import { BaseNadoAPI } from '../base.js';
4
- import '@nadohq/contracts';
4
+ import '@nadohq/shared';
5
5
  import '../../context.js';
6
6
  import '@nadohq/engine-client';
7
7
  import '@nadohq/trigger-client';
@@ -1,8 +1,8 @@
1
1
  import * as ts_mixer_dist_types_types from 'ts-mixer/dist/types/types';
2
2
  import { PerpExecuteAPI } from './PerpExecuteAPI.cjs';
3
3
  import { PerpQueryAPI } from './PerpQueryAPI.cjs';
4
- import '@nadohq/contracts';
5
4
  import '../base.cjs';
5
+ import '@nadohq/shared';
6
6
  import '../../context.cjs';
7
7
  import '@nadohq/engine-client';
8
8
  import '@nadohq/indexer-client';
@@ -1,8 +1,8 @@
1
1
  import * as ts_mixer_dist_types_types from 'ts-mixer/dist/types/types';
2
2
  import { PerpExecuteAPI } from './PerpExecuteAPI.js';
3
3
  import { PerpQueryAPI } from './PerpQueryAPI.js';
4
- import '@nadohq/contracts';
5
4
  import '../base.js';
5
+ import '@nadohq/shared';
6
6
  import '../../context.js';
7
7
  import '@nadohq/engine-client';
8
8
  import '@nadohq/indexer-client';
@@ -23,8 +23,8 @@ __export(BaseSpotAPI_exports, {
23
23
  BaseSpotAPI: () => BaseSpotAPI
24
24
  });
25
25
  module.exports = __toCommonJS(BaseSpotAPI_exports);
26
- var import_contracts = require("@nadohq/contracts");
27
- var import_utils = require("@nadohq/utils");
26
+ var import_shared = require("@nadohq/shared");
27
+ var import_shared2 = require("@nadohq/shared");
28
28
  var import_viem = require("viem");
29
29
  var import_base = require("../base.cjs");
30
30
  var BaseSpotAPI = class extends import_base.BaseNadoAPI {
@@ -42,8 +42,8 @@ var BaseSpotAPI = class extends import_base.BaseNadoAPI {
42
42
  tokenAddress = params.tokenAddress;
43
43
  }
44
44
  return (0, import_viem.getContract)({
45
- abi: import_contracts.ERC20_ABI,
46
- address: (0, import_utils.getValidatedAddress)(tokenAddress),
45
+ abi: import_shared.ERC20_ABI,
46
+ address: (0, import_shared2.getValidatedAddress)(tokenAddress),
47
47
  client: this.context.walletClient ?? this.context.publicClient
48
48
  });
49
49
  }
@@ -1 +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":[]}
1
+ {"version":3,"sources":["../../../src/apis/spot/BaseSpotAPI.ts"],"sourcesContent":["import { ERC20_ABI } from '@nadohq/shared';\nimport { ContractInstance } from '@nadohq/shared';\nimport { getValidatedAddress } from '@nadohq/shared';\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,oBAA0B;AAE1B,IAAAA,iBAAoC;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,oCAAoB,YAAY;AAAA,MACzC,QAAQ,KAAK,QAAQ,gBAAgB,KAAK,QAAQ;AAAA,IACpD,CAAC;AAAA,EACH;AACF;","names":["import_shared"]}
@@ -1,4 +1,4 @@
1
- import { ContractInstance, ERC20_ABI } from '@nadohq/contracts';
1
+ import { ContractInstance, ERC20_ABI } from '@nadohq/shared';
2
2
  import { BaseNadoAPI } from '../base.cjs';
3
3
  import { ProductIdOrTokenAddress } from './types.cjs';
4
4
  import '../../context.cjs';
@@ -6,7 +6,6 @@ import '@nadohq/engine-client';
6
6
  import '@nadohq/indexer-client';
7
7
  import '@nadohq/trigger-client';
8
8
  import 'viem';
9
- import '@nadohq/utils';
10
9
  import '../types.cjs';
11
10
 
12
11
  declare class BaseSpotAPI extends BaseNadoAPI {
@@ -1,4 +1,4 @@
1
- import { ContractInstance, ERC20_ABI } from '@nadohq/contracts';
1
+ import { ContractInstance, ERC20_ABI } from '@nadohq/shared';
2
2
  import { BaseNadoAPI } from '../base.js';
3
3
  import { ProductIdOrTokenAddress } from './types.js';
4
4
  import '../../context.js';
@@ -6,7 +6,6 @@ import '@nadohq/engine-client';
6
6
  import '@nadohq/indexer-client';
7
7
  import '@nadohq/trigger-client';
8
8
  import 'viem';
9
- import '@nadohq/utils';
10
9
  import '../types.js';
11
10
 
12
11
  declare class BaseSpotAPI extends BaseNadoAPI {
@@ -1,6 +1,6 @@
1
1
  // src/apis/spot/BaseSpotAPI.ts
2
- import { ERC20_ABI } from "@nadohq/contracts";
3
- import { getValidatedAddress } from "@nadohq/utils";
2
+ import { ERC20_ABI } from "@nadohq/shared";
3
+ import { getValidatedAddress } from "@nadohq/shared";
4
4
  import { getContract } from "viem";
5
5
  import { BaseNadoAPI } from "../base.js";
6
6
  var BaseSpotAPI = class extends BaseNadoAPI {
@@ -1 +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":[]}
1
+ {"version":3,"sources":["../../../src/apis/spot/BaseSpotAPI.ts"],"sourcesContent":["import { ERC20_ABI } from '@nadohq/shared';\nimport { ContractInstance } from '@nadohq/shared';\nimport { getValidatedAddress } from '@nadohq/shared';\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,SAAS,iBAAiB;AAE1B,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":[]}
@@ -23,12 +23,12 @@ __export(SpotExecuteAPI_exports, {
23
23
  SpotExecuteAPI: () => SpotExecuteAPI
24
24
  });
25
25
  module.exports = __toCommonJS(SpotExecuteAPI_exports);
26
- var import_contracts = require("@nadohq/contracts");
27
- var import_utils = require("@nadohq/utils");
26
+ var import_shared = require("@nadohq/shared");
27
+ var import_shared2 = require("@nadohq/shared");
28
28
  var import_BaseSpotAPI = require("./BaseSpotAPI.cjs");
29
29
  var SpotExecuteAPI = class extends import_BaseSpotAPI.BaseSpotAPI {
30
30
  async deposit(params) {
31
- return (0, import_contracts.depositCollateral)({
31
+ return (0, import_shared.depositCollateral)({
32
32
  endpoint: this.context.contracts.endpoint,
33
33
  subaccountName: params.subaccountName,
34
34
  productId: params.productId,
@@ -46,12 +46,12 @@ var SpotExecuteAPI = class extends import_BaseSpotAPI.BaseSpotAPI {
46
46
  }
47
47
  async approveAllowance(params) {
48
48
  const tokenContract = await this.getTokenContractForProduct(params);
49
- if (!(0, import_contracts.isWriteableContract)(tokenContract)) {
49
+ if (!(0, import_shared.isWriteableContract)(tokenContract)) {
50
50
  throw new Error(
51
51
  "Token contract does not permit writes. Is a wallet client provided?"
52
52
  );
53
53
  }
54
- return (0, import_contracts.approveDepositAllowance)({
54
+ return (0, import_shared.approveDepositAllowance)({
55
55
  amount: params.amount,
56
56
  endpoint: this.context.contracts.endpoint,
57
57
  tokenContract
@@ -88,16 +88,16 @@ var SpotExecuteAPI = class extends import_BaseSpotAPI.BaseSpotAPI {
88
88
  }
89
89
  async _mintMockERC20(params) {
90
90
  if (!this.context.walletClient) {
91
- throw new import_utils.WalletNotProvidedError();
91
+ throw new import_shared2.WalletNotProvidedError();
92
92
  }
93
93
  const config = await this.context.contracts.spotEngine.read.getConfig([
94
94
  params.productId
95
95
  ]);
96
96
  return this.context.walletClient.writeContract({
97
- abi: import_contracts.MOCK_ERC20_ABI,
97
+ abi: import_shared.MOCK_ERC20_ABI,
98
98
  address: config.token,
99
99
  functionName: "mint",
100
- args: [this.getWalletClientAddress(), (0, import_utils.toBigInt)(params.amount)]
100
+ args: [this.getWalletClientAddress(), (0, import_shared2.toBigInt)(params.amount)]
101
101
  });
102
102
  }
103
103
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/apis/spot/SpotExecuteAPI.ts"],"sourcesContent":["import {\n approveDepositAllowance,\n depositCollateral,\n DepositCollateralParams,\n isWriteableContract,\n MintMockERC20Params,\n MOCK_ERC20_ABI,\n} from '@nadohq/contracts';\nimport { toBigInt, WalletNotProvidedError } from '@nadohq/utils';\nimport { BaseSpotAPI } from './BaseSpotAPI';\nimport {\n ApproveAllowanceParams,\n BurnNlpParams,\n MintNlpParams,\n TransferQuoteParams,\n WithdrawCollateralParams,\n} from './types';\n\nexport class SpotExecuteAPI extends BaseSpotAPI {\n async deposit(params: DepositCollateralParams) {\n return depositCollateral({\n endpoint: this.context.contracts.endpoint,\n subaccountName: params.subaccountName,\n productId: params.productId,\n amount: params.amount,\n referralCode: params.referralCode,\n });\n }\n\n async withdraw(params: WithdrawCollateralParams) {\n return this.context.engineClient.withdrawCollateral({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n });\n }\n\n async approveAllowance(params: ApproveAllowanceParams) {\n const tokenContract = await this.getTokenContractForProduct(params);\n if (!isWriteableContract(tokenContract)) {\n throw new Error(\n 'Token contract does not permit writes. Is a wallet client provided?',\n );\n }\n\n return approveDepositAllowance({\n amount: params.amount,\n endpoint: this.context.contracts.endpoint,\n tokenContract,\n });\n }\n\n /**\n * Transfers quote between subaccounts under the same wallet.\n *\n * @param params\n */\n async transferQuote(params: TransferQuoteParams) {\n return this.context.engineClient.transferQuote({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n });\n }\n\n async mintNlp(params: MintNlpParams) {\n return this.context.engineClient.mintNlp({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n });\n }\n\n async burnNlp(params: BurnNlpParams) {\n return this.context.engineClient.burnNlp({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n });\n }\n\n async _mintMockERC20(params: MintMockERC20Params) {\n if (!this.context.walletClient) {\n throw new WalletNotProvidedError();\n }\n\n const config = await this.context.contracts.spotEngine.read.getConfig([\n params.productId,\n ]);\n\n return this.context.walletClient.writeContract({\n abi: MOCK_ERC20_ABI,\n address: config.token,\n functionName: 'mint',\n args: [this.getWalletClientAddress(), toBigInt(params.amount)],\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAOO;AACP,mBAAiD;AACjD,yBAA4B;AASrB,IAAM,iBAAN,cAA6B,+BAAY;AAAA,EAC9C,MAAM,QAAQ,QAAiC;AAC7C,eAAO,oCAAkB;AAAA,MACvB,UAAU,KAAK,QAAQ,UAAU;AAAA,MACjC,gBAAgB,OAAO;AAAA,MACvB,WAAW,OAAO;AAAA,MAClB,QAAQ,OAAO;AAAA,MACf,cAAc,OAAO;AAAA,IACvB,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,SAAS,QAAkC;AAC/C,WAAO,KAAK,QAAQ,aAAa,mBAAmB;AAAA,MAClD,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,SAAS,KAAK,+BAA+B,MAAM;AAAA,MACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,IACjE,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,iBAAiB,QAAgC;AACrD,UAAM,gBAAgB,MAAM,KAAK,2BAA2B,MAAM;AAClE,QAAI,KAAC,sCAAoB,aAAa,GAAG;AACvC,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAEA,eAAO,0CAAwB;AAAA,MAC7B,QAAQ,OAAO;AAAA,MACf,UAAU,KAAK,QAAQ,UAAU;AAAA,MACjC;AAAA,IACF,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,cAAc,QAA6B;AAC/C,WAAO,KAAK,QAAQ,aAAa,cAAc;AAAA,MAC7C,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,MAC/D,SAAS,KAAK,+BAA+B,MAAM;AAAA,IACrD,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,QAAQ,QAAuB;AACnC,WAAO,KAAK,QAAQ,aAAa,QAAQ;AAAA,MACvC,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,SAAS,KAAK,+BAA+B,MAAM;AAAA,MACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,IACjE,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,QAAQ,QAAuB;AACnC,WAAO,KAAK,QAAQ,aAAa,QAAQ;AAAA,MACvC,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,SAAS,KAAK,+BAA+B,MAAM;AAAA,MACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,IACjE,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,eAAe,QAA6B;AAChD,QAAI,CAAC,KAAK,QAAQ,cAAc;AAC9B,YAAM,IAAI,oCAAuB;AAAA,IACnC;AAEA,UAAM,SAAS,MAAM,KAAK,QAAQ,UAAU,WAAW,KAAK,UAAU;AAAA,MACpE,OAAO;AAAA,IACT,CAAC;AAED,WAAO,KAAK,QAAQ,aAAa,cAAc;AAAA,MAC7C,KAAK;AAAA,MACL,SAAS,OAAO;AAAA,MAChB,cAAc;AAAA,MACd,MAAM,CAAC,KAAK,uBAAuB,OAAG,uBAAS,OAAO,MAAM,CAAC;AAAA,IAC/D,CAAC;AAAA,EACH;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/apis/spot/SpotExecuteAPI.ts"],"sourcesContent":["import {\n approveDepositAllowance,\n depositCollateral,\n DepositCollateralParams,\n isWriteableContract,\n MOCK_ERC20_ABI,\n} from '@nadohq/shared';\nimport { toBigInt, WalletNotProvidedError } from '@nadohq/shared';\nimport { BaseSpotAPI } from './BaseSpotAPI';\nimport {\n ApproveAllowanceParams,\n BurnNlpParams,\n MintMockERC20Params,\n MintNlpParams,\n TransferQuoteParams,\n WithdrawCollateralParams,\n} from './types';\n\nexport class SpotExecuteAPI extends BaseSpotAPI {\n async deposit(params: DepositCollateralParams) {\n return depositCollateral({\n endpoint: this.context.contracts.endpoint,\n subaccountName: params.subaccountName,\n productId: params.productId,\n amount: params.amount,\n referralCode: params.referralCode,\n });\n }\n\n async withdraw(params: WithdrawCollateralParams) {\n return this.context.engineClient.withdrawCollateral({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n });\n }\n\n async approveAllowance(params: ApproveAllowanceParams) {\n const tokenContract = await this.getTokenContractForProduct(params);\n if (!isWriteableContract(tokenContract)) {\n throw new Error(\n 'Token contract does not permit writes. Is a wallet client provided?',\n );\n }\n\n return approveDepositAllowance({\n amount: params.amount,\n endpoint: this.context.contracts.endpoint,\n tokenContract,\n });\n }\n\n /**\n * Transfers quote between subaccounts under the same wallet.\n *\n * @param params\n */\n async transferQuote(params: TransferQuoteParams) {\n return this.context.engineClient.transferQuote({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n });\n }\n\n async mintNlp(params: MintNlpParams) {\n return this.context.engineClient.mintNlp({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n });\n }\n\n async burnNlp(params: BurnNlpParams) {\n return this.context.engineClient.burnNlp({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n });\n }\n\n async _mintMockERC20(params: MintMockERC20Params) {\n if (!this.context.walletClient) {\n throw new WalletNotProvidedError();\n }\n\n const config = await this.context.contracts.spotEngine.read.getConfig([\n params.productId,\n ]);\n\n return this.context.walletClient.writeContract({\n abi: MOCK_ERC20_ABI,\n address: config.token,\n functionName: 'mint',\n args: [this.getWalletClientAddress(), toBigInt(params.amount)],\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAMO;AACP,IAAAA,iBAAiD;AACjD,yBAA4B;AAUrB,IAAM,iBAAN,cAA6B,+BAAY;AAAA,EAC9C,MAAM,QAAQ,QAAiC;AAC7C,eAAO,iCAAkB;AAAA,MACvB,UAAU,KAAK,QAAQ,UAAU;AAAA,MACjC,gBAAgB,OAAO;AAAA,MACvB,WAAW,OAAO;AAAA,MAClB,QAAQ,OAAO;AAAA,MACf,cAAc,OAAO;AAAA,IACvB,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,SAAS,QAAkC;AAC/C,WAAO,KAAK,QAAQ,aAAa,mBAAmB;AAAA,MAClD,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,SAAS,KAAK,+BAA+B,MAAM;AAAA,MACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,IACjE,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,iBAAiB,QAAgC;AACrD,UAAM,gBAAgB,MAAM,KAAK,2BAA2B,MAAM;AAClE,QAAI,KAAC,mCAAoB,aAAa,GAAG;AACvC,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAEA,eAAO,uCAAwB;AAAA,MAC7B,QAAQ,OAAO;AAAA,MACf,UAAU,KAAK,QAAQ,UAAU;AAAA,MACjC;AAAA,IACF,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,cAAc,QAA6B;AAC/C,WAAO,KAAK,QAAQ,aAAa,cAAc;AAAA,MAC7C,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,MAC/D,SAAS,KAAK,+BAA+B,MAAM;AAAA,IACrD,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,QAAQ,QAAuB;AACnC,WAAO,KAAK,QAAQ,aAAa,QAAQ;AAAA,MACvC,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,SAAS,KAAK,+BAA+B,MAAM;AAAA,MACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,IACjE,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,QAAQ,QAAuB;AACnC,WAAO,KAAK,QAAQ,aAAa,QAAQ;AAAA,MACvC,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,SAAS,KAAK,+BAA+B,MAAM;AAAA,MACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,IACjE,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,eAAe,QAA6B;AAChD,QAAI,CAAC,KAAK,QAAQ,cAAc;AAC9B,YAAM,IAAI,sCAAuB;AAAA,IACnC;AAEA,UAAM,SAAS,MAAM,KAAK,QAAQ,UAAU,WAAW,KAAK,UAAU;AAAA,MACpE,OAAO;AAAA,IACT,CAAC;AAED,WAAO,KAAK,QAAQ,aAAa,cAAc;AAAA,MAC7C,KAAK;AAAA,MACL,SAAS,OAAO;AAAA,MAChB,cAAc;AAAA,MACd,MAAM,CAAC,KAAK,uBAAuB,OAAG,yBAAS,OAAO,MAAM,CAAC;AAAA,IAC/D,CAAC;AAAA,EACH;AACF;","names":["import_shared"]}
@@ -1,13 +1,12 @@
1
1
  import * as _nadohq_engine_client from '@nadohq/engine-client';
2
- import { DepositCollateralParams, MintMockERC20Params } from '@nadohq/contracts';
2
+ import { DepositCollateralParams } from '@nadohq/shared';
3
3
  import { BaseSpotAPI } from './BaseSpotAPI.cjs';
4
- import { WithdrawCollateralParams, ApproveAllowanceParams, TransferQuoteParams, MintNlpParams, BurnNlpParams } from './types.cjs';
4
+ import { WithdrawCollateralParams, ApproveAllowanceParams, TransferQuoteParams, MintNlpParams, BurnNlpParams, MintMockERC20Params } from './types.cjs';
5
5
  import '../base.cjs';
6
6
  import '../../context.cjs';
7
7
  import '@nadohq/indexer-client';
8
8
  import '@nadohq/trigger-client';
9
9
  import 'viem';
10
- import '@nadohq/utils';
11
10
  import '../types.cjs';
12
11
 
13
12
  declare class SpotExecuteAPI extends BaseSpotAPI {
@@ -1,13 +1,12 @@
1
1
  import * as _nadohq_engine_client from '@nadohq/engine-client';
2
- import { DepositCollateralParams, MintMockERC20Params } from '@nadohq/contracts';
2
+ import { DepositCollateralParams } from '@nadohq/shared';
3
3
  import { BaseSpotAPI } from './BaseSpotAPI.js';
4
- import { WithdrawCollateralParams, ApproveAllowanceParams, TransferQuoteParams, MintNlpParams, BurnNlpParams } from './types.js';
4
+ import { WithdrawCollateralParams, ApproveAllowanceParams, TransferQuoteParams, MintNlpParams, BurnNlpParams, MintMockERC20Params } from './types.js';
5
5
  import '../base.js';
6
6
  import '../../context.js';
7
7
  import '@nadohq/indexer-client';
8
8
  import '@nadohq/trigger-client';
9
9
  import 'viem';
10
- import '@nadohq/utils';
11
10
  import '../types.js';
12
11
 
13
12
  declare class SpotExecuteAPI extends BaseSpotAPI {
@@ -4,8 +4,8 @@ import {
4
4
  depositCollateral,
5
5
  isWriteableContract,
6
6
  MOCK_ERC20_ABI
7
- } from "@nadohq/contracts";
8
- import { toBigInt, WalletNotProvidedError } from "@nadohq/utils";
7
+ } from "@nadohq/shared";
8
+ import { toBigInt, WalletNotProvidedError } from "@nadohq/shared";
9
9
  import { BaseSpotAPI } from "./BaseSpotAPI.js";
10
10
  var SpotExecuteAPI = class extends BaseSpotAPI {
11
11
  async deposit(params) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/apis/spot/SpotExecuteAPI.ts"],"sourcesContent":["import {\n approveDepositAllowance,\n depositCollateral,\n DepositCollateralParams,\n isWriteableContract,\n MintMockERC20Params,\n MOCK_ERC20_ABI,\n} from '@nadohq/contracts';\nimport { toBigInt, WalletNotProvidedError } from '@nadohq/utils';\nimport { BaseSpotAPI } from './BaseSpotAPI';\nimport {\n ApproveAllowanceParams,\n BurnNlpParams,\n MintNlpParams,\n TransferQuoteParams,\n WithdrawCollateralParams,\n} from './types';\n\nexport class SpotExecuteAPI extends BaseSpotAPI {\n async deposit(params: DepositCollateralParams) {\n return depositCollateral({\n endpoint: this.context.contracts.endpoint,\n subaccountName: params.subaccountName,\n productId: params.productId,\n amount: params.amount,\n referralCode: params.referralCode,\n });\n }\n\n async withdraw(params: WithdrawCollateralParams) {\n return this.context.engineClient.withdrawCollateral({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n });\n }\n\n async approveAllowance(params: ApproveAllowanceParams) {\n const tokenContract = await this.getTokenContractForProduct(params);\n if (!isWriteableContract(tokenContract)) {\n throw new Error(\n 'Token contract does not permit writes. Is a wallet client provided?',\n );\n }\n\n return approveDepositAllowance({\n amount: params.amount,\n endpoint: this.context.contracts.endpoint,\n tokenContract,\n });\n }\n\n /**\n * Transfers quote between subaccounts under the same wallet.\n *\n * @param params\n */\n async transferQuote(params: TransferQuoteParams) {\n return this.context.engineClient.transferQuote({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n });\n }\n\n async mintNlp(params: MintNlpParams) {\n return this.context.engineClient.mintNlp({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n });\n }\n\n async burnNlp(params: BurnNlpParams) {\n return this.context.engineClient.burnNlp({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n });\n }\n\n async _mintMockERC20(params: MintMockERC20Params) {\n if (!this.context.walletClient) {\n throw new WalletNotProvidedError();\n }\n\n const config = await this.context.contracts.spotEngine.read.getConfig([\n params.productId,\n ]);\n\n return this.context.walletClient.writeContract({\n abi: MOCK_ERC20_ABI,\n address: config.token,\n functionName: 'mint',\n args: [this.getWalletClientAddress(), toBigInt(params.amount)],\n });\n }\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EAEA;AAAA,EAEA;AAAA,OACK;AACP,SAAS,UAAU,8BAA8B;AACjD,SAAS,mBAAmB;AASrB,IAAM,iBAAN,cAA6B,YAAY;AAAA,EAC9C,MAAM,QAAQ,QAAiC;AAC7C,WAAO,kBAAkB;AAAA,MACvB,UAAU,KAAK,QAAQ,UAAU;AAAA,MACjC,gBAAgB,OAAO;AAAA,MACvB,WAAW,OAAO;AAAA,MAClB,QAAQ,OAAO;AAAA,MACf,cAAc,OAAO;AAAA,IACvB,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,SAAS,QAAkC;AAC/C,WAAO,KAAK,QAAQ,aAAa,mBAAmB;AAAA,MAClD,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,SAAS,KAAK,+BAA+B,MAAM;AAAA,MACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,IACjE,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,iBAAiB,QAAgC;AACrD,UAAM,gBAAgB,MAAM,KAAK,2BAA2B,MAAM;AAClE,QAAI,CAAC,oBAAoB,aAAa,GAAG;AACvC,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAEA,WAAO,wBAAwB;AAAA,MAC7B,QAAQ,OAAO;AAAA,MACf,UAAU,KAAK,QAAQ,UAAU;AAAA,MACjC;AAAA,IACF,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,cAAc,QAA6B;AAC/C,WAAO,KAAK,QAAQ,aAAa,cAAc;AAAA,MAC7C,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,MAC/D,SAAS,KAAK,+BAA+B,MAAM;AAAA,IACrD,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,QAAQ,QAAuB;AACnC,WAAO,KAAK,QAAQ,aAAa,QAAQ;AAAA,MACvC,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,SAAS,KAAK,+BAA+B,MAAM;AAAA,MACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,IACjE,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,QAAQ,QAAuB;AACnC,WAAO,KAAK,QAAQ,aAAa,QAAQ;AAAA,MACvC,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,SAAS,KAAK,+BAA+B,MAAM;AAAA,MACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,IACjE,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,eAAe,QAA6B;AAChD,QAAI,CAAC,KAAK,QAAQ,cAAc;AAC9B,YAAM,IAAI,uBAAuB;AAAA,IACnC;AAEA,UAAM,SAAS,MAAM,KAAK,QAAQ,UAAU,WAAW,KAAK,UAAU;AAAA,MACpE,OAAO;AAAA,IACT,CAAC;AAED,WAAO,KAAK,QAAQ,aAAa,cAAc;AAAA,MAC7C,KAAK;AAAA,MACL,SAAS,OAAO;AAAA,MAChB,cAAc;AAAA,MACd,MAAM,CAAC,KAAK,uBAAuB,GAAG,SAAS,OAAO,MAAM,CAAC;AAAA,IAC/D,CAAC;AAAA,EACH;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/apis/spot/SpotExecuteAPI.ts"],"sourcesContent":["import {\n approveDepositAllowance,\n depositCollateral,\n DepositCollateralParams,\n isWriteableContract,\n MOCK_ERC20_ABI,\n} from '@nadohq/shared';\nimport { toBigInt, WalletNotProvidedError } from '@nadohq/shared';\nimport { BaseSpotAPI } from './BaseSpotAPI';\nimport {\n ApproveAllowanceParams,\n BurnNlpParams,\n MintMockERC20Params,\n MintNlpParams,\n TransferQuoteParams,\n WithdrawCollateralParams,\n} from './types';\n\nexport class SpotExecuteAPI extends BaseSpotAPI {\n async deposit(params: DepositCollateralParams) {\n return depositCollateral({\n endpoint: this.context.contracts.endpoint,\n subaccountName: params.subaccountName,\n productId: params.productId,\n amount: params.amount,\n referralCode: params.referralCode,\n });\n }\n\n async withdraw(params: WithdrawCollateralParams) {\n return this.context.engineClient.withdrawCollateral({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n });\n }\n\n async approveAllowance(params: ApproveAllowanceParams) {\n const tokenContract = await this.getTokenContractForProduct(params);\n if (!isWriteableContract(tokenContract)) {\n throw new Error(\n 'Token contract does not permit writes. Is a wallet client provided?',\n );\n }\n\n return approveDepositAllowance({\n amount: params.amount,\n endpoint: this.context.contracts.endpoint,\n tokenContract,\n });\n }\n\n /**\n * Transfers quote between subaccounts under the same wallet.\n *\n * @param params\n */\n async transferQuote(params: TransferQuoteParams) {\n return this.context.engineClient.transferQuote({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n });\n }\n\n async mintNlp(params: MintNlpParams) {\n return this.context.engineClient.mintNlp({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n });\n }\n\n async burnNlp(params: BurnNlpParams) {\n return this.context.engineClient.burnNlp({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n });\n }\n\n async _mintMockERC20(params: MintMockERC20Params) {\n if (!this.context.walletClient) {\n throw new WalletNotProvidedError();\n }\n\n const config = await this.context.contracts.spotEngine.read.getConfig([\n params.productId,\n ]);\n\n return this.context.walletClient.writeContract({\n abi: MOCK_ERC20_ABI,\n address: config.token,\n functionName: 'mint',\n args: [this.getWalletClientAddress(), toBigInt(params.amount)],\n });\n }\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AACP,SAAS,UAAU,8BAA8B;AACjD,SAAS,mBAAmB;AAUrB,IAAM,iBAAN,cAA6B,YAAY;AAAA,EAC9C,MAAM,QAAQ,QAAiC;AAC7C,WAAO,kBAAkB;AAAA,MACvB,UAAU,KAAK,QAAQ,UAAU;AAAA,MACjC,gBAAgB,OAAO;AAAA,MACvB,WAAW,OAAO;AAAA,MAClB,QAAQ,OAAO;AAAA,MACf,cAAc,OAAO;AAAA,IACvB,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,SAAS,QAAkC;AAC/C,WAAO,KAAK,QAAQ,aAAa,mBAAmB;AAAA,MAClD,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,SAAS,KAAK,+BAA+B,MAAM;AAAA,MACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,IACjE,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,iBAAiB,QAAgC;AACrD,UAAM,gBAAgB,MAAM,KAAK,2BAA2B,MAAM;AAClE,QAAI,CAAC,oBAAoB,aAAa,GAAG;AACvC,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAEA,WAAO,wBAAwB;AAAA,MAC7B,QAAQ,OAAO;AAAA,MACf,UAAU,KAAK,QAAQ,UAAU;AAAA,MACjC;AAAA,IACF,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,cAAc,QAA6B;AAC/C,WAAO,KAAK,QAAQ,aAAa,cAAc;AAAA,MAC7C,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,MAC/D,SAAS,KAAK,+BAA+B,MAAM;AAAA,IACrD,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,QAAQ,QAAuB;AACnC,WAAO,KAAK,QAAQ,aAAa,QAAQ;AAAA,MACvC,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,SAAS,KAAK,+BAA+B,MAAM;AAAA,MACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,IACjE,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,QAAQ,QAAuB;AACnC,WAAO,KAAK,QAAQ,aAAa,QAAQ;AAAA,MACvC,GAAG;AAAA,MACH,iBAAiB,KAAK,2BAA2B,MAAM;AAAA,MACvD,SAAS,KAAK,+BAA+B,MAAM;AAAA,MACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,IACjE,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,eAAe,QAA6B;AAChD,QAAI,CAAC,KAAK,QAAQ,cAAc;AAC9B,YAAM,IAAI,uBAAuB;AAAA,IACnC;AAEA,UAAM,SAAS,MAAM,KAAK,QAAQ,UAAU,WAAW,KAAK,UAAU;AAAA,MACpE,OAAO;AAAA,IACT,CAAC;AAED,WAAO,KAAK,QAAQ,aAAa,cAAc;AAAA,MAC7C,KAAK;AAAA,MACL,SAAS,OAAO;AAAA,MAChB,cAAc;AAAA,MACd,MAAM,CAAC,KAAK,uBAAuB,GAAG,SAAS,OAAO,MAAM,CAAC;AAAA,IAC/D,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -23,7 +23,7 @@ __export(SpotQueryAPI_exports, {
23
23
  SpotQueryAPI: () => SpotQueryAPI
24
24
  });
25
25
  module.exports = __toCommonJS(SpotQueryAPI_exports);
26
- var import_utils = require("@nadohq/utils");
26
+ var import_shared = require("@nadohq/shared");
27
27
  var import_BaseSpotAPI = require("./BaseSpotAPI.cjs");
28
28
  var SpotQueryAPI = class extends import_BaseSpotAPI.BaseSpotAPI {
29
29
  /**
@@ -49,7 +49,7 @@ var SpotQueryAPI = class extends import_BaseSpotAPI.BaseSpotAPI {
49
49
  ...rest
50
50
  }) {
51
51
  const token = await this.getTokenContractForProduct(rest);
52
- return token.read.balanceOf([(0, import_utils.getValidatedAddress)(address)]);
52
+ return token.read.balanceOf([(0, import_shared.getValidatedAddress)(address)]);
53
53
  }
54
54
  /**
55
55
  * Helper to get current token allowance
@@ -59,9 +59,9 @@ var SpotQueryAPI = class extends import_BaseSpotAPI.BaseSpotAPI {
59
59
  ...rest
60
60
  }) {
61
61
  const token = await this.getTokenContractForProduct(rest);
62
- return (0, import_utils.toBigDecimal)(
62
+ return (0, import_shared.toBigDecimal)(
63
63
  await token.read.allowance([
64
- (0, import_utils.getValidatedAddress)(address),
64
+ (0, import_shared.getValidatedAddress)(address),
65
65
  this.getEndpointAddress()
66
66
  ])
67
67
  );
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/apis/spot/SpotQueryAPI.ts"],"sourcesContent":["import {\n GetEngineMaxMintNlpAmountParams,\n GetEngineMaxWithdrawableParams,\n} from '@nadohq/engine-client';\nimport { BigDecimal, getValidatedAddress, toBigDecimal } from '@nadohq/utils';\nimport { BaseSpotAPI } from './BaseSpotAPI';\nimport { GetTokenAllowanceParams, GetTokenWalletBalanceParams } from './types';\n\nexport class SpotQueryAPI extends BaseSpotAPI {\n /**\n * Gets the estimated max withdrawable amount for a product\n * @param params\n */\n async getMaxWithdrawable(params: GetEngineMaxWithdrawableParams) {\n return this.context.engineClient.getMaxWithdrawable(params);\n }\n\n /**\n * Queries engine to determine maximum quote amount for minting NLP.\n *\n * @param params\n */\n async getMaxMintNlpAmount(params: GetEngineMaxMintNlpAmountParams) {\n return this.context.engineClient.getMaxMintNlpAmount(params);\n }\n\n /**\n * Helper to get current token balance in the user's wallet (i.e. not in a Nado subaccount)\n */\n async getTokenWalletBalance({\n address,\n ...rest\n }: GetTokenWalletBalanceParams): Promise<bigint> {\n const token = await this.getTokenContractForProduct(rest);\n return token.read.balanceOf([getValidatedAddress(address)]);\n }\n\n /**\n * Helper to get current token allowance\n */\n async getTokenAllowance({\n address,\n ...rest\n }: GetTokenAllowanceParams): Promise<BigDecimal> {\n const token = await this.getTokenContractForProduct(rest);\n return toBigDecimal(\n await token.read.allowance([\n getValidatedAddress(address),\n this.getEndpointAddress(),\n ]),\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,mBAA8D;AAC9D,yBAA4B;AAGrB,IAAM,eAAN,cAA2B,+BAAY;AAAA;AAAA;AAAA;AAAA;AAAA,EAK5C,MAAM,mBAAmB,QAAwC;AAC/D,WAAO,KAAK,QAAQ,aAAa,mBAAmB,MAAM;AAAA,EAC5D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,oBAAoB,QAAyC;AACjE,WAAO,KAAK,QAAQ,aAAa,oBAAoB,MAAM;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,sBAAsB;AAAA,IAC1B;AAAA,IACA,GAAG;AAAA,EACL,GAAiD;AAC/C,UAAM,QAAQ,MAAM,KAAK,2BAA2B,IAAI;AACxD,WAAO,MAAM,KAAK,UAAU,KAAC,kCAAoB,OAAO,CAAC,CAAC;AAAA,EAC5D;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,kBAAkB;AAAA,IACtB;AAAA,IACA,GAAG;AAAA,EACL,GAAiD;AAC/C,UAAM,QAAQ,MAAM,KAAK,2BAA2B,IAAI;AACxD,eAAO;AAAA,MACL,MAAM,MAAM,KAAK,UAAU;AAAA,YACzB,kCAAoB,OAAO;AAAA,QAC3B,KAAK,mBAAmB;AAAA,MAC1B,CAAC;AAAA,IACH;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/apis/spot/SpotQueryAPI.ts"],"sourcesContent":["import {\n GetEngineMaxMintNlpAmountParams,\n GetEngineMaxWithdrawableParams,\n} from '@nadohq/engine-client';\nimport { BigDecimal, getValidatedAddress, toBigDecimal } from '@nadohq/shared';\nimport { BaseSpotAPI } from './BaseSpotAPI';\nimport { GetTokenAllowanceParams, GetTokenWalletBalanceParams } from './types';\n\nexport class SpotQueryAPI extends BaseSpotAPI {\n /**\n * Gets the estimated max withdrawable amount for a product\n * @param params\n */\n async getMaxWithdrawable(params: GetEngineMaxWithdrawableParams) {\n return this.context.engineClient.getMaxWithdrawable(params);\n }\n\n /**\n * Queries engine to determine maximum quote amount for minting NLP.\n *\n * @param params\n */\n async getMaxMintNlpAmount(params: GetEngineMaxMintNlpAmountParams) {\n return this.context.engineClient.getMaxMintNlpAmount(params);\n }\n\n /**\n * Helper to get current token balance in the user's wallet (i.e. not in a Nado subaccount)\n */\n async getTokenWalletBalance({\n address,\n ...rest\n }: GetTokenWalletBalanceParams): Promise<bigint> {\n const token = await this.getTokenContractForProduct(rest);\n return token.read.balanceOf([getValidatedAddress(address)]);\n }\n\n /**\n * Helper to get current token allowance\n */\n async getTokenAllowance({\n address,\n ...rest\n }: GetTokenAllowanceParams): Promise<BigDecimal> {\n const token = await this.getTokenContractForProduct(rest);\n return toBigDecimal(\n await token.read.allowance([\n getValidatedAddress(address),\n this.getEndpointAddress(),\n ]),\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,oBAA8D;AAC9D,yBAA4B;AAGrB,IAAM,eAAN,cAA2B,+BAAY;AAAA;AAAA;AAAA;AAAA;AAAA,EAK5C,MAAM,mBAAmB,QAAwC;AAC/D,WAAO,KAAK,QAAQ,aAAa,mBAAmB,MAAM;AAAA,EAC5D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,oBAAoB,QAAyC;AACjE,WAAO,KAAK,QAAQ,aAAa,oBAAoB,MAAM;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,sBAAsB;AAAA,IAC1B;AAAA,IACA,GAAG;AAAA,EACL,GAAiD;AAC/C,UAAM,QAAQ,MAAM,KAAK,2BAA2B,IAAI;AACxD,WAAO,MAAM,KAAK,UAAU,KAAC,mCAAoB,OAAO,CAAC,CAAC;AAAA,EAC5D;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,kBAAkB;AAAA,IACtB;AAAA,IACA,GAAG;AAAA,EACL,GAAiD;AAC/C,UAAM,QAAQ,MAAM,KAAK,2BAA2B,IAAI;AACxD,eAAO;AAAA,MACL,MAAM,MAAM,KAAK,UAAU;AAAA,YACzB,mCAAoB,OAAO;AAAA,QAC3B,KAAK,mBAAmB;AAAA,MAC1B,CAAC;AAAA,IACH;AAAA,EACF;AACF;","names":[]}
@@ -1,8 +1,7 @@
1
1
  import { GetEngineMaxWithdrawableParams, GetEngineMaxMintNlpAmountParams } from '@nadohq/engine-client';
2
- import { BigDecimal } from '@nadohq/utils';
2
+ import { BigDecimal } from '@nadohq/shared';
3
3
  import { BaseSpotAPI } from './BaseSpotAPI.cjs';
4
4
  import { GetTokenWalletBalanceParams, GetTokenAllowanceParams } from './types.cjs';
5
- import '@nadohq/contracts';
6
5
  import '../base.cjs';
7
6
  import '../../context.cjs';
8
7
  import '@nadohq/indexer-client';
@@ -1,8 +1,7 @@
1
1
  import { GetEngineMaxWithdrawableParams, GetEngineMaxMintNlpAmountParams } from '@nadohq/engine-client';
2
- import { BigDecimal } from '@nadohq/utils';
2
+ import { BigDecimal } from '@nadohq/shared';
3
3
  import { BaseSpotAPI } from './BaseSpotAPI.js';
4
4
  import { GetTokenWalletBalanceParams, GetTokenAllowanceParams } from './types.js';
5
- import '@nadohq/contracts';
6
5
  import '../base.js';
7
6
  import '../../context.js';
8
7
  import '@nadohq/indexer-client';
@@ -1,5 +1,5 @@
1
1
  // src/apis/spot/SpotQueryAPI.ts
2
- import { getValidatedAddress, toBigDecimal } from "@nadohq/utils";
2
+ import { getValidatedAddress, toBigDecimal } from "@nadohq/shared";
3
3
  import { BaseSpotAPI } from "./BaseSpotAPI.js";
4
4
  var SpotQueryAPI = class extends BaseSpotAPI {
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/apis/spot/SpotQueryAPI.ts"],"sourcesContent":["import {\n GetEngineMaxMintNlpAmountParams,\n GetEngineMaxWithdrawableParams,\n} from '@nadohq/engine-client';\nimport { BigDecimal, getValidatedAddress, toBigDecimal } from '@nadohq/utils';\nimport { BaseSpotAPI } from './BaseSpotAPI';\nimport { GetTokenAllowanceParams, GetTokenWalletBalanceParams } from './types';\n\nexport class SpotQueryAPI extends BaseSpotAPI {\n /**\n * Gets the estimated max withdrawable amount for a product\n * @param params\n */\n async getMaxWithdrawable(params: GetEngineMaxWithdrawableParams) {\n return this.context.engineClient.getMaxWithdrawable(params);\n }\n\n /**\n * Queries engine to determine maximum quote amount for minting NLP.\n *\n * @param params\n */\n async getMaxMintNlpAmount(params: GetEngineMaxMintNlpAmountParams) {\n return this.context.engineClient.getMaxMintNlpAmount(params);\n }\n\n /**\n * Helper to get current token balance in the user's wallet (i.e. not in a Nado subaccount)\n */\n async getTokenWalletBalance({\n address,\n ...rest\n }: GetTokenWalletBalanceParams): Promise<bigint> {\n const token = await this.getTokenContractForProduct(rest);\n return token.read.balanceOf([getValidatedAddress(address)]);\n }\n\n /**\n * Helper to get current token allowance\n */\n async getTokenAllowance({\n address,\n ...rest\n }: GetTokenAllowanceParams): Promise<BigDecimal> {\n const token = await this.getTokenContractForProduct(rest);\n return toBigDecimal(\n await token.read.allowance([\n getValidatedAddress(address),\n this.getEndpointAddress(),\n ]),\n );\n }\n}\n"],"mappings":";AAIA,SAAqB,qBAAqB,oBAAoB;AAC9D,SAAS,mBAAmB;AAGrB,IAAM,eAAN,cAA2B,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,EAK5C,MAAM,mBAAmB,QAAwC;AAC/D,WAAO,KAAK,QAAQ,aAAa,mBAAmB,MAAM;AAAA,EAC5D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,oBAAoB,QAAyC;AACjE,WAAO,KAAK,QAAQ,aAAa,oBAAoB,MAAM;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,sBAAsB;AAAA,IAC1B;AAAA,IACA,GAAG;AAAA,EACL,GAAiD;AAC/C,UAAM,QAAQ,MAAM,KAAK,2BAA2B,IAAI;AACxD,WAAO,MAAM,KAAK,UAAU,CAAC,oBAAoB,OAAO,CAAC,CAAC;AAAA,EAC5D;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,kBAAkB;AAAA,IACtB;AAAA,IACA,GAAG;AAAA,EACL,GAAiD;AAC/C,UAAM,QAAQ,MAAM,KAAK,2BAA2B,IAAI;AACxD,WAAO;AAAA,MACL,MAAM,MAAM,KAAK,UAAU;AAAA,QACzB,oBAAoB,OAAO;AAAA,QAC3B,KAAK,mBAAmB;AAAA,MAC1B,CAAC;AAAA,IACH;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/apis/spot/SpotQueryAPI.ts"],"sourcesContent":["import {\n GetEngineMaxMintNlpAmountParams,\n GetEngineMaxWithdrawableParams,\n} from '@nadohq/engine-client';\nimport { BigDecimal, getValidatedAddress, toBigDecimal } from '@nadohq/shared';\nimport { BaseSpotAPI } from './BaseSpotAPI';\nimport { GetTokenAllowanceParams, GetTokenWalletBalanceParams } from './types';\n\nexport class SpotQueryAPI extends BaseSpotAPI {\n /**\n * Gets the estimated max withdrawable amount for a product\n * @param params\n */\n async getMaxWithdrawable(params: GetEngineMaxWithdrawableParams) {\n return this.context.engineClient.getMaxWithdrawable(params);\n }\n\n /**\n * Queries engine to determine maximum quote amount for minting NLP.\n *\n * @param params\n */\n async getMaxMintNlpAmount(params: GetEngineMaxMintNlpAmountParams) {\n return this.context.engineClient.getMaxMintNlpAmount(params);\n }\n\n /**\n * Helper to get current token balance in the user's wallet (i.e. not in a Nado subaccount)\n */\n async getTokenWalletBalance({\n address,\n ...rest\n }: GetTokenWalletBalanceParams): Promise<bigint> {\n const token = await this.getTokenContractForProduct(rest);\n return token.read.balanceOf([getValidatedAddress(address)]);\n }\n\n /**\n * Helper to get current token allowance\n */\n async getTokenAllowance({\n address,\n ...rest\n }: GetTokenAllowanceParams): Promise<BigDecimal> {\n const token = await this.getTokenContractForProduct(rest);\n return toBigDecimal(\n await token.read.allowance([\n getValidatedAddress(address),\n this.getEndpointAddress(),\n ]),\n );\n }\n}\n"],"mappings":";AAIA,SAAqB,qBAAqB,oBAAoB;AAC9D,SAAS,mBAAmB;AAGrB,IAAM,eAAN,cAA2B,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,EAK5C,MAAM,mBAAmB,QAAwC;AAC/D,WAAO,KAAK,QAAQ,aAAa,mBAAmB,MAAM;AAAA,EAC5D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,oBAAoB,QAAyC;AACjE,WAAO,KAAK,QAAQ,aAAa,oBAAoB,MAAM;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,sBAAsB;AAAA,IAC1B;AAAA,IACA,GAAG;AAAA,EACL,GAAiD;AAC/C,UAAM,QAAQ,MAAM,KAAK,2BAA2B,IAAI;AACxD,WAAO,MAAM,KAAK,UAAU,CAAC,oBAAoB,OAAO,CAAC,CAAC;AAAA,EAC5D;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,kBAAkB;AAAA,IACtB;AAAA,IACA,GAAG;AAAA,EACL,GAAiD;AAC/C,UAAM,QAAQ,MAAM,KAAK,2BAA2B,IAAI;AACxD,WAAO;AAAA,MACL,MAAM,MAAM,KAAK,UAAU;AAAA,QACzB,oBAAoB,OAAO;AAAA,QAC3B,KAAK,mBAAmB;AAAA,MAC1B,CAAC;AAAA,IACH;AAAA,EACF;AACF;","names":[]}
@@ -1,16 +1,15 @@
1
1
  import * as ts_mixer_dist_types_types from 'ts-mixer/dist/types/types';
2
2
  import { SpotExecuteAPI } from './SpotExecuteAPI.cjs';
3
3
  import { SpotQueryAPI } from './SpotQueryAPI.cjs';
4
- export { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintNlpParams, ProductIdOrTokenAddress, TransferQuoteParams, WithdrawCollateralParams } from './types.cjs';
4
+ export { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintMockERC20Params, MintNlpParams, ProductIdOrTokenAddress, TransferQuoteParams, WithdrawCollateralParams } from './types.cjs';
5
5
  import '@nadohq/engine-client';
6
- import '@nadohq/contracts';
6
+ import '@nadohq/shared';
7
7
  import './BaseSpotAPI.cjs';
8
8
  import '../base.cjs';
9
9
  import '../../context.cjs';
10
10
  import '@nadohq/indexer-client';
11
11
  import '@nadohq/trigger-client';
12
12
  import 'viem';
13
- import '@nadohq/utils';
14
13
  import '../types.cjs';
15
14
 
16
15
  declare const SpotAPI_base: ts_mixer_dist_types_types.Class<any[], SpotExecuteAPI & SpotQueryAPI, typeof SpotExecuteAPI & typeof SpotQueryAPI>;
@@ -1,16 +1,15 @@
1
1
  import * as ts_mixer_dist_types_types from 'ts-mixer/dist/types/types';
2
2
  import { SpotExecuteAPI } from './SpotExecuteAPI.js';
3
3
  import { SpotQueryAPI } from './SpotQueryAPI.js';
4
- export { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintNlpParams, ProductIdOrTokenAddress, TransferQuoteParams, WithdrawCollateralParams } from './types.js';
4
+ export { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintMockERC20Params, MintNlpParams, ProductIdOrTokenAddress, TransferQuoteParams, WithdrawCollateralParams } from './types.js';
5
5
  import '@nadohq/engine-client';
6
- import '@nadohq/contracts';
6
+ import '@nadohq/shared';
7
7
  import './BaseSpotAPI.js';
8
8
  import '../base.js';
9
9
  import '../../context.js';
10
10
  import '@nadohq/indexer-client';
11
11
  import '@nadohq/trigger-client';
12
12
  import 'viem';
13
- import '@nadohq/utils';
14
13
  import '../types.js';
15
14
 
16
15
  declare const SpotAPI_base: ts_mixer_dist_types_types.Class<any[], SpotExecuteAPI & SpotQueryAPI, typeof SpotExecuteAPI & typeof SpotQueryAPI>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/apis/spot/types.ts"],"sourcesContent":["import {\n EngineBurnNlpParams,\n EngineMintNlpParams,\n EngineTransferQuoteParams,\n EngineWithdrawCollateralParams,\n} from '@nadohq/engine-client';\nimport { BigDecimalish } from '@nadohq/utils';\nimport { OptionalSignatureParams, OptionalSubaccountOwner } from '../types';\n\nexport type ProductIdOrTokenAddress =\n | {\n productId: number;\n }\n | {\n tokenAddress: string;\n };\n\ntype TokenQueryParams = {\n address: string;\n} & ProductIdOrTokenAddress;\n\nexport type ApproveAllowanceParams = ProductIdOrTokenAddress & {\n amount: BigDecimalish;\n};\n\nexport type GetTokenWalletBalanceParams = TokenQueryParams;\n\nexport type GetTokenAllowanceParams = TokenQueryParams;\n\nexport type WithdrawCollateralParams = OptionalSignatureParams<\n OptionalSubaccountOwner<EngineWithdrawCollateralParams>\n>;\n\nexport type TransferQuoteParams = OptionalSignatureParams<\n OptionalSubaccountOwner<EngineTransferQuoteParams>\n>;\n\nexport type MintNlpParams = OptionalSignatureParams<\n OptionalSubaccountOwner<EngineMintNlpParams>\n>;\n\nexport type BurnNlpParams = OptionalSignatureParams<\n OptionalSubaccountOwner<EngineBurnNlpParams>\n>;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../../src/apis/spot/types.ts"],"sourcesContent":["import {\n EngineBurnNlpParams,\n EngineMintNlpParams,\n EngineTransferQuoteParams,\n EngineWithdrawCollateralParams,\n} from '@nadohq/engine-client';\nimport { BigDecimalish } from '@nadohq/shared';\nimport { OptionalSignatureParams, OptionalSubaccountOwner } from '../types';\n\nexport type ProductIdOrTokenAddress =\n | {\n productId: number;\n }\n | {\n tokenAddress: string;\n };\n\ntype TokenQueryParams = {\n address: string;\n} & ProductIdOrTokenAddress;\n\nexport type ApproveAllowanceParams = ProductIdOrTokenAddress & {\n amount: BigDecimalish;\n};\n\nexport type GetTokenWalletBalanceParams = TokenQueryParams;\n\nexport type GetTokenAllowanceParams = TokenQueryParams;\n\nexport type WithdrawCollateralParams = OptionalSignatureParams<\n OptionalSubaccountOwner<EngineWithdrawCollateralParams>\n>;\n\nexport type TransferQuoteParams = OptionalSignatureParams<\n OptionalSubaccountOwner<EngineTransferQuoteParams>\n>;\n\nexport type MintNlpParams = OptionalSignatureParams<\n OptionalSubaccountOwner<EngineMintNlpParams>\n>;\n\nexport type BurnNlpParams = OptionalSignatureParams<\n OptionalSubaccountOwner<EngineBurnNlpParams>\n>;\n\nexport interface MintMockERC20Params {\n productId: number;\n amount: BigDecimalish;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,5 +1,5 @@
1
1
  import { EngineWithdrawCollateralParams, EngineTransferQuoteParams, EngineMintNlpParams, EngineBurnNlpParams } from '@nadohq/engine-client';
2
- import { BigDecimalish } from '@nadohq/utils';
2
+ import { BigDecimalish } from '@nadohq/shared';
3
3
  import { OptionalSignatureParams, OptionalSubaccountOwner } from '../types.cjs';
4
4
 
5
5
  type ProductIdOrTokenAddress = {
@@ -19,5 +19,9 @@ type WithdrawCollateralParams = OptionalSignatureParams<OptionalSubaccountOwner<
19
19
  type TransferQuoteParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineTransferQuoteParams>>;
20
20
  type MintNlpParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineMintNlpParams>>;
21
21
  type BurnNlpParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineBurnNlpParams>>;
22
+ interface MintMockERC20Params {
23
+ productId: number;
24
+ amount: BigDecimalish;
25
+ }
22
26
 
23
- export type { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintNlpParams, ProductIdOrTokenAddress, TransferQuoteParams, WithdrawCollateralParams };
27
+ export type { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintMockERC20Params, MintNlpParams, ProductIdOrTokenAddress, TransferQuoteParams, WithdrawCollateralParams };