@compass-labs/api-sdk 0.5.57 → 0.5.58

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 (97) hide show
  1. package/bin/mcp-server.js +209 -105
  2. package/bin/mcp-server.js.map +14 -14
  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/pendleaddliquidityparams.d.ts +47 -17
  8. package/dist/commonjs/models/components/pendleaddliquidityparams.d.ts.map +1 -1
  9. package/dist/commonjs/models/components/pendleaddliquidityparams.js +48 -18
  10. package/dist/commonjs/models/components/pendleaddliquidityparams.js.map +1 -1
  11. package/dist/commonjs/models/components/pendleaddliquidityrequest.d.ts +47 -17
  12. package/dist/commonjs/models/components/pendleaddliquidityrequest.d.ts.map +1 -1
  13. package/dist/commonjs/models/components/pendleaddliquidityrequest.js +48 -18
  14. package/dist/commonjs/models/components/pendleaddliquidityrequest.js.map +1 -1
  15. package/dist/commonjs/models/components/pendleremoveliquidityparams.d.ts +47 -17
  16. package/dist/commonjs/models/components/pendleremoveliquidityparams.d.ts.map +1 -1
  17. package/dist/commonjs/models/components/pendleremoveliquidityparams.js +48 -18
  18. package/dist/commonjs/models/components/pendleremoveliquidityparams.js.map +1 -1
  19. package/dist/commonjs/models/components/pendleremoveliquidityrequest.d.ts +47 -17
  20. package/dist/commonjs/models/components/pendleremoveliquidityrequest.d.ts.map +1 -1
  21. package/dist/commonjs/models/components/pendleremoveliquidityrequest.js +48 -18
  22. package/dist/commonjs/models/components/pendleremoveliquidityrequest.js.map +1 -1
  23. package/dist/commonjs/models/components/pendlesellptparams.d.ts +47 -17
  24. package/dist/commonjs/models/components/pendlesellptparams.d.ts.map +1 -1
  25. package/dist/commonjs/models/components/pendlesellptparams.js +48 -18
  26. package/dist/commonjs/models/components/pendlesellptparams.js.map +1 -1
  27. package/dist/commonjs/models/components/pendlesellptrequest.d.ts +47 -17
  28. package/dist/commonjs/models/components/pendlesellptrequest.d.ts.map +1 -1
  29. package/dist/commonjs/models/components/pendlesellptrequest.js +48 -18
  30. package/dist/commonjs/models/components/pendlesellptrequest.js.map +1 -1
  31. package/dist/commonjs/models/components/pendlesellytparams.d.ts +47 -17
  32. package/dist/commonjs/models/components/pendlesellytparams.d.ts.map +1 -1
  33. package/dist/commonjs/models/components/pendlesellytparams.js +48 -18
  34. package/dist/commonjs/models/components/pendlesellytparams.js.map +1 -1
  35. package/dist/commonjs/models/components/pendlesellytrequest.d.ts +47 -17
  36. package/dist/commonjs/models/components/pendlesellytrequest.d.ts.map +1 -1
  37. package/dist/commonjs/models/components/pendlesellytrequest.js +48 -18
  38. package/dist/commonjs/models/components/pendlesellytrequest.js.map +1 -1
  39. package/dist/commonjs/models/components/useroperation.d.ts +32 -32
  40. package/dist/commonjs/models/components/useroperation.d.ts.map +1 -1
  41. package/dist/commonjs/models/components/useroperation.js +28 -28
  42. package/dist/commonjs/models/components/useroperation.js.map +1 -1
  43. package/dist/esm/lib/config.d.ts +2 -2
  44. package/dist/esm/lib/config.js +2 -2
  45. package/dist/esm/mcp-server/mcp-server.js +1 -1
  46. package/dist/esm/mcp-server/server.js +1 -1
  47. package/dist/esm/models/components/pendleaddliquidityparams.d.ts +47 -17
  48. package/dist/esm/models/components/pendleaddliquidityparams.d.ts.map +1 -1
  49. package/dist/esm/models/components/pendleaddliquidityparams.js +43 -15
  50. package/dist/esm/models/components/pendleaddliquidityparams.js.map +1 -1
  51. package/dist/esm/models/components/pendleaddliquidityrequest.d.ts +47 -17
  52. package/dist/esm/models/components/pendleaddliquidityrequest.d.ts.map +1 -1
  53. package/dist/esm/models/components/pendleaddliquidityrequest.js +43 -15
  54. package/dist/esm/models/components/pendleaddliquidityrequest.js.map +1 -1
  55. package/dist/esm/models/components/pendleremoveliquidityparams.d.ts +47 -17
  56. package/dist/esm/models/components/pendleremoveliquidityparams.d.ts.map +1 -1
  57. package/dist/esm/models/components/pendleremoveliquidityparams.js +43 -15
  58. package/dist/esm/models/components/pendleremoveliquidityparams.js.map +1 -1
  59. package/dist/esm/models/components/pendleremoveliquidityrequest.d.ts +47 -17
  60. package/dist/esm/models/components/pendleremoveliquidityrequest.d.ts.map +1 -1
  61. package/dist/esm/models/components/pendleremoveliquidityrequest.js +43 -15
  62. package/dist/esm/models/components/pendleremoveliquidityrequest.js.map +1 -1
  63. package/dist/esm/models/components/pendlesellptparams.d.ts +47 -17
  64. package/dist/esm/models/components/pendlesellptparams.d.ts.map +1 -1
  65. package/dist/esm/models/components/pendlesellptparams.js +43 -15
  66. package/dist/esm/models/components/pendlesellptparams.js.map +1 -1
  67. package/dist/esm/models/components/pendlesellptrequest.d.ts +47 -17
  68. package/dist/esm/models/components/pendlesellptrequest.d.ts.map +1 -1
  69. package/dist/esm/models/components/pendlesellptrequest.js +43 -15
  70. package/dist/esm/models/components/pendlesellptrequest.js.map +1 -1
  71. package/dist/esm/models/components/pendlesellytparams.d.ts +47 -17
  72. package/dist/esm/models/components/pendlesellytparams.d.ts.map +1 -1
  73. package/dist/esm/models/components/pendlesellytparams.js +43 -15
  74. package/dist/esm/models/components/pendlesellytparams.js.map +1 -1
  75. package/dist/esm/models/components/pendlesellytrequest.d.ts +47 -17
  76. package/dist/esm/models/components/pendlesellytrequest.d.ts.map +1 -1
  77. package/dist/esm/models/components/pendlesellytrequest.js +43 -15
  78. package/dist/esm/models/components/pendlesellytrequest.js.map +1 -1
  79. package/dist/esm/models/components/useroperation.d.ts +32 -32
  80. package/dist/esm/models/components/useroperation.d.ts.map +1 -1
  81. package/dist/esm/models/components/useroperation.js +28 -28
  82. package/dist/esm/models/components/useroperation.js.map +1 -1
  83. package/docs/sdks/pendle/README.md +16 -8
  84. package/jsr.json +1 -1
  85. package/package.json +1 -1
  86. package/src/lib/config.ts +2 -2
  87. package/src/mcp-server/mcp-server.ts +1 -1
  88. package/src/mcp-server/server.ts +1 -1
  89. package/src/models/components/pendleaddliquidityparams.ts +99 -28
  90. package/src/models/components/pendleaddliquidityrequest.ts +100 -28
  91. package/src/models/components/pendleremoveliquidityparams.ts +104 -28
  92. package/src/models/components/pendleremoveliquidityrequest.ts +103 -28
  93. package/src/models/components/pendlesellptparams.ts +96 -27
  94. package/src/models/components/pendlesellptrequest.ts +100 -27
  95. package/src/models/components/pendlesellytparams.ts +96 -27
  96. package/src/models/components/pendlesellytrequest.ts +100 -27
  97. package/src/models/components/useroperation.ts +98 -98
