@compass-labs/api-sdk 2.1.34 → 2.1.35-rc.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 (213) hide show
  1. package/README.md +3 -1
  2. package/codeSamples_typescript.yaml +6 -0
  3. package/dist/commonjs/funcs/earnEarnAaveMarkets.d.ts +4 -7
  4. package/dist/commonjs/funcs/earnEarnAaveMarkets.d.ts.map +1 -1
  5. package/dist/commonjs/funcs/earnEarnAaveMarkets.js +4 -7
  6. package/dist/commonjs/funcs/earnEarnAaveMarkets.js.map +1 -1
  7. package/dist/commonjs/funcs/earnEarnBundle.d.ts +9 -10
  8. package/dist/commonjs/funcs/earnEarnBundle.d.ts.map +1 -1
  9. package/dist/commonjs/funcs/earnEarnBundle.js +9 -10
  10. package/dist/commonjs/funcs/earnEarnBundle.js.map +1 -1
  11. package/dist/commonjs/funcs/earnEarnCreateAccount.d.ts +5 -7
  12. package/dist/commonjs/funcs/earnEarnCreateAccount.d.ts.map +1 -1
  13. package/dist/commonjs/funcs/earnEarnCreateAccount.js +5 -7
  14. package/dist/commonjs/funcs/earnEarnCreateAccount.js.map +1 -1
  15. package/dist/commonjs/funcs/earnEarnManage.d.ts +10 -14
  16. package/dist/commonjs/funcs/earnEarnManage.d.ts.map +1 -1
  17. package/dist/commonjs/funcs/earnEarnManage.js +10 -14
  18. package/dist/commonjs/funcs/earnEarnManage.js.map +1 -1
  19. package/dist/commonjs/funcs/earnEarnPendleMarkets.d.ts +28 -0
  20. package/dist/commonjs/funcs/earnEarnPendleMarkets.d.ts.map +1 -0
  21. package/dist/commonjs/funcs/earnEarnPendleMarkets.js +136 -0
  22. package/dist/commonjs/funcs/earnEarnPendleMarkets.js.map +1 -0
  23. package/dist/commonjs/funcs/earnEarnPositions.d.ts +8 -1
  24. package/dist/commonjs/funcs/earnEarnPositions.d.ts.map +1 -1
  25. package/dist/commonjs/funcs/earnEarnPositions.js +8 -1
  26. package/dist/commonjs/funcs/earnEarnPositions.js.map +1 -1
  27. package/dist/commonjs/funcs/earnEarnSwap.d.ts +6 -0
  28. package/dist/commonjs/funcs/earnEarnSwap.d.ts.map +1 -1
  29. package/dist/commonjs/funcs/earnEarnSwap.js +6 -0
  30. package/dist/commonjs/funcs/earnEarnSwap.js.map +1 -1
  31. package/dist/commonjs/funcs/earnEarnTransfer.d.ts +14 -5
  32. package/dist/commonjs/funcs/earnEarnTransfer.d.ts.map +1 -1
  33. package/dist/commonjs/funcs/earnEarnTransfer.js +14 -5
  34. package/dist/commonjs/funcs/earnEarnTransfer.js.map +1 -1
  35. package/dist/commonjs/funcs/earnEarnVaults.d.ts +6 -2
  36. package/dist/commonjs/funcs/earnEarnVaults.d.ts.map +1 -1
  37. package/dist/commonjs/funcs/earnEarnVaults.js +6 -2
  38. package/dist/commonjs/funcs/earnEarnVaults.js.map +1 -1
  39. package/dist/commonjs/funcs/gasSponsorshipGasSponsorshipApproveTransfer.d.ts +8 -8
  40. package/dist/commonjs/funcs/gasSponsorshipGasSponsorshipApproveTransfer.js +8 -8
  41. package/dist/commonjs/funcs/gasSponsorshipGasSponsorshipPrepare.d.ts +9 -3
  42. package/dist/commonjs/funcs/gasSponsorshipGasSponsorshipPrepare.d.ts.map +1 -1
  43. package/dist/commonjs/funcs/gasSponsorshipGasSponsorshipPrepare.js +9 -3
  44. package/dist/commonjs/funcs/gasSponsorshipGasSponsorshipPrepare.js.map +1 -1
  45. package/dist/commonjs/lib/config.d.ts +2 -2
  46. package/dist/commonjs/lib/config.js +2 -2
  47. package/dist/commonjs/lib/sdks.js +2 -2
  48. package/dist/commonjs/lib/sdks.js.map +1 -1
  49. package/dist/commonjs/models/components/approvetransferrequest.d.ts +1 -1
  50. package/dist/commonjs/models/components/batchedsafeoperationsresponseinput.d.ts +2 -2
  51. package/dist/commonjs/models/components/batchedsafeoperationsresponseoutput.d.ts +2 -2
  52. package/dist/commonjs/models/components/compassapibackendv2modelssafetransactresponsebatchedsafeoperationseip712domain.d.ts +3 -3
  53. package/dist/commonjs/models/components/index.d.ts +2 -0
  54. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  55. package/dist/commonjs/models/components/index.js +2 -0
  56. package/dist/commonjs/models/components/index.js.map +1 -1
  57. package/dist/commonjs/models/components/pendlemarketinfo.d.ts +64 -0
  58. package/dist/commonjs/models/components/pendlemarketinfo.d.ts.map +1 -0
  59. package/dist/commonjs/models/components/pendlemarketinfo.js +77 -0
  60. package/dist/commonjs/models/components/pendlemarketinfo.js.map +1 -0
  61. package/dist/commonjs/models/components/pendlemarketsresponse.d.ts +20 -0
  62. package/dist/commonjs/models/components/pendlemarketsresponse.d.ts.map +1 -0
  63. package/dist/commonjs/models/components/pendlemarketsresponse.js +54 -0
  64. package/dist/commonjs/models/components/pendlemarketsresponse.js.map +1 -0
  65. package/dist/commonjs/models/components/safetxmessage.d.ts +3 -3
  66. package/dist/commonjs/models/components/sponsorgasrequest.d.ts +1 -1
  67. package/dist/commonjs/models/operations/index.d.ts +1 -0
  68. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  69. package/dist/commonjs/models/operations/index.js +1 -0
  70. package/dist/commonjs/models/operations/index.js.map +1 -1
  71. package/dist/commonjs/models/operations/v2earnpendlemarkets.d.ts +55 -0
  72. package/dist/commonjs/models/operations/v2earnpendlemarkets.d.ts.map +1 -0
  73. package/dist/commonjs/models/operations/v2earnpendlemarkets.js +70 -0
  74. package/dist/commonjs/models/operations/v2earnpendlemarkets.js.map +1 -0
  75. package/dist/commonjs/models/operations/v2earnvaults.d.ts +4 -4
  76. package/dist/commonjs/models/operations/v2earnvaults.d.ts.map +1 -1
  77. package/dist/commonjs/models/operations/v2earnvaults.js +4 -5
  78. package/dist/commonjs/models/operations/v2earnvaults.js.map +1 -1
  79. package/dist/commonjs/sdk/earn.d.ts +78 -46
  80. package/dist/commonjs/sdk/earn.d.ts.map +1 -1
  81. package/dist/commonjs/sdk/earn.js +81 -46
  82. package/dist/commonjs/sdk/earn.js.map +1 -1
  83. package/dist/commonjs/sdk/gassponsorship.d.ts +17 -11
  84. package/dist/commonjs/sdk/gassponsorship.d.ts.map +1 -1
  85. package/dist/commonjs/sdk/gassponsorship.js +17 -11
  86. package/dist/commonjs/sdk/gassponsorship.js.map +1 -1
  87. package/dist/esm/funcs/earnEarnAaveMarkets.d.ts +4 -7
  88. package/dist/esm/funcs/earnEarnAaveMarkets.d.ts.map +1 -1
  89. package/dist/esm/funcs/earnEarnAaveMarkets.js +4 -7
  90. package/dist/esm/funcs/earnEarnAaveMarkets.js.map +1 -1
  91. package/dist/esm/funcs/earnEarnBundle.d.ts +9 -10
  92. package/dist/esm/funcs/earnEarnBundle.d.ts.map +1 -1
  93. package/dist/esm/funcs/earnEarnBundle.js +9 -10
  94. package/dist/esm/funcs/earnEarnBundle.js.map +1 -1
  95. package/dist/esm/funcs/earnEarnCreateAccount.d.ts +5 -7
  96. package/dist/esm/funcs/earnEarnCreateAccount.d.ts.map +1 -1
  97. package/dist/esm/funcs/earnEarnCreateAccount.js +5 -7
  98. package/dist/esm/funcs/earnEarnCreateAccount.js.map +1 -1
  99. package/dist/esm/funcs/earnEarnManage.d.ts +10 -14
  100. package/dist/esm/funcs/earnEarnManage.d.ts.map +1 -1
  101. package/dist/esm/funcs/earnEarnManage.js +10 -14
  102. package/dist/esm/funcs/earnEarnManage.js.map +1 -1
  103. package/dist/esm/funcs/earnEarnPendleMarkets.d.ts +28 -0
  104. package/dist/esm/funcs/earnEarnPendleMarkets.d.ts.map +1 -0
  105. package/dist/esm/funcs/earnEarnPendleMarkets.js +100 -0
  106. package/dist/esm/funcs/earnEarnPendleMarkets.js.map +1 -0
  107. package/dist/esm/funcs/earnEarnPositions.d.ts +8 -1
  108. package/dist/esm/funcs/earnEarnPositions.d.ts.map +1 -1
  109. package/dist/esm/funcs/earnEarnPositions.js +8 -1
  110. package/dist/esm/funcs/earnEarnPositions.js.map +1 -1
  111. package/dist/esm/funcs/earnEarnSwap.d.ts +6 -0
  112. package/dist/esm/funcs/earnEarnSwap.d.ts.map +1 -1
  113. package/dist/esm/funcs/earnEarnSwap.js +6 -0
  114. package/dist/esm/funcs/earnEarnSwap.js.map +1 -1
  115. package/dist/esm/funcs/earnEarnTransfer.d.ts +14 -5
  116. package/dist/esm/funcs/earnEarnTransfer.d.ts.map +1 -1
  117. package/dist/esm/funcs/earnEarnTransfer.js +14 -5
  118. package/dist/esm/funcs/earnEarnTransfer.js.map +1 -1
  119. package/dist/esm/funcs/earnEarnVaults.d.ts +6 -2
  120. package/dist/esm/funcs/earnEarnVaults.d.ts.map +1 -1
  121. package/dist/esm/funcs/earnEarnVaults.js +6 -2
  122. package/dist/esm/funcs/earnEarnVaults.js.map +1 -1
  123. package/dist/esm/funcs/gasSponsorshipGasSponsorshipApproveTransfer.d.ts +8 -8
  124. package/dist/esm/funcs/gasSponsorshipGasSponsorshipApproveTransfer.js +8 -8
  125. package/dist/esm/funcs/gasSponsorshipGasSponsorshipPrepare.d.ts +9 -3
  126. package/dist/esm/funcs/gasSponsorshipGasSponsorshipPrepare.d.ts.map +1 -1
  127. package/dist/esm/funcs/gasSponsorshipGasSponsorshipPrepare.js +9 -3
  128. package/dist/esm/funcs/gasSponsorshipGasSponsorshipPrepare.js.map +1 -1
  129. package/dist/esm/lib/config.d.ts +2 -2
  130. package/dist/esm/lib/config.js +2 -2
  131. package/dist/esm/lib/sdks.js +2 -2
  132. package/dist/esm/lib/sdks.js.map +1 -1
  133. package/dist/esm/models/components/approvetransferrequest.d.ts +1 -1
  134. package/dist/esm/models/components/batchedsafeoperationsresponseinput.d.ts +2 -2
  135. package/dist/esm/models/components/batchedsafeoperationsresponseoutput.d.ts +2 -2
  136. package/dist/esm/models/components/compassapibackendv2modelssafetransactresponsebatchedsafeoperationseip712domain.d.ts +3 -3
  137. package/dist/esm/models/components/index.d.ts +2 -0
  138. package/dist/esm/models/components/index.d.ts.map +1 -1
  139. package/dist/esm/models/components/index.js +2 -0
  140. package/dist/esm/models/components/index.js.map +1 -1
  141. package/dist/esm/models/components/pendlemarketinfo.d.ts +64 -0
  142. package/dist/esm/models/components/pendlemarketinfo.d.ts.map +1 -0
  143. package/dist/esm/models/components/pendlemarketinfo.js +40 -0
  144. package/dist/esm/models/components/pendlemarketinfo.js.map +1 -0
  145. package/dist/esm/models/components/pendlemarketsresponse.d.ts +20 -0
  146. package/dist/esm/models/components/pendlemarketsresponse.d.ts.map +1 -0
  147. package/dist/esm/models/components/pendlemarketsresponse.js +17 -0
  148. package/dist/esm/models/components/pendlemarketsresponse.js.map +1 -0
  149. package/dist/esm/models/components/safetxmessage.d.ts +3 -3
  150. package/dist/esm/models/components/sponsorgasrequest.d.ts +1 -1
  151. package/dist/esm/models/operations/index.d.ts +1 -0
  152. package/dist/esm/models/operations/index.d.ts.map +1 -1
  153. package/dist/esm/models/operations/index.js +1 -0
  154. package/dist/esm/models/operations/index.js.map +1 -1
  155. package/dist/esm/models/operations/v2earnpendlemarkets.d.ts +55 -0
  156. package/dist/esm/models/operations/v2earnpendlemarkets.d.ts.map +1 -0
  157. package/dist/esm/models/operations/v2earnpendlemarkets.js +33 -0
  158. package/dist/esm/models/operations/v2earnpendlemarkets.js.map +1 -0
  159. package/dist/esm/models/operations/v2earnvaults.d.ts +4 -4
  160. package/dist/esm/models/operations/v2earnvaults.d.ts.map +1 -1
  161. package/dist/esm/models/operations/v2earnvaults.js +3 -4
  162. package/dist/esm/models/operations/v2earnvaults.js.map +1 -1
  163. package/dist/esm/sdk/earn.d.ts +78 -46
  164. package/dist/esm/sdk/earn.d.ts.map +1 -1
  165. package/dist/esm/sdk/earn.js +81 -46
  166. package/dist/esm/sdk/earn.js.map +1 -1
  167. package/dist/esm/sdk/gassponsorship.d.ts +17 -11
  168. package/dist/esm/sdk/gassponsorship.d.ts.map +1 -1
  169. package/dist/esm/sdk/gassponsorship.js +17 -11
  170. package/dist/esm/sdk/gassponsorship.js.map +1 -1
  171. package/docs/models/components/approvetransferrequest.md +1 -1
  172. package/docs/models/components/batchedsafeoperationsresponseinput.md +2 -2
  173. package/docs/models/components/batchedsafeoperationsresponseoutput.md +2 -2
  174. package/docs/models/components/compassapibackendv2modelssafetransactresponsebatchedsafeoperationseip712domain.md +5 -5
  175. package/docs/models/components/pendlemarketinfo.md +33 -0
  176. package/docs/models/components/pendlemarketsresponse.md +25 -0
  177. package/docs/models/components/safetxmessage.md +3 -3
  178. package/docs/models/components/sponsorgasrequest.md +1 -1
  179. package/docs/models/operations/v2earnpendlemarketsdirection.md +17 -0
  180. package/docs/models/operations/v2earnpendlemarketsrequest.md +25 -0
  181. package/docs/models/operations/v2earnvaultsdirection.md +17 -0
  182. package/docs/models/operations/v2earnvaultsrequest.md +8 -8
  183. package/docs/sdks/earn/README.md +152 -46
  184. package/docs/sdks/gassponsorship/README.md +17 -11
  185. package/package.json +1 -1
  186. package/src/funcs/earnEarnAaveMarkets.ts +4 -7
  187. package/src/funcs/earnEarnBundle.ts +9 -10
  188. package/src/funcs/earnEarnCreateAccount.ts +5 -7
  189. package/src/funcs/earnEarnManage.ts +10 -14
  190. package/src/funcs/earnEarnPendleMarkets.ts +189 -0
  191. package/src/funcs/earnEarnPositions.ts +8 -1
  192. package/src/funcs/earnEarnSwap.ts +6 -0
  193. package/src/funcs/earnEarnTransfer.ts +14 -5
  194. package/src/funcs/earnEarnVaults.ts +6 -2
  195. package/src/funcs/gasSponsorshipGasSponsorshipApproveTransfer.ts +8 -8
  196. package/src/funcs/gasSponsorshipGasSponsorshipPrepare.ts +9 -3
  197. package/src/lib/config.ts +2 -2
  198. package/src/lib/sdks.ts +2 -2
  199. package/src/models/components/approvetransferrequest.ts +1 -1
  200. package/src/models/components/batchedsafeoperationsresponseinput.ts +2 -2
  201. package/src/models/components/batchedsafeoperationsresponseoutput.ts +2 -2
  202. package/src/models/components/compassapibackendv2modelssafetransactresponsebatchedsafeoperationseip712domain.ts +3 -3
  203. package/src/models/components/index.ts +2 -0
  204. package/src/models/components/pendlemarketinfo.ts +112 -0
  205. package/src/models/components/pendlemarketsresponse.ts +47 -0
  206. package/src/models/components/safetxmessage.ts +3 -3
  207. package/src/models/components/sponsorgasrequest.ts +1 -1
  208. package/src/models/operations/index.ts +1 -0
  209. package/src/models/operations/v2earnpendlemarkets.ts +91 -0
  210. package/src/models/operations/v2earnvaults.ts +7 -6
  211. package/src/sdk/earn.ts +89 -46
  212. package/src/sdk/gassponsorship.ts +17 -11
  213. package/docs/models/operations/direction.md +0 -17
