@compass-labs/api-sdk 2.1.18-rc.1 → 2.1.18-rc.2

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 (154) hide show
  1. package/README.md +3 -5
  2. package/codeSamples_typescript.yaml +0 -6
  3. package/dist/commonjs/funcs/earnEarnListAaveMarkets.d.ts +10 -4
  4. package/dist/commonjs/funcs/earnEarnListAaveMarkets.d.ts.map +1 -1
  5. package/dist/commonjs/funcs/earnEarnListAaveMarkets.js +10 -4
  6. package/dist/commonjs/funcs/earnEarnListAaveMarkets.js.map +1 -1
  7. package/dist/commonjs/models/components/chainmarketinfo.d.ts +24 -0
  8. package/dist/commonjs/models/components/chainmarketinfo.d.ts.map +1 -0
  9. package/dist/commonjs/models/components/{aavemarketinfo.js → chainmarketinfo.js} +6 -7
  10. package/dist/commonjs/models/components/chainmarketinfo.js.map +1 -0
  11. package/dist/commonjs/models/components/index.d.ts +3 -6
  12. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  13. package/dist/commonjs/models/components/index.js +3 -6
  14. package/dist/commonjs/models/components/index.js.map +1 -1
  15. package/dist/commonjs/models/components/listaavemarketsresponse.d.ts +6 -9
  16. package/dist/commonjs/models/components/listaavemarketsresponse.d.ts.map +1 -1
  17. package/dist/commonjs/models/components/listaavemarketsresponse.js +2 -9
  18. package/dist/commonjs/models/components/listaavemarketsresponse.js.map +1 -1
  19. package/dist/commonjs/models/components/maxsupplyapyinfo.d.ts +28 -0
  20. package/dist/commonjs/models/components/maxsupplyapyinfo.d.ts.map +1 -0
  21. package/dist/commonjs/models/components/{chainratedata.js → maxsupplyapyinfo.js} +12 -10
  22. package/dist/commonjs/models/components/maxsupplyapyinfo.js.map +1 -0
  23. package/dist/commonjs/models/components/tokenmarketdata.d.ts +24 -0
  24. package/dist/commonjs/models/components/tokenmarketdata.d.ts.map +1 -0
  25. package/dist/commonjs/models/components/{aaveusdcratesresponse.js → tokenmarketdata.js} +11 -13
  26. package/dist/commonjs/models/components/tokenmarketdata.js.map +1 -0
  27. package/dist/commonjs/models/operations/index.d.ts +0 -1
  28. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  29. package/dist/commonjs/models/operations/index.js +0 -1
  30. package/dist/commonjs/models/operations/index.js.map +1 -1
  31. package/dist/commonjs/sdk/earn.d.ts +9 -10
  32. package/dist/commonjs/sdk/earn.d.ts.map +1 -1
  33. package/dist/commonjs/sdk/earn.js +9 -13
  34. package/dist/commonjs/sdk/earn.js.map +1 -1
  35. package/dist/esm/funcs/earnEarnListAaveMarkets.d.ts +10 -4
  36. package/dist/esm/funcs/earnEarnListAaveMarkets.d.ts.map +1 -1
  37. package/dist/esm/funcs/earnEarnListAaveMarkets.js +10 -4
  38. package/dist/esm/funcs/earnEarnListAaveMarkets.js.map +1 -1
  39. package/dist/esm/models/components/chainmarketinfo.d.ts +24 -0
  40. package/dist/esm/models/components/chainmarketinfo.d.ts.map +1 -0
  41. package/dist/esm/models/components/{aavemarketinfo.js → chainmarketinfo.js} +4 -5
  42. package/dist/esm/models/components/chainmarketinfo.js.map +1 -0
  43. package/dist/esm/models/components/index.d.ts +3 -6
  44. package/dist/esm/models/components/index.d.ts.map +1 -1
  45. package/dist/esm/models/components/index.js +3 -6
  46. package/dist/esm/models/components/index.js.map +1 -1
  47. package/dist/esm/models/components/listaavemarketsresponse.d.ts +6 -9
  48. package/dist/esm/models/components/listaavemarketsresponse.d.ts.map +1 -1
  49. package/dist/esm/models/components/listaavemarketsresponse.js +2 -9
  50. package/dist/esm/models/components/listaavemarketsresponse.js.map +1 -1
  51. package/dist/esm/models/components/maxsupplyapyinfo.d.ts +28 -0
  52. package/dist/esm/models/components/maxsupplyapyinfo.d.ts.map +1 -0
  53. package/dist/esm/models/components/maxsupplyapyinfo.js +22 -0
  54. package/dist/esm/models/components/maxsupplyapyinfo.js.map +1 -0
  55. package/dist/esm/models/components/tokenmarketdata.d.ts +24 -0
  56. package/dist/esm/models/components/tokenmarketdata.d.ts.map +1 -0
  57. package/dist/esm/models/components/tokenmarketdata.js +21 -0
  58. package/dist/esm/models/components/tokenmarketdata.js.map +1 -0
  59. package/dist/esm/models/operations/index.d.ts +0 -1
  60. package/dist/esm/models/operations/index.d.ts.map +1 -1
  61. package/dist/esm/models/operations/index.js +0 -1
  62. package/dist/esm/models/operations/index.js.map +1 -1
  63. package/dist/esm/sdk/earn.d.ts +9 -10
  64. package/dist/esm/sdk/earn.d.ts.map +1 -1
  65. package/dist/esm/sdk/earn.js +9 -13
  66. package/dist/esm/sdk/earn.js.map +1 -1
  67. package/docs/models/components/chainmarketinfo.md +23 -0
  68. package/docs/models/components/listaavemarketsresponse.md +16 -13
  69. package/docs/models/components/maxsupplyapyinfo.md +25 -0
  70. package/docs/models/components/tokenmarketdata.md +26 -0
  71. package/docs/sdks/earn/README.md +9 -78
  72. package/package.json +1 -1
  73. package/src/funcs/earnEarnListAaveMarkets.ts +10 -4
  74. package/src/models/components/{aavemarketinfo.ts → chainmarketinfo.ts} +11 -16
  75. package/src/models/components/index.ts +3 -6
  76. package/src/models/components/listaavemarketsresponse.ts +7 -21
  77. package/src/models/components/maxsupplyapyinfo.ts +58 -0
  78. package/src/models/components/tokenmarketdata.ts +55 -0
  79. package/src/models/operations/index.ts +0 -1
  80. package/src/sdk/earn.ts +9 -21
  81. package/dist/commonjs/funcs/earnEarnAaveTokenRates.d.ts +0 -19
  82. package/dist/commonjs/funcs/earnEarnAaveTokenRates.d.ts.map +0 -1
  83. package/dist/commonjs/funcs/earnEarnAaveTokenRates.js +0 -122
  84. package/dist/commonjs/funcs/earnEarnAaveTokenRates.js.map +0 -1
  85. package/dist/commonjs/models/components/aavemarketinfo.d.ts +0 -28
  86. package/dist/commonjs/models/components/aavemarketinfo.d.ts.map +0 -1
  87. package/dist/commonjs/models/components/aavemarketinfo.js.map +0 -1
  88. package/dist/commonjs/models/components/aaveusdcratesresponse.d.ts +0 -30
  89. package/dist/commonjs/models/components/aaveusdcratesresponse.d.ts.map +0 -1
  90. package/dist/commonjs/models/components/aaveusdcratesresponse.js.map +0 -1
  91. package/dist/commonjs/models/components/chainaavemarkets.d.ts +0 -21
  92. package/dist/commonjs/models/components/chainaavemarkets.d.ts.map +0 -1
  93. package/dist/commonjs/models/components/chainaavemarkets.js +0 -52
  94. package/dist/commonjs/models/components/chainaavemarkets.js.map +0 -1
  95. package/dist/commonjs/models/components/chainratedata.d.ts +0 -20
  96. package/dist/commonjs/models/components/chainratedata.d.ts.map +0 -1
  97. package/dist/commonjs/models/components/chainratedata.js.map +0 -1
  98. package/dist/commonjs/models/components/maxsupplyapydata.d.ts +0 -21
  99. package/dist/commonjs/models/components/maxsupplyapydata.d.ts.map +0 -1
  100. package/dist/commonjs/models/components/maxsupplyapydata.js +0 -52
  101. package/dist/commonjs/models/components/maxsupplyapydata.js.map +0 -1
  102. package/dist/commonjs/models/components/maxsupplyapymarket.d.ts +0 -21
  103. package/dist/commonjs/models/components/maxsupplyapymarket.d.ts.map +0 -1
  104. package/dist/commonjs/models/components/maxsupplyapymarket.js +0 -52
  105. package/dist/commonjs/models/components/maxsupplyapymarket.js.map +0 -1
  106. package/dist/commonjs/models/operations/v2earnaavetokenrates.d.ts +0 -15
  107. package/dist/commonjs/models/operations/v2earnaavetokenrates.d.ts.map +0 -1
  108. package/dist/commonjs/models/operations/v2earnaavetokenrates.js +0 -49
  109. package/dist/commonjs/models/operations/v2earnaavetokenrates.js.map +0 -1
  110. package/dist/esm/funcs/earnEarnAaveTokenRates.d.ts +0 -19
  111. package/dist/esm/funcs/earnEarnAaveTokenRates.d.ts.map +0 -1
  112. package/dist/esm/funcs/earnEarnAaveTokenRates.js +0 -86
  113. package/dist/esm/funcs/earnEarnAaveTokenRates.js.map +0 -1
  114. package/dist/esm/models/components/aavemarketinfo.d.ts +0 -28
  115. package/dist/esm/models/components/aavemarketinfo.d.ts.map +0 -1
  116. package/dist/esm/models/components/aavemarketinfo.js.map +0 -1
  117. package/dist/esm/models/components/aaveusdcratesresponse.d.ts +0 -30
  118. package/dist/esm/models/components/aaveusdcratesresponse.d.ts.map +0 -1
  119. package/dist/esm/models/components/aaveusdcratesresponse.js +0 -23
  120. package/dist/esm/models/components/aaveusdcratesresponse.js.map +0 -1
  121. package/dist/esm/models/components/chainaavemarkets.d.ts +0 -21
  122. package/dist/esm/models/components/chainaavemarkets.d.ts.map +0 -1
  123. package/dist/esm/models/components/chainaavemarkets.js +0 -15
  124. package/dist/esm/models/components/chainaavemarkets.js.map +0 -1
  125. package/dist/esm/models/components/chainratedata.d.ts +0 -20
  126. package/dist/esm/models/components/chainratedata.d.ts.map +0 -1
  127. package/dist/esm/models/components/chainratedata.js +0 -20
  128. package/dist/esm/models/components/chainratedata.js.map +0 -1
  129. package/dist/esm/models/components/maxsupplyapydata.d.ts +0 -21
  130. package/dist/esm/models/components/maxsupplyapydata.d.ts.map +0 -1
  131. package/dist/esm/models/components/maxsupplyapydata.js +0 -15
  132. package/dist/esm/models/components/maxsupplyapydata.js.map +0 -1
  133. package/dist/esm/models/components/maxsupplyapymarket.d.ts +0 -21
  134. package/dist/esm/models/components/maxsupplyapymarket.d.ts.map +0 -1
  135. package/dist/esm/models/components/maxsupplyapymarket.js +0 -15
  136. package/dist/esm/models/components/maxsupplyapymarket.js.map +0 -1
  137. package/dist/esm/models/operations/v2earnaavetokenrates.d.ts +0 -15
  138. package/dist/esm/models/operations/v2earnaavetokenrates.d.ts.map +0 -1
  139. package/dist/esm/models/operations/v2earnaavetokenrates.js +0 -12
  140. package/dist/esm/models/operations/v2earnaavetokenrates.js.map +0 -1
  141. package/docs/models/components/aavemarketinfo.md +0 -25
  142. package/docs/models/components/aaveusdcratesresponse.md +0 -40
  143. package/docs/models/components/chainaavemarkets.md +0 -21
  144. package/docs/models/components/chainratedata.md +0 -21
  145. package/docs/models/components/maxsupplyapydata.md +0 -24
  146. package/docs/models/components/maxsupplyapymarket.md +0 -26
  147. package/docs/models/operations/v2earnaavetokenratesrequest.md +0 -17
  148. package/src/funcs/earnEarnAaveTokenRates.ts +0 -175
  149. package/src/models/components/aaveusdcratesresponse.ts +0 -62
  150. package/src/models/components/chainaavemarkets.ts +0 -46
  151. package/src/models/components/chainratedata.ts +0 -48
  152. package/src/models/components/maxsupplyapydata.ts +0 -43
  153. package/src/models/components/maxsupplyapymarket.ts +0 -46
  154. package/src/models/operations/v2earnaavetokenrates.ts +0 -36
