@compass-labs/api-sdk 0.5.47 → 0.5.49

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 (186) hide show
  1. package/FUNCTIONS.md +3 -3
  2. package/README.md +13 -6
  3. package/bin/mcp-server.js +1003 -553
  4. package/bin/mcp-server.js.map +21 -12
  5. package/dist/commonjs/funcs/aaveV3AaveSupportedTokens.d.ts +25 -0
  6. package/dist/commonjs/funcs/aaveV3AaveSupportedTokens.d.ts.map +1 -0
  7. package/dist/commonjs/funcs/aaveV3AaveSupportedTokens.js +129 -0
  8. package/dist/commonjs/funcs/aaveV3AaveSupportedTokens.js.map +1 -0
  9. package/dist/commonjs/funcs/swapOdos.d.ts +25 -0
  10. package/dist/commonjs/funcs/swapOdos.d.ts.map +1 -0
  11. package/dist/commonjs/funcs/swapOdos.js +125 -0
  12. package/dist/commonjs/funcs/swapOdos.js.map +1 -0
  13. package/dist/commonjs/lib/config.d.ts +3 -3
  14. package/dist/commonjs/lib/config.js +3 -3
  15. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  16. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  17. package/dist/commonjs/mcp-server/server.js +5 -1
  18. package/dist/commonjs/mcp-server/server.js.map +1 -1
  19. package/dist/commonjs/mcp-server/tools/aaveV3AaveSupportedTokens.d.ts +8 -0
  20. package/dist/commonjs/mcp-server/tools/aaveV3AaveSupportedTokens.d.ts.map +1 -0
  21. package/dist/commonjs/mcp-server/tools/aaveV3AaveSupportedTokens.js +70 -0
  22. package/dist/commonjs/mcp-server/tools/aaveV3AaveSupportedTokens.js.map +1 -0
  23. package/dist/commonjs/mcp-server/tools/swapOdos.d.ts +8 -0
  24. package/dist/commonjs/mcp-server/tools/swapOdos.d.ts.map +1 -0
  25. package/dist/commonjs/mcp-server/tools/swapOdos.js +72 -0
  26. package/dist/commonjs/mcp-server/tools/swapOdos.js.map +1 -0
  27. package/dist/commonjs/models/components/aavesupportedtokenmetadata.d.ts +47 -0
  28. package/dist/commonjs/models/components/aavesupportedtokenmetadata.d.ts.map +1 -0
  29. package/dist/commonjs/models/components/aavesupportedtokenmetadata.js +86 -0
  30. package/dist/commonjs/models/components/aavesupportedtokenmetadata.js.map +1 -0
  31. package/dist/commonjs/models/components/aavesupportedtokensresponse.d.ts +33 -0
  32. package/dist/commonjs/models/components/aavesupportedtokensresponse.d.ts.map +1 -0
  33. package/dist/commonjs/models/components/aavesupportedtokensresponse.js +70 -0
  34. package/dist/commonjs/models/components/aavesupportedtokensresponse.js.map +1 -0
  35. package/dist/commonjs/models/components/index.d.ts +4 -0
  36. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  37. package/dist/commonjs/models/components/index.js +4 -0
  38. package/dist/commonjs/models/components/index.js.map +1 -1
  39. package/dist/commonjs/models/components/odosswapparams.d.ts +122 -0
  40. package/dist/commonjs/models/components/odosswapparams.d.ts.map +1 -0
  41. package/dist/commonjs/models/components/odosswapparams.js +162 -0
  42. package/dist/commonjs/models/components/odosswapparams.js.map +1 -0
  43. package/dist/commonjs/models/components/odosswaprequest.d.ts +133 -0
  44. package/dist/commonjs/models/components/odosswaprequest.d.ts.map +1 -0
  45. package/dist/commonjs/models/components/odosswaprequest.js +167 -0
  46. package/dist/commonjs/models/components/odosswaprequest.js.map +1 -0
  47. package/dist/commonjs/models/components/setallowanceparams.d.ts +3 -0
  48. package/dist/commonjs/models/components/setallowanceparams.d.ts.map +1 -1
  49. package/dist/commonjs/models/components/setallowanceparams.js +1 -0
  50. package/dist/commonjs/models/components/setallowanceparams.js.map +1 -1
  51. package/dist/commonjs/models/components/setallowancerequest.d.ts +3 -0
  52. package/dist/commonjs/models/components/setallowancerequest.d.ts.map +1 -1
  53. package/dist/commonjs/models/components/setallowancerequest.js +1 -0
  54. package/dist/commonjs/models/components/setallowancerequest.js.map +1 -1
  55. package/dist/commonjs/models/components/useroperation.d.ts +9 -0
  56. package/dist/commonjs/models/components/useroperation.d.ts.map +1 -1
  57. package/dist/commonjs/models/components/useroperation.js +13 -0
  58. package/dist/commonjs/models/components/useroperation.js.map +1 -1
  59. package/dist/commonjs/models/operations/aaveaavesupportedtokens.d.ts +72 -0
  60. package/dist/commonjs/models/operations/aaveaavesupportedtokens.d.ts.map +1 -0
  61. package/dist/commonjs/models/operations/aaveaavesupportedtokens.js +94 -0
  62. package/dist/commonjs/models/operations/aaveaavesupportedtokens.js.map +1 -0
  63. package/dist/commonjs/models/operations/genericallowance.d.ts +3 -0
  64. package/dist/commonjs/models/operations/genericallowance.d.ts.map +1 -1
  65. package/dist/commonjs/models/operations/genericallowance.js +1 -0
  66. package/dist/commonjs/models/operations/genericallowance.js.map +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/sdk/aavev3.d.ts +13 -0
  72. package/dist/commonjs/sdk/aavev3.d.ts.map +1 -1
  73. package/dist/commonjs/sdk/aavev3.js +16 -0
  74. package/dist/commonjs/sdk/aavev3.js.map +1 -1
  75. package/dist/commonjs/sdk/sdk.d.ts +3 -0
  76. package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
  77. package/dist/commonjs/sdk/sdk.js +4 -0
  78. package/dist/commonjs/sdk/sdk.js.map +1 -1
  79. package/dist/commonjs/sdk/swap.d.ts +19 -0
  80. package/dist/commonjs/sdk/swap.d.ts.map +1 -0
  81. package/dist/commonjs/sdk/swap.js +29 -0
  82. package/dist/commonjs/sdk/swap.js.map +1 -0
  83. package/dist/esm/funcs/aaveV3AaveSupportedTokens.d.ts +25 -0
  84. package/dist/esm/funcs/aaveV3AaveSupportedTokens.d.ts.map +1 -0
  85. package/dist/esm/funcs/aaveV3AaveSupportedTokens.js +93 -0
  86. package/dist/esm/funcs/aaveV3AaveSupportedTokens.js.map +1 -0
  87. package/dist/esm/funcs/swapOdos.d.ts +25 -0
  88. package/dist/esm/funcs/swapOdos.d.ts.map +1 -0
  89. package/dist/esm/funcs/swapOdos.js +89 -0
  90. package/dist/esm/funcs/swapOdos.js.map +1 -0
  91. package/dist/esm/lib/config.d.ts +3 -3
  92. package/dist/esm/lib/config.js +3 -3
  93. package/dist/esm/mcp-server/mcp-server.js +1 -1
  94. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  95. package/dist/esm/mcp-server/server.js +5 -1
  96. package/dist/esm/mcp-server/server.js.map +1 -1
  97. package/dist/esm/mcp-server/tools/aaveV3AaveSupportedTokens.d.ts +8 -0
  98. package/dist/esm/mcp-server/tools/aaveV3AaveSupportedTokens.d.ts.map +1 -0
  99. package/dist/esm/mcp-server/tools/aaveV3AaveSupportedTokens.js +34 -0
  100. package/dist/esm/mcp-server/tools/aaveV3AaveSupportedTokens.js.map +1 -0
  101. package/dist/esm/mcp-server/tools/swapOdos.d.ts +8 -0
  102. package/dist/esm/mcp-server/tools/swapOdos.d.ts.map +1 -0
  103. package/dist/esm/mcp-server/tools/swapOdos.js +36 -0
  104. package/dist/esm/mcp-server/tools/swapOdos.js.map +1 -0
  105. package/dist/esm/models/components/aavesupportedtokenmetadata.d.ts +47 -0
  106. package/dist/esm/models/components/aavesupportedtokenmetadata.d.ts.map +1 -0
  107. package/dist/esm/models/components/aavesupportedtokenmetadata.js +48 -0
  108. package/dist/esm/models/components/aavesupportedtokenmetadata.js.map +1 -0
  109. package/dist/esm/models/components/aavesupportedtokensresponse.d.ts +33 -0
  110. package/dist/esm/models/components/aavesupportedtokensresponse.d.ts.map +1 -0
  111. package/dist/esm/models/components/aavesupportedtokensresponse.js +32 -0
  112. package/dist/esm/models/components/aavesupportedtokensresponse.js.map +1 -0
  113. package/dist/esm/models/components/index.d.ts +4 -0
  114. package/dist/esm/models/components/index.d.ts.map +1 -1
  115. package/dist/esm/models/components/index.js +4 -0
  116. package/dist/esm/models/components/index.js.map +1 -1
  117. package/dist/esm/models/components/odosswapparams.d.ts +122 -0
  118. package/dist/esm/models/components/odosswapparams.d.ts.map +1 -0
  119. package/dist/esm/models/components/odosswapparams.js +118 -0
  120. package/dist/esm/models/components/odosswapparams.js.map +1 -0
  121. package/dist/esm/models/components/odosswaprequest.d.ts +133 -0
  122. package/dist/esm/models/components/odosswaprequest.d.ts.map +1 -0
  123. package/dist/esm/models/components/odosswaprequest.js +123 -0
  124. package/dist/esm/models/components/odosswaprequest.js.map +1 -0
  125. package/dist/esm/models/components/setallowanceparams.d.ts +3 -0
  126. package/dist/esm/models/components/setallowanceparams.d.ts.map +1 -1
  127. package/dist/esm/models/components/setallowanceparams.js +1 -0
  128. package/dist/esm/models/components/setallowanceparams.js.map +1 -1
  129. package/dist/esm/models/components/setallowancerequest.d.ts +3 -0
  130. package/dist/esm/models/components/setallowancerequest.d.ts.map +1 -1
  131. package/dist/esm/models/components/setallowancerequest.js +1 -0
  132. package/dist/esm/models/components/setallowancerequest.js.map +1 -1
  133. package/dist/esm/models/components/useroperation.d.ts +9 -0
  134. package/dist/esm/models/components/useroperation.d.ts.map +1 -1
  135. package/dist/esm/models/components/useroperation.js +13 -0
  136. package/dist/esm/models/components/useroperation.js.map +1 -1
  137. package/dist/esm/models/operations/aaveaavesupportedtokens.d.ts +72 -0
  138. package/dist/esm/models/operations/aaveaavesupportedtokens.d.ts.map +1 -0
  139. package/dist/esm/models/operations/aaveaavesupportedtokens.js +56 -0
  140. package/dist/esm/models/operations/aaveaavesupportedtokens.js.map +1 -0
  141. package/dist/esm/models/operations/genericallowance.d.ts +3 -0
  142. package/dist/esm/models/operations/genericallowance.d.ts.map +1 -1
  143. package/dist/esm/models/operations/genericallowance.js +1 -0
  144. package/dist/esm/models/operations/genericallowance.js.map +1 -1
  145. package/dist/esm/models/operations/index.d.ts +1 -0
  146. package/dist/esm/models/operations/index.d.ts.map +1 -1
  147. package/dist/esm/models/operations/index.js +1 -0
  148. package/dist/esm/models/operations/index.js.map +1 -1
  149. package/dist/esm/sdk/aavev3.d.ts +13 -0
  150. package/dist/esm/sdk/aavev3.d.ts.map +1 -1
  151. package/dist/esm/sdk/aavev3.js +16 -0
  152. package/dist/esm/sdk/aavev3.js.map +1 -1
  153. package/dist/esm/sdk/sdk.d.ts +3 -0
  154. package/dist/esm/sdk/sdk.d.ts.map +1 -1
  155. package/dist/esm/sdk/sdk.js +4 -0
  156. package/dist/esm/sdk/sdk.js.map +1 -1
  157. package/dist/esm/sdk/swap.d.ts +19 -0
  158. package/dist/esm/sdk/swap.d.ts.map +1 -0
  159. package/dist/esm/sdk/swap.js +25 -0
  160. package/dist/esm/sdk/swap.js.map +1 -0
  161. package/docs/sdks/aavev3/README.md +76 -0
  162. package/docs/sdks/swap/README.md +99 -0
  163. package/examples/{aaveV3Rate.example.ts → aaveV3AaveSupportedTokens.example.ts} +2 -2
  164. package/jsr.json +1 -1
  165. package/package.json +1 -1
  166. package/src/funcs/aaveV3AaveSupportedTokens.ts +182 -0
  167. package/src/funcs/swapOdos.ts +176 -0
  168. package/src/lib/config.ts +3 -3
  169. package/src/mcp-server/mcp-server.ts +1 -1
  170. package/src/mcp-server/server.ts +5 -1
  171. package/src/mcp-server/tools/aaveV3AaveSupportedTokens.ts +43 -0
  172. package/src/mcp-server/tools/swapOdos.ts +45 -0
  173. package/src/models/components/aavesupportedtokenmetadata.ts +101 -0
  174. package/src/models/components/aavesupportedtokensresponse.ts +77 -0
  175. package/src/models/components/index.ts +4 -0
  176. package/src/models/components/odosswapparams.ts +269 -0
  177. package/src/models/components/odosswaprequest.ts +286 -0
  178. package/src/models/components/setallowanceparams.ts +1 -0
  179. package/src/models/components/setallowancerequest.ts +1 -0
  180. package/src/models/components/useroperation.ts +30 -0
  181. package/src/models/operations/aaveaavesupportedtokens.ts +117 -0
  182. package/src/models/operations/genericallowance.ts +1 -0
  183. package/src/models/operations/index.ts +1 -0
  184. package/src/sdk/aavev3.ts +24 -0
  185. package/src/sdk/sdk.ts +6 -0
  186. package/src/sdk/swap.ts +34 -0
