@compass-labs/api-sdk 0.0.21 → 0.0.22

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 (105) hide show
  1. package/bin/mcp-server.js +5 -486
  2. package/bin/mcp-server.js.map +9 -16
  3. package/dist/commonjs/lib/config.d.ts +2 -2
  4. package/dist/commonjs/lib/config.js +2 -2
  5. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  6. package/dist/commonjs/mcp-server/server.js +1 -1
  7. package/dist/commonjs/models/components/index.d.ts +0 -7
  8. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  9. package/dist/commonjs/models/components/index.js +0 -7
  10. package/dist/commonjs/models/components/index.js.map +1 -1
  11. package/dist/commonjs/models/components/multicallaction.d.ts +4 -11
  12. package/dist/commonjs/models/components/multicallaction.d.ts.map +1 -1
  13. package/dist/commonjs/models/components/multicallaction.js +0 -35
  14. package/dist/commonjs/models/components/multicallaction.js.map +1 -1
  15. package/dist/commonjs/models/components/multicallactiontype.d.ts +0 -21
  16. package/dist/commonjs/models/components/multicallactiontype.d.ts.map +1 -1
  17. package/dist/commonjs/models/components/multicallactiontype.js +0 -7
  18. package/dist/commonjs/models/components/multicallactiontype.js.map +1 -1
  19. package/dist/esm/lib/config.d.ts +2 -2
  20. package/dist/esm/lib/config.js +2 -2
  21. package/dist/esm/mcp-server/mcp-server.js +1 -1
  22. package/dist/esm/mcp-server/server.js +1 -1
  23. package/dist/esm/models/components/index.d.ts +0 -7
  24. package/dist/esm/models/components/index.d.ts.map +1 -1
  25. package/dist/esm/models/components/index.js +0 -7
  26. package/dist/esm/models/components/index.js.map +1 -1
  27. package/dist/esm/models/components/multicallaction.d.ts +4 -11
  28. package/dist/esm/models/components/multicallaction.d.ts.map +1 -1
  29. package/dist/esm/models/components/multicallaction.js +0 -35
  30. package/dist/esm/models/components/multicallaction.js.map +1 -1
  31. package/dist/esm/models/components/multicallactiontype.d.ts +0 -21
  32. package/dist/esm/models/components/multicallactiontype.d.ts.map +1 -1
  33. package/dist/esm/models/components/multicallactiontype.js +0 -7
  34. package/dist/esm/models/components/multicallactiontype.js.map +1 -1
  35. package/jsr.json +1 -1
  36. package/package.json +1 -1
  37. package/src/lib/config.ts +2 -2
  38. package/src/mcp-server/mcp-server.ts +1 -1
  39. package/src/mcp-server/server.ts +1 -1
  40. package/src/models/components/index.ts +0 -7
  41. package/src/models/components/multicallaction.ts +0 -98
  42. package/src/models/components/multicallactiontype.ts +0 -7
  43. package/dist/commonjs/models/components/aerodromeaddliquidityethparams.d.ts +0 -177
  44. package/dist/commonjs/models/components/aerodromeaddliquidityethparams.d.ts.map +0 -1
  45. package/dist/commonjs/models/components/aerodromeaddliquidityethparams.js +0 -191
  46. package/dist/commonjs/models/components/aerodromeaddliquidityethparams.js.map +0 -1
  47. package/dist/commonjs/models/components/aerodromeaddliquidityparams.d.ts +0 -186
  48. package/dist/commonjs/models/components/aerodromeaddliquidityparams.d.ts.map +0 -1
  49. package/dist/commonjs/models/components/aerodromeaddliquidityparams.js +0 -197
  50. package/dist/commonjs/models/components/aerodromeaddliquidityparams.js.map +0 -1
  51. package/dist/commonjs/models/components/aerodromeremoveliquidityethrequest.d.ts +0 -151
  52. package/dist/commonjs/models/components/aerodromeremoveliquidityethrequest.d.ts.map +0 -1
  53. package/dist/commonjs/models/components/aerodromeremoveliquidityethrequest.js +0 -167
  54. package/dist/commonjs/models/components/aerodromeremoveliquidityethrequest.js.map +0 -1
  55. package/dist/commonjs/models/components/aerodromeremoveliquidityrequest.d.ts +0 -161
  56. package/dist/commonjs/models/components/aerodromeremoveliquidityrequest.d.ts.map +0 -1
  57. package/dist/commonjs/models/components/aerodromeremoveliquidityrequest.js +0 -173
  58. package/dist/commonjs/models/components/aerodromeremoveliquidityrequest.js.map +0 -1
  59. package/dist/commonjs/models/components/aerodromeswapethfortokenparams.d.ts +0 -109
  60. package/dist/commonjs/models/components/aerodromeswapethfortokenparams.d.ts.map +0 -1
  61. package/dist/commonjs/models/components/aerodromeswapethfortokenparams.js +0 -137
  62. package/dist/commonjs/models/components/aerodromeswapethfortokenparams.js.map +0 -1
  63. package/dist/commonjs/models/components/aerodromeswaptokenforethparams.d.ts +0 -109
  64. package/dist/commonjs/models/components/aerodromeswaptokenforethparams.d.ts.map +0 -1
  65. package/dist/commonjs/models/components/aerodromeswaptokenforethparams.js +0 -137
  66. package/dist/commonjs/models/components/aerodromeswaptokenforethparams.js.map +0 -1
  67. package/dist/commonjs/models/components/aerodromeswaptokensparams.d.ts +0 -128
  68. package/dist/commonjs/models/components/aerodromeswaptokensparams.d.ts.map +0 -1
  69. package/dist/commonjs/models/components/aerodromeswaptokensparams.js +0 -141
  70. package/dist/commonjs/models/components/aerodromeswaptokensparams.js.map +0 -1
  71. package/dist/esm/models/components/aerodromeaddliquidityethparams.d.ts +0 -177
  72. package/dist/esm/models/components/aerodromeaddliquidityethparams.d.ts.map +0 -1
  73. package/dist/esm/models/components/aerodromeaddliquidityethparams.js +0 -145
  74. package/dist/esm/models/components/aerodromeaddliquidityethparams.js.map +0 -1
  75. package/dist/esm/models/components/aerodromeaddliquidityparams.d.ts +0 -186
  76. package/dist/esm/models/components/aerodromeaddliquidityparams.d.ts.map +0 -1
  77. package/dist/esm/models/components/aerodromeaddliquidityparams.js +0 -151
  78. package/dist/esm/models/components/aerodromeaddliquidityparams.js.map +0 -1
  79. package/dist/esm/models/components/aerodromeremoveliquidityethrequest.d.ts +0 -151
  80. package/dist/esm/models/components/aerodromeremoveliquidityethrequest.d.ts.map +0 -1
  81. package/dist/esm/models/components/aerodromeremoveliquidityethrequest.js +0 -123
  82. package/dist/esm/models/components/aerodromeremoveliquidityethrequest.js.map +0 -1
  83. package/dist/esm/models/components/aerodromeremoveliquidityrequest.d.ts +0 -161
  84. package/dist/esm/models/components/aerodromeremoveliquidityrequest.d.ts.map +0 -1
  85. package/dist/esm/models/components/aerodromeremoveliquidityrequest.js +0 -129
  86. package/dist/esm/models/components/aerodromeremoveliquidityrequest.js.map +0 -1
  87. package/dist/esm/models/components/aerodromeswapethfortokenparams.d.ts +0 -109
  88. package/dist/esm/models/components/aerodromeswapethfortokenparams.d.ts.map +0 -1
  89. package/dist/esm/models/components/aerodromeswapethfortokenparams.js +0 -95
  90. package/dist/esm/models/components/aerodromeswapethfortokenparams.js.map +0 -1
  91. package/dist/esm/models/components/aerodromeswaptokenforethparams.d.ts +0 -109
  92. package/dist/esm/models/components/aerodromeswaptokenforethparams.d.ts.map +0 -1
  93. package/dist/esm/models/components/aerodromeswaptokenforethparams.js +0 -95
  94. package/dist/esm/models/components/aerodromeswaptokenforethparams.js.map +0 -1
  95. package/dist/esm/models/components/aerodromeswaptokensparams.d.ts +0 -128
  96. package/dist/esm/models/components/aerodromeswaptokensparams.d.ts.map +0 -1
  97. package/dist/esm/models/components/aerodromeswaptokensparams.js +0 -99
  98. package/dist/esm/models/components/aerodromeswaptokensparams.js.map +0 -1
  99. package/src/models/components/aerodromeaddliquidityethparams.ts +0 -392
  100. package/src/models/components/aerodromeaddliquidityparams.ts +0 -382
  101. package/src/models/components/aerodromeremoveliquidityethrequest.ts +0 -357
  102. package/src/models/components/aerodromeremoveliquidityrequest.ts +0 -363
  103. package/src/models/components/aerodromeswapethfortokenparams.ts +0 -249
  104. package/src/models/components/aerodromeswaptokenforethparams.ts +0 -249
  105. package/src/models/components/aerodromeswaptokensparams.ts +0 -260