@@ -0,0 +1,189 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { CompassApiSDKCore } from "../core.js";
6
+ import { encodeFormQuery } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import * as components from "../models/components/index.js";
14
+ import { CompassAPISDKError } from "../models/errors/compassapisdkerror.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * List pendle markets
31
+ *
32
+ * @remarks
33
+ * List Pendle yield trading markets with TVL and implied APY.
34
+ *
35
+ * Returns Pendle market data including Principal Token (PT), Standardized Yield (SY),
36
+ * and Yield Token (YT) addresses, along with market expiry, TVL, and implied APY.
37
+ *
38
+ * Use this endpoint to discover yield trading opportunities, compare rates across
39
+ * Pendle markets, or build market selection interfaces.
40
+ *
41
+ * APY values are returned in percentage format (e.g., 5.25 means 5.25%). Markets
42
+ * without complete metadata or statistics are excluded.
43
+ */
44
+ export function earnEarnPendleMarkets(
45
+ client: CompassApiSDKCore,
46
+ request: operations.V2EarnPendleMarketsRequest,
47
+ options?: RequestOptions,
48
+ ): APIPromise<
49
+ Result<
50
+ components.PendleMarketsResponse,
51
+ | errors.HTTPValidationError
52
+ | CompassAPISDKError
53
+ | ResponseValidationError
54
+ | ConnectionError
55
+ | RequestAbortedError
56
+ | RequestTimeoutError
57
+ | InvalidRequestError
58
+ | UnexpectedClientError
59
+ | SDKValidationError
60
+ >
61
+ > {
62
+ return new APIPromise($do(
63
+ client,
64
+ request,
65
+ options,
66
+ ));
67
+ }
68
+
69
+ async function $do(
70
+ client: CompassApiSDKCore,
71
+ request: operations.V2EarnPendleMarketsRequest,
72
+ options?: RequestOptions,
73
+ ): Promise<
74
+ [
75
+ Result<
76
+ components.PendleMarketsResponse,
77
+ | errors.HTTPValidationError
78
+ | CompassAPISDKError
79
+ | ResponseValidationError
80
+ | ConnectionError
81
+ | RequestAbortedError
82
+ | RequestTimeoutError
83
+ | InvalidRequestError
84
+ | UnexpectedClientError
85
+ | SDKValidationError
86
+ >,
87
+ APICall,
88
+ ]
89
+ > {
90
+ const parsed = safeParse(
91
+ request,
92
+ (value) =>
93
+ operations.V2EarnPendleMarketsRequest$outboundSchema.parse(value),
94
+ "Input validation failed",
95
+ );
96
+ if (!parsed.ok) {
97
+ return [parsed, { status: "invalid" }];
98
+ }
99
+ const payload = parsed.value;
100
+ const body = null;
101
+
102
+ const path = pathToFunc("/v2/earn/pendle_markets")();
103
+
104
+ const query = encodeFormQuery({
105
+ "chain": payload.chain,
106
+ "direction": payload.direction,
107
+ "limit": payload.limit,
108
+ "offset": payload.offset,
109
+ "order_by": payload.order_by,
110
+ "underlying_symbol": payload.underlying_symbol,
111
+ });
112
+
113
+ const headers = new Headers(compactMap({
114
+ Accept: "application/json",
115
+ }));
116
+
117
+ const secConfig = await extractSecurity(client._options.apiKeyAuth);
118
+ const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
119
+ const requestSecurity = resolveGlobalSecurity(securityInput);
120
+
121
+ const context = {
122
+ options: client._options,
123
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
124
+ operationID: "v2_earn_pendle_markets",
125
+ oAuth2Scopes: null,
126
+
127
+ resolvedSecurity: requestSecurity,
128
+
129
+ securitySource: client._options.apiKeyAuth,
130
+ retryConfig: options?.retries
131
+ || client._options.retryConfig
132
+ || { strategy: "none" },
133
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
134
+ };
135
+
136
+ const requestRes = client._createRequest(context, {
137
+ security: requestSecurity,
138
+ method: "GET",
139
+ baseURL: options?.serverURL,
140
+ path: path,
141
+ headers: headers,
142
+ query: query,
143
+ body: body,
144
+ userAgent: client._options.userAgent,
145
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
146
+ }, options);
147
+ if (!requestRes.ok) {
148
+ return [requestRes, { status: "invalid" }];
149
+ }
150
+ const req = requestRes.value;
151
+
152
+ const doResult = await client._do(req, {
153
+ context,
154
+ errorCodes: ["422", "4XX", "5XX"],
155
+ retryConfig: context.retryConfig,
156
+ retryCodes: context.retryCodes,
157
+ });
158
+ if (!doResult.ok) {
159
+ return [doResult, { status: "request-error", request: req }];
160
+ }
161
+ const response = doResult.value;
162
+
163
+ const responseFields = {
164
+ HttpMeta: { Response: response, Request: req },
165
+ };
166
+
167
+ const [result] = await M.match<
168
+ components.PendleMarketsResponse,
169
+ | errors.HTTPValidationError
170
+ | CompassAPISDKError
171
+ | ResponseValidationError
172
+ | ConnectionError
173
+ | RequestAbortedError
174
+ | RequestTimeoutError
175
+ | InvalidRequestError
176
+ | UnexpectedClientError
177
+ | SDKValidationError
178
+ >(
179
+ M.json(200, components.PendleMarketsResponse$inboundSchema),
180
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
181
+ M.fail("4XX"),
182
+ M.fail("5XX"),
183
+ )(response, req, { extraFields: responseFields });
184
+ if (!result.ok) {
185
+ return [result, { status: "complete", request: req, response }];
186
+ }
187
+
188
+ return [result, { status: "complete", request: req, response }];
189
+ }
@@ -30,7 +30,14 @@ import { Result } from "../types/fp.js";
30
30
  * List earn positions
