@compass-labs/api-sdk 1.0.16 → 1.0.18

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 (123) hide show
  1. package/README.md +2 -2
  2. package/bin/mcp-server.js +115 -120
  3. package/bin/mcp-server.js.map +14 -14
  4. package/dist/commonjs/funcs/ethenaEthenaRequest.d.ts +1 -6
  5. package/dist/commonjs/funcs/ethenaEthenaRequest.d.ts.map +1 -1
  6. package/dist/commonjs/funcs/ethenaEthenaRequest.js +1 -6
  7. package/dist/commonjs/funcs/ethenaEthenaRequest.js.map +1 -1
  8. package/dist/commonjs/funcs/{ethenaEthenaWithdraw.d.ts → ethenaEthenaUnstake.d.ts} +12 -10
  9. package/dist/commonjs/funcs/ethenaEthenaUnstake.d.ts.map +1 -0
  10. package/dist/commonjs/funcs/{ethenaEthenaWithdraw.js → ethenaEthenaUnstake.js} +16 -14
  11. package/dist/commonjs/funcs/{ethenaEthenaWithdraw.js.map → ethenaEthenaUnstake.js.map} +1 -1
  12. package/dist/commonjs/lib/config.d.ts +2 -2
  13. package/dist/commonjs/lib/config.js +2 -2
  14. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  15. package/dist/commonjs/mcp-server/server.js +3 -3
  16. package/dist/commonjs/mcp-server/server.js.map +1 -1
  17. package/dist/commonjs/mcp-server/tools/ethenaEthenaRequest.d.ts.map +1 -1
  18. package/dist/commonjs/mcp-server/tools/ethenaEthenaRequest.js +1 -7
  19. package/dist/commonjs/mcp-server/tools/ethenaEthenaRequest.js.map +1 -1
  20. package/dist/commonjs/mcp-server/tools/ethenaEthenaUnstake.d.ts +8 -0
  21. package/dist/commonjs/mcp-server/tools/ethenaEthenaUnstake.d.ts.map +1 -0
  22. package/dist/commonjs/mcp-server/tools/{ethenaEthenaWithdraw.js → ethenaEthenaUnstake.js} +17 -16
  23. package/dist/commonjs/mcp-server/tools/ethenaEthenaUnstake.js.map +1 -0
  24. package/dist/commonjs/models/components/ethenaunstakeparams.d.ts +34 -0
  25. package/dist/commonjs/models/components/ethenaunstakeparams.d.ts.map +1 -0
  26. package/dist/commonjs/models/components/{ethenawithdrawparams.js → ethenaunstakeparams.js} +19 -21
  27. package/dist/commonjs/models/components/ethenaunstakeparams.js.map +1 -0
  28. package/dist/commonjs/models/components/ethenaunstakerequest.d.ts +64 -0
  29. package/dist/commonjs/models/components/ethenaunstakerequest.d.ts.map +1 -0
  30. package/dist/commonjs/models/components/{ethenawithdrawrequest.js → ethenaunstakerequest.js} +31 -33
  31. package/dist/commonjs/models/components/ethenaunstakerequest.js.map +1 -0
  32. package/dist/commonjs/models/components/index.d.ts +2 -2
  33. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  34. package/dist/commonjs/models/components/index.js +2 -2
  35. package/dist/commonjs/models/components/index.js.map +1 -1
  36. package/dist/commonjs/models/components/useroperation.d.ts +9 -9
  37. package/dist/commonjs/models/components/useroperation.d.ts.map +1 -1
  38. package/dist/commonjs/models/components/useroperation.js +13 -9
  39. package/dist/commonjs/models/components/useroperation.js.map +1 -1
  40. package/dist/commonjs/sdk/ethena.d.ts +21 -24
  41. package/dist/commonjs/sdk/ethena.d.ts.map +1 -1
  42. package/dist/commonjs/sdk/ethena.js +24 -27
  43. package/dist/commonjs/sdk/ethena.js.map +1 -1
  44. package/dist/esm/funcs/ethenaEthenaRequest.d.ts +1 -6
  45. package/dist/esm/funcs/ethenaEthenaRequest.d.ts.map +1 -1
  46. package/dist/esm/funcs/ethenaEthenaRequest.js +1 -6
  47. package/dist/esm/funcs/ethenaEthenaRequest.js.map +1 -1
  48. package/dist/esm/funcs/{ethenaEthenaWithdraw.d.ts → ethenaEthenaUnstake.d.ts} +12 -10
  49. package/dist/esm/funcs/ethenaEthenaUnstake.d.ts.map +1 -0
  50. package/dist/esm/funcs/{ethenaEthenaWithdraw.js → ethenaEthenaUnstake.js} +15 -13
  51. package/dist/esm/funcs/{ethenaEthenaWithdraw.js.map → ethenaEthenaUnstake.js.map} +1 -1
  52. package/dist/esm/lib/config.d.ts +2 -2
  53. package/dist/esm/lib/config.js +2 -2
  54. package/dist/esm/mcp-server/mcp-server.js +1 -1
  55. package/dist/esm/mcp-server/server.js +3 -3
  56. package/dist/esm/mcp-server/server.js.map +1 -1
  57. package/dist/esm/mcp-server/tools/ethenaEthenaRequest.d.ts.map +1 -1
  58. package/dist/esm/mcp-server/tools/ethenaEthenaRequest.js +1 -7
  59. package/dist/esm/mcp-server/tools/ethenaEthenaRequest.js.map +1 -1
  60. package/dist/esm/mcp-server/tools/ethenaEthenaUnstake.d.ts +8 -0
  61. package/dist/esm/mcp-server/tools/ethenaEthenaUnstake.d.ts.map +1 -0
  62. package/dist/esm/mcp-server/tools/ethenaEthenaUnstake.js +41 -0
  63. package/dist/esm/mcp-server/tools/ethenaEthenaUnstake.js.map +1 -0
  64. package/dist/esm/models/components/ethenaunstakeparams.d.ts +34 -0
  65. package/dist/esm/models/components/ethenaunstakeparams.d.ts.map +1 -0
  66. package/dist/esm/models/components/ethenaunstakeparams.js +42 -0
  67. package/dist/esm/models/components/ethenaunstakeparams.js.map +1 -0
  68. package/dist/esm/models/components/ethenaunstakerequest.d.ts +64 -0
  69. package/dist/esm/models/components/ethenaunstakerequest.d.ts.map +1 -0
  70. package/dist/esm/models/components/ethenaunstakerequest.js +64 -0
  71. package/dist/esm/models/components/ethenaunstakerequest.js.map +1 -0
  72. package/dist/esm/models/components/index.d.ts +2 -2
  73. package/dist/esm/models/components/index.d.ts.map +1 -1
  74. package/dist/esm/models/components/index.js +2 -2
  75. package/dist/esm/models/components/index.js.map +1 -1
  76. package/dist/esm/models/components/useroperation.d.ts +9 -9
  77. package/dist/esm/models/components/useroperation.d.ts.map +1 -1
  78. package/dist/esm/models/components/useroperation.js +13 -9
  79. package/dist/esm/models/components/useroperation.js.map +1 -1
  80. package/dist/esm/sdk/ethena.d.ts +21 -24
  81. package/dist/esm/sdk/ethena.d.ts.map +1 -1
  82. package/dist/esm/sdk/ethena.js +24 -27
  83. package/dist/esm/sdk/ethena.js.map +1 -1
  84. package/docs/sdks/ethena/README.md +36 -43
  85. package/jsr.json +1 -1
  86. package/package.json +1 -1
  87. package/src/funcs/ethenaEthenaRequest.ts +1 -6
  88. package/src/funcs/{ethenaEthenaWithdraw.ts → ethenaEthenaUnstake.ts} +16 -14
  89. package/src/lib/config.ts +2 -2
  90. package/src/mcp-server/mcp-server.ts +1 -1
  91. package/src/mcp-server/server.ts +3 -3
  92. package/src/mcp-server/tools/ethenaEthenaRequest.ts +1 -7
  93. package/src/mcp-server/tools/{ethenaEthenaWithdraw.ts → ethenaEthenaUnstake.ts} +15 -14
  94. package/src/models/components/ethenaunstakeparams.ts +82 -0
  95. package/src/models/components/ethenaunstakerequest.ts +122 -0
  96. package/src/models/components/index.ts +2 -2
  97. package/src/models/components/useroperation.ts +33 -33
  98. package/src/sdk/ethena.ts +30 -33
  99. package/dist/commonjs/funcs/ethenaEthenaWithdraw.d.ts.map +0 -1
  100. package/dist/commonjs/mcp-server/tools/ethenaEthenaWithdraw.d.ts +0 -8
  101. package/dist/commonjs/mcp-server/tools/ethenaEthenaWithdraw.d.ts.map +0 -1
  102. package/dist/commonjs/mcp-server/tools/ethenaEthenaWithdraw.js.map +0 -1
  103. package/dist/commonjs/models/components/ethenawithdrawparams.d.ts +0 -39
  104. package/dist/commonjs/models/components/ethenawithdrawparams.d.ts.map +0 -1
  105. package/dist/commonjs/models/components/ethenawithdrawparams.js.map +0 -1
  106. package/dist/commonjs/models/components/ethenawithdrawrequest.d.ts +0 -69
  107. package/dist/commonjs/models/components/ethenawithdrawrequest.d.ts.map +0 -1
  108. package/dist/commonjs/models/components/ethenawithdrawrequest.js.map +0 -1
  109. package/dist/esm/funcs/ethenaEthenaWithdraw.d.ts.map +0 -1
  110. package/dist/esm/mcp-server/tools/ethenaEthenaWithdraw.d.ts +0 -8
  111. package/dist/esm/mcp-server/tools/ethenaEthenaWithdraw.d.ts.map +0 -1
  112. package/dist/esm/mcp-server/tools/ethenaEthenaWithdraw.js +0 -40
  113. package/dist/esm/mcp-server/tools/ethenaEthenaWithdraw.js.map +0 -1
  114. package/dist/esm/models/components/ethenawithdrawparams.d.ts +0 -39
  115. package/dist/esm/models/components/ethenawithdrawparams.d.ts.map +0 -1
  116. package/dist/esm/models/components/ethenawithdrawparams.js +0 -44
  117. package/dist/esm/models/components/ethenawithdrawparams.js.map +0 -1
  118. package/dist/esm/models/components/ethenawithdrawrequest.d.ts +0 -69
  119. package/dist/esm/models/components/ethenawithdrawrequest.d.ts.map +0 -1
  120. package/dist/esm/models/components/ethenawithdrawrequest.js +0 -66
  121. package/dist/esm/models/components/ethenawithdrawrequest.js.map +0 -1
  122. package/src/models/components/ethenawithdrawparams.ts +0 -89
  123. package/src/models/components/ethenawithdrawrequest.ts +0 -129
