@compass-labs/api-sdk 2.2.105 → 2.2.107

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 (164) hide show
  1. package/README.md +6 -4
  2. package/codeSamples_typescript.yaml +7 -1
  3. package/dist/commonjs/funcs/creditCreditSwap.d.ts +23 -0
  4. package/dist/commonjs/funcs/creditCreditSwap.d.ts.map +1 -0
  5. package/dist/commonjs/funcs/creditCreditSwap.js +124 -0
  6. package/dist/commonjs/funcs/creditCreditSwap.js.map +1 -0
  7. package/dist/commonjs/funcs/earnEarnSwap.d.ts +7 -7
  8. package/dist/commonjs/funcs/earnEarnSwap.js +7 -7
  9. package/dist/commonjs/lib/config.d.ts +2 -2
  10. package/dist/commonjs/lib/config.js +2 -2
  11. package/dist/commonjs/lib/config.js.map +1 -1
  12. package/dist/commonjs/models/components/chain.d.ts +1 -0
  13. package/dist/commonjs/models/components/chain.d.ts.map +1 -1
  14. package/dist/commonjs/models/components/chain.js +1 -0
  15. package/dist/commonjs/models/components/chain.js.map +1 -1
  16. package/dist/commonjs/models/components/creditswaprequest.d.ts +112 -0
  17. package/dist/commonjs/models/components/creditswaprequest.d.ts.map +1 -0
  18. package/dist/commonjs/models/components/creditswaprequest.js +101 -0
  19. package/dist/commonjs/models/components/creditswaprequest.js.map +1 -0
  20. package/dist/commonjs/models/components/creditswapresponse.d.ts +51 -0
  21. package/dist/commonjs/models/components/creditswapresponse.d.ts.map +1 -0
  22. package/dist/commonjs/models/components/creditswapresponse.js +74 -0
  23. package/dist/commonjs/models/components/creditswapresponse.js.map +1 -0
  24. package/dist/commonjs/models/components/earnswaprequest.d.ts +2 -3
  25. package/dist/commonjs/models/components/earnswaprequest.d.ts.map +1 -1
  26. package/dist/commonjs/models/components/earnswaprequest.js.map +1 -1
  27. package/dist/commonjs/models/components/eulermarket.d.ts +12 -0
  28. package/dist/commonjs/models/components/eulermarket.d.ts.map +1 -1
  29. package/dist/commonjs/models/components/eulermarket.js +6 -0
  30. package/dist/commonjs/models/components/eulermarket.js.map +1 -1
  31. package/dist/commonjs/models/components/eulermarketcollateral.d.ts +4 -0
  32. package/dist/commonjs/models/components/eulermarketcollateral.d.ts.map +1 -1
  33. package/dist/commonjs/models/components/eulermarketcollateral.js +2 -0
  34. package/dist/commonjs/models/components/eulermarketcollateral.js.map +1 -1
  35. package/dist/commonjs/models/components/index.d.ts +2 -0
  36. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  37. package/dist/commonjs/models/components/index.js +2 -0
  38. package/dist/commonjs/models/components/index.js.map +1 -1
  39. package/dist/commonjs/models/operations/v2earnswapquote.d.ts +1 -0
  40. package/dist/commonjs/models/operations/v2earnswapquote.d.ts.map +1 -1
  41. package/dist/commonjs/models/operations/v2earnswapquote.js +1 -0
  42. package/dist/commonjs/models/operations/v2earnswapquote.js.map +1 -1
  43. package/dist/commonjs/models/operations/v2tokenizedassetsbalances.d.ts +1 -0
  44. package/dist/commonjs/models/operations/v2tokenizedassetsbalances.d.ts.map +1 -1
  45. package/dist/commonjs/models/operations/v2tokenizedassetsbalances.js +1 -0
  46. package/dist/commonjs/models/operations/v2tokenizedassetsbalances.js.map +1 -1
  47. package/dist/commonjs/models/operations/v2tokenizedassetsmarketssymbol.d.ts +1 -0
  48. package/dist/commonjs/models/operations/v2tokenizedassetsmarketssymbol.d.ts.map +1 -1
  49. package/dist/commonjs/models/operations/v2tokenizedassetsmarketssymbol.js +1 -0
  50. package/dist/commonjs/models/operations/v2tokenizedassetsmarketssymbol.js.map +1 -1
  51. package/dist/commonjs/models/operations/v2tokenizedassetspositions.d.ts +1 -0
  52. package/dist/commonjs/models/operations/v2tokenizedassetspositions.d.ts.map +1 -1
  53. package/dist/commonjs/models/operations/v2tokenizedassetspositions.js +1 -0
  54. package/dist/commonjs/models/operations/v2tokenizedassetspositions.js.map +1 -1
  55. package/dist/commonjs/models/operations/v2tokenizedassetsredemptions.d.ts +1 -0
  56. package/dist/commonjs/models/operations/v2tokenizedassetsredemptions.d.ts.map +1 -1
  57. package/dist/commonjs/models/operations/v2tokenizedassetsredemptions.js +1 -0
  58. package/dist/commonjs/models/operations/v2tokenizedassetsredemptions.js.map +1 -1
  59. package/dist/commonjs/sdk/credit.d.ts +12 -0
  60. package/dist/commonjs/sdk/credit.d.ts.map +1 -1
  61. package/dist/commonjs/sdk/credit.js +15 -0
  62. package/dist/commonjs/sdk/credit.js.map +1 -1
  63. package/dist/commonjs/sdk/earn.d.ts +7 -7
  64. package/dist/commonjs/sdk/earn.js +7 -7
  65. package/dist/esm/funcs/creditCreditSwap.d.ts +23 -0
  66. package/dist/esm/funcs/creditCreditSwap.d.ts.map +1 -0
  67. package/dist/esm/funcs/creditCreditSwap.js +88 -0
  68. package/dist/esm/funcs/creditCreditSwap.js.map +1 -0
  69. package/dist/esm/funcs/earnEarnSwap.d.ts +7 -7
  70. package/dist/esm/funcs/earnEarnSwap.js +7 -7
  71. package/dist/esm/lib/config.d.ts +2 -2
  72. package/dist/esm/lib/config.js +2 -2
  73. package/dist/esm/lib/config.js.map +1 -1
  74. package/dist/esm/models/components/chain.d.ts +1 -0
  75. package/dist/esm/models/components/chain.d.ts.map +1 -1
  76. package/dist/esm/models/components/chain.js +1 -0
  77. package/dist/esm/models/components/chain.js.map +1 -1
  78. package/dist/esm/models/components/creditswaprequest.d.ts +112 -0
  79. package/dist/esm/models/components/creditswaprequest.d.ts.map +1 -0
  80. package/dist/esm/models/components/creditswaprequest.js +62 -0
  81. package/dist/esm/models/components/creditswaprequest.js.map +1 -0
  82. package/dist/esm/models/components/creditswapresponse.d.ts +51 -0
  83. package/dist/esm/models/components/creditswapresponse.d.ts.map +1 -0
  84. package/dist/esm/models/components/creditswapresponse.js +37 -0
  85. package/dist/esm/models/components/creditswapresponse.js.map +1 -0
  86. package/dist/esm/models/components/earnswaprequest.d.ts +2 -3
  87. package/dist/esm/models/components/earnswaprequest.d.ts.map +1 -1
  88. package/dist/esm/models/components/earnswaprequest.js.map +1 -1
  89. package/dist/esm/models/components/eulermarket.d.ts +12 -0
  90. package/dist/esm/models/components/eulermarket.d.ts.map +1 -1
  91. package/dist/esm/models/components/eulermarket.js +6 -0
  92. package/dist/esm/models/components/eulermarket.js.map +1 -1
  93. package/dist/esm/models/components/eulermarketcollateral.d.ts +4 -0
  94. package/dist/esm/models/components/eulermarketcollateral.d.ts.map +1 -1
  95. package/dist/esm/models/components/eulermarketcollateral.js +2 -0
  96. package/dist/esm/models/components/eulermarketcollateral.js.map +1 -1
  97. package/dist/esm/models/components/index.d.ts +2 -0
  98. package/dist/esm/models/components/index.d.ts.map +1 -1
  99. package/dist/esm/models/components/index.js +2 -0
  100. package/dist/esm/models/components/index.js.map +1 -1
  101. package/dist/esm/models/operations/v2earnswapquote.d.ts +1 -0
  102. package/dist/esm/models/operations/v2earnswapquote.d.ts.map +1 -1
  103. package/dist/esm/models/operations/v2earnswapquote.js +1 -0
  104. package/dist/esm/models/operations/v2earnswapquote.js.map +1 -1
  105. package/dist/esm/models/operations/v2tokenizedassetsbalances.d.ts +1 -0
  106. package/dist/esm/models/operations/v2tokenizedassetsbalances.d.ts.map +1 -1
  107. package/dist/esm/models/operations/v2tokenizedassetsbalances.js +1 -0
  108. package/dist/esm/models/operations/v2tokenizedassetsbalances.js.map +1 -1
  109. package/dist/esm/models/operations/v2tokenizedassetsmarketssymbol.d.ts +1 -0
  110. package/dist/esm/models/operations/v2tokenizedassetsmarketssymbol.d.ts.map +1 -1
  111. package/dist/esm/models/operations/v2tokenizedassetsmarketssymbol.js +1 -0
  112. package/dist/esm/models/operations/v2tokenizedassetsmarketssymbol.js.map +1 -1
  113. package/dist/esm/models/operations/v2tokenizedassetspositions.d.ts +1 -0
  114. package/dist/esm/models/operations/v2tokenizedassetspositions.d.ts.map +1 -1
  115. package/dist/esm/models/operations/v2tokenizedassetspositions.js +1 -0
  116. package/dist/esm/models/operations/v2tokenizedassetspositions.js.map +1 -1
  117. package/dist/esm/models/operations/v2tokenizedassetsredemptions.d.ts +1 -0
  118. package/dist/esm/models/operations/v2tokenizedassetsredemptions.d.ts.map +1 -1
  119. package/dist/esm/models/operations/v2tokenizedassetsredemptions.js +1 -0
  120. package/dist/esm/models/operations/v2tokenizedassetsredemptions.js.map +1 -1
  121. package/dist/esm/sdk/credit.d.ts +12 -0
  122. package/dist/esm/sdk/credit.d.ts.map +1 -1
  123. package/dist/esm/sdk/credit.js +15 -0
  124. package/dist/esm/sdk/credit.js.map +1 -1
  125. package/dist/esm/sdk/earn.d.ts +7 -7
  126. package/dist/esm/sdk/earn.js +7 -7
  127. package/docs/models/components/chain.md +1 -1
  128. package/docs/models/components/creditswaprequest.md +36 -0
  129. package/docs/models/components/creditswaprequestamountin.md +19 -0
  130. package/docs/models/components/creditswaprequestchain.md +17 -0
  131. package/docs/models/components/creditswaprequestpricing.md +17 -0
  132. package/docs/models/components/creditswaprequestslippage.md +19 -0
  133. package/docs/models/components/creditswapresponse.md +25 -0
  134. package/docs/models/components/creditswapresponseswapprovider.md +17 -0
  135. package/docs/models/components/earnswaprequest.md +2 -3
  136. package/docs/models/components/eulermarket.md +21 -18
  137. package/docs/models/components/eulermarketcollateral.md +11 -10
  138. package/docs/models/operations/v2earnswapquotechain.md +1 -1
  139. package/docs/models/operations/v2tokenizedassetsbalanceschain.md +2 -2
  140. package/docs/models/operations/v2tokenizedassetsmarketssymbolchain.md +2 -2
  141. package/docs/models/operations/v2tokenizedassetspositionschain.md +1 -1
  142. package/docs/models/operations/v2tokenizedassetsredemptionschain.md +1 -1
  143. package/docs/sdks/credit/README.md +94 -0
  144. package/docs/sdks/earn/README.md +7 -7
  145. package/docs/sdks/tokenizedassets/README.md +2 -2
  146. package/openapi_prepped_for_speakeasy.json +272 -3
  147. package/package.json +1 -1
  148. package/src/funcs/creditCreditSwap.ts +176 -0
  149. package/src/funcs/earnEarnSwap.ts +7 -7
  150. package/src/lib/config.ts +2 -2
  151. package/src/models/components/chain.ts +1 -0
  152. package/src/models/components/creditswaprequest.ts +186 -0
  153. package/src/models/components/creditswapresponse.ts +99 -0
  154. package/src/models/components/earnswaprequest.ts +2 -3
  155. package/src/models/components/eulermarket.ts +18 -0
  156. package/src/models/components/eulermarketcollateral.ts +6 -0
  157. package/src/models/components/index.ts +2 -0
  158. package/src/models/operations/v2earnswapquote.ts +1 -0
  159. package/src/models/operations/v2tokenizedassetsbalances.ts +1 -0
  160. package/src/models/operations/v2tokenizedassetsmarketssymbol.ts +1 -0
  161. package/src/models/operations/v2tokenizedassetspositions.ts +1 -0
  162. package/src/models/operations/v2tokenizedassetsredemptions.ts +1 -0
  163. package/src/sdk/credit.ts +23 -0
  164. package/src/sdk/earn.ts +7 -7