31
31
  *
32
32
  * @remarks
33
- * This endpoint fetches all Compass Earn positions with PnL information.
33
+ * List all Earn positions for a given owner with PnL tracking.
34
+ *
35
+ * Returns position data including current balance, cost basis, and profit and loss.
36
+ * Use this endpoint to display portfolio performance, track yields over time, or build
37
+ * position management interfaces.
38
+ *
39
+ * Positions are tracked across all venue types (vaults and Aave markets). Each
40
+ * position includes the venue address, deposited amount, and performance metrics.
34
41
  */
35
42
  export function earnEarnPositions(
36
43
  client: CompassApiSDKCore,
@@ -30,6 +30,12 @@ import { Result } from "../types/fp.js";
30
30
  *
31
31
  * @remarks
32
32
  * Swap tokens within an Earn Account.
33
+ *
34
+ * Use this endpoint to exchange one token for another without transferring funds out of the Earn Account.
35
+ *
36
+ * 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.
37
+ *
38
+ * 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`.
33
39
  */
34
40
  export function earnEarnSwap(
35
41
  client: CompassApiSDKCore,
@@ -29,14 +29,23 @@ import { Result } from "../types/fp.js";
29
29
  * Transfer tokens to/from account
30
30
  *
31
31
  * @remarks
32
- * Transfer tokens to and from an Earn Account.
32
+ * Transfer tokens between an owner's wallet and their Earn Account.
33
33
  *
34
- * If `DEPOSIT`'` is selected, tokens will be transferred from the `owner`'s wallet into their Earn Account.
34
+ * Use `DEPOSIT` to move tokens from the owner's wallet into their Earn Account. Use `WITHDRAW` to move tokens from the Earn Account back to the owner's wallet.
35
35
  *
36
- * If `WITHDRAW` is selected, tokens will be transferred from the `owner`'s Earn Account into their wallet.
36
+ * **Gas-sponsored deposits** require two steps:
37
37
  *
38
- * If a gas-sponsored `DEPOSIT` transfer is desired for a given token, a one-time Permit2 allowance must be set before proceeding. This is common practice for many other applications and, for many `owner`s, this one-time allowance will already have been set for the token they would like to transfer.
39
- * Once the one-time allowance is set for a given token and `gas_sponsorship` is set to 'true', EIP-712 typed data will be returned and can be signed off-chain by the user. This signature can then be submitted to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`) where a `sender` can be set for the transaction.
38
+ * **Step 1 (once per token):** Set up Permit2 allowance
39
+ * 1. Call [/gas_sponsorship/approve_transfer](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/approve-token-transfer) to get EIP-712 typed data
40
+ * 2. Owner signs the typed data
41
+ * 3. Submit signature + typed data to [/gas_sponsorship/prepare](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/prepare-gas-sponsored-transaction)
42
+ *
43
+ * **Step 2 (each transfer):** Execute the gas-sponsored transfer
44
+ * 1. Call this endpoint with `gas_sponsorship=true` to get EIP-712 typed data
45
+ * 2. Owner signs the typed data
46
+ * 3. Submit signature + typed data to [/gas_sponsorship/prepare](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/prepare-gas-sponsored-transaction)
47
+ *
48
+ * **Note:** This endpoint moves tokens to/from the Earn Account itself—not into yield venues. To deposit into a vault or Aave market, use the [manage endpoint](https://docs.compasslabs.ai/v2/api-reference/earn/manage-earn-position).
40
49
  */
41
50
  export function earnEarnTransfer(
42
51
  client: CompassApiSDKCore,
@@ -30,9 +30,13 @@ import { Result } from "../types/fp.js";
30
30
  * List vaults
31
31
  *
32
32
  * @remarks
33
- * List information about 4626 vaults.
33
+ * List ERC-4626 yield vaults across DeFi venues.
34
34
  *
35
- * These are earn opportunities for protocols like morpho.
35
+ * Returns vault data including APY, TVL, and underlying asset information. Use this endpoint to discover yield opportunities, compare rates across venues, or build vault selection interfaces.
36
+ *
37
+ * Supports dozens of vaults and markets like Morpho and other ERC-4626 compatible yield venues.
38
+ *
39
+ * To deposit into a vault, use the [manage endpoint](https://docs.compasslabs.ai/v2/api-reference/earn/manage-earn-position) with `venue_type=VAULTS`.
36
40
  */
37
41
  export function earnEarnVaults(
38
42
  client: CompassApiSDKCore,
@@ -29,16 +29,16 @@ import { Result } from "../types/fp.js";
29
29
  * Approve token transfer
30
30
  *
31
31
  * @remarks
32
- * Prepare a one-time permit2 approval transaction for a given token.
32
+ * Set up a one-time Permit2 allowance for gas-sponsored token transfers.
33
33
  *
34
- * This is only required if the `owner` would like to transfer tokens from their wallet to their Earn Account with gas-sponsorship.
34
+ * Only required when using [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account) with `gas_sponsorship=true`. This allowance only needs to be set up once per token.
35
35
  *
36
- * This approval transaction itself can be submitted with gas-sponsorship.
37
- * In this case, EIP-712 typed data will be returned and should be signed by the `owner` off-chain.
38
- * This signature can then be submitted to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`).
39
- * Gas-sponsored approvals can only be achieved by ERC-20 tokens that support permit (EIP-2612).
40
- * Some tokens, like USDT and WETH, do not allow for this behavior.
41
- * In the case of non-permit tokens, the one-time approval transaction can be submitted in the conventional manner where the `owner` must sign, submit and pay gas for the transaction.
36
+ * **With gas sponsorship (`gas_sponsorship=true`):**
37
+ * - Returns EIP-712 typed data for the owner to sign off-chain
38
+ * - Submit signature + typed data to [/prepare](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/prepare-gas-sponsored-transaction)
39
+ * - Only works for tokens that support EIP-2612 permit (e.g., USDC)
40
+ *
41
+ * Some tokens, like USDT and WETH, do not support EIP-2612 permit. For these tokens, set `gas_sponsorship=false` to receive an unsigned transaction that the owner must sign, submit, and pay gas for.
42
42
  */
