@compass-labs/api-sdk 0.0.27 → 0.0.29

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 (220) hide show
  1. package/FUNCTIONS.md +4 -3
  2. package/README.md +21 -13
  3. package/bin/mcp-server.js +1255 -558
  4. package/bin/mcp-server.js.map +30 -15
  5. package/dist/commonjs/funcs/aaveV3AvgRate.d.ts +18 -0
  6. package/dist/commonjs/funcs/aaveV3AvgRate.d.ts.map +1 -0
  7. package/dist/commonjs/funcs/aaveV3AvgRate.js +122 -0
  8. package/dist/commonjs/funcs/aaveV3AvgRate.js.map +1 -0
  9. package/dist/commonjs/lib/config.d.ts +3 -3
  10. package/dist/commonjs/lib/config.js +3 -3
  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/aaveV3AvgRate.d.ts +8 -0
  16. package/dist/commonjs/mcp-server/tools/aaveV3AvgRate.d.ts.map +1 -0
  17. package/dist/commonjs/mcp-server/tools/aaveV3AvgRate.js +64 -0
  18. package/dist/commonjs/mcp-server/tools/aaveV3AvgRate.js.map +1 -0
  19. package/dist/commonjs/models/components/aaveavgrateresponse.d.ts +57 -0
  20. package/dist/commonjs/models/components/aaveavgrateresponse.d.ts.map +1 -0
  21. package/dist/commonjs/models/components/aaveavgrateresponse.js +98 -0
  22. package/dist/commonjs/models/components/aaveavgrateresponse.js.map +1 -0
  23. package/dist/commonjs/models/components/index.d.ts +12 -0
  24. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  25. package/dist/commonjs/models/components/index.js +12 -0
  26. package/dist/commonjs/models/components/index.js.map +1 -1
  27. package/dist/commonjs/models/components/morphoborrowparams.d.ts +71 -0
  28. package/dist/commonjs/models/components/morphoborrowparams.d.ts.map +1 -0
  29. package/dist/commonjs/models/components/morphoborrowparams.js +109 -0
  30. package/dist/commonjs/models/components/morphoborrowparams.js.map +1 -0
  31. package/dist/commonjs/models/components/morphodepositparams.d.ts +66 -0
  32. package/dist/commonjs/models/components/morphodepositparams.d.ts.map +1 -0
  33. package/dist/commonjs/models/components/morphodepositparams.js +105 -0
  34. package/dist/commonjs/models/components/morphodepositparams.js.map +1 -0
  35. package/dist/commonjs/models/components/morphorepayparams.d.ts +47 -0
  36. package/dist/commonjs/models/components/morphorepayparams.d.ts.map +1 -0
  37. package/dist/commonjs/models/components/morphorepayparams.js +89 -0
  38. package/dist/commonjs/models/components/morphorepayparams.js.map +1 -0
  39. package/dist/commonjs/models/components/morphosetvaultallowanceparams.d.ts +61 -0
  40. package/dist/commonjs/models/components/morphosetvaultallowanceparams.d.ts.map +1 -0
  41. package/dist/commonjs/models/components/morphosetvaultallowanceparams.js +103 -0
  42. package/dist/commonjs/models/components/morphosetvaultallowanceparams.js.map +1 -0
  43. package/dist/commonjs/models/components/morphosupplycollateralparams.d.ts +71 -0
  44. package/dist/commonjs/models/components/morphosupplycollateralparams.d.ts.map +1 -0
  45. package/dist/commonjs/models/components/morphosupplycollateralparams.js +112 -0
  46. package/dist/commonjs/models/components/morphosupplycollateralparams.js.map +1 -0
  47. package/dist/commonjs/models/components/morphowithdrawcollateralparams.d.ts +71 -0
  48. package/dist/commonjs/models/components/morphowithdrawcollateralparams.d.ts.map +1 -0
  49. package/dist/commonjs/models/components/morphowithdrawcollateralparams.js +109 -0
  50. package/dist/commonjs/models/components/morphowithdrawcollateralparams.js.map +1 -0
  51. package/dist/commonjs/models/components/morphowithdrawparams.d.ts +42 -0
  52. package/dist/commonjs/models/components/morphowithdrawparams.d.ts.map +1 -0
  53. package/dist/commonjs/models/components/morphowithdrawparams.js +82 -0
  54. package/dist/commonjs/models/components/morphowithdrawparams.js.map +1 -0
  55. package/dist/commonjs/models/components/multicallaction.d.ts +15 -4
  56. package/dist/commonjs/models/components/multicallaction.d.ts.map +1 -1
  57. package/dist/commonjs/models/components/multicallaction.js +55 -0
  58. package/dist/commonjs/models/components/multicallaction.js.map +1 -1
  59. package/dist/commonjs/models/components/multicallactiontype.d.ts +33 -0
  60. package/dist/commonjs/models/components/multicallactiontype.d.ts.map +1 -1
  61. package/dist/commonjs/models/components/multicallactiontype.js +11 -0
  62. package/dist/commonjs/models/components/multicallactiontype.js.map +1 -1
  63. package/dist/commonjs/models/components/skybuyparams.d.ts +93 -0
  64. package/dist/commonjs/models/components/skybuyparams.d.ts.map +1 -0
  65. package/dist/commonjs/models/components/skybuyparams.js +125 -0
  66. package/dist/commonjs/models/components/skybuyparams.js.map +1 -0
  67. package/dist/commonjs/models/components/skybuyrequest.d.ts +8 -8
  68. package/dist/commonjs/models/components/skybuyrequest.d.ts.map +1 -1
  69. package/dist/commonjs/models/components/skybuyrequest.js +13 -14
  70. package/dist/commonjs/models/components/skybuyrequest.js.map +1 -1
  71. package/dist/commonjs/models/components/skydepositparams.d.ts +61 -0
  72. package/dist/commonjs/models/components/skydepositparams.d.ts.map +1 -0
  73. package/dist/commonjs/models/components/skydepositparams.js +94 -0
  74. package/dist/commonjs/models/components/skydepositparams.js.map +1 -0
  75. package/dist/commonjs/models/components/skysellparams.d.ts +93 -0
  76. package/dist/commonjs/models/components/skysellparams.d.ts.map +1 -0
  77. package/dist/commonjs/models/components/skysellparams.js +125 -0
  78. package/dist/commonjs/models/components/skysellparams.js.map +1 -0
  79. package/dist/commonjs/models/components/skysellrequest.d.ts +8 -8
  80. package/dist/commonjs/models/components/skysellrequest.d.ts.map +1 -1
  81. package/dist/commonjs/models/components/skysellrequest.js +13 -14
  82. package/dist/commonjs/models/components/skysellrequest.js.map +1 -1
  83. package/dist/commonjs/models/components/skywithdrawparams.d.ts +37 -0
  84. package/dist/commonjs/models/components/skywithdrawparams.d.ts.map +1 -0
  85. package/dist/commonjs/models/components/skywithdrawparams.js +71 -0
  86. package/dist/commonjs/models/components/skywithdrawparams.js.map +1 -0
  87. package/dist/commonjs/models/operations/aaveavgrate.d.ts +244 -0
  88. package/dist/commonjs/models/operations/aaveavgrate.d.ts.map +1 -0
  89. package/dist/commonjs/models/operations/aaveavgrate.js +165 -0
  90. package/dist/commonjs/models/operations/aaveavgrate.js.map +1 -0
  91. package/dist/commonjs/models/operations/index.d.ts +1 -0
  92. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  93. package/dist/commonjs/models/operations/index.js +1 -0
  94. package/dist/commonjs/models/operations/index.js.map +1 -1
  95. package/dist/commonjs/sdk/aavev3.d.ts +7 -0
  96. package/dist/commonjs/sdk/aavev3.d.ts.map +1 -1
  97. package/dist/commonjs/sdk/aavev3.js +10 -0
  98. package/dist/commonjs/sdk/aavev3.js.map +1 -1
  99. package/dist/esm/funcs/aaveV3AvgRate.d.ts +18 -0
  100. package/dist/esm/funcs/aaveV3AvgRate.d.ts.map +1 -0
  101. package/dist/esm/funcs/aaveV3AvgRate.js +86 -0
  102. package/dist/esm/funcs/aaveV3AvgRate.js.map +1 -0
  103. package/dist/esm/lib/config.d.ts +3 -3
  104. package/dist/esm/lib/config.js +3 -3
  105. package/dist/esm/mcp-server/mcp-server.js +1 -1
  106. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  107. package/dist/esm/mcp-server/server.js +3 -1
  108. package/dist/esm/mcp-server/server.js.map +1 -1
  109. package/dist/esm/mcp-server/tools/aaveV3AvgRate.d.ts +8 -0
  110. package/dist/esm/mcp-server/tools/aaveV3AvgRate.d.ts.map +1 -0
  111. package/dist/esm/mcp-server/tools/aaveV3AvgRate.js +28 -0
  112. package/dist/esm/mcp-server/tools/aaveV3AvgRate.js.map +1 -0
  113. package/dist/esm/models/components/aaveavgrateresponse.d.ts +57 -0
  114. package/dist/esm/models/components/aaveavgrateresponse.d.ts.map +1 -0
  115. package/dist/esm/models/components/aaveavgrateresponse.js +60 -0
  116. package/dist/esm/models/components/aaveavgrateresponse.js.map +1 -0
  117. package/dist/esm/models/components/index.d.ts +12 -0
  118. package/dist/esm/models/components/index.d.ts.map +1 -1
  119. package/dist/esm/models/components/index.js +12 -0
  120. package/dist/esm/models/components/index.js.map +1 -1
  121. package/dist/esm/models/components/morphoborrowparams.d.ts +71 -0
  122. package/dist/esm/models/components/morphoborrowparams.d.ts.map +1 -0
  123. package/dist/esm/models/components/morphoborrowparams.js +69 -0
  124. package/dist/esm/models/components/morphoborrowparams.js.map +1 -0
  125. package/dist/esm/models/components/morphodepositparams.d.ts +66 -0
  126. package/dist/esm/models/components/morphodepositparams.d.ts.map +1 -0
  127. package/dist/esm/models/components/morphodepositparams.js +65 -0
  128. package/dist/esm/models/components/morphodepositparams.js.map +1 -0
  129. package/dist/esm/models/components/morphorepayparams.d.ts +47 -0
  130. package/dist/esm/models/components/morphorepayparams.d.ts.map +1 -0
  131. package/dist/esm/models/components/morphorepayparams.js +51 -0
  132. package/dist/esm/models/components/morphorepayparams.js.map +1 -0
  133. package/dist/esm/models/components/morphosetvaultallowanceparams.d.ts +61 -0
  134. package/dist/esm/models/components/morphosetvaultallowanceparams.d.ts.map +1 -0
  135. package/dist/esm/models/components/morphosetvaultallowanceparams.js +63 -0
  136. package/dist/esm/models/components/morphosetvaultallowanceparams.js.map +1 -0
  137. package/dist/esm/models/components/morphosupplycollateralparams.d.ts +71 -0
  138. package/dist/esm/models/components/morphosupplycollateralparams.d.ts.map +1 -0
  139. package/dist/esm/models/components/morphosupplycollateralparams.js +72 -0
  140. package/dist/esm/models/components/morphosupplycollateralparams.js.map +1 -0
  141. package/dist/esm/models/components/morphowithdrawcollateralparams.d.ts +71 -0
  142. package/dist/esm/models/components/morphowithdrawcollateralparams.d.ts.map +1 -0
  143. package/dist/esm/models/components/morphowithdrawcollateralparams.js +69 -0
  144. package/dist/esm/models/components/morphowithdrawcollateralparams.js.map +1 -0
  145. package/dist/esm/models/components/morphowithdrawparams.d.ts +42 -0
  146. package/dist/esm/models/components/morphowithdrawparams.d.ts.map +1 -0
  147. package/dist/esm/models/components/morphowithdrawparams.js +44 -0
  148. package/dist/esm/models/components/morphowithdrawparams.js.map +1 -0
  149. package/dist/esm/models/components/multicallaction.d.ts +15 -4
  150. package/dist/esm/models/components/multicallaction.d.ts.map +1 -1
  151. package/dist/esm/models/components/multicallaction.js +55 -0
  152. package/dist/esm/models/components/multicallaction.js.map +1 -1
  153. package/dist/esm/models/components/multicallactiontype.d.ts +33 -0
  154. package/dist/esm/models/components/multicallactiontype.d.ts.map +1 -1
  155. package/dist/esm/models/components/multicallactiontype.js +11 -0
  156. package/dist/esm/models/components/multicallactiontype.js.map +1 -1
  157. package/dist/esm/models/components/skybuyparams.d.ts +93 -0
  158. package/dist/esm/models/components/skybuyparams.d.ts.map +1 -0
  159. package/dist/esm/models/components/skybuyparams.js +85 -0
  160. package/dist/esm/models/components/skybuyparams.js.map +1 -0
  161. package/dist/esm/models/components/skybuyrequest.d.ts +8 -8
  162. package/dist/esm/models/components/skybuyrequest.d.ts.map +1 -1
  163. package/dist/esm/models/components/skybuyrequest.js +12 -13
  164. package/dist/esm/models/components/skybuyrequest.js.map +1 -1
  165. package/dist/esm/models/components/skydepositparams.d.ts +61 -0
  166. package/dist/esm/models/components/skydepositparams.d.ts.map +1 -0
  167. package/dist/esm/models/components/skydepositparams.js +54 -0
  168. package/dist/esm/models/components/skydepositparams.js.map +1 -0
  169. package/dist/esm/models/components/skysellparams.d.ts +93 -0
  170. package/dist/esm/models/components/skysellparams.d.ts.map +1 -0
  171. package/dist/esm/models/components/skysellparams.js +85 -0
  172. package/dist/esm/models/components/skysellparams.js.map +1 -0
  173. package/dist/esm/models/components/skysellrequest.d.ts +8 -8
  174. package/dist/esm/models/components/skysellrequest.d.ts.map +1 -1
  175. package/dist/esm/models/components/skysellrequest.js +12 -13
  176. package/dist/esm/models/components/skysellrequest.js.map +1 -1
  177. package/dist/esm/models/components/skywithdrawparams.d.ts +37 -0
  178. package/dist/esm/models/components/skywithdrawparams.d.ts.map +1 -0
  179. package/dist/esm/models/components/skywithdrawparams.js +33 -0
  180. package/dist/esm/models/components/skywithdrawparams.js.map +1 -0
  181. package/dist/esm/models/operations/aaveavgrate.d.ts +244 -0
  182. package/dist/esm/models/operations/aaveavgrate.d.ts.map +1 -0
  183. package/dist/esm/models/operations/aaveavgrate.js +127 -0
  184. package/dist/esm/models/operations/aaveavgrate.js.map +1 -0
  185. package/dist/esm/models/operations/index.d.ts +1 -0
  186. package/dist/esm/models/operations/index.d.ts.map +1 -1
  187. package/dist/esm/models/operations/index.js +1 -0
  188. package/dist/esm/models/operations/index.js.map +1 -1
  189. package/dist/esm/sdk/aavev3.d.ts +7 -0
  190. package/dist/esm/sdk/aavev3.d.ts.map +1 -1
  191. package/dist/esm/sdk/aavev3.js +10 -0
  192. package/dist/esm/sdk/aavev3.js.map +1 -1
  193. package/docs/sdks/aavev3/README.md +82 -0
  194. package/jsr.json +1 -1
  195. package/package.json +1 -1
  196. package/src/funcs/aaveV3AvgRate.ts +170 -0
  197. package/src/lib/config.ts +3 -3
  198. package/src/mcp-server/mcp-server.ts +1 -1
  199. package/src/mcp-server/server.ts +3 -1
  200. package/src/mcp-server/tools/aaveV3AvgRate.ts +37 -0
  201. package/src/models/components/aaveavgrateresponse.ts +123 -0
  202. package/src/models/components/index.ts +12 -0
  203. package/src/models/components/morphoborrowparams.ts +154 -0
  204. package/src/models/components/morphodepositparams.ts +145 -0
  205. package/src/models/components/morphorepayparams.ts +104 -0
  206. package/src/models/components/morphosetvaultallowanceparams.ts +145 -0
  207. package/src/models/components/morphosupplycollateralparams.ts +163 -0
  208. package/src/models/components/morphowithdrawcollateralparams.ts +161 -0
  209. package/src/models/components/morphowithdrawparams.ts +92 -0
  210. package/src/models/components/multicallaction.ts +154 -0
  211. package/src/models/components/multicallactiontype.ts +11 -0
  212. package/src/models/components/skybuyparams.ts +168 -0
  213. package/src/models/components/skybuyrequest.ts +16 -14
  214. package/src/models/components/skydepositparams.ts +129 -0
  215. package/src/models/components/skysellparams.ts +168 -0
  216. package/src/models/components/skysellrequest.ts +16 -14
  217. package/src/models/components/skywithdrawparams.ts +76 -0
  218. package/src/models/operations/aaveavgrate.ts +203 -0
  219. package/src/models/operations/index.ts +1 -0
  220. package/src/sdk/aavev3.ts +18 -0
