@nadohq/client 0.21.2 → 0.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/{BaseSpotAPI-BeTjhXT_.d.cts → BaseSpotAPI-BM5FjPgM.d.cts} +2 -2
  2. package/dist/{BaseSpotAPI-BeTjhXT_.d.cts.map → BaseSpotAPI-BM5FjPgM.d.cts.map} +1 -1
  3. package/dist/{BaseSpotAPI-Ck64kyYt.d.ts → BaseSpotAPI-BPzNEjG1.d.ts} +2 -2
  4. package/dist/{BaseSpotAPI-Ck64kyYt.d.ts.map → BaseSpotAPI-BPzNEjG1.d.ts.map} +1 -1
  5. package/dist/{SpotExecuteAPI-b07ixUz2.d.cts → SpotExecuteAPI-1ldtNuAF.d.cts} +13 -3
  6. package/dist/SpotExecuteAPI-1ldtNuAF.d.cts.map +1 -0
  7. package/dist/{SpotExecuteAPI-UWnX_Hm4.d.ts → SpotExecuteAPI-tvJR-OKl.d.ts} +13 -3
  8. package/dist/SpotExecuteAPI-tvJR-OKl.d.ts.map +1 -0
  9. package/dist/{SpotQueryAPI-DS85MzQB.d.cts → SpotQueryAPI-MD_laBQT.d.cts} +3 -3
  10. package/dist/{SpotQueryAPI-DS85MzQB.d.cts.map → SpotQueryAPI-MD_laBQT.d.cts.map} +1 -1
  11. package/dist/{SpotQueryAPI-CfZcvt4p.d.ts → SpotQueryAPI-j1tFpyNx.d.ts} +3 -3
  12. package/dist/{SpotQueryAPI-CfZcvt4p.d.ts.map → SpotQueryAPI-j1tFpyNx.d.ts.map} +1 -1
  13. package/dist/{WebSocketExecuteAPI-7gLrCoXN.d.cts → WebSocketExecuteAPI-BNptpegV.d.cts} +9 -1
  14. package/dist/WebSocketExecuteAPI-BNptpegV.d.cts.map +1 -0
  15. package/dist/{WebSocketExecuteAPI-DHhKag16.d.ts → WebSocketExecuteAPI-GF4dkb5s.d.ts} +9 -1
  16. package/dist/WebSocketExecuteAPI-GF4dkb5s.d.ts.map +1 -0
  17. package/dist/apis/spot/BaseSpotAPI.d.cts +1 -1
  18. package/dist/apis/spot/BaseSpotAPI.d.ts +1 -1
  19. package/dist/apis/spot/SpotExecuteAPI.cjs +17 -0
  20. package/dist/apis/spot/SpotExecuteAPI.cjs.map +1 -1
  21. package/dist/apis/spot/SpotExecuteAPI.d.cts +1 -1
  22. package/dist/apis/spot/SpotExecuteAPI.d.ts +1 -1
  23. package/dist/apis/spot/SpotExecuteAPI.js +17 -0
  24. package/dist/apis/spot/SpotExecuteAPI.js.map +1 -1
  25. package/dist/apis/spot/SpotQueryAPI.d.cts +1 -1
  26. package/dist/apis/spot/SpotQueryAPI.d.ts +1 -1
  27. package/dist/apis/spot/index.d.cts +3 -3
  28. package/dist/apis/spot/index.d.ts +3 -3
  29. package/dist/apis/spot/types.d.cts +2 -2
  30. package/dist/apis/spot/types.d.ts +2 -2
  31. package/dist/apis/ws/WebSocketExecuteAPI.cjs +8 -0
  32. package/dist/apis/ws/WebSocketExecuteAPI.cjs.map +1 -1
  33. package/dist/apis/ws/WebSocketExecuteAPI.d.cts +1 -1
  34. package/dist/apis/ws/WebSocketExecuteAPI.d.ts +1 -1
  35. package/dist/apis/ws/WebSocketExecuteAPI.js +8 -0
  36. package/dist/apis/ws/WebSocketExecuteAPI.js.map +1 -1
  37. package/dist/apis/ws/index.d.cts +1 -1
  38. package/dist/apis/ws/index.d.ts +1 -1
  39. package/dist/client.d.cts +2 -2
  40. package/dist/client.d.ts +2 -2
  41. package/dist/{index-CSG04f_b.d.cts → index-BQJITv0Y.d.cts} +3 -3
  42. package/dist/index-BQJITv0Y.d.cts.map +1 -0
  43. package/dist/{index-Cc2RdeRK.d.cts → index-CF-YqgJA.d.cts} +2 -2
  44. package/dist/{index-Cc2RdeRK.d.cts.map → index-CF-YqgJA.d.cts.map} +1 -1
  45. package/dist/{index-RtQYDuRY.d.ts → index-sXZQ-XdS.d.ts} +2 -2
  46. package/dist/{index-RtQYDuRY.d.ts.map → index-sXZQ-XdS.d.ts.map} +1 -1
  47. package/dist/{index-Mhjd1FK8.d.ts → index-sybPTci-.d.ts} +3 -3
  48. package/dist/index-sybPTci-.d.ts.map +1 -0
  49. package/dist/index.d.cts +3 -3
  50. package/dist/index.d.ts +3 -3
  51. package/dist/{types-B-tOIIKl.d.ts → types-DnBjJCnd.d.ts} +4 -3
  52. package/dist/types-DnBjJCnd.d.ts.map +1 -0
  53. package/dist/{types-CCj4QJO8.d.cts → types-pRheTrJ1.d.cts} +4 -3
  54. package/dist/types-pRheTrJ1.d.cts.map +1 -0
  55. package/package.json +8 -8
  56. package/src/apis/spot/SpotExecuteAPI.ts +19 -0
  57. package/src/apis/spot/types.ts +5 -0
  58. package/src/apis/ws/WebSocketExecuteAPI.ts +13 -0
  59. package/dist/SpotExecuteAPI-UWnX_Hm4.d.ts.map +0 -1
  60. package/dist/SpotExecuteAPI-b07ixUz2.d.cts.map +0 -1
  61. package/dist/WebSocketExecuteAPI-7gLrCoXN.d.cts.map +0 -1
  62. package/dist/WebSocketExecuteAPI-DHhKag16.d.ts.map +0 -1
  63. package/dist/index-CSG04f_b.d.cts.map +0 -1
  64. package/dist/index-Mhjd1FK8.d.ts.map +0 -1
  65. package/dist/types-B-tOIIKl.d.ts.map +0 -1
  66. package/dist/types-CCj4QJO8.d.cts.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { t as BaseNadoAPI } from "./base-BYkH_-5-.cjs";
2
- import { s as ProductIdOrTokenAddress } from "./types-CCj4QJO8.cjs";
2
+ import { s as ProductIdOrTokenAddress } from "./types-pRheTrJ1.cjs";
3
3
  import { ContractInstance, ERC20_ABI } from "@nadohq/shared";
4
4
 
5
5
  //#region src/apis/spot/BaseSpotAPI.d.ts
@@ -11,4 +11,4 @@ declare class BaseSpotAPI extends BaseNadoAPI {
11
11
  }
12
12
  //#endregion
13
13
  export { BaseSpotAPI as t };
14
- //# sourceMappingURL=BaseSpotAPI-BeTjhXT_.d.cts.map
14
+ //# sourceMappingURL=BaseSpotAPI-BM5FjPgM.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseSpotAPI-BeTjhXT_.d.cts","names":[],"sources":["../src/apis/spot/src/apis/spot/BaseSpotAPI.ts"],"mappings":";;;;;cASa,WAAA,SAAoB,WAAA;;AAAjC;;EAIQ,0BAAA,CACJ,MAAA,EAAQ,uBAAA,GACP,OAAA,CAAQ,gBAAA,QAAwB,SAAA;AAAA"}
1
+ {"version":3,"file":"BaseSpotAPI-BM5FjPgM.d.cts","names":[],"sources":["../src/apis/spot/src/apis/spot/BaseSpotAPI.ts"],"mappings":";;;;;cASa,WAAA,SAAoB,WAAA;;AAAjC;;EAIQ,0BAAA,CACJ,MAAA,EAAQ,uBAAA,GACP,OAAA,CAAQ,gBAAA,QAAwB,SAAA;AAAA"}
@@ -1,5 +1,5 @@
1
1
  import { t as BaseNadoAPI } from "./base-B92wTsrc.js";
2
- import { s as ProductIdOrTokenAddress } from "./types-B-tOIIKl.js";
2
+ import { s as ProductIdOrTokenAddress } from "./types-DnBjJCnd.js";
3
3
  import { ContractInstance, ERC20_ABI } from "@nadohq/shared";
4
4
 
5
5
  //#region src/apis/spot/BaseSpotAPI.d.ts
@@ -11,4 +11,4 @@ declare class BaseSpotAPI extends BaseNadoAPI {
11
11
  }
12
12
  //#endregion
13
13
  export { BaseSpotAPI as t };
14
- //# sourceMappingURL=BaseSpotAPI-Ck64kyYt.d.ts.map
14
+ //# sourceMappingURL=BaseSpotAPI-BPzNEjG1.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BaseSpotAPI-Ck64kyYt.d.ts","names":[],"sources":["../src/apis/spot/src/apis/spot/BaseSpotAPI.ts"],"mappings":";;;;;cASa,WAAA,SAAoB,WAAA;;AAAjC;;EAIQ,0BAAA,CACJ,MAAA,EAAQ,uBAAA,GACP,OAAA,CAAQ,gBAAA,QAAwB,SAAA;AAAA"}
1
+ {"version":3,"file":"BaseSpotAPI-BPzNEjG1.d.ts","names":[],"sources":["../src/apis/spot/src/apis/spot/BaseSpotAPI.ts"],"mappings":";;;;;cASa,WAAA,SAAoB,WAAA;;AAAjC;;EAIQ,0BAAA,CACJ,MAAA,EAAQ,uBAAA,GACP,OAAA,CAAQ,gBAAA,QAAwB,SAAA;AAAA"}
@@ -1,11 +1,21 @@
1
- import { a as MintMockERC20Params, c as TransferQuoteParams, l as WithdrawCollateralParams, n as BurnNlpParams, o as MintNlpParams, t as ApproveAllowanceParams } from "./types-CCj4QJO8.cjs";
2
- import { t as BaseSpotAPI } from "./BaseSpotAPI-BeTjhXT_.cjs";
1
+ import { a as MintMockERC20Params, c as TransferQuoteParams, l as WithdrawCollateralParams, n as BurnNlpParams, o as MintNlpParams, t as ApproveAllowanceParams, u as WithdrawCollateralV2Params } from "./types-pRheTrJ1.cjs";
2
+ import { t as BaseSpotAPI } from "./BaseSpotAPI-BM5FjPgM.cjs";
3
3
  import { DepositCollateralParams } from "@nadohq/shared";
4
4
 
5
5
  //#region src/apis/spot/SpotExecuteAPI.d.ts