43
43
  export function gasSponsorshipGasSponsorshipApproveTransfer(
44
44
  client: CompassApiSDKCore,
@@ -29,11 +29,17 @@ import { Result } from "../types/fp.js";
29
29
  * Prepare gas-sponsored transaction
30
30
  *
31
31
  * @remarks
32
- * Prepare a gas-sponsored transaction to be signed and submitted by `sender`.
32
+ * Prepare a gas-sponsored transaction from signed EIP-712 typed data.
33
33
  *
34
- * The `owner` submits their off-chain signature of EIP-712 typed data along with the data itself.
34
+ * Submit the `owner`'s off-chain signature along with the EIP-712 typed data that was signed. Returns an unsigned transaction for the `sender` to sign and broadcast.
35
35
  *
36
- * The `sender` will sign and submit the transaction returned from this endpoint, effectively sponsoring the gas for the transaction on behalf of the `owner`.
36
+ * **How gas sponsorship works:**
37
+ * 1. Call an endpoint with `gas_sponsorship=true` (e.g., [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account), [/earn/manage](https://docs.compasslabs.ai/v2/api-reference/earn/manage-earn-position)) to get EIP-712 typed data
38
+ * 2. Owner signs the typed data off-chain
39
+ * 3. Submit signature + typed data to this endpoint
40
+ * 4. Sender signs and broadcasts the returned transaction, paying gas on behalf of the owner
41
+ *
42
+ * **Note:** For gas-sponsored deposits via [/earn/transfer](https://docs.compasslabs.ai/v2/api-reference/earn/transfer-tokens-tofrom-account), the owner must first set up a Permit2 allowance using [/approve_transfer](https://docs.compasslabs.ai/v2/api-reference/gas-sponsorship/approve-token-transfer) (once per token).
37
43
  */
38
44
  export function gasSponsorshipGasSponsorshipPrepare(
39
45
  client: CompassApiSDKCore,
package/src/lib/config.ts CHANGED
@@ -62,7 +62,7 @@ export const SDK_METADATA = {
62
62
  language: "typescript",
63
63
  openapiDocVersion: "0.0.1",
64
64
  sdkVersion: "2.0.0",
65
- genVersion: "2.791.1",
65
+ genVersion: "2.792.2",
66
66
  userAgent:
67
- "speakeasy-sdk/typescript 2.0.0 2.791.1 0.0.1 @compass-labs/api-sdk",
67
+ "speakeasy-sdk/typescript 2.0.0 2.792.2 0.0.1 @compass-labs/api-sdk",
68
68
  } as const;
package/src/lib/sdks.ts CHANGED
@@ -304,9 +304,9 @@ export class ClientSDK {
304
304
  }
305
305
  }
306
306
 
307
- const jsonLikeContentTypeRE = /(application|text)\/.*?\+*json.*/;
307
+ const jsonLikeContentTypeRE = /(application|text)\/([^+]+\+)*json.*/;
308
308
  const jsonlLikeContentTypeRE =
309
- /(application|text)\/(.*?\+*\bjsonl\b.*|.*?\+*\bx-ndjson\b.*)/;
309
+ /(application|text)\/(([^+]+\+)*jsonl\b.*|([^+]+\+)*x-ndjson\b.*)/;
310
310
  async function logRequest(logger: Logger | undefined, req: Request) {
311
311
  if (!logger) {
312
312
  return;
@@ -8,7 +8,7 @@ import { Chain, Chain$outboundSchema } from "./chain.js";
8
8
 
9
9
  export type ApproveTransferRequest = {
10
10
  /**
11
- * The owner of the smart account's address.
11
+ * The wallet address that owns the Earn Account.
12
12
  */
13
13
  owner: string;
14
14
  /**
@@ -24,7 +24,7 @@ import {
24
24
  */
25
25
  export type BatchedSafeOperationsResponseInput = {
26
26
  /**
27
- * The EIP-712 domain separator for Safe transactions.
27
+ * The EIP-712 domain separator.
28
28
  */
29
29
  domain:
30
30
  CompassApiBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain;
@@ -38,7 +38,7 @@ export type BatchedSafeOperationsResponseInput = {
38
38
  */
39
39
  primaryType: "SafeTx";
40
40
  /**
41
- * The message data for a Safe transaction.
41
+ * The message data for the transaction.
42
42
  */
43
43
  message: SafeTxMessage;
44
44
  };
@@ -21,7 +21,7 @@ import { SafeTxMessage, SafeTxMessage$inboundSchema } from "./safetxmessage.js";
21
21
  */
22
22
  export type BatchedSafeOperationsResponseOutput = {
23
23
  /**
24
- * The EIP-712 domain separator for Safe transactions.
24
+ * The EIP-712 domain separator.
25
25
  */
26
26
  domain:
27
27
  CompassApiBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain;
@@ -35,7 +35,7 @@ export type BatchedSafeOperationsResponseOutput = {
35
35
  */
36
36
  primaryType: "SafeTx";
37
37
  /**
38
- * The message data for a Safe transaction.
38
+ * The message data for the transaction.
39
39
  */
40
40
  message: SafeTxMessage;
41
41
  };
@@ -8,16 +8,16 @@ import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
9
 
10
10
  /**
11
- * The EIP-712 domain separator for Safe transactions.
11
+ * The EIP-712 domain separator.
12
12
  */
13
13
  export type CompassApiBackendV2ModelsSafeTransactResponseBatchedSafeOperationsEip712Domain =
14
14
  {
15
15
  /**
16
- * Chain ID for the Safe transaction
16
+ * Chain ID
17
17
  */
18
18
  chainId: number;
19
19
  /**
20
- * Address of the Safe contract
20
+ * Address of the Product Account
21
21
  */
22
22
  verifyingContract: string;
23
23
  };
@@ -153,6 +153,8 @@ export * from "./pendlelistuserpositionsresponse.js";
153
153
  export * from "./pendlemanageliquidityparams.js";
154
154
  export * from "./pendlemanageliquidityrequest.js";
155
155
  export * from "./pendlemarket.js";
156
+ export * from "./pendlemarketinfo.js";
157
+ export * from "./pendlemarketsresponse.js";
156
158
  export * from "./pendleredeemyieldparams.js";
157
159
  export * from "./pendleredeemyieldrequest.js";
158
160
  export * from "./pendletradeptparams.js";
@@ -0,0 +1,112 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
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
+ /**
12
+ * Information about a single Pendle market from the database.
13
+ */
14
+ export type PendleMarketInfo = {
15
+ /**
16
+ * The Pendle market contract address.
17
+ */
18
+ marketAddress: string;
19
+ /**
20
+ * Blockchain name (e.g., 'ethereum', 'arbitrum').
21
+ */
22
+ chain: string;
23
+ /**
24
+ * The Principal Token (PT) address.
25
+ */
26
+ ptAddress: string;
27
+ /**
28
+ * The Standardized Yield (SY) token address.
29
+ */
30
+ syAddress?: string | null | undefined;
31
+ /**
32
+ * The Yield Token (YT) address.
33
+ */
34
+ ytAddress?: string | null | undefined;
35
+ /**
36
+ * The market maturity timestamp (Unix epoch seconds).
37
+ */
38
+ expiry?: number | null | undefined;
39
+ /**
40
+ * The underlying asset contract address.
41
+ */
42
+ underlyingAsset?: string | null | undefined;
43
+ /**
44
+ * The name of the underlying asset.
45
+ */
46
+ underlyingName?: string | null | undefined;
47
+ /**
48
+ * The symbol of the underlying asset (e.g., 'USDC').
49
+ */
50
+ underlyingSymbol?: string | null | undefined;
51
+ /**
52
+ * The name of the Principal Token.
53
+ */
54
+ ptName?: string | null | undefined;
55
+ /**
56
+ * The symbol of the Principal Token.
57
+ */
58
+ ptSymbol?: string | null | undefined;
59
+ /**
60
+ * Total Value Locked in USD.
61
+ */
62
+ tvlUsd?: string | null | undefined;
63
+ /**
64
+ * Implied APY as a percentage (e.g., 5.25 = 5.25%).
65
+ */
66
+ impliedApy?: string | null | undefined;
67
+ };
68
+
69
+ /** @internal */
70
+ export const PendleMarketInfo$inboundSchema: z.ZodType<
71
+ PendleMarketInfo,
72
+ z.ZodTypeDef,
73
+ unknown
74
+ > = z.object({
75
+ market_address: z.string(),
76
+ chain: z.string(),
77
+ pt_address: z.string(),
78
+ sy_address: z.nullable(z.string()).optional(),
79
+ yt_address: z.nullable(z.string()).optional(),
80
+ expiry: z.nullable(z.number().int()).optional(),
81
+ underlying_asset: z.nullable(z.string()).optional(),
82
+ underlying_name: z.nullable(z.string()).optional(),
83
+ underlying_symbol: z.nullable(z.string()).optional(),
84
+ pt_name: z.nullable(z.string()).optional(),
85
+ pt_symbol: z.nullable(z.string()).optional(),
86
+ tvl_usd: z.nullable(z.string()).optional(),
87
+ implied_apy: z.nullable(z.string()).optional(),
88
+ }).transform((v) => {
89
+ return remap$(v, {
90
+ "market_address": "marketAddress",
91
+ "pt_address": "ptAddress",
92
+ "sy_address": "syAddress",
93
+ "yt_address": "ytAddress",
94
+ "underlying_asset": "underlyingAsset",
95
+ "underlying_name": "underlyingName",
96
+ "underlying_symbol": "underlyingSymbol",
97
+ "pt_name": "ptName",
98
+ "pt_symbol": "ptSymbol",
99
+ "tvl_usd": "tvlUsd",
100
+ "implied_apy": "impliedApy",
101
+ });
102
+ });
103
+
104
+ export function pendleMarketInfoFromJSON(
105
+ jsonString: string,
106
+ ): SafeParseResult<PendleMarketInfo, SDKValidationError> {
107
+ return safeParse(
108
+ jsonString,
109
+ (x) => PendleMarketInfo$inboundSchema.parse(JSON.parse(x)),
110
+ `Failed to parse 'PendleMarketInfo' from JSON`,
111
+ );
112
+ }
@@ -0,0 +1,47 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ PendleMarketInfo,
11
+ PendleMarketInfo$inboundSchema,
12
+ } from "./pendlemarketinfo.js";
13
+
14
+ /**
15
+ * Response model for a paginated list of Pendle markets.
16
+ */
17
+ export type PendleMarketsResponse = {
18
+ total: number;
19
+ offset: number;
20
+ limit: number;
21
+ /**
22
+ * A list of Pendle market information objects.
23
+ */
24
+ markets: Array<PendleMarketInfo>;
25
+ };
26
+
27
+ /** @internal */
28
+ export const PendleMarketsResponse$inboundSchema: z.ZodType<
29
+ PendleMarketsResponse,
30
+ z.ZodTypeDef,
31
+ unknown
32
+ > = z.object({
33
+ total: z.number().int(),
34
+ offset: z.number().int(),
35
+ limit: z.number().int(),
36
+ markets: z.array(PendleMarketInfo$inboundSchema),
37
+ });
38
+
39
+ export function pendleMarketsResponseFromJSON(
40
+ jsonString: string,
41
+ ): SafeParseResult<PendleMarketsResponse, SDKValidationError> {
42
+ return safeParse(
43
+ jsonString,
44
+ (x) => PendleMarketsResponse$inboundSchema.parse(JSON.parse(x)),
45
+ `Failed to parse 'PendleMarketsResponse' from JSON`,
46
+ );
47
+ }
@@ -13,7 +13,7 @@ import {
13
13
  } from "./operationtype.js";
14
14
 
15
15
  /**
16
- * The message data for a Safe transaction.
16
+ * The message data for the transaction.
17
17
  */
18
18
  export type SafeTxMessage = {
19
19
  /**
@@ -33,7 +33,7 @@ export type SafeTxMessage = {
33
33
  */
34
34
  operation: OperationType;
35
35
  /**
36
- * Gas for the Safe transaction
36
+ * Gas for the transaction
37
37
  */
38
38
  safeTxGas: string;
39
39
  /**
@@ -53,7 +53,7 @@ export type SafeTxMessage = {
53
53
  */
54
54
  refundReceiver: string;
55
55
  /**
56
- * Safe transaction nonce
56
+ * Transaction nonce
57
57
  */
58
58
  nonce: string;
59
59
  };
@@ -31,7 +31,7 @@ export type SponsorGasRequestEip712 =
31
31
 
32
32
  export type SponsorGasRequest = {
33
33
  /**
34
- * The owner of the smart account's address.
34
+ * The wallet address that owns the Earn Account.
35
35
  */
36
36
  owner: string;
37
37
  /**
@@ -42,5 +42,6 @@ export * from "./v1vaultsvault.js";
42
42
  export * from "./v1wildcatmarket.js";
43
43
  export * from "./v2cctpmint.js";
44
44
  export * from "./v2earnaavemarkets.js";
45
+ export * from "./v2earnpendlemarkets.js";
45
46
  export * from "./v2earnpositions.js";
46
47
  export * from "./v2earnvaults.js";