@@ -0,0 +1,154 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * Amount of the token to borrow from the market.
13
+ */
14
+ export type MorphoBorrowParamsAmount = number | string;
15
+
16
+ export type MorphoBorrowParams = {
17
+ /**
18
+ * Amount of the token to borrow from the market.
19
+ */
20
+ amount: number | string;
21
+ /**
22
+ * The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint.
23
+ */
24
+ uniqueMarketKey: string;
25
+ /**
26
+ * The address where the collateral is borrowed against. Defaults to sender.
27
+ */
28
+ onBehalfOf?: string | null | undefined;
29
+ /**
30
+ * The address of the receiver of the tokens borrowed. Defaults to the transaction sender.
31
+ */
32
+ receiver?: string | null | undefined;
33
+ };
34
+
35
+ /** @internal */
36
+ export const MorphoBorrowParamsAmount$inboundSchema: z.ZodType<
37
+ MorphoBorrowParamsAmount,
38
+ z.ZodTypeDef,
39
+ unknown
40
+ > = z.union([z.number(), z.string()]);
41
+
42
+ /** @internal */
43
+ export type MorphoBorrowParamsAmount$Outbound = number | string;
44
+
45
+ /** @internal */
46
+ export const MorphoBorrowParamsAmount$outboundSchema: z.ZodType<
47
+ MorphoBorrowParamsAmount$Outbound,
48
+ z.ZodTypeDef,
49
+ MorphoBorrowParamsAmount
50
+ > = z.union([z.number(), z.string()]);
51
+
52
+ /**
53
+ * @internal
54
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
55
+ */
56
+ export namespace MorphoBorrowParamsAmount$ {
57
+ /** @deprecated use `MorphoBorrowParamsAmount$inboundSchema` instead. */
58
+ export const inboundSchema = MorphoBorrowParamsAmount$inboundSchema;
59
+ /** @deprecated use `MorphoBorrowParamsAmount$outboundSchema` instead. */
60
+ export const outboundSchema = MorphoBorrowParamsAmount$outboundSchema;
61
+ /** @deprecated use `MorphoBorrowParamsAmount$Outbound` instead. */
62
+ export type Outbound = MorphoBorrowParamsAmount$Outbound;
63
+ }
64
+
65
+ export function morphoBorrowParamsAmountToJSON(
66
+ morphoBorrowParamsAmount: MorphoBorrowParamsAmount,
67
+ ): string {
68
+ return JSON.stringify(
69
+ MorphoBorrowParamsAmount$outboundSchema.parse(morphoBorrowParamsAmount),
70
+ );
71
+ }
72
+
73
+ export function morphoBorrowParamsAmountFromJSON(
74
+ jsonString: string,
75
+ ): SafeParseResult<MorphoBorrowParamsAmount, SDKValidationError> {
76
+ return safeParse(
77
+ jsonString,
78
+ (x) => MorphoBorrowParamsAmount$inboundSchema.parse(JSON.parse(x)),
79
+ `Failed to parse 'MorphoBorrowParamsAmount' from JSON`,
80
+ );
81
+ }
82
+
83
+ /** @internal */
84
+ export const MorphoBorrowParams$inboundSchema: z.ZodType<
85
+ MorphoBorrowParams,
86
+ z.ZodTypeDef,
87
+ unknown
88
+ > = z.object({
89
+ amount: z.union([z.number(), z.string()]),
90
+ unique_market_key: z.string(),
91
+ on_behalf_of: z.nullable(z.string()).optional(),
92
+ receiver: z.nullable(z.string()).optional(),
93
+ }).transform((v) => {
94
+ return remap$(v, {
95
+ "unique_market_key": "uniqueMarketKey",
96
+ "on_behalf_of": "onBehalfOf",
97
+ });
98
+ });
99
+
100
+ /** @internal */
101
+ export type MorphoBorrowParams$Outbound = {
102
+ amount: number | string;
103
+ unique_market_key: string;
104
+ on_behalf_of?: string | null | undefined;
105
+ receiver?: string | null | undefined;
106
+ };
107
+
108
+ /** @internal */
109
+ export const MorphoBorrowParams$outboundSchema: z.ZodType<
110
+ MorphoBorrowParams$Outbound,
111
+ z.ZodTypeDef,
112
+ MorphoBorrowParams
113
+ > = z.object({
114
+ amount: z.union([z.number(), z.string()]),
115
+ uniqueMarketKey: z.string(),
116
+ onBehalfOf: z.nullable(z.string()).optional(),
117
+ receiver: z.nullable(z.string()).optional(),
118
+ }).transform((v) => {
119
+ return remap$(v, {
120
+ uniqueMarketKey: "unique_market_key",
121
+ onBehalfOf: "on_behalf_of",
122
+ });
123
+ });
124
+
125
+ /**
126
+ * @internal
127
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
128
+ */
129
+ export namespace MorphoBorrowParams$ {
130
+ /** @deprecated use `MorphoBorrowParams$inboundSchema` instead. */
131
+ export const inboundSchema = MorphoBorrowParams$inboundSchema;
132
+ /** @deprecated use `MorphoBorrowParams$outboundSchema` instead. */
133
+ export const outboundSchema = MorphoBorrowParams$outboundSchema;
134
+ /** @deprecated use `MorphoBorrowParams$Outbound` instead. */
135
+ export type Outbound = MorphoBorrowParams$Outbound;
136
+ }
137
+
138
+ export function morphoBorrowParamsToJSON(
139
+ morphoBorrowParams: MorphoBorrowParams,
140
+ ): string {
141
+ return JSON.stringify(
142
+ MorphoBorrowParams$outboundSchema.parse(morphoBorrowParams),
143
+ );
144
+ }
145
+
146
+ export function morphoBorrowParamsFromJSON(
147
+ jsonString: string,
148
+ ): SafeParseResult<MorphoBorrowParams, SDKValidationError> {
149
+ return safeParse(
150
+ jsonString,
151
+ (x) => MorphoBorrowParams$inboundSchema.parse(JSON.parse(x)),
152
+ `Failed to parse 'MorphoBorrowParams' from JSON`,
153
+ );
154
+ }
@@ -0,0 +1,145 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * The amount of tokens to deposit into the vault.
13
+ */
14
+ export type MorphoDepositParamsAmount = number | string;
15
+
16
+ export type MorphoDepositParams = {
17
+ /**
18
+ * The vault address you are depositing to.
19
+ */
20
+ vaultAddress: string;
21
+ /**
22
+ * The amount of tokens to deposit into the vault.
23
+ */
24
+ amount: number | string;
25
+ /**
26
+ * The address which will receive the shares from the vault representing their proportional ownership of the vault's assets. Defaults to the sender.
27
+ */
28
+ receiver?: string | null | undefined;
29
+ };
30
+
31
+ /** @internal */
32
+ export const MorphoDepositParamsAmount$inboundSchema: z.ZodType<
33
+ MorphoDepositParamsAmount,
34
+ z.ZodTypeDef,
35
+ unknown
36
+ > = z.union([z.number(), z.string()]);
37
+
38
+ /** @internal */
39
+ export type MorphoDepositParamsAmount$Outbound = number | string;
40
+
41
+ /** @internal */
42
+ export const MorphoDepositParamsAmount$outboundSchema: z.ZodType<
43
+ MorphoDepositParamsAmount$Outbound,
44
+ z.ZodTypeDef,
45
+ MorphoDepositParamsAmount
46
+ > = z.union([z.number(), z.string()]);
47
+
48
+ /**
49
+ * @internal
50
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
51
+ */
52
+ export namespace MorphoDepositParamsAmount$ {
53
+ /** @deprecated use `MorphoDepositParamsAmount$inboundSchema` instead. */
54
+ export const inboundSchema = MorphoDepositParamsAmount$inboundSchema;
55
+ /** @deprecated use `MorphoDepositParamsAmount$outboundSchema` instead. */
56
+ export const outboundSchema = MorphoDepositParamsAmount$outboundSchema;
57
+ /** @deprecated use `MorphoDepositParamsAmount$Outbound` instead. */
58
+ export type Outbound = MorphoDepositParamsAmount$Outbound;
59
+ }
60
+
61
+ export function morphoDepositParamsAmountToJSON(
62
+ morphoDepositParamsAmount: MorphoDepositParamsAmount,
63
+ ): string {
64
+ return JSON.stringify(
65
+ MorphoDepositParamsAmount$outboundSchema.parse(morphoDepositParamsAmount),
66
+ );
67
+ }
68
+
69
+ export function morphoDepositParamsAmountFromJSON(
70
+ jsonString: string,
71
+ ): SafeParseResult<MorphoDepositParamsAmount, SDKValidationError> {
72
+ return safeParse(
73
+ jsonString,
74
+ (x) => MorphoDepositParamsAmount$inboundSchema.parse(JSON.parse(x)),
75
+ `Failed to parse 'MorphoDepositParamsAmount' from JSON`,
76
+ );
77
+ }
78
+
79
+ /** @internal */
80
+ export const MorphoDepositParams$inboundSchema: z.ZodType<
81
+ MorphoDepositParams,
82
+ z.ZodTypeDef,
83
+ unknown
84
+ > = z.object({
85
+ vault_address: z.string(),
86
+ amount: z.union([z.number(), z.string()]),
87
+ receiver: z.nullable(z.string()).optional(),
88
+ }).transform((v) => {
89
+ return remap$(v, {
90
+ "vault_address": "vaultAddress",
91
+ });
92
+ });
93
+
94
+ /** @internal */
95
+ export type MorphoDepositParams$Outbound = {
96
+ vault_address: string;
97
+ amount: number | string;
98
+ receiver?: string | null | undefined;
99
+ };
100
+
101
+ /** @internal */
102
+ export const MorphoDepositParams$outboundSchema: z.ZodType<
103
+ MorphoDepositParams$Outbound,
104
+ z.ZodTypeDef,
105
+ MorphoDepositParams
106
+ > = z.object({
107
+ vaultAddress: z.string(),
108
+ amount: z.union([z.number(), z.string()]),
109
+ receiver: z.nullable(z.string()).optional(),
110
+ }).transform((v) => {
111
+ return remap$(v, {
112
+ vaultAddress: "vault_address",
113
+ });
114
+ });
115
+
116
+ /**
117
+ * @internal
118
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
119
+ */
120
+ export namespace MorphoDepositParams$ {
121
+ /** @deprecated use `MorphoDepositParams$inboundSchema` instead. */
122
+ export const inboundSchema = MorphoDepositParams$inboundSchema;
123
+ /** @deprecated use `MorphoDepositParams$outboundSchema` instead. */
124
+ export const outboundSchema = MorphoDepositParams$outboundSchema;
125
+ /** @deprecated use `MorphoDepositParams$Outbound` instead. */
126
+ export type Outbound = MorphoDepositParams$Outbound;
127
+ }
128
+
129
+ export function morphoDepositParamsToJSON(
130
+ morphoDepositParams: MorphoDepositParams,
131
+ ): string {
132
+ return JSON.stringify(
133
+ MorphoDepositParams$outboundSchema.parse(morphoDepositParams),
134
+ );
135
+ }
136
+
137
+ export function morphoDepositParamsFromJSON(
138
+ jsonString: string,
139
+ ): SafeParseResult<MorphoDepositParams, SDKValidationError> {
140
+ return safeParse(
141
+ jsonString,
142
+ (x) => MorphoDepositParams$inboundSchema.parse(JSON.parse(x)),
143
+ `Failed to parse 'MorphoDepositParams' from JSON`,
144
+ );
145
+ }
@@ -0,0 +1,104 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import * as b64$ from "../../lib/base64.js";
7
+ import { remap as remap$ } from "../../lib/primitives.js";
8
+ import { safeParse } from "../../lib/schemas.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type MorphoRepayParams = {
13
+ /**
14
+ * Amount of the token to repay to the market. If set to 'ALL', all debt plus interest will be paid back if the user has a sufficient token balance in their wallet.
15
+ */
16
+ amount?: any | undefined;
17
+ /**
18
+ * The key that uniquely identifies the market. This can be found using the 'Get Markets' endpoint.
19
+ */
20
+ uniqueMarketKey: string;
21
+ /**
22
+ * The address on behalf of whom the repayment is made. Defaults to sender.
23
+ */
24
+ onBehalfOf?: string | null | undefined;
25
+ /**
26
+ * An optional field for callback byte data that will be triggered upon successful repaying of debt.
27
+ */
28
+ callbackData?: Uint8Array | string | null | undefined;
29
+ };
30
+
31
+ /** @internal */
32
+ export const MorphoRepayParams$inboundSchema: z.ZodType<
33
+ MorphoRepayParams,
34
+ z.ZodTypeDef,
35
+ unknown
36
+ > = z.object({
37
+ amount: z.any().optional(),
38
+ unique_market_key: z.string(),
39
+ on_behalf_of: z.nullable(z.string()).optional(),
40
+ callback_data: z.nullable(b64$.zodInbound).optional(),
41
+ }).transform((v) => {
42
+ return remap$(v, {
43
+ "unique_market_key": "uniqueMarketKey",
44
+ "on_behalf_of": "onBehalfOf",
45
+ "callback_data": "callbackData",
46
+ });
47
+ });
48
+
49
+ /** @internal */
50
+ export type MorphoRepayParams$Outbound = {
51
+ amount?: any | undefined;
52
+ unique_market_key: string;
53
+ on_behalf_of?: string | null | undefined;
54
+ callback_data?: Uint8Array | null | undefined;
55
+ };
56
+
57
+ /** @internal */
58
+ export const MorphoRepayParams$outboundSchema: z.ZodType<
59
+ MorphoRepayParams$Outbound,
60
+ z.ZodTypeDef,
61
+ MorphoRepayParams
62
+ > = z.object({
63
+ amount: z.any().optional(),
64
+ uniqueMarketKey: z.string(),
65
+ onBehalfOf: z.nullable(z.string()).optional(),
66
+ callbackData: z.nullable(b64$.zodOutbound).optional(),
67
+ }).transform((v) => {
68
+ return remap$(v, {
69
+ uniqueMarketKey: "unique_market_key",
70
+ onBehalfOf: "on_behalf_of",
71
+ callbackData: "callback_data",
72
+ });
73
+ });
74
+
75
+ /**
76
+ * @internal
77
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
78
+ */
79
+ export namespace MorphoRepayParams$ {
80
+ /** @deprecated use `MorphoRepayParams$inboundSchema` instead. */
81
+ export const inboundSchema = MorphoRepayParams$inboundSchema;
82
+ /** @deprecated use `MorphoRepayParams$outboundSchema` instead. */
83
+ export const outboundSchema = MorphoRepayParams$outboundSchema;
84
+ /** @deprecated use `MorphoRepayParams$Outbound` instead. */
85
+ export type Outbound = MorphoRepayParams$Outbound;
86
+ }
87
+
88
+ export function morphoRepayParamsToJSON(
89
+ morphoRepayParams: MorphoRepayParams,
90
+ ): string {
91
+ return JSON.stringify(
92
+ MorphoRepayParams$outboundSchema.parse(morphoRepayParams),
93
+ );
94
+ }
95
+
96
+ export function morphoRepayParamsFromJSON(
97
+ jsonString: string,
98
+ ): SafeParseResult<MorphoRepayParams, SDKValidationError> {
99
+ return safeParse(
100
+ jsonString,
101
+ (x) => MorphoRepayParams$inboundSchema.parse(JSON.parse(x)),
102
+ `Failed to parse 'MorphoRepayParams' from JSON`,
103
+ );
104
+ }
@@ -0,0 +1,145 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * The amount of tokens to increase the allowance by.
13
+ */
14
+ export type MorphoSetVaultAllowanceParamsAmount = number | string;
15
+
16
+ export type MorphoSetVaultAllowanceParams = {
17
+ /**
18
+ * The vault address you are increasing the allowance for.
19
+ */
20
+ vaultAddress: string;
21
+ /**
22
+ * The amount of tokens to increase the allowance by.
23
+ */
24
+ amount: number | string;
25
+ };
26
+
27
+ /** @internal */
28
+ export const MorphoSetVaultAllowanceParamsAmount$inboundSchema: z.ZodType<
29
+ MorphoSetVaultAllowanceParamsAmount,
30
+ z.ZodTypeDef,
31
+ unknown
32
+ > = z.union([z.number(), z.string()]);
33
+
34
+ /** @internal */
35
+ export type MorphoSetVaultAllowanceParamsAmount$Outbound = number | string;
36
+
37
+ /** @internal */
38
+ export const MorphoSetVaultAllowanceParamsAmount$outboundSchema: z.ZodType<
39
+ MorphoSetVaultAllowanceParamsAmount$Outbound,
40
+ z.ZodTypeDef,
41
+ MorphoSetVaultAllowanceParamsAmount
42
+ > = z.union([z.number(), z.string()]);
43
+
44
+ /**
45
+ * @internal
46
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
47
+ */
48
+ export namespace MorphoSetVaultAllowanceParamsAmount$ {
49
+ /** @deprecated use `MorphoSetVaultAllowanceParamsAmount$inboundSchema` instead. */
50
+ export const inboundSchema =
51
+ MorphoSetVaultAllowanceParamsAmount$inboundSchema;
52
+ /** @deprecated use `MorphoSetVaultAllowanceParamsAmount$outboundSchema` instead. */
53
+ export const outboundSchema =
54
+ MorphoSetVaultAllowanceParamsAmount$outboundSchema;
55
+ /** @deprecated use `MorphoSetVaultAllowanceParamsAmount$Outbound` instead. */
56
+ export type Outbound = MorphoSetVaultAllowanceParamsAmount$Outbound;
57
+ }
58
+
59
+ export function morphoSetVaultAllowanceParamsAmountToJSON(
60
+ morphoSetVaultAllowanceParamsAmount: MorphoSetVaultAllowanceParamsAmount,
61
+ ): string {
62
+ return JSON.stringify(
63
+ MorphoSetVaultAllowanceParamsAmount$outboundSchema.parse(
64
+ morphoSetVaultAllowanceParamsAmount,
65
+ ),
66
+ );
67
+ }
68
+
69
+ export function morphoSetVaultAllowanceParamsAmountFromJSON(
70
+ jsonString: string,
71
+ ): SafeParseResult<MorphoSetVaultAllowanceParamsAmount, SDKValidationError> {
72
+ return safeParse(
73
+ jsonString,
74
+ (x) =>
75
+ MorphoSetVaultAllowanceParamsAmount$inboundSchema.parse(JSON.parse(x)),
76
+ `Failed to parse 'MorphoSetVaultAllowanceParamsAmount' from JSON`,
77
+ );
78
+ }
79
+
80
+ /** @internal */
81
+ export const MorphoSetVaultAllowanceParams$inboundSchema: z.ZodType<
82
+ MorphoSetVaultAllowanceParams,
83
+ z.ZodTypeDef,
84
+ unknown
85
+ > = z.object({
86
+ vault_address: z.string(),
87
+ amount: z.union([z.number(), z.string()]),
88
+ }).transform((v) => {
89
+ return remap$(v, {
90
+ "vault_address": "vaultAddress",
91
+ });
92
+ });
93
+
94
+ /** @internal */
95
+ export type MorphoSetVaultAllowanceParams$Outbound = {
96
+ vault_address: string;
97
+ amount: number | string;
98
+ };
99
+
100
+ /** @internal */
101
+ export const MorphoSetVaultAllowanceParams$outboundSchema: z.ZodType<
102
+ MorphoSetVaultAllowanceParams$Outbound,
103
+ z.ZodTypeDef,
104
+ MorphoSetVaultAllowanceParams
105
+ > = z.object({
106
+ vaultAddress: z.string(),
107
+ amount: z.union([z.number(), z.string()]),
108
+ }).transform((v) => {
109
+ return remap$(v, {
110
+ vaultAddress: "vault_address",
111
+ });
112
+ });
113
+
114
+ /**
115
+ * @internal
116
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
117
+ */
118
+ export namespace MorphoSetVaultAllowanceParams$ {
119
+ /** @deprecated use `MorphoSetVaultAllowanceParams$inboundSchema` instead. */
120
+ export const inboundSchema = MorphoSetVaultAllowanceParams$inboundSchema;
121
+ /** @deprecated use `MorphoSetVaultAllowanceParams$outboundSchema` instead. */
122
+ export const outboundSchema = MorphoSetVaultAllowanceParams$outboundSchema;
123
+ /** @deprecated use `MorphoSetVaultAllowanceParams$Outbound` instead. */
124
+ export type Outbound = MorphoSetVaultAllowanceParams$Outbound;
125
+ }
126
+
127
+ export function morphoSetVaultAllowanceParamsToJSON(
128
+ morphoSetVaultAllowanceParams: MorphoSetVaultAllowanceParams,
129
+ ): string {
130
+ return JSON.stringify(
131
+ MorphoSetVaultAllowanceParams$outboundSchema.parse(
132
+ morphoSetVaultAllowanceParams,
133
+ ),
134
+ );
135
+ }
136
+
137
+ export function morphoSetVaultAllowanceParamsFromJSON(
138
+ jsonString: string,
139
+ ): SafeParseResult<MorphoSetVaultAllowanceParams, SDKValidationError> {
140
+ return safeParse(
141
+ jsonString,
142
+ (x) => MorphoSetVaultAllowanceParams$inboundSchema.parse(JSON.parse(x)),
143
+ `Failed to parse 'MorphoSetVaultAllowanceParams' from JSON`,
144
+ );
145
+ }