package/src/sdk/credit.ts CHANGED
@@ -13,6 +13,7 @@ import { creditCreditMorphoMarkets } from "../funcs/creditCreditMorphoMarkets.js
13
13
  import { creditCreditPositions } from "../funcs/creditCreditPositions.js";
14
14
  import { creditCreditRebalance } from "../funcs/creditCreditRebalance.js";
15
15
  import { creditCreditRepay } from "../funcs/creditCreditRepay.js";
16
+ import { creditCreditSwap } from "../funcs/creditCreditSwap.js";
16
17
  import { creditCreditTransfer } from "../funcs/creditCreditTransfer.js";
17
18
  import { creditCreditUnloop } from "../funcs/creditCreditUnloop.js";
18
19
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
@@ -287,6 +288,28 @@ export class Credit extends ClientSDK {
287
288
  ));
288
289
  }
289
290
 
291
+ /**
292
+ * Swap tokens
293
+ *
294
+ * @remarks
295
+ * Swap one token for another inside a Credit Account.
296
+ *
297
+ * Exchanges tokens the Credit Account already holds in a single atomic
298
+ * transaction, so idle or borrowed balances can be converted without moving
299
+ * funds out first. Returns an unsigned transaction to sign, the expected
300
+ * output amount, and which route priced the swap.
301
+ */
302
+ async creditSwap(
303
+ request: components.CreditSwapRequest,
304
+ options?: RequestOptions,
305
+ ): Promise<components.CreditSwapResponse> {
306
+ return unwrapAsync(creditCreditSwap(
307
+ this,
308
+ request,
309
+ options,
310
+ ));
311
+ }
312
+
290
313
  /**
291
314
  * Repay debt and withdraw collateral
292
315
  *
package/src/sdk/earn.ts CHANGED
@@ -279,16 +279,16 @@ export class Earn extends ClientSDK {
279
279
  }
280
280
 
281
281
  /**
282
- * Swap tokens within Earn Account
282
+ * Swap tokens
283
283
  *
284
284
  * @remarks
285
- * Swap tokens within an Earn Account.
285
+ * Swap one token for another inside an Earn Account.
286
286
  *
287
- * Use this endpoint to exchange one token for another without transferring funds out of the Earn Account.
288
- *
289
- * The swap executes atomically within the Earn Account and can be combined with other actions using the [bundle endpoint](https://docs.compasslabs.ai/v2/api-reference/earn/execute-multiple-earn-actions). For example, swap ETH to USDC, then deposit USDC into a vault—all in one transaction.
290
- *
291
- * Returns either an unsigned transaction (when `gas_sponsorship=false`) or EIP-712 typed data for off-chain signing (when `gas_sponsorship=true`). For gas-sponsored swaps, submit the signed typed data to `/gas_sponsorship/prepare`.
287
+ * Exchanges tokens the Earn Account already holds in a single atomic
288
+ * transaction, so funds never leave it, and can be chained with other actions
289
+ * through the [bundle endpoint](https://docs.compasslabs.ai/v2/api-reference/earn/execute-multiple-earn-actions)
290
+ * (for example, swap ETH to USDC and deposit the USDC into a vault at once).
291
+ * Returns an unsigned transaction to sign and the expected output amount.
292
292
  */
293
293
  async earnSwap(
294
294
  request: components.EarnSwapRequest,