@compass-labs/api-sdk 0.0.21 → 0.0.23

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 (166) hide show
  1. package/FUNCTIONS.md +2 -2
  2. package/README.md +9 -7
  3. package/bin/mcp-server.js +631 -885
  4. package/bin/mcp-server.js.map +14 -17
  5. package/dist/commonjs/funcs/aaveV3ReserveOverview.d.ts +23 -0
  6. package/dist/commonjs/funcs/aaveV3ReserveOverview.d.ts.map +1 -0
  7. package/dist/commonjs/funcs/aaveV3ReserveOverview.js +126 -0
  8. package/dist/commonjs/funcs/aaveV3ReserveOverview.js.map +1 -0
  9. package/dist/commonjs/lib/config.d.ts +2 -2
  10. package/dist/commonjs/lib/config.js +2 -2
  11. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  12. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  13. package/dist/commonjs/mcp-server/server.js +3 -1
  14. package/dist/commonjs/mcp-server/server.js.map +1 -1
  15. package/dist/commonjs/mcp-server/tools/aaveV3ReserveOverview.d.ts +8 -0
  16. package/dist/commonjs/mcp-server/tools/aaveV3ReserveOverview.d.ts.map +1 -0
  17. package/dist/commonjs/mcp-server/tools/aaveV3ReserveOverview.js +69 -0
  18. package/dist/commonjs/mcp-server/tools/aaveV3ReserveOverview.js.map +1 -0
  19. package/dist/commonjs/models/components/aavereserveoverviewresponse.d.ts +42 -0
  20. package/dist/commonjs/models/components/aavereserveoverviewresponse.d.ts.map +1 -0
  21. package/dist/commonjs/models/components/aavereserveoverviewresponse.js +84 -0
  22. package/dist/commonjs/models/components/aavereserveoverviewresponse.js.map +1 -0
  23. package/dist/commonjs/models/components/index.d.ts +1 -7
  24. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  25. package/dist/commonjs/models/components/index.js +1 -7
  26. package/dist/commonjs/models/components/index.js.map +1 -1
  27. package/dist/commonjs/models/components/multicallaction.d.ts +4 -11
  28. package/dist/commonjs/models/components/multicallaction.d.ts.map +1 -1
  29. package/dist/commonjs/models/components/multicallaction.js +0 -35
  30. package/dist/commonjs/models/components/multicallaction.js.map +1 -1
  31. package/dist/commonjs/models/components/multicallactiontype.d.ts +0 -21
  32. package/dist/commonjs/models/components/multicallactiontype.d.ts.map +1 -1
  33. package/dist/commonjs/models/components/multicallactiontype.js +0 -7
  34. package/dist/commonjs/models/components/multicallactiontype.js.map +1 -1
  35. package/dist/commonjs/models/operations/aavereserveoverview.d.ts +244 -0
  36. package/dist/commonjs/models/operations/aavereserveoverview.d.ts.map +1 -0
  37. package/dist/commonjs/models/operations/aavereserveoverview.js +163 -0
  38. package/dist/commonjs/models/operations/aavereserveoverview.js.map +1 -0
  39. package/dist/commonjs/models/operations/index.d.ts +1 -0
  40. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  41. package/dist/commonjs/models/operations/index.js +1 -0
  42. package/dist/commonjs/models/operations/index.js.map +1 -1
  43. package/dist/commonjs/sdk/aavev3.d.ts +12 -0
  44. package/dist/commonjs/sdk/aavev3.d.ts.map +1 -1
  45. package/dist/commonjs/sdk/aavev3.js +15 -0
  46. package/dist/commonjs/sdk/aavev3.js.map +1 -1
  47. package/dist/esm/funcs/aaveV3ReserveOverview.d.ts +23 -0
  48. package/dist/esm/funcs/aaveV3ReserveOverview.d.ts.map +1 -0
  49. package/dist/esm/funcs/aaveV3ReserveOverview.js +90 -0
  50. package/dist/esm/funcs/aaveV3ReserveOverview.js.map +1 -0
  51. package/dist/esm/lib/config.d.ts +2 -2
  52. package/dist/esm/lib/config.js +2 -2
  53. package/dist/esm/mcp-server/mcp-server.js +1 -1
  54. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  55. package/dist/esm/mcp-server/server.js +3 -1
  56. package/dist/esm/mcp-server/server.js.map +1 -1
  57. package/dist/esm/mcp-server/tools/aaveV3ReserveOverview.d.ts +8 -0
  58. package/dist/esm/mcp-server/tools/aaveV3ReserveOverview.d.ts.map +1 -0
  59. package/dist/esm/mcp-server/tools/aaveV3ReserveOverview.js +33 -0
  60. package/dist/esm/mcp-server/tools/aaveV3ReserveOverview.js.map +1 -0
  61. package/dist/esm/models/components/aavereserveoverviewresponse.d.ts +42 -0
  62. package/dist/esm/models/components/aavereserveoverviewresponse.d.ts.map +1 -0
  63. package/dist/esm/models/components/aavereserveoverviewresponse.js +46 -0
  64. package/dist/esm/models/components/aavereserveoverviewresponse.js.map +1 -0
  65. package/dist/esm/models/components/index.d.ts +1 -7
  66. package/dist/esm/models/components/index.d.ts.map +1 -1
  67. package/dist/esm/models/components/index.js +1 -7
  68. package/dist/esm/models/components/index.js.map +1 -1
  69. package/dist/esm/models/components/multicallaction.d.ts +4 -11
  70. package/dist/esm/models/components/multicallaction.d.ts.map +1 -1
  71. package/dist/esm/models/components/multicallaction.js +0 -35
  72. package/dist/esm/models/components/multicallaction.js.map +1 -1
  73. package/dist/esm/models/components/multicallactiontype.d.ts +0 -21
  74. package/dist/esm/models/components/multicallactiontype.d.ts.map +1 -1
  75. package/dist/esm/models/components/multicallactiontype.js +0 -7
  76. package/dist/esm/models/components/multicallactiontype.js.map +1 -1
  77. package/dist/esm/models/operations/aavereserveoverview.d.ts +244 -0
  78. package/dist/esm/models/operations/aavereserveoverview.d.ts.map +1 -0
  79. package/dist/esm/models/operations/aavereserveoverview.js +125 -0
  80. package/dist/esm/models/operations/aavereserveoverview.js.map +1 -0
  81. package/dist/esm/models/operations/index.d.ts +1 -0
  82. package/dist/esm/models/operations/index.d.ts.map +1 -1
  83. package/dist/esm/models/operations/index.js +1 -0
  84. package/dist/esm/models/operations/index.js.map +1 -1
  85. package/dist/esm/sdk/aavev3.d.ts +12 -0
  86. package/dist/esm/sdk/aavev3.d.ts.map +1 -1
  87. package/dist/esm/sdk/aavev3.js +15 -0
  88. package/dist/esm/sdk/aavev3.js.map +1 -1
  89. package/docs/sdks/aavev3/README.md +85 -0
  90. package/jsr.json +1 -1
  91. package/package.json +1 -1
  92. package/src/funcs/aaveV3ReserveOverview.ts +175 -0
  93. package/src/lib/config.ts +2 -2
  94. package/src/mcp-server/mcp-server.ts +1 -1
  95. package/src/mcp-server/server.ts +3 -1
  96. package/src/mcp-server/tools/aaveV3ReserveOverview.ts +42 -0
  97. package/src/models/components/aavereserveoverviewresponse.ts +96 -0
  98. package/src/models/components/index.ts +1 -7
  99. package/src/models/components/multicallaction.ts +0 -98
  100. package/src/models/components/multicallactiontype.ts +0 -7
  101. package/src/models/operations/aavereserveoverview.ts +205 -0
  102. package/src/models/operations/index.ts +1 -0
  103. package/src/sdk/aavev3.ts +23 -0
  104. package/dist/commonjs/models/components/aerodromeaddliquidityethparams.d.ts +0 -177
  105. package/dist/commonjs/models/components/aerodromeaddliquidityethparams.d.ts.map +0 -1
  106. package/dist/commonjs/models/components/aerodromeaddliquidityethparams.js +0 -191
  107. package/dist/commonjs/models/components/aerodromeaddliquidityethparams.js.map +0 -1
  108. package/dist/commonjs/models/components/aerodromeaddliquidityparams.d.ts +0 -186
  109. package/dist/commonjs/models/components/aerodromeaddliquidityparams.d.ts.map +0 -1
  110. package/dist/commonjs/models/components/aerodromeaddliquidityparams.js +0 -197
  111. package/dist/commonjs/models/components/aerodromeaddliquidityparams.js.map +0 -1
  112. package/dist/commonjs/models/components/aerodromeremoveliquidityethrequest.d.ts +0 -151
  113. package/dist/commonjs/models/components/aerodromeremoveliquidityethrequest.d.ts.map +0 -1
  114. package/dist/commonjs/models/components/aerodromeremoveliquidityethrequest.js +0 -167
  115. package/dist/commonjs/models/components/aerodromeremoveliquidityethrequest.js.map +0 -1
  116. package/dist/commonjs/models/components/aerodromeremoveliquidityrequest.d.ts +0 -161
  117. package/dist/commonjs/models/components/aerodromeremoveliquidityrequest.d.ts.map +0 -1
  118. package/dist/commonjs/models/components/aerodromeremoveliquidityrequest.js +0 -173
  119. package/dist/commonjs/models/components/aerodromeremoveliquidityrequest.js.map +0 -1
  120. package/dist/commonjs/models/components/aerodromeswapethfortokenparams.d.ts +0 -109
  121. package/dist/commonjs/models/components/aerodromeswapethfortokenparams.d.ts.map +0 -1
  122. package/dist/commonjs/models/components/aerodromeswapethfortokenparams.js +0 -137
  123. package/dist/commonjs/models/components/aerodromeswapethfortokenparams.js.map +0 -1
  124. package/dist/commonjs/models/components/aerodromeswaptokenforethparams.d.ts +0 -109
  125. package/dist/commonjs/models/components/aerodromeswaptokenforethparams.d.ts.map +0 -1
  126. package/dist/commonjs/models/components/aerodromeswaptokenforethparams.js +0 -137
  127. package/dist/commonjs/models/components/aerodromeswaptokenforethparams.js.map +0 -1
  128. package/dist/commonjs/models/components/aerodromeswaptokensparams.d.ts +0 -128
  129. package/dist/commonjs/models/components/aerodromeswaptokensparams.d.ts.map +0 -1
  130. package/dist/commonjs/models/components/aerodromeswaptokensparams.js +0 -141
  131. package/dist/commonjs/models/components/aerodromeswaptokensparams.js.map +0 -1
  132. package/dist/esm/models/components/aerodromeaddliquidityethparams.d.ts +0 -177
  133. package/dist/esm/models/components/aerodromeaddliquidityethparams.d.ts.map +0 -1
  134. package/dist/esm/models/components/aerodromeaddliquidityethparams.js +0 -145
  135. package/dist/esm/models/components/aerodromeaddliquidityethparams.js.map +0 -1
  136. package/dist/esm/models/components/aerodromeaddliquidityparams.d.ts +0 -186
  137. package/dist/esm/models/components/aerodromeaddliquidityparams.d.ts.map +0 -1
  138. package/dist/esm/models/components/aerodromeaddliquidityparams.js +0 -151
  139. package/dist/esm/models/components/aerodromeaddliquidityparams.js.map +0 -1
  140. package/dist/esm/models/components/aerodromeremoveliquidityethrequest.d.ts +0 -151
  141. package/dist/esm/models/components/aerodromeremoveliquidityethrequest.d.ts.map +0 -1
  142. package/dist/esm/models/components/aerodromeremoveliquidityethrequest.js +0 -123
  143. package/dist/esm/models/components/aerodromeremoveliquidityethrequest.js.map +0 -1
  144. package/dist/esm/models/components/aerodromeremoveliquidityrequest.d.ts +0 -161
  145. package/dist/esm/models/components/aerodromeremoveliquidityrequest.d.ts.map +0 -1
  146. package/dist/esm/models/components/aerodromeremoveliquidityrequest.js +0 -129
  147. package/dist/esm/models/components/aerodromeremoveliquidityrequest.js.map +0 -1
  148. package/dist/esm/models/components/aerodromeswapethfortokenparams.d.ts +0 -109
  149. package/dist/esm/models/components/aerodromeswapethfortokenparams.d.ts.map +0 -1
  150. package/dist/esm/models/components/aerodromeswapethfortokenparams.js +0 -95
  151. package/dist/esm/models/components/aerodromeswapethfortokenparams.js.map +0 -1
  152. package/dist/esm/models/components/aerodromeswaptokenforethparams.d.ts +0 -109
  153. package/dist/esm/models/components/aerodromeswaptokenforethparams.d.ts.map +0 -1
  154. package/dist/esm/models/components/aerodromeswaptokenforethparams.js +0 -95
  155. package/dist/esm/models/components/aerodromeswaptokenforethparams.js.map +0 -1
  156. package/dist/esm/models/components/aerodromeswaptokensparams.d.ts +0 -128
  157. package/dist/esm/models/components/aerodromeswaptokensparams.d.ts.map +0 -1
  158. package/dist/esm/models/components/aerodromeswaptokensparams.js +0 -99
  159. package/dist/esm/models/components/aerodromeswaptokensparams.js.map +0 -1
  160. package/src/models/components/aerodromeaddliquidityethparams.ts +0 -392
  161. package/src/models/components/aerodromeaddliquidityparams.ts +0 -382
  162. package/src/models/components/aerodromeremoveliquidityethrequest.ts +0 -357
  163. package/src/models/components/aerodromeremoveliquidityrequest.ts +0 -363
  164. package/src/models/components/aerodromeswapethfortokenparams.ts +0 -249
  165. package/src/models/components/aerodromeswaptokenforethparams.ts +0 -249
  166. package/src/models/components/aerodromeswaptokensparams.ts +0 -260
