@nadohq/client 0.53.0 → 0.54.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.
@@ -1,25 +1,17 @@
1
1
  import { i as GetTokenWalletBalanceParams, r as GetTokenAllowanceParams } from "./types-Caq8UZ8J.cjs";
2
2
  import { t as BaseSpotAPI } from "./BaseSpotAPI-DCsJiSaU.cjs";
3
- import { GetEngineDynamicFeeQuoteParams, GetEngineDynamicFeeQuoteResponse, GetEngineMaxMintNlpAmountParams, GetEngineMaxWithdrawableParams, GetEngineMaxWithdrawableResponse, GetEngineMaxWithdrawableWithDynamicFeeResponse } from "@nadohq/engine-client";
3
+ import { GetEngineDynamicFeeQuoteParams, GetEngineDynamicFeeQuoteResponse, GetEngineMaxMintNlpAmountParams, GetEngineMaxWithdrawableParams, GetEngineMaxWithdrawableResponse } from "@nadohq/engine-client";
4
4
  import BigNumber from "bignumber.js";
5
5
 
6
6
  //#region src/apis/spot/SpotQueryAPI.d.ts
7
7
  declare class SpotQueryAPI extends BaseSpotAPI {
8
8
  /**
9
- * Gets the estimated max withdrawable amount for a product
9
+ * Gets the estimated max withdrawable amount for a product, or the max transferable quote amount
10
+ * to a recipient when `recipientSubaccountName` is set (requires `productId` 0), with the current
11
+ * dynamic fee reserved. The reserved fee is returned as `fee`.
10
12
  * @param params
11
13
  */
12
14
  getMaxWithdrawable(params: GetEngineMaxWithdrawableParams): Promise<GetEngineMaxWithdrawableResponse>;
13
- /**
14
- * Gets the estimated max withdrawable amount for a product, with the current dynamic fee of
15
- * Withdraw Collateral V2 reserved instead of the flat fee. The reserved fee is returned as
16
- * `fee`.
17
- * @param params
18
- * @returns The max withdrawable with the current dynamic fee reserved, and the reserved fee.
19
- */
20
- getMaxWithdrawable(params: GetEngineMaxWithdrawableParams, options: {
21
- withDynamicFee: true;
22
- }): Promise<GetEngineMaxWithdrawableWithDynamicFeeResponse>;
23
15
  /**
24
16
  * Gets the current dynamic fee for a V2 withdrawal or V2 quote transfer. The fee is priced
25
17
  * again at execution, so pass a `maxFeeX18` with some headroom when executing.
@@ -50,4 +42,4 @@ declare class SpotQueryAPI extends BaseSpotAPI {
50
42
  }
51
43
  //#endregion
52
44
  export { SpotQueryAPI as t };
53
- //# sourceMappingURL=SpotQueryAPI-GvWSoN94.d.cts.map
45
+ //# sourceMappingURL=SpotQueryAPI-CG3SHDBT.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SpotQueryAPI-CG3SHDBT.d.cts","names":[],"sources":["../src/apis/spot/src/apis/spot/SpotQueryAPI.ts"],"mappings":";;;;;;cAYa,YAAA,SAAqB,WAAA;;AAAlC;;;;;EAOQ,kBAAA,CACJ,MAAA,EAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;EAWD;;;;;;EADJ,kBAAA,CACJ,MAAA,EAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;EAmBR;;;;;EAVG,mBAAA,CAAoB,MAAA,EAAQ,+BAAA,GAA+B,OAAA,CAAA,SAAA;EA9BjC;;;EAqC1B,qBAAA,CAAA;IACJ,OAAA;IAAA,GACG;EAAA,GACF,2BAAA,GAA8B,OAAA;EAjC3B;;;EAyCA,iBAAA,CAAA;IACJ,OAAA;IAAA,GACG;EAAA,GACF,uBAAA,GAA0B,OAAA,CAAQ,SAAA;AAAA"}
@@ -1,25 +1,17 @@
1
1
  import { i as GetTokenWalletBalanceParams, r as GetTokenAllowanceParams } from "./types-DXQWU3Dg.js";
2
2
  import { t as BaseSpotAPI } from "./BaseSpotAPI-kj3rVPSC.js";
3
- import { GetEngineDynamicFeeQuoteParams, GetEngineDynamicFeeQuoteResponse, GetEngineMaxMintNlpAmountParams, GetEngineMaxWithdrawableParams, GetEngineMaxWithdrawableResponse, GetEngineMaxWithdrawableWithDynamicFeeResponse } from "@nadohq/engine-client";
3
+ import { GetEngineDynamicFeeQuoteParams, GetEngineDynamicFeeQuoteResponse, GetEngineMaxMintNlpAmountParams, GetEngineMaxWithdrawableParams, GetEngineMaxWithdrawableResponse } from "@nadohq/engine-client";
4
4
  import BigNumber from "bignumber.js";
5
5
 
6
6
  //#region src/apis/spot/SpotQueryAPI.d.ts
7
7
  declare class SpotQueryAPI extends BaseSpotAPI {
8
8
  /**
9
- * Gets the estimated max withdrawable amount for a product
9
+ * Gets the estimated max withdrawable amount for a product, or the max transferable quote amount
10
+ * to a recipient when `recipientSubaccountName` is set (requires `productId` 0), with the current
11
+ * dynamic fee reserved. The reserved fee is returned as `fee`.
10
12
  * @param params
11
13
  */
12
14
  getMaxWithdrawable(params: GetEngineMaxWithdrawableParams): Promise<GetEngineMaxWithdrawableResponse>;
13
- /**
14
- * Gets the estimated max withdrawable amount for a product, with the current dynamic fee of
15
- * Withdraw Collateral V2 reserved instead of the flat fee. The reserved fee is returned as
16
- * `fee`.
17
- * @param params
18
- * @returns The max withdrawable with the current dynamic fee reserved, and the reserved fee.
19
- */
20
- getMaxWithdrawable(params: GetEngineMaxWithdrawableParams, options: {
21
- withDynamicFee: true;
22
- }): Promise<GetEngineMaxWithdrawableWithDynamicFeeResponse>;
23
15
  /**
24
16
  * Gets the current dynamic fee for a V2 withdrawal or V2 quote transfer. The fee is priced
25
17
  * again at execution, so pass a `maxFeeX18` with some headroom when executing.
@@ -50,4 +42,4 @@ declare class SpotQueryAPI extends BaseSpotAPI {
50
42
  }
51
43
  //#endregion
52
44
  export { SpotQueryAPI as t };
53
- //# sourceMappingURL=SpotQueryAPI-BBLKIvGJ.d.ts.map
45
+ //# sourceMappingURL=SpotQueryAPI-D_dmKgx9.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SpotQueryAPI-D_dmKgx9.d.ts","names":[],"sources":["../src/apis/spot/src/apis/spot/SpotQueryAPI.ts"],"mappings":";;;;;;cAYa,YAAA,SAAqB,WAAA;;AAAlC;;;;;EAOQ,kBAAA,CACJ,MAAA,EAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;EAWD;;;;;;EADJ,kBAAA,CACJ,MAAA,EAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;EAmBR;;;;;EAVG,mBAAA,CAAoB,MAAA,EAAQ,+BAAA,GAA+B,OAAA,CAAA,SAAA;EA9BjC;;;EAqC1B,qBAAA,CAAA;IACJ,OAAA;IAAA,GACG;EAAA,GACF,2BAAA,GAA8B,OAAA;EAjC3B;;;EAyCA,iBAAA,CAAA;IACJ,OAAA;IAAA,GACG;EAAA,GACF,uBAAA,GAA0B,OAAA,CAAQ,SAAA;AAAA"}
@@ -3,8 +3,13 @@ const require_apis_spot_BaseSpotAPI = require("./BaseSpotAPI.cjs");
3
3
  let _nadohq_shared = require("@nadohq/shared");
4
4
  //#region src/apis/spot/SpotQueryAPI.ts
5
5
  var SpotQueryAPI = class extends require_apis_spot_BaseSpotAPI.BaseSpotAPI {
6
- async getMaxWithdrawable(params, options) {
7
- if (options?.withDynamicFee) return this.context.engineClient.getMaxWithdrawable(params, { withDynamicFee: true });
6
+ /**
7
+ * Gets the estimated max withdrawable amount for a product, or the max transferable quote amount
8
+ * to a recipient when `recipientSubaccountName` is set (requires `productId` 0), with the current
9
+ * dynamic fee reserved. The reserved fee is returned as `fee`.
10
+ * @param params
11
+ */
12
+ async getMaxWithdrawable(params) {
8
13
  return this.context.engineClient.getMaxWithdrawable(params);
9
14
  }
10
15
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"SpotQueryAPI.cjs","names":["BaseSpotAPI"],"sources":["../../../src/apis/spot/SpotQueryAPI.ts"],"sourcesContent":["import {\n GetEngineDynamicFeeQuoteParams,\n GetEngineDynamicFeeQuoteResponse,\n GetEngineMaxMintNlpAmountParams,\n GetEngineMaxWithdrawableParams,\n GetEngineMaxWithdrawableResponse,\n GetEngineMaxWithdrawableWithDynamicFeeResponse,\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(\n params: GetEngineMaxWithdrawableParams,\n ): Promise<GetEngineMaxWithdrawableResponse>;\n /**\n * Gets the estimated max withdrawable amount for a product, with the current dynamic fee of\n * Withdraw Collateral V2 reserved instead of the flat fee. The reserved fee is returned as\n * `fee`.\n * @param params\n * @returns The max withdrawable with the current dynamic fee reserved, and the reserved fee.\n */\n async getMaxWithdrawable(\n params: GetEngineMaxWithdrawableParams,\n options: { withDynamicFee: true },\n ): Promise<GetEngineMaxWithdrawableWithDynamicFeeResponse>;\n async getMaxWithdrawable(\n params: GetEngineMaxWithdrawableParams,\n options?: { withDynamicFee?: boolean },\n ): Promise<\n | GetEngineMaxWithdrawableResponse\n | GetEngineMaxWithdrawableWithDynamicFeeResponse\n > {\n if (options?.withDynamicFee) {\n return this.context.engineClient.getMaxWithdrawable(params, {\n withDynamicFee: true,\n });\n }\n\n return this.context.engineClient.getMaxWithdrawable(params);\n }\n\n /**\n * Gets the current dynamic fee for a V2 withdrawal or V2 quote transfer. The fee is priced\n * again at execution, so pass a `maxFeeX18` with some headroom when executing.\n * @param params\n * @returns The current required fee, the fee cap, and the V2 demand pressure.\n */\n async getDynamicFeeQuote(\n params: GetEngineDynamicFeeQuoteParams,\n ): Promise<GetEngineDynamicFeeQuoteResponse> {\n return this.context.engineClient.getDynamicFeeQuote(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":";;;;AAaA,IAAa,eAAb,cAAkCA,8BAAAA,YAAY;CAmB5C,MAAM,mBACJ,QACA,SAIA;EACA,IAAI,SAAS,gBACX,OAAO,KAAK,QAAQ,aAAa,mBAAmB,QAAQ,EAC1D,gBAAgB,KAClB,CAAC;EAGH,OAAO,KAAK,QAAQ,aAAa,mBAAmB,MAAM;CAC5D;;;;;;;CAQA,MAAM,mBACJ,QAC2C;EAC3C,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,EAAA,GAAA,eAAA,qBAAqB,OAAO,CAAC,CAAC;CAC5D;;;;CAKA,MAAM,kBAAkB,EACtB,SACA,GAAG,QAC2C;EAE9C,QAAA,GAAA,eAAA,aACE,OAAM,MAFY,KAAK,2BAA2B,IAAI,GAE1C,KAAK,UAAU,EAAA,GAAA,eAAA,qBACL,OAAO,GAC3B,KAAK,mBAAmB,CAC1B,CAAC,CACH;CACF;AACF"}
1
+ {"version":3,"file":"SpotQueryAPI.cjs","names":["BaseSpotAPI"],"sources":["../../../src/apis/spot/SpotQueryAPI.ts"],"sourcesContent":["import {\n GetEngineDynamicFeeQuoteParams,\n GetEngineDynamicFeeQuoteResponse,\n GetEngineMaxMintNlpAmountParams,\n GetEngineMaxWithdrawableParams,\n GetEngineMaxWithdrawableResponse,\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, or the max transferable quote amount\n * to a recipient when `recipientSubaccountName` is set (requires `productId` 0), with the current\n * dynamic fee reserved. The reserved fee is returned as `fee`.\n * @param params\n */\n async getMaxWithdrawable(\n params: GetEngineMaxWithdrawableParams,\n ): Promise<GetEngineMaxWithdrawableResponse> {\n return this.context.engineClient.getMaxWithdrawable(params);\n }\n\n /**\n * Gets the current dynamic fee for a V2 withdrawal or V2 quote transfer. The fee is priced\n * again at execution, so pass a `maxFeeX18` with some headroom when executing.\n * @param params\n * @returns The current required fee, the fee cap, and the V2 demand pressure.\n */\n async getDynamicFeeQuote(\n params: GetEngineDynamicFeeQuoteParams,\n ): Promise<GetEngineDynamicFeeQuoteResponse> {\n return this.context.engineClient.getDynamicFeeQuote(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":";;;;AAYA,IAAa,eAAb,cAAkCA,8BAAAA,YAAY;;;;;;;CAO5C,MAAM,mBACJ,QAC2C;EAC3C,OAAO,KAAK,QAAQ,aAAa,mBAAmB,MAAM;CAC5D;;;;;;;CAQA,MAAM,mBACJ,QAC2C;EAC3C,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,EAAA,GAAA,eAAA,qBAAqB,OAAO,CAAC,CAAC;CAC5D;;;;CAKA,MAAM,kBAAkB,EACtB,SACA,GAAG,QAC2C;EAE9C,QAAA,GAAA,eAAA,aACE,OAAM,MAFY,KAAK,2BAA2B,IAAI,GAE1C,KAAK,UAAU,EAAA,GAAA,eAAA,qBACL,OAAO,GAC3B,KAAK,mBAAmB,CAC1B,CAAC,CACH;CACF;AACF"}
@@ -1,2 +1,2 @@
1
- import { t as SpotQueryAPI } from "../../SpotQueryAPI-GvWSoN94.cjs";
1
+ import { t as SpotQueryAPI } from "../../SpotQueryAPI-CG3SHDBT.cjs";
2
2
  export { SpotQueryAPI };
@@ -1,2 +1,2 @@
1
- import { t as SpotQueryAPI } from "../../SpotQueryAPI-BBLKIvGJ.js";
1
+ import { t as SpotQueryAPI } from "../../SpotQueryAPI-D_dmKgx9.js";
2
2
  export { SpotQueryAPI };
@@ -2,8 +2,13 @@ import { BaseSpotAPI } from "./BaseSpotAPI.js";
2
2
  import { getValidatedAddress, toBigNumber } from "@nadohq/shared";
3
3
  //#region src/apis/spot/SpotQueryAPI.ts
4
4
  var SpotQueryAPI = class extends BaseSpotAPI {
5
- async getMaxWithdrawable(params, options) {
6
- if (options?.withDynamicFee) return this.context.engineClient.getMaxWithdrawable(params, { withDynamicFee: true });
5
+ /**
6
+ * Gets the estimated max withdrawable amount for a product, or the max transferable quote amount
7
+ * to a recipient when `recipientSubaccountName` is set (requires `productId` 0), with the current
8
+ * dynamic fee reserved. The reserved fee is returned as `fee`.
9
+ * @param params
10
+ */
11
+ async getMaxWithdrawable(params) {
7
12
  return this.context.engineClient.getMaxWithdrawable(params);
8
13
  }
9
14
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"SpotQueryAPI.js","names":[],"sources":["../../../src/apis/spot/SpotQueryAPI.ts"],"sourcesContent":["import {\n GetEngineDynamicFeeQuoteParams,\n GetEngineDynamicFeeQuoteResponse,\n GetEngineMaxMintNlpAmountParams,\n GetEngineMaxWithdrawableParams,\n GetEngineMaxWithdrawableResponse,\n GetEngineMaxWithdrawableWithDynamicFeeResponse,\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(\n params: GetEngineMaxWithdrawableParams,\n ): Promise<GetEngineMaxWithdrawableResponse>;\n /**\n * Gets the estimated max withdrawable amount for a product, with the current dynamic fee of\n * Withdraw Collateral V2 reserved instead of the flat fee. The reserved fee is returned as\n * `fee`.\n * @param params\n * @returns The max withdrawable with the current dynamic fee reserved, and the reserved fee.\n */\n async getMaxWithdrawable(\n params: GetEngineMaxWithdrawableParams,\n options: { withDynamicFee: true },\n ): Promise<GetEngineMaxWithdrawableWithDynamicFeeResponse>;\n async getMaxWithdrawable(\n params: GetEngineMaxWithdrawableParams,\n options?: { withDynamicFee?: boolean },\n ): Promise<\n | GetEngineMaxWithdrawableResponse\n | GetEngineMaxWithdrawableWithDynamicFeeResponse\n > {\n if (options?.withDynamicFee) {\n return this.context.engineClient.getMaxWithdrawable(params, {\n withDynamicFee: true,\n });\n }\n\n return this.context.engineClient.getMaxWithdrawable(params);\n }\n\n /**\n * Gets the current dynamic fee for a V2 withdrawal or V2 quote transfer. The fee is priced\n * again at execution, so pass a `maxFeeX18` with some headroom when executing.\n * @param params\n * @returns The current required fee, the fee cap, and the V2 demand pressure.\n */\n async getDynamicFeeQuote(\n params: GetEngineDynamicFeeQuoteParams,\n ): Promise<GetEngineDynamicFeeQuoteResponse> {\n return this.context.engineClient.getDynamicFeeQuote(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":";;;AAaA,IAAa,eAAb,cAAkC,YAAY;CAmB5C,MAAM,mBACJ,QACA,SAIA;EACA,IAAI,SAAS,gBACX,OAAO,KAAK,QAAQ,aAAa,mBAAmB,QAAQ,EAC1D,gBAAgB,KAClB,CAAC;EAGH,OAAO,KAAK,QAAQ,aAAa,mBAAmB,MAAM;CAC5D;;;;;;;CAQA,MAAM,mBACJ,QAC2C;EAC3C,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"}
1
+ {"version":3,"file":"SpotQueryAPI.js","names":[],"sources":["../../../src/apis/spot/SpotQueryAPI.ts"],"sourcesContent":["import {\n GetEngineDynamicFeeQuoteParams,\n GetEngineDynamicFeeQuoteResponse,\n GetEngineMaxMintNlpAmountParams,\n GetEngineMaxWithdrawableParams,\n GetEngineMaxWithdrawableResponse,\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, or the max transferable quote amount\n * to a recipient when `recipientSubaccountName` is set (requires `productId` 0), with the current\n * dynamic fee reserved. The reserved fee is returned as `fee`.\n * @param params\n */\n async getMaxWithdrawable(\n params: GetEngineMaxWithdrawableParams,\n ): Promise<GetEngineMaxWithdrawableResponse> {\n return this.context.engineClient.getMaxWithdrawable(params);\n }\n\n /**\n * Gets the current dynamic fee for a V2 withdrawal or V2 quote transfer. The fee is priced\n * again at execution, so pass a `maxFeeX18` with some headroom when executing.\n * @param params\n * @returns The current required fee, the fee cap, and the V2 demand pressure.\n */\n async getDynamicFeeQuote(\n params: GetEngineDynamicFeeQuoteParams,\n ): Promise<GetEngineDynamicFeeQuoteResponse> {\n return this.context.engineClient.getDynamicFeeQuote(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":";;;AAYA,IAAa,eAAb,cAAkC,YAAY;;;;;;;CAO5C,MAAM,mBACJ,QAC2C;EAC3C,OAAO,KAAK,QAAQ,aAAa,mBAAmB,MAAM;CAC5D;;;;;;;CAQA,MAAM,mBACJ,QAC2C;EAC3C,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"}
@@ -1,3 +1,3 @@
1
1
  import { a as MintMockERC20Params, c as TransferQuoteParams, d as WithdrawCollateralV2Params, i as GetTokenWalletBalanceParams, l as TransferQuoteV2Params, n as BurnNlpParams, o as MintNlpParams, r as GetTokenAllowanceParams, s as ProductIdOrTokenAddress, t as ApproveAllowanceParams, u as WithdrawCollateralParams } from "../../types-Caq8UZ8J.cjs";
2
- import { t as SpotAPI } from "../../index-B44dQYOt.cjs";
2
+ import { t as SpotAPI } from "../../index-Dt0GXh8D.cjs";
3
3
  export { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintMockERC20Params, MintNlpParams, ProductIdOrTokenAddress, SpotAPI, TransferQuoteParams, TransferQuoteV2Params, WithdrawCollateralParams, WithdrawCollateralV2Params };
@@ -1,3 +1,3 @@
1
1
  import { a as MintMockERC20Params, c as TransferQuoteParams, d as WithdrawCollateralV2Params, i as GetTokenWalletBalanceParams, l as TransferQuoteV2Params, n as BurnNlpParams, o as MintNlpParams, r as GetTokenAllowanceParams, s as ProductIdOrTokenAddress, t as ApproveAllowanceParams, u as WithdrawCollateralParams } from "../../types-DXQWU3Dg.js";
2
- import { t as SpotAPI } from "../../index-DlJeayLR.js";
2
+ import { t as SpotAPI } from "../../index--m7yZpQu.js";
3
3
  export { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintMockERC20Params, MintNlpParams, ProductIdOrTokenAddress, SpotAPI, TransferQuoteParams, TransferQuoteV2Params, WithdrawCollateralParams, WithdrawCollateralV2Params };
package/dist/client.d.cts CHANGED
@@ -2,7 +2,7 @@ import { r as NadoClientContext } from "./context-DnJSqTLC.cjs";
2
2
  import { t as MarketAPI } from "./index-CsAkM9rG.cjs";
3
3
  import { t as PerpAPI } from "./index-D7D-gJ5H.cjs";
4
4
  import { t as RewardsAPI } from "./index-CaHqV6zm.cjs";
5
- import { t as SpotAPI } from "./index-B44dQYOt.cjs";
5
+ import { t as SpotAPI } from "./index-Dt0GXh8D.cjs";
6
6
  import { t as SubaccountAPI } from "./index-BKXL9EgP.cjs";
7
7
  import { t as WebsocketAPI } from "./index-D9w2TtoN.cjs";
8
8
  import { WalletClientWithAccount } from "@nadohq/shared";
package/dist/client.d.ts CHANGED
@@ -2,7 +2,7 @@ import { r as NadoClientContext } from "./context-DLwmlDFU.js";
2
2
  import { t as MarketAPI } from "./index-D4VVXjdj.js";
3
3
  import { t as PerpAPI } from "./index-DKuDOwSh.js";
4
4
  import { t as RewardsAPI } from "./index-BOjdI8Tw.js";
5
- import { t as SpotAPI } from "./index-DlJeayLR.js";
5
+ import { t as SpotAPI } from "./index--m7yZpQu.js";
6
6
  import { t as SubaccountAPI } from "./index-_sKgQEvR.js";
7
7
  import { t as WebsocketAPI } from "./index-BvLzbcxb.js";
8
8
  import { WalletClientWithAccount } from "@nadohq/shared";
@@ -1,5 +1,5 @@
1
1
  import { t as SpotExecuteAPI } from "./SpotExecuteAPI-D3-EOC-H.js";
2
- import { t as SpotQueryAPI } from "./SpotQueryAPI-BBLKIvGJ.js";
2
+ import { t as SpotQueryAPI } from "./SpotQueryAPI-D_dmKgx9.js";
3
3
 
4
4
  //#region src/apis/spot/index.d.ts
5
5
  declare const SpotAPI_base: import("ts-mixer/dist/types/types").Class<any[], SpotExecuteAPI & SpotQueryAPI, typeof SpotExecuteAPI & typeof SpotQueryAPI>;
@@ -9,4 +9,4 @@ declare const SpotAPI_base: import("ts-mixer/dist/types/types").Class<any[], Spo
9
9
  declare class SpotAPI extends SpotAPI_base {}
10
10
  //#endregion
11
11
  export { SpotAPI as t };
12
- //# sourceMappingURL=index-DlJeayLR.d.ts.map
12
+ //# sourceMappingURL=index--m7yZpQu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index--m7yZpQu.d.ts","names":[],"sources":["../src/apis/spot/src/apis/spot/index.ts"],"mappings":";;;;cAE8C,YAAA;;;AAAA;cAKjC,OAAA,SAAgB,YAAmC"}
@@ -1,5 +1,5 @@
1
1
  import { t as SpotExecuteAPI } from "./SpotExecuteAPI-CXbeLCsc.cjs";
2
- import { t as SpotQueryAPI } from "./SpotQueryAPI-GvWSoN94.cjs";
2
+ import { t as SpotQueryAPI } from "./SpotQueryAPI-CG3SHDBT.cjs";
3
3
 
4
4
  //#region src/apis/spot/index.d.ts
5
5
  declare const SpotAPI_base: import("ts-mixer/dist/types/types").Class<any[], SpotExecuteAPI & SpotQueryAPI, typeof SpotExecuteAPI & typeof SpotQueryAPI>;
@@ -9,4 +9,4 @@ declare const SpotAPI_base: import("ts-mixer/dist/types/types").Class<any[], Spo
9
9
  declare class SpotAPI extends SpotAPI_base {}
10
10
  //#endregion
11
11
  export { SpotAPI as t };
12
- //# sourceMappingURL=index-B44dQYOt.d.cts.map
12
+ //# sourceMappingURL=index-Dt0GXh8D.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-Dt0GXh8D.d.cts","names":[],"sources":["../src/apis/spot/src/apis/spot/index.ts"],"mappings":";;;;cAE8C,YAAA;;;AAAA;cAKjC,OAAA,SAAgB,YAAmC"}
package/dist/index.d.cts CHANGED
@@ -5,7 +5,7 @@ import { t as PerpAPI } from "./index-D7D-gJ5H.cjs";
5
5
  import { n as GetClaimedAirdropAmountsParams, t as AirdropAddressParams } from "./types-xRxFR-cw.cjs";
6
6
  import { t as RewardsAPI } from "./index-CaHqV6zm.cjs";
7
7
  import { a as MintMockERC20Params, c as TransferQuoteParams, d as WithdrawCollateralV2Params, i as GetTokenWalletBalanceParams, l as TransferQuoteV2Params, n as BurnNlpParams, o as MintNlpParams, r as GetTokenAllowanceParams, s as ProductIdOrTokenAddress, t as ApproveAllowanceParams, u as WithdrawCollateralParams } from "./types-Caq8UZ8J.cjs";
8
- import { t as SpotAPI } from "./index-B44dQYOt.cjs";
8
+ import { t as SpotAPI } from "./index-Dt0GXh8D.cjs";
9
9
  import { n as LinkSignerParams, r as LiquidateSubaccountParams, t as CreateStandardLinkedSignerResult } from "./types-BiFd3gnp.cjs";
10
10
  import { t as SubaccountAPI } from "./index-BKXL9EgP.cjs";
11
11
  import { NadoClient } from "./client.cjs";
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ import { t as PerpAPI } from "./index-DKuDOwSh.js";
5
5
  import { n as GetClaimedAirdropAmountsParams, t as AirdropAddressParams } from "./types-xRxFR-cw.js";
6
6
  import { t as RewardsAPI } from "./index-BOjdI8Tw.js";
7
7
  import { a as MintMockERC20Params, c as TransferQuoteParams, d as WithdrawCollateralV2Params, i as GetTokenWalletBalanceParams, l as TransferQuoteV2Params, n as BurnNlpParams, o as MintNlpParams, r as GetTokenAllowanceParams, s as ProductIdOrTokenAddress, t as ApproveAllowanceParams, u as WithdrawCollateralParams } from "./types-DXQWU3Dg.js";
8
- import { t as SpotAPI } from "./index-DlJeayLR.js";
8
+ import { t as SpotAPI } from "./index--m7yZpQu.js";
9
9
  import { n as LinkSignerParams, r as LiquidateSubaccountParams, t as CreateStandardLinkedSignerResult } from "./types-Bp0NkxsQ.js";
10
10
  import { t as SubaccountAPI } from "./index-_sKgQEvR.js";
11
11
  import { NadoClient } from "./client.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nadohq/client",
3
- "version": "0.53.0",
3
+ "version": "0.54.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "Nado SDK client — unified API for trading, market data, and collateral management on Nado",
@@ -41,13 +41,13 @@
41
41
  "module": "./dist/index.js",
42
42
  "types": "./dist/index.d.ts",
43
43
  "dependencies": {
44
- "@nadohq/engine-client": "^0.53.0",
45
- "@nadohq/indexer-client": "^0.53.0",
46
- "@nadohq/mobile-client": "^0.53.0",
47
- "@nadohq/nuanze-client": "^0.53.0",
48
- "@nadohq/otc-client": "^0.53.0",
49
- "@nadohq/shared": "^0.53.0",
50
- "@nadohq/trigger-client": "^0.53.0",
44
+ "@nadohq/engine-client": "^0.54.0",
45
+ "@nadohq/indexer-client": "^0.54.0",
46
+ "@nadohq/mobile-client": "^0.54.0",
47
+ "@nadohq/nuanze-client": "^0.54.0",
48
+ "@nadohq/otc-client": "^0.54.0",
49
+ "@nadohq/shared": "^0.54.0",
50
+ "@nadohq/trigger-client": "^0.54.0",
51
51
  "ts-mixer": "6.0.4"
52
52
  },
53
53
  "peerDependencies": {
@@ -58,5 +58,5 @@
58
58
  "bignumber.js": "11.1.1",
59
59
  "viem": "2.52.0"
60
60
  },
61
- "gitHead": "94a4731d08230a234122e6d225b59208313d846f"
61
+ "gitHead": "83485ee66ad20b239387e271a2945386b39e824e"
62
62
  }
@@ -4,7 +4,6 @@ import {
4
4
  GetEngineMaxMintNlpAmountParams,
5
5
  GetEngineMaxWithdrawableParams,
6
6
  GetEngineMaxWithdrawableResponse,
7
- GetEngineMaxWithdrawableWithDynamicFeeResponse,
8
7
  } from '@nadohq/engine-client';
9
8
  import { getValidatedAddress, toBigNumber } from '@nadohq/shared';
10
9
  import BigNumber from 'bignumber.js';
@@ -13,36 +12,14 @@ import { GetTokenAllowanceParams, GetTokenWalletBalanceParams } from './types';
13
12
 
14
13
  export class SpotQueryAPI extends BaseSpotAPI {
15
14
  /**
16
- * Gets the estimated max withdrawable amount for a product
15
+ * Gets the estimated max withdrawable amount for a product, or the max transferable quote amount
16
+ * to a recipient when `recipientSubaccountName` is set (requires `productId` 0), with the current
17
+ * dynamic fee reserved. The reserved fee is returned as `fee`.
17
18
  * @param params
18
19
  */
19
20
  async getMaxWithdrawable(
20
21
  params: GetEngineMaxWithdrawableParams,
21
- ): Promise<GetEngineMaxWithdrawableResponse>;
22
- /**
23
- * Gets the estimated max withdrawable amount for a product, with the current dynamic fee of
24
- * Withdraw Collateral V2 reserved instead of the flat fee. The reserved fee is returned as
25
- * `fee`.
26
- * @param params
27
- * @returns The max withdrawable with the current dynamic fee reserved, and the reserved fee.
28
- */
29
- async getMaxWithdrawable(
30
- params: GetEngineMaxWithdrawableParams,
31
- options: { withDynamicFee: true },
32
- ): Promise<GetEngineMaxWithdrawableWithDynamicFeeResponse>;
33
- async getMaxWithdrawable(
34
- params: GetEngineMaxWithdrawableParams,
35
- options?: { withDynamicFee?: boolean },
36
- ): Promise<
37
- | GetEngineMaxWithdrawableResponse
38
- | GetEngineMaxWithdrawableWithDynamicFeeResponse
39
- > {
40
- if (options?.withDynamicFee) {
41
- return this.context.engineClient.getMaxWithdrawable(params, {
42
- withDynamicFee: true,
43
- });
44
- }
45
-
22
+ ): Promise<GetEngineMaxWithdrawableResponse> {
46
23
  return this.context.engineClient.getMaxWithdrawable(params);
47
24
  }
48
25
 
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpotQueryAPI-BBLKIvGJ.d.ts","names":[],"sources":["../src/apis/spot/src/apis/spot/SpotQueryAPI.ts"],"mappings":";;;;;;cAaa,YAAA,SAAqB,WAAA;;AAAlC;;;EAKQ,kBAAA,CACJ,MAAA,EAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;EAAA;;;;;;;EAQL,kBAAA,CACJ,MAAA,EAAQ,8BAAA,EACR,OAAA;IAAW,cAAA;EAAA,IACV,OAAA,CAAQ,8CAAA;EAkCsD;;;;;;EAX3D,kBAAA,CACJ,MAAA,EAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;EA8BkB;;;;;EArBvB,mBAAA,CAAoB,MAAA,EAAQ,+BAAA,GAA+B,OAAA,CAAA,SAAA;EA9CvD;;;EAqDJ,qBAAA,CAAA;IACJ,OAAA;IAAA,GACG;EAAA,GACF,2BAAA,GAA8B,OAAA;EA/C3B;;;EAuDA,iBAAA,CAAA;IACJ,OAAA;IAAA,GACG;EAAA,GACF,uBAAA,GAA0B,OAAA,CAAQ,SAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpotQueryAPI-GvWSoN94.d.cts","names":[],"sources":["../src/apis/spot/src/apis/spot/SpotQueryAPI.ts"],"mappings":";;;;;;cAaa,YAAA,SAAqB,WAAA;;AAAlC;;;EAKQ,kBAAA,CACJ,MAAA,EAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;EAAA;;;;;;;EAQL,kBAAA,CACJ,MAAA,EAAQ,8BAAA,EACR,OAAA;IAAW,cAAA;EAAA,IACV,OAAA,CAAQ,8CAAA;EAkCsD;;;;;;EAX3D,kBAAA,CACJ,MAAA,EAAQ,8BAAA,GACP,OAAA,CAAQ,gCAAA;EA8BkB;;;;;EArBvB,mBAAA,CAAoB,MAAA,EAAQ,+BAAA,GAA+B,OAAA,CAAA,SAAA;EA9CvD;;;EAqDJ,qBAAA,CAAA;IACJ,OAAA;IAAA,GACG;EAAA,GACF,2BAAA,GAA8B,OAAA;EA/C3B;;;EAuDA,iBAAA,CAAA;IACJ,OAAA;IAAA,GACG;EAAA,GACF,uBAAA,GAA0B,OAAA,CAAQ,SAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-B44dQYOt.d.cts","names":[],"sources":["../src/apis/spot/src/apis/spot/index.ts"],"mappings":";;;;cAE8C,YAAA;;;AAAA;cAKjC,OAAA,SAAgB,YAAmC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-DlJeayLR.d.ts","names":[],"sources":["../src/apis/spot/src/apis/spot/index.ts"],"mappings":";;;;cAE8C,YAAA;;;AAAA;cAKjC,OAAA,SAAgB,YAAmC"}