6
6
  declare class SpotExecuteAPI extends BaseSpotAPI {
7
7
  deposit(params: DepositCollateralParams): Promise<`0x${string}`>;
8
8
  withdraw(params: WithdrawCollateralParams): Promise<import("@nadohq/engine-client").EngineServerExecuteSuccessResult<"withdraw_collateral">>;
9
+ /**
10
+ * Withdraws collateral to a custom recipient address via the `withdraw_collateral_v2` execute.
11
+ *
12
+ * When `sendTo` is the zero address, funds are sent to the subaccount owner. When `sendTo` is a
13
+ * non-zero address, the transaction must be signed by the subaccount owner (linked signers are
14
+ * not permitted).
15
+ *
16
+ * @param params
17
+ */
18
+ withdrawV2(params: WithdrawCollateralV2Params): Promise<import("@nadohq/engine-client").EngineServerExecuteSuccessResult<"withdraw_collateral_v2">>;
9
19
  approveAllowance(params: ApproveAllowanceParams): Promise<`0x${string}`>;
10
20
  /**
11
21
  * Transfers quote between subaccounts under the same wallet.
@@ -19,4 +29,4 @@ declare class SpotExecuteAPI extends BaseSpotAPI {
19
29
  }
20
30
  //#endregion
21
31
  export { SpotExecuteAPI as t };
22
- //# sourceMappingURL=SpotExecuteAPI-b07ixUz2.d.cts.map
32
+ //# sourceMappingURL=SpotExecuteAPI-1ldtNuAF.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SpotExecuteAPI-1ldtNuAF.d.cts","names":[],"sources":["../src/apis/spot/src/apis/spot/SpotExecuteAPI.ts"],"mappings":";;;;;cAoBa,cAAA,SAAuB,WAAA;EAC5B,OAAA,CAAQ,MAAA,EAAQ,uBAAA,GAAuB,OAAA;EAUvC,QAAA,CAAS,MAAA,EAAQ,wBAAA,GAAwB,OAAA,iCAAA,gCAAA;EAXrB;;;;;;;;;EA6BpB,UAAA,CAAW,MAAA,EAAQ,0BAAA,GAA0B,OAAA,iCAAA,gCAAA;EAS7C,gBAAA,CAAiB,MAAA,EAAQ,sBAAA,GAAsB,OAAA;EAoBN;;;;;EAAzC,aAAA,CAAc,MAAA,EAAQ,mBAAA,GAAmB,OAAA,iCAAA,gCAAA;EASzC,OAAA,CAAQ,MAAA,EAAQ,aAAA,GAAa,OAAA,iCAAA,gCAAA;EAS7B,OAAA,CAAQ,MAAA,EAAQ,aAAA,GAAa,OAAA,iCAAA,gCAAA;EAS7B,cAAA,CAAe,MAAA,EAAQ,mBAAA,GAAmB,OAAA;AAAA"}
@@ -1,11 +1,21 @@
1
- import { a as MintMockERC20Params, c as TransferQuoteParams, l as WithdrawCollateralParams, n as BurnNlpParams, o as MintNlpParams, t as ApproveAllowanceParams } from "./types-B-tOIIKl.js";
2
- import { t as BaseSpotAPI } from "./BaseSpotAPI-Ck64kyYt.js";
1
+ import { a as MintMockERC20Params, c as TransferQuoteParams, l as WithdrawCollateralParams, n as BurnNlpParams, o as MintNlpParams, t as ApproveAllowanceParams, u as WithdrawCollateralV2Params } from "./types-DnBjJCnd.js";
2
+ import { t as BaseSpotAPI } from "./BaseSpotAPI-BPzNEjG1.js";
3
3
  import { DepositCollateralParams } from "@nadohq/shared";
4
4
 
5
5
  //#region src/apis/spot/SpotExecuteAPI.d.ts
6
6
  declare class SpotExecuteAPI extends BaseSpotAPI {
7
7
  deposit(params: DepositCollateralParams): Promise<`0x${string}`>;
8
8
  withdraw(params: WithdrawCollateralParams): Promise<import("@nadohq/engine-client").EngineServerExecuteSuccessResult<"withdraw_collateral">>;
9
+ /**
10
+ * Withdraws collateral to a custom recipient address via the `withdraw_collateral_v2` execute.
11
+ *
12
+ * When `sendTo` is the zero address, funds are sent to the subaccount owner. When `sendTo` is a
13
+ * non-zero address, the transaction must be signed by the subaccount owner (linked signers are
14
+ * not permitted).
15
+ *
16
+ * @param params
17
+ */
18
+ withdrawV2(params: WithdrawCollateralV2Params): Promise<import("@nadohq/engine-client").EngineServerExecuteSuccessResult<"withdraw_collateral_v2">>;
9
19
  approveAllowance(params: ApproveAllowanceParams): Promise<`0x${string}`>;
10
20
  /**
11
21
  * Transfers quote between subaccounts under the same wallet.
@@ -19,4 +29,4 @@ declare class SpotExecuteAPI extends BaseSpotAPI {
19
29
  }
20
30
  //#endregion
21
31
  export { SpotExecuteAPI as t };
22
- //# sourceMappingURL=SpotExecuteAPI-UWnX_Hm4.d.ts.map
32
+ //# sourceMappingURL=SpotExecuteAPI-tvJR-OKl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SpotExecuteAPI-tvJR-OKl.d.ts","names":[],"sources":["../src/apis/spot/src/apis/spot/SpotExecuteAPI.ts"],"mappings":";;;;;cAoBa,cAAA,SAAuB,WAAA;EAC5B,OAAA,CAAQ,MAAA,EAAQ,uBAAA,GAAuB,OAAA;EAUvC,QAAA,CAAS,MAAA,EAAQ,wBAAA,GAAwB,OAAA,iCAAA,gCAAA;EAXrB;;;;;;;;;EA6BpB,UAAA,CAAW,MAAA,EAAQ,0BAAA,GAA0B,OAAA,iCAAA,gCAAA;EAS7C,gBAAA,CAAiB,MAAA,EAAQ,sBAAA,GAAsB,OAAA;EAoBN;;;;;EAAzC,aAAA,CAAc,MAAA,EAAQ,mBAAA,GAAmB,OAAA,iCAAA,gCAAA;EASzC,OAAA,CAAQ,MAAA,EAAQ,aAAA,GAAa,OAAA,iCAAA,gCAAA;EAS7B,OAAA,CAAQ,MAAA,EAAQ,aAAA,GAAa,OAAA,iCAAA,gCAAA;EAS7B,cAAA,CAAe,MAAA,EAAQ,mBAAA,GAAmB,OAAA;AAAA"}
@@ -1,5 +1,5 @@
1
- import { i as GetTokenWalletBalanceParams, r as GetTokenAllowanceParams } from "./types-CCj4QJO8.cjs";
2
- import { t as BaseSpotAPI } from "./BaseSpotAPI-BeTjhXT_.cjs";
1
+ import { i as GetTokenWalletBalanceParams, r as GetTokenAllowanceParams } from "./types-pRheTrJ1.cjs";
2
+ import { t as BaseSpotAPI } from "./BaseSpotAPI-BM5FjPgM.cjs";
3
3
  import { GetEngineMaxMintNlpAmountParams, GetEngineMaxWithdrawableParams } from "@nadohq/engine-client";
4
4
  import BigNumber from "bignumber.js";
5
5
 
@@ -33,4 +33,4 @@ declare class SpotQueryAPI extends BaseSpotAPI {
33
33
  }
34
34
  //#endregion
35
35
  export { SpotQueryAPI as t };
36
- //# sourceMappingURL=SpotQueryAPI-DS85MzQB.d.cts.map
36
+ //# sourceMappingURL=SpotQueryAPI-MD_laBQT.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SpotQueryAPI-DS85MzQB.d.cts","names":[],"sources":["../src/apis/spot/src/apis/spot/SpotQueryAPI.ts"],"mappings":";;;;;;cASa,YAAA,SAAqB,WAAA;;AAAlC;;;EAKQ,kBAAA,CAAmB,MAAA,EAAQ,8BAAA,GAA8B,OAAA,CAAA,SAAA;EAAA;;;;;EASzD,mBAAA,CAAoB,MAAA,EAAQ,+BAAA,GAA+B,OAAA,CAAA,SAAA;EAU9D;;;EAHG,qBAAA,CAAA;IACJ,OAAA;IAAA,GACG;EAAA,GACF,2BAAA,GAA8B,OAAA;EAWI;;;EAH/B,iBAAA,CAAA;IACJ,OAAA;IAAA,GACG;EAAA,GACF,uBAAA,GAA0B,OAAA,CAAQ,SAAA;AAAA"}
1
+ {"version":3,"file":"SpotQueryAPI-MD_laBQT.d.cts","names":[],"sources":["../src/apis/spot/src/apis/spot/SpotQueryAPI.ts"],"mappings":";;;;;;cASa,YAAA,SAAqB,WAAA;;AAAlC;;;EAKQ,kBAAA,CAAmB,MAAA,EAAQ,8BAAA,GAA8B,OAAA,CAAA,SAAA;EAAA;;;;;EASzD,mBAAA,CAAoB,MAAA,EAAQ,+BAAA,GAA+B,OAAA,CAAA,SAAA;EAU9D;;;EAHG,qBAAA,CAAA;IACJ,OAAA;IAAA,GACG;EAAA,GACF,2BAAA,GAA8B,OAAA;EAWI;;;EAH/B,iBAAA,CAAA;IACJ,OAAA;IAAA,GACG;EAAA,GACF,uBAAA,GAA0B,OAAA,CAAQ,SAAA;AAAA"}
@@ -1,5 +1,5 @@
1
- import { i as GetTokenWalletBalanceParams, r as GetTokenAllowanceParams } from "./types-B-tOIIKl.js";
2
- import { t as BaseSpotAPI } from "./BaseSpotAPI-Ck64kyYt.js";
1
+ import { i as GetTokenWalletBalanceParams, r as GetTokenAllowanceParams } from "./types-DnBjJCnd.js";
2
+ import { t as BaseSpotAPI } from "./BaseSpotAPI-BPzNEjG1.js";
3
3
  import { GetEngineMaxMintNlpAmountParams, GetEngineMaxWithdrawableParams } from "@nadohq/engine-client";
4
4
  import BigNumber from "bignumber.js";
5
5
 
@@ -33,4 +33,4 @@ declare class SpotQueryAPI extends BaseSpotAPI {
33
33
  }
34
34
  //#endregion
35
35
  export { SpotQueryAPI as t };
36
- //# sourceMappingURL=SpotQueryAPI-CfZcvt4p.d.ts.map
36
+ //# sourceMappingURL=SpotQueryAPI-j1tFpyNx.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SpotQueryAPI-CfZcvt4p.d.ts","names":[],"sources":["../src/apis/spot/src/apis/spot/SpotQueryAPI.ts"],"mappings":";;;;;;cASa,YAAA,SAAqB,WAAA;;AAAlC;;;EAKQ,kBAAA,CAAmB,MAAA,EAAQ,8BAAA,GAA8B,OAAA,CAAA,SAAA;EAAA;;;;;EASzD,mBAAA,CAAoB,MAAA,EAAQ,+BAAA,GAA+B,OAAA,CAAA,SAAA;EAU9D;;;EAHG,qBAAA,CAAA;IACJ,OAAA;IAAA,GACG;EAAA,GACF,2BAAA,GAA8B,OAAA;EAWI;;;EAH/B,iBAAA,CAAA;IACJ,OAAA;IAAA,GACG;EAAA,GACF,uBAAA,GAA0B,OAAA,CAAQ,SAAA;AAAA"}
1
+ {"version":3,"file":"SpotQueryAPI-j1tFpyNx.d.ts","names":[],"sources":["../src/apis/spot/src/apis/spot/SpotQueryAPI.ts"],"mappings":";;;;;;cASa,YAAA,SAAqB,WAAA;;AAAlC;;;EAKQ,kBAAA,CAAmB,MAAA,EAAQ,8BAAA,GAA8B,OAAA,CAAA,SAAA;EAAA;;;;;EASzD,mBAAA,CAAoB,MAAA,EAAQ,+BAAA,GAA+B,OAAA,CAAA,SAAA;EAU9D;;;EAHG,qBAAA,CAAA;IACJ,OAAA;IAAA,GACG;EAAA,GACF,2BAAA,GAA8B,OAAA;EAWI;;;EAH/B,iBAAA,CAAA;IACJ,OAAA;IAAA,GACG;EAAA,GACF,uBAAA,GAA0B,OAAA,CAAQ,SAAA;AAAA"}
@@ -22,6 +22,14 @@ declare class WebSocketExecuteAPI extends BaseNadoAPI {
22
22
  buildWithdrawCollateralMessage(params: EngineExecuteRequestParamsByType['withdraw_collateral']): Promise<import("@nadohq/shared").SignedTx<import("@nadohq/shared").EIP712WithdrawCollateralValues> & {
23
23
  spot_leverage: boolean | null;
24
24
  }>;
25
+ /**
26
+ * Builds ws message for the `withdraw_collateral_v2` execute action.
27
+ * @param params WithdrawCollateralV2 params.
28
+ * @returns `withdraw_collateral_v2` execute message
29
+ */
30
+ buildWithdrawCollateralV2Message(params: EngineExecuteRequestParamsByType['withdraw_collateral_v2']): Promise<import("@nadohq/shared").SignedTx<import("@nadohq/shared").EIP712WithdrawCollateralV2Values> & {
31
+ spot_leverage: boolean | null;
32
+ }>;
25
33
  /**
26
34
  * Builds ws message for the `place_order` execute action.
27
35
  * @param params PlaceOrder params.
@@ -41,4 +49,4 @@ declare class WebSocketExecuteAPI extends BaseNadoAPI {
41
49
  }
42
50
  //#endregion
43
51
  export { WebSocketExecuteAPI as t };
44
- //# sourceMappingURL=WebSocketExecuteAPI-7gLrCoXN.d.cts.map
52
+ //# sourceMappingURL=WebSocketExecuteAPI-BNptpegV.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebSocketExecuteAPI-BNptpegV.d.cts","names":[],"sources":["../src/apis/ws/src/apis/ws/WebSocketExecuteAPI.ts"],"mappings":";;;;;;;AAWA;;cAAa,mBAAA,SAA4B,WAAA;EAO7B;;;;;EADJ,+BAAA,CACJ,MAAA,EAAQ,gCAAA,2BAAwD,OAAA,0BAAA,QAAA,0BAAA,+BAAA;EAwC9D;;;;;EA5BE,8BAAA,CACJ,MAAA,EAAQ,gCAAA,0BAAuD,OAAA,0BAAA,QAAA,0BAAA,8BAAA;;;EApB1B;;;;;EAgCjC,gCAAA,CACJ,MAAA,EAAQ,gCAAA,6BAA0D,OAAA,0BAAA,QAAA,0BAAA,gCAAA;;;EAb1D;;;;;EAyBV,sBAAA,CACE,MAAA,EAAQ,aAAA,CACN,gCAAA;IACE,KAAA,EAAO,iBAAA;EAAA,qCAEV,oCAAA;EAjBD;;;;;EA6BF,wBAAA,CACE,MAAA,EAAQ,aAAA,CACN,gCAAA;IAAsD,KAAA;EAAA,qCACvD,8BAAA;AAAA"}
@@ -22,6 +22,14 @@ declare class WebSocketExecuteAPI extends BaseNadoAPI {
22
22
  buildWithdrawCollateralMessage(params: EngineExecuteRequestParamsByType['withdraw_collateral']): Promise<import("@nadohq/shared").SignedTx<import("@nadohq/shared").EIP712WithdrawCollateralValues> & {
23
23
  spot_leverage: boolean | null;
24
24
  }>;
25
+ /**
26
+ * Builds ws message for the `withdraw_collateral_v2` execute action.
27
+ * @param params WithdrawCollateralV2 params.
28
+ * @returns `withdraw_collateral_v2` execute message
29
+ */
30
+ buildWithdrawCollateralV2Message(params: EngineExecuteRequestParamsByType['withdraw_collateral_v2']): Promise<import("@nadohq/shared").SignedTx<import("@nadohq/shared").EIP712WithdrawCollateralV2Values> & {
31
+ spot_leverage: boolean | null;
32
+ }>;
25
33
  /**
26
34
  * Builds ws message for the `place_order` execute action.
27
35
  * @param params PlaceOrder params.
@@ -41,4 +49,4 @@ declare class WebSocketExecuteAPI extends BaseNadoAPI {
41
49
  }
42
50
  //#endregion
43
51
  export { WebSocketExecuteAPI as t };
44
- //# sourceMappingURL=WebSocketExecuteAPI-DHhKag16.d.ts.map
52
+ //# sourceMappingURL=WebSocketExecuteAPI-GF4dkb5s.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebSocketExecuteAPI-GF4dkb5s.d.ts","names":[],"sources":["../src/apis/ws/src/apis/ws/WebSocketExecuteAPI.ts"],"mappings":";;;;;;;AAWA;;cAAa,mBAAA,SAA4B,WAAA;EAO7B;;;;;EADJ,+BAAA,CACJ,MAAA,EAAQ,gCAAA,2BAAwD,OAAA,0BAAA,QAAA,0BAAA,+BAAA;EAwC9D;;;;;EA5BE,8BAAA,CACJ,MAAA,EAAQ,gCAAA,0BAAuD,OAAA,0BAAA,QAAA,0BAAA,8BAAA;;;EApB1B;;;;;EAgCjC,gCAAA,CACJ,MAAA,EAAQ,gCAAA,6BAA0D,OAAA,0BAAA,QAAA,0BAAA,gCAAA;;;EAb1D;;;;;EAyBV,sBAAA,CACE,MAAA,EAAQ,aAAA,CACN,gCAAA;IACE,KAAA,EAAO,iBAAA;EAAA,qCAEV,oCAAA;EAjBD;;;;;EA6BF,wBAAA,CACE,MAAA,EAAQ,aAAA,CACN,gCAAA;IAAsD,KAAA;EAAA,qCACvD,8BAAA;AAAA"}
@@ -1,2 +1,2 @@
1
- import { t as BaseSpotAPI } from "../../BaseSpotAPI-BeTjhXT_.cjs";
1
+ import { t as BaseSpotAPI } from "../../BaseSpotAPI-BM5FjPgM.cjs";
2
2
  export { BaseSpotAPI };
@@ -1,2 +1,2 @@
1
- import { t as BaseSpotAPI } from "../../BaseSpotAPI-Ck64kyYt.js";
1
+ import { t as BaseSpotAPI } from "../../BaseSpotAPI-BPzNEjG1.js";
2
2
  export { BaseSpotAPI };
@@ -20,6 +20,23 @@ var SpotExecuteAPI = class extends require_apis_spot_BaseSpotAPI.BaseSpotAPI {
20
20
  verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress()
21
21
  });
22
22
  }
23
+ /**
24
+ * Withdraws collateral to a custom recipient address via the `withdraw_collateral_v2` execute.
25
+ *
26
+ * When `sendTo` is the zero address, funds are sent to the subaccount owner. When `sendTo` is a
27
+ * non-zero address, the transaction must be signed by the subaccount owner (linked signers are
28
+ * not permitted).
29
+ *
30
+ * @param params
31
+ */
32
+ async withdrawV2(params) {
33
+ return this.context.engineClient.withdrawCollateralV2({
34
+ ...params,
35
+ subaccountOwner: this.getSubaccountOwnerIfNeeded(params),
36
+ chainId: this.getWalletClientChainIdIfNeeded(params),
37
+ verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress()
38
+ });
39
+ }
23
40
  async approveAllowance(params) {
24
41
  const tokenContract = await this.getTokenContractForProduct(params);
25
42
  if (!(0, _nadohq_shared.isWriteableContract)(tokenContract)) throw new Error("Token contract does not permit writes. Is a wallet client provided?");
@@ -1 +1 @@
1
- {"version":3,"file":"SpotExecuteAPI.cjs","names":["BaseSpotAPI","WalletNotProvidedError","MOCK_ERC20_ABI"],"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":";;;;AAmBA,IAAa,iBAAb,cAAoCA,8BAAAA,YAAY;CAC9C,MAAM,QAAQ,QAAiC;EAC7C,QAAA,GAAA,eAAA,mBAAyB;GACvB,UAAU,KAAK,QAAQ,UAAU;GACjC,gBAAgB,OAAO;GACvB,WAAW,OAAO;GAClB,QAAQ,OAAO;GACf,cAAc,OAAO;EACvB,CAAC;CACH;CAEA,MAAM,SAAS,QAAkC;EAC/C,OAAO,KAAK,QAAQ,aAAa,mBAAmB;GAClD,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,SAAS,KAAK,+BAA+B,MAAM;GACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;EACjE,CAAC;CACH;CAEA,MAAM,iBAAiB,QAAgC;EACrD,MAAM,gBAAgB,MAAM,KAAK,2BAA2B,MAAM;EAClE,IAAI,EAAA,GAAA,eAAA,qBAAqB,aAAa,GACpC,MAAM,IAAI,MACR,qEACF;EAGF,QAAA,GAAA,eAAA,yBAA+B;GAC7B,QAAQ,OAAO;GACf,UAAU,KAAK,QAAQ,UAAU;GACjC;EACF,CAAC;CACH;;;;;;CAOA,MAAM,cAAc,QAA6B;EAC/C,OAAO,KAAK,QAAQ,aAAa,cAAc;GAC7C,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;GAC/D,SAAS,KAAK,+BAA+B,MAAM;EACrD,CAAC;CACH;CAEA,MAAM,QAAQ,QAAuB;EACnC,OAAO,KAAK,QAAQ,aAAa,QAAQ;GACvC,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,SAAS,KAAK,+BAA+B,MAAM;GACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;EACjE,CAAC;CACH;CAEA,MAAM,QAAQ,QAAuB;EACnC,OAAO,KAAK,QAAQ,aAAa,QAAQ;GACvC,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,SAAS,KAAK,+BAA+B,MAAM;GACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;EACjE,CAAC;CACH;CAEA,MAAM,eAAe,QAA6B;EAChD,IAAI,CAAC,KAAK,QAAQ,cAChB,MAAM,IAAIC,eAAAA,uBAAuB;EAGnC,MAAM,SAAS,MAAM,KAAK,QAAQ,UAAU,WAAW,KAAK,UAAU,CACpE,OAAO,SACT,CAAC;EAED,OAAO,KAAK,QAAQ,aAAa,cAAc;GAC7C,KAAKC,eAAAA;GACL,SAAS,OAAO;GAChB,cAAc;GACd,MAAM,CAAC,KAAK,uBAAuB,IAAA,GAAA,eAAA,UAAY,OAAO,MAAM,CAAC;EAC/D,CAAC;CACH;AACF"}
1
+ {"version":3,"file":"SpotExecuteAPI.cjs","names":["BaseSpotAPI","WalletNotProvidedError","MOCK_ERC20_ABI"],"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 WithdrawCollateralV2Params,\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 /**\n * Withdraws collateral to a custom recipient address via the `withdraw_collateral_v2` execute.\n *\n * When `sendTo` is the zero address, funds are sent to the subaccount owner. When `sendTo` is a\n * non-zero address, the transaction must be signed by the subaccount owner (linked signers are\n * not permitted).\n *\n * @param params\n */\n async withdrawV2(params: WithdrawCollateralV2Params) {\n return this.context.engineClient.withdrawCollateralV2({\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":";;;;AAoBA,IAAa,iBAAb,cAAoCA,8BAAAA,YAAY;CAC9C,MAAM,QAAQ,QAAiC;EAC7C,QAAA,GAAA,eAAA,mBAAyB;GACvB,UAAU,KAAK,QAAQ,UAAU;GACjC,gBAAgB,OAAO;GACvB,WAAW,OAAO;GAClB,QAAQ,OAAO;GACf,cAAc,OAAO;EACvB,CAAC;CACH;CAEA,MAAM,SAAS,QAAkC;EAC/C,OAAO,KAAK,QAAQ,aAAa,mBAAmB;GAClD,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,SAAS,KAAK,+BAA+B,MAAM;GACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;EACjE,CAAC;CACH;;;;;;;;;;CAWA,MAAM,WAAW,QAAoC;EACnD,OAAO,KAAK,QAAQ,aAAa,qBAAqB;GACpD,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,SAAS,KAAK,+BAA+B,MAAM;GACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;EACjE,CAAC;CACH;CAEA,MAAM,iBAAiB,QAAgC;EACrD,MAAM,gBAAgB,MAAM,KAAK,2BAA2B,MAAM;EAClE,IAAI,EAAA,GAAA,eAAA,qBAAqB,aAAa,GACpC,MAAM,IAAI,MACR,qEACF;EAGF,QAAA,GAAA,eAAA,yBAA+B;GAC7B,QAAQ,OAAO;GACf,UAAU,KAAK,QAAQ,UAAU;GACjC;EACF,CAAC;CACH;;;;;;CAOA,MAAM,cAAc,QAA6B;EAC/C,OAAO,KAAK,QAAQ,aAAa,cAAc;GAC7C,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;GAC/D,SAAS,KAAK,+BAA+B,MAAM;EACrD,CAAC;CACH;CAEA,MAAM,QAAQ,QAAuB;EACnC,OAAO,KAAK,QAAQ,aAAa,QAAQ;GACvC,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,SAAS,KAAK,+BAA+B,MAAM;GACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;EACjE,CAAC;CACH;CAEA,MAAM,QAAQ,QAAuB;EACnC,OAAO,KAAK,QAAQ,aAAa,QAAQ;GACvC,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,SAAS,KAAK,+BAA+B,MAAM;GACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;EACjE,CAAC;CACH;CAEA,MAAM,eAAe,QAA6B;EAChD,IAAI,CAAC,KAAK,QAAQ,cAChB,MAAM,IAAIC,eAAAA,uBAAuB;EAGnC,MAAM,SAAS,MAAM,KAAK,QAAQ,UAAU,WAAW,KAAK,UAAU,CACpE,OAAO,SACT,CAAC;EAED,OAAO,KAAK,QAAQ,aAAa,cAAc;GAC7C,KAAKC,eAAAA;GACL,SAAS,OAAO;GAChB,cAAc;GACd,MAAM,CAAC,KAAK,uBAAuB,IAAA,GAAA,eAAA,UAAY,OAAO,MAAM,CAAC;EAC/D,CAAC;CACH;AACF"}
@@ -1,2 +1,2 @@
1
- import { t as SpotExecuteAPI } from "../../SpotExecuteAPI-b07ixUz2.cjs";
1
+ import { t as SpotExecuteAPI } from "../../SpotExecuteAPI-1ldtNuAF.cjs";
2
2
  export { SpotExecuteAPI };
@@ -1,2 +1,2 @@
1
- import { t as SpotExecuteAPI } from "../../SpotExecuteAPI-UWnX_Hm4.js";
1
+ import { t as SpotExecuteAPI } from "../../SpotExecuteAPI-tvJR-OKl.js";
2
2
  export { SpotExecuteAPI };
@@ -19,6 +19,23 @@ var SpotExecuteAPI = class extends BaseSpotAPI {
19
19
  verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress()
20
20
  });
21
21
  }