@@ -8,11 +8,21 @@ import { safeParse } from "../../lib/schemas.js";
8
8
  import { ClosedEnum } from "../../types/enums.js";
9
9
  import { Result as SafeParseResult } from "../../types/fp.js";
10
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+ import {
12
+ TokenEnum,
13
+ TokenEnum$inboundSchema,
14
+ TokenEnum$outboundSchema,
15
+ } from "./tokenenum.js";
11
16
 
12
17
  /**
13
- * The amount of liquidity you would like to remove from the market denominated in the market's Liquidity Provider Token (LP).
18
+ * The symbol or address of the token to buy with market's Liquidity Provider Token (LP).
14
19
  */
15
- export type PendleRemoveLiquidityRequestAmount = number | string;
20
+ export type PendleRemoveLiquidityRequestTokenOut = TokenEnum | string;
21
+
22
+ /**
23
+ * The amount of liquidity you would like to remove from the market by selling market's Liquidity Provider Token (LP) for 'token_out'.
24
+ */
25
+ export type PendleRemoveLiquidityRequestAmountIn = number | string;
16
26
 
17
27
  export const PendleRemoveLiquidityRequestChain = {
18
28
  ArbitrumMainnet: "arbitrum:mainnet",
@@ -30,9 +40,13 @@ export type PendleRemoveLiquidityRequest = {
30
40
  */
31
41
  marketAddress: string;
32
42
  /**
33
- * The amount of liquidity you would like to remove from the market denominated in the market's Liquidity Provider Token (LP).
43
+ * The symbol or address of the token to buy with market's Liquidity Provider Token (LP).
44
+ */
45
+ tokenOut: TokenEnum | string;
46
+ /**
47
+ * The amount of liquidity you would like to remove from the market by selling market's Liquidity Provider Token (LP) for 'token_out'.
34
48
  */
35
- amount: number | string;
49
+ amountIn: number | string;
36
50
  /**
37
51
  * The maximum slippage allowed in percent. e.g. `1` means `1%` slippage allowed.
38
52
  */
@@ -45,54 +59,108 @@ export type PendleRemoveLiquidityRequest = {
45
59
  };
46
60
 
47
61
  /** @internal */
48
- export const PendleRemoveLiquidityRequestAmount$inboundSchema: z.ZodType<
49
- PendleRemoveLiquidityRequestAmount,
62
+ export const PendleRemoveLiquidityRequestTokenOut$inboundSchema: z.ZodType<
63
+ PendleRemoveLiquidityRequestTokenOut,
64
+ z.ZodTypeDef,
65
+ unknown
66
+ > = z.union([TokenEnum$inboundSchema, z.string()]);
67
+
68
+ /** @internal */
69
+ export type PendleRemoveLiquidityRequestTokenOut$Outbound = string | string;
70
+
71
+ /** @internal */
72
+ export const PendleRemoveLiquidityRequestTokenOut$outboundSchema: z.ZodType<
73
+ PendleRemoveLiquidityRequestTokenOut$Outbound,
74
+ z.ZodTypeDef,
75
+ PendleRemoveLiquidityRequestTokenOut
76
+ > = z.union([TokenEnum$outboundSchema, z.string()]);
77
+
78
+ /**
79
+ * @internal
80
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
81
+ */
82
+ export namespace PendleRemoveLiquidityRequestTokenOut$ {
83
+ /** @deprecated use `PendleRemoveLiquidityRequestTokenOut$inboundSchema` instead. */
84
+ export const inboundSchema =
85
+ PendleRemoveLiquidityRequestTokenOut$inboundSchema;
86
+ /** @deprecated use `PendleRemoveLiquidityRequestTokenOut$outboundSchema` instead. */
87
+ export const outboundSchema =
88
+ PendleRemoveLiquidityRequestTokenOut$outboundSchema;
89
+ /** @deprecated use `PendleRemoveLiquidityRequestTokenOut$Outbound` instead. */
90
+ export type Outbound = PendleRemoveLiquidityRequestTokenOut$Outbound;
91
+ }
92
+
93
+ export function pendleRemoveLiquidityRequestTokenOutToJSON(
94
+ pendleRemoveLiquidityRequestTokenOut: PendleRemoveLiquidityRequestTokenOut,
95
+ ): string {
96
+ return JSON.stringify(
97
+ PendleRemoveLiquidityRequestTokenOut$outboundSchema.parse(
98
+ pendleRemoveLiquidityRequestTokenOut,
99
+ ),
100
+ );
101
+ }
102
+
103
+ export function pendleRemoveLiquidityRequestTokenOutFromJSON(
104
+ jsonString: string,
105
+ ): SafeParseResult<PendleRemoveLiquidityRequestTokenOut, SDKValidationError> {
106
+ return safeParse(
107
+ jsonString,
108
+ (x) =>
109
+ PendleRemoveLiquidityRequestTokenOut$inboundSchema.parse(JSON.parse(x)),
110
+ `Failed to parse 'PendleRemoveLiquidityRequestTokenOut' from JSON`,
111
+ );
112
+ }
113
+
114
+ /** @internal */
115
+ export const PendleRemoveLiquidityRequestAmountIn$inboundSchema: z.ZodType<
116
+ PendleRemoveLiquidityRequestAmountIn,
50
117
  z.ZodTypeDef,
51
118
  unknown
52
119
  > = z.union([z.number(), z.string()]);
53
120
 
54
121
  /** @internal */
55
- export type PendleRemoveLiquidityRequestAmount$Outbound = number | string;
122
+ export type PendleRemoveLiquidityRequestAmountIn$Outbound = number | string;
56
123
 
57
124
  /** @internal */
58
- export const PendleRemoveLiquidityRequestAmount$outboundSchema: z.ZodType<
59
- PendleRemoveLiquidityRequestAmount$Outbound,
125
+ export const PendleRemoveLiquidityRequestAmountIn$outboundSchema: z.ZodType<
126
+ PendleRemoveLiquidityRequestAmountIn$Outbound,
60
127
  z.ZodTypeDef,
61
- PendleRemoveLiquidityRequestAmount
128
+ PendleRemoveLiquidityRequestAmountIn
62
129
  > = z.union([z.number(), z.string()]);
63
130
 
64
131
  /**
65
132
  * @internal
66
133
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
67
134
  */
68
- export namespace PendleRemoveLiquidityRequestAmount$ {
69
- /** @deprecated use `PendleRemoveLiquidityRequestAmount$inboundSchema` instead. */
70
- export const inboundSchema = PendleRemoveLiquidityRequestAmount$inboundSchema;
71
- /** @deprecated use `PendleRemoveLiquidityRequestAmount$outboundSchema` instead. */
135
+ export namespace PendleRemoveLiquidityRequestAmountIn$ {
136
+ /** @deprecated use `PendleRemoveLiquidityRequestAmountIn$inboundSchema` instead. */
137
+ export const inboundSchema =
138
+ PendleRemoveLiquidityRequestAmountIn$inboundSchema;
139
+ /** @deprecated use `PendleRemoveLiquidityRequestAmountIn$outboundSchema` instead. */
72
140
  export const outboundSchema =
73
- PendleRemoveLiquidityRequestAmount$outboundSchema;
74
- /** @deprecated use `PendleRemoveLiquidityRequestAmount$Outbound` instead. */
75
- export type Outbound = PendleRemoveLiquidityRequestAmount$Outbound;
141
+ PendleRemoveLiquidityRequestAmountIn$outboundSchema;
142
+ /** @deprecated use `PendleRemoveLiquidityRequestAmountIn$Outbound` instead. */
143
+ export type Outbound = PendleRemoveLiquidityRequestAmountIn$Outbound;
76
144
  }
77
145
 
78
- export function pendleRemoveLiquidityRequestAmountToJSON(
79
- pendleRemoveLiquidityRequestAmount: PendleRemoveLiquidityRequestAmount,
146
+ export function pendleRemoveLiquidityRequestAmountInToJSON(
147
+ pendleRemoveLiquidityRequestAmountIn: PendleRemoveLiquidityRequestAmountIn,
80
148
  ): string {
81
149
  return JSON.stringify(
82
- PendleRemoveLiquidityRequestAmount$outboundSchema.parse(
83
- pendleRemoveLiquidityRequestAmount,
150
+ PendleRemoveLiquidityRequestAmountIn$outboundSchema.parse(
151
+ pendleRemoveLiquidityRequestAmountIn,
84
152
  ),
85
153
  );
86
154
  }
87
155
 
88
- export function pendleRemoveLiquidityRequestAmountFromJSON(
156
+ export function pendleRemoveLiquidityRequestAmountInFromJSON(
89
157
  jsonString: string,
90
- ): SafeParseResult<PendleRemoveLiquidityRequestAmount, SDKValidationError> {
158
+ ): SafeParseResult<PendleRemoveLiquidityRequestAmountIn, SDKValidationError> {
91
159
  return safeParse(
92
160
  jsonString,
93
161
  (x) =>
94
- PendleRemoveLiquidityRequestAmount$inboundSchema.parse(JSON.parse(x)),
95
- `Failed to parse 'PendleRemoveLiquidityRequestAmount' from JSON`,
162
+ PendleRemoveLiquidityRequestAmountIn$inboundSchema.parse(JSON.parse(x)),
163
+ `Failed to parse 'PendleRemoveLiquidityRequestAmountIn' from JSON`,
96
164
  );
97
165
  }
98
166
 
@@ -128,7 +196,8 @@ export const PendleRemoveLiquidityRequest$inboundSchema: z.ZodType<
128
196
  "PENDLE_REMOVE_LIQUIDITY",
129
197
  ),
130
198
  market_address: z.string(),
131
- amount: z.union([z.number(), z.string()]),
199
+ token_out: z.union([TokenEnum$inboundSchema, z.string()]),
200
+ amount_in: z.union([z.number(), z.string()]),
132
201
  max_slippage_percent: z.number(),
133
202
  chain: PendleRemoveLiquidityRequestChain$inboundSchema,
134
203
  sender: z.string(),
@@ -136,6 +205,8 @@ export const PendleRemoveLiquidityRequest$inboundSchema: z.ZodType<
136
205
  return remap$(v, {
137
206
  "action_type": "actionType",
138
207
  "market_address": "marketAddress",
208
+ "token_out": "tokenOut",
209
+ "amount_in": "amountIn",
139
210
  "max_slippage_percent": "maxSlippagePercent",
140
211
  });
141
212
  });
@@ -144,7 +215,8 @@ export const PendleRemoveLiquidityRequest$inboundSchema: z.ZodType<
144
215
  export type PendleRemoveLiquidityRequest$Outbound = {
145
216
  action_type: "PENDLE_REMOVE_LIQUIDITY";
146
217
  market_address: string;
147
- amount: number | string;
218
+ token_out: string | string;
219
+ amount_in: number | string;
148
220
  max_slippage_percent: number;
149
221
  chain: string;
150
222
  sender: string;
@@ -160,7 +232,8 @@ export const PendleRemoveLiquidityRequest$outboundSchema: z.ZodType<
160
232
  "PENDLE_REMOVE_LIQUIDITY" as const,
161
233
  ),
162
234
  marketAddress: z.string(),
163
- amount: z.union([z.number(), z.string()]),
235
+ tokenOut: z.union([TokenEnum$outboundSchema, z.string()]),
236
+ amountIn: z.union([z.number(), z.string()]),
164
237
  maxSlippagePercent: z.number(),
165
238
  chain: PendleRemoveLiquidityRequestChain$outboundSchema,
166
239
  sender: z.string(),
@@ -168,6 +241,8 @@ export const PendleRemoveLiquidityRequest$outboundSchema: z.ZodType<
168
241
  return remap$(v, {
169
242
  actionType: "action_type",
170
243
  marketAddress: "market_address",
244
+ tokenOut: "token_out",
245
+ amountIn: "amount_in",
171
246
  maxSlippagePercent: "max_slippage_percent",
172
247
  });
173
248
  });
@@ -7,11 +7,21 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ TokenEnum,
12
+ TokenEnum$inboundSchema,
13
+ TokenEnum$outboundSchema,
14
+ } from "./tokenenum.js";
10
15
 
