@compass-labs/api-sdk 0.5.41 → 0.5.43

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 (175) hide show
  1. package/README.md +2 -4
  2. package/bin/mcp-server.js +603 -852
  3. package/bin/mcp-server.js.map +18 -22
  4. package/dist/commonjs/funcs/pendleMarket.d.ts +3 -1
  5. package/dist/commonjs/funcs/pendleMarket.d.ts.map +1 -1
  6. package/dist/commonjs/funcs/pendleMarket.js +4 -1
  7. package/dist/commonjs/funcs/pendleMarket.js.map +1 -1
  8. package/dist/commonjs/lib/config.d.ts +3 -3
  9. package/dist/commonjs/lib/config.js +3 -3
  10. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  11. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  12. package/dist/commonjs/mcp-server/server.js +2 -4
  13. package/dist/commonjs/mcp-server/server.js.map +1 -1
  14. package/dist/commonjs/mcp-server/tools/pendleMarket.d.ts.map +1 -1
  15. package/dist/commonjs/mcp-server/tools/pendleMarket.js +4 -2
  16. package/dist/commonjs/mcp-server/tools/pendleMarket.js.map +1 -1
  17. package/dist/commonjs/models/components/compassapibackendmodelspendlereadresponsemarketuserposition.d.ts +62 -0
  18. package/dist/commonjs/models/components/compassapibackendmodelspendlereadresponsemarketuserposition.d.ts.map +1 -0
  19. package/dist/commonjs/models/components/{pendlegetuserpositionresponse.js → compassapibackendmodelspendlereadresponsemarketuserposition.js} +23 -29
  20. package/dist/commonjs/models/components/compassapibackendmodelspendlereadresponsemarketuserposition.js.map +1 -0
  21. package/dist/commonjs/models/components/compassapibackendmodelsvaultsreadresponsevaultuserposition.d.ts +31 -0
  22. package/dist/commonjs/models/components/compassapibackendmodelsvaultsreadresponsevaultuserposition.d.ts.map +1 -0
  23. package/dist/commonjs/models/components/compassapibackendmodelsvaultsreadresponsevaultuserposition.js +82 -0
  24. package/dist/commonjs/models/components/compassapibackendmodelsvaultsreadresponsevaultuserposition.js.map +1 -0
  25. package/dist/commonjs/models/components/index.d.ts +2 -2
  26. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  27. package/dist/commonjs/models/components/index.js +2 -2
  28. package/dist/commonjs/models/components/index.js.map +1 -1
  29. package/dist/commonjs/models/components/pendlegetmarketresponse.d.ts +6 -0
  30. package/dist/commonjs/models/components/pendlegetmarketresponse.d.ts.map +1 -1
  31. package/dist/commonjs/models/components/pendlegetmarketresponse.js +5 -0
  32. package/dist/commonjs/models/components/pendlegetmarketresponse.js.map +1 -1
  33. package/dist/commonjs/models/components/uniswapbuyexactlyparams.d.ts +54 -16
  34. package/dist/commonjs/models/components/uniswapbuyexactlyparams.d.ts.map +1 -1
  35. package/dist/commonjs/models/components/uniswapbuyexactlyparams.js +51 -5
  36. package/dist/commonjs/models/components/uniswapbuyexactlyparams.js.map +1 -1
  37. package/dist/commonjs/models/components/uniswapbuyexactlyrequest.d.ts +54 -16
  38. package/dist/commonjs/models/components/uniswapbuyexactlyrequest.d.ts.map +1 -1
  39. package/dist/commonjs/models/components/uniswapbuyexactlyrequest.js +51 -5
  40. package/dist/commonjs/models/components/uniswapbuyexactlyrequest.js.map +1 -1
  41. package/dist/commonjs/models/components/vaultgetvaultresponse.d.ts +3 -3
  42. package/dist/commonjs/models/components/vaultgetvaultresponse.d.ts.map +1 -1
  43. package/dist/commonjs/models/components/vaultgetvaultresponse.js +3 -3
  44. package/dist/commonjs/models/components/vaultgetvaultresponse.js.map +1 -1
  45. package/dist/commonjs/models/operations/index.d.ts +0 -1
  46. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  47. package/dist/commonjs/models/operations/index.js +0 -1
  48. package/dist/commonjs/models/operations/index.js.map +1 -1
  49. package/dist/commonjs/models/operations/pendlemarket.d.ts +5 -0
  50. package/dist/commonjs/models/operations/pendlemarket.d.ts.map +1 -1
  51. package/dist/commonjs/models/operations/pendlemarket.js +4 -0
  52. package/dist/commonjs/models/operations/pendlemarket.js.map +1 -1
  53. package/dist/commonjs/sdk/pendle.d.ts +5 -10
  54. package/dist/commonjs/sdk/pendle.d.ts.map +1 -1
  55. package/dist/commonjs/sdk/pendle.js +6 -14
  56. package/dist/commonjs/sdk/pendle.js.map +1 -1
  57. package/dist/esm/funcs/pendleMarket.d.ts +3 -1
  58. package/dist/esm/funcs/pendleMarket.d.ts.map +1 -1
  59. package/dist/esm/funcs/pendleMarket.js +4 -1
  60. package/dist/esm/funcs/pendleMarket.js.map +1 -1
  61. package/dist/esm/lib/config.d.ts +3 -3
  62. package/dist/esm/lib/config.js +3 -3
  63. package/dist/esm/mcp-server/mcp-server.js +1 -1
  64. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  65. package/dist/esm/mcp-server/server.js +2 -4
  66. package/dist/esm/mcp-server/server.js.map +1 -1
  67. package/dist/esm/mcp-server/tools/pendleMarket.d.ts.map +1 -1
  68. package/dist/esm/mcp-server/tools/pendleMarket.js +4 -2
  69. package/dist/esm/mcp-server/tools/pendleMarket.js.map +1 -1
  70. package/dist/esm/models/components/compassapibackendmodelspendlereadresponsemarketuserposition.d.ts +62 -0
  71. package/dist/esm/models/components/compassapibackendmodelspendlereadresponsemarketuserposition.d.ts.map +1 -0
  72. package/dist/esm/models/components/compassapibackendmodelspendlereadresponsemarketuserposition.js +66 -0
  73. package/dist/esm/models/components/compassapibackendmodelspendlereadresponsemarketuserposition.js.map +1 -0
  74. package/dist/esm/models/components/compassapibackendmodelsvaultsreadresponsevaultuserposition.d.ts +31 -0
  75. package/dist/esm/models/components/compassapibackendmodelsvaultsreadresponsevaultuserposition.d.ts.map +1 -0
  76. package/dist/esm/models/components/compassapibackendmodelsvaultsreadresponsevaultuserposition.js +44 -0
  77. package/dist/esm/models/components/compassapibackendmodelsvaultsreadresponsevaultuserposition.js.map +1 -0
  78. package/dist/esm/models/components/index.d.ts +2 -2
  79. package/dist/esm/models/components/index.d.ts.map +1 -1
  80. package/dist/esm/models/components/index.js +2 -2
  81. package/dist/esm/models/components/index.js.map +1 -1
  82. package/dist/esm/models/components/pendlegetmarketresponse.d.ts +6 -0
  83. package/dist/esm/models/components/pendlegetmarketresponse.d.ts.map +1 -1
  84. package/dist/esm/models/components/pendlegetmarketresponse.js +5 -0
  85. package/dist/esm/models/components/pendlegetmarketresponse.js.map +1 -1
  86. package/dist/esm/models/components/uniswapbuyexactlyparams.d.ts +54 -16
  87. package/dist/esm/models/components/uniswapbuyexactlyparams.d.ts.map +1 -1
  88. package/dist/esm/models/components/uniswapbuyexactlyparams.js +46 -4
  89. package/dist/esm/models/components/uniswapbuyexactlyparams.js.map +1 -1
  90. package/dist/esm/models/components/uniswapbuyexactlyrequest.d.ts +54 -16
  91. package/dist/esm/models/components/uniswapbuyexactlyrequest.d.ts.map +1 -1
  92. package/dist/esm/models/components/uniswapbuyexactlyrequest.js +46 -4
  93. package/dist/esm/models/components/uniswapbuyexactlyrequest.js.map +1 -1
  94. package/dist/esm/models/components/vaultgetvaultresponse.d.ts +3 -3
  95. package/dist/esm/models/components/vaultgetvaultresponse.d.ts.map +1 -1
  96. package/dist/esm/models/components/vaultgetvaultresponse.js +3 -3
  97. package/dist/esm/models/components/vaultgetvaultresponse.js.map +1 -1
  98. package/dist/esm/models/operations/index.d.ts +0 -1
  99. package/dist/esm/models/operations/index.d.ts.map +1 -1
  100. package/dist/esm/models/operations/index.js +0 -1
  101. package/dist/esm/models/operations/index.js.map +1 -1
  102. package/dist/esm/models/operations/pendlemarket.d.ts +5 -0
  103. package/dist/esm/models/operations/pendlemarket.d.ts.map +1 -1
  104. package/dist/esm/models/operations/pendlemarket.js +4 -0
  105. package/dist/esm/models/operations/pendlemarket.js.map +1 -1
  106. package/dist/esm/sdk/pendle.d.ts +5 -10
  107. package/dist/esm/sdk/pendle.d.ts.map +1 -1
  108. package/dist/esm/sdk/pendle.js +6 -14
  109. package/dist/esm/sdk/pendle.js.map +1 -1
  110. package/docs/sdks/pendle/README.md +15 -79
  111. package/docs/sdks/uniswapv3/README.md +4 -4
  112. package/examples/README.md +26 -0
  113. package/examples/aaveV3Rate.example.ts +24 -0
  114. package/examples/package.json +18 -0
  115. package/jsr.json +1 -1
  116. package/package.json +2 -2
  117. package/src/funcs/pendleMarket.ts +4 -1
  118. package/src/lib/config.ts +3 -3
  119. package/src/mcp-server/mcp-server.ts +1 -1
  120. package/src/mcp-server/server.ts +2 -4
  121. package/src/mcp-server/tools/pendleMarket.ts +4 -2
  122. package/src/models/components/compassapibackendmodelspendlereadresponsemarketuserposition.ts +145 -0
  123. package/src/models/components/compassapibackendmodelsvaultsreadresponsevaultuserposition.ts +92 -0
  124. package/src/models/components/index.ts +2 -2
  125. package/src/models/components/pendlegetmarketresponse.ts +25 -0
  126. package/src/models/components/uniswapbuyexactlyparams.ts +120 -20
  127. package/src/models/components/uniswapbuyexactlyrequest.ts +120 -20
  128. package/src/models/components/vaultgetvaultresponse.ts +19 -9
  129. package/src/models/operations/index.ts +0 -1
  130. package/src/models/operations/pendlemarket.ts +9 -0
  131. package/src/sdk/pendle.ts +8 -24
  132. package/dist/commonjs/funcs/pendlePosition.d.ts +0 -19
  133. package/dist/commonjs/funcs/pendlePosition.d.ts.map +0 -1
  134. package/dist/commonjs/funcs/pendlePosition.js +0 -125
  135. package/dist/commonjs/funcs/pendlePosition.js.map +0 -1
  136. package/dist/commonjs/mcp-server/tools/pendlePosition.d.ts +0 -8
  137. package/dist/commonjs/mcp-server/tools/pendlePosition.d.ts.map +0 -1
  138. package/dist/commonjs/mcp-server/tools/pendlePosition.js +0 -64
  139. package/dist/commonjs/mcp-server/tools/pendlePosition.js.map +0 -1
  140. package/dist/commonjs/models/components/pendlegetuserpositionresponse.d.ts +0 -72
  141. package/dist/commonjs/models/components/pendlegetuserpositionresponse.d.ts.map +0 -1
  142. package/dist/commonjs/models/components/pendlegetuserpositionresponse.js.map +0 -1
  143. package/dist/commonjs/models/components/userposition.d.ts +0 -31
  144. package/dist/commonjs/models/components/userposition.d.ts.map +0 -1
  145. package/dist/commonjs/models/components/userposition.js +0 -80
  146. package/dist/commonjs/models/components/userposition.js.map +0 -1
  147. package/dist/commonjs/models/operations/pendleposition.d.ts +0 -82
  148. package/dist/commonjs/models/operations/pendleposition.d.ts.map +0 -1
  149. package/dist/commonjs/models/operations/pendleposition.js +0 -109
  150. package/dist/commonjs/models/operations/pendleposition.js.map +0 -1
  151. package/dist/esm/funcs/pendlePosition.d.ts +0 -19
  152. package/dist/esm/funcs/pendlePosition.d.ts.map +0 -1
  153. package/dist/esm/funcs/pendlePosition.js +0 -89
  154. package/dist/esm/funcs/pendlePosition.js.map +0 -1
  155. package/dist/esm/mcp-server/tools/pendlePosition.d.ts +0 -8
  156. package/dist/esm/mcp-server/tools/pendlePosition.d.ts.map +0 -1
  157. package/dist/esm/mcp-server/tools/pendlePosition.js +0 -28
  158. package/dist/esm/mcp-server/tools/pendlePosition.js.map +0 -1
  159. package/dist/esm/models/components/pendlegetuserpositionresponse.d.ts +0 -72
  160. package/dist/esm/models/components/pendlegetuserpositionresponse.d.ts.map +0 -1
  161. package/dist/esm/models/components/pendlegetuserpositionresponse.js +0 -72
  162. package/dist/esm/models/components/pendlegetuserpositionresponse.js.map +0 -1
  163. package/dist/esm/models/components/userposition.d.ts +0 -31
  164. package/dist/esm/models/components/userposition.d.ts.map +0 -1
  165. package/dist/esm/models/components/userposition.js +0 -42
  166. package/dist/esm/models/components/userposition.js.map +0 -1
  167. package/dist/esm/models/operations/pendleposition.d.ts +0 -82
  168. package/dist/esm/models/operations/pendleposition.d.ts.map +0 -1
  169. package/dist/esm/models/operations/pendleposition.js +0 -71
  170. package/dist/esm/models/operations/pendleposition.js.map +0 -1
  171. package/src/funcs/pendlePosition.ts +0 -177
  172. package/src/mcp-server/tools/pendlePosition.ts +0 -37
  173. package/src/models/components/pendlegetuserpositionresponse.ts +0 -154
  174. package/src/models/components/userposition.ts +0 -75
  175. package/src/models/operations/pendleposition.ts +0 -142