@@ -0,0 +1,286 @@
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
+ import { Chain, Chain$inboundSchema, Chain$outboundSchema } from "./chain.js";
11
+ import {
12
+ TokenEnum,
13
+ TokenEnum$inboundSchema,
14
+ TokenEnum$outboundSchema,
15
+ } from "./tokenenum.js";
16
+
17
+ /**
18
+ * The symbol or address of the token that is to be sold.
19
+ */
20
+ export type OdosSwapRequestTokenIn = TokenEnum | string;
21
+
22
+ /**
23
+ * The symbol or address of the token that is to be bought.
24
+ */
25
+ export type OdosSwapRequestTokenOut = TokenEnum | string;
26
+
27
+ /**
28
+ * The amount of token_in to be sold.
29
+ */
30
+ export type OdosSwapRequestAmount = number | string;
31
+
32
+ export type OdosSwapRequest = {
33
+ actionType?: "ODOS_SWAP" | undefined;
34
+ /**
35
+ * The symbol or address of the token that is to be sold.
36
+ */
37
+ tokenIn: TokenEnum | string;
38
+ /**
39
+ * The symbol or address of the token that is to be bought.
40
+ */
41
+ tokenOut: TokenEnum | string;
42
+ /**
43
+ * The amount of token_in to be sold.
44
+ */
45
+ amount: number | string;
46
+ /**
47
+ * The maximum slippage allowed in percent. e.g. `1` means `1%` slippage allowed.
48
+ */
49
+ maxSlippagePercent: number;
50
+ /**
51
+ * The chain to use.
52
+ */
53
+ chain: Chain;
54
+ /**
55
+ * The address of the transaction sender.
56
+ */
57
+ sender: string;
58
+ };
59
+
60
+ /** @internal */
61
+ export const OdosSwapRequestTokenIn$inboundSchema: z.ZodType<
62
+ OdosSwapRequestTokenIn,
63
+ z.ZodTypeDef,
64
+ unknown
65
+ > = z.union([TokenEnum$inboundSchema, z.string()]);
66
+
67
+ /** @internal */
68
+ export type OdosSwapRequestTokenIn$Outbound = string | string;
69
+
70
+ /** @internal */
71
+ export const OdosSwapRequestTokenIn$outboundSchema: z.ZodType<
72
+ OdosSwapRequestTokenIn$Outbound,
73
+ z.ZodTypeDef,
74
+ OdosSwapRequestTokenIn
75
+ > = z.union([TokenEnum$outboundSchema, z.string()]);
76
+
77
+ /**
78
+ * @internal
79
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
80
+ */
81
+ export namespace OdosSwapRequestTokenIn$ {
82
+ /** @deprecated use `OdosSwapRequestTokenIn$inboundSchema` instead. */
83
+ export const inboundSchema = OdosSwapRequestTokenIn$inboundSchema;
84
+ /** @deprecated use `OdosSwapRequestTokenIn$outboundSchema` instead. */
85
+ export const outboundSchema = OdosSwapRequestTokenIn$outboundSchema;
86
+ /** @deprecated use `OdosSwapRequestTokenIn$Outbound` instead. */
87
+ export type Outbound = OdosSwapRequestTokenIn$Outbound;
88
+ }
89
+
90
+ export function odosSwapRequestTokenInToJSON(
91
+ odosSwapRequestTokenIn: OdosSwapRequestTokenIn,
92
+ ): string {
93
+ return JSON.stringify(
94
+ OdosSwapRequestTokenIn$outboundSchema.parse(odosSwapRequestTokenIn),
95
+ );
96
+ }
97
+
98
+ export function odosSwapRequestTokenInFromJSON(
99
+ jsonString: string,
100
+ ): SafeParseResult<OdosSwapRequestTokenIn, SDKValidationError> {
101
+ return safeParse(
102
+ jsonString,
103
+ (x) => OdosSwapRequestTokenIn$inboundSchema.parse(JSON.parse(x)),
104
+ `Failed to parse 'OdosSwapRequestTokenIn' from JSON`,
105
+ );
106
+ }
107
+
108
+ /** @internal */
109
+ export const OdosSwapRequestTokenOut$inboundSchema: z.ZodType<
110
+ OdosSwapRequestTokenOut,
111
+ z.ZodTypeDef,
112
+ unknown
113
+ > = z.union([TokenEnum$inboundSchema, z.string()]);
114
+
115
+ /** @internal */
116
+ export type OdosSwapRequestTokenOut$Outbound = string | string;
117
+
118
+ /** @internal */
119
+ export const OdosSwapRequestTokenOut$outboundSchema: z.ZodType<
120
+ OdosSwapRequestTokenOut$Outbound,
121
+ z.ZodTypeDef,
122
+ OdosSwapRequestTokenOut
123
+ > = z.union([TokenEnum$outboundSchema, z.string()]);
124
+
125
+ /**
126
+ * @internal
127
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
128
+ */
129
+ export namespace OdosSwapRequestTokenOut$ {
130
+ /** @deprecated use `OdosSwapRequestTokenOut$inboundSchema` instead. */
131
+ export const inboundSchema = OdosSwapRequestTokenOut$inboundSchema;
132
+ /** @deprecated use `OdosSwapRequestTokenOut$outboundSchema` instead. */
133
+ export const outboundSchema = OdosSwapRequestTokenOut$outboundSchema;
134
+ /** @deprecated use `OdosSwapRequestTokenOut$Outbound` instead. */
135
+ export type Outbound = OdosSwapRequestTokenOut$Outbound;
136
+ }
137
+
138
+ export function odosSwapRequestTokenOutToJSON(
139
+ odosSwapRequestTokenOut: OdosSwapRequestTokenOut,
140
+ ): string {
141
+ return JSON.stringify(
142
+ OdosSwapRequestTokenOut$outboundSchema.parse(odosSwapRequestTokenOut),
143
+ );
144
+ }
145
+
146
+ export function odosSwapRequestTokenOutFromJSON(
147
+ jsonString: string,
148
+ ): SafeParseResult<OdosSwapRequestTokenOut, SDKValidationError> {
149
+ return safeParse(
150
+ jsonString,
151
+ (x) => OdosSwapRequestTokenOut$inboundSchema.parse(JSON.parse(x)),
152
+ `Failed to parse 'OdosSwapRequestTokenOut' from JSON`,
153
+ );
154
+ }
155
+
156
+ /** @internal */
157
+ export const OdosSwapRequestAmount$inboundSchema: z.ZodType<
158
+ OdosSwapRequestAmount,
159
+ z.ZodTypeDef,
160
+ unknown
161
+ > = z.union([z.number(), z.string()]);
162
+
163
+ /** @internal */
164
+ export type OdosSwapRequestAmount$Outbound = number | string;
165
+
166
+ /** @internal */
167
+ export const OdosSwapRequestAmount$outboundSchema: z.ZodType<
168
+ OdosSwapRequestAmount$Outbound,
169
+ z.ZodTypeDef,
170
+ OdosSwapRequestAmount
171
+ > = z.union([z.number(), z.string()]);
172
+
173
+ /**
174
+ * @internal
175
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
176
+ */
177
+ export namespace OdosSwapRequestAmount$ {
178
+ /** @deprecated use `OdosSwapRequestAmount$inboundSchema` instead. */
179
+ export const inboundSchema = OdosSwapRequestAmount$inboundSchema;
180
+ /** @deprecated use `OdosSwapRequestAmount$outboundSchema` instead. */
181
+ export const outboundSchema = OdosSwapRequestAmount$outboundSchema;
182
+ /** @deprecated use `OdosSwapRequestAmount$Outbound` instead. */
183
+ export type Outbound = OdosSwapRequestAmount$Outbound;
184
+ }
185
+
186
+ export function odosSwapRequestAmountToJSON(
187
+ odosSwapRequestAmount: OdosSwapRequestAmount,
188
+ ): string {
189
+ return JSON.stringify(
190
+ OdosSwapRequestAmount$outboundSchema.parse(odosSwapRequestAmount),
191
+ );
192
+ }
193
+
194
+ export function odosSwapRequestAmountFromJSON(
195
+ jsonString: string,
196
+ ): SafeParseResult<OdosSwapRequestAmount, SDKValidationError> {
197
+ return safeParse(
198
+ jsonString,
199
+ (x) => OdosSwapRequestAmount$inboundSchema.parse(JSON.parse(x)),
200
+ `Failed to parse 'OdosSwapRequestAmount' from JSON`,
201
+ );
202
+ }
203
+
204
+ /** @internal */
205
+ export const OdosSwapRequest$inboundSchema: z.ZodType<
206
+ OdosSwapRequest,
207
+ z.ZodTypeDef,
208
+ unknown
209
+ > = z.object({
210
+ action_type: z.literal("ODOS_SWAP").default("ODOS_SWAP"),
211
+ token_in: z.union([TokenEnum$inboundSchema, z.string()]),
212
+ token_out: z.union([TokenEnum$inboundSchema, z.string()]),
213
+ amount: z.union([z.number(), z.string()]),
214
+ max_slippage_percent: z.number(),
215
+ chain: Chain$inboundSchema,
216
+ sender: z.string(),
217
+ }).transform((v) => {
218
+ return remap$(v, {
219
+ "action_type": "actionType",
220
+ "token_in": "tokenIn",
221
+ "token_out": "tokenOut",
222
+ "max_slippage_percent": "maxSlippagePercent",
223
+ });
224
+ });
225
+
226
+ /** @internal */
227
+ export type OdosSwapRequest$Outbound = {
228
+ action_type: "ODOS_SWAP";
229
+ token_in: string | string;
230
+ token_out: string | string;
231
+ amount: number | string;
232
+ max_slippage_percent: number;
233
+ chain: string;
234
+ sender: string;
235
+ };
236
+
237
+ /** @internal */
238
+ export const OdosSwapRequest$outboundSchema: z.ZodType<
239
+ OdosSwapRequest$Outbound,
240
+ z.ZodTypeDef,
241
+ OdosSwapRequest
242
+ > = z.object({
243
+ actionType: z.literal("ODOS_SWAP").default("ODOS_SWAP" as const),
244
+ tokenIn: z.union([TokenEnum$outboundSchema, z.string()]),
245
+ tokenOut: z.union([TokenEnum$outboundSchema, z.string()]),
246
+ amount: z.union([z.number(), z.string()]),
247
+ maxSlippagePercent: z.number(),
248
+ chain: Chain$outboundSchema,
249
+ sender: z.string(),
250
+ }).transform((v) => {
251
+ return remap$(v, {
252
+ actionType: "action_type",
253
+ tokenIn: "token_in",
254
+ tokenOut: "token_out",
255
+ maxSlippagePercent: "max_slippage_percent",
256
+ });
257
+ });
258
+
259
+ /**
260
+ * @internal
261
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
262
+ */
263
+ export namespace OdosSwapRequest$ {
264
+ /** @deprecated use `OdosSwapRequest$inboundSchema` instead. */
265
+ export const inboundSchema = OdosSwapRequest$inboundSchema;
266
+ /** @deprecated use `OdosSwapRequest$outboundSchema` instead. */
267
+ export const outboundSchema = OdosSwapRequest$outboundSchema;
268
+ /** @deprecated use `OdosSwapRequest$Outbound` instead. */
269
+ export type Outbound = OdosSwapRequest$Outbound;
270
+ }
271
+
272
+ export function odosSwapRequestToJSON(
273
+ odosSwapRequest: OdosSwapRequest,
274
+ ): string {
275
+ return JSON.stringify(OdosSwapRequest$outboundSchema.parse(odosSwapRequest));
276
+ }
277
+
278
+ export function odosSwapRequestFromJSON(
279
+ jsonString: string,
280
+ ): SafeParseResult<OdosSwapRequest, SDKValidationError> {
281
+ return safeParse(
282
+ jsonString,
283
+ (x) => OdosSwapRequest$inboundSchema.parse(JSON.parse(x)),
284
+ `Failed to parse 'OdosSwapRequest' from JSON`,
285
+ );
286
+ }
@@ -32,6 +32,7 @@ export const SetAllowanceParamsContractEnum = {
32
32
  SkyUsdcUsdsConverter: "SkyUsdcUsdsConverter",
33
33
  SkyUsdsVault: "SkyUsdsVault",
34
34
  PendleRouter: "PendleRouter",
35
+ OdosRouter: "OdosRouter",
35
36
  } as const;