11
16
  /**
12
- * The amount of market's Principal Token (PT) you would like to sell for market's Underlying Token.
17
+ * The symbol or address of the token to buy with market's Principal Token (PT).
13
18
  */
14
- export type PendleSellPtParamsAmount = number | string;
19
+ export type PendleSellPtParamsTokenOut = TokenEnum | string;
20
+
21
+ /**
22
+ * The amount of market's Principal Token (PT) you would like to sell for 'token_out'.
23
+ */
24
+ export type PendleSellPtParamsAmountIn = number | string;
15
25
 
16
26
  export type PendleSellPtParams = {
17
27
  actionType?: "PENDLE_SELL_PT" | undefined;
@@ -20,9 +30,13 @@ export type PendleSellPtParams = {
20
30
  */
21
31
  marketAddress: string;
22
32
  /**
23
- * The amount of market's Principal Token (PT) you would like to sell for market's Underlying Token.
33
+ * The symbol or address of the token to buy with market's Principal Token (PT).
34
+ */
35
+ tokenOut: TokenEnum | string;
36
+ /**
37
+ * The amount of market's Principal Token (PT) you would like to sell for 'token_out'.
24
38
  */
25
- amount: number | string;
39
+ amountIn: number | string;
26
40
  /**
27
41
  * The maximum slippage allowed in percent. e.g. `1` means `1%` slippage allowed.
28
42
  */
@@ -30,50 +44,98 @@ export type PendleSellPtParams = {
30
44
  };
31
45
 
32
46
  /** @internal */
33
- export const PendleSellPtParamsAmount$inboundSchema: z.ZodType<
34
- PendleSellPtParamsAmount,
47
+ export const PendleSellPtParamsTokenOut$inboundSchema: z.ZodType<
48
+ PendleSellPtParamsTokenOut,
49
+ z.ZodTypeDef,
50
+ unknown
51
+ > = z.union([TokenEnum$inboundSchema, z.string()]);
52
+
53
+ /** @internal */
54
+ export type PendleSellPtParamsTokenOut$Outbound = string | string;
55
+
56
+ /** @internal */
57
+ export const PendleSellPtParamsTokenOut$outboundSchema: z.ZodType<
58
+ PendleSellPtParamsTokenOut$Outbound,
59
+ z.ZodTypeDef,
60
+ PendleSellPtParamsTokenOut
61
+ > = z.union([TokenEnum$outboundSchema, z.string()]);
62
+
63
+ /**
64
+ * @internal
65
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
66
+ */
67
+ export namespace PendleSellPtParamsTokenOut$ {
68
+ /** @deprecated use `PendleSellPtParamsTokenOut$inboundSchema` instead. */
69
+ export const inboundSchema = PendleSellPtParamsTokenOut$inboundSchema;
70
+ /** @deprecated use `PendleSellPtParamsTokenOut$outboundSchema` instead. */
71
+ export const outboundSchema = PendleSellPtParamsTokenOut$outboundSchema;
72
+ /** @deprecated use `PendleSellPtParamsTokenOut$Outbound` instead. */
73
+ export type Outbound = PendleSellPtParamsTokenOut$Outbound;
74
+ }
75
+
76
+ export function pendleSellPtParamsTokenOutToJSON(
77
+ pendleSellPtParamsTokenOut: PendleSellPtParamsTokenOut,
78
+ ): string {
79
+ return JSON.stringify(
80
+ PendleSellPtParamsTokenOut$outboundSchema.parse(pendleSellPtParamsTokenOut),
81
+ );
82
+ }
83
+
84
+ export function pendleSellPtParamsTokenOutFromJSON(
85
+ jsonString: string,
86
+ ): SafeParseResult<PendleSellPtParamsTokenOut, SDKValidationError> {
87
+ return safeParse(
88
+ jsonString,
89
+ (x) => PendleSellPtParamsTokenOut$inboundSchema.parse(JSON.parse(x)),
90
+ `Failed to parse 'PendleSellPtParamsTokenOut' from JSON`,
91
+ );
92
+ }
93
+
94
+ /** @internal */
95
+ export const PendleSellPtParamsAmountIn$inboundSchema: z.ZodType<
96
+ PendleSellPtParamsAmountIn,
35
97
  z.ZodTypeDef,
36
98
  unknown
37
99
  > = z.union([z.number(), z.string()]);
38
100
 
39
101
  /** @internal */
40
- export type PendleSellPtParamsAmount$Outbound = number | string;
102
+ export type PendleSellPtParamsAmountIn$Outbound = number | string;
41
103
 
42
104
  /** @internal */
43
- export const PendleSellPtParamsAmount$outboundSchema: z.ZodType<
44
- PendleSellPtParamsAmount$Outbound,
105
+ export const PendleSellPtParamsAmountIn$outboundSchema: z.ZodType<
106
+ PendleSellPtParamsAmountIn$Outbound,
45
107
  z.ZodTypeDef,
46
- PendleSellPtParamsAmount
108
+ PendleSellPtParamsAmountIn
47
109
  > = z.union([z.number(), z.string()]);
48
110
 
49
111
  /**
50
112
  * @internal
51
113
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
52
114
  */
53
- export namespace PendleSellPtParamsAmount$ {
54
- /** @deprecated use `PendleSellPtParamsAmount$inboundSchema` instead. */
55
- export const inboundSchema = PendleSellPtParamsAmount$inboundSchema;
56
- /** @deprecated use `PendleSellPtParamsAmount$outboundSchema` instead. */
57
- export const outboundSchema = PendleSellPtParamsAmount$outboundSchema;
58
- /** @deprecated use `PendleSellPtParamsAmount$Outbound` instead. */
59
- export type Outbound = PendleSellPtParamsAmount$Outbound;
115
+ export namespace PendleSellPtParamsAmountIn$ {
116
+ /** @deprecated use `PendleSellPtParamsAmountIn$inboundSchema` instead. */
117
+ export const inboundSchema = PendleSellPtParamsAmountIn$inboundSchema;
118
+ /** @deprecated use `PendleSellPtParamsAmountIn$outboundSchema` instead. */
119
+ export const outboundSchema = PendleSellPtParamsAmountIn$outboundSchema;
120
+ /** @deprecated use `PendleSellPtParamsAmountIn$Outbound` instead. */
121
+ export type Outbound = PendleSellPtParamsAmountIn$Outbound;
60
122
  }
61
123
 
62
- export function pendleSellPtParamsAmountToJSON(
63
- pendleSellPtParamsAmount: PendleSellPtParamsAmount,
124
+ export function pendleSellPtParamsAmountInToJSON(
125
+ pendleSellPtParamsAmountIn: PendleSellPtParamsAmountIn,
64
126
  ): string {
65
127
  return JSON.stringify(
66
- PendleSellPtParamsAmount$outboundSchema.parse(pendleSellPtParamsAmount),
128
+ PendleSellPtParamsAmountIn$outboundSchema.parse(pendleSellPtParamsAmountIn),
67
129
  );
68
130
  }
69
131
 
70
- export function pendleSellPtParamsAmountFromJSON(
132
+ export function pendleSellPtParamsAmountInFromJSON(
71
133
  jsonString: string,
72
- ): SafeParseResult<PendleSellPtParamsAmount, SDKValidationError> {
134
+ ): SafeParseResult<PendleSellPtParamsAmountIn, SDKValidationError> {
73
135
  return safeParse(
74
136
  jsonString,
75
- (x) => PendleSellPtParamsAmount$inboundSchema.parse(JSON.parse(x)),
76
- `Failed to parse 'PendleSellPtParamsAmount' from JSON`,
137
+ (x) => PendleSellPtParamsAmountIn$inboundSchema.parse(JSON.parse(x)),
138
+ `Failed to parse 'PendleSellPtParamsAmountIn' from JSON`,
77
139
  );
78
140
  }
79
141
 
@@ -85,12 +147,15 @@ export const PendleSellPtParams$inboundSchema: z.ZodType<
85
147
  > = z.object({
86
148
  action_type: z.literal("PENDLE_SELL_PT").default("PENDLE_SELL_PT"),
87
149
  market_address: z.string(),
88
- amount: z.union([z.number(), z.string()]),
150
+ token_out: z.union([TokenEnum$inboundSchema, z.string()]),
151
+ amount_in: z.union([z.number(), z.string()]),
89
152
  max_slippage_percent: z.number(),
90
153
  }).transform((v) => {
91
154
  return remap$(v, {
92
155
  "action_type": "actionType",
93
156
  "market_address": "marketAddress",
157
+ "token_out": "tokenOut",
158
+ "amount_in": "amountIn",
94
159
  "max_slippage_percent": "maxSlippagePercent",
95
160
  });
96
161
  });
@@ -99,7 +164,8 @@ export const PendleSellPtParams$inboundSchema: z.ZodType<
99
164
  export type PendleSellPtParams$Outbound = {
100
165
  action_type: "PENDLE_SELL_PT";
101
166
  market_address: string;
102
- amount: number | string;
167
+ token_out: string | string;
168
+ amount_in: number | string;
103
169
  max_slippage_percent: number;
104
170
  };
105
171
 
@@ -111,12 +177,15 @@ export const PendleSellPtParams$outboundSchema: z.ZodType<
111
177
  > = z.object({
112
178
  actionType: z.literal("PENDLE_SELL_PT").default("PENDLE_SELL_PT" as const),
113
179
  marketAddress: z.string(),
114
- amount: z.union([z.number(), z.string()]),
180
+ tokenOut: z.union([TokenEnum$outboundSchema, z.string()]),
181
+ amountIn: z.union([z.number(), z.string()]),
115
182
  maxSlippagePercent: z.number(),
116
183
  }).transform((v) => {
117
184
  return remap$(v, {
118
185
  actionType: "action_type",
119
186
  marketAddress: "market_address",
187
+ tokenOut: "token_out",
188
+ amountIn: "amount_in",
120
189
  maxSlippagePercent: "max_slippage_percent",
121
190
  });
122
191
  });
@@ -8,11 +8,21 @@ import { safeParse } from "../../lib/schemas.js";
8
8
  import { ClosedEnum } from "../../types/enums.js";
9
9
  import { Result as SafeParseResult } from "../../types/fp.js";
10
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+ import {
12
+ TokenEnum,
13
+ TokenEnum$inboundSchema,
14
+ TokenEnum$outboundSchema,
15
+ } from "./tokenenum.js";
11
16
 
12
17
  /**
13
- * The amount of market's Principal Token (PT) you would like to sell for market's Underlying Token.
18
+ * The symbol or address of the token to buy with market's Principal Token (PT).
14
19
  */
15
- export type PendleSellPtRequestAmount = number | string;
20
+ export type PendleSellPtRequestTokenOut = TokenEnum | string;
21
+
22
+ /**
23
+ * The amount of market's Principal Token (PT) you would like to sell for 'token_out'.
24
+ */
25
+ export type PendleSellPtRequestAmountIn = number | string;
16
26
 
17
27
  export const PendleSellPtRequestChain = {
18
28
  ArbitrumMainnet: "arbitrum:mainnet",
@@ -30,9 +40,13 @@ export type PendleSellPtRequest = {
30
40
  */
31
41
  marketAddress: string;
32
42
  /**
33
- * The amount of market's Principal Token (PT) you would like to sell for market's Underlying Token.
43
+ * The symbol or address of the token to buy with market's Principal Token (PT).
44
+ */
45
+ tokenOut: TokenEnum | string;
46
+ /**
47
+ * The amount of market's Principal Token (PT) you would like to sell for 'token_out'.
34
48
  */
35
- amount: number | string;
49
+ amountIn: number | string;
36
50
  /**
37
51
  * The maximum slippage allowed in percent. e.g. `1` means `1%` slippage allowed.
38
52
  */
@@ -45,50 +59,102 @@ export type PendleSellPtRequest = {
45
59
  };
46
60
 
47
61
  /** @internal */
48
- export const PendleSellPtRequestAmount$inboundSchema: z.ZodType<
49
- PendleSellPtRequestAmount,
62
+ export const PendleSellPtRequestTokenOut$inboundSchema: z.ZodType<
63
+ PendleSellPtRequestTokenOut,
64
+ z.ZodTypeDef,
65
+ unknown
66
+ > = z.union([TokenEnum$inboundSchema, z.string()]);
67
+
68
+ /** @internal */
69
+ export type PendleSellPtRequestTokenOut$Outbound = string | string;
70
+
71
+ /** @internal */
72
+ export const PendleSellPtRequestTokenOut$outboundSchema: z.ZodType<
73
+ PendleSellPtRequestTokenOut$Outbound,
74
+ z.ZodTypeDef,
75
+ PendleSellPtRequestTokenOut
76
+ > = z.union([TokenEnum$outboundSchema, z.string()]);
77
+
78
+ /**
79
+ * @internal
80
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
81
+ */
82
+ export namespace PendleSellPtRequestTokenOut$ {
83
+ /** @deprecated use `PendleSellPtRequestTokenOut$inboundSchema` instead. */
84
+ export const inboundSchema = PendleSellPtRequestTokenOut$inboundSchema;
85
+ /** @deprecated use `PendleSellPtRequestTokenOut$outboundSchema` instead. */
86
+ export const outboundSchema = PendleSellPtRequestTokenOut$outboundSchema;
87
+ /** @deprecated use `PendleSellPtRequestTokenOut$Outbound` instead. */
88
+ export type Outbound = PendleSellPtRequestTokenOut$Outbound;
89
+ }
90
+
91
+ export function pendleSellPtRequestTokenOutToJSON(
92
+ pendleSellPtRequestTokenOut: PendleSellPtRequestTokenOut,
93
+ ): string {
94
+ return JSON.stringify(
95
+ PendleSellPtRequestTokenOut$outboundSchema.parse(
96
+ pendleSellPtRequestTokenOut,
97
+ ),
98
+ );
99
+ }
100
+
101
+ export function pendleSellPtRequestTokenOutFromJSON(
102
+ jsonString: string,
103
+ ): SafeParseResult<PendleSellPtRequestTokenOut, SDKValidationError> {
104
+ return safeParse(
105
+ jsonString,
106
+ (x) => PendleSellPtRequestTokenOut$inboundSchema.parse(JSON.parse(x)),
107
+ `Failed to parse 'PendleSellPtRequestTokenOut' from JSON`,
108
+ );
109
+ }
110
+
111
+ /** @internal */
112
+ export const PendleSellPtRequestAmountIn$inboundSchema: z.ZodType<
113
+ PendleSellPtRequestAmountIn,
50
114
  z.ZodTypeDef,
51
115
  unknown
52
116
  > = z.union([z.number(), z.string()]);
53
117
 
54
118
  /** @internal */
55
- export type PendleSellPtRequestAmount$Outbound = number | string;
119
+ export type PendleSellPtRequestAmountIn$Outbound = number | string;
56
120
 
57
121
  /** @internal */
58
- export const PendleSellPtRequestAmount$outboundSchema: z.ZodType<
59
- PendleSellPtRequestAmount$Outbound,
122
+ export const PendleSellPtRequestAmountIn$outboundSchema: z.ZodType<
123
+ PendleSellPtRequestAmountIn$Outbound,
60
124
  z.ZodTypeDef,
61
- PendleSellPtRequestAmount
125
+ PendleSellPtRequestAmountIn
62
126
  > = z.union([z.number(), z.string()]);
63
127
 
64
128
  /**
65
129
  * @internal
66
130
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
67
131
  */
68
- export namespace PendleSellPtRequestAmount$ {
69
- /** @deprecated use `PendleSellPtRequestAmount$inboundSchema` instead. */
70
- export const inboundSchema = PendleSellPtRequestAmount$inboundSchema;
71
- /** @deprecated use `PendleSellPtRequestAmount$outboundSchema` instead. */
72
- export const outboundSchema = PendleSellPtRequestAmount$outboundSchema;
73
- /** @deprecated use `PendleSellPtRequestAmount$Outbound` instead. */
74
- export type Outbound = PendleSellPtRequestAmount$Outbound;
132
+ export namespace PendleSellPtRequestAmountIn$ {
133
+ /** @deprecated use `PendleSellPtRequestAmountIn$inboundSchema` instead. */
134
+ export const inboundSchema = PendleSellPtRequestAmountIn$inboundSchema;
135
+ /** @deprecated use `PendleSellPtRequestAmountIn$outboundSchema` instead. */
136
+ export const outboundSchema = PendleSellPtRequestAmountIn$outboundSchema;
137
+ /** @deprecated use `PendleSellPtRequestAmountIn$Outbound` instead. */
138
+ export type Outbound = PendleSellPtRequestAmountIn$Outbound;
75
139
  }
76
140
 
77
- export function pendleSellPtRequestAmountToJSON(
78
- pendleSellPtRequestAmount: PendleSellPtRequestAmount,
141
+ export function pendleSellPtRequestAmountInToJSON(
142
+ pendleSellPtRequestAmountIn: PendleSellPtRequestAmountIn,
79
143
  ): string {
80
144
  return JSON.stringify(
81
- PendleSellPtRequestAmount$outboundSchema.parse(pendleSellPtRequestAmount),
145
+ PendleSellPtRequestAmountIn$outboundSchema.parse(
146
+ pendleSellPtRequestAmountIn,
147
+ ),
82
148
  );
83
149
  }
84
150
 
85
- export function pendleSellPtRequestAmountFromJSON(
151
+ export function pendleSellPtRequestAmountInFromJSON(
86
152
  jsonString: string,
87
- ): SafeParseResult<PendleSellPtRequestAmount, SDKValidationError> {
153
+ ): SafeParseResult<PendleSellPtRequestAmountIn, SDKValidationError> {
88
154
  return safeParse(
89
155
  jsonString,
90
- (x) => PendleSellPtRequestAmount$inboundSchema.parse(JSON.parse(x)),
91
- `Failed to parse 'PendleSellPtRequestAmount' from JSON`,
156
+ (x) => PendleSellPtRequestAmountIn$inboundSchema.parse(JSON.parse(x)),
157
+ `Failed to parse 'PendleSellPtRequestAmountIn' from JSON`,
92
158
  );
93
159
  }
94
160
 
@@ -121,7 +187,8 @@ export const PendleSellPtRequest$inboundSchema: z.ZodType<
121
187
  > = z.object({
122
188
  action_type: z.literal("PENDLE_SELL_PT").default("PENDLE_SELL_PT"),
123
189
  market_address: z.string(),
124
- amount: z.union([z.number(), z.string()]),
190
+ token_out: z.union([TokenEnum$inboundSchema, z.string()]),
191
+ amount_in: z.union([z.number(), z.string()]),
125
192
  max_slippage_percent: z.number(),
126
193
  chain: PendleSellPtRequestChain$inboundSchema,
127
194
  sender: z.string(),
@@ -129,6 +196,8 @@ export const PendleSellPtRequest$inboundSchema: z.ZodType<
129
196
  return remap$(v, {
130
197
  "action_type": "actionType",
131
198
  "market_address": "marketAddress",
199
+ "token_out": "tokenOut",
200
+ "amount_in": "amountIn",
132
201
  "max_slippage_percent": "maxSlippagePercent",
133
202
  });
134
203
  });
@@ -137,7 +206,8 @@ export const PendleSellPtRequest$inboundSchema: z.ZodType<
137
206
  export type PendleSellPtRequest$Outbound = {
138
207
  action_type: "PENDLE_SELL_PT";
139
208
  market_address: string;
140
- amount: number | string;
209
+ token_out: string | string;
210
+ amount_in: number | string;
141
211
  max_slippage_percent: number;
142
212
  chain: string;
143
213
  sender: string;
@@ -151,7 +221,8 @@ export const PendleSellPtRequest$outboundSchema: z.ZodType<
151
221
  > = z.object({
152
222
  actionType: z.literal("PENDLE_SELL_PT").default("PENDLE_SELL_PT" as const),
153
223
  marketAddress: z.string(),
154
- amount: z.union([z.number(), z.string()]),
224
+ tokenOut: z.union([TokenEnum$outboundSchema, z.string()]),
225
+ amountIn: z.union([z.number(), z.string()]),
155
226
  maxSlippagePercent: z.number(),
156
227
  chain: PendleSellPtRequestChain$outboundSchema,
157
228
  sender: z.string(),
@@ -159,6 +230,8 @@ export const PendleSellPtRequest$outboundSchema: z.ZodType<
159
230
  return remap$(v, {
160
231
  actionType: "action_type",
161
232
  marketAddress: "market_address",
233
+ tokenOut: "token_out",
234
+ amountIn: "amount_in",
162
235
  maxSlippagePercent: "max_slippage_percent",
163
236
  });
164
237
  });