22
+ /**
23
+ * Withdraws collateral to a custom recipient address via the `withdraw_collateral_v2` execute.
24
+ *
25
+ * When `sendTo` is the zero address, funds are sent to the subaccount owner. When `sendTo` is a
26
+ * non-zero address, the transaction must be signed by the subaccount owner (linked signers are
27
+ * not permitted).
28
+ *
29
+ * @param params
30
+ */
31
+ async withdrawV2(params) {
32
+ return this.context.engineClient.withdrawCollateralV2({
33
+ ...params,
34
+ subaccountOwner: this.getSubaccountOwnerIfNeeded(params),
35
+ chainId: this.getWalletClientChainIdIfNeeded(params),
36
+ verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress()
37
+ });
38
+ }
22
39
  async approveAllowance(params) {
23
40
  const tokenContract = await this.getTokenContractForProduct(params);
24
41
  if (!isWriteableContract(tokenContract)) throw new Error("Token contract does not permit writes. Is a wallet client provided?");
@@ -1 +1 @@
1
- {"version":3,"file":"SpotExecuteAPI.js","names":[],"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":";;;AAmBA,IAAa,iBAAb,cAAoC,YAAY;CAC9C,MAAM,QAAQ,QAAiC;EAC7C,OAAO,kBAAkB;GACvB,UAAU,KAAK,QAAQ,UAAU;GACjC,gBAAgB,OAAO;GACvB,WAAW,OAAO;GAClB,QAAQ,OAAO;GACf,cAAc,OAAO;EACvB,CAAC;CACH;CAEA,MAAM,SAAS,QAAkC;EAC/C,OAAO,KAAK,QAAQ,aAAa,mBAAmB;GAClD,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,SAAS,KAAK,+BAA+B,MAAM;GACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;EACjE,CAAC;CACH;CAEA,MAAM,iBAAiB,QAAgC;EACrD,MAAM,gBAAgB,MAAM,KAAK,2BAA2B,MAAM;EAClE,IAAI,CAAC,oBAAoB,aAAa,GACpC,MAAM,IAAI,MACR,qEACF;EAGF,OAAO,wBAAwB;GAC7B,QAAQ,OAAO;GACf,UAAU,KAAK,QAAQ,UAAU;GACjC;EACF,CAAC;CACH;;;;;;CAOA,MAAM,cAAc,QAA6B;EAC/C,OAAO,KAAK,QAAQ,aAAa,cAAc;GAC7C,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;GAC/D,SAAS,KAAK,+BAA+B,MAAM;EACrD,CAAC;CACH;CAEA,MAAM,QAAQ,QAAuB;EACnC,OAAO,KAAK,QAAQ,aAAa,QAAQ;GACvC,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,SAAS,KAAK,+BAA+B,MAAM;GACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;EACjE,CAAC;CACH;CAEA,MAAM,QAAQ,QAAuB;EACnC,OAAO,KAAK,QAAQ,aAAa,QAAQ;GACvC,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,SAAS,KAAK,+BAA+B,MAAM;GACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;EACjE,CAAC;CACH;CAEA,MAAM,eAAe,QAA6B;EAChD,IAAI,CAAC,KAAK,QAAQ,cAChB,MAAM,IAAI,uBAAuB;EAGnC,MAAM,SAAS,MAAM,KAAK,QAAQ,UAAU,WAAW,KAAK,UAAU,CACpE,OAAO,SACT,CAAC;EAED,OAAO,KAAK,QAAQ,aAAa,cAAc;GAC7C,KAAK;GACL,SAAS,OAAO;GAChB,cAAc;GACd,MAAM,CAAC,KAAK,uBAAuB,GAAG,SAAS,OAAO,MAAM,CAAC;EAC/D,CAAC;CACH;AACF"}
1
+ {"version":3,"file":"SpotExecuteAPI.js","names":[],"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 WithdrawCollateralV2Params,\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 /**\n * Withdraws collateral to a custom recipient address via the `withdraw_collateral_v2` execute.\n *\n * When `sendTo` is the zero address, funds are sent to the subaccount owner. When `sendTo` is a\n * non-zero address, the transaction must be signed by the subaccount owner (linked signers are\n * not permitted).\n *\n * @param params\n */\n async withdrawV2(params: WithdrawCollateralV2Params) {\n return this.context.engineClient.withdrawCollateralV2({\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":";;;AAoBA,IAAa,iBAAb,cAAoC,YAAY;CAC9C,MAAM,QAAQ,QAAiC;EAC7C,OAAO,kBAAkB;GACvB,UAAU,KAAK,QAAQ,UAAU;GACjC,gBAAgB,OAAO;GACvB,WAAW,OAAO;GAClB,QAAQ,OAAO;GACf,cAAc,OAAO;EACvB,CAAC;CACH;CAEA,MAAM,SAAS,QAAkC;EAC/C,OAAO,KAAK,QAAQ,aAAa,mBAAmB;GAClD,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,SAAS,KAAK,+BAA+B,MAAM;GACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;EACjE,CAAC;CACH;;;;;;;;;;CAWA,MAAM,WAAW,QAAoC;EACnD,OAAO,KAAK,QAAQ,aAAa,qBAAqB;GACpD,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,SAAS,KAAK,+BAA+B,MAAM;GACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;EACjE,CAAC;CACH;CAEA,MAAM,iBAAiB,QAAgC;EACrD,MAAM,gBAAgB,MAAM,KAAK,2BAA2B,MAAM;EAClE,IAAI,CAAC,oBAAoB,aAAa,GACpC,MAAM,IAAI,MACR,qEACF;EAGF,OAAO,wBAAwB;GAC7B,QAAQ,OAAO;GACf,UAAU,KAAK,QAAQ,UAAU;GACjC;EACF,CAAC;CACH;;;;;;CAOA,MAAM,cAAc,QAA6B;EAC/C,OAAO,KAAK,QAAQ,aAAa,cAAc;GAC7C,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;GAC/D,SAAS,KAAK,+BAA+B,MAAM;EACrD,CAAC;CACH;CAEA,MAAM,QAAQ,QAAuB;EACnC,OAAO,KAAK,QAAQ,aAAa,QAAQ;GACvC,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,SAAS,KAAK,+BAA+B,MAAM;GACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;EACjE,CAAC;CACH;CAEA,MAAM,QAAQ,QAAuB;EACnC,OAAO,KAAK,QAAQ,aAAa,QAAQ;GACvC,GAAG;GACH,iBAAiB,KAAK,2BAA2B,MAAM;GACvD,SAAS,KAAK,+BAA+B,MAAM;GACnD,eAAe,OAAO,iBAAiB,KAAK,mBAAmB;EACjE,CAAC;CACH;CAEA,MAAM,eAAe,QAA6B;EAChD,IAAI,CAAC,KAAK,QAAQ,cAChB,MAAM,IAAI,uBAAuB;EAGnC,MAAM,SAAS,MAAM,KAAK,QAAQ,UAAU,WAAW,KAAK,UAAU,CACpE,OAAO,SACT,CAAC;EAED,OAAO,KAAK,QAAQ,aAAa,cAAc;GAC7C,KAAK;GACL,SAAS,OAAO;GAChB,cAAc;GACd,MAAM,CAAC,KAAK,uBAAuB,GAAG,SAAS,OAAO,MAAM,CAAC;EAC/D,CAAC;CACH;AACF"}
@@ -1,2 +1,2 @@
1
- import { t as SpotQueryAPI } from "../../SpotQueryAPI-DS85MzQB.cjs";
1
+ import { t as SpotQueryAPI } from "../../SpotQueryAPI-MD_laBQT.cjs";
2
2
  export { SpotQueryAPI };
@@ -1,2 +1,2 @@
1
- import { t as SpotQueryAPI } from "../../SpotQueryAPI-CfZcvt4p.js";
1
+ import { t as SpotQueryAPI } from "../../SpotQueryAPI-j1tFpyNx.js";
2
2
  export { SpotQueryAPI };
@@ -1,3 +1,3 @@
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
+ 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, u as WithdrawCollateralV2Params } from "../../types-pRheTrJ1.cjs";
2
+ import { t as SpotAPI } from "../../index-BQJITv0Y.cjs";
3
+ export { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintMockERC20Params, MintNlpParams, ProductIdOrTokenAddress, SpotAPI, TransferQuoteParams, WithdrawCollateralParams, WithdrawCollateralV2Params };
@@ -1,3 +1,3 @@
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 };
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, u as WithdrawCollateralV2Params } from "../../types-DnBjJCnd.js";
2
+ import { t as SpotAPI } from "../../index-sybPTci-.js";
3
+ export { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintMockERC20Params, MintNlpParams, ProductIdOrTokenAddress, SpotAPI, TransferQuoteParams, WithdrawCollateralParams, WithdrawCollateralV2Params };
@@ -1,2 +1,2 @@
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
+ 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, u as WithdrawCollateralV2Params } from "../../types-pRheTrJ1.cjs";
2
+ export { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintMockERC20Params, MintNlpParams, ProductIdOrTokenAddress, TransferQuoteParams, WithdrawCollateralParams, WithdrawCollateralV2Params };
@@ -1,2 +1,2 @@
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 };
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, u as WithdrawCollateralV2Params } from "../../types-DnBjJCnd.js";
2
+ export { ApproveAllowanceParams, BurnNlpParams, GetTokenAllowanceParams, GetTokenWalletBalanceParams, MintMockERC20Params, MintNlpParams, ProductIdOrTokenAddress, TransferQuoteParams, WithdrawCollateralParams, WithdrawCollateralV2Params };
@@ -23,6 +23,14 @@ var WebSocketExecuteAPI = class extends require_apis_base.BaseNadoAPI {
23
23
  return this.context.engineClient.payloadBuilder.buildWithdrawCollateralPayload(params);
24
24
  }