@@ -1,363 +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 { 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 amount of liquidity you want to remove
19
- */
20
- export type AerodromeRemoveLiquidityRequestLiquidity = number | string;
21
-
22
- /**
23
- * The minimal amount of token A you are willing to receive
24
- */
25
- export type AerodromeRemoveLiquidityRequestAmountAMin = number | string;
26
-
27
- /**
28
- * The minimal amount of token B you are willing to receive
29
- */
30
- export type AerodromeRemoveLiquidityRequestAmountBMin = number | string;
31
-
32
- export type AerodromeRemoveLiquidityRequest = {
33
- /**
34
- * The chain to use.
35
- */
36
- chain: Chain;
37
- /**
38
- * The address of the transaction sender.
39
- */
40
- sender: string;
41
- /**
42
- * A class representing the token.
43
- *
44
- * @remarks
45
- *
46
- * This class is used to represent the token in the system. Notice individual
47
- * endpoints' documentation where per chain tokens are presented.
48
- */
49
- tokenA: TokenEnum;
50
- /**
51
- * A class representing the token.
52
- *
53
- * @remarks
54
- *
55
- * This class is used to represent the token in the system. Notice individual
56
- * endpoints' documentation where per chain tokens are presented.
57
- */
58
- tokenB: TokenEnum;
59
- /**
60
- * If true, try to remove liquidity from a stable pool with a bonding curve of K=x^3y+y^3x. If false, try to remove liquidity from a volatile pool with a bonding curve of K=xy
61
- */
62
- stable: boolean;
63
- /**
64
- * The amount of liquidity you want to remove
65
- */
66
- liquidity: number | string;
67
- /**
68
- * The minimal amount of token A you are willing to receive
69
- */
70
- amountAMin: number | string;
71
- /**
72
- * The minimal amount of token B you are willing to receive
73
- */
74
- amountBMin: number | string;
75
- /**
76
- * The receiver of the tokens from this liquidity removal, default to sender
77
- */
78
- to?: string | null | undefined;
79
- /**
80
- * The deadline for this transaction in seconds since epoch
81
- */
82
- deadline: number | null;
83
- };
84
-
85
- /** @internal */
86
- export const AerodromeRemoveLiquidityRequestLiquidity$inboundSchema: z.ZodType<
87
- AerodromeRemoveLiquidityRequestLiquidity,
88
- z.ZodTypeDef,
89
- unknown
90
- > = z.union([z.number(), z.string()]);
91
-
92
- /** @internal */
93
- export type AerodromeRemoveLiquidityRequestLiquidity$Outbound = number | string;
94
-
95
- /** @internal */
96
- export const AerodromeRemoveLiquidityRequestLiquidity$outboundSchema: z.ZodType<
97
- AerodromeRemoveLiquidityRequestLiquidity$Outbound,
98
- z.ZodTypeDef,
99
- AerodromeRemoveLiquidityRequestLiquidity
100
- > = z.union([z.number(), z.string()]);
101
-
102
- /**
103
- * @internal
104
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
105
- */
106
- export namespace AerodromeRemoveLiquidityRequestLiquidity$ {
107
- /** @deprecated use `AerodromeRemoveLiquidityRequestLiquidity$inboundSchema` instead. */
108
- export const inboundSchema =
109
- AerodromeRemoveLiquidityRequestLiquidity$inboundSchema;
110
- /** @deprecated use `AerodromeRemoveLiquidityRequestLiquidity$outboundSchema` instead. */
111
- export const outboundSchema =
112
- AerodromeRemoveLiquidityRequestLiquidity$outboundSchema;
113
- /** @deprecated use `AerodromeRemoveLiquidityRequestLiquidity$Outbound` instead. */
114
- export type Outbound = AerodromeRemoveLiquidityRequestLiquidity$Outbound;
115
- }
116
-
117
- export function aerodromeRemoveLiquidityRequestLiquidityToJSON(
118
- aerodromeRemoveLiquidityRequestLiquidity:
119
- AerodromeRemoveLiquidityRequestLiquidity,
120
- ): string {
121
- return JSON.stringify(
122
- AerodromeRemoveLiquidityRequestLiquidity$outboundSchema.parse(
123
- aerodromeRemoveLiquidityRequestLiquidity,
124
- ),
125
- );
126
- }
127
-
128
- export function aerodromeRemoveLiquidityRequestLiquidityFromJSON(
129
- jsonString: string,
130
- ): SafeParseResult<
131
- AerodromeRemoveLiquidityRequestLiquidity,
132
- SDKValidationError
133
- > {
134
- return safeParse(
135
- jsonString,
136
- (x) =>
137
- AerodromeRemoveLiquidityRequestLiquidity$inboundSchema.parse(
138
- JSON.parse(x),
139
- ),
140
- `Failed to parse 'AerodromeRemoveLiquidityRequestLiquidity' from JSON`,
141
- );
142
- }
143
-
144
- /** @internal */
145
- export const AerodromeRemoveLiquidityRequestAmountAMin$inboundSchema: z.ZodType<
146
- AerodromeRemoveLiquidityRequestAmountAMin,
147
- z.ZodTypeDef,
148
- unknown
149
- > = z.union([z.number(), z.string()]);
150
-
151
- /** @internal */
152
- export type AerodromeRemoveLiquidityRequestAmountAMin$Outbound =
153
- | number
154
- | string;
155
-
156
- /** @internal */
157
- export const AerodromeRemoveLiquidityRequestAmountAMin$outboundSchema:
158
- z.ZodType<
159
- AerodromeRemoveLiquidityRequestAmountAMin$Outbound,
160
- z.ZodTypeDef,
161
- AerodromeRemoveLiquidityRequestAmountAMin
162
- > = z.union([z.number(), z.string()]);
163
-
164
- /**
165
- * @internal
166
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
167
- */
168
- export namespace AerodromeRemoveLiquidityRequestAmountAMin$ {
169
- /** @deprecated use `AerodromeRemoveLiquidityRequestAmountAMin$inboundSchema` instead. */
170
- export const inboundSchema =
171
- AerodromeRemoveLiquidityRequestAmountAMin$inboundSchema;
172
- /** @deprecated use `AerodromeRemoveLiquidityRequestAmountAMin$outboundSchema` instead. */
173
- export const outboundSchema =
174
- AerodromeRemoveLiquidityRequestAmountAMin$outboundSchema;
175
- /** @deprecated use `AerodromeRemoveLiquidityRequestAmountAMin$Outbound` instead. */
176
- export type Outbound = AerodromeRemoveLiquidityRequestAmountAMin$Outbound;
177
- }
178
-
179
- export function aerodromeRemoveLiquidityRequestAmountAMinToJSON(
180
- aerodromeRemoveLiquidityRequestAmountAMin:
181
- AerodromeRemoveLiquidityRequestAmountAMin,
182
- ): string {
183
- return JSON.stringify(
184
- AerodromeRemoveLiquidityRequestAmountAMin$outboundSchema.parse(
185
- aerodromeRemoveLiquidityRequestAmountAMin,
186
- ),
187
- );
188
- }
189
-
190
- export function aerodromeRemoveLiquidityRequestAmountAMinFromJSON(
191
- jsonString: string,
192
- ): SafeParseResult<
193
- AerodromeRemoveLiquidityRequestAmountAMin,
194
- SDKValidationError
195
- > {
196
- return safeParse(
197
- jsonString,
198
- (x) =>
199
- AerodromeRemoveLiquidityRequestAmountAMin$inboundSchema.parse(
200
- JSON.parse(x),
201
- ),
202
- `Failed to parse 'AerodromeRemoveLiquidityRequestAmountAMin' from JSON`,
203
- );
204
- }
205
-
206
- /** @internal */
207
- export const AerodromeRemoveLiquidityRequestAmountBMin$inboundSchema: z.ZodType<
208
- AerodromeRemoveLiquidityRequestAmountBMin,
209
- z.ZodTypeDef,
210
- unknown
211
- > = z.union([z.number(), z.string()]);
212
-
213
- /** @internal */
214
- export type AerodromeRemoveLiquidityRequestAmountBMin$Outbound =
215
- | number
216
- | string;
217
-
218
- /** @internal */
219
- export const AerodromeRemoveLiquidityRequestAmountBMin$outboundSchema:
220
- z.ZodType<
221
- AerodromeRemoveLiquidityRequestAmountBMin$Outbound,
222
- z.ZodTypeDef,
223
- AerodromeRemoveLiquidityRequestAmountBMin
224
- > = z.union([z.number(), z.string()]);
225
-
226
- /**
227
- * @internal
228
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
229
- */
230
- export namespace AerodromeRemoveLiquidityRequestAmountBMin$ {
231
- /** @deprecated use `AerodromeRemoveLiquidityRequestAmountBMin$inboundSchema` instead. */
232
- export const inboundSchema =
233
- AerodromeRemoveLiquidityRequestAmountBMin$inboundSchema;
234
- /** @deprecated use `AerodromeRemoveLiquidityRequestAmountBMin$outboundSchema` instead. */
235
- export const outboundSchema =
236
- AerodromeRemoveLiquidityRequestAmountBMin$outboundSchema;
237
- /** @deprecated use `AerodromeRemoveLiquidityRequestAmountBMin$Outbound` instead. */
238
- export type Outbound = AerodromeRemoveLiquidityRequestAmountBMin$Outbound;
239
- }
240
-
241
- export function aerodromeRemoveLiquidityRequestAmountBMinToJSON(
242
- aerodromeRemoveLiquidityRequestAmountBMin:
243
- AerodromeRemoveLiquidityRequestAmountBMin,
244
- ): string {
245
- return JSON.stringify(
246
- AerodromeRemoveLiquidityRequestAmountBMin$outboundSchema.parse(
247
- aerodromeRemoveLiquidityRequestAmountBMin,
248
- ),
249
- );
250
- }
251
-
252
- export function aerodromeRemoveLiquidityRequestAmountBMinFromJSON(
253
- jsonString: string,
254
- ): SafeParseResult<
255
- AerodromeRemoveLiquidityRequestAmountBMin,
256
- SDKValidationError
257
- > {
258
- return safeParse(
259
- jsonString,
260
- (x) =>
261
- AerodromeRemoveLiquidityRequestAmountBMin$inboundSchema.parse(
262
- JSON.parse(x),
263
- ),
264
- `Failed to parse 'AerodromeRemoveLiquidityRequestAmountBMin' from JSON`,
265
- );
266
- }
267
-
268
- /** @internal */
269
- export const AerodromeRemoveLiquidityRequest$inboundSchema: z.ZodType<
270
- AerodromeRemoveLiquidityRequest,
271
- z.ZodTypeDef,
272
- unknown
273
- > = z.object({
274
- chain: Chain$inboundSchema,
275
- sender: z.string(),
276
- token_a: TokenEnum$inboundSchema,
277
- token_b: TokenEnum$inboundSchema,
278
- stable: z.boolean(),
279
- liquidity: z.union([z.number(), z.string()]),
280
- amount_a_min: z.union([z.number(), z.string()]),
281
- amount_b_min: z.union([z.number(), z.string()]),
282
- to: z.nullable(z.string()).optional(),
283
- deadline: z.nullable(z.number().int()),
284
- }).transform((v) => {
285
- return remap$(v, {
286
- "token_a": "tokenA",
287
- "token_b": "tokenB",
288
- "amount_a_min": "amountAMin",
289
- "amount_b_min": "amountBMin",
290
- });
291
- });
292
-
293
- /** @internal */
294
- export type AerodromeRemoveLiquidityRequest$Outbound = {
295
- chain: string;
296
- sender: string;
297
- token_a: string;
298
- token_b: string;
299
- stable: boolean;
300
- liquidity: number | string;
301
- amount_a_min: number | string;
302
- amount_b_min: number | string;
303
- to?: string | null | undefined;
304
- deadline: number | null;
305
- };
306
-
307
- /** @internal */
308
- export const AerodromeRemoveLiquidityRequest$outboundSchema: z.ZodType<
309
- AerodromeRemoveLiquidityRequest$Outbound,
310
- z.ZodTypeDef,
311
- AerodromeRemoveLiquidityRequest
312
- > = z.object({
313
- chain: Chain$outboundSchema,
314
- sender: z.string(),
315
- tokenA: TokenEnum$outboundSchema,
316
- tokenB: TokenEnum$outboundSchema,
317
- stable: z.boolean(),
318
- liquidity: z.union([z.number(), z.string()]),
319
- amountAMin: z.union([z.number(), z.string()]),
320
- amountBMin: z.union([z.number(), z.string()]),
321
- to: z.nullable(z.string()).optional(),
322
- deadline: z.nullable(z.number().int()),
323
- }).transform((v) => {
324
- return remap$(v, {
325
- tokenA: "token_a",
326
- tokenB: "token_b",
327
- amountAMin: "amount_a_min",
328
- amountBMin: "amount_b_min",
329
- });
330
- });
331
-
332
- /**
333
- * @internal
334
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
335
- */
336
- export namespace AerodromeRemoveLiquidityRequest$ {
337
- /** @deprecated use `AerodromeRemoveLiquidityRequest$inboundSchema` instead. */
338
- export const inboundSchema = AerodromeRemoveLiquidityRequest$inboundSchema;
339
- /** @deprecated use `AerodromeRemoveLiquidityRequest$outboundSchema` instead. */
340
- export const outboundSchema = AerodromeRemoveLiquidityRequest$outboundSchema;
341
- /** @deprecated use `AerodromeRemoveLiquidityRequest$Outbound` instead. */
342
- export type Outbound = AerodromeRemoveLiquidityRequest$Outbound;
343
- }
344
-
345
- export function aerodromeRemoveLiquidityRequestToJSON(
346
- aerodromeRemoveLiquidityRequest: AerodromeRemoveLiquidityRequest,
347
- ): string {
348
- return JSON.stringify(
349
- AerodromeRemoveLiquidityRequest$outboundSchema.parse(
350
- aerodromeRemoveLiquidityRequest,
351
- ),
352
- );
353
- }
354
-
355
- export function aerodromeRemoveLiquidityRequestFromJSON(
356
- jsonString: string,
357
- ): SafeParseResult<AerodromeRemoveLiquidityRequest, SDKValidationError> {
358
- return safeParse(
359
- jsonString,
360
- (x) => AerodromeRemoveLiquidityRequest$inboundSchema.parse(JSON.parse(x)),
361
- `Failed to parse 'AerodromeRemoveLiquidityRequest' from JSON`,
362
- );
363
- }
@@ -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 ETH you will give to aerodrome_basic for this trade
18
- */
19
- export type AerodromeSwapEthForTokenParamsAmountIn = number | string;
20
-
21
- /**
22
- * The minimal amount of token you are willing to receive (will revert if the swap gives you less)
23
- */
24
- export type AerodromeSwapEthForTokenParamsAmountOutMin = number | string;
25
-
26
- /**
27
- * Parameters model for swapping ETH for tokens.
28
- */
29
- export type AerodromeSwapEthForTokenParams = {
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
- tokenOut: TokenEnum;
39
- /**
40
- * The amount of ETH you will give to aerodrome_basic for this trade
41
- */
42
- amountIn: number | string;
43
- /**
44
- * The minimal amount of token 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 AerodromeSwapEthForTokenParamsAmountIn$inboundSchema: z.ZodType<
59
- AerodromeSwapEthForTokenParamsAmountIn,
60
- z.ZodTypeDef,
61
- unknown
62
- > = z.union([z.number(), z.string()]);
63
-
64
- /** @internal */
65
- export type AerodromeSwapEthForTokenParamsAmountIn$Outbound = number | string;
66
-
67
- /** @internal */
68
- export const AerodromeSwapEthForTokenParamsAmountIn$outboundSchema: z.ZodType<
69
- AerodromeSwapEthForTokenParamsAmountIn$Outbound,
70
- z.ZodTypeDef,
71
- AerodromeSwapEthForTokenParamsAmountIn
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 AerodromeSwapEthForTokenParamsAmountIn$ {
79
- /** @deprecated use `AerodromeSwapEthForTokenParamsAmountIn$inboundSchema` instead. */
80
- export const inboundSchema =
81
- AerodromeSwapEthForTokenParamsAmountIn$inboundSchema;
82
- /** @deprecated use `AerodromeSwapEthForTokenParamsAmountIn$outboundSchema` instead. */
83
- export const outboundSchema =
84
- AerodromeSwapEthForTokenParamsAmountIn$outboundSchema;
85
- /** @deprecated use `AerodromeSwapEthForTokenParamsAmountIn$Outbound` instead. */
86
- export type Outbound = AerodromeSwapEthForTokenParamsAmountIn$Outbound;
87
- }
88
-
89
- export function aerodromeSwapEthForTokenParamsAmountInToJSON(
90
- aerodromeSwapEthForTokenParamsAmountIn:
91
- AerodromeSwapEthForTokenParamsAmountIn,
92
- ): string {
93
- return JSON.stringify(
94
- AerodromeSwapEthForTokenParamsAmountIn$outboundSchema.parse(
95
- aerodromeSwapEthForTokenParamsAmountIn,
96
- ),
97
- );
98
- }
99
-
100
- export function aerodromeSwapEthForTokenParamsAmountInFromJSON(
101
- jsonString: string,
102
- ): SafeParseResult<AerodromeSwapEthForTokenParamsAmountIn, SDKValidationError> {
103
- return safeParse(
104
- jsonString,
105
- (x) =>
106
- AerodromeSwapEthForTokenParamsAmountIn$inboundSchema.parse(JSON.parse(x)),
107
- `Failed to parse 'AerodromeSwapEthForTokenParamsAmountIn' from JSON`,
108
- );
109
- }
110
-
111
- /** @internal */
112
- export const AerodromeSwapEthForTokenParamsAmountOutMin$inboundSchema:
113
- z.ZodType<AerodromeSwapEthForTokenParamsAmountOutMin, z.ZodTypeDef, unknown> =
114
- z.union([z.number(), z.string()]);
115
-
116
- /** @internal */
117
- export type AerodromeSwapEthForTokenParamsAmountOutMin$Outbound =
118
- | number
119
- | string;
120
-
121
- /** @internal */
122
- export const AerodromeSwapEthForTokenParamsAmountOutMin$outboundSchema:
123
- z.ZodType<
124
- AerodromeSwapEthForTokenParamsAmountOutMin$Outbound,
125
- z.ZodTypeDef,
126
- AerodromeSwapEthForTokenParamsAmountOutMin
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 AerodromeSwapEthForTokenParamsAmountOutMin$ {
134
- /** @deprecated use `AerodromeSwapEthForTokenParamsAmountOutMin$inboundSchema` instead. */
135
- export const inboundSchema =
136
- AerodromeSwapEthForTokenParamsAmountOutMin$inboundSchema;
137
- /** @deprecated use `AerodromeSwapEthForTokenParamsAmountOutMin$outboundSchema` instead. */
138
- export const outboundSchema =
139
- AerodromeSwapEthForTokenParamsAmountOutMin$outboundSchema;
140
- /** @deprecated use `AerodromeSwapEthForTokenParamsAmountOutMin$Outbound` instead. */
141
- export type Outbound = AerodromeSwapEthForTokenParamsAmountOutMin$Outbound;
142
- }
143
-
144
- export function aerodromeSwapEthForTokenParamsAmountOutMinToJSON(
145
- aerodromeSwapEthForTokenParamsAmountOutMin:
146
- AerodromeSwapEthForTokenParamsAmountOutMin,
147
- ): string {
148
- return JSON.stringify(
149
- AerodromeSwapEthForTokenParamsAmountOutMin$outboundSchema.parse(
150
- aerodromeSwapEthForTokenParamsAmountOutMin,
151
- ),
152
- );
153
- }
154
-
155
- export function aerodromeSwapEthForTokenParamsAmountOutMinFromJSON(
156
- jsonString: string,
157
- ): SafeParseResult<
158
- AerodromeSwapEthForTokenParamsAmountOutMin,
159
- SDKValidationError
160
- > {
161
- return safeParse(
162
- jsonString,
163
- (x) =>
164
- AerodromeSwapEthForTokenParamsAmountOutMin$inboundSchema.parse(
165
- JSON.parse(x),
166
- ),
167
- `Failed to parse 'AerodromeSwapEthForTokenParamsAmountOutMin' from JSON`,
168
- );
169
- }
170
-
171
- /** @internal */
172
- export const AerodromeSwapEthForTokenParams$inboundSchema: z.ZodType<
173
- AerodromeSwapEthForTokenParams,
174
- z.ZodTypeDef,
175
- unknown
176
- > = z.object({
177
- token_out: 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_out": "tokenOut",
185
- "amount_in": "amountIn",
186
- "amount_out_min": "amountOutMin",
187
- });
188
- });
189
-
190
- /** @internal */
191
- export type AerodromeSwapEthForTokenParams$Outbound = {
192
- token_out: 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 AerodromeSwapEthForTokenParams$outboundSchema: z.ZodType<
201
- AerodromeSwapEthForTokenParams$Outbound,
202
- z.ZodTypeDef,
203
- AerodromeSwapEthForTokenParams
204
- > = z.object({
205
- tokenOut: 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
- tokenOut: "token_out",
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 AerodromeSwapEthForTokenParams$ {
223
- /** @deprecated use `AerodromeSwapEthForTokenParams$inboundSchema` instead. */
224
- export const inboundSchema = AerodromeSwapEthForTokenParams$inboundSchema;
225
- /** @deprecated use `AerodromeSwapEthForTokenParams$outboundSchema` instead. */
226
- export const outboundSchema = AerodromeSwapEthForTokenParams$outboundSchema;
227
- /** @deprecated use `AerodromeSwapEthForTokenParams$Outbound` instead. */
228
- export type Outbound = AerodromeSwapEthForTokenParams$Outbound;
229
- }
230
-
231
- export function aerodromeSwapEthForTokenParamsToJSON(
232
- aerodromeSwapEthForTokenParams: AerodromeSwapEthForTokenParams,
233
- ): string {
234
- return JSON.stringify(
235
- AerodromeSwapEthForTokenParams$outboundSchema.parse(
236
- aerodromeSwapEthForTokenParams,
237
- ),
238
- );
239
- }
240
-
241
- export function aerodromeSwapEthForTokenParamsFromJSON(
242
- jsonString: string,
243
- ): SafeParseResult<AerodromeSwapEthForTokenParams, SDKValidationError> {
244
- return safeParse(
245
- jsonString,
246
- (x) => AerodromeSwapEthForTokenParams$inboundSchema.parse(JSON.parse(x)),
247
- `Failed to parse 'AerodromeSwapEthForTokenParams' from JSON`,
248
- );
249
- }