@@ -53,7 +53,6 @@ import { tool$pendleBuyPt } from "./tools/pendleBuyPt.js";
53
53
  import { tool$pendleBuyYt } from "./tools/pendleBuyYt.js";
54
54
  import { tool$pendleMarket } from "./tools/pendleMarket.js";
55
55
  import { tool$pendleMarkets } from "./tools/pendleMarkets.js";
56
- import { tool$pendlePosition } from "./tools/pendlePosition.js";
57
56
  import { tool$pendlePositions } from "./tools/pendlePositions.js";
58
57
  import { tool$pendleQuote } from "./tools/pendleQuote.js";
59
58
  import { tool$pendleRedeemYield } from "./tools/pendleRedeemYield.js";
@@ -102,7 +101,7 @@ export function createMCPServer(deps: {
102
101
  }) {
103
102
  const server = new McpServer({
104
103
  name: "CompassApiSDK",
105
- version: "0.5.41",
104
+ version: "0.5.43",
106
105
  });
107
106
 
108
107
  const client = new CompassApiSDKCore({
@@ -191,9 +190,8 @@ export function createMCPServer(deps: {
191
190
  tool(tool$universalWrapEth);
192
191
  tool(tool$universalUnwrapWeth);
193
192
  tool(tool$universalAllowanceSet);
194
- tool(tool$pendlePosition);
195
- tool(tool$pendlePositions);
196
193
  tool(tool$pendleMarket);
194
+ tool(tool$pendlePositions);
197
195
  tool(tool$pendleMarkets);
198
196
  tool(tool$pendleQuote);
199
197
  tool(tool$pendleBuyPt);
@@ -12,9 +12,11 @@ const args = {
12
12
 
13
13
  export const tool$pendleMarket: ToolDefinition<typeof args> = {
14
14
  name: "pendle-market",
15
- description: `Get Market Data
15
+ description: `Get Market & User Position
16
16
 
17
- Get the market's implied APY, maturity date and the associated token data.`,
17
+ Get the market's implied APY, maturity date and the associated token data.
18
+
19
+ The user position is only included if 'user_address' parameter is included.`,
18
20
  args,
19
21
  tool: async (client, args, ctx) => {
20
22
  const [result, apiCall] = await pendleMarket(
@@ -0,0 +1,145 @@
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 CompassApiBackendModelsPendleReadResponseMarketUserPosition = {
12
+ /**
13
+ * The amount of yield that can be claimed in the underlying token.
14
+ */
15
+ claimableYield: string;
16
+ /**
17
+ * The amount of SY tokens the user currently holds.
18
+ */
19
+ syBalance: string;
20
+ /**
21
+ * The amount of PT tokens the user currently holds.
22
+ */
23
+ ptBalance: string;
24
+ /**
25
+ * The amount of YT tokens the user currently holds.
26
+ */
27
+ ytBalance: string;
28
+ /**
29
+ * The amount of LP tokens the user currently holds.
30
+ */
31
+ lpBalance: string;
32
+ /**
33
+ * The amount of underlying tokens the user currently holds.
34
+ */
35
+ underlyingTokenBalance: string;
36
+ /**
37
+ * The amount of accounting assets the user currently holds.
38
+ */
39
+ accountingAssetBalance?: string | null | undefined;
40
+ };
41
+
42
+ /** @internal */
43
+ export const CompassApiBackendModelsPendleReadResponseMarketUserPosition$inboundSchema:
44
+ z.ZodType<
45
+ CompassApiBackendModelsPendleReadResponseMarketUserPosition,
46
+ z.ZodTypeDef,
47
+ unknown
48
+ > = z.object({
49
+ claimable_yield: z.string(),
50
+ sy_balance: z.string(),
51
+ pt_balance: z.string(),
52
+ yt_balance: z.string(),
53
+ lp_balance: z.string(),
54
+ underlying_token_balance: z.string(),
55
+ accounting_asset_balance: z.nullable(z.string()).optional(),
56
+ }).transform((v) => {
57
+ return remap$(v, {
58
+ "claimable_yield": "claimableYield",
59
+ "sy_balance": "syBalance",
60
+ "pt_balance": "ptBalance",
61
+ "yt_balance": "ytBalance",
62
+ "lp_balance": "lpBalance",
63
+ "underlying_token_balance": "underlyingTokenBalance",
64
+ "accounting_asset_balance": "accountingAssetBalance",
65
+ });
66
+ });
67
+
68
+ /** @internal */
69
+ export type CompassApiBackendModelsPendleReadResponseMarketUserPosition$Outbound =
70
+ {
71
+ claimable_yield: string;
72
+ sy_balance: string;
73
+ pt_balance: string;
74
+ yt_balance: string;
75
+ lp_balance: string;
76
+ underlying_token_balance: string;
77
+ accounting_asset_balance?: string | null | undefined;
78
+ };
79
+
80
+ /** @internal */
81
+ export const CompassApiBackendModelsPendleReadResponseMarketUserPosition$outboundSchema:
82
+ z.ZodType<
83
+ CompassApiBackendModelsPendleReadResponseMarketUserPosition$Outbound,
84
+ z.ZodTypeDef,
85
+ CompassApiBackendModelsPendleReadResponseMarketUserPosition
86
+ > = z.object({
87
+ claimableYield: z.string(),
88
+ syBalance: z.string(),
89
+ ptBalance: z.string(),
90
+ ytBalance: z.string(),
91
+ lpBalance: z.string(),
92
+ underlyingTokenBalance: z.string(),
93
+ accountingAssetBalance: z.nullable(z.string()).optional(),
94
+ }).transform((v) => {
95
+ return remap$(v, {
96
+ claimableYield: "claimable_yield",
97
+ syBalance: "sy_balance",
98
+ ptBalance: "pt_balance",
99
+ ytBalance: "yt_balance",
100
+ lpBalance: "lp_balance",
101
+ underlyingTokenBalance: "underlying_token_balance",
102
+ accountingAssetBalance: "accounting_asset_balance",
103
+ });
104
+ });
105
+
106
+ /**
107
+ * @internal
108
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
109
+ */
110
+ export namespace CompassApiBackendModelsPendleReadResponseMarketUserPosition$ {
111
+ /** @deprecated use `CompassApiBackendModelsPendleReadResponseMarketUserPosition$inboundSchema` instead. */
112
+ export const inboundSchema =
113
+ CompassApiBackendModelsPendleReadResponseMarketUserPosition$inboundSchema;
114
+ /** @deprecated use `CompassApiBackendModelsPendleReadResponseMarketUserPosition$outboundSchema` instead. */
115
+ export const outboundSchema =
116
+ CompassApiBackendModelsPendleReadResponseMarketUserPosition$outboundSchema;
117
+ /** @deprecated use `CompassApiBackendModelsPendleReadResponseMarketUserPosition$Outbound` instead. */
118
+ export type Outbound =
119
+ CompassApiBackendModelsPendleReadResponseMarketUserPosition$Outbound;
120
+ }
121
+
122
+ export function compassApiBackendModelsPendleReadResponseMarketUserPositionToJSON(
123
+ compassApiBackendModelsPendleReadResponseMarketUserPosition:
124
+ CompassApiBackendModelsPendleReadResponseMarketUserPosition,
125
+ ): string {
126
+ return JSON.stringify(
127
+ CompassApiBackendModelsPendleReadResponseMarketUserPosition$outboundSchema
128
+ .parse(compassApiBackendModelsPendleReadResponseMarketUserPosition),
129
+ );
130
+ }
131
+
132
+ export function compassApiBackendModelsPendleReadResponseMarketUserPositionFromJSON(
133
+ jsonString: string,
134
+ ): SafeParseResult<
135
+ CompassApiBackendModelsPendleReadResponseMarketUserPosition,
136
+ SDKValidationError
137
+ > {
138
+ return safeParse(
139
+ jsonString,
140
+ (x) =>
141
+ CompassApiBackendModelsPendleReadResponseMarketUserPosition$inboundSchema
142
+ .parse(JSON.parse(x)),
143
+ `Failed to parse 'CompassApiBackendModelsPendleReadResponseMarketUserPosition' from JSON`,
144
+ );
145
+ }
@@ -0,0 +1,92 @@
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 CompassApiBackendModelsVaultsReadResponseVaultUserPosition = {
12
+ shares: number;
13
+ tokenAmount: string;
14
+ };
15
+
16
+ /** @internal */
17
+ export const CompassApiBackendModelsVaultsReadResponseVaultUserPosition$inboundSchema:
18
+ z.ZodType<
19
+ CompassApiBackendModelsVaultsReadResponseVaultUserPosition,
20
+ z.ZodTypeDef,
21
+ unknown
22
+ > = z.object({
23
+ shares: z.number().int(),
24
+ token_amount: z.string(),
25
+ }).transform((v) => {
26
+ return remap$(v, {
27
+ "token_amount": "tokenAmount",
28
+ });
29
+ });
30
+
31
+ /** @internal */
32
+ export type CompassApiBackendModelsVaultsReadResponseVaultUserPosition$Outbound =
33
+ {
34
+ shares: number;
35
+ token_amount: string;
36
+ };
37
+
38
+ /** @internal */
39
+ export const CompassApiBackendModelsVaultsReadResponseVaultUserPosition$outboundSchema:
40
+ z.ZodType<
41
+ CompassApiBackendModelsVaultsReadResponseVaultUserPosition$Outbound,
42
+ z.ZodTypeDef,
43
+ CompassApiBackendModelsVaultsReadResponseVaultUserPosition
44
+ > = z.object({
45
+ shares: z.number().int(),
46
+ tokenAmount: z.string(),
47
+ }).transform((v) => {
48
+ return remap$(v, {
49
+ tokenAmount: "token_amount",
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 CompassApiBackendModelsVaultsReadResponseVaultUserPosition$ {
58
+ /** @deprecated use `CompassApiBackendModelsVaultsReadResponseVaultUserPosition$inboundSchema` instead. */
59
+ export const inboundSchema =
60
+ CompassApiBackendModelsVaultsReadResponseVaultUserPosition$inboundSchema;
61
+ /** @deprecated use `CompassApiBackendModelsVaultsReadResponseVaultUserPosition$outboundSchema` instead. */
62
+ export const outboundSchema =
63
+ CompassApiBackendModelsVaultsReadResponseVaultUserPosition$outboundSchema;
64
+ /** @deprecated use `CompassApiBackendModelsVaultsReadResponseVaultUserPosition$Outbound` instead. */
65
+ export type Outbound =
66
+ CompassApiBackendModelsVaultsReadResponseVaultUserPosition$Outbound;
67
+ }
68
+
69
+ export function compassApiBackendModelsVaultsReadResponseVaultUserPositionToJSON(
70
+ compassApiBackendModelsVaultsReadResponseVaultUserPosition:
71
+ CompassApiBackendModelsVaultsReadResponseVaultUserPosition,
72
+ ): string {
73
+ return JSON.stringify(
74
+ CompassApiBackendModelsVaultsReadResponseVaultUserPosition$outboundSchema
75
+ .parse(compassApiBackendModelsVaultsReadResponseVaultUserPosition),
76
+ );
77
+ }
78
+
79
+ export function compassApiBackendModelsVaultsReadResponseVaultUserPositionFromJSON(
80
+ jsonString: string,
81
+ ): SafeParseResult<
82
+ CompassApiBackendModelsVaultsReadResponseVaultUserPosition,
83
+ SDKValidationError
84
+ > {
85
+ return safeParse(
86
+ jsonString,
87
+ (x) =>
88
+ CompassApiBackendModelsVaultsReadResponseVaultUserPosition$inboundSchema
89
+ .parse(JSON.parse(x)),
90
+ `Failed to parse 'CompassApiBackendModelsVaultsReadResponseVaultUserPosition' from JSON`,
91
+ );
92
+ }
@@ -52,8 +52,10 @@ export * from "./compassapibackendmodelsmorphoreadresponsegetmarketsasset.js";
52
52
  export * from "./compassapibackendmodelsmorphoreadresponsegetmarketsmarketstate.js";
53
53
  export * from "./compassapibackendmodelsmorphoreadresponsegetvaultsasset.js";
54
54
  export * from "./compassapibackendmodelsmorphoreadresponsegetvaultsvaultstate.js";
55
+ export * from "./compassapibackendmodelspendlereadresponsemarketuserposition.js";
55
56
  export * from "./compassapibackendmodelspendlereadresponsepositionstokenbalance.js";
56
57
  export * from "./compassapibackendmodelsvaultsreadresponsevaultasset.js";
58
+ export * from "./compassapibackendmodelsvaultsreadresponsevaultuserposition.js";
57
59
  export * from "./details.js";
58
60
  export * from "./ensnameinforesponse.js";
59
61
  export * from "./erc20data.js";
@@ -97,7 +99,6 @@ export * from "./pendlebuyytparams.js";
97
99
  export * from "./pendlebuyytrequest.js";
98
100
  export * from "./pendlegetmarketresponse.js";
99
101
  export * from "./pendlegetquoteresponse.js";
100
- export * from "./pendlegetuserpositionresponse.js";
101
102
  export * from "./pendlelistmarketsresponse.js";
102
103
  export * from "./pendlelistuserpositionsresponse.js";
103
104
  export * from "./pendlemarket.js";
@@ -161,7 +162,6 @@ export * from "./unwrapwethrequest.js";
161
162
  export * from "./usageascollateral.js";
162
163
  export * from "./useroperation.js";
163
164
  export * from "./useroperationresponse.js";
164
- export * from "./userposition.js";
165
165
  export * from "./userstate.js";
166
166
  export * from "./validationerror.js";
167
167
  export * from "./vault.js";
@@ -7,6 +7,12 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ CompassApiBackendModelsPendleReadResponseMarketUserPosition,
12
+ CompassApiBackendModelsPendleReadResponseMarketUserPosition$inboundSchema,
13
+ CompassApiBackendModelsPendleReadResponseMarketUserPosition$Outbound,
14
+ CompassApiBackendModelsPendleReadResponseMarketUserPosition$outboundSchema,
15
+ } from "./compassapibackendmodelspendlereadresponsemarketuserposition.js";
10
16
  import {
11
17
  MarketTokens,
12
18
  MarketTokens$inboundSchema,
@@ -28,6 +34,13 @@ export type PendleGetMarketResponse = {
28
34
  */
29
35
  maturityDate: Date;
30
36
  tokens: MarketTokens;
37
+ /**
38
+ * The user's position in the market.
39
+ */
40
+ userPosition?:
41
+ | CompassApiBackendModelsPendleReadResponseMarketUserPosition
42
+ | null
43
+ | undefined;
31
44
  };
32
45
 
33
46
  /** @internal */
@@ -42,11 +55,15 @@ export const PendleGetMarketResponse$inboundSchema: z.ZodType<
42
55
  new Date(v)
43
56
  ),
44
57
  tokens: MarketTokens$inboundSchema,
58
+ user_position: z.nullable(
59
+ CompassApiBackendModelsPendleReadResponseMarketUserPosition$inboundSchema,
60
+ ).optional(),
45
61
  }).transform((v) => {
46
62
  return remap$(v, {
47
63
  "market_address": "marketAddress",
48
64
  "implied_apy": "impliedApy",
49
65
  "maturity_date": "maturityDate",
66
+ "user_position": "userPosition",
50
67
  });
51
68
  });
52
69
 
@@ -56,6 +73,10 @@ export type PendleGetMarketResponse$Outbound = {
56
73
  implied_apy: string;
57
74
  maturity_date: string;
58
75
  tokens: MarketTokens$Outbound;
76
+ user_position?:
77
+ | CompassApiBackendModelsPendleReadResponseMarketUserPosition$Outbound
78
+ | null
79
+ | undefined;
59
80
  };
60
81
 
61
82
  /** @internal */
@@ -68,11 +89,15 @@ export const PendleGetMarketResponse$outboundSchema: z.ZodType<
68
89
  impliedApy: z.string(),
69
90
  maturityDate: z.date().transform(v => v.toISOString()),
70
91
  tokens: MarketTokens$outboundSchema,
92
+ userPosition: z.nullable(
93
+ CompassApiBackendModelsPendleReadResponseMarketUserPosition$outboundSchema,
94
+ ).optional(),
71
95
  }).transform((v) => {
72
96
  return remap$(v, {
73
97
  marketAddress: "market_address",
74
98
  impliedApy: "implied_apy",
75
99
  maturityDate: "maturity_date",
100
+ userPosition: "user_position",
76
101
  });
77
102
  });
78
103
 
@@ -18,6 +18,16 @@ import {
18
18
  TokenEnum$outboundSchema,
19
19
  } from "./tokenenum.js";
20
20
 
21
+ /**
22
+ * The symbol of the token to swap from.
23
+ */
24
+ export type UniswapBuyExactlyParamsTokenIn = TokenEnum | string;
25
+
26
+ /**
27
+ * The symbol of the token to swap to.
28
+ */
29
+ export type UniswapBuyExactlyParamsTokenOut = TokenEnum | string;
30
+
21
31
  /**
22
32
  * The amount of the token to swap to
23
33
  */
@@ -26,23 +36,13 @@ export type UniswapBuyExactlyParamsAmount = number | string;
26
36
  export type UniswapBuyExactlyParams = {
27
37
  actionType?: "UNISWAP_BUY_EXACTLY" | undefined;
28
38
  /**
29
- * A class representing the token.
30
- *
31
- * @remarks
32
- *
33
- * This class is used to represent the token in the system. Notice individual
34
- * endpoints' documentation where per chain tokens are presented.
39
+ * The symbol of the token to swap from.
35
40
  */
36
- tokenIn: TokenEnum;
41
+ tokenIn: TokenEnum | string;
37
42
  /**
38
- * A class representing the token.
39
- *
40
- * @remarks
41
- *
42
- * This class is used to represent the token in the system. Notice individual
43
- * endpoints' documentation where per chain tokens are presented.
43
+ * The symbol of the token to swap to.
44
44
  */
45
- tokenOut: TokenEnum;
45
+ tokenOut: TokenEnum | string;
46
46
  /**
47
47
  * The transaction fee of a Uniswap pool in bips.
48
48
  *
@@ -65,6 +65,106 @@ export type UniswapBuyExactlyParams = {
65
65
  wrapEth?: boolean | undefined;
66
66
  };
67
67
 
68
+ /** @internal */
69
+ export const UniswapBuyExactlyParamsTokenIn$inboundSchema: z.ZodType<
70
+ UniswapBuyExactlyParamsTokenIn,
71
+ z.ZodTypeDef,
72
+ unknown
73
+ > = z.union([TokenEnum$inboundSchema, z.string()]);
74
+
75
+ /** @internal */
76
+ export type UniswapBuyExactlyParamsTokenIn$Outbound = string | string;
77
+
78
+ /** @internal */
79
+ export const UniswapBuyExactlyParamsTokenIn$outboundSchema: z.ZodType<
80
+ UniswapBuyExactlyParamsTokenIn$Outbound,
81
+ z.ZodTypeDef,
82
+ UniswapBuyExactlyParamsTokenIn
83
+ > = z.union([TokenEnum$outboundSchema, z.string()]);
84
+
85
+ /**
86
+ * @internal
87
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
88
+ */
89
+ export namespace UniswapBuyExactlyParamsTokenIn$ {
90
+ /** @deprecated use `UniswapBuyExactlyParamsTokenIn$inboundSchema` instead. */
91
+ export const inboundSchema = UniswapBuyExactlyParamsTokenIn$inboundSchema;
92
+ /** @deprecated use `UniswapBuyExactlyParamsTokenIn$outboundSchema` instead. */
93
+ export const outboundSchema = UniswapBuyExactlyParamsTokenIn$outboundSchema;
94
+ /** @deprecated use `UniswapBuyExactlyParamsTokenIn$Outbound` instead. */
95
+ export type Outbound = UniswapBuyExactlyParamsTokenIn$Outbound;
96
+ }
97
+
98
+ export function uniswapBuyExactlyParamsTokenInToJSON(
99
+ uniswapBuyExactlyParamsTokenIn: UniswapBuyExactlyParamsTokenIn,
100
+ ): string {
101
+ return JSON.stringify(
102
+ UniswapBuyExactlyParamsTokenIn$outboundSchema.parse(
103
+ uniswapBuyExactlyParamsTokenIn,
104
+ ),
105
+ );
106
+ }
107
+
108
+ export function uniswapBuyExactlyParamsTokenInFromJSON(
109
+ jsonString: string,
110
+ ): SafeParseResult<UniswapBuyExactlyParamsTokenIn, SDKValidationError> {
111
+ return safeParse(
112
+ jsonString,
113
+ (x) => UniswapBuyExactlyParamsTokenIn$inboundSchema.parse(JSON.parse(x)),
114
+ `Failed to parse 'UniswapBuyExactlyParamsTokenIn' from JSON`,
115
+ );
116
+ }
117
+
118
+ /** @internal */
119
+ export const UniswapBuyExactlyParamsTokenOut$inboundSchema: z.ZodType<
120
+ UniswapBuyExactlyParamsTokenOut,
121
+ z.ZodTypeDef,
122
+ unknown
123
+ > = z.union([TokenEnum$inboundSchema, z.string()]);
124
+
125
+ /** @internal */
126
+ export type UniswapBuyExactlyParamsTokenOut$Outbound = string | string;
127
+
128
+ /** @internal */
129
+ export const UniswapBuyExactlyParamsTokenOut$outboundSchema: z.ZodType<
130
+ UniswapBuyExactlyParamsTokenOut$Outbound,
131
+ z.ZodTypeDef,
132
+ UniswapBuyExactlyParamsTokenOut
133
+ > = z.union([TokenEnum$outboundSchema, z.string()]);
134
+
135
+ /**
136
+ * @internal
137
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
138
+ */
139
+ export namespace UniswapBuyExactlyParamsTokenOut$ {
140
+ /** @deprecated use `UniswapBuyExactlyParamsTokenOut$inboundSchema` instead. */
141
+ export const inboundSchema = UniswapBuyExactlyParamsTokenOut$inboundSchema;
142
+ /** @deprecated use `UniswapBuyExactlyParamsTokenOut$outboundSchema` instead. */
143
+ export const outboundSchema = UniswapBuyExactlyParamsTokenOut$outboundSchema;
144
+ /** @deprecated use `UniswapBuyExactlyParamsTokenOut$Outbound` instead. */
145
+ export type Outbound = UniswapBuyExactlyParamsTokenOut$Outbound;
146
+ }
147
+
148
+ export function uniswapBuyExactlyParamsTokenOutToJSON(
149
+ uniswapBuyExactlyParamsTokenOut: UniswapBuyExactlyParamsTokenOut,
150
+ ): string {
151
+ return JSON.stringify(
152
+ UniswapBuyExactlyParamsTokenOut$outboundSchema.parse(
153
+ uniswapBuyExactlyParamsTokenOut,
154
+ ),
155
+ );
156
+ }
157
+
158
+ export function uniswapBuyExactlyParamsTokenOutFromJSON(
159
+ jsonString: string,
160
+ ): SafeParseResult<UniswapBuyExactlyParamsTokenOut, SDKValidationError> {
161
+ return safeParse(
162
+ jsonString,
163
+ (x) => UniswapBuyExactlyParamsTokenOut$inboundSchema.parse(JSON.parse(x)),
164
+ `Failed to parse 'UniswapBuyExactlyParamsTokenOut' from JSON`,
165
+ );
166
+ }
167
+
68
168
  /** @internal */
69
169
  export const UniswapBuyExactlyParamsAmount$inboundSchema: z.ZodType<
70
170
  UniswapBuyExactlyParamsAmount,
@@ -122,8 +222,8 @@ export const UniswapBuyExactlyParams$inboundSchema: z.ZodType<
122
222
  unknown
123
223
  > = z.object({
124
224
  action_type: z.literal("UNISWAP_BUY_EXACTLY").default("UNISWAP_BUY_EXACTLY"),
125
- token_in: TokenEnum$inboundSchema,
126
- token_out: TokenEnum$inboundSchema,
225
+ token_in: z.union([TokenEnum$inboundSchema, z.string()]),
226
+ token_out: z.union([TokenEnum$inboundSchema, z.string()]),
127
227
  fee: FeeEnum$inboundSchema,
128
228
  amount: z.union([z.number(), z.string()]),
129
229
  max_slippage_percent: z.number(),
@@ -141,8 +241,8 @@ export const UniswapBuyExactlyParams$inboundSchema: z.ZodType<
141
241
  /** @internal */
142
242
  export type UniswapBuyExactlyParams$Outbound = {
143
243
  action_type: "UNISWAP_BUY_EXACTLY";
144
- token_in: string;
145
- token_out: string;
244
+ token_in: string | string;
245
+ token_out: string | string;
146
246
  fee: string;
147
247
  amount: number | string;
148
248
  max_slippage_percent: number;
@@ -158,8 +258,8 @@ export const UniswapBuyExactlyParams$outboundSchema: z.ZodType<
158
258
  actionType: z.literal("UNISWAP_BUY_EXACTLY").default(
159
259
  "UNISWAP_BUY_EXACTLY" as const,
160
260
  ),
161
- tokenIn: TokenEnum$outboundSchema,
162
- tokenOut: TokenEnum$outboundSchema,
261
+ tokenIn: z.union([TokenEnum$outboundSchema, z.string()]),
262
+ tokenOut: z.union([TokenEnum$outboundSchema, z.string()]),
163
263
  fee: FeeEnum$outboundSchema,
164
264
  amount: z.union([z.number(), z.string()]),
165
265
  maxSlippagePercent: z.number(),