25
25
  /**
26
+ * Builds ws message for the `withdraw_collateral_v2` execute action.
27
+ * @param params WithdrawCollateralV2 params.
28
+ * @returns `withdraw_collateral_v2` execute message
29
+ */
30
+ async buildWithdrawCollateralV2Message(params) {
31
+ return this.context.engineClient.payloadBuilder.buildWithdrawCollateralV2Payload(params);
32
+ }
33
+ /**
26
34
  * Builds ws message for the `place_order` execute action.
27
35
  * @param params PlaceOrder params.
28
36
  * @returns `place_order` execute message
@@ -1 +1 @@
1
- {"version":3,"file":"WebSocketExecuteAPI.cjs","names":["BaseNadoAPI"],"sources":["../../../src/apis/ws/WebSocketExecuteAPI.ts"],"sourcesContent":["import {\n EngineExecuteRequestParamsByType,\n WithSignature,\n} from '@nadohq/engine-client';\nimport { EIP712OrderParams } from '@nadohq/shared';\nimport { BaseNadoAPI } from '../base';\n\n/**\n * Builds execute messages as expected by the server to send over Websocket.\n * @example nadoClient.ws.execute.buildPlaceOrderMessage(...)\n */\nexport class WebSocketExecuteAPI extends BaseNadoAPI {\n /**\n * Builds ws message for the `liquidate_subaccount` execute action.\n * @param params LiquidateSubaccount params.\n * @returns `liquidate_subaccount` execute message\n */\n async buildLiquidateSubaccountMessage(\n params: EngineExecuteRequestParamsByType['liquidate_subaccount'],\n ) {\n return this.context.engineClient.payloadBuilder.buildLiquidateSubaccountPayload(\n params,\n );\n }\n\n /**\n * Builds ws message for the `withdraw_collateral` execute action.\n * @param params WithdrawCollateral params.\n * @returns `liquidate_subaccount` execute message\n */\n async buildWithdrawCollateralMessage(\n params: EngineExecuteRequestParamsByType['withdraw_collateral'],\n ) {\n return this.context.engineClient.payloadBuilder.buildWithdrawCollateralPayload(\n params,\n );\n }\n\n /**\n * Builds ws message for the `place_order` execute action.\n * @param params PlaceOrder params.\n * @returns `place_order` execute message\n */\n buildPlaceOrderMessage(\n params: WithSignature<\n EngineExecuteRequestParamsByType['place_order'] & {\n order: EIP712OrderParams;\n }\n >,\n ) {\n return this.context.engineClient.payloadBuilder.buildPlaceOrderPayloadSync(\n params,\n );\n }\n\n /**\n * Builds ws message for the `cancel_orders` execute action.\n * @param params PlaceOrder params.\n * @returns `cancel_orders` execute message\n */\n buildCancelOrdersMessage(\n params: WithSignature<\n EngineExecuteRequestParamsByType['cancel_orders'] & { nonce: string }\n >,\n ) {\n return this.context.engineClient.payloadBuilder.buildCancelOrdersPayloadSync(\n params,\n );\n }\n}\n"],"mappings":";;;;;;;AAWA,IAAa,sBAAb,cAAyCA,kBAAAA,YAAY;;;;;;CAMnD,MAAM,gCACJ,QACA;EACA,OAAO,KAAK,QAAQ,aAAa,eAAe,gCAC9C,MACF;CACF;;;;;;CAOA,MAAM,+BACJ,QACA;EACA,OAAO,KAAK,QAAQ,aAAa,eAAe,+BAC9C,MACF;CACF;;;;;;CAOA,uBACE,QAKA;EACA,OAAO,KAAK,QAAQ,aAAa,eAAe,2BAC9C,MACF;CACF;;;;;;CAOA,yBACE,QAGA;EACA,OAAO,KAAK,QAAQ,aAAa,eAAe,6BAC9C,MACF;CACF;AACF"}
1
+ {"version":3,"file":"WebSocketExecuteAPI.cjs","names":["BaseNadoAPI"],"sources":["../../../src/apis/ws/WebSocketExecuteAPI.ts"],"sourcesContent":["import {\n EngineExecuteRequestParamsByType,\n WithSignature,\n} from '@nadohq/engine-client';\nimport { EIP712OrderParams } from '@nadohq/shared';\nimport { BaseNadoAPI } from '../base';\n\n/**\n * Builds execute messages as expected by the server to send over Websocket.\n * @example nadoClient.ws.execute.buildPlaceOrderMessage(...)\n */\nexport class WebSocketExecuteAPI extends BaseNadoAPI {\n /**\n * Builds ws message for the `liquidate_subaccount` execute action.\n * @param params LiquidateSubaccount params.\n * @returns `liquidate_subaccount` execute message\n */\n async buildLiquidateSubaccountMessage(\n params: EngineExecuteRequestParamsByType['liquidate_subaccount'],\n ) {\n return this.context.engineClient.payloadBuilder.buildLiquidateSubaccountPayload(\n params,\n );\n }\n\n /**\n * Builds ws message for the `withdraw_collateral` execute action.\n * @param params WithdrawCollateral params.\n * @returns `liquidate_subaccount` execute message\n */\n async buildWithdrawCollateralMessage(\n params: EngineExecuteRequestParamsByType['withdraw_collateral'],\n ) {\n return this.context.engineClient.payloadBuilder.buildWithdrawCollateralPayload(\n params,\n );\n }\n\n /**\n * Builds ws message for the `withdraw_collateral_v2` execute action.\n * @param params WithdrawCollateralV2 params.\n * @returns `withdraw_collateral_v2` execute message\n */\n async buildWithdrawCollateralV2Message(\n params: EngineExecuteRequestParamsByType['withdraw_collateral_v2'],\n ) {\n return this.context.engineClient.payloadBuilder.buildWithdrawCollateralV2Payload(\n params,\n );\n }\n\n /**\n * Builds ws message for the `place_order` execute action.\n * @param params PlaceOrder params.\n * @returns `place_order` execute message\n */\n buildPlaceOrderMessage(\n params: WithSignature<\n EngineExecuteRequestParamsByType['place_order'] & {\n order: EIP712OrderParams;\n }\n >,\n ) {\n return this.context.engineClient.payloadBuilder.buildPlaceOrderPayloadSync(\n params,\n );\n }\n\n /**\n * Builds ws message for the `cancel_orders` execute action.\n * @param params PlaceOrder params.\n * @returns `cancel_orders` execute message\n */\n buildCancelOrdersMessage(\n params: WithSignature<\n EngineExecuteRequestParamsByType['cancel_orders'] & { nonce: string }\n >,\n ) {\n return this.context.engineClient.payloadBuilder.buildCancelOrdersPayloadSync(\n params,\n );\n }\n}\n"],"mappings":";;;;;;;AAWA,IAAa,sBAAb,cAAyCA,kBAAAA,YAAY;;;;;;CAMnD,MAAM,gCACJ,QACA;EACA,OAAO,KAAK,QAAQ,aAAa,eAAe,gCAC9C,MACF;CACF;;;;;;CAOA,MAAM,+BACJ,QACA;EACA,OAAO,KAAK,QAAQ,aAAa,eAAe,+BAC9C,MACF;CACF;;;;;;CAOA,MAAM,iCACJ,QACA;EACA,OAAO,KAAK,QAAQ,aAAa,eAAe,iCAC9C,MACF;CACF;;;;;;CAOA,uBACE,QAKA;EACA,OAAO,KAAK,QAAQ,aAAa,eAAe,2BAC9C,MACF;CACF;;;;;;CAOA,yBACE,QAGA;EACA,OAAO,KAAK,QAAQ,aAAa,eAAe,6BAC9C,MACF;CACF;AACF"}
@@ -1,2 +1,2 @@
1
- import { t as WebSocketExecuteAPI } from "../../WebSocketExecuteAPI-7gLrCoXN.cjs";
1
+ import { t as WebSocketExecuteAPI } from "../../WebSocketExecuteAPI-BNptpegV.cjs";
2
2
  export { WebSocketExecuteAPI };
