@nadohq/client 0.1.0-alpha.2 → 0.1.0-alpha.20
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.
- package/dist/apis/base.cjs +3 -6
- package/dist/apis/base.cjs.map +1 -1
- package/dist/apis/base.d.cts +1 -2
- package/dist/apis/base.d.ts +1 -2
- package/dist/apis/base.js +1 -4
- package/dist/apis/base.js.map +1 -1
- package/dist/apis/market/MarketExecuteAPI.cjs +23 -23
- package/dist/apis/market/MarketExecuteAPI.cjs.map +1 -1
- package/dist/apis/market/MarketExecuteAPI.d.cts +9 -11
- package/dist/apis/market/MarketExecuteAPI.d.ts +9 -11
- package/dist/apis/market/MarketExecuteAPI.js +23 -23
- package/dist/apis/market/MarketExecuteAPI.js.map +1 -1
- package/dist/apis/market/MarketQueryAPI.cjs +2 -9
- package/dist/apis/market/MarketQueryAPI.cjs.map +1 -1
- package/dist/apis/market/MarketQueryAPI.d.cts +4 -8
- package/dist/apis/market/MarketQueryAPI.d.ts +4 -8
- package/dist/apis/market/MarketQueryAPI.js +2 -9
- package/dist/apis/market/MarketQueryAPI.js.map +1 -1
- package/dist/apis/market/index.d.cts +2 -2
- package/dist/apis/market/index.d.ts +2 -2
- package/dist/apis/market/types.cjs.map +1 -1
- package/dist/apis/market/types.d.cts +6 -9
- package/dist/apis/market/types.d.ts +6 -9
- package/dist/apis/perp/PerpExecuteAPI.cjs +0 -3
- package/dist/apis/perp/PerpExecuteAPI.cjs.map +1 -1
- package/dist/apis/perp/PerpExecuteAPI.d.cts +1 -2
- package/dist/apis/perp/PerpExecuteAPI.d.ts +1 -2
- package/dist/apis/perp/PerpExecuteAPI.js +0 -3
- package/dist/apis/perp/PerpExecuteAPI.js.map +1 -1
- package/dist/apis/perp/PerpQueryAPI.d.cts +1 -1
- package/dist/apis/perp/PerpQueryAPI.d.ts +1 -1
- package/dist/apis/perp/index.d.cts +1 -1
- package/dist/apis/perp/index.d.ts +1 -1
- package/dist/apis/spot/BaseSpotAPI.cjs +3 -4
- package/dist/apis/spot/BaseSpotAPI.cjs.map +1 -1
- package/dist/apis/spot/BaseSpotAPI.d.cts +1 -2
- package/dist/apis/spot/BaseSpotAPI.d.ts +1 -2
- package/dist/apis/spot/BaseSpotAPI.js +4 -2
- package/dist/apis/spot/BaseSpotAPI.js.map +1 -1
- package/dist/apis/spot/SpotExecuteAPI.cjs +7 -8
- package/dist/apis/spot/SpotExecuteAPI.cjs.map +1 -1
- package/dist/apis/spot/SpotExecuteAPI.d.cts +2 -3
- package/dist/apis/spot/SpotExecuteAPI.d.ts +2 -3
- package/dist/apis/spot/SpotExecuteAPI.js +4 -3
- package/dist/apis/spot/SpotExecuteAPI.js.map +1 -1
- package/dist/apis/spot/SpotQueryAPI.cjs +4 -4
- package/dist/apis/spot/SpotQueryAPI.cjs.map +1 -1
- package/dist/apis/spot/SpotQueryAPI.d.cts +1 -2
- package/dist/apis/spot/SpotQueryAPI.d.ts +1 -2
- package/dist/apis/spot/SpotQueryAPI.js +1 -1
- package/dist/apis/spot/SpotQueryAPI.js.map +1 -1
- package/dist/apis/spot/index.d.cts +2 -3
- package/dist/apis/spot/index.d.ts +2 -3
- package/dist/apis/spot/types.cjs.map +1 -1
- package/dist/apis/spot/types.d.cts +6 -2
- package/dist/apis/spot/types.d.ts +6 -2
- package/dist/apis/subaccount/SubaccountExecuteAPI.d.cts +1 -1
- package/dist/apis/subaccount/SubaccountExecuteAPI.d.ts +1 -1
- package/dist/apis/subaccount/SubaccountQueryAPI.cjs +1 -10
- package/dist/apis/subaccount/SubaccountQueryAPI.cjs.map +1 -1
- package/dist/apis/subaccount/SubaccountQueryAPI.d.cts +3 -10
- package/dist/apis/subaccount/SubaccountQueryAPI.d.ts +3 -10
- package/dist/apis/subaccount/SubaccountQueryAPI.js +1 -12
- package/dist/apis/subaccount/SubaccountQueryAPI.js.map +1 -1
- package/dist/apis/subaccount/index.cjs +3 -4
- package/dist/apis/subaccount/index.cjs.map +1 -1
- package/dist/apis/subaccount/index.d.cts +1 -1
- package/dist/apis/subaccount/index.d.ts +1 -1
- package/dist/apis/subaccount/index.js +4 -2
- package/dist/apis/subaccount/index.js.map +1 -1
- package/dist/apis/subaccount/types.cjs.map +1 -1
- package/dist/apis/subaccount/types.d.cts +1 -1
- package/dist/apis/subaccount/types.d.ts +1 -1
- package/dist/apis/ws/WebSocketExecuteAPI.cjs.map +1 -1
- package/dist/apis/ws/WebSocketExecuteAPI.d.cts +4 -4
- package/dist/apis/ws/WebSocketExecuteAPI.d.ts +4 -4
- package/dist/apis/ws/WebSocketExecuteAPI.js.map +1 -1
- package/dist/apis/ws/WebSocketQueryAPI.d.cts +1 -1
- package/dist/apis/ws/WebSocketQueryAPI.d.ts +1 -1
- package/dist/apis/ws/WebSocketSubscriptionAPI.d.cts +1 -1
- package/dist/apis/ws/WebSocketSubscriptionAPI.d.ts +1 -1
- package/dist/apis/ws/index.d.cts +1 -1
- package/dist/apis/ws/index.d.ts +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +2 -3
- package/dist/client.d.ts +2 -3
- package/dist/client.js.map +1 -1
- package/dist/context.cjs +3 -3
- package/dist/context.cjs.map +1 -1
- package/dist/context.d.cts +1 -1
- package/dist/context.d.ts +1 -1
- package/dist/context.js +4 -4
- package/dist/context.js.map +1 -1
- package/dist/createNadoClient.d.cts +1 -2
- package/dist/createNadoClient.d.ts +1 -2
- package/dist/index.cjs +4 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -5
- package/dist/index.d.ts +4 -5
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/package.json +6 -7
- package/src/apis/base.ts +1 -6
- package/src/apis/market/MarketExecuteAPI.ts +27 -33
- package/src/apis/market/MarketQueryAPI.ts +4 -11
- package/src/apis/market/types.ts +8 -12
- package/src/apis/perp/PerpExecuteAPI.ts +1 -6
- package/src/apis/spot/BaseSpotAPI.ts +5 -2
- package/src/apis/spot/SpotExecuteAPI.ts +4 -3
- package/src/apis/spot/SpotQueryAPI.ts +1 -1
- package/src/apis/spot/types.ts +6 -1
- package/src/apis/subaccount/SubaccountQueryAPI.ts +1 -14
- package/src/apis/subaccount/index.ts +4 -2
- package/src/apis/subaccount/types.ts +1 -1
- package/src/apis/ws/WebSocketExecuteAPI.ts +1 -1
- package/src/client.ts +1 -1
- package/src/context.ts +6 -6
- package/src/index.ts +2 -3
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
// src/apis/market/MarketQueryAPI.ts
|
|
2
|
-
import { getAllMarkets } from "@nadohq/contracts";
|
|
3
2
|
import { BaseNadoAPI } from "../base.js";
|
|
4
3
|
var MarketQueryAPI = class extends BaseNadoAPI {
|
|
5
|
-
/**
|
|
6
|
-
* Retrieves all market states from the on-chain contracts
|
|
7
|
-
*/
|
|
8
|
-
async getAllMarkets() {
|
|
9
|
-
return getAllMarkets(this.context.contracts);
|
|
10
|
-
}
|
|
11
4
|
/**
|
|
12
5
|
* Retrieves all market states from the offchain engine
|
|
13
6
|
*/
|
|
14
|
-
async
|
|
7
|
+
async getAllMarkets() {
|
|
15
8
|
return this.context.engineClient.getAllMarkets();
|
|
16
9
|
}
|
|
17
10
|
/**
|
|
18
11
|
* Get all edge engine markets
|
|
19
12
|
*/
|
|
20
|
-
async
|
|
13
|
+
async getEdgeAllMarkets() {
|
|
21
14
|
return this.context.engineClient.getEdgeAllMarkets();
|
|
22
15
|
}
|
|
23
16
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/apis/market/MarketQueryAPI.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/apis/market/MarketQueryAPI.ts"],"sourcesContent":["import {\n GetEngineAllMarketsResponse,\n GetEngineMarketLiquidityParams,\n GetEngineMarketPriceParams,\n GetEngineMarketPricesParams,\n GetEngineMaxOrderSizeParams,\n GetEngineSubaccountOrdersParams,\n GetEngineSubaccountProductOrdersParams,\n ValidateEngineOrderParams,\n} from '@nadohq/engine-client';\nimport {\n GetIndexerCandlesticksParams,\n GetIndexerEdgeCandlesticksParams,\n GetIndexerEdgeMarketSnapshotsParams,\n GetIndexerFundingRateParams,\n GetIndexerMarketSnapshotsParams,\n GetIndexerMultiProductFundingRatesParams,\n GetIndexerMultiProductSnapshotsParams,\n GetIndexerOrdersParams,\n GetIndexerOrdersResponse,\n GetIndexerProductSnapshotsParams,\n} from '@nadohq/indexer-client';\nimport { BaseNadoAPI } from '../base';\nimport { GetTriggerOrdersParams } from './types';\n\nexport class MarketQueryAPI extends BaseNadoAPI {\n /**\n * Retrieves all market states from the offchain engine\n */\n async getAllMarkets(): Promise<GetEngineAllMarketsResponse> {\n return this.context.engineClient.getAllMarkets();\n }\n\n /**\n * Get all edge engine markets\n */\n async getEdgeAllMarkets(): Promise<\n Record<number, GetEngineAllMarketsResponse>\n > {\n return this.context.engineClient.getEdgeAllMarkets();\n }\n\n /**\n * Retrieves all spread health groups\n */\n async getHealthGroups() {\n return this.context.engineClient.getHealthGroups();\n }\n\n /**\n * Queries engine to determine if the order can be submitted within health requirements\n */\n async validateOrderParams(params: ValidateEngineOrderParams) {\n return this.context.engineClient.validateOrderParams(params);\n }\n\n /**\n * Queries the offchain engine to retrieve status of any open orders for the given subaccount\n * @param params\n */\n async getOpenSubaccountOrders(params: GetEngineSubaccountOrdersParams) {\n return this.context.engineClient.getSubaccountOrders(params);\n }\n\n /**\n * Queries the offchain engine to retrieve status of any open orders for the given subaccount for multiple products\n * @param params\n */\n async getOpenSubaccountMultiProductOrders(\n params: GetEngineSubaccountProductOrdersParams,\n ) {\n return this.context.engineClient.getSubaccountMultiProductOrders(params);\n }\n\n /**\n * Queries the offchain trigger service to list trigger orders. Requires a signature\n * @param params\n */\n async getTriggerOrders(params: GetTriggerOrdersParams) {\n return this.context.triggerClient.listOrders({\n ...params,\n chainId: this.getWalletClientChainIdIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n });\n }\n\n /**\n * Queries indexer to fetch historical orders\n *\n * @param params\n */\n async getHistoricalOrders(\n params: GetIndexerOrdersParams,\n ): Promise<GetIndexerOrdersResponse> {\n return this.context.indexerClient.getOrders(params);\n }\n\n /**\n * Queries engine to determine maximum order size\n * @param params\n */\n async getMaxOrderSize(params: GetEngineMaxOrderSizeParams) {\n return this.context.engineClient.getMaxOrderSize(params);\n }\n\n /**\n * Retrieves liquidity per price tick from the engine. The engine will skip price levels that have no liquidity,\n * so it is not guaranteed that the bids/asks are evenly spaced\n */\n async getMarketLiquidity(params: GetEngineMarketLiquidityParams) {\n return this.context.engineClient.getMarketLiquidity(params);\n }\n\n /**\n * Historical candlesticks from the indexer, use getLatestMarketPrice for the latest orderbook prices\n *\n * @param params\n */\n async getCandlesticks(params: GetIndexerCandlesticksParams) {\n return this.context.indexerClient.getCandlesticks(params);\n }\n\n /**\n * Historical candlesticks from Edge, use getLatestMarketPrice for the latest orderbook prices\n *\n * @param params\n */\n async getEdgeCandlesticks(params: GetIndexerEdgeCandlesticksParams) {\n return this.context.indexerClient.getEdgeCandlesticks(params);\n }\n\n /**\n * Retrieves the latest off-chain orderbook price from the engine\n *\n * @param params\n */\n async getLatestMarketPrice(params: GetEngineMarketPriceParams) {\n return this.context.engineClient.getMarketPrice(params);\n }\n\n /**\n * Retrieves the latest off-chain orderbook price from the engine for multiple markets\n *\n * @param params\n */\n async getLatestMarketPrices(params: GetEngineMarketPricesParams) {\n return this.context.engineClient.getMarketPrices(params);\n }\n\n /**\n * Retrieves the latest funding rate for a perp product\n *\n * @param params\n */\n async getFundingRate(params: GetIndexerFundingRateParams) {\n return this.context.indexerClient.getFundingRate(params);\n }\n\n /**\n * Retrieves the latest funding rate for multiple perp products\n *\n * @param params\n */\n async getMultiProductFundingRates(\n params: GetIndexerMultiProductFundingRatesParams,\n ) {\n return this.context.indexerClient.getMultiProductFundingRates(params);\n }\n\n /**\n * Retrieves the historical snapshots for a product from the indexer\n *\n * @param params\n */\n async getProductSnapshots(params: GetIndexerProductSnapshotsParams) {\n return this.context.indexerClient.getProductSnapshots(params);\n }\n\n /**\n * Retrieves the historical snapshots for a market from the indexer\n *\n * @param params\n */\n async getMarketSnapshots(params: GetIndexerMarketSnapshotsParams) {\n return this.context.indexerClient.getMarketSnapshots(params);\n }\n\n /**\n * Retrieves the historical snapshots for a market from Edge\n *\n * @param params\n */\n async getEdgeMarketSnapshots(params: GetIndexerEdgeMarketSnapshotsParams) {\n return this.context.indexerClient.getEdgeMarketSnapshots(params);\n }\n\n /**\n * Retrieves the historical snapshots for multiple products from the indexer\n *\n * @param params\n */\n async getMultiProductSnapshots(\n params: GetIndexerMultiProductSnapshotsParams,\n ) {\n return this.context.indexerClient.getMultiProductSnapshots(params);\n }\n}\n"],"mappings":";AAsBA,SAAS,mBAAmB;AAGrB,IAAM,iBAAN,cAA6B,YAAY;AAAA;AAAA;AAAA;AAAA,EAI9C,MAAM,gBAAsD;AAC1D,WAAO,KAAK,QAAQ,aAAa,cAAc;AAAA,EACjD;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,oBAEJ;AACA,WAAO,KAAK,QAAQ,aAAa,kBAAkB;AAAA,EACrD;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,kBAAkB;AACtB,WAAO,KAAK,QAAQ,aAAa,gBAAgB;AAAA,EACnD;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,oBAAoB,QAAmC;AAC3D,WAAO,KAAK,QAAQ,aAAa,oBAAoB,MAAM;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,wBAAwB,QAAyC;AACrE,WAAO,KAAK,QAAQ,aAAa,oBAAoB,MAAM;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,oCACJ,QACA;AACA,WAAO,KAAK,QAAQ,aAAa,gCAAgC,MAAM;AAAA,EACzE;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,iBAAiB,QAAgC;AACrD,WAAO,KAAK,QAAQ,cAAc,WAAW;AAAA,MAC3C,GAAG;AAAA,MACH,SAAS,KAAK,+BAA+B,MAAM;AAAA,MACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;AAAA,IACjE,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,oBACJ,QACmC;AACnC,WAAO,KAAK,QAAQ,cAAc,UAAU,MAAM;AAAA,EACpD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,gBAAgB,QAAqC;AACzD,WAAO,KAAK,QAAQ,aAAa,gBAAgB,MAAM;AAAA,EACzD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,mBAAmB,QAAwC;AAC/D,WAAO,KAAK,QAAQ,aAAa,mBAAmB,MAAM;AAAA,EAC5D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,gBAAgB,QAAsC;AAC1D,WAAO,KAAK,QAAQ,cAAc,gBAAgB,MAAM;AAAA,EAC1D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,oBAAoB,QAA0C;AAClE,WAAO,KAAK,QAAQ,cAAc,oBAAoB,MAAM;AAAA,EAC9D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,qBAAqB,QAAoC;AAC7D,WAAO,KAAK,QAAQ,aAAa,eAAe,MAAM;AAAA,EACxD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,sBAAsB,QAAqC;AAC/D,WAAO,KAAK,QAAQ,aAAa,gBAAgB,MAAM;AAAA,EACzD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,eAAe,QAAqC;AACxD,WAAO,KAAK,QAAQ,cAAc,eAAe,MAAM;AAAA,EACzD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,4BACJ,QACA;AACA,WAAO,KAAK,QAAQ,cAAc,4BAA4B,MAAM;AAAA,EACtE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,oBAAoB,QAA0C;AAClE,WAAO,KAAK,QAAQ,cAAc,oBAAoB,MAAM;AAAA,EAC9D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,mBAAmB,QAAyC;AAChE,WAAO,KAAK,QAAQ,cAAc,mBAAmB,MAAM;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,uBAAuB,QAA6C;AACxE,WAAO,KAAK,QAAQ,cAAc,uBAAuB,MAAM;AAAA,EACjE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,yBACJ,QACA;AACA,WAAO,KAAK,QAAQ,cAAc,yBAAyB,MAAM;AAAA,EACnE;AACF;","names":[]}
|
|
@@ -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.cjs';
|
|
3
3
|
import { MarketQueryAPI } from './MarketQueryAPI.cjs';
|
|
4
|
-
export { CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, GetTriggerOrdersParams,
|
|
4
|
+
export { CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, GetTriggerOrdersParams, PlaceOrderParams, PlaceOrdersParams, PlaceTriggerOrderParams } from './types.cjs';
|
|
5
5
|
import '@nadohq/trigger-client';
|
|
6
6
|
import '@nadohq/engine-client';
|
|
7
7
|
import '../base.cjs';
|
|
8
|
-
import '@nadohq/
|
|
8
|
+
import '@nadohq/shared';
|
|
9
9
|
import '../../context.cjs';
|
|
10
10
|
import '@nadohq/indexer-client';
|
|
11
11
|
import 'viem';
|
|
@@ -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,
|
|
4
|
+
export { CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, GetTriggerOrdersParams, PlaceOrderParams, PlaceOrdersParams, PlaceTriggerOrderParams } from './types.js';
|
|
5
5
|
import '@nadohq/trigger-client';
|
|
6
6
|
import '@nadohq/engine-client';
|
|
7
7
|
import '../base.js';
|
|
8
|
-
import '@nadohq/
|
|
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
|
|
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 PlaceOrdersParams = PlaceOrderParams[];\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,14 @@
|
|
|
1
|
-
import { EngineOrderParams, EnginePlaceOrderParams,
|
|
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
|
|
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
|
-
};
|
|
11
|
+
type PlaceOrdersParams = PlaceOrderParams[];
|
|
15
12
|
type CancelOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineCancelOrdersParams>>;
|
|
16
13
|
type CancelProductOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineCancelProductOrdersParams>>;
|
|
17
14
|
interface CancelAndPlaceOrderParams {
|
|
@@ -23,4 +20,4 @@ type CancelTriggerOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner
|
|
|
23
20
|
type CancelTriggerProductOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner<TriggerCancelProductOrdersParams>>;
|
|
24
21
|
type GetTriggerOrdersParams = OptionalSignatureParams<TriggerListOrdersParams>;
|
|
25
22
|
|
|
26
|
-
export type { CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, GetTriggerOrdersParams,
|
|
23
|
+
export type { CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, GetTriggerOrdersParams, PlaceOrderParams, PlaceOrdersParams, PlaceTriggerOrderParams };
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import { EngineOrderParams, EnginePlaceOrderParams,
|
|
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
|
|
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
|
-
};
|
|
11
|
+
type PlaceOrdersParams = PlaceOrderParams[];
|
|
15
12
|
type CancelOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineCancelOrdersParams>>;
|
|
16
13
|
type CancelProductOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineCancelProductOrdersParams>>;
|
|
17
14
|
interface CancelAndPlaceOrderParams {
|
|
@@ -23,4 +20,4 @@ type CancelTriggerOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner
|
|
|
23
20
|
type CancelTriggerProductOrdersParams = OptionalSignatureParams<OptionalSubaccountOwner<TriggerCancelProductOrdersParams>>;
|
|
24
21
|
type GetTriggerOrdersParams = OptionalSignatureParams<TriggerListOrdersParams>;
|
|
25
22
|
|
|
26
|
-
export type { CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, GetTriggerOrdersParams,
|
|
23
|
+
export type { CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, GetTriggerOrdersParams, PlaceOrderParams, PlaceOrdersParams, 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 {
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/apis/perp/PerpExecuteAPI.ts"],"sourcesContent":["import {
|
|
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/
|
|
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/
|
|
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,7 @@ __export(BaseSpotAPI_exports, {
|
|
|
23
23
|
BaseSpotAPI: () => BaseSpotAPI
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(BaseSpotAPI_exports);
|
|
26
|
-
var
|
|
27
|
-
var import_utils = require("@nadohq/utils");
|
|
26
|
+
var import_shared = require("@nadohq/shared");
|
|
28
27
|
var import_viem = require("viem");
|
|
29
28
|
var import_base = require("../base.cjs");
|
|
30
29
|
var BaseSpotAPI = class extends import_base.BaseNadoAPI {
|
|
@@ -42,8 +41,8 @@ var BaseSpotAPI = class extends import_base.BaseNadoAPI {
|
|
|
42
41
|
tokenAddress = params.tokenAddress;
|
|
43
42
|
}
|
|
44
43
|
return (0, import_viem.getContract)({
|
|
45
|
-
abi:
|
|
46
|
-
address: (0,
|
|
44
|
+
abi: import_shared.ERC20_ABI,
|
|
45
|
+
address: (0, import_shared.getValidatedAddress)(tokenAddress),
|
|
47
46
|
client: this.context.walletClient ?? this.context.publicClient
|
|
48
47
|
});
|
|
49
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/apis/spot/BaseSpotAPI.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/apis/spot/BaseSpotAPI.ts"],"sourcesContent":["import {\n ContractInstance,\n ERC20_ABI,\n getValidatedAddress,\n} 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,oBAIO;AACP,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,mCAAoB,YAAY;AAAA,MACzC,QAAQ,KAAK,QAAQ,gBAAgB,KAAK,QAAQ;AAAA,IACpD,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContractInstance, ERC20_ABI } from '@nadohq/
|
|
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/
|
|
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,8 @@
|
|
|
1
1
|
// src/apis/spot/BaseSpotAPI.ts
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
ERC20_ABI,
|
|
4
|
+
getValidatedAddress
|
|
5
|
+
} from "@nadohq/shared";
|
|
4
6
|
import { getContract } from "viem";
|
|
5
7
|
import { BaseNadoAPI } from "../base.js";
|
|
6
8
|
var BaseSpotAPI = class extends BaseNadoAPI {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/apis/spot/BaseSpotAPI.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/apis/spot/BaseSpotAPI.ts"],"sourcesContent":["import {\n ContractInstance,\n ERC20_ABI,\n getValidatedAddress,\n} 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,EAEE;AAAA,EACA;AAAA,OACK;AACP,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,11 @@ __export(SpotExecuteAPI_exports, {
|
|
|
23
23
|
SpotExecuteAPI: () => SpotExecuteAPI
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(SpotExecuteAPI_exports);
|
|
26
|
-
var
|
|
27
|
-
var import_utils = require("@nadohq/utils");
|
|
26
|
+
var import_shared = require("@nadohq/shared");
|
|
28
27
|
var import_BaseSpotAPI = require("./BaseSpotAPI.cjs");
|
|
29
28
|
var SpotExecuteAPI = class extends import_BaseSpotAPI.BaseSpotAPI {
|
|
30
29
|
async deposit(params) {
|
|
31
|
-
return (0,
|
|
30
|
+
return (0, import_shared.depositCollateral)({
|
|
32
31
|
endpoint: this.context.contracts.endpoint,
|
|
33
32
|
subaccountName: params.subaccountName,
|
|
34
33
|
productId: params.productId,
|
|
@@ -46,12 +45,12 @@ var SpotExecuteAPI = class extends import_BaseSpotAPI.BaseSpotAPI {
|
|
|
46
45
|
}
|
|
47
46
|
async approveAllowance(params) {
|
|
48
47
|
const tokenContract = await this.getTokenContractForProduct(params);
|
|
49
|
-
if (!(0,
|
|
48
|
+
if (!(0, import_shared.isWriteableContract)(tokenContract)) {
|
|
50
49
|
throw new Error(
|
|
51
50
|
"Token contract does not permit writes. Is a wallet client provided?"
|
|
52
51
|
);
|
|
53
52
|
}
|
|
54
|
-
return (0,
|
|
53
|
+
return (0, import_shared.approveDepositAllowance)({
|
|
55
54
|
amount: params.amount,
|
|
56
55
|
endpoint: this.context.contracts.endpoint,
|
|
57
56
|
tokenContract
|
|
@@ -88,16 +87,16 @@ var SpotExecuteAPI = class extends import_BaseSpotAPI.BaseSpotAPI {
|
|
|
88
87
|
}
|
|
89
88
|
async _mintMockERC20(params) {
|
|
90
89
|
if (!this.context.walletClient) {
|
|
91
|
-
throw new
|
|
90
|
+
throw new import_shared.WalletNotProvidedError();
|
|
92
91
|
}
|
|
93
92
|
const config = await this.context.contracts.spotEngine.read.getConfig([
|
|
94
93
|
params.productId
|
|
95
94
|
]);
|
|
96
95
|
return this.context.walletClient.writeContract({
|
|
97
|
-
abi:
|
|
96
|
+
abi: import_shared.MOCK_ERC20_ABI,
|
|
98
97
|
address: config.token,
|
|
99
98
|
functionName: "mint",
|
|
100
|
-
args: [this.getWalletClientAddress(), (0,
|
|
99
|
+
args: [this.getWalletClientAddress(), (0, import_shared.toBigInt)(params.amount)]
|
|
101
100
|
});
|
|
102
101
|
}
|
|
103
102
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/apis/spot/SpotExecuteAPI.ts"],"sourcesContent":["import {\n approveDepositAllowance,\n depositCollateral,\n DepositCollateralParams,\n isWriteableContract,\n
|
|
1
|
+
{"version":3,"sources":["../../../src/apis/spot/SpotExecuteAPI.ts"],"sourcesContent":["import {\n approveDepositAllowance,\n depositCollateral,\n DepositCollateralParams,\n isWriteableContract,\n MOCK_ERC20_ABI,\n toBigInt,\n WalletNotProvidedError,\n} 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,oBAQO;AACP,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,qCAAuB;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,wBAAS,OAAO,MAAM,CAAC;AAAA,IAC/D,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import * as _nadohq_engine_client from '@nadohq/engine-client';
|
|
2
|
-
import { DepositCollateralParams
|
|
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
|
|
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 {
|
|
@@ -3,9 +3,10 @@ import {
|
|
|
3
3
|
approveDepositAllowance,
|
|
4
4
|
depositCollateral,
|
|
5
5
|
isWriteableContract,
|
|
6
|
-
MOCK_ERC20_ABI
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
MOCK_ERC20_ABI,
|
|
7
|
+
toBigInt,
|
|
8
|
+
WalletNotProvidedError
|
|
9
|
+
} from "@nadohq/shared";
|
|
9
10
|
import { BaseSpotAPI } from "./BaseSpotAPI.js";
|
|
10
11
|
var SpotExecuteAPI = class extends BaseSpotAPI {
|
|
11
12
|
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
|
|
1
|
+
{"version":3,"sources":["../../../src/apis/spot/SpotExecuteAPI.ts"],"sourcesContent":["import {\n approveDepositAllowance,\n depositCollateral,\n DepositCollateralParams,\n isWriteableContract,\n MOCK_ERC20_ABI,\n toBigInt,\n WalletNotProvidedError,\n} 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,EACA;AAAA,EACA;AAAA,OACK;AACP,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
|
|
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,
|
|
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,
|
|
62
|
+
return (0, import_shared.toBigDecimal)(
|
|
63
63
|
await token.read.allowance([
|
|
64
|
-
(0,
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
2
|
+
import { getValidatedAddress, toBigDecimal } from "@nadohq/shared";
|
|
3
3
|
import { BaseSpotAPI } from "./BaseSpotAPI.js";
|
|
4
4
|
var SpotQueryAPI = class extends BaseSpotAPI {
|
|
5
5
|
/**
|