36
37
  export type SetAllowanceParamsContractEnum = ClosedEnum<
37
38
  typeof SetAllowanceParamsContractEnum
@@ -33,6 +33,7 @@ export const SetAllowanceRequestContractEnum = {
33
33
  SkyUsdcUsdsConverter: "SkyUsdcUsdsConverter",
34
34
  SkyUsdsVault: "SkyUsdsVault",
35
35
  PendleRouter: "PendleRouter",
36
+ OdosRouter: "OdosRouter",
36
37
  } as const;
37
38
  export type SetAllowanceRequestContractEnum = ClosedEnum<
38
39
  typeof SetAllowanceRequestContractEnum
@@ -96,6 +96,12 @@ import {
96
96
  MorphoWithdrawParams$Outbound,
97
97
  MorphoWithdrawParams$outboundSchema,
98
98
  } from "./morphowithdrawparams.js";
99
+ import {
100
+ OdosSwapParams,
101
+ OdosSwapParams$inboundSchema,
102
+ OdosSwapParams$Outbound,
103
+ OdosSwapParams$outboundSchema,
104
+ } from "./odosswapparams.js";
99
105
  import {
100
106
  PendleAddLiquidityParams,
101
107
  PendleAddLiquidityParams$inboundSchema,
@@ -245,6 +251,7 @@ export type Body =
245
251
  | (AerodromeSlipstreamSellExactlyParams & {
246
252
  actionType: "AERODROME_SLIPSTREAM_SELL_EXACTLY";
247
253
  })
254
+ | (OdosSwapParams & { actionType: "ODOS_SWAP" })
248
255
  | (AaveBorrowParams & { actionType: "AAVE_BORROW" })
249
256
  | (AaveRepayParams & { actionType: "AAVE_REPAY" })
250
257
  | (AaveWithdrawParams & { actionType: "AAVE_WITHDRAW" })
@@ -302,6 +309,7 @@ export type UserOperation = {
302
309
  | (AerodromeSlipstreamSellExactlyParams & {
303
310
  actionType: "AERODROME_SLIPSTREAM_SELL_EXACTLY";
304
311
  })
312
+ | (OdosSwapParams & { actionType: "ODOS_SWAP" })
305
313
  | (AaveBorrowParams & { actionType: "AAVE_BORROW" })
306
314
  | (AaveRepayParams & { actionType: "AAVE_REPAY" })
307
315
  | (AaveWithdrawParams & { actionType: "AAVE_WITHDRAW" })
@@ -386,6 +394,11 @@ export const Body$inboundSchema: z.ZodType<Body, z.ZodTypeDef, unknown> = z
386
394
  z.object({ action_type: z.literal("AERODROME_SLIPSTREAM_SELL_EXACTLY") })
387
395
  .transform((v) => ({ actionType: v.action_type })),
388
396
  ),
397
+ OdosSwapParams$inboundSchema.and(
398
+ z.object({ action_type: z.literal("ODOS_SWAP") }).transform((v) => ({
399
+ actionType: v.action_type,
400
+ })),
401
+ ),
389
402
  AaveBorrowParams$inboundSchema.and(
390
403
  z.object({ action_type: z.literal("AAVE_BORROW") }).transform((v) => ({
391
404
  actionType: v.action_type,
@@ -548,6 +561,7 @@ export type Body$Outbound =
548
561
  | (AerodromeSlipstreamSellExactlyParams$Outbound & {
549
562
  action_type: "AERODROME_SLIPSTREAM_SELL_EXACTLY";
550
563
  })
564
+ | (OdosSwapParams$Outbound & { action_type: "ODOS_SWAP" })
551
565
  | (AaveBorrowParams$Outbound & { action_type: "AAVE_BORROW" })
552
566
  | (AaveRepayParams$Outbound & { action_type: "AAVE_REPAY" })
553
567
  | (AaveWithdrawParams$Outbound & { action_type: "AAVE_WITHDRAW" })
@@ -637,6 +651,11 @@ export const Body$outboundSchema: z.ZodType<Body$Outbound, z.ZodTypeDef, Body> =
637
651
  z.object({ actionType: z.literal("AERODROME_SLIPSTREAM_SELL_EXACTLY") })
638
652
  .transform((v) => ({ action_type: v.actionType })),
639
653
  ),
654
+ OdosSwapParams$outboundSchema.and(
655
+ z.object({ actionType: z.literal("ODOS_SWAP") }).transform((v) => ({
656
+ action_type: v.actionType,
657
+ })),
658
+ ),
640
659
  AaveBorrowParams$outboundSchema.and(
641
660
  z.object({ actionType: z.literal("AAVE_BORROW") }).transform((v) => ({
642
661
  action_type: v.actionType,
@@ -853,6 +872,11 @@ export const UserOperation$inboundSchema: z.ZodType<
853
872
  z.object({ action_type: z.literal("AERODROME_SLIPSTREAM_SELL_EXACTLY") })
854
873
  .transform((v) => ({ actionType: v.action_type })),
855
874
  ),
875
+ OdosSwapParams$inboundSchema.and(
876
+ z.object({ action_type: z.literal("ODOS_SWAP") }).transform((v) => ({
877
+ actionType: v.action_type,
878
+ })),
879
+ ),
856
880
  AaveBorrowParams$inboundSchema.and(
857
881
  z.object({ action_type: z.literal("AAVE_BORROW") }).transform((v) => ({
858
882
  actionType: v.action_type,
@@ -1019,6 +1043,7 @@ export type UserOperation$Outbound = {
1019
1043
  | (AerodromeSlipstreamSellExactlyParams$Outbound & {
1020
1044
  action_type: "AERODROME_SLIPSTREAM_SELL_EXACTLY";
1021
1045
  })
1046
+ | (OdosSwapParams$Outbound & { action_type: "ODOS_SWAP" })
1022
1047
  | (AaveBorrowParams$Outbound & { action_type: "AAVE_BORROW" })
1023
1048
  | (AaveRepayParams$Outbound & { action_type: "AAVE_REPAY" })
1024
1049
  | (AaveWithdrawParams$Outbound & { action_type: "AAVE_WITHDRAW" })
@@ -1115,6 +1140,11 @@ export const UserOperation$outboundSchema: z.ZodType<
1115
1140
  z.object({ actionType: z.literal("AERODROME_SLIPSTREAM_SELL_EXACTLY") })
1116
1141
  .transform((v) => ({ action_type: v.actionType })),
1117
1142
  ),
1143
+ OdosSwapParams$outboundSchema.and(
1144
+ z.object({ actionType: z.literal("ODOS_SWAP") }).transform((v) => ({
1145
+ action_type: v.actionType,
1146
+ })),
1147
+ ),
1118
1148
  AaveBorrowParams$outboundSchema.and(
1119
1149
  z.object({ actionType: z.literal("AAVE_BORROW") }).transform((v) => ({
1120
1150
  action_type: v.actionType,
@@ -0,0 +1,117 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { ClosedEnum } from "../../types/enums.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * The chain to use.
13
+ */
14
+ export const AaveAaveSupportedTokensChain = {
15
+ BaseMainnet: "base:mainnet",
16
+ EthereumMainnet: "ethereum:mainnet",
17
+ ArbitrumMainnet: "arbitrum:mainnet",
18
+ } as const;
19
+ /**
20
+ * The chain to use.
21
+ */
22
+ export type AaveAaveSupportedTokensChain = ClosedEnum<
23
+ typeof AaveAaveSupportedTokensChain
24
+ >;
25
+
26
+ export type AaveAaveSupportedTokensRequest = {
27
+ /**
28
+ * The chain to use.
29
+ */
30
+ chain?: AaveAaveSupportedTokensChain | undefined;
31
+ /**
32
+ * Optional block number (defaults to latest).
33
+ */
34
+ block?: number | null | undefined;
35
+ };
36
+
37
+ /** @internal */
38
+ export const AaveAaveSupportedTokensChain$inboundSchema: z.ZodNativeEnum<
39
+ typeof AaveAaveSupportedTokensChain
40
+ > = z.nativeEnum(AaveAaveSupportedTokensChain);
41
+
42
+ /** @internal */
43
+ export const AaveAaveSupportedTokensChain$outboundSchema: z.ZodNativeEnum<
44
+ typeof AaveAaveSupportedTokensChain
45
+ > = AaveAaveSupportedTokensChain$inboundSchema;
46
+
47
+ /**
48
+ * @internal
49
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
50
+ */
51
+ export namespace AaveAaveSupportedTokensChain$ {
52
+ /** @deprecated use `AaveAaveSupportedTokensChain$inboundSchema` instead. */
53
+ export const inboundSchema = AaveAaveSupportedTokensChain$inboundSchema;
54
+ /** @deprecated use `AaveAaveSupportedTokensChain$outboundSchema` instead. */
55
+ export const outboundSchema = AaveAaveSupportedTokensChain$outboundSchema;
56
+ }
57
+
58
+ /** @internal */
59
+ export const AaveAaveSupportedTokensRequest$inboundSchema: z.ZodType<
60
+ AaveAaveSupportedTokensRequest,
61
+ z.ZodTypeDef,
62
+ unknown
63
+ > = z.object({
64
+ chain: AaveAaveSupportedTokensChain$inboundSchema.default("arbitrum:mainnet"),
65
+ block: z.nullable(z.number().int()).optional(),
66
+ });
67
+
68
+ /** @internal */
69
+ export type AaveAaveSupportedTokensRequest$Outbound = {
70
+ chain: string;
71
+ block?: number | null | undefined;
72
+ };
73
+
74
+ /** @internal */
75
+ export const AaveAaveSupportedTokensRequest$outboundSchema: z.ZodType<
76
+ AaveAaveSupportedTokensRequest$Outbound,
77
+ z.ZodTypeDef,
78
+ AaveAaveSupportedTokensRequest
79
+ > = z.object({
80
+ chain: AaveAaveSupportedTokensChain$outboundSchema.default(
81
+ "arbitrum:mainnet",
82
+ ),
83
+ block: z.nullable(z.number().int()).optional(),
84
+ });
85
+
86
+ /**
87
+ * @internal
88
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
89
+ */
90
+ export namespace AaveAaveSupportedTokensRequest$ {
91
+ /** @deprecated use `AaveAaveSupportedTokensRequest$inboundSchema` instead. */
92
+ export const inboundSchema = AaveAaveSupportedTokensRequest$inboundSchema;
93
+ /** @deprecated use `AaveAaveSupportedTokensRequest$outboundSchema` instead. */
94
+ export const outboundSchema = AaveAaveSupportedTokensRequest$outboundSchema;
95
+ /** @deprecated use `AaveAaveSupportedTokensRequest$Outbound` instead. */
96
+ export type Outbound = AaveAaveSupportedTokensRequest$Outbound;
97
+ }
98
+
99
+ export function aaveAaveSupportedTokensRequestToJSON(
100
+ aaveAaveSupportedTokensRequest: AaveAaveSupportedTokensRequest,
101
+ ): string {
102
+ return JSON.stringify(
103
+ AaveAaveSupportedTokensRequest$outboundSchema.parse(
104
+ aaveAaveSupportedTokensRequest,
105
+ ),
106
+ );
107
+ }
108
+
109
+ export function aaveAaveSupportedTokensRequestFromJSON(
110
+ jsonString: string,
111
+ ): SafeParseResult<AaveAaveSupportedTokensRequest, SDKValidationError> {
112
+ return safeParse(
113
+ jsonString,
114
+ (x) => AaveAaveSupportedTokensRequest$inboundSchema.parse(JSON.parse(x)),
115
+ `Failed to parse 'AaveAaveSupportedTokensRequest' from JSON`,
116
+ );
117
+ }
@@ -40,6 +40,7 @@ export const ContractEnum = {
40
40
  SkyUsdcUsdsConverter: "SkyUsdcUsdsConverter",
41
41
  SkyUsdsVault: "SkyUsdsVault",
42
42
  PendleRouter: "PendleRouter",
43
+ OdosRouter: "OdosRouter",
43
44
  } as const;
44
45
  export type ContractEnum = ClosedEnum<typeof ContractEnum>;
45
46
 
@@ -2,6 +2,7 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
+ export * from "./aaveaavesupportedtokens.js";
5
6
  export * from "./aaveavgrate.js";
6
7
  export * from "./aavehistoricaltransactions.js";
7
8
  export * from "./aaveliquiditychange.js";
package/src/sdk/aavev3.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
+ import { aaveV3AaveSupportedTokens } from "../funcs/aaveV3AaveSupportedTokens.js";
5
6
  import { aaveV3AvgRate } from "../funcs/aaveV3AvgRate.js";
6
7
  import { aaveV3Borrow } from "../funcs/aaveV3Borrow.js";
7
8
  import { aaveV3HistoricalTransactions } from "../funcs/aaveV3HistoricalTransactions.js";
@@ -21,6 +22,29 @@ import * as operations from "../models/operations/index.js";
21
22
  import { unwrapAsync } from "../types/fp.js";
22
23
 
23
24
  export class AaveV3 extends ClientSDK {
25
+ /**
26
+ * Aave Supported Tokens
27
+ *
28
+ * @remarks
29
+ * Returns the list of supported tokens on Aave for the specified network, along
30
+ * with key metadata.
31
+ *
32
+ * For each token, the response includes:
33
+ * - The symbol and contract address.
34
+ * - Whether the token is currently enabled for supplying (depositing).
35
+ * - Whether it is enabled for borrowing.
36
+ */
37
+ async aaveSupportedTokens(
38
+ request: operations.AaveAaveSupportedTokensRequest,
39
+ options?: RequestOptions,
40
+ ): Promise<components.AaveSupportedTokensResponse> {
41
+ return unwrapAsync(aaveV3AaveSupportedTokens(
42
+ this,
43
+ request,
44
+ options,
45
+ ));
46
+ }
47
+
24
48
  /**
25
49
  * Interest Rates
26
50
  *
package/src/sdk/sdk.ts CHANGED
@@ -10,6 +10,7 @@ import { Morpho } from "./morpho.js";
10
10
  import { Pendle } from "./pendle.js";
11
11
  import { Sky } from "./sky.js";
12
12
  import { SmartAccount } from "./smartaccount.js";
13
+ import { Swap } from "./swap.js";
13
14
  import { Token } from "./token.js";
14
15
  import { TransactionBundler } from "./transactionbundler.js";
15
16
  import { UniswapV3 } from "./uniswapv3.js";
@@ -58,6 +59,11 @@ export class CompassApiSDK extends ClientSDK {
58
59
  return (this._pendle ??= new Pendle(this._options));
59
60
  }
60
61
 
62
+ private _swap?: Swap;
63
+ get swap(): Swap {
64
+ return (this._swap ??= new Swap(this._options));
65
+ }
66
+
61
67
  private _transactionBundler?: TransactionBundler;
62
68
  get transactionBundler(): TransactionBundler {
63
69
  return (this._transactionBundler ??= new TransactionBundler(this._options));
@@ -0,0 +1,34 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { swapOdos } from "../funcs/swapOdos.js";
6
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
7
+ import * as components from "../models/components/index.js";
8
+ import { unwrapAsync } from "../types/fp.js";
9
+
10
+ export class Swap extends ClientSDK {
11
+ /**
12
+ * Odos Swap
13
+ *
14
+ * @remarks
15
+ * Swap between two tokens using Odos Smart Order Routing.
16
+ * <Info>
17
+ * **Required Allowances**
18
+ *
19
+ * In order to make this transaction, token allowances need to be set on the following contracts.
20
+ *
21
+ * - `OdosRouter`
22
+ * </Info>
23
+ */
24
+ async odos(
25
+ request: components.OdosSwapRequest,
26
+ options?: RequestOptions,
27
+ ): Promise<components.TxResponse> {
28
+ return unwrapAsync(swapOdos(
29
+ this,
30
+ request,
31
+ options,
32
+ ));
33
+ }
34
+ }