@@ -1,2 +1,2 @@
1
- import { t as WebSocketExecuteAPI } from "../../WebSocketExecuteAPI-DHhKag16.js";
1
+ import { t as WebSocketExecuteAPI } from "../../WebSocketExecuteAPI-GF4dkb5s.js";
2
2
  export { WebSocketExecuteAPI };
@@ -22,6 +22,14 @@ var WebSocketExecuteAPI = class extends BaseNadoAPI {
22
22
  return this.context.engineClient.payloadBuilder.buildWithdrawCollateralPayload(params);
23
23
  }
24
24
  /**
25
+ * Builds ws message for the `withdraw_collateral_v2` execute action.
26
+ * @param params WithdrawCollateralV2 params.
27
+ * @returns `withdraw_collateral_v2` execute message
28
+ */
29
+ async buildWithdrawCollateralV2Message(params) {
30
+ return this.context.engineClient.payloadBuilder.buildWithdrawCollateralV2Payload(params);
31
+ }
32
+ /**
25
33
  * Builds ws message for the `place_order` execute action.
26
34
  * @param params PlaceOrder params.
27
35
  * @returns `place_order` execute message
@@ -1 +1 @@
1
- {"version":3,"file":"WebSocketExecuteAPI.js","names":[],"sources":["../../../src/apis/ws/WebSocketExecuteAPI.ts"],"sourcesContent":["import {\n EngineExecuteRequestParamsByType,\n WithSignature,\n} from '@nadohq/engine-client';\nimport { EIP712OrderParams } from '@nadohq/shared';\nimport { BaseNadoAPI } from '../base';\n\n/**\n * Builds execute messages as expected by the server to send over Websocket.\n * @example nadoClient.ws.execute.buildPlaceOrderMessage(...)\n */\nexport class WebSocketExecuteAPI extends BaseNadoAPI {\n /**\n * Builds ws message for the `liquidate_subaccount` execute action.\n * @param params LiquidateSubaccount params.\n * @returns `liquidate_subaccount` execute message\n */\n async buildLiquidateSubaccountMessage(\n params: EngineExecuteRequestParamsByType['liquidate_subaccount'],\n ) {\n return this.context.engineClient.payloadBuilder.buildLiquidateSubaccountPayload(\n params,\n );\n }\n\n /**\n * Builds ws message for the `withdraw_collateral` execute action.\n * @param params WithdrawCollateral params.\n * @returns `liquidate_subaccount` execute message\n */\n async buildWithdrawCollateralMessage(\n params: EngineExecuteRequestParamsByType['withdraw_collateral'],\n ) {\n return this.context.engineClient.payloadBuilder.buildWithdrawCollateralPayload(\n params,\n );\n }\n\n /**\n * Builds ws message for the `place_order` execute action.\n * @param params PlaceOrder params.\n * @returns `place_order` execute message\n */\n buildPlaceOrderMessage(\n params: WithSignature<\n EngineExecuteRequestParamsByType['place_order'] & {\n order: EIP712OrderParams;\n }\n >,\n ) {\n return this.context.engineClient.payloadBuilder.buildPlaceOrderPayloadSync(\n params,\n );\n }\n\n /**\n * Builds ws message for the `cancel_orders` execute action.\n * @param params PlaceOrder params.\n * @returns `cancel_orders` execute message\n */\n buildCancelOrdersMessage(\n params: WithSignature<\n EngineExecuteRequestParamsByType['cancel_orders'] & { nonce: string }\n >,\n ) {\n return this.context.engineClient.payloadBuilder.buildCancelOrdersPayloadSync(\n params,\n );\n }\n}\n"],"mappings":";;;;;;AAWA,IAAa,sBAAb,cAAyC,YAAY;;;;;;CAMnD,MAAM,gCACJ,QACA;EACA,OAAO,KAAK,QAAQ,aAAa,eAAe,gCAC9C,MACF;CACF;;;;;;CAOA,MAAM,+BACJ,QACA;EACA,OAAO,KAAK,QAAQ,aAAa,eAAe,+BAC9C,MACF;CACF;;;;;;CAOA,uBACE,QAKA;EACA,OAAO,KAAK,QAAQ,aAAa,eAAe,2BAC9C,MACF;CACF;;;;;;CAOA,yBACE,QAGA;EACA,OAAO,KAAK,QAAQ,aAAa,eAAe,6BAC9C,MACF;CACF;AACF"}
1
+ {"version":3,"file":"WebSocketExecuteAPI.js","names":[],"sources":["../../../src/apis/ws/WebSocketExecuteAPI.ts"],"sourcesContent":["import {\n EngineExecuteRequestParamsByType,\n WithSignature,\n} from '@nadohq/engine-client';\nimport { EIP712OrderParams } from '@nadohq/shared';\nimport { BaseNadoAPI } from '../base';\n\n/**\n * Builds execute messages as expected by the server to send over Websocket.\n * @example nadoClient.ws.execute.buildPlaceOrderMessage(...)\n */\nexport class WebSocketExecuteAPI extends BaseNadoAPI {\n /**\n * Builds ws message for the `liquidate_subaccount` execute action.\n * @param params LiquidateSubaccount params.\n * @returns `liquidate_subaccount` execute message\n */\n async buildLiquidateSubaccountMessage(\n params: EngineExecuteRequestParamsByType['liquidate_subaccount'],\n ) {\n return this.context.engineClient.payloadBuilder.buildLiquidateSubaccountPayload(\n params,\n );\n }\n\n /**\n * Builds ws message for the `withdraw_collateral` execute action.\n * @param params WithdrawCollateral params.\n * @returns `liquidate_subaccount` execute message\n */\n async buildWithdrawCollateralMessage(\n params: EngineExecuteRequestParamsByType['withdraw_collateral'],\n ) {\n return this.context.engineClient.payloadBuilder.buildWithdrawCollateralPayload(\n params,\n );\n }\n\n /**\n * Builds ws message for the `withdraw_collateral_v2` execute action.\n * @param params WithdrawCollateralV2 params.\n * @returns `withdraw_collateral_v2` execute message\n */\n async buildWithdrawCollateralV2Message(\n params: EngineExecuteRequestParamsByType['withdraw_collateral_v2'],\n ) {\n return this.context.engineClient.payloadBuilder.buildWithdrawCollateralV2Payload(\n params,\n );\n }\n\n /**\n * Builds ws message for the `place_order` execute action.\n * @param params PlaceOrder params.\n * @returns `place_order` execute message\n */\n buildPlaceOrderMessage(\n params: WithSignature<\n EngineExecuteRequestParamsByType['place_order'] & {\n order: EIP712OrderParams;\n }\n >,\n ) {\n return this.context.engineClient.payloadBuilder.buildPlaceOrderPayloadSync(\n params,\n );\n }\n\n /**\n * Builds ws message for the `cancel_orders` execute action.\n * @param params PlaceOrder params.\n * @returns `cancel_orders` execute message\n */\n buildCancelOrdersMessage(\n params: WithSignature<\n EngineExecuteRequestParamsByType['cancel_orders'] & { nonce: string }\n >,\n ) {\n return this.context.engineClient.payloadBuilder.buildCancelOrdersPayloadSync(\n params,\n );\n }\n}\n"],"mappings":";;;;;;AAWA,IAAa,sBAAb,cAAyC,YAAY;;;;;;CAMnD,MAAM,gCACJ,QACA;EACA,OAAO,KAAK,QAAQ,aAAa,eAAe,gCAC9C,MACF;CACF;;;;;;CAOA,MAAM,+BACJ,QACA;EACA,OAAO,KAAK,QAAQ,aAAa,eAAe,+BAC9C,MACF;CACF;;;;;;CAOA,MAAM,iCACJ,QACA;EACA,OAAO,KAAK,QAAQ,aAAa,eAAe,iCAC9C,MACF;CACF;;;;;;CAOA,uBACE,QAKA;EACA,OAAO,KAAK,QAAQ,aAAa,eAAe,2BAC9C,MACF;CACF;;;;;;CAOA,yBACE,QAGA;EACA,OAAO,KAAK,QAAQ,aAAa,eAAe,6BAC9C,MACF;CACF;AACF"}
@@ -1,2 +1,2 @@
1
- import { t as WebsocketAPI } from "../../index-Cc2RdeRK.cjs";
1
+ import { t as WebsocketAPI } from "../../index-CF-YqgJA.cjs";
2
2
  export { WebsocketAPI };
