@compass-labs/api-sdk 2.1.4 → 2.1.5-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.
- package/README.md +2 -0
- package/dist/commonjs/funcs/earnEarnAaveTokenRates.d.ts +19 -0
- package/dist/commonjs/funcs/earnEarnAaveTokenRates.d.ts.map +1 -0
- package/dist/commonjs/funcs/earnEarnAaveTokenRates.js +122 -0
- package/dist/commonjs/funcs/earnEarnAaveTokenRates.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/components/aaveusdcratesresponse.d.ts +30 -0
- package/dist/commonjs/models/components/aaveusdcratesresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/aaveusdcratesresponse.js +60 -0
- package/dist/commonjs/models/components/aaveusdcratesresponse.js.map +1 -0
- package/dist/commonjs/models/components/chainratedata.d.ts +20 -0
- package/dist/commonjs/models/components/chainratedata.d.ts.map +1 -0
- package/dist/commonjs/models/components/chainratedata.js +57 -0
- package/dist/commonjs/models/components/chainratedata.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +3 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +3 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/maxsupplyapydata.d.ts +21 -0
- package/dist/commonjs/models/components/maxsupplyapydata.d.ts.map +1 -0
- package/dist/commonjs/models/components/maxsupplyapydata.js +52 -0
- package/dist/commonjs/models/components/maxsupplyapydata.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/v2earnaavetokenrates.d.ts +15 -0
- package/dist/commonjs/models/operations/v2earnaavetokenrates.d.ts.map +1 -0
- package/dist/commonjs/models/operations/v2earnaavetokenrates.js +49 -0
- package/dist/commonjs/models/operations/v2earnaavetokenrates.js.map +1 -0
- package/dist/commonjs/sdk/earn.d.ts +7 -0
- package/dist/commonjs/sdk/earn.d.ts.map +1 -1
- package/dist/commonjs/sdk/earn.js +10 -0
- package/dist/commonjs/sdk/earn.js.map +1 -1
- package/dist/commonjs/types/enums.d.ts +1 -8
- package/dist/commonjs/types/enums.d.ts.map +1 -1
- package/dist/commonjs/types/enums.js +3 -21
- package/dist/commonjs/types/enums.js.map +1 -1
- package/dist/commonjs/types/index.d.ts +2 -1
- package/dist/commonjs/types/index.d.ts.map +1 -1
- package/dist/commonjs/types/index.js +15 -0
- package/dist/commonjs/types/index.js.map +1 -1
- package/dist/commonjs/types/unrecognized.d.ts +10 -0
- package/dist/commonjs/types/unrecognized.d.ts.map +1 -0
- package/dist/commonjs/types/unrecognized.js +26 -0
- package/dist/commonjs/types/unrecognized.js.map +1 -0
- package/dist/esm/funcs/earnEarnAaveTokenRates.d.ts +19 -0
- package/dist/esm/funcs/earnEarnAaveTokenRates.d.ts.map +1 -0
- package/dist/esm/funcs/earnEarnAaveTokenRates.js +86 -0
- package/dist/esm/funcs/earnEarnAaveTokenRates.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/components/aaveusdcratesresponse.d.ts +30 -0
- package/dist/esm/models/components/aaveusdcratesresponse.d.ts.map +1 -0
- package/dist/esm/models/components/aaveusdcratesresponse.js +23 -0
- package/dist/esm/models/components/aaveusdcratesresponse.js.map +1 -0
- package/dist/esm/models/components/chainratedata.d.ts +20 -0
- package/dist/esm/models/components/chainratedata.d.ts.map +1 -0
- package/dist/esm/models/components/chainratedata.js +20 -0
- package/dist/esm/models/components/chainratedata.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +3 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +3 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/maxsupplyapydata.d.ts +21 -0
- package/dist/esm/models/components/maxsupplyapydata.d.ts.map +1 -0
- package/dist/esm/models/components/maxsupplyapydata.js +15 -0
- package/dist/esm/models/components/maxsupplyapydata.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/v2earnaavetokenrates.d.ts +15 -0
- package/dist/esm/models/operations/v2earnaavetokenrates.d.ts.map +1 -0
- package/dist/esm/models/operations/v2earnaavetokenrates.js +12 -0
- package/dist/esm/models/operations/v2earnaavetokenrates.js.map +1 -0
- package/dist/esm/sdk/earn.d.ts +7 -0
- package/dist/esm/sdk/earn.d.ts.map +1 -1
- package/dist/esm/sdk/earn.js +10 -0
- package/dist/esm/sdk/earn.js.map +1 -1
- package/dist/esm/types/enums.d.ts +1 -8
- package/dist/esm/types/enums.d.ts.map +1 -1
- package/dist/esm/types/enums.js +1 -18
- package/dist/esm/types/enums.js.map +1 -1
- package/dist/esm/types/index.d.ts +2 -1
- package/dist/esm/types/index.d.ts.map +1 -1
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/types/index.js.map +1 -1
- package/dist/esm/types/unrecognized.d.ts +10 -0
- package/dist/esm/types/unrecognized.d.ts.map +1 -0
- package/dist/esm/types/unrecognized.js +23 -0
- package/dist/esm/types/unrecognized.js.map +1 -0
- package/package.json +1 -1
- package/src/funcs/earnEarnAaveTokenRates.ts +175 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/aaveusdcratesresponse.ts +62 -0
- package/src/models/components/chainratedata.ts +48 -0
- package/src/models/components/index.ts +3 -0
- package/src/models/components/maxsupplyapydata.ts +43 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/v2earnaavetokenrates.ts +36 -0
- package/src/sdk/earn.ts +18 -0
- package/src/types/enums.ts +1 -21
- package/src/types/index.ts +2 -1
- package/src/types/unrecognized.ts +27 -0
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
}
|
|
@@ -19,6 +19,7 @@ export * from "./aavesupplyrequest.js";
|
|
|
19
19
|
export * from "./aavesupportedtokenmetadata.js";
|
|
20
20
|
export * from "./aavesupportedtokensresponse.js";
|
|
21
21
|
export * from "./aavetokenpriceresponse.js";
|
|
22
|
+
export * from "./aaveusdcratesresponse.js";
|
|
22
23
|
export * from "./aaveuserpositionpertokenresponse.js";
|
|
23
24
|
export * from "./aaveuserpositionsummaryresponse.js";
|
|
24
25
|
export * from "./aavevenue.js";
|
|
@@ -49,6 +50,7 @@ export * from "./borrow.js";
|
|
|
49
50
|
export * from "./bundlertransactionresponse.js";
|
|
50
51
|
export * from "./chain.js";
|
|
51
52
|
export * from "./chaininfo.js";
|
|
53
|
+
export * from "./chainratedata.js";
|
|
52
54
|
export * from "./compassapibackendv1modelsgenericreadresponseportfoliotokenbalance.js";
|
|
53
55
|
export * from "./compassapibackendv1modelsmorphoreadresponsecheckuserpositionapydata.js";
|
|
54
56
|
export * from "./compassapibackendv1modelsmorphoreadresponsecheckuserpositionasset.js";
|
|
@@ -103,6 +105,7 @@ export * from "./lpbalance.js";
|
|
|
103
105
|
export * from "./market.js";
|
|
104
106
|
export * from "./marketposition.js";
|
|
105
107
|
export * from "./markettokens.js";
|
|
108
|
+
export * from "./maxsupplyapydata.js";
|
|
106
109
|
export * from "./morphoborrowparams.js";
|
|
107
110
|
export * from "./morphoborrowrequest.js";
|
|
108
111
|
export * from "./morphocheckmarketpositionresponse.js";
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
}
|
|
@@ -40,6 +40,7 @@ export * from "./v1uniswapquotebuyexactly.js";
|
|
|
40
40
|
export * from "./v1uniswapquotesellexactly.js";
|
|
41
41
|
export * from "./v1vaultsvault.js";
|
|
42
42
|
export * from "./v1wildcatmarket.js";
|
|
43
|
+
export * from "./v2earnaavetokenrates.js";
|
|
43
44
|
export * from "./v2earnpositions.js";
|
|
44
45
|
export * from "./v2earnpositionspositionid.js";
|
|
45
46
|
export * from "./v2earnvaults.js";
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
}
|
package/src/sdk/earn.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import { earnEarnAaveTokenRates } from "../funcs/earnEarnAaveTokenRates.js";
|
|
5
6
|
import { earnEarnCreateAccount } from "../funcs/earnEarnCreateAccount.js";
|
|
6
7
|
import { earnEarnManage } from "../funcs/earnEarnManage.js";
|
|
7
8
|
import { earnEarnPositions } from "../funcs/earnEarnPositions.js";
|
|
@@ -65,6 +66,23 @@ export class Earn extends ClientSDK {
|
|
|
65
66
|
));
|
|
66
67
|
}
|
|
67
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Get token rates on Aave
|
|
71
|
+
*
|
|
72
|
+
* @remarks
|
|
73
|
+
* This endpoint fetches token rates on Aave across Ethereum, Base, and Arbitrum.
|
|
74
|
+
*/
|
|
75
|
+
async earnAaveTokenRates(
|
|
76
|
+
request: operations.V2EarnAaveTokenRatesRequest,
|
|
77
|
+
options?: RequestOptions,
|
|
78
|
+
): Promise<components.AaveUsdcRatesResponse> {
|
|
79
|
+
return unwrapAsync(earnEarnAaveTokenRates(
|
|
80
|
+
this,
|
|
81
|
+
request,
|
|
82
|
+
options,
|
|
83
|
+
));
|
|
84
|
+
}
|
|
85
|
+
|
|
68
86
|
/**
|
|
69
87
|
* Create earn account
|
|
70
88
|
*
|
package/src/types/enums.ts
CHANGED
|
@@ -3,34 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
|
+
import { Unrecognized, unrecognized } from "./unrecognized.js";
|
|
6
7
|
|
|
7
|
-
declare const __brand: unique symbol;
|
|
8
|
-
export type Unrecognized<T> = T & { [__brand]: "unrecognized" };
|
|
9
8
|
export type ClosedEnum<T extends Readonly<Record<string, string | number>>> =
|
|
10
9
|
T[keyof T];
|
|
11
10
|
export type OpenEnum<T extends Readonly<Record<string, string | number>>> =
|
|
12
11
|
| T[keyof T]
|
|
13
12
|
| Unrecognized<T[keyof T] extends number ? number : string>;
|
|
14
13
|
|
|
15
|
-
function unrecognized<T>(value: T): Unrecognized<T> {
|
|
16
|
-
unrecognizedCount++;
|
|
17
|
-
return value as Unrecognized<T>;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
let unrecognizedCount = 0;
|
|
21
|
-
let refCount = 0;
|
|
22
|
-
export function unrecognizedCounter() {
|
|
23
|
-
refCount++;
|
|
24
|
-
const start = unrecognizedCount;
|
|
25
|
-
return {
|
|
26
|
-
count: () => {
|
|
27
|
-
const count = unrecognizedCount - start;
|
|
28
|
-
if (--refCount === 0) unrecognizedCount = 0;
|
|
29
|
-
return count;
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
14
|
export function inboundSchema<T extends Record<string, string>>(
|
|
35
15
|
enumObj: T,
|
|
36
16
|
): z.ZodType<OpenEnum<T>, z.ZodTypeDef, unknown> {
|
package/src/types/index.ts
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
export { blobLikeSchema, isBlobLike } from "./blobs.js";
|
|
6
|
-
export type { ClosedEnum, OpenEnum
|
|
6
|
+
export type { ClosedEnum, OpenEnum } from "./enums.js";
|
|
7
7
|
export type { Result } from "./fp.js";
|
|
8
8
|
export type { PageIterator, Paginator } from "./operations.js";
|
|
9
9
|
export { createPageIterator } from "./operations.js";
|
|
10
10
|
export { RFCDate } from "./rfcdate.js";
|
|
11
|
+
export * from "./unrecognized.js";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
declare const __brand: unique symbol;
|
|
6
|
+
export type Unrecognized<T> = T & { [__brand]: "unrecognized" };
|
|
7
|
+
|
|
8
|
+
function unrecognized<T>(value: T): Unrecognized<T> {
|
|
9
|
+
globalCount++;
|
|
10
|
+
return value as Unrecognized<T>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let globalCount = 0;
|
|
14
|
+
let refCount = 0;
|
|
15
|
+
export function startCountingUnrecognized() {
|
|
16
|
+
refCount++;
|
|
17
|
+
const start = globalCount;
|
|
18
|
+
return {
|
|
19
|
+
end: () => {
|
|
20
|
+
const count = globalCount - start;
|
|
21
|
+
if (--refCount === 0) globalCount = 0;
|
|
22
|
+
return count;
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { unrecognized };
|