@@ -3,8 +3,8 @@
3
3
  */
4
4
  import { ethenaEthenaDeposit } from "../funcs/ethenaEthenaDeposit.js";
5
5
  import { ethenaEthenaRequest } from "../funcs/ethenaEthenaRequest.js";
6
+ import { ethenaEthenaUnstake } from "../funcs/ethenaEthenaUnstake.js";
6
7
  import { ethenaEthenaVault } from "../funcs/ethenaEthenaVault.js";
7
- import { ethenaEthenaWithdraw } from "../funcs/ethenaEthenaWithdraw.js";
8
8
  import { ClientSDK } from "../lib/sdks.js";
9
9
  import { unwrapAsync } from "../types/fp.js";
10
10
  export class Ethena extends ClientSDK {
@@ -39,26 +39,6 @@ export class Ethena extends ClientSDK {
39
39
  async ethenaDeposit(request, options) {
40
40
  return unwrapAsync(ethenaEthenaDeposit(this, request, options));
41
41
  }
42
- /**
43
- * Withdraw USDe
44
- *
45
- * @remarks
46
- * Withdraw deposited USDe from Ethena's vault and cease earning passive yield.
47
- *
48
- * The passive yield earned on USDe deposits is represented by the increased value of
49
- * the shares received (sUSDe) upon depositing USDe. Trade in these shares in exchange
50
- * for the intial USDe deposited and any accrued yield since depositing.
51
- * <Info>
52
- * **Required Allowances**
53
- *
54
- * In order to make this transaction, token allowances need to be set for the following contracts.
55
- *
56
- * - `EthenaVault`
57
- * </Info>
58
- */
59
- async ethenaWithdraw(request, options) {
60
- return unwrapAsync(ethenaEthenaWithdraw(this, request, options));
61
- }
62
42
  /**
63
43
  * Request to Withdraw USDe
64
44
  *
@@ -73,16 +53,33 @@ export class Ethena extends ClientSDK {
73
53
  * withdrawing the originally requested amount, the cooldown period restarts.
74
54
  *
75
55
  * Yield is not earned on USDe while in its cooldown period.
76
- * <Info>
77
- * **Required Allowances**
78
- *
79
- * In order to make this transaction, token allowances need to be set for the following contracts.
80
56
  *
81
- * - `EthenaVault`
82
- * </Info>
57
+ * An allowance does not have to be set to initiate the cooldown period.
83
58
  */
84
59
  async ethenaRequest(request, options) {
85
60
  return unwrapAsync(ethenaEthenaRequest(this, request, options));
86
61
  }
62
+ /**
63
+ * Unstake USDe
64
+ *
65
+ * @remarks
66
+ * Unstake deposited USDe from Ethena's vault.
67
+ *
68
+ * Verify that the USDe being unstaked has completed its mandatory cooldown period
69
+ * using the Ethena 'Get Vault & User Position' endpoint.
70
+ *
71
+ * This is an all or nothing action. All of the USDe that has completed its cooldown
72
+ * period must be withdrawn.
73
+ *
74
+ * The passive yield earned on USDe deposits is represented by the increased value of
75
+ * the shares received (sUSDe) upon depositing USDe. Trade in these shares in exchange
76
+ * for the intial USDe deposited and any accrued yield since depositing.
77
+ *
78
+ * An allowance does not have to be set to unstake USDe that has completed its cooldown
79
+ * period.
80
+ */
81
+ async ethenaUnstake(request, options) {
82
+ return unwrapAsync(ethenaEthenaUnstake(this, request, options));
83
+ }
87
84
  }
88
85
  //# sourceMappingURL=ethena.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ethena.js","sourceRoot":"","sources":["../../../src/sdk/ethena.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,MAAO,SAAQ,SAAS;IACnC;;;;;;;;;OASG;IACH,KAAK,CAAC,WAAW,CACf,OAAwC,EACxC,OAAwB;QAExB,OAAO,WAAW,CAAC,iBAAiB,CAClC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,aAAa,CACjB,OAAwC,EACxC,OAAwB;QAExB,OAAO,WAAW,CAAC,mBAAmB,CACpC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,KAAK,CAAC,cAAc,CAClB,OAAyC,EACzC,OAAwB;QAExB,OAAO,WAAW,CAAC,oBAAoB,CACrC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,KAAK,CAAC,aAAa,CACjB,OAAkD,EAClD,OAAwB;QAExB,OAAO,WAAW,CAAC,mBAAmB,CACpC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
1
+ {"version":3,"file":"ethena.js","sourceRoot":"","sources":["../../../src/sdk/ethena.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,MAAO,SAAQ,SAAS;IACnC;;;;;;;;;OASG;IACH,KAAK,CAAC,WAAW,CACf,OAAwC,EACxC,OAAwB;QAExB,OAAO,WAAW,CAAC,iBAAiB,CAClC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,aAAa,CACjB,OAAwC,EACxC,OAAwB;QAExB,OAAO,WAAW,CAAC,mBAAmB,CACpC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,KAAK,CAAC,aAAa,CACjB,OAAkD,EAClD,OAAwB;QAExB,OAAO,WAAW,CAAC,mBAAmB,CACpC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,aAAa,CACjB,OAAwC,EACxC,OAAwB;QAExB,OAAO,WAAW,CAAC,mBAAmB,CACpC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -7,8 +7,8 @@
7
7
 
8
8
  * [ethenaVault](#ethenavault) - Get Vault & User Position
9
9
  * [ethenaDeposit](#ethenadeposit) - Deposit USDe
10
- * [ethenaWithdraw](#ethenawithdraw) - Withdraw USDe
11
10
  * [ethenaRequest](#ethenarequest) - Request to Withdraw USDe
11
+ * [ethenaUnstake](#ethenaunstake) - Unstake USDe
12
12
 
13
13
  ## ethenaVault
14
14
 
@@ -172,25 +172,24 @@ run();
172
172
  | errors.HTTPValidationError | 422 | application/json |
173
173
  | errors.APIError | 4XX, 5XX | \*/\* |
174
174
 
175
- ## ethenaWithdraw
175
+ ## ethenaRequest
176
176
 
177
- Withdraw deposited USDe from Ethena's vault and cease earning passive yield.
177
+ Request to withdraw deposited USDe from Ethena's vault.
178
178
 
179
- The passive yield earned on USDe deposits is represented by the increased value of
180
- the shares received (sUSDe) upon depositing USDe. Trade in these shares in exchange
181
- for the intial USDe deposited and any accrued yield since depositing.
182
- <Info>
183
- **Required Allowances**
179
+ The Ethena vault requires a cooldown period. Once a request to withdraw a specified
180
+ amount of USDe has been submitted, the alloted cooldown period must pass before the
181
+ withdraw USDe transaction can be submitted.
184
182
 
185
- In order to make this transaction, token allowances need to be set for the following contracts.
183
+ If an additional amount of USDe is requested to be withdrawn anytime before
184
+ withdrawing the originally requested amount, the cooldown period restarts.
186
185
 
187
- - `EthenaVault`
188
- </Info>
189
-
186
+ Yield is not earned on USDe while in its cooldown period.
187
+
188
+ An allowance does not have to be set to initiate the cooldown period.
190
189
 
191
190
  ### Example Usage
192
191
 
193
- <!-- UsageSnippet language="typescript" operationID="v1_ethena_withdraw" method="post" path="/v1/ethena/withdraw" -->
192
+ <!-- UsageSnippet language="typescript" operationID="v1_ethena_request" method="post" path="/v1/ethena/request" -->
194
193
  ```typescript
195
194
  import { CompassApiSDK } from "@compass-labs/api-sdk";
196
195
 
@@ -199,7 +198,7 @@ const compassApiSDK = new CompassApiSDK({
199
198
  });
200
199
 
201
200
  async function run() {
202
- const result = await compassApiSDK.ethena.ethenaWithdraw({
201
+ const result = await compassApiSDK.ethena.ethenaRequest({
203
202
  amount: 1.5,
204
203
  chain: "ethereum",
205
204
  sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
@@ -217,7 +216,7 @@ The standalone function version of this method:
217
216
 
218
217
  ```typescript
219
218
  import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
220
- import { ethenaEthenaWithdraw } from "@compass-labs/api-sdk/funcs/ethenaEthenaWithdraw.js";
219
+ import { ethenaEthenaRequest } from "@compass-labs/api-sdk/funcs/ethenaEthenaRequest.js";
221
220
 
222
221
  // Use `CompassApiSDKCore` for best tree-shaking performance.
223
222
  // You can create one instance of it to use across an application.
@@ -226,7 +225,7 @@ const compassApiSDK = new CompassApiSDKCore({
226
225
  });
227
226
 
228
227
  async function run() {
229
- const res = await ethenaEthenaWithdraw(compassApiSDK, {
228
+ const res = await ethenaEthenaRequest(compassApiSDK, {
230
229
  amount: 1.5,
231
230
  chain: "ethereum",
232
231
  sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
@@ -235,7 +234,7 @@ async function run() {
235
234
  const { value: result } = res;
236
235
  console.log(result);
237
236
  } else {
238
- console.log("ethenaEthenaWithdraw failed:", res.error);
237
+ console.log("ethenaEthenaRequest failed:", res.error);
239
238
  }
240
239
  }
241
240
 
@@ -246,14 +245,14 @@ run();
246
245
 
247
246
  | Parameter | Type | Required | Description |
248
247
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
249
- | `request` | [components.EthenaWithdrawRequest](../../models/components/ethenawithdrawrequest.md) | :heavy_check_mark: | The request object to use for the request. |
248
+ | `request` | [components.EthenaRequestToWithdrawRequest](../../models/components/ethenarequesttowithdrawrequest.md) | :heavy_check_mark: | The request object to use for the request. |
250
249
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
251
250
  | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
252
251
  | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
253
252
 
254
253
  ### Response
255
254
 
256
- **Promise\<[components.TransactionResponse](../../models/components/transactionresponse.md)\>**
255
+ **Promise\<[components.EthenaRequestToWithdrawTransactionResponse](../../models/components/ethenarequesttowithdrawtransactionresponse.md)\>**
257
256
 
258
257
  ### Errors
259
258
 
@@ -262,30 +261,26 @@ run();
262
261
  | errors.HTTPValidationError | 422 | application/json |
263
262
  | errors.APIError | 4XX, 5XX | \*/\* |
264
263
 
265
- ## ethenaRequest
266
-
267
- Request to withdraw deposited USDe from Ethena's vault.
264
+ ## ethenaUnstake
268
265
 
269
- The Ethena vault requires a cooldown period. Once a request to withdraw a specified
270
- amount of USDe has been submitted, the alloted cooldown period must pass before the
271
- withdraw USDe transaction can be submitted.
266
+ Unstake deposited USDe from Ethena's vault.
272
267
 
273
- If an additional amount of USDe is requested to be withdrawn anytime before
274
- withdrawing the originally requested amount, the cooldown period restarts.
268
+ Verify that the USDe being unstaked has completed its mandatory cooldown period
269
+ using the Ethena 'Get Vault & User Position' endpoint.
275
270
 
276
- Yield is not earned on USDe while in its cooldown period.
277
- <Info>
278
- **Required Allowances**
271
+ This is an all or nothing action. All of the USDe that has completed its cooldown
272
+ period must be withdrawn.
279
273
 
280
- In order to make this transaction, token allowances need to be set for the following contracts.
274
+ The passive yield earned on USDe deposits is represented by the increased value of
275
+ the shares received (sUSDe) upon depositing USDe. Trade in these shares in exchange
276
+ for the intial USDe deposited and any accrued yield since depositing.
281
277
 
282
- - `EthenaVault`
283
- </Info>
284
-
278
+ An allowance does not have to be set to unstake USDe that has completed its cooldown
279
+ period.
285
280
 
286
281
  ### Example Usage
287
282
 
288
- <!-- UsageSnippet language="typescript" operationID="v1_ethena_request" method="post" path="/v1/ethena/request" -->
283
+ <!-- UsageSnippet language="typescript" operationID="v1_ethena_unstake" method="post" path="/v1/ethena/unstake" -->
289
284
  ```typescript
290
285
  import { CompassApiSDK } from "@compass-labs/api-sdk";
291
286
 
@@ -294,8 +289,7 @@ const compassApiSDK = new CompassApiSDK({
294
289
  });
295
290
 
296
291
  async function run() {
297
- const result = await compassApiSDK.ethena.ethenaRequest({
298
- amount: 1.5,
292
+ const result = await compassApiSDK.ethena.ethenaUnstake({
299
293
  chain: "ethereum",
300
294
  sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
301
295
  });
@@ -312,7 +306,7 @@ The standalone function version of this method:
312
306
 
313
307
  ```typescript
314
308
  import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
315
- import { ethenaEthenaRequest } from "@compass-labs/api-sdk/funcs/ethenaEthenaRequest.js";
309
+ import { ethenaEthenaUnstake } from "@compass-labs/api-sdk/funcs/ethenaEthenaUnstake.js";
316
310
 
317
311
  // Use `CompassApiSDKCore` for best tree-shaking performance.
318
312
  // You can create one instance of it to use across an application.
@@ -321,8 +315,7 @@ const compassApiSDK = new CompassApiSDKCore({
321
315
  });
322
316
 
323
317
  async function run() {
324
- const res = await ethenaEthenaRequest(compassApiSDK, {
325
- amount: 1.5,
318
+ const res = await ethenaEthenaUnstake(compassApiSDK, {
326
319
  chain: "ethereum",
327
320
  sender: "0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B",
328
321
  });
@@ -330,7 +323,7 @@ async function run() {
330
323
  const { value: result } = res;
331
324
  console.log(result);
332
325
  } else {
333
- console.log("ethenaEthenaRequest failed:", res.error);
326
+ console.log("ethenaEthenaUnstake failed:", res.error);
334
327
  }
335
328
  }
336
329
 
@@ -341,14 +334,14 @@ run();
341
334
 
342
335
  | Parameter | Type | Required | Description |
343
336
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
344
- | `request` | [components.EthenaRequestToWithdrawRequest](../../models/components/ethenarequesttowithdrawrequest.md) | :heavy_check_mark: | The request object to use for the request. |
337
+ | `request` | [components.EthenaUnstakeRequest](../../models/components/ethenaunstakerequest.md) | :heavy_check_mark: | The request object to use for the request. |
345
338
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
346
339
  | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
347
340
  | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
348
341
 
349
342
  ### Response
350
343
 
351
- **Promise\<[components.EthenaRequestToWithdrawTransactionResponse](../../models/components/ethenarequesttowithdrawtransactionresponse.md)\>**
344
+ **Promise\<[components.TransactionResponse](../../models/components/transactionresponse.md)\>**
352
345
 
353
346
  ### Errors
354
347
 
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@compass-labs/api-sdk",
5
- "version": "1.0.16",
5
+ "version": "1.0.18",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compass-labs/api-sdk",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "author": "royalnine",
5
5
  "type": "module",
6
6
  "bin": {
@@ -39,13 +39,8 @@ import { Result } from "../types/fp.js";
39
39
  * withdrawing the originally requested amount, the cooldown period restarts.
40
40
  *
41
41
  * Yield is not earned on USDe while in its cooldown period.
42
- * <Info>
43
- * **Required Allowances**
44
42
  *
45
- * In order to make this transaction, token allowances need to be set for the following contracts.
46
- *
47
- * - `EthenaVault`
48
- * </Info>
43
+ * An allowance does not have to be set to initiate the cooldown period.
49
44
  */
50
45
  export function ethenaEthenaRequest(
51
46
  client: CompassApiSDKCore,
@@ -26,25 +26,27 @@ import { APICall, APIPromise } from "../types/async.js";
26
26
  import { Result } from "../types/fp.js";
27
27
 
28
28
  /**
29
- * Withdraw USDe
29
+ * Unstake USDe
30
30
  *
31
31
  * @remarks
32
- * Withdraw deposited USDe from Ethena's vault and cease earning passive yield.
32
+ * Unstake deposited USDe from Ethena's vault.
33
+ *
34
+ * Verify that the USDe being unstaked has completed its mandatory cooldown period
35
+ * using the Ethena 'Get Vault & User Position' endpoint.
36
+ *
37
+ * This is an all or nothing action. All of the USDe that has completed its cooldown
38
+ * period must be withdrawn.
33
39
  *
34
40
  * The passive yield earned on USDe deposits is represented by the increased value of
35
41
  * the shares received (sUSDe) upon depositing USDe. Trade in these shares in exchange
36
42
  * for the intial USDe deposited and any accrued yield since depositing.
37
- * <Info>
38
- * **Required Allowances**
39
- *
40
- * In order to make this transaction, token allowances need to be set for the following contracts.
41
43
  *
42
- * - `EthenaVault`
43
- * </Info>
44
+ * An allowance does not have to be set to unstake USDe that has completed its cooldown
45
+ * period.
44
46
  */
45
- export function ethenaEthenaWithdraw(
47
+ export function ethenaEthenaUnstake(
46
48
  client: CompassApiSDKCore,
47
- request: components.EthenaWithdrawRequest,
49
+ request: components.EthenaUnstakeRequest,
48
50
  options?: RequestOptions,
49
51
  ): APIPromise<
50
52
  Result<
@@ -69,7 +71,7 @@ export function ethenaEthenaWithdraw(
69
71
 
70
72
  async function $do(
71
73
  client: CompassApiSDKCore,
72
- request: components.EthenaWithdrawRequest,
74
+ request: components.EthenaUnstakeRequest,
73
75
  options?: RequestOptions,
74
76
  ): Promise<
75
77
  [
@@ -90,7 +92,7 @@ async function $do(
90
92
  > {
91
93
  const parsed = safeParse(
92
94
  request,
93
- (value) => components.EthenaWithdrawRequest$outboundSchema.parse(value),
95
+ (value) => components.EthenaUnstakeRequest$outboundSchema.parse(value),
94
96
  "Input validation failed",
95
97
  );
96
98
  if (!parsed.ok) {
@@ -99,7 +101,7 @@ async function $do(
99
101
  const payload = parsed.value;
100
102
  const body = encodeJSON("body", payload, { explode: true });
101
103
 
102
- const path = pathToFunc("/v1/ethena/withdraw")();
104
+ const path = pathToFunc("/v1/ethena/unstake")();
103
105
 
104
106
  const headers = new Headers(compactMap({
105
107
  "Content-Type": "application/json",
@@ -113,7 +115,7 @@ async function $do(
113
115
  const context = {
114
116
  options: client._options,
115
117
  baseURL: options?.serverURL ?? client._baseURL ?? "",
116
- operationID: "v1_ethena_withdraw",
118
+ operationID: "v1_ethena_unstake",
117
119
  oAuth2Scopes: [],
118
120
 
119
121
  resolvedSecurity: requestSecurity,
package/src/lib/config.ts CHANGED
@@ -61,8 +61,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
61
61
  export const SDK_METADATA = {
62
62
  language: "typescript",
63
63
  openapiDocVersion: "0.0.1",
64
- sdkVersion: "1.0.16",
64
+ sdkVersion: "1.0.18",
65
65
  genVersion: "2.684.0",
66
66
  userAgent:
67
- "speakeasy-sdk/typescript 1.0.16 2.684.0 0.0.1 @compass-labs/api-sdk",
67
+ "speakeasy-sdk/typescript 1.0.18 2.684.0 0.0.1 @compass-labs/api-sdk",
68
68
  } as const;
@@ -19,7 +19,7 @@ const routes = buildRouteMap({
19
19
  export const app = buildApplication(routes, {
20
20
  name: "mcp",
21
21
  versionInfo: {
22
- currentVersion: "1.0.16",
22
+ currentVersion: "1.0.18",
23
23
  },
24
24
  });
25
25
 
@@ -39,8 +39,8 @@ import { tool$erc4626VaultsVaultsVault } from "./tools/erc4626VaultsVaultsVault.
39
39
  import { tool$erc4626VaultsVaultsWithdraw } from "./tools/erc4626VaultsVaultsWithdraw.js";
40
40
  import { tool$ethenaEthenaDeposit } from "./tools/ethenaEthenaDeposit.js";
41
41
  import { tool$ethenaEthenaRequest } from "./tools/ethenaEthenaRequest.js";
42
+ import { tool$ethenaEthenaUnstake } from "./tools/ethenaEthenaUnstake.js";
42
43
  import { tool$ethenaEthenaVault } from "./tools/ethenaEthenaVault.js";
43
- import { tool$ethenaEthenaWithdraw } from "./tools/ethenaEthenaWithdraw.js";
44
44
  import { tool$morphoMorphoBorrow } from "./tools/morphoMorphoBorrow.js";
45
45
  import { tool$morphoMorphoDeposit } from "./tools/morphoMorphoDeposit.js";
46
46
  import { tool$morphoMorphoMarket } from "./tools/morphoMorphoMarket.js";
@@ -103,7 +103,7 @@ export function createMCPServer(deps: {
103
103
  }) {
104
104
  const server = new McpServer({
105
105
  name: "CompassApiSDK",
106
- version: "1.0.16",
106
+ version: "1.0.18",
107
107
  });
108
108
 
109
109
  const client = new CompassApiSDKCore({
@@ -210,8 +210,8 @@ export function createMCPServer(deps: {
210
210
  tool(tool$erc4626VaultsVaultsWithdraw);
211
211
  tool(tool$ethenaEthenaVault);
212
212
  tool(tool$ethenaEthenaDeposit);
213
- tool(tool$ethenaEthenaWithdraw);
214
213
  tool(tool$ethenaEthenaRequest);
214
+ tool(tool$ethenaEthenaUnstake);
215
215
 
216
216
  return server;
217
217
  }
@@ -24,14 +24,8 @@ If an additional amount of USDe is requested to be withdrawn anytime before
24
24
  withdrawing the originally requested amount, the cooldown period restarts.
25
25
 
26
26
  Yield is not earned on USDe while in its cooldown period.
27
- <Info>
28
- **Required Allowances**
29
27
 
30
- In order to make this transaction, token allowances need to be set for the following contracts.
31
-
32
- - \`EthenaVault\`
33
- </Info>
34
- `,
28
+ An allowance does not have to be set to initiate the cooldown period.`,
35
29
  args,
36
30
  tool: async (client, args, ctx) => {
37
31
  const [result, apiCall] = await ethenaEthenaRequest(
@@ -2,34 +2,35 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
- import { ethenaEthenaWithdraw } from "../../funcs/ethenaEthenaWithdraw.js";
5
+ import { ethenaEthenaUnstake } from "../../funcs/ethenaEthenaUnstake.js";
6
6
  import * as components from "../../models/components/index.js";
7
7
  import { formatResult, ToolDefinition } from "../tools.js";
8
8
 
9
9
  const args = {
10
- request: components.EthenaWithdrawRequest$inboundSchema,
10
+ request: components.EthenaUnstakeRequest$inboundSchema,
11
11
  };
12
12
 
13
- export const tool$ethenaEthenaWithdraw: ToolDefinition<typeof args> = {
14
- name: "ethena-ethena-withdraw",
15
- description: `Withdraw USDe
13
+ export const tool$ethenaEthenaUnstake: ToolDefinition<typeof args> = {
14
+ name: "ethena-ethena-unstake",
15
+ description: `Unstake USDe
16
16
 
17
- Withdraw deposited USDe from Ethena's vault and cease earning passive yield.
17
+ Unstake deposited USDe from Ethena's vault.
18
+
19
+ Verify that the USDe being unstaked has completed its mandatory cooldown period
20
+ using the Ethena 'Get Vault & User Position' endpoint.
21
+
22
+ This is an all or nothing action. All of the USDe that has completed its cooldown
23
+ period must be withdrawn.
18
24
 
19
25
  The passive yield earned on USDe deposits is represented by the increased value of
20
26
  the shares received (sUSDe) upon depositing USDe. Trade in these shares in exchange
21
27
  for the intial USDe deposited and any accrued yield since depositing.
22
- <Info>
23
- **Required Allowances**
24
-
25
- In order to make this transaction, token allowances need to be set for the following contracts.
26
28
 
27
- - \`EthenaVault\`
28
- </Info>
29
- `,
29
+ An allowance does not have to be set to unstake USDe that has completed its cooldown
30
+ period.`,
30
31
  args,
31
32
  tool: async (client, args, ctx) => {
32
- const [result, apiCall] = await ethenaEthenaWithdraw(
33
+ const [result, apiCall] = await ethenaEthenaUnstake(
33
34
  client,
34
35
  args.request,
35
36
  { fetchOptions: { signal: ctx.signal } },
@@ -0,0 +1,82 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type EthenaUnstakeParams = {
12
+ actionType?: "ETHENA_UNSTAKE" | undefined;
13
+ /**
14
+ * The address which will receive the unstaked USDe. Defaults to the sender.
15
+ */
16
+ receiver?: string | null | undefined;
17
+ };
18
+
19
+ /** @internal */
20
+ export const EthenaUnstakeParams$inboundSchema: z.ZodType<
21
+ EthenaUnstakeParams,
22
+ z.ZodTypeDef,
23
+ unknown
24
+ > = z.object({
25
+ action_type: z.literal("ETHENA_UNSTAKE").default("ETHENA_UNSTAKE"),
26
+ receiver: z.nullable(z.string()).optional(),
27
+ }).transform((v) => {
28
+ return remap$(v, {
29
+ "action_type": "actionType",
30
+ });
31
+ });
32
+
33
+ /** @internal */
34
+ export type EthenaUnstakeParams$Outbound = {
35
+ action_type: "ETHENA_UNSTAKE";
36
+ receiver?: string | null | undefined;
37
+ };
38
+
39
+ /** @internal */
40
+ export const EthenaUnstakeParams$outboundSchema: z.ZodType<
41
+ EthenaUnstakeParams$Outbound,
42
+ z.ZodTypeDef,
43
+ EthenaUnstakeParams
44
+ > = z.object({
45
+ actionType: z.literal("ETHENA_UNSTAKE").default("ETHENA_UNSTAKE" as const),
46
+ receiver: z.nullable(z.string()).optional(),
47
+ }).transform((v) => {
48
+ return remap$(v, {
49
+ actionType: "action_type",
50
+ });
51
+ });
52
+
53
+ /**
54
+ * @internal
55
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
56
+ */
57
+ export namespace EthenaUnstakeParams$ {
58
+ /** @deprecated use `EthenaUnstakeParams$inboundSchema` instead. */
59
+ export const inboundSchema = EthenaUnstakeParams$inboundSchema;
60
+ /** @deprecated use `EthenaUnstakeParams$outboundSchema` instead. */
61
+ export const outboundSchema = EthenaUnstakeParams$outboundSchema;
62
+ /** @deprecated use `EthenaUnstakeParams$Outbound` instead. */
63
+ export type Outbound = EthenaUnstakeParams$Outbound;
64
+ }
65
+
66
+ export function ethenaUnstakeParamsToJSON(
67
+ ethenaUnstakeParams: EthenaUnstakeParams,
68
+ ): string {
69
+ return JSON.stringify(
70
+ EthenaUnstakeParams$outboundSchema.parse(ethenaUnstakeParams),
71
+ );
72
+ }
73
+
74
+ export function ethenaUnstakeParamsFromJSON(
75
+ jsonString: string,
76
+ ): SafeParseResult<EthenaUnstakeParams, SDKValidationError> {
77
+ return safeParse(
78
+ jsonString,
79
+ (x) => EthenaUnstakeParams$inboundSchema.parse(JSON.parse(x)),
80
+ `Failed to parse 'EthenaUnstakeParams' from JSON`,
81
+ );
82
+ }