@@ -1,2 +1,2 @@
1
- import { t as WebsocketAPI } from "../../index-RtQYDuRY.js";
1
+ import { t as WebsocketAPI } from "../../index-sXZQ-XdS.js";
2
2
  export { WebsocketAPI };
package/dist/client.d.cts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { r as NadoClientContext } from "./context-YHVv2kD4.cjs";
2
2
  import { t as MarketAPI } from "./index-C7QDIAXA.cjs";
3
3
  import { t as PerpAPI } from "./index-BFQPcj2w.cjs";
4
- import { t as SpotAPI } from "./index-CSG04f_b.cjs";
4
+ import { t as SpotAPI } from "./index-BQJITv0Y.cjs";
5
5
  import { t as SubaccountAPI } from "./index-jTtf55U_.cjs";
6
- import { t as WebsocketAPI } from "./index-Cc2RdeRK.cjs";
6
+ import { t as WebsocketAPI } from "./index-CF-YqgJA.cjs";
7
7
  import { WalletClientWithAccount } from "@nadohq/shared";
8
8
 
9
9
  //#region src/client.d.ts
package/dist/client.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { r as NadoClientContext } from "./context-YfcGQ0Sr.js";
2
2
  import { t as MarketAPI } from "./index-CKZZ-QEJ.js";
3
3
  import { t as PerpAPI } from "./index-DVJ1Mu6s.js";
4
- import { t as SpotAPI } from "./index-Mhjd1FK8.js";
4
+ import { t as SpotAPI } from "./index-sybPTci-.js";
5
5
  import { t as SubaccountAPI } from "./index-Dw9iFeeU.js";
6
- import { t as WebsocketAPI } from "./index-RtQYDuRY.js";
6
+ import { t as WebsocketAPI } from "./index-sXZQ-XdS.js";
7
7
  import { WalletClientWithAccount } from "@nadohq/shared";
8
8
 
9
9
  //#region src/client.d.ts
@@ -1,5 +1,5 @@
1
- import { t as SpotExecuteAPI } from "./SpotExecuteAPI-b07ixUz2.cjs";
2
- import { t as SpotQueryAPI } from "./SpotQueryAPI-DS85MzQB.cjs";
1
+ import { t as SpotExecuteAPI } from "./SpotExecuteAPI-1ldtNuAF.cjs";
2
+ import { t as SpotQueryAPI } from "./SpotQueryAPI-MD_laBQT.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-CSG04f_b.d.cts.map
12
+ //# sourceMappingURL=index-BQJITv0Y.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-BQJITv0Y.d.cts","names":[],"sources":["../src/apis/spot/src/apis/spot/index.ts"],"mappings":";;;;cAE8C,YAAA;;;AAAA;cAKjC,OAAA,SAAgB,YAAmC"}
@@ -1,6 +1,6 @@
1
1
  import { r as NadoClientContext } from "./context-YHVv2kD4.cjs";
2
2
  import { t as BaseNadoAPI } from "./base-BYkH_-5-.cjs";
3
- import { t as WebSocketExecuteAPI } from "./WebSocketExecuteAPI-7gLrCoXN.cjs";
3
+ import { t as WebSocketExecuteAPI } from "./WebSocketExecuteAPI-BNptpegV.cjs";
4
4
  import { t as WebSocketQueryAPI } from "./WebSocketQueryAPI-BMLp4dCH.cjs";
5
5
  import { t as WebSocketSubscriptionAPI } from "./WebSocketSubscriptionAPI-bApRHac8.cjs";
6
6
 
@@ -16,4 +16,4 @@ declare class WebsocketAPI extends BaseNadoAPI {
16
16
  }
17
17
  //#endregion
18
18
  export { WebsocketAPI as t };
19
- //# sourceMappingURL=index-Cc2RdeRK.d.cts.map
19
+ //# sourceMappingURL=index-CF-YqgJA.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-Cc2RdeRK.d.cts","names":[],"sources":["../src/apis/ws/src/apis/ws/index.ts"],"mappings":";;;;;;;;;AASA;cAAa,YAAA,SAAqB,WAAA;EAAA,SACvB,KAAA,EAAO,iBAAA;EAAA,SACP,OAAA,EAAS,mBAAA;EAAA,SACT,YAAA,EAAc,wBAAA;cAEX,OAAA,EAAS,iBAAA;AAAA"}
1
+ {"version":3,"file":"index-CF-YqgJA.d.cts","names":[],"sources":["../src/apis/ws/src/apis/ws/index.ts"],"mappings":";;;;;;;;;AASA;cAAa,YAAA,SAAqB,WAAA;EAAA,SACvB,KAAA,EAAO,iBAAA;EAAA,SACP,OAAA,EAAS,mBAAA;EAAA,SACT,YAAA,EAAc,wBAAA;cAEX,OAAA,EAAS,iBAAA;AAAA"}
@@ -1,6 +1,6 @@
1
1
  import { r as NadoClientContext } from "./context-YfcGQ0Sr.js";
2
2
  import { t as BaseNadoAPI } from "./base-B92wTsrc.js";
3
- import { t as WebSocketExecuteAPI } from "./WebSocketExecuteAPI-DHhKag16.js";
3
+ import { t as WebSocketExecuteAPI } from "./WebSocketExecuteAPI-GF4dkb5s.js";
4
4
  import { t as WebSocketQueryAPI } from "./WebSocketQueryAPI-B9vBQo5q.js";
5
5
  import { t as WebSocketSubscriptionAPI } from "./WebSocketSubscriptionAPI-qUFRFcRI.js";
6
6
 
@@ -16,4 +16,4 @@ declare class WebsocketAPI extends BaseNadoAPI {
16
16
  }
17
17
  //#endregion
18
18
  export { WebsocketAPI as t };
19
- //# sourceMappingURL=index-RtQYDuRY.d.ts.map
19
+ //# sourceMappingURL=index-sXZQ-XdS.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-RtQYDuRY.d.ts","names":[],"sources":["../src/apis/ws/src/apis/ws/index.ts"],"mappings":";;;;;;;;;AASA;cAAa,YAAA,SAAqB,WAAA;EAAA,SACvB,KAAA,EAAO,iBAAA;EAAA,SACP,OAAA,EAAS,mBAAA;EAAA,SACT,YAAA,EAAc,wBAAA;cAEX,OAAA,EAAS,iBAAA;AAAA"}
1
+ {"version":3,"file":"index-sXZQ-XdS.d.ts","names":[],"sources":["../src/apis/ws/src/apis/ws/index.ts"],"mappings":";;;;;;;;;AASA;cAAa,YAAA,SAAqB,WAAA;EAAA,SACvB,KAAA,EAAO,iBAAA;EAAA,SACP,OAAA,EAAS,mBAAA;EAAA,SACT,YAAA,EAAc,wBAAA;cAEX,OAAA,EAAS,iBAAA;AAAA"}
@@ -1,5 +1,5 @@
1
- import { t as SpotExecuteAPI } from "./SpotExecuteAPI-UWnX_Hm4.js";
2
- import { t as SpotQueryAPI } from "./SpotQueryAPI-CfZcvt4p.js";
1
+ import { t as SpotExecuteAPI } from "./SpotExecuteAPI-tvJR-OKl.js";
2
+ import { t as SpotQueryAPI } from "./SpotQueryAPI-j1tFpyNx.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-Mhjd1FK8.d.ts.map
12
+ //# sourceMappingURL=index-sybPTci-.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-sybPTci-.d.ts","names":[],"sources":["../src/apis/spot/src/apis/spot/index.ts"],"mappings":";;;;cAE8C,YAAA;;;AAAA;cAKjC,OAAA,SAAgB,YAAmC"}
package/dist/index.d.cts CHANGED
@@ -2,8 +2,8 @@ import { i as createClientContext, n as CreateNadoClientContextOpts, r as NadoCl
2
2
  import { a as CancelTriggerProductOrdersParams, c as PlaceOrdersParams, i as CancelTriggerOrdersParams, l as PlaceTriggerOrderParams, n as CancelOrdersParams, o as GetTriggerOrdersParams, r as CancelProductOrdersParams, s as PlaceOrderParams, t as CancelAndPlaceOrderParams, u as PlaceTriggerOrdersParams } from "./types-YBdM1sun.cjs";
3
3
  import { t as MarketAPI } from "./index-C7QDIAXA.cjs";
4
4
  import { t as PerpAPI } from "./index-BFQPcj2w.cjs";
5
- 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";
6
- import { t as SpotAPI } from "./index-CSG04f_b.cjs";
5
+ 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, u as WithdrawCollateralV2Params } from "./types-pRheTrJ1.cjs";
6
+ import { t as SpotAPI } from "./index-BQJITv0Y.cjs";
7
7
  import { n as LinkSignerParams, r as LiquidateSubaccountParams, t as CreateStandardLinkedSignerResult } from "./types-BWRdhQd_.cjs";