@@ -1,17 +0,0 @@
1
- # V2EarnAaveTokenRatesRequest
2
-
3
- ## Example Usage
4
-
5
- ```typescript
6
- import { V2EarnAaveTokenRatesRequest } from "@compass-labs/api-sdk/models/operations";
7
-
8
- let value: V2EarnAaveTokenRatesRequest = {
9
- token: "USDC",
10
- };
11
- ```
12
-
13
- ## Fields
14
-
15
- | Field | Type | Required | Description | Example |
16
- | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ |
17
- | `token` | *string* | :heavy_check_mark: | The symbol or address of the token to fetch rates for. | USDC |
@@ -1,175 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { CompassApiSDKCore } from "../core.js";
6
- import { encodeFormQuery } from "../lib/encodings.js";
7
- import * as M from "../lib/matchers.js";
8
- import { compactMap } from "../lib/primitives.js";
9
- import { safeParse } from "../lib/schemas.js";
10
- import { RequestOptions } from "../lib/sdks.js";
11
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
- import { pathToFunc } from "../lib/url.js";
13
- import * as components from "../models/components/index.js";
14
- import { CompassAPISDKError } from "../models/errors/compassapisdkerror.js";
15
- import {
16
- ConnectionError,
17
- InvalidRequestError,
18
- RequestAbortedError,
19
- RequestTimeoutError,
20
- UnexpectedClientError,
21
- } from "../models/errors/httpclienterrors.js";
22
- import * as errors from "../models/errors/index.js";
23
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
- import * as operations from "../models/operations/index.js";
26
- import { APICall, APIPromise } from "../types/async.js";
27
- import { Result } from "../types/fp.js";
28
-
29
- /**
30
- * Get token rates on Aave
31
- *
32
- * @remarks
33
- * This endpoint fetches token rates on Aave across Ethereum, Base, and Arbitrum.
34
- */
35
- export function earnEarnAaveTokenRates(
36
- client: CompassApiSDKCore,
37
- request: operations.V2EarnAaveTokenRatesRequest,
38
- options?: RequestOptions,
39
- ): APIPromise<
40
- Result<
41
- components.AaveUsdcRatesResponse,
42
- | errors.HTTPValidationError
43
- | CompassAPISDKError
44
- | ResponseValidationError
45
- | ConnectionError
46
- | RequestAbortedError
47
- | RequestTimeoutError
48
- | InvalidRequestError
49
- | UnexpectedClientError
50
- | SDKValidationError
51
- >
52
- > {
53
- return new APIPromise($do(
54
- client,
55
- request,
56
- options,
57
- ));
58
- }
59
-
60
- async function $do(
61
- client: CompassApiSDKCore,
62
- request: operations.V2EarnAaveTokenRatesRequest,
63
- options?: RequestOptions,
64
- ): Promise<
65
- [
66
- Result<
67
- components.AaveUsdcRatesResponse,
68
- | errors.HTTPValidationError
69
- | CompassAPISDKError
70
- | ResponseValidationError
71
- | ConnectionError
72
- | RequestAbortedError
73
- | RequestTimeoutError
74
- | InvalidRequestError
75
- | UnexpectedClientError
76
- | SDKValidationError
77
- >,
78
- APICall,
79
- ]
80
- > {
81
- const parsed = safeParse(
82
- request,
83
- (value) =>
84
- operations.V2EarnAaveTokenRatesRequest$outboundSchema.parse(value),
85
- "Input validation failed",
86
- );
87
- if (!parsed.ok) {
88
- return [parsed, { status: "invalid" }];
89
- }
90
- const payload = parsed.value;
91
- const body = null;
92
-
93
- const path = pathToFunc("/v2/earn/aave_token_rates")();
94
-
95
- const query = encodeFormQuery({
96
- "token": payload.token,
97
- });
98
-
99
- const headers = new Headers(compactMap({
100
- Accept: "application/json",
101
- }));
102
-
103
- const secConfig = await extractSecurity(client._options.apiKeyAuth);
104
- const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
105
- const requestSecurity = resolveGlobalSecurity(securityInput);
106
-
107
- const context = {
108
- options: client._options,
109
- baseURL: options?.serverURL ?? client._baseURL ?? "",
110
- operationID: "v2_earn_aave_token_rates",
111
- oAuth2Scopes: null,
112
-
113
- resolvedSecurity: requestSecurity,
114
-
115
- securitySource: client._options.apiKeyAuth,
116
- retryConfig: options?.retries
117
- || client._options.retryConfig
118
- || { strategy: "none" },
119
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
120
- };
121
-
122
- const requestRes = client._createRequest(context, {
123
- security: requestSecurity,
124
- method: "GET",
125
- baseURL: options?.serverURL,
126
- path: path,
127
- headers: headers,
128
- query: query,
129
- body: body,
130
- userAgent: client._options.userAgent,
131
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
132
- }, options);
133
- if (!requestRes.ok) {
134
- return [requestRes, { status: "invalid" }];
135
- }
136
- const req = requestRes.value;
137
-
138
- const doResult = await client._do(req, {
139
- context,
140
- errorCodes: ["422", "4XX", "5XX"],
141
- retryConfig: context.retryConfig,
142
- retryCodes: context.retryCodes,
143
- });
144
- if (!doResult.ok) {
145
- return [doResult, { status: "request-error", request: req }];
146
- }
147
- const response = doResult.value;
148
-
149
- const responseFields = {
150
- HttpMeta: { Response: response, Request: req },
151
- };
152
-
153
- const [result] = await M.match<
154
- components.AaveUsdcRatesResponse,
155
- | errors.HTTPValidationError
156
- | CompassAPISDKError
157
- | ResponseValidationError
158
- | ConnectionError
159
- | RequestAbortedError
160
- | RequestTimeoutError
161
- | InvalidRequestError
162
- | UnexpectedClientError
163
- | SDKValidationError
164
- >(
165
- M.json(200, components.AaveUsdcRatesResponse$inboundSchema),
166
- M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
167
- M.fail("4XX"),
168
- M.fail("5XX"),
169
- )(response, req, { extraFields: responseFields });
170
- if (!result.ok) {
171
- return [result, { status: "complete", request: req, response }];
172
- }
173
-
174
- return [result, { status: "complete", request: req, response }];
175
- }
@@ -1,62 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v3";
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 { ChainRateData, ChainRateData$inboundSchema } from "./chainratedata.js";
11
- import {
12
- MaxSupplyApyData,
13
- MaxSupplyApyData$inboundSchema,
14
- } from "./maxsupplyapydata.js";
15
-
16
- /**
17
- * Response containing token rates on Aave for Ethereum, Base, and Arbitrum.
18
- */
19
- export type AaveUsdcRatesResponse = {
20
- /**
21
- * Rate data for a specific chain.
22
- */
23
- ethereum: ChainRateData;
24
- /**
25
- * Rate data for a specific chain.
26
- */
27
- base: ChainRateData;
28
- /**
29
- * Rate data for a specific chain.
30
- */
31
- arbitrum: ChainRateData;
32
- /**
33
- * Data for the chain with the highest supply APY.
34
- */
35
- supplyApyMax: MaxSupplyApyData;
36
- };
37
-
38
- /** @internal */
39
- export const AaveUsdcRatesResponse$inboundSchema: z.ZodType<
40
- AaveUsdcRatesResponse,
41
- z.ZodTypeDef,
42
- unknown
43
- > = z.object({
44
- ethereum: ChainRateData$inboundSchema,
45
- base: ChainRateData$inboundSchema,
46
- arbitrum: ChainRateData$inboundSchema,
47
- supply_apy_max: MaxSupplyApyData$inboundSchema,
48
- }).transform((v) => {
49
- return remap$(v, {
50
- "supply_apy_max": "supplyApyMax",
51
- });
52
- });
53
-
54
- export function aaveUsdcRatesResponseFromJSON(
55
- jsonString: string,
56
- ): SafeParseResult<AaveUsdcRatesResponse, SDKValidationError> {
57
- return safeParse(
58
- jsonString,
59
- (x) => AaveUsdcRatesResponse$inboundSchema.parse(JSON.parse(x)),
60
- `Failed to parse 'AaveUsdcRatesResponse' from JSON`,
61
- );
62
- }
@@ -1,46 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v3";
6
- import { safeParse } from "../../lib/schemas.js";
7
- import { Result as SafeParseResult } from "../../types/fp.js";
8
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
- import {
10
- AaveMarketInfo,
11
- AaveMarketInfo$inboundSchema,
12
- } from "./aavemarketinfo.js";
13
-
14
- /**
15
- * Aave market data for a specific chain.
16
- */
17
- export type ChainAaveMarkets = {
18
- /**
19
- * Chain name (ethereum, base, or arbitrum).
20
- */
21
- chain: string;
22
- /**
23
- * List of all Aave markets with their rates on this chain.
24
- */
25
- markets: Array<AaveMarketInfo>;
26
- };
27
-
28
- /** @internal */
29
- export const ChainAaveMarkets$inboundSchema: z.ZodType<
30
- ChainAaveMarkets,
31
- z.ZodTypeDef,
32
- unknown
33
- > = z.object({
34
- chain: z.string(),
35
- markets: z.array(AaveMarketInfo$inboundSchema),
36
- });
37
-
38
- export function chainAaveMarketsFromJSON(
39
- jsonString: string,
40
- ): SafeParseResult<ChainAaveMarkets, SDKValidationError> {
41
- return safeParse(
42
- jsonString,
43
- (x) => ChainAaveMarkets$inboundSchema.parse(JSON.parse(x)),
44
- `Failed to parse 'ChainAaveMarkets' from JSON`,
45
- );
46
- }
@@ -1,48 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v3";
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
- * Rate data for a specific chain.
13
- */
14
- export type ChainRateData = {
15
- /**
16
- * Variable rate APY for deposits.
17
- */
18
- supplyApyVariableRate: string;
19
- /**
20
- * Variable rate APY for loans.
21
- */
22
- borrowApyVariableRate: string;
23
- };
24
-
25
- /** @internal */
26
- export const ChainRateData$inboundSchema: z.ZodType<
27
- ChainRateData,
28
- z.ZodTypeDef,
29
- unknown
30
- > = z.object({
31
- supply_apy_variable_rate: z.string(),
32
- borrow_apy_variable_rate: z.string(),
33
- }).transform((v) => {
34
- return remap$(v, {
35
- "supply_apy_variable_rate": "supplyApyVariableRate",
36
- "borrow_apy_variable_rate": "borrowApyVariableRate",
37
- });
38
- });
39
-
40
- export function chainRateDataFromJSON(
41
- jsonString: string,
42
- ): SafeParseResult<ChainRateData, SDKValidationError> {
43
- return safeParse(
44
- jsonString,
45
- (x) => ChainRateData$inboundSchema.parse(JSON.parse(x)),
46
- `Failed to parse 'ChainRateData' from JSON`,
47
- );
48
- }
@@ -1,43 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v3";
6
- import { safeParse } from "../../lib/schemas.js";
7
- import { Result as SafeParseResult } from "../../types/fp.js";
8
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
- import { ChainRateData, ChainRateData$inboundSchema } from "./chainratedata.js";
10
-
11
- /**
12
- * Data for the chain with the highest supply APY.
13
- */
14
- export type MaxSupplyApyData = {
15
- /**
16
- * Name of the chain with the highest supply APY (ethereum, base, or arbitrum).
17
- */
18
- chain: string;
19
- /**
20
- * Rate data for a specific chain.
21
- */
22
- rates: ChainRateData;
23
- };
24
-
25
- /** @internal */
26
- export const MaxSupplyApyData$inboundSchema: z.ZodType<
27
- MaxSupplyApyData,
28
- z.ZodTypeDef,
29
- unknown
30
- > = z.object({
31
- chain: z.string(),
32
- rates: ChainRateData$inboundSchema,
33
- });
34
-
35
- export function maxSupplyApyDataFromJSON(
36
- jsonString: string,
37
- ): SafeParseResult<MaxSupplyApyData, SDKValidationError> {
38
- return safeParse(
39
- jsonString,
40
- (x) => MaxSupplyApyData$inboundSchema.parse(JSON.parse(x)),
41
- `Failed to parse 'MaxSupplyApyData' from JSON`,
42
- );
43
- }
@@ -1,46 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v3";
6
- import { safeParse } from "../../lib/schemas.js";
7
- import { Result as SafeParseResult } from "../../types/fp.js";
8
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
- import {
10
- AaveMarketInfo,
11
- AaveMarketInfo$inboundSchema,
12
- } from "./aavemarketinfo.js";
13
-
14
- /**
15
- * Information about the market with the highest supply APY.
16
- */
17
- export type MaxSupplyApyMarket = {
18
- /**
19
- * Chain name where this market exists.
20
- */
21
- chain: string;
22
- /**
23
- * Rate information for a single token on Aave.
24
- */
25
- market: AaveMarketInfo;
26
- };
27
-
28
- /** @internal */
29
- export const MaxSupplyApyMarket$inboundSchema: z.ZodType<
30
- MaxSupplyApyMarket,
31
- z.ZodTypeDef,
32
- unknown
33
- > = z.object({
34
- chain: z.string(),
35
- market: AaveMarketInfo$inboundSchema,
36
- });
37
-
38
- export function maxSupplyApyMarketFromJSON(
39
- jsonString: string,
40
- ): SafeParseResult<MaxSupplyApyMarket, SDKValidationError> {
41
- return safeParse(
42
- jsonString,
43
- (x) => MaxSupplyApyMarket$inboundSchema.parse(JSON.parse(x)),
44
- `Failed to parse 'MaxSupplyApyMarket' from JSON`,
45
- );
46
- }
@@ -1,36 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v3";
6
-
7
- export type V2EarnAaveTokenRatesRequest = {
8
- /**
9
- * The symbol or address of the token to fetch rates for.
10
- */
11
- token: string;
12
- };
13
-
14
- /** @internal */
15
- export type V2EarnAaveTokenRatesRequest$Outbound = {
16
- token: string;
17
- };
18
-
19
- /** @internal */
20
- export const V2EarnAaveTokenRatesRequest$outboundSchema: z.ZodType<
21
- V2EarnAaveTokenRatesRequest$Outbound,
22
- z.ZodTypeDef,
23
- V2EarnAaveTokenRatesRequest
24
- > = z.object({
25
- token: z.string(),
26
- });
27
-
28
- export function v2EarnAaveTokenRatesRequestToJSON(
29
- v2EarnAaveTokenRatesRequest: V2EarnAaveTokenRatesRequest,
30
- ): string {
31
- return JSON.stringify(
32
- V2EarnAaveTokenRatesRequest$outboundSchema.parse(
33
- v2EarnAaveTokenRatesRequest,
34
- ),
35
- );
36
- }