@@ -1,249 +0,0 @@
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 {
11
- TokenEnum,
12
- TokenEnum$inboundSchema,
13
- TokenEnum$outboundSchema,
14
- } from "./tokenenum.js";
15
-
16
- /**
17
- * The amount of tokens you will give to aerodrome_basic for this trade
18
- */
19
- export type AerodromeSwapTokenForEthParamsAmountIn = number | string;
20
-
21
- /**
22
- * The minimal amount of ETH you are willing to receive (will revert if the swap gives you less)
23
- */
24
- export type AerodromeSwapTokenForEthParamsAmountOutMin = number | string;
25
-
26
- /**
27
- * Parameters model for swapping tokens for ETH.
28
- */
29
- export type AerodromeSwapTokenForEthParams = {
30
- /**
31
- * A class representing the token.
32
- *
33
- * @remarks
34
- *
35
- * This class is used to represent the token in the system. Notice individual
36
- * endpoints' documentation where per chain tokens are presented.
37
- */
38
- tokenIn: TokenEnum;
39
- /**
40
- * The amount of tokens you will give to aerodrome_basic for this trade
41
- */
42
- amountIn: number | string;
43
- /**
44
- * The minimal amount of ETH you are willing to receive (will revert if the swap gives you less)
45
- */
46
- amountOutMin: number | string;
47
- /**
48
- * If true, try to trade on a stable pool with a bonding curve of K=x^3y+y^3x. If false, try to trade on a volatile pool with a bonding curve of K=xy
49
- */
50
- stable: boolean;
51
- /**
52
- * The receiver of the funds from this trade, default to sender
53
- */
54
- to?: string | null | undefined;
55
- };
56
-
57
- /** @internal */
58
- export const AerodromeSwapTokenForEthParamsAmountIn$inboundSchema: z.ZodType<
59
- AerodromeSwapTokenForEthParamsAmountIn,
60
- z.ZodTypeDef,
61
- unknown
62
- > = z.union([z.number(), z.string()]);
63
-
64
- /** @internal */
65
- export type AerodromeSwapTokenForEthParamsAmountIn$Outbound = number | string;
66
-
67
- /** @internal */
68
- export const AerodromeSwapTokenForEthParamsAmountIn$outboundSchema: z.ZodType<
69
- AerodromeSwapTokenForEthParamsAmountIn$Outbound,
70
- z.ZodTypeDef,
71
- AerodromeSwapTokenForEthParamsAmountIn
72
- > = z.union([z.number(), z.string()]);
73
-
74
- /**
75
- * @internal
76
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
77
- */
78
- export namespace AerodromeSwapTokenForEthParamsAmountIn$ {
79
- /** @deprecated use `AerodromeSwapTokenForEthParamsAmountIn$inboundSchema` instead. */
80
- export const inboundSchema =
81
- AerodromeSwapTokenForEthParamsAmountIn$inboundSchema;
82
- /** @deprecated use `AerodromeSwapTokenForEthParamsAmountIn$outboundSchema` instead. */
83
- export const outboundSchema =
84
- AerodromeSwapTokenForEthParamsAmountIn$outboundSchema;
85
- /** @deprecated use `AerodromeSwapTokenForEthParamsAmountIn$Outbound` instead. */
86
- export type Outbound = AerodromeSwapTokenForEthParamsAmountIn$Outbound;
87
- }
88
-
89
- export function aerodromeSwapTokenForEthParamsAmountInToJSON(
90
- aerodromeSwapTokenForEthParamsAmountIn:
91
- AerodromeSwapTokenForEthParamsAmountIn,
92
- ): string {
93
- return JSON.stringify(
94
- AerodromeSwapTokenForEthParamsAmountIn$outboundSchema.parse(
95
- aerodromeSwapTokenForEthParamsAmountIn,
96
- ),
97
- );
98
- }
99
-
100
- export function aerodromeSwapTokenForEthParamsAmountInFromJSON(
101
- jsonString: string,
102
- ): SafeParseResult<AerodromeSwapTokenForEthParamsAmountIn, SDKValidationError> {
103
- return safeParse(
104
- jsonString,
105
- (x) =>
106
- AerodromeSwapTokenForEthParamsAmountIn$inboundSchema.parse(JSON.parse(x)),
107
- `Failed to parse 'AerodromeSwapTokenForEthParamsAmountIn' from JSON`,
108
- );
109
- }
110
-
111
- /** @internal */
112
- export const AerodromeSwapTokenForEthParamsAmountOutMin$inboundSchema:
113
- z.ZodType<AerodromeSwapTokenForEthParamsAmountOutMin, z.ZodTypeDef, unknown> =
114
- z.union([z.number(), z.string()]);
115
-
116
- /** @internal */
117
- export type AerodromeSwapTokenForEthParamsAmountOutMin$Outbound =
118
- | number
119
- | string;
120
-
121
- /** @internal */
122
- export const AerodromeSwapTokenForEthParamsAmountOutMin$outboundSchema:
123
- z.ZodType<
124
- AerodromeSwapTokenForEthParamsAmountOutMin$Outbound,
125
- z.ZodTypeDef,
126
- AerodromeSwapTokenForEthParamsAmountOutMin
127
- > = z.union([z.number(), z.string()]);
128
-
129
- /**
130
- * @internal
131
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
132
- */
133
- export namespace AerodromeSwapTokenForEthParamsAmountOutMin$ {
134
- /** @deprecated use `AerodromeSwapTokenForEthParamsAmountOutMin$inboundSchema` instead. */
135
- export const inboundSchema =
136
- AerodromeSwapTokenForEthParamsAmountOutMin$inboundSchema;
137
- /** @deprecated use `AerodromeSwapTokenForEthParamsAmountOutMin$outboundSchema` instead. */
138
- export const outboundSchema =
139
- AerodromeSwapTokenForEthParamsAmountOutMin$outboundSchema;
140
- /** @deprecated use `AerodromeSwapTokenForEthParamsAmountOutMin$Outbound` instead. */
141
- export type Outbound = AerodromeSwapTokenForEthParamsAmountOutMin$Outbound;
142
- }
143
-
144
- export function aerodromeSwapTokenForEthParamsAmountOutMinToJSON(
145
- aerodromeSwapTokenForEthParamsAmountOutMin:
146
- AerodromeSwapTokenForEthParamsAmountOutMin,
147
- ): string {
148
- return JSON.stringify(
149
- AerodromeSwapTokenForEthParamsAmountOutMin$outboundSchema.parse(
150
- aerodromeSwapTokenForEthParamsAmountOutMin,
151
- ),
152
- );
153
- }
154
-
155
- export function aerodromeSwapTokenForEthParamsAmountOutMinFromJSON(
156
- jsonString: string,
157
- ): SafeParseResult<
158
- AerodromeSwapTokenForEthParamsAmountOutMin,
159
- SDKValidationError
160
- > {
161
- return safeParse(
162
- jsonString,
163
- (x) =>
164
- AerodromeSwapTokenForEthParamsAmountOutMin$inboundSchema.parse(
165
- JSON.parse(x),
166
- ),
167
- `Failed to parse 'AerodromeSwapTokenForEthParamsAmountOutMin' from JSON`,
168
- );
169
- }
170
-
171
- /** @internal */
172
- export const AerodromeSwapTokenForEthParams$inboundSchema: z.ZodType<
173
- AerodromeSwapTokenForEthParams,
174
- z.ZodTypeDef,
175
- unknown
176
- > = z.object({
177
- token_in: TokenEnum$inboundSchema,
178
- amount_in: z.union([z.number(), z.string()]),
179
- amount_out_min: z.union([z.number(), z.string()]),
180
- stable: z.boolean(),
181
- to: z.nullable(z.string()).optional(),
182
- }).transform((v) => {
183
- return remap$(v, {
184
- "token_in": "tokenIn",
185
- "amount_in": "amountIn",
186
- "amount_out_min": "amountOutMin",
187
- });
188
- });
189
-
190
- /** @internal */
191
- export type AerodromeSwapTokenForEthParams$Outbound = {
192
- token_in: string;
193
- amount_in: number | string;
194
- amount_out_min: number | string;
195
- stable: boolean;
196
- to?: string | null | undefined;
197
- };
198
-
199
- /** @internal */
200
- export const AerodromeSwapTokenForEthParams$outboundSchema: z.ZodType<
201
- AerodromeSwapTokenForEthParams$Outbound,
202
- z.ZodTypeDef,
203
- AerodromeSwapTokenForEthParams
204
- > = z.object({
205
- tokenIn: TokenEnum$outboundSchema,
206
- amountIn: z.union([z.number(), z.string()]),
207
- amountOutMin: z.union([z.number(), z.string()]),
208
- stable: z.boolean(),
209
- to: z.nullable(z.string()).optional(),
210
- }).transform((v) => {
211
- return remap$(v, {
212
- tokenIn: "token_in",
213
- amountIn: "amount_in",
214
- amountOutMin: "amount_out_min",
215
- });
216
- });
217
-
218
- /**
219
- * @internal
220
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
221
- */
222
- export namespace AerodromeSwapTokenForEthParams$ {
223
- /** @deprecated use `AerodromeSwapTokenForEthParams$inboundSchema` instead. */
224
- export const inboundSchema = AerodromeSwapTokenForEthParams$inboundSchema;
225
- /** @deprecated use `AerodromeSwapTokenForEthParams$outboundSchema` instead. */
226
- export const outboundSchema = AerodromeSwapTokenForEthParams$outboundSchema;
227
- /** @deprecated use `AerodromeSwapTokenForEthParams$Outbound` instead. */
228
- export type Outbound = AerodromeSwapTokenForEthParams$Outbound;
229
- }
230
-
231
- export function aerodromeSwapTokenForEthParamsToJSON(
232
- aerodromeSwapTokenForEthParams: AerodromeSwapTokenForEthParams,
233
- ): string {
234
- return JSON.stringify(
235
- AerodromeSwapTokenForEthParams$outboundSchema.parse(
236
- aerodromeSwapTokenForEthParams,
237
- ),
238
- );
239
- }
240
-
241
- export function aerodromeSwapTokenForEthParamsFromJSON(
242
- jsonString: string,
243
- ): SafeParseResult<AerodromeSwapTokenForEthParams, SDKValidationError> {
244
- return safeParse(
245
- jsonString,
246
- (x) => AerodromeSwapTokenForEthParams$inboundSchema.parse(JSON.parse(x)),
247
- `Failed to parse 'AerodromeSwapTokenForEthParams' from JSON`,
248
- );
249
- }
@@ -1,260 +0,0 @@
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 {
11
- TokenEnum,
12
- TokenEnum$inboundSchema,
13
- TokenEnum$outboundSchema,
14
- } from "./tokenenum.js";
15
-
16
- /**
17
- * The amount of tokens you will give to aerodrome_basic for this trade
18
- */
19
- export type AerodromeSwapTokensParamsAmountIn = number | string;
20
-
21
- /**
22
- * The minimal amount of token you are willing to receive (will revert if the
23
- *
24
- * @remarks
25
- * swap gives you less)
26
- */
27
- export type AerodromeSwapTokensParamsAmountOutMin = number | string;
28
-
29
- /**
30
- * Parameters model for swapping tokens.
31
- */
32
- export type AerodromeSwapTokensParams = {
33
- /**
34
- * A class representing the token.
35
- *
36
- * @remarks
37
- *
38
- * This class is used to represent the token in the system. Notice individual
39
- * endpoints' documentation where per chain tokens are presented.
40
- */
41
- tokenIn: TokenEnum;
42
- /**
43
- * A class representing the token.
44
- *
45
- * @remarks
46
- *
47
- * This class is used to represent the token in the system. Notice individual
48
- * endpoints' documentation where per chain tokens are presented.
49
- */
50
- tokenOut: TokenEnum;
51
- /**
52
- * The amount of tokens you will give to aerodrome_basic for this trade
53
- */
54
- amountIn: number | string;
55
- /**
56
- * The minimal amount of token you are willing to receive (will revert if the
57
- *
58
- * @remarks
59
- * swap gives you less)
60
- */
61
- amountOutMin: number | string;
62
- /**
63
- * If true, try to trade on a stable pool with a bonding curve of K=x^3y+y^3x.
64
- *
65
- * @remarks
66
- * If false, try to trade on a volatile pool with a bonding curve of K=xy
67
- */
68
- stable: boolean;
69
- /**
70
- * The receiver of the funds from this trade, default to sender
71
- */
72
- to?: string | null | undefined;
73
- };
74
-
75
- /** @internal */
76
- export const AerodromeSwapTokensParamsAmountIn$inboundSchema: z.ZodType<
77
- AerodromeSwapTokensParamsAmountIn,
78
- z.ZodTypeDef,
79
- unknown
80
- > = z.union([z.number(), z.string()]);
81
-
82
- /** @internal */
83
- export type AerodromeSwapTokensParamsAmountIn$Outbound = number | string;
84
-
85
- /** @internal */
86
- export const AerodromeSwapTokensParamsAmountIn$outboundSchema: z.ZodType<
87
- AerodromeSwapTokensParamsAmountIn$Outbound,
88
- z.ZodTypeDef,
89
- AerodromeSwapTokensParamsAmountIn
90
- > = z.union([z.number(), z.string()]);
91
-
92
- /**
93
- * @internal
94
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
95
- */
96
- export namespace AerodromeSwapTokensParamsAmountIn$ {
97
- /** @deprecated use `AerodromeSwapTokensParamsAmountIn$inboundSchema` instead. */
98
- export const inboundSchema = AerodromeSwapTokensParamsAmountIn$inboundSchema;
99
- /** @deprecated use `AerodromeSwapTokensParamsAmountIn$outboundSchema` instead. */
100
- export const outboundSchema =
101
- AerodromeSwapTokensParamsAmountIn$outboundSchema;
102
- /** @deprecated use `AerodromeSwapTokensParamsAmountIn$Outbound` instead. */
103
- export type Outbound = AerodromeSwapTokensParamsAmountIn$Outbound;
104
- }
105
-
106
- export function aerodromeSwapTokensParamsAmountInToJSON(
107
- aerodromeSwapTokensParamsAmountIn: AerodromeSwapTokensParamsAmountIn,
108
- ): string {
109
- return JSON.stringify(
110
- AerodromeSwapTokensParamsAmountIn$outboundSchema.parse(
111
- aerodromeSwapTokensParamsAmountIn,
112
- ),
113
- );
114
- }
115
-
116
- export function aerodromeSwapTokensParamsAmountInFromJSON(
117
- jsonString: string,
118
- ): SafeParseResult<AerodromeSwapTokensParamsAmountIn, SDKValidationError> {
119
- return safeParse(
120
- jsonString,
121
- (x) => AerodromeSwapTokensParamsAmountIn$inboundSchema.parse(JSON.parse(x)),
122
- `Failed to parse 'AerodromeSwapTokensParamsAmountIn' from JSON`,
123
- );
124
- }
125
-
126
- /** @internal */
127
- export const AerodromeSwapTokensParamsAmountOutMin$inboundSchema: z.ZodType<
128
- AerodromeSwapTokensParamsAmountOutMin,
129
- z.ZodTypeDef,
130
- unknown
131
- > = z.union([z.number(), z.string()]);
132
-
133
- /** @internal */
134
- export type AerodromeSwapTokensParamsAmountOutMin$Outbound = number | string;
135
-
136
- /** @internal */
137
- export const AerodromeSwapTokensParamsAmountOutMin$outboundSchema: z.ZodType<
138
- AerodromeSwapTokensParamsAmountOutMin$Outbound,
139
- z.ZodTypeDef,
140
- AerodromeSwapTokensParamsAmountOutMin
141
- > = z.union([z.number(), z.string()]);
142
-
143
- /**
144
- * @internal
145
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
146
- */
147
- export namespace AerodromeSwapTokensParamsAmountOutMin$ {
148
- /** @deprecated use `AerodromeSwapTokensParamsAmountOutMin$inboundSchema` instead. */
149
- export const inboundSchema =
150
- AerodromeSwapTokensParamsAmountOutMin$inboundSchema;
151
- /** @deprecated use `AerodromeSwapTokensParamsAmountOutMin$outboundSchema` instead. */
152
- export const outboundSchema =
153
- AerodromeSwapTokensParamsAmountOutMin$outboundSchema;
154
- /** @deprecated use `AerodromeSwapTokensParamsAmountOutMin$Outbound` instead. */
155
- export type Outbound = AerodromeSwapTokensParamsAmountOutMin$Outbound;
156
- }
157
-
158
- export function aerodromeSwapTokensParamsAmountOutMinToJSON(
159
- aerodromeSwapTokensParamsAmountOutMin: AerodromeSwapTokensParamsAmountOutMin,
160
- ): string {
161
- return JSON.stringify(
162
- AerodromeSwapTokensParamsAmountOutMin$outboundSchema.parse(
163
- aerodromeSwapTokensParamsAmountOutMin,
164
- ),
165
- );
166
- }
167
-
168
- export function aerodromeSwapTokensParamsAmountOutMinFromJSON(
169
- jsonString: string,
170
- ): SafeParseResult<AerodromeSwapTokensParamsAmountOutMin, SDKValidationError> {
171
- return safeParse(
172
- jsonString,
173
- (x) =>
174
- AerodromeSwapTokensParamsAmountOutMin$inboundSchema.parse(JSON.parse(x)),
175
- `Failed to parse 'AerodromeSwapTokensParamsAmountOutMin' from JSON`,
176
- );
177
- }
178
-
179
- /** @internal */
180
- export const AerodromeSwapTokensParams$inboundSchema: z.ZodType<
181
- AerodromeSwapTokensParams,
182
- z.ZodTypeDef,
183
- unknown
184
- > = z.object({
185
- token_in: TokenEnum$inboundSchema,
186
- token_out: TokenEnum$inboundSchema,
187
- amount_in: z.union([z.number(), z.string()]),
188
- amount_out_min: z.union([z.number(), z.string()]),
189
- stable: z.boolean(),
190
- to: z.nullable(z.string()).optional(),
191
- }).transform((v) => {
192
- return remap$(v, {
193
- "token_in": "tokenIn",
194
- "token_out": "tokenOut",
195
- "amount_in": "amountIn",
196
- "amount_out_min": "amountOutMin",
197
- });
198
- });
199
-
200
- /** @internal */
201
- export type AerodromeSwapTokensParams$Outbound = {
202
- token_in: string;
203
- token_out: string;
204
- amount_in: number | string;
205
- amount_out_min: number | string;
206
- stable: boolean;
207
- to?: string | null | undefined;
208
- };
209
-
210
- /** @internal */
211
- export const AerodromeSwapTokensParams$outboundSchema: z.ZodType<
212
- AerodromeSwapTokensParams$Outbound,
213
- z.ZodTypeDef,
214
- AerodromeSwapTokensParams
215
- > = z.object({
216
- tokenIn: TokenEnum$outboundSchema,
217
- tokenOut: TokenEnum$outboundSchema,
218
- amountIn: z.union([z.number(), z.string()]),
219
- amountOutMin: z.union([z.number(), z.string()]),
220
- stable: z.boolean(),
221
- to: z.nullable(z.string()).optional(),
222
- }).transform((v) => {
223
- return remap$(v, {
224
- tokenIn: "token_in",
225
- tokenOut: "token_out",
226
- amountIn: "amount_in",
227
- amountOutMin: "amount_out_min",
228
- });
229
- });
230
-
231
- /**
232
- * @internal
233
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
234
- */
235
- export namespace AerodromeSwapTokensParams$ {
236
- /** @deprecated use `AerodromeSwapTokensParams$inboundSchema` instead. */
237
- export const inboundSchema = AerodromeSwapTokensParams$inboundSchema;
238
- /** @deprecated use `AerodromeSwapTokensParams$outboundSchema` instead. */
239
- export const outboundSchema = AerodromeSwapTokensParams$outboundSchema;
240
- /** @deprecated use `AerodromeSwapTokensParams$Outbound` instead. */
241
- export type Outbound = AerodromeSwapTokensParams$Outbound;
242
- }
243
-
244
- export function aerodromeSwapTokensParamsToJSON(
245
- aerodromeSwapTokensParams: AerodromeSwapTokensParams,
246
- ): string {
247
- return JSON.stringify(
248
- AerodromeSwapTokensParams$outboundSchema.parse(aerodromeSwapTokensParams),
249
- );
250
- }
251
-
252
- export function aerodromeSwapTokensParamsFromJSON(
253
- jsonString: string,
254
- ): SafeParseResult<AerodromeSwapTokensParams, SDKValidationError> {
255
- return safeParse(
256
- jsonString,
257
- (x) => AerodromeSwapTokensParams$inboundSchema.parse(JSON.parse(x)),
258
- `Failed to parse 'AerodromeSwapTokensParams' from JSON`,
259
- );
260
- }