8
8
  import { t as SubaccountAPI } from "./index-jTtf55U_.cjs";
9
9
  import { NadoClient } from "./client.cjs";
@@ -12,4 +12,4 @@ export * from "@nadohq/shared";
12
12
  export * from "@nadohq/engine-client";
13
13
  export * from "@nadohq/indexer-client";
14
14
  export * from "@nadohq/trigger-client";
15
- export { ApproveAllowanceParams, BurnNlpParams, CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, CreateNadoClientContextAccountOpts, CreateNadoClientContextOpts, CreateStandardLinkedSignerResult, GetTokenAllowanceParams, GetTokenWalletBalanceParams, GetTriggerOrdersParams, LinkSignerParams, LiquidateSubaccountParams, MarketAPI, MintMockERC20Params, MintNlpParams, NadoClient, NadoClientContext, PerpAPI, PlaceOrderParams, PlaceOrdersParams, PlaceTriggerOrderParams, PlaceTriggerOrdersParams, ProductIdOrTokenAddress, SpotAPI, SubaccountAPI, TransferQuoteParams, WithdrawCollateralParams, createClientContext, createNadoClient };
15
+ export { ApproveAllowanceParams, BurnNlpParams, CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, CreateNadoClientContextAccountOpts, CreateNadoClientContextOpts, CreateStandardLinkedSignerResult, GetTokenAllowanceParams, GetTokenWalletBalanceParams, GetTriggerOrdersParams, LinkSignerParams, LiquidateSubaccountParams, MarketAPI, MintMockERC20Params, MintNlpParams, NadoClient, NadoClientContext, PerpAPI, PlaceOrderParams, PlaceOrdersParams, PlaceTriggerOrderParams, PlaceTriggerOrdersParams, ProductIdOrTokenAddress, SpotAPI, SubaccountAPI, TransferQuoteParams, WithdrawCollateralParams, WithdrawCollateralV2Params, createClientContext, createNadoClient };
package/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@ import { i as createClientContext, n as CreateNadoClientContextOpts, r as NadoCl
2
2
  import { a as CancelTriggerProductOrdersParams, c as PlaceOrdersParams, i as CancelTriggerOrdersParams, l as PlaceTriggerOrderParams, n as CancelOrdersParams, o as GetTriggerOrdersParams, r as CancelProductOrdersParams, s as PlaceOrderParams, t as CancelAndPlaceOrderParams, u as PlaceTriggerOrdersParams } from "./types-BFFzjzRy.js";
3
3
  import { t as MarketAPI } from "./index-CKZZ-QEJ.js";
4
4
  import { t as PerpAPI } from "./index-DVJ1Mu6s.js";
5
- 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";
6
- import { t as SpotAPI } from "./index-Mhjd1FK8.js";
5
+ 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, u as WithdrawCollateralV2Params } from "./types-DnBjJCnd.js";
6
+ import { t as SpotAPI } from "./index-sybPTci-.js";
7
7
  import { n as LinkSignerParams, r as LiquidateSubaccountParams, t as CreateStandardLinkedSignerResult } from "./types-B6oFoDTo.js";
8
8
  import { t as SubaccountAPI } from "./index-Dw9iFeeU.js";
9
9
  import { NadoClient } from "./client.js";
@@ -12,4 +12,4 @@ export * from "@nadohq/shared";
12
12
  export * from "@nadohq/engine-client";
13
13
  export * from "@nadohq/indexer-client";
14
14
  export * from "@nadohq/trigger-client";
15
- export { ApproveAllowanceParams, BurnNlpParams, CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, CreateNadoClientContextAccountOpts, CreateNadoClientContextOpts, CreateStandardLinkedSignerResult, GetTokenAllowanceParams, GetTokenWalletBalanceParams, GetTriggerOrdersParams, LinkSignerParams, LiquidateSubaccountParams, MarketAPI, MintMockERC20Params, MintNlpParams, NadoClient, NadoClientContext, PerpAPI, PlaceOrderParams, PlaceOrdersParams, PlaceTriggerOrderParams, PlaceTriggerOrdersParams, ProductIdOrTokenAddress, SpotAPI, SubaccountAPI, TransferQuoteParams, WithdrawCollateralParams, createClientContext, createNadoClient };
15
+ export { ApproveAllowanceParams, BurnNlpParams, CancelAndPlaceOrderParams, CancelOrdersParams, CancelProductOrdersParams, CancelTriggerOrdersParams, CancelTriggerProductOrdersParams, CreateNadoClientContextAccountOpts, CreateNadoClientContextOpts, CreateStandardLinkedSignerResult, GetTokenAllowanceParams, GetTokenWalletBalanceParams, GetTriggerOrdersParams, LinkSignerParams, LiquidateSubaccountParams, MarketAPI, MintMockERC20Params, MintNlpParams, NadoClient, NadoClientContext, PerpAPI, PlaceOrderParams, PlaceOrdersParams, PlaceTriggerOrderParams, PlaceTriggerOrdersParams, ProductIdOrTokenAddress, SpotAPI, SubaccountAPI, TransferQuoteParams, WithdrawCollateralParams, WithdrawCollateralV2Params, createClientContext, createNadoClient };
@@ -1,6 +1,6 @@
1
1
  import { n as OptionalSubaccountOwner, t as OptionalSignatureParams } from "./types-C5DKLOen.js";
2
2
  import { BigNumberish } from "@nadohq/shared";
3
- import { EngineBurnNlpParams, EngineMintNlpParams, EngineTransferQuoteParams, EngineWithdrawCollateralParams } from "@nadohq/engine-client";
3
+ import { EngineBurnNlpParams, EngineMintNlpParams, EngineTransferQuoteParams, EngineWithdrawCollateralParams, EngineWithdrawCollateralV2Params } from "@nadohq/engine-client";
4
4
 
5
5
  //#region src/apis/spot/types.d.ts
