@nadohq/client 0.14.0 → 0.17.0
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/BaseSpotAPI-BeTjhXT_.d.cts +14 -0
- package/dist/BaseSpotAPI-BeTjhXT_.d.cts.map +1 -0
- package/dist/BaseSpotAPI-Ck64kyYt.d.ts +14 -0
- package/dist/BaseSpotAPI-Ck64kyYt.d.ts.map +1 -0
- package/dist/MarketExecuteAPI-BBp0Nn6N.d.cts +55 -0
- package/dist/MarketExecuteAPI-BBp0Nn6N.d.cts.map +1 -0
- package/dist/MarketExecuteAPI-_S9-rNsv.d.ts +55 -0
- package/dist/MarketExecuteAPI-_S9-rNsv.d.ts.map +1 -0
- package/dist/MarketQueryAPI-Dhb8hWiD.d.cts +118 -0
- package/dist/MarketQueryAPI-Dhb8hWiD.d.cts.map +1 -0
- package/dist/MarketQueryAPI-Dz8FrVPK.d.ts +118 -0
- package/dist/MarketQueryAPI-Dz8FrVPK.d.ts.map +1 -0
- package/dist/PerpExecuteAPI-C0APgWq4.d.cts +7 -0
- package/dist/PerpExecuteAPI-C0APgWq4.d.cts.map +1 -0
- package/dist/PerpExecuteAPI-DPNJdARF.d.ts +7 -0
- package/dist/PerpExecuteAPI-DPNJdARF.d.ts.map +1 -0
- package/dist/PerpQueryAPI-RGhdNhoJ.d.cts +19 -0
- package/dist/PerpQueryAPI-RGhdNhoJ.d.cts.map +1 -0
- package/dist/PerpQueryAPI-tJbMmCcO.d.ts +19 -0
- package/dist/PerpQueryAPI-tJbMmCcO.d.ts.map +1 -0
- package/dist/SpotExecuteAPI-UWnX_Hm4.d.ts +22 -0
- package/dist/SpotExecuteAPI-UWnX_Hm4.d.ts.map +1 -0
- package/dist/SpotExecuteAPI-b07ixUz2.d.cts +22 -0
- package/dist/SpotExecuteAPI-b07ixUz2.d.cts.map +1 -0
- package/dist/SpotQueryAPI-CfZcvt4p.d.ts +36 -0
- package/dist/SpotQueryAPI-CfZcvt4p.d.ts.map +1 -0
- package/dist/SpotQueryAPI-DS85MzQB.d.cts +36 -0
- package/dist/SpotQueryAPI-DS85MzQB.d.cts.map +1 -0
- package/dist/SubaccountExecuteAPI-DhHBzzdk.d.cts +21 -0
- package/dist/SubaccountExecuteAPI-DhHBzzdk.d.cts.map +1 -0
- package/dist/SubaccountExecuteAPI-KApMbONz.d.ts +21 -0
- package/dist/SubaccountExecuteAPI-KApMbONz.d.ts.map +1 -0
- package/dist/SubaccountQueryAPI-C9h3epmM.d.cts +40 -0
- package/dist/SubaccountQueryAPI-C9h3epmM.d.cts.map +1 -0
- package/dist/SubaccountQueryAPI-DnLcgfiM.d.ts +40 -0
- package/dist/SubaccountQueryAPI-DnLcgfiM.d.ts.map +1 -0
- package/dist/WebSocketExecuteAPI-7gLrCoXN.d.cts +44 -0
- package/dist/WebSocketExecuteAPI-7gLrCoXN.d.cts.map +1 -0
- package/dist/WebSocketExecuteAPI-DHhKag16.d.ts +44 -0
- package/dist/WebSocketExecuteAPI-DHhKag16.d.ts.map +1 -0
- package/dist/WebSocketQueryAPI-B9vBQo5q.d.ts +20 -0
- package/dist/WebSocketQueryAPI-B9vBQo5q.d.ts.map +1 -0
- package/dist/WebSocketQueryAPI-BMLp4dCH.d.cts +20 -0
- package/dist/WebSocketQueryAPI-BMLp4dCH.d.cts.map +1 -0
- package/dist/WebSocketSubscriptionAPI-bApRHac8.d.cts +34 -0
- package/dist/WebSocketSubscriptionAPI-bApRHac8.d.cts.map +1 -0
- package/dist/WebSocketSubscriptionAPI-qUFRFcRI.d.ts +34 -0
- package/dist/WebSocketSubscriptionAPI-qUFRFcRI.d.ts.map +1 -0
- package/dist/apis/base.cjs +30 -60
- package/dist/apis/base.cjs.map +1 -1
- package/dist/apis/base.d.cts +2 -22
- package/dist/apis/base.d.ts +2 -22
- package/dist/apis/base.js +28 -34
- package/dist/apis/base.js.map +1 -1
- package/dist/apis/market/MarketExecuteAPI.cjs +164 -190
- package/dist/apis/market/MarketExecuteAPI.cjs.map +1 -1
- package/dist/apis/market/MarketExecuteAPI.d.cts +2 -61
- package/dist/apis/market/MarketExecuteAPI.d.ts +2 -61
- package/dist/apis/market/MarketExecuteAPI.js +162 -164
- package/dist/apis/market/MarketExecuteAPI.js.map +1 -1
- package/dist/apis/market/MarketQueryAPI.cjs +157 -181
- package/dist/apis/market/MarketQueryAPI.cjs.map +1 -1
- package/dist/apis/market/MarketQueryAPI.d.cts +2 -124
- package/dist/apis/market/MarketQueryAPI.d.ts +2 -124
- package/dist/apis/market/MarketQueryAPI.js +155 -155
- package/dist/apis/market/MarketQueryAPI.js.map +1 -1
- package/dist/apis/market/index.cjs +8 -36
- package/dist/apis/market/index.cjs.map +1 -1
- package/dist/apis/market/index.d.cts +3 -19
- package/dist/apis/market/index.d.ts +3 -19
- package/dist/apis/market/index.js +6 -8
- package/dist/apis/market/index.js.map +1 -1
- package/dist/apis/market/types.cjs +0 -19
- package/dist/apis/market/types.d.cts +2 -41
- package/dist/apis/market/types.d.ts +2 -41
- package/dist/apis/market/types.js +1 -1
- package/dist/apis/perp/PerpExecuteAPI.cjs +6 -31
- package/dist/apis/perp/PerpExecuteAPI.cjs.map +1 -1
- package/dist/apis/perp/PerpExecuteAPI.d.cts +2 -12
- package/dist/apis/perp/PerpExecuteAPI.d.ts +2 -12
- package/dist/apis/perp/PerpExecuteAPI.js +5 -6
- package/dist/apis/perp/PerpExecuteAPI.js.map +1 -1
- package/dist/apis/perp/PerpQueryAPI.cjs +20 -44
- package/dist/apis/perp/PerpQueryAPI.cjs.map +1 -1
- package/dist/apis/perp/PerpQueryAPI.d.cts +2 -23
- package/dist/apis/perp/PerpQueryAPI.d.ts +2 -23
- package/dist/apis/perp/PerpQueryAPI.js +18 -18
- package/dist/apis/perp/PerpQueryAPI.js.map +1 -1
- package/dist/apis/perp/index.cjs +8 -33
- package/dist/apis/perp/index.cjs.map +1 -1
- package/dist/apis/perp/index.d.cts +2 -16
- package/dist/apis/perp/index.d.ts +2 -16
- package/dist/apis/perp/index.js +6 -7
- package/dist/apis/perp/index.js.map +1 -1
- package/dist/apis/spot/BaseSpotAPI.cjs +21 -51
- package/dist/apis/spot/BaseSpotAPI.cjs.map +1 -1
- package/dist/apis/spot/BaseSpotAPI.d.cts +2 -18
- package/dist/apis/spot/BaseSpotAPI.d.ts +2 -18
- package/dist/apis/spot/BaseSpotAPI.js +19 -28
- package/dist/apis/spot/BaseSpotAPI.js.map +1 -1
- package/dist/apis/spot/SpotExecuteAPI.cjs +72 -104
- package/dist/apis/spot/SpotExecuteAPI.cjs.map +1 -1
- package/dist/apis/spot/SpotExecuteAPI.d.cts +2 -27
- package/dist/apis/spot/SpotExecuteAPI.d.ts +2 -27
- package/dist/apis/spot/SpotExecuteAPI.js +70 -85
- package/dist/apis/spot/SpotExecuteAPI.js.map +1 -1
- package/dist/apis/spot/SpotQueryAPI.cjs +34 -71
- package/dist/apis/spot/SpotQueryAPI.cjs.map +1 -1
- package/dist/apis/spot/SpotQueryAPI.d.cts +2 -35
- package/dist/apis/spot/SpotQueryAPI.d.ts +2 -35
- package/dist/apis/spot/SpotQueryAPI.js +32 -45
- package/dist/apis/spot/SpotQueryAPI.js.map +1 -1
- package/dist/apis/spot/index.cjs +11 -36
- package/dist/apis/spot/index.cjs.map +1 -1
- package/dist/apis/spot/index.d.cts +3 -23
- package/dist/apis/spot/index.d.ts +3 -23
- package/dist/apis/spot/index.js +9 -8
- package/dist/apis/spot/index.js.map +1 -1
- package/dist/apis/spot/types.cjs +0 -19
- package/dist/apis/spot/types.d.cts +2 -27
- package/dist/apis/spot/types.d.ts +2 -27
- package/dist/apis/spot/types.js +1 -1
- package/dist/apis/subaccount/SubaccountExecuteAPI.cjs +32 -56
- package/dist/apis/subaccount/SubaccountExecuteAPI.cjs.map +1 -1
- package/dist/apis/subaccount/SubaccountExecuteAPI.d.cts +2 -26
- package/dist/apis/subaccount/SubaccountExecuteAPI.d.ts +2 -26
- package/dist/apis/subaccount/SubaccountExecuteAPI.js +30 -30
- package/dist/apis/subaccount/SubaccountExecuteAPI.js.map +1 -1
- package/dist/apis/subaccount/SubaccountQueryAPI.cjs +48 -72
- package/dist/apis/subaccount/SubaccountQueryAPI.cjs.map +1 -1
- package/dist/apis/subaccount/SubaccountQueryAPI.d.cts +2 -44
- package/dist/apis/subaccount/SubaccountQueryAPI.d.ts +2 -44
- package/dist/apis/subaccount/SubaccountQueryAPI.js +46 -46
- package/dist/apis/subaccount/SubaccountQueryAPI.js.map +1 -1
- package/dist/apis/subaccount/index.cjs +32 -64
- package/dist/apis/subaccount/index.cjs.map +1 -1
- package/dist/apis/subaccount/index.d.cts +3 -27
- package/dist/apis/subaccount/index.d.ts +3 -27
- package/dist/apis/subaccount/index.js +30 -39
- package/dist/apis/subaccount/index.js.map +1 -1
- package/dist/apis/subaccount/types.cjs +0 -19
- package/dist/apis/subaccount/types.d.cts +2 -9
- package/dist/apis/subaccount/types.d.ts +2 -9
- package/dist/apis/subaccount/types.js +1 -1
- package/dist/apis/types.cjs +0 -19
- package/dist/apis/types.d.cts +2 -9
- package/dist/apis/types.d.ts +2 -9
- package/dist/apis/types.js +1 -1
- package/dist/apis/ws/WebSocketExecuteAPI.cjs +42 -70
- package/dist/apis/ws/WebSocketExecuteAPI.cjs.map +1 -1
- package/dist/apis/ws/WebSocketExecuteAPI.d.cts +2 -48
- package/dist/apis/ws/WebSocketExecuteAPI.d.ts +2 -48
- package/dist/apis/ws/WebSocketExecuteAPI.js +40 -44
- package/dist/apis/ws/WebSocketExecuteAPI.js.map +1 -1
- package/dist/apis/ws/WebSocketQueryAPI.cjs +19 -39
- package/dist/apis/ws/WebSocketQueryAPI.cjs.map +1 -1
- package/dist/apis/ws/WebSocketQueryAPI.d.cts +2 -23
- package/dist/apis/ws/WebSocketQueryAPI.d.ts +2 -23
- package/dist/apis/ws/WebSocketQueryAPI.js +17 -13
- package/dist/apis/ws/WebSocketQueryAPI.js.map +1 -1
- package/dist/apis/ws/WebSocketSubscriptionAPI.cjs +40 -58
- package/dist/apis/ws/WebSocketSubscriptionAPI.cjs.map +1 -1
- package/dist/apis/ws/WebSocketSubscriptionAPI.d.cts +2 -37
- package/dist/apis/ws/WebSocketSubscriptionAPI.d.ts +2 -37
- package/dist/apis/ws/WebSocketSubscriptionAPI.js +38 -32
- package/dist/apis/ws/WebSocketSubscriptionAPI.js.map +1 -1
- package/dist/apis/ws/index.cjs +18 -39
- package/dist/apis/ws/index.cjs.map +1 -1
- package/dist/apis/ws/index.d.cts +2 -22
- package/dist/apis/ws/index.d.ts +2 -22
- package/dist/apis/ws/index.js +13 -10
- package/dist/apis/ws/index.js.map +1 -1
- package/dist/base-B92wTsrc.d.ts +20 -0
- package/dist/base-B92wTsrc.d.ts.map +1 -0
- package/dist/base-BYkH_-5-.d.cts +20 -0
- package/dist/base-BYkH_-5-.d.cts.map +1 -0
- package/dist/client.cjs +53 -77
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +28 -49
- package/dist/client.d.cts.map +1 -0
- package/dist/client.d.ts +28 -49
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +46 -46
- package/dist/client.js.map +1 -1
- package/dist/context-YHVv2kD4.d.cts +44 -0
- package/dist/context-YHVv2kD4.d.cts.map +1 -0
- package/dist/context-YfcGQ0Sr.d.ts +44 -0
- package/dist/context-YfcGQ0Sr.d.ts.map +1 -0
- package/dist/context.cjs +92 -122
- package/dist/context.cjs.map +1 -1
- package/dist/context.d.cts +2 -42
- package/dist/context.d.ts +2 -42
- package/dist/context.js +90 -105
- package/dist/context.js.map +1 -1
- package/dist/createNadoClient.cjs +15 -32
- package/dist/createNadoClient.cjs.map +1 -1
- package/dist/createNadoClient.d.cts +5 -32
- package/dist/createNadoClient.d.cts.map +1 -0
- package/dist/createNadoClient.d.ts +5 -32
- package/dist/createNadoClient.d.ts.map +1 -0
- package/dist/createNadoClient.js +13 -8
- package/dist/createNadoClient.js.map +1 -1
- package/dist/index-BFQPcj2w.d.cts +9 -0
- package/dist/index-BFQPcj2w.d.cts.map +1 -0
- package/dist/index-CSG04f_b.d.cts +12 -0
- package/dist/index-CSG04f_b.d.cts.map +1 -0
- package/dist/index-Cc2RdeRK.d.cts +19 -0
- package/dist/index-Cc2RdeRK.d.cts.map +1 -0
- package/dist/index-DIX4yJe-.d.ts +9 -0
- package/dist/index-DIX4yJe-.d.ts.map +1 -0
- package/dist/index-DVJ1Mu6s.d.ts +9 -0
- package/dist/index-DVJ1Mu6s.d.ts.map +1 -0
- package/dist/index-DkTJs2nZ.d.cts +9 -0
- package/dist/index-DkTJs2nZ.d.cts.map +1 -0
- package/dist/index-Dw9iFeeU.d.ts +19 -0
- package/dist/index-Dw9iFeeU.d.ts.map +1 -0
- package/dist/index-Mhjd1FK8.d.ts +12 -0
- package/dist/index-Mhjd1FK8.d.ts.map +1 -0
- package/dist/index-RtQYDuRY.d.ts +19 -0
- package/dist/index-RtQYDuRY.d.ts.map +1 -0
- package/dist/index-jTtf55U_.d.cts +19 -0
- package/dist/index-jTtf55U_.d.cts.map +1 -0
- package/dist/index.cjs +50 -44
- package/dist/index.d.cts +15 -32
- package/dist/index.d.ts +15 -32
- package/dist/index.js +9 -10
- package/dist/types-B-tOIIKl.d.ts +29 -0
- package/dist/types-B-tOIIKl.d.ts.map +1 -0
- package/dist/types-B6oFoDTo.d.ts +11 -0
- package/dist/types-B6oFoDTo.d.ts.map +1 -0
- package/dist/types-BFFzjzRy.d.ts +43 -0
- package/dist/types-BFFzjzRy.d.ts.map +1 -0
- package/dist/types-BWRdhQd_.d.cts +11 -0
- package/dist/types-BWRdhQd_.d.cts.map +1 -0
- package/dist/types-C5DKLOen.d.ts +11 -0
- package/dist/types-C5DKLOen.d.ts.map +1 -0
- package/dist/types-CCj4QJO8.d.cts +29 -0
- package/dist/types-CCj4QJO8.d.cts.map +1 -0
- package/dist/types-D27__G6_.d.cts +11 -0
- package/dist/types-D27__G6_.d.cts.map +1 -0
- package/dist/types-YBdM1sun.d.cts +43 -0
- package/dist/types-YBdM1sun.d.cts.map +1 -0
- package/package.json +11 -11
- package/dist/apis/market/types.cjs.map +0 -1
- package/dist/apis/market/types.js.map +0 -1
- package/dist/apis/spot/types.cjs.map +0 -1
- package/dist/apis/spot/types.js.map +0 -1
- package/dist/apis/subaccount/types.cjs.map +0 -1
- package/dist/apis/subaccount/types.js.map +0 -1
- package/dist/apis/types.cjs.map +0 -1
- package/dist/apis/types.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -1,35 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { BaseSpotAPI } from './BaseSpotAPI.js';
|
|
4
|
-
import { GetTokenWalletBalanceParams, GetTokenAllowanceParams } from './types.js';
|
|
5
|
-
import '@nadohq/shared';
|
|
6
|
-
import '../base.js';
|
|
7
|
-
import '../../context.js';
|
|
8
|
-
import '@nadohq/indexer-client';
|
|
9
|
-
import '@nadohq/trigger-client';
|
|
10
|
-
import 'viem';
|
|
11
|
-
import '../types.js';
|
|
12
|
-
|
|
13
|
-
declare class SpotQueryAPI extends BaseSpotAPI {
|
|
14
|
-
/**
|
|
15
|
-
* Gets the estimated max withdrawable amount for a product
|
|
16
|
-
* @param params
|
|
17
|
-
*/
|
|
18
|
-
getMaxWithdrawable(params: GetEngineMaxWithdrawableParams): Promise<BigNumber__default>;
|
|
19
|
-
/**
|
|
20
|
-
* Queries engine to determine maximum quote amount for minting NLP.
|
|
21
|
-
*
|
|
22
|
-
* @param params
|
|
23
|
-
*/
|
|
24
|
-
getMaxMintNlpAmount(params: GetEngineMaxMintNlpAmountParams): Promise<BigNumber__default>;
|
|
25
|
-
/**
|
|
26
|
-
* Helper to get current token balance in the user's wallet (i.e. not in a Nado subaccount)
|
|
27
|
-
*/
|
|
28
|
-
getTokenWalletBalance({ address, ...rest }: GetTokenWalletBalanceParams): Promise<bigint>;
|
|
29
|
-
/**
|
|
30
|
-
* Helper to get current token allowance
|
|
31
|
-
*/
|
|
32
|
-
getTokenAllowance({ address, ...rest }: GetTokenAllowanceParams): Promise<BigNumber__default>;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export { SpotQueryAPI };
|
|
1
|
+
import { t as SpotQueryAPI } from "../../SpotQueryAPI-CfZcvt4p.js";
|
|
2
|
+
export { SpotQueryAPI };
|
|
@@ -1,49 +1,36 @@
|
|
|
1
|
-
// src/apis/spot/SpotQueryAPI.ts
|
|
2
|
-
import { getValidatedAddress, toBigNumber } from "@nadohq/shared";
|
|
3
1
|
import { BaseSpotAPI } from "./BaseSpotAPI.js";
|
|
2
|
+
import { getValidatedAddress, toBigNumber } from "@nadohq/shared";
|
|
3
|
+
//#region src/apis/spot/SpotQueryAPI.ts
|
|
4
4
|
var SpotQueryAPI = class extends BaseSpotAPI {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*/
|
|
33
|
-
async getTokenAllowance({
|
|
34
|
-
address,
|
|
35
|
-
...rest
|
|
36
|
-
}) {
|
|
37
|
-
const token = await this.getTokenContractForProduct(rest);
|
|
38
|
-
return toBigNumber(
|
|
39
|
-
await token.read.allowance([
|
|
40
|
-
getValidatedAddress(address),
|
|
41
|
-
this.getEndpointAddress()
|
|
42
|
-
])
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
export {
|
|
47
|
-
SpotQueryAPI
|
|
5
|
+
/**
|
|
6
|
+
* Gets the estimated max withdrawable amount for a product
|
|
7
|
+
* @param params
|
|
8
|
+
*/
|
|
9
|
+
async getMaxWithdrawable(params) {
|
|
10
|
+
return this.context.engineClient.getMaxWithdrawable(params);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Queries engine to determine maximum quote amount for minting NLP.
|
|
14
|
+
*
|
|
15
|
+
* @param params
|
|
16
|
+
*/
|
|
17
|
+
async getMaxMintNlpAmount(params) {
|
|
18
|
+
return this.context.engineClient.getMaxMintNlpAmount(params);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Helper to get current token balance in the user's wallet (i.e. not in a Nado subaccount)
|
|
22
|
+
*/
|
|
23
|
+
async getTokenWalletBalance({ address, ...rest }) {
|
|
24
|
+
return (await this.getTokenContractForProduct(rest)).read.balanceOf([getValidatedAddress(address)]);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Helper to get current token allowance
|
|
28
|
+
*/
|
|
29
|
+
async getTokenAllowance({ address, ...rest }) {
|
|
30
|
+
return toBigNumber(await (await this.getTokenContractForProduct(rest)).read.allowance([getValidatedAddress(address), this.getEndpointAddress()]));
|
|
31
|
+
}
|
|
48
32
|
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { SpotQueryAPI };
|
|
35
|
+
|
|
49
36
|
//# sourceMappingURL=SpotQueryAPI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/apis/spot/SpotQueryAPI.ts"],"sourcesContent":["import {\n GetEngineMaxMintNlpAmountParams,\n GetEngineMaxWithdrawableParams,\n} from '@nadohq/engine-client';\nimport { getValidatedAddress, toBigNumber } from '@nadohq/shared';\nimport BigNumber from 'bignumber.js';\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<BigNumber> {\n const token = await this.getTokenContractForProduct(rest);\n return toBigNumber(\n await token.read.allowance([\n getValidatedAddress(address),\n this.getEndpointAddress(),\n ]),\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SpotQueryAPI.js","names":[],"sources":["../../../src/apis/spot/SpotQueryAPI.ts"],"sourcesContent":["import {\n GetEngineMaxMintNlpAmountParams,\n GetEngineMaxWithdrawableParams,\n} from '@nadohq/engine-client';\nimport { getValidatedAddress, toBigNumber } from '@nadohq/shared';\nimport BigNumber from 'bignumber.js';\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<BigNumber> {\n const token = await this.getTokenContractForProduct(rest);\n return toBigNumber(\n await token.read.allowance([\n getValidatedAddress(address),\n this.getEndpointAddress(),\n ]),\n );\n }\n}\n"],"mappings":";;;AASA,IAAa,eAAb,cAAkC,YAAY;;;;;CAK5C,MAAM,mBAAmB,QAAwC;EAC/D,OAAO,KAAK,QAAQ,aAAa,mBAAmB,MAAM;CAC5D;;;;;;CAOA,MAAM,oBAAoB,QAAyC;EACjE,OAAO,KAAK,QAAQ,aAAa,oBAAoB,MAAM;CAC7D;;;;CAKA,MAAM,sBAAsB,EAC1B,SACA,GAAG,QAC4C;EAE/C,QAAO,MADa,KAAK,2BAA2B,IAAI,GAC3C,KAAK,UAAU,CAAC,oBAAoB,OAAO,CAAC,CAAC;CAC5D;;;;CAKA,MAAM,kBAAkB,EACtB,SACA,GAAG,QAC2C;EAE9C,OAAO,YACL,OAAM,MAFY,KAAK,2BAA2B,IAAI,GAE1C,KAAK,UAAU,CACzB,oBAAoB,OAAO,GAC3B,KAAK,mBAAmB,CAC1B,CAAC,CACH;CACF;AACF"}
|
package/dist/apis/spot/index.cjs
CHANGED
|
@@ -1,38 +1,13 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_apis_spot_SpotExecuteAPI = require("./SpotExecuteAPI.cjs");
|
|
3
|
+
const require_apis_spot_SpotQueryAPI = require("./SpotQueryAPI.cjs");
|
|
4
|
+
let ts_mixer = require("ts-mixer");
|
|
5
|
+
//#region src/apis/spot/index.ts
|
|
6
|
+
/**
|
|
7
|
+
* Combined Spot trading API providing both execution and query functionality
|
|
8
|
+
*/
|
|
9
|
+
var SpotAPI = class extends (0, ts_mixer.Mixin)(require_apis_spot_SpotExecuteAPI.SpotExecuteAPI, require_apis_spot_SpotQueryAPI.SpotQueryAPI) {};
|
|
10
|
+
//#endregion
|
|
11
|
+
exports.SpotAPI = SpotAPI;
|
|
20
12
|
|
|
21
|
-
// src/apis/spot/index.ts
|
|
22
|
-
var spot_exports = {};
|
|
23
|
-
__export(spot_exports, {
|
|
24
|
-
SpotAPI: () => SpotAPI
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(spot_exports);
|
|
27
|
-
var import_ts_mixer = require("ts-mixer");
|
|
28
|
-
var import_SpotExecuteAPI = require("./SpotExecuteAPI.cjs");
|
|
29
|
-
var import_SpotQueryAPI = require("./SpotQueryAPI.cjs");
|
|
30
|
-
__reExport(spot_exports, require("./types.cjs"), module.exports);
|
|
31
|
-
var SpotAPI = class extends (0, import_ts_mixer.Mixin)(import_SpotExecuteAPI.SpotExecuteAPI, import_SpotQueryAPI.SpotQueryAPI) {
|
|
32
|
-
};
|
|
33
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
-
0 && (module.exports = {
|
|
35
|
-
SpotAPI,
|
|
36
|
-
...require("./types.cjs")
|
|
37
|
-
});
|
|
38
13
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/apis/spot/index.ts"],"sourcesContent":["import { Mixin } from 'ts-mixer';\nimport { SpotExecuteAPI } from './SpotExecuteAPI';\nimport { SpotQueryAPI } from './SpotQueryAPI';\n\n/**\n * Combined Spot trading API providing both execution and query functionality\n */\nexport class SpotAPI extends Mixin(SpotExecuteAPI, SpotQueryAPI) {}\n\nexport * from './types';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["SpotExecuteAPI","SpotQueryAPI"],"sources":["../../../src/apis/spot/index.ts"],"sourcesContent":["import { Mixin } from 'ts-mixer';\nimport { SpotExecuteAPI } from './SpotExecuteAPI';\nimport { SpotQueryAPI } from './SpotQueryAPI';\n\n/**\n * Combined Spot trading API providing both execution and query functionality\n */\nexport class SpotAPI extends Mixin(SpotExecuteAPI, SpotQueryAPI) {}\n\nexport * from './types';\n"],"mappings":";;;;;;;;AAOA,IAAa,UAAb,eAAA,GAAA,SAAA,OAAmCA,iCAAAA,gBAAgBC,+BAAAA,YAAY,EAAE,CAAC"}
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintMockERC20Params, MintNlpParams, ProductIdOrTokenAddress, TransferQuoteParams, WithdrawCollateralParams } from './types.cjs';
|
|
5
|
-
import '@nadohq/engine-client';
|
|
6
|
-
import '@nadohq/shared';
|
|
7
|
-
import './BaseSpotAPI.cjs';
|
|
8
|
-
import '../base.cjs';
|
|
9
|
-
import '../../context.cjs';
|
|
10
|
-
import '@nadohq/indexer-client';
|
|
11
|
-
import '@nadohq/trigger-client';
|
|
12
|
-
import 'viem';
|
|
13
|
-
import 'bignumber.js';
|
|
14
|
-
import '../types.cjs';
|
|
15
|
-
|
|
16
|
-
declare const SpotAPI_base: ts_mixer_dist_types_types.Class<any[], SpotExecuteAPI & SpotQueryAPI, typeof SpotExecuteAPI & typeof SpotQueryAPI>;
|
|
17
|
-
/**
|
|
18
|
-
* Combined Spot trading API providing both execution and query functionality
|
|
19
|
-
*/
|
|
20
|
-
declare class SpotAPI extends SpotAPI_base {
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export { SpotAPI };
|
|
1
|
+
import { a as MintMockERC20Params, c as TransferQuoteParams, i as GetTokenWalletBalanceParams, l as WithdrawCollateralParams, n as BurnNlpParams, o as MintNlpParams, r as GetTokenAllowanceParams, s as ProductIdOrTokenAddress, t as ApproveAllowanceParams } from "../../types-CCj4QJO8.cjs";
|
|
2
|
+
import { t as SpotAPI } from "../../index-CSG04f_b.cjs";
|
|
3
|
+
export { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintMockERC20Params, MintNlpParams, ProductIdOrTokenAddress, SpotAPI, TransferQuoteParams, WithdrawCollateralParams };
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintMockERC20Params, MintNlpParams, ProductIdOrTokenAddress, TransferQuoteParams, WithdrawCollateralParams } from './types.js';
|
|
5
|
-
import '@nadohq/engine-client';
|
|
6
|
-
import '@nadohq/shared';
|
|
7
|
-
import './BaseSpotAPI.js';
|
|
8
|
-
import '../base.js';
|
|
9
|
-
import '../../context.js';
|
|
10
|
-
import '@nadohq/indexer-client';
|
|
11
|
-
import '@nadohq/trigger-client';
|
|
12
|
-
import 'viem';
|
|
13
|
-
import 'bignumber.js';
|
|
14
|
-
import '../types.js';
|
|
15
|
-
|
|
16
|
-
declare const SpotAPI_base: ts_mixer_dist_types_types.Class<any[], SpotExecuteAPI & SpotQueryAPI, typeof SpotExecuteAPI & typeof SpotQueryAPI>;
|
|
17
|
-
/**
|
|
18
|
-
* Combined Spot trading API providing both execution and query functionality
|
|
19
|
-
*/
|
|
20
|
-
declare class SpotAPI extends SpotAPI_base {
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export { SpotAPI };
|
|
1
|
+
import { a as MintMockERC20Params, c as TransferQuoteParams, i as GetTokenWalletBalanceParams, l as WithdrawCollateralParams, n as BurnNlpParams, o as MintNlpParams, r as GetTokenAllowanceParams, s as ProductIdOrTokenAddress, t as ApproveAllowanceParams } from "../../types-B-tOIIKl.js";
|
|
2
|
+
import { t as SpotAPI } from "../../index-Mhjd1FK8.js";
|
|
3
|
+
export { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintMockERC20Params, MintNlpParams, ProductIdOrTokenAddress, SpotAPI, TransferQuoteParams, WithdrawCollateralParams };
|
package/dist/apis/spot/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
// src/apis/spot/index.ts
|
|
2
|
-
import { Mixin } from "ts-mixer";
|
|
3
1
|
import { SpotExecuteAPI } from "./SpotExecuteAPI.js";
|
|
4
2
|
import { SpotQueryAPI } from "./SpotQueryAPI.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
3
|
+
import { Mixin } from "ts-mixer";
|
|
4
|
+
//#region src/apis/spot/index.ts
|
|
5
|
+
/**
|
|
6
|
+
* Combined Spot trading API providing both execution and query functionality
|
|
7
|
+
*/
|
|
8
|
+
var SpotAPI = class extends Mixin(SpotExecuteAPI, SpotQueryAPI) {};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { SpotAPI };
|
|
11
|
+
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/apis/spot/index.ts"],"sourcesContent":["import { Mixin } from 'ts-mixer';\nimport { SpotExecuteAPI } from './SpotExecuteAPI';\nimport { SpotQueryAPI } from './SpotQueryAPI';\n\n/**\n * Combined Spot trading API providing both execution and query functionality\n */\nexport class SpotAPI extends Mixin(SpotExecuteAPI, SpotQueryAPI) {}\n\nexport * from './types';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/apis/spot/index.ts"],"sourcesContent":["import { Mixin } from 'ts-mixer';\nimport { SpotExecuteAPI } from './SpotExecuteAPI';\nimport { SpotQueryAPI } from './SpotQueryAPI';\n\n/**\n * Combined Spot trading API providing both execution and query functionality\n */\nexport class SpotAPI extends Mixin(SpotExecuteAPI, SpotQueryAPI) {}\n\nexport * from './types';\n"],"mappings":";;;;;;;AAOA,IAAa,UAAb,cAA6B,MAAM,gBAAgB,YAAY,EAAE,CAAC"}
|
package/dist/apis/spot/types.cjs
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// src/apis/spot/types.ts
|
|
17
|
-
var types_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(types_exports);
|
|
19
|
-
//# sourceMappingURL=types.cjs.map
|
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { OptionalSignatureParams, OptionalSubaccountOwner } from '../types.cjs';
|
|
4
|
-
|
|
5
|
-
type ProductIdOrTokenAddress = {
|
|
6
|
-
productId: number;
|
|
7
|
-
} | {
|
|
8
|
-
tokenAddress: string;
|
|
9
|
-
};
|
|
10
|
-
type TokenQueryParams = {
|
|
11
|
-
address: string;
|
|
12
|
-
} & ProductIdOrTokenAddress;
|
|
13
|
-
type ApproveAllowanceParams = ProductIdOrTokenAddress & {
|
|
14
|
-
amount: BigNumberish;
|
|
15
|
-
};
|
|
16
|
-
type GetTokenWalletBalanceParams = TokenQueryParams;
|
|
17
|
-
type GetTokenAllowanceParams = TokenQueryParams;
|
|
18
|
-
type WithdrawCollateralParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineWithdrawCollateralParams>>;
|
|
19
|
-
type TransferQuoteParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineTransferQuoteParams>>;
|
|
20
|
-
type MintNlpParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineMintNlpParams>>;
|
|
21
|
-
type BurnNlpParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineBurnNlpParams>>;
|
|
22
|
-
interface MintMockERC20Params {
|
|
23
|
-
productId: number;
|
|
24
|
-
amount: BigNumberish;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export type { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintMockERC20Params, MintNlpParams, ProductIdOrTokenAddress, TransferQuoteParams, WithdrawCollateralParams };
|
|
1
|
+
import { a as MintMockERC20Params, c as TransferQuoteParams, i as GetTokenWalletBalanceParams, l as WithdrawCollateralParams, n as BurnNlpParams, o as MintNlpParams, r as GetTokenAllowanceParams, s as ProductIdOrTokenAddress, t as ApproveAllowanceParams } from "../../types-CCj4QJO8.cjs";
|
|
2
|
+
export { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintMockERC20Params, MintNlpParams, ProductIdOrTokenAddress, TransferQuoteParams, WithdrawCollateralParams };
|
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { OptionalSignatureParams, OptionalSubaccountOwner } from '../types.js';
|
|
4
|
-
|
|
5
|
-
type ProductIdOrTokenAddress = {
|
|
6
|
-
productId: number;
|
|
7
|
-
} | {
|
|
8
|
-
tokenAddress: string;
|
|
9
|
-
};
|
|
10
|
-
type TokenQueryParams = {
|
|
11
|
-
address: string;
|
|
12
|
-
} & ProductIdOrTokenAddress;
|
|
13
|
-
type ApproveAllowanceParams = ProductIdOrTokenAddress & {
|
|
14
|
-
amount: BigNumberish;
|
|
15
|
-
};
|
|
16
|
-
type GetTokenWalletBalanceParams = TokenQueryParams;
|
|
17
|
-
type GetTokenAllowanceParams = TokenQueryParams;
|
|
18
|
-
type WithdrawCollateralParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineWithdrawCollateralParams>>;
|
|
19
|
-
type TransferQuoteParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineTransferQuoteParams>>;
|
|
20
|
-
type MintNlpParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineMintNlpParams>>;
|
|
21
|
-
type BurnNlpParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineBurnNlpParams>>;
|
|
22
|
-
interface MintMockERC20Params {
|
|
23
|
-
productId: number;
|
|
24
|
-
amount: BigNumberish;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export type { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintMockERC20Params, MintNlpParams, ProductIdOrTokenAddress, TransferQuoteParams, WithdrawCollateralParams };
|
|
1
|
+
import { a as MintMockERC20Params, c as TransferQuoteParams, i as GetTokenWalletBalanceParams, l as WithdrawCollateralParams, n as BurnNlpParams, o as MintNlpParams, r as GetTokenAllowanceParams, s as ProductIdOrTokenAddress, t as ApproveAllowanceParams } from "../../types-B-tOIIKl.js";
|
|
2
|
+
export { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintMockERC20Params, MintNlpParams, ProductIdOrTokenAddress, TransferQuoteParams, WithdrawCollateralParams };
|
package/dist/apis/spot/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
|
@@ -1,59 +1,35 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_apis_base = require("../base.cjs");
|
|
3
|
+
//#region src/apis/subaccount/SubaccountExecuteAPI.ts
|
|
4
|
+
var SubaccountExecuteAPI = class extends require_apis_base.BaseNadoAPI {
|
|
5
|
+
/**
|
|
6
|
+
* Liquidates a subaccount
|
|
7
|
+
*
|
|
8
|
+
* @param params
|
|
9
|
+
*/
|
|
10
|
+
async liquidateSubaccount(params) {
|
|
11
|
+
return this.context.engineClient.liquidateSubaccount({
|
|
12
|
+
...params,
|
|
13
|
+
subaccountOwner: this.getSubaccountOwnerIfNeeded(params),
|
|
14
|
+
verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),
|
|
15
|
+
chainId: this.getWalletClientChainIdIfNeeded(params)
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Links a signer to a subaccount to allow them to sign transactions on behalf of the subaccount
|
|
20
|
+
*
|
|
21
|
+
* @param params
|
|
22
|
+
*/
|
|
23
|
+
async linkSigner(params) {
|
|
24
|
+
return this.context.engineClient.linkSigner({
|
|
25
|
+
...params,
|
|
26
|
+
subaccountOwner: this.getSubaccountOwnerIfNeeded(params),
|
|
27
|
+
verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),
|
|
28
|
+
chainId: this.getWalletClientChainIdIfNeeded(params)
|
|
29
|
+
});
|
|
30
|
+
}
|
|
9
31
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
+
//#endregion
|
|
33
|
+
exports.SubaccountExecuteAPI = SubaccountExecuteAPI;
|
|
19
34
|
|
|
20
|
-
// src/apis/subaccount/SubaccountExecuteAPI.ts
|
|
21
|
-
var SubaccountExecuteAPI_exports = {};
|
|
22
|
-
__export(SubaccountExecuteAPI_exports, {
|
|
23
|
-
SubaccountExecuteAPI: () => SubaccountExecuteAPI
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(SubaccountExecuteAPI_exports);
|
|
26
|
-
var import_base = require("../base.cjs");
|
|
27
|
-
var SubaccountExecuteAPI = class extends import_base.BaseNadoAPI {
|
|
28
|
-
/**
|
|
29
|
-
* Liquidates a subaccount
|
|
30
|
-
*
|
|
31
|
-
* @param params
|
|
32
|
-
*/
|
|
33
|
-
async liquidateSubaccount(params) {
|
|
34
|
-
return this.context.engineClient.liquidateSubaccount({
|
|
35
|
-
...params,
|
|
36
|
-
subaccountOwner: this.getSubaccountOwnerIfNeeded(params),
|
|
37
|
-
verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),
|
|
38
|
-
chainId: this.getWalletClientChainIdIfNeeded(params)
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Links a signer to a subaccount to allow them to sign transactions on behalf of the subaccount
|
|
43
|
-
*
|
|
44
|
-
* @param params
|
|
45
|
-
*/
|
|
46
|
-
async linkSigner(params) {
|
|
47
|
-
return this.context.engineClient.linkSigner({
|
|
48
|
-
...params,
|
|
49
|
-
subaccountOwner: this.getSubaccountOwnerIfNeeded(params),
|
|
50
|
-
verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),
|
|
51
|
-
chainId: this.getWalletClientChainIdIfNeeded(params)
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
-
0 && (module.exports = {
|
|
57
|
-
SubaccountExecuteAPI
|
|
58
|
-
});
|
|
59
35
|
//# sourceMappingURL=SubaccountExecuteAPI.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/apis/subaccount/SubaccountExecuteAPI.ts"],"sourcesContent":["import { BaseNadoAPI } from '../base';\nimport { LinkSignerParams, LiquidateSubaccountParams } from './types';\n\nexport class SubaccountExecuteAPI extends BaseNadoAPI {\n /**\n * Liquidates a subaccount\n *\n * @param params\n */\n async liquidateSubaccount(params: LiquidateSubaccountParams) {\n return this.context.engineClient.liquidateSubaccount({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n });\n }\n\n /**\n * Links a signer to a subaccount to allow them to sign transactions on behalf of the subaccount\n *\n * @param params\n */\n async linkSigner(params: LinkSignerParams) {\n return this.context.engineClient.linkSigner({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n });\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SubaccountExecuteAPI.cjs","names":["BaseNadoAPI"],"sources":["../../../src/apis/subaccount/SubaccountExecuteAPI.ts"],"sourcesContent":["import { BaseNadoAPI } from '../base';\nimport { LinkSignerParams, LiquidateSubaccountParams } from './types';\n\nexport class SubaccountExecuteAPI extends BaseNadoAPI {\n /**\n * Liquidates a subaccount\n *\n * @param params\n */\n async liquidateSubaccount(params: LiquidateSubaccountParams) {\n return this.context.engineClient.liquidateSubaccount({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n });\n }\n\n /**\n * Links a signer to a subaccount to allow them to sign transactions on behalf of the subaccount\n *\n * @param params\n */\n async linkSigner(params: LinkSignerParams) {\n return this.context.engineClient.linkSigner({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n });\n }\n}\n"],"mappings":";;;AAGA,IAAa,uBAAb,cAA0CA,kBAAAA,YAAY;;;;;;CAMpD,MAAM,oBAAoB,QAAmC;EAC3D,OAAO,KAAK,QAAQ,aAAa,oBAAoB;GACnD,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;GAC/D,SAAS,KAAK,+BAA+B,MAAM;EACrD,CAAC;CACH;;;;;;CAOA,MAAM,WAAW,QAA0B;EACzC,OAAO,KAAK,QAAQ,aAAa,WAAW;GAC1C,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;GAC/D,SAAS,KAAK,+BAA+B,MAAM;EACrD,CAAC;CACH;AACF"}
|
|
@@ -1,26 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { LiquidateSubaccountParams, LinkSignerParams } from './types.cjs';
|
|
4
|
-
import '@nadohq/shared';
|
|
5
|
-
import '../../context.cjs';
|
|
6
|
-
import '@nadohq/indexer-client';
|
|
7
|
-
import '@nadohq/trigger-client';
|
|
8
|
-
import 'viem';
|
|
9
|
-
import '../types.cjs';
|
|
10
|
-
|
|
11
|
-
declare class SubaccountExecuteAPI extends BaseNadoAPI {
|
|
12
|
-
/**
|
|
13
|
-
* Liquidates a subaccount
|
|
14
|
-
*
|
|
15
|
-
* @param params
|
|
16
|
-
*/
|
|
17
|
-
liquidateSubaccount(params: LiquidateSubaccountParams): Promise<_nadohq_engine_client.EngineServerExecuteSuccessResult<"liquidate_subaccount">>;
|
|
18
|
-
/**
|
|
19
|
-
* Links a signer to a subaccount to allow them to sign transactions on behalf of the subaccount
|
|
20
|
-
*
|
|
21
|
-
* @param params
|
|
22
|
-
*/
|
|
23
|
-
linkSigner(params: LinkSignerParams): Promise<_nadohq_engine_client.EngineServerExecuteSuccessResult<"link_signer">>;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { SubaccountExecuteAPI };
|
|
1
|
+
import { t as SubaccountExecuteAPI } from "../../SubaccountExecuteAPI-DhHBzzdk.cjs";
|
|
2
|
+
export { SubaccountExecuteAPI };
|
|
@@ -1,26 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { LiquidateSubaccountParams, LinkSignerParams } from './types.js';
|
|
4
|
-
import '@nadohq/shared';
|
|
5
|
-
import '../../context.js';
|
|
6
|
-
import '@nadohq/indexer-client';
|
|
7
|
-
import '@nadohq/trigger-client';
|
|
8
|
-
import 'viem';
|
|
9
|
-
import '../types.js';
|
|
10
|
-
|
|
11
|
-
declare class SubaccountExecuteAPI extends BaseNadoAPI {
|
|
12
|
-
/**
|
|
13
|
-
* Liquidates a subaccount
|
|
14
|
-
*
|
|
15
|
-
* @param params
|
|
16
|
-
*/
|
|
17
|
-
liquidateSubaccount(params: LiquidateSubaccountParams): Promise<_nadohq_engine_client.EngineServerExecuteSuccessResult<"liquidate_subaccount">>;
|
|
18
|
-
/**
|
|
19
|
-
* Links a signer to a subaccount to allow them to sign transactions on behalf of the subaccount
|
|
20
|
-
*
|
|
21
|
-
* @param params
|
|
22
|
-
*/
|
|
23
|
-
linkSigner(params: LinkSignerParams): Promise<_nadohq_engine_client.EngineServerExecuteSuccessResult<"link_signer">>;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { SubaccountExecuteAPI };
|
|
1
|
+
import { t as SubaccountExecuteAPI } from "../../SubaccountExecuteAPI-KApMbONz.js";
|
|
2
|
+
export { SubaccountExecuteAPI };
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
// src/apis/subaccount/SubaccountExecuteAPI.ts
|
|
2
1
|
import { BaseNadoAPI } from "../base.js";
|
|
2
|
+
//#region src/apis/subaccount/SubaccountExecuteAPI.ts
|
|
3
3
|
var SubaccountExecuteAPI = class extends BaseNadoAPI {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
};
|
|
31
|
-
export {
|
|
32
|
-
SubaccountExecuteAPI
|
|
4
|
+
/**
|
|
5
|
+
* Liquidates a subaccount
|
|
6
|
+
*
|
|
7
|
+
* @param params
|
|
8
|
+
*/
|
|
9
|
+
async liquidateSubaccount(params) {
|
|
10
|
+
return this.context.engineClient.liquidateSubaccount({
|
|
11
|
+
...params,
|
|
12
|
+
subaccountOwner: this.getSubaccountOwnerIfNeeded(params),
|
|
13
|
+
verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),
|
|
14
|
+
chainId: this.getWalletClientChainIdIfNeeded(params)
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Links a signer to a subaccount to allow them to sign transactions on behalf of the subaccount
|
|
19
|
+
*
|
|
20
|
+
* @param params
|
|
21
|
+
*/
|
|
22
|
+
async linkSigner(params) {
|
|
23
|
+
return this.context.engineClient.linkSigner({
|
|
24
|
+
...params,
|
|
25
|
+
subaccountOwner: this.getSubaccountOwnerIfNeeded(params),
|
|
26
|
+
verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),
|
|
27
|
+
chainId: this.getWalletClientChainIdIfNeeded(params)
|
|
28
|
+
});
|
|
29
|
+
}
|
|
33
30
|
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { SubaccountExecuteAPI };
|
|
33
|
+
|
|
34
34
|
//# sourceMappingURL=SubaccountExecuteAPI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/apis/subaccount/SubaccountExecuteAPI.ts"],"sourcesContent":["import { BaseNadoAPI } from '../base';\nimport { LinkSignerParams, LiquidateSubaccountParams } from './types';\n\nexport class SubaccountExecuteAPI extends BaseNadoAPI {\n /**\n * Liquidates a subaccount\n *\n * @param params\n */\n async liquidateSubaccount(params: LiquidateSubaccountParams) {\n return this.context.engineClient.liquidateSubaccount({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n });\n }\n\n /**\n * Links a signer to a subaccount to allow them to sign transactions on behalf of the subaccount\n *\n * @param params\n */\n async linkSigner(params: LinkSignerParams) {\n return this.context.engineClient.linkSigner({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n });\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SubaccountExecuteAPI.js","names":[],"sources":["../../../src/apis/subaccount/SubaccountExecuteAPI.ts"],"sourcesContent":["import { BaseNadoAPI } from '../base';\nimport { LinkSignerParams, LiquidateSubaccountParams } from './types';\n\nexport class SubaccountExecuteAPI extends BaseNadoAPI {\n /**\n * Liquidates a subaccount\n *\n * @param params\n */\n async liquidateSubaccount(params: LiquidateSubaccountParams) {\n return this.context.engineClient.liquidateSubaccount({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n });\n }\n\n /**\n * Links a signer to a subaccount to allow them to sign transactions on behalf of the subaccount\n *\n * @param params\n */\n async linkSigner(params: LinkSignerParams) {\n return this.context.engineClient.linkSigner({\n ...params,\n subaccountOwner: this.getSubaccountOwnerIfNeeded(params),\n verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),\n chainId: this.getWalletClientChainIdIfNeeded(params),\n });\n }\n}\n"],"mappings":";;AAGA,IAAa,uBAAb,cAA0C,YAAY;;;;;;CAMpD,MAAM,oBAAoB,QAAmC;EAC3D,OAAO,KAAK,QAAQ,aAAa,oBAAoB;GACnD,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;GAC/D,SAAS,KAAK,+BAA+B,MAAM;EACrD,CAAC;CACH;;;;;;CAOA,MAAM,WAAW,QAA0B;EACzC,OAAO,KAAK,QAAQ,aAAa,WAAW;GAC1C,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;GAC/D,SAAS,KAAK,+BAA+B,MAAM;EACrD,CAAC;CACH;AACF"}
|