6
6
  type ProductIdOrTokenAddress = {
@@ -17,6 +17,7 @@ type ApproveAllowanceParams = ProductIdOrTokenAddress & {
17
17
  type GetTokenWalletBalanceParams = TokenQueryParams;
18
18
  type GetTokenAllowanceParams = TokenQueryParams;
19
19
  type WithdrawCollateralParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineWithdrawCollateralParams>>;
20
+ type WithdrawCollateralV2Params = OptionalSignatureParams<OptionalSubaccountOwner<EngineWithdrawCollateralV2Params>>;
20
21
  type TransferQuoteParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineTransferQuoteParams>>;
21
22
  type MintNlpParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineMintNlpParams>>;
22
23
  type BurnNlpParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineBurnNlpParams>>;
@@ -25,5 +26,5 @@ interface MintMockERC20Params {
25
26
  amount: BigNumberish;
26
27
  }
27
28
  //#endregion
28
- export { MintMockERC20Params as a, TransferQuoteParams as c, GetTokenWalletBalanceParams as i, WithdrawCollateralParams as l, BurnNlpParams as n, MintNlpParams as o, GetTokenAllowanceParams as r, ProductIdOrTokenAddress as s, ApproveAllowanceParams as t };
29
- //# sourceMappingURL=types-B-tOIIKl.d.ts.map
29
+ export { MintMockERC20Params as a, TransferQuoteParams as c, GetTokenWalletBalanceParams as i, WithdrawCollateralParams as l, BurnNlpParams as n, MintNlpParams as o, GetTokenAllowanceParams as r, ProductIdOrTokenAddress as s, ApproveAllowanceParams as t, WithdrawCollateralV2Params as u };
30
+ //# sourceMappingURL=types-DnBjJCnd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-DnBjJCnd.d.ts","names":[],"sources":["../src/apis/spot/src/apis/spot/types.ts"],"mappings":";;;;;KAUY,uBAAA;EAEN,SAAA;AAAA;EAGA,YAAY;AAAA;AAAA,KAGb,gBAAA;EACH,OAAA;AAAA,IACE,uBAAuB;AAAA,KAEf,sBAAA,GAAyB,uBAAA;EACnC,MAAA,EAAQ,YAAY;AAAA;AAAA,KAGV,2BAAA,GAA8B,gBAAgB;AAAA,KAE9C,uBAAA,GAA0B,gBAAgB;AAAA,KAE1C,wBAAA,GAA2B,uBAAA,CACrC,uBAAA,CAAwB,8BAAA;AAAA,KAGd,0BAAA,GAA6B,uBAAA,CACvC,uBAAA,CAAwB,gCAAA;AAAA,KAGd,mBAAA,GAAsB,uBAAA,CAChC,uBAAA,CAAwB,yBAAA;AAAA,KAGd,aAAA,GAAgB,uBAAA,CAC1B,uBAAA,CAAwB,mBAAA;AAAA,KAGd,aAAA,GAAgB,uBAAA,CAC1B,uBAAA,CAAwB,mBAAA;AAAA,UAGT,mBAAA;EACf,SAAA;EACA,MAAA,EAAQ,YAAY;AAAA"}
@@ -1,6 +1,6 @@
1
1
  import { n as OptionalSubaccountOwner, t as OptionalSignatureParams } from "./types-D27__G6_.cjs";
2
2
  import { BigNumberish } from "@nadohq/shared";
3
- import { EngineBurnNlpParams, EngineMintNlpParams, EngineTransferQuoteParams, EngineWithdrawCollateralParams } from "@nadohq/engine-client";
3
+ import { EngineBurnNlpParams, EngineMintNlpParams, EngineTransferQuoteParams, EngineWithdrawCollateralParams, EngineWithdrawCollateralV2Params } from "@nadohq/engine-client";
4
4
 
5
5
  //#region src/apis/spot/types.d.ts
6
6
  type ProductIdOrTokenAddress = {
@@ -17,6 +17,7 @@ type ApproveAllowanceParams = ProductIdOrTokenAddress & {
17
17
  type GetTokenWalletBalanceParams = TokenQueryParams;
18
18
  type GetTokenAllowanceParams = TokenQueryParams;
19
19
  type WithdrawCollateralParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineWithdrawCollateralParams>>;
20
+ type WithdrawCollateralV2Params = OptionalSignatureParams<OptionalSubaccountOwner<EngineWithdrawCollateralV2Params>>;
20
21
  type TransferQuoteParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineTransferQuoteParams>>;
21
22
  type MintNlpParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineMintNlpParams>>;
22
23
  type BurnNlpParams = OptionalSignatureParams<OptionalSubaccountOwner<EngineBurnNlpParams>>;
@@ -25,5 +26,5 @@ interface MintMockERC20Params {
25
26
  amount: BigNumberish;
26
27
  }
27
28
  //#endregion
28
- export { MintMockERC20Params as a, TransferQuoteParams as c, GetTokenWalletBalanceParams as i, WithdrawCollateralParams as l, BurnNlpParams as n, MintNlpParams as o, GetTokenAllowanceParams as r, ProductIdOrTokenAddress as s, ApproveAllowanceParams as t };
29
- //# sourceMappingURL=types-CCj4QJO8.d.cts.map
29
+ export { MintMockERC20Params as a, TransferQuoteParams as c, GetTokenWalletBalanceParams as i, WithdrawCollateralParams as l, BurnNlpParams as n, MintNlpParams as o, GetTokenAllowanceParams as r, ProductIdOrTokenAddress as s, ApproveAllowanceParams as t, WithdrawCollateralV2Params as u };
30
+ //# sourceMappingURL=types-pRheTrJ1.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-pRheTrJ1.d.cts","names":[],"sources":["../src/apis/spot/src/apis/spot/types.ts"],"mappings":";;;;;KAUY,uBAAA;EAEN,SAAA;AAAA;EAGA,YAAY;AAAA;AAAA,KAGb,gBAAA;EACH,OAAA;AAAA,IACE,uBAAuB;AAAA,KAEf,sBAAA,GAAyB,uBAAA;EACnC,MAAA,EAAQ,YAAY;AAAA;AAAA,KAGV,2BAAA,GAA8B,gBAAgB;AAAA,KAE9C,uBAAA,GAA0B,gBAAgB;AAAA,KAE1C,wBAAA,GAA2B,uBAAA,CACrC,uBAAA,CAAwB,8BAAA;AAAA,KAGd,0BAAA,GAA6B,uBAAA,CACvC,uBAAA,CAAwB,gCAAA;AAAA,KAGd,mBAAA,GAAsB,uBAAA,CAChC,uBAAA,CAAwB,yBAAA;AAAA,KAGd,aAAA,GAAgB,uBAAA,CAC1B,uBAAA,CAAwB,mBAAA;AAAA,KAGd,aAAA,GAAgB,uBAAA,CAC1B,uBAAA,CAAwB,mBAAA;AAAA,UAGT,mBAAA;EACf,SAAA;EACA,MAAA,EAAQ,YAAY;AAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nadohq/client",
3
- "version": "0.21.2",
3
+ "version": "0.22.1",
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,19 +41,19 @@
41
41
  "module": "./dist/index.js",
42
42
  "types": "./dist/index.d.ts",
43
43
  "dependencies": {
44
- "@nadohq/engine-client": "^0.21.2",
45
- "@nadohq/indexer-client": "^0.21.2",
46
- "@nadohq/shared": "^0.21.2",
47
- "@nadohq/trigger-client": "^0.21.2",
44
+ "@nadohq/engine-client": "^0.22.1",
45
+ "@nadohq/indexer-client": "^0.22.1",
46
+ "@nadohq/shared": "^0.22.1",
47
+ "@nadohq/trigger-client": "^0.22.1",
48
48
  "ts-mixer": "6.0.4"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "bignumber.js": "11.1.1",
52
- "viem": "2.50.4"
52
+ "viem": "2.52.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "bignumber.js": "11.1.1",
56
- "viem": "2.50.4"
56
+ "viem": "2.52.0"
57
57
  },
58
- "gitHead": "c95f325b73315f1ed8fd808a840e663326e39679"
58
+ "gitHead": "040857b674c8236b280441329664c9f802728af2"
59
59
  }
@@ -15,6 +15,7 @@ import {
15
15
  MintNlpParams,
16
16
  TransferQuoteParams,
17
17
  WithdrawCollateralParams,
18
+ WithdrawCollateralV2Params,
18
19
  } from './types';
19
20
 
20
21
  export class SpotExecuteAPI extends BaseSpotAPI {
@@ -37,6 +38,24 @@ export class SpotExecuteAPI extends BaseSpotAPI {
37
38
  });
38
39
  }
39
40
 
41
+ /**
42
+ * Withdraws collateral to a custom recipient address via the `withdraw_collateral_v2` execute.
43
+ *
44
+ * When `sendTo` is the zero address, funds are sent to the subaccount owner. When `sendTo` is a
45
+ * non-zero address, the transaction must be signed by the subaccount owner (linked signers are
46
+ * not permitted).
47
+ *
48
+ * @param params
49
+ */
50
+ async withdrawV2(params: WithdrawCollateralV2Params) {
51
+ return this.context.engineClient.withdrawCollateralV2({
52
+ ...params,
53
+ subaccountOwner: this.getSubaccountOwnerIfNeeded(params),
54
+ chainId: this.getWalletClientChainIdIfNeeded(params),
55
+ verifyingAddr: params.verifyingAddr ?? this.getEndpointAddress(),
56
+ });
57
+ }
58
+
40
59
  async approveAllowance(params: ApproveAllowanceParams) {
41
60
  const tokenContract = await this.getTokenContractForProduct(params);
42
61
  if (!isWriteableContract(tokenContract)) {
@@ -3,6 +3,7 @@ import {
3
3
  EngineMintNlpParams,
4
4
  EngineTransferQuoteParams,
5
5
  EngineWithdrawCollateralParams,
6
+ EngineWithdrawCollateralV2Params,
6
7
  } from '@nadohq/engine-client';
7
8
  import { BigNumberish } from '@nadohq/shared';
8
9
  import { OptionalSignatureParams, OptionalSubaccountOwner } from '../types';
@@ -31,6 +32,10 @@ export type WithdrawCollateralParams = OptionalSignatureParams<
31
32
  OptionalSubaccountOwner<EngineWithdrawCollateralParams>
32
33
  >;
33
34
 
35
+ export type WithdrawCollateralV2Params = OptionalSignatureParams<
36
+ OptionalSubaccountOwner<EngineWithdrawCollateralV2Params>
37
+ >;
38
+
34
39
  export type TransferQuoteParams = OptionalSignatureParams<
35
40
  OptionalSubaccountOwner<EngineTransferQuoteParams>
36
41
  >;
@@ -36,6 +36,19 @@ export class WebSocketExecuteAPI extends BaseNadoAPI {
36
36
  );
37
37
  }
38
38
 
39
+ /**
40
+ * Builds ws message for the `withdraw_collateral_v2` execute action.
41
+ * @param params WithdrawCollateralV2 params.
42
+ * @returns `withdraw_collateral_v2` execute message
43
+ */
44
+ async buildWithdrawCollateralV2Message(
45
+ params: EngineExecuteRequestParamsByType['withdraw_collateral_v2'],
46
+ ) {
47
+ return this.context.engineClient.payloadBuilder.buildWithdrawCollateralV2Payload(
48
+ params,
49
+ );
50
+ }
51
+
39
52
  /**
40
53
  * Builds ws message for the `place_order` execute action.
41
54
  * @param params PlaceOrder params.
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpotExecuteAPI-UWnX_Hm4.d.ts","names":[],"sources":["../src/apis/spot/src/apis/spot/SpotExecuteAPI.ts"],"mappings":";;;;;cAmBa,cAAA,SAAuB,WAAA;EAC5B,OAAA,CAAQ,MAAA,EAAQ,uBAAA,GAAuB,OAAA;EAUvC,QAAA,CAAS,MAAA,EAAQ,wBAAA,GAAwB,OAAA,iCAAA,gCAAA;EASzC,gBAAA,CAAiB,MAAA,EAAQ,sBAAA,GAAsB,OAAA;;;;;;EAoB/C,aAAA,CAAc,MAAA,EAAQ,mBAAA,GAAmB,OAAA,iCAAA,gCAAA;EASzC,OAAA,CAAQ,MAAA,EAAQ,aAAA,GAAa,OAAA,iCAAA,gCAAA;EAS7B,OAAA,CAAQ,MAAA,EAAQ,aAAA,GAAa,OAAA,iCAAA,gCAAA;EAS7B,cAAA,CAAe,MAAA,EAAQ,mBAAA,GAAmB,OAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpotExecuteAPI-b07ixUz2.d.cts","names":[],"sources":["../src/apis/spot/src/apis/spot/SpotExecuteAPI.ts"],"mappings":";;;;;cAmBa,cAAA,SAAuB,WAAA;EAC5B,OAAA,CAAQ,MAAA,EAAQ,uBAAA,GAAuB,OAAA;EAUvC,QAAA,CAAS,MAAA,EAAQ,wBAAA,GAAwB,OAAA,iCAAA,gCAAA;EASzC,gBAAA,CAAiB,MAAA,EAAQ,sBAAA,GAAsB,OAAA;;;;;;EAoB/C,aAAA,CAAc,MAAA,EAAQ,mBAAA,GAAmB,OAAA,iCAAA,gCAAA;EASzC,OAAA,CAAQ,MAAA,EAAQ,aAAA,GAAa,OAAA,iCAAA,gCAAA;EAS7B,OAAA,CAAQ,MAAA,EAAQ,aAAA,GAAa,OAAA,iCAAA,gCAAA;EAS7B,cAAA,CAAe,MAAA,EAAQ,mBAAA,GAAmB,OAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"WebSocketExecuteAPI-7gLrCoXN.d.cts","names":[],"sources":["../src/apis/ws/src/apis/ws/WebSocketExecuteAPI.ts"],"mappings":";;;;;;;AAWA;;cAAa,mBAAA,SAA4B,WAAA;EAO7B;;;;;EADJ,+BAAA,CACJ,MAAA,EAAQ,gCAAA,2BAAwD,OAAA,0BAAA,QAAA,0BAAA,+BAAA;EA0BxD;;;;;EAdJ,8BAAA,CACJ,MAAA,EAAQ,gCAAA,0BAAuD,OAAA,0BAAA,QAAA,0BAAA,8BAAA;;;EAbvD;;;;;EAyBV,sBAAA,CACE,MAAA,EAAQ,aAAA,CACN,gCAAA;IACE,KAAA,EAAO,iBAAA;EAAA,qCAEV,oCAAA;EAjB8D;;;;;EA6BjE,wBAAA,CACE,MAAA,EAAQ,aAAA,CACN,gCAAA;IAAsD,KAAA;EAAA,qCACvD,8BAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"WebSocketExecuteAPI-DHhKag16.d.ts","names":[],"sources":["../src/apis/ws/src/apis/ws/WebSocketExecuteAPI.ts"],"mappings":";;;;;;;AAWA;;cAAa,mBAAA,SAA4B,WAAA;EAO7B;;;;;EADJ,+BAAA,CACJ,MAAA,EAAQ,gCAAA,2BAAwD,OAAA,0BAAA,QAAA,0BAAA,+BAAA;EA0BxD;;;;;EAdJ,8BAAA,CACJ,MAAA,EAAQ,gCAAA,0BAAuD,OAAA,0BAAA,QAAA,0BAAA,8BAAA;;;EAbvD;;;;;EAyBV,sBAAA,CACE,MAAA,EAAQ,aAAA,CACN,gCAAA;IACE,KAAA,EAAO,iBAAA;EAAA,qCAEV,oCAAA;EAjB8D;;;;;EA6BjE,wBAAA,CACE,MAAA,EAAQ,aAAA,CACN,gCAAA;IAAsD,KAAA;EAAA,qCACvD,8BAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-CSG04f_b.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-Mhjd1FK8.d.ts","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":"types-B-tOIIKl.d.ts","names":[],"sources":["../src/apis/spot/src/apis/spot/types.ts"],"mappings":";;;;;KASY,uBAAA;EAEN,SAAA;AAAA;EAGA,YAAY;AAAA;AAAA,KAGb,gBAAA;EACH,OAAA;AAAA,IACE,uBAAuB;AAAA,KAEf,sBAAA,GAAyB,uBAAA;EACnC,MAAA,EAAQ,YAAY;AAAA;AAAA,KAGV,2BAAA,GAA8B,gBAAgB;AAAA,KAE9C,uBAAA,GAA0B,gBAAgB;AAAA,KAE1C,wBAAA,GAA2B,uBAAA,CACrC,uBAAA,CAAwB,8BAAA;AAAA,KAGd,mBAAA,GAAsB,uBAAA,CAChC,uBAAA,CAAwB,yBAAA;AAAA,KAGd,aAAA,GAAgB,uBAAA,CAC1B,uBAAA,CAAwB,mBAAA;AAAA,KAGd,aAAA,GAAgB,uBAAA,CAC1B,uBAAA,CAAwB,mBAAA;AAAA,UAGT,mBAAA;EACf,SAAA;EACA,MAAA,EAAQ,YAAY;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-CCj4QJO8.d.cts","names":[],"sources":["../src/apis/spot/src/apis/spot/types.ts"],"mappings":";;;;;KASY,uBAAA;EAEN,SAAA;AAAA;EAGA,YAAY;AAAA;AAAA,KAGb,gBAAA;EACH,OAAA;AAAA,IACE,uBAAuB;AAAA,KAEf,sBAAA,GAAyB,uBAAA;EACnC,MAAA,EAAQ,YAAY;AAAA;AAAA,KAGV,2BAAA,GAA8B,gBAAgB;AAAA,KAE9C,uBAAA,GAA0B,gBAAgB;AAAA,KAE1C,wBAAA,GAA2B,uBAAA,CACrC,uBAAA,CAAwB,8BAAA;AAAA,KAGd,mBAAA,GAAsB,uBAAA,CAChC,uBAAA,CAAwB,yBAAA;AAAA,KAGd,aAAA,GAAgB,uBAAA,CAC1B,uBAAA,CAAwB,mBAAA;AAAA,KAGd,aAAA,GAAgB,uBAAA,CAC1B,uBAAA,CAAwB,mBAAA;AAAA,UAGT,mBAAA;EACf,SAAA;EACA,MAAA,EAAQ,YAAY;AAAA"}