@compass-labs/api-sdk 2.2.71 → 2.2.72
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 +5 -3
- package/codeSamples_typescript.yaml +6 -0
- package/dist/commonjs/funcs/creditCreditEulerMarkets.d.ts +24 -0
- package/dist/commonjs/funcs/creditCreditEulerMarkets.d.ts.map +1 -0
- package/dist/commonjs/funcs/creditCreditEulerMarkets.js +128 -0
- package/dist/commonjs/funcs/creditCreditEulerMarkets.js.map +1 -0
- package/dist/commonjs/models/components/eulermarket.d.ts +37 -0
- package/dist/commonjs/models/components/eulermarket.d.ts.map +1 -0
- package/dist/commonjs/models/components/eulermarket.js +63 -0
- package/dist/commonjs/models/components/eulermarket.js.map +1 -0
- package/dist/commonjs/models/components/eulermarketcollateral.d.ts +32 -0
- package/dist/commonjs/models/components/eulermarketcollateral.d.ts.map +1 -0
- package/dist/commonjs/models/components/eulermarketcollateral.js +61 -0
- package/dist/commonjs/models/components/eulermarketcollateral.js.map +1 -0
- package/dist/commonjs/models/components/eulermarketsresponse.d.ts +21 -0
- package/dist/commonjs/models/components/eulermarketsresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/eulermarketsresponse.js +52 -0
- package/dist/commonjs/models/components/eulermarketsresponse.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/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/v2crediteulermarkets.d.ts +22 -0
- package/dist/commonjs/models/operations/v2crediteulermarkets.d.ts.map +1 -0
- package/dist/commonjs/models/operations/v2crediteulermarkets.js +57 -0
- package/dist/commonjs/models/operations/v2crediteulermarkets.js.map +1 -0
- package/dist/commonjs/sdk/credit.d.ts +12 -0
- package/dist/commonjs/sdk/credit.d.ts.map +1 -1
- package/dist/commonjs/sdk/credit.js +15 -0
- package/dist/commonjs/sdk/credit.js.map +1 -1
- package/dist/esm/funcs/creditCreditEulerMarkets.d.ts +24 -0
- package/dist/esm/funcs/creditCreditEulerMarkets.d.ts.map +1 -0
- package/dist/esm/funcs/creditCreditEulerMarkets.js +92 -0
- package/dist/esm/funcs/creditCreditEulerMarkets.js.map +1 -0
- package/dist/esm/models/components/eulermarket.d.ts +37 -0
- package/dist/esm/models/components/eulermarket.d.ts.map +1 -0
- package/dist/esm/models/components/eulermarket.js +26 -0
- package/dist/esm/models/components/eulermarket.js.map +1 -0
- package/dist/esm/models/components/eulermarketcollateral.d.ts +32 -0
- package/dist/esm/models/components/eulermarketcollateral.d.ts.map +1 -0
- package/dist/esm/models/components/eulermarketcollateral.js +24 -0
- package/dist/esm/models/components/eulermarketcollateral.js.map +1 -0
- package/dist/esm/models/components/eulermarketsresponse.d.ts +21 -0
- package/dist/esm/models/components/eulermarketsresponse.d.ts.map +1 -0
- package/dist/esm/models/components/eulermarketsresponse.js +15 -0
- package/dist/esm/models/components/eulermarketsresponse.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/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/v2crediteulermarkets.d.ts +22 -0
- package/dist/esm/models/operations/v2crediteulermarkets.d.ts.map +1 -0
- package/dist/esm/models/operations/v2crediteulermarkets.js +20 -0
- package/dist/esm/models/operations/v2crediteulermarkets.js.map +1 -0
- package/dist/esm/sdk/credit.d.ts +12 -0
- package/dist/esm/sdk/credit.d.ts.map +1 -1
- package/dist/esm/sdk/credit.js +15 -0
- package/dist/esm/sdk/credit.js.map +1 -1
- package/docs/models/components/eulermarket.md +29 -0
- package/docs/models/components/eulermarketcollateral.md +27 -0
- package/docs/models/components/eulermarketsresponse.md +21 -0
- package/docs/models/operations/v2crediteulermarketschain.md +15 -0
- package/docs/models/operations/v2crediteulermarketsrequest.md +17 -0
- package/docs/sdks/credit/README.md +80 -0
- package/openapi_prepped_for_speakeasy.json +164 -0
- package/package.json +1 -1
- package/src/funcs/creditCreditEulerMarkets.ts +182 -0
- package/src/models/components/eulermarket.ts +73 -0
- package/src/models/components/eulermarketcollateral.ts +64 -0
- package/src/models/components/eulermarketsresponse.ts +43 -0
- package/src/models/components/index.ts +3 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/v2crediteulermarkets.ts +49 -0
- package/src/sdk/credit.ts +23 -0
|
@@ -0,0 +1,182 @@
|
|
|
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 { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
15
|
+
import { CompassAPISDKError } from "../models/errors/compassapisdkerror.js";
|
|
16
|
+
import {
|
|
17
|
+
ConnectionError,
|
|
18
|
+
InvalidRequestError,
|
|
19
|
+
RequestAbortedError,
|
|
20
|
+
RequestTimeoutError,
|
|
21
|
+
UnexpectedClientError,
|
|
22
|
+
} from "../models/errors/httpclienterrors.js";
|
|
23
|
+
import * as errors from "../models/errors/index.js";
|
|
24
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
26
|
+
import * as operations from "../models/operations/index.js";
|
|
27
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
28
|
+
import { Result } from "../types/fp.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* List curated Euler markets
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* List curated Euler V2 credit markets for a chain.
|
|
35
|
+
*
|
|
36
|
+
* Euler is permissionless, so credit borrow/repay identify a market by EVK vault
|
|
37
|
+
* address. This returns the borrow markets from Euler's Governed Perspective (the
|
|
38
|
+
* DAO-vetted vault set) -- each with the collateral vaults it accepts and their
|
|
39
|
+
* LTVs -- so callers know which borrow_vault / collateral_vault to use.
|
|
40
|
+
*/
|
|
41
|
+
export function creditCreditEulerMarkets(
|
|
42
|
+
client: CompassApiSDKCore,
|
|
43
|
+
request: operations.V2CreditEulerMarketsRequest,
|
|
44
|
+
options?: RequestOptions,
|
|
45
|
+
): APIPromise<
|
|
46
|
+
Result<
|
|
47
|
+
components.EulerMarketsResponse,
|
|
48
|
+
| errors.HTTPValidationError
|
|
49
|
+
| CompassAPISDKError
|
|
50
|
+
| ResponseValidationError
|
|
51
|
+
| ConnectionError
|
|
52
|
+
| RequestAbortedError
|
|
53
|
+
| RequestTimeoutError
|
|
54
|
+
| InvalidRequestError
|
|
55
|
+
| UnexpectedClientError
|
|
56
|
+
| SDKValidationError
|
|
57
|
+
>
|
|
58
|
+
> {
|
|
59
|
+
return new APIPromise($do(
|
|
60
|
+
client,
|
|
61
|
+
request,
|
|
62
|
+
options,
|
|
63
|
+
));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async function $do(
|
|
67
|
+
client: CompassApiSDKCore,
|
|
68
|
+
request: operations.V2CreditEulerMarketsRequest,
|
|
69
|
+
options?: RequestOptions,
|
|
70
|
+
): Promise<
|
|
71
|
+
[
|
|
72
|
+
Result<
|
|
73
|
+
components.EulerMarketsResponse,
|
|
74
|
+
| errors.HTTPValidationError
|
|
75
|
+
| CompassAPISDKError
|
|
76
|
+
| ResponseValidationError
|
|
77
|
+
| ConnectionError
|
|
78
|
+
| RequestAbortedError
|
|
79
|
+
| RequestTimeoutError
|
|
80
|
+
| InvalidRequestError
|
|
81
|
+
| UnexpectedClientError
|
|
82
|
+
| SDKValidationError
|
|
83
|
+
>,
|
|
84
|
+
APICall,
|
|
85
|
+
]
|
|
86
|
+
> {
|
|
87
|
+
const parsed = safeParse(
|
|
88
|
+
request,
|
|
89
|
+
(value) =>
|
|
90
|
+
operations.V2CreditEulerMarketsRequest$outboundSchema.parse(value),
|
|
91
|
+
"Input validation failed",
|
|
92
|
+
);
|
|
93
|
+
if (!parsed.ok) {
|
|
94
|
+
return [parsed, { status: "invalid" }];
|
|
95
|
+
}
|
|
96
|
+
const payload = parsed.value;
|
|
97
|
+
const body = null;
|
|
98
|
+
|
|
99
|
+
const path = pathToFunc("/v2/credit/euler_markets")();
|
|
100
|
+
|
|
101
|
+
const query = encodeFormQuery({
|
|
102
|
+
"chain": payload.chain,
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
const headers = new Headers(compactMap({
|
|
106
|
+
Accept: "application/json",
|
|
107
|
+
}));
|
|
108
|
+
|
|
109
|
+
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
110
|
+
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
111
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
112
|
+
|
|
113
|
+
const context = {
|
|
114
|
+
options: client._options,
|
|
115
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
116
|
+
operationID: "v2_credit_euler_markets",
|
|
117
|
+
oAuth2Scopes: null,
|
|
118
|
+
|
|
119
|
+
resolvedSecurity: requestSecurity,
|
|
120
|
+
|
|
121
|
+
securitySource: client._options.apiKeyAuth,
|
|
122
|
+
retryConfig: options?.retries
|
|
123
|
+
|| client._options.retryConfig
|
|
124
|
+
|| { strategy: "none" },
|
|
125
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const requestRes = client._createRequest(context, {
|
|
129
|
+
security: requestSecurity,
|
|
130
|
+
method: "GET",
|
|
131
|
+
baseURL: options?.serverURL,
|
|
132
|
+
path: path,
|
|
133
|
+
headers: headers,
|
|
134
|
+
query: query,
|
|
135
|
+
body: body,
|
|
136
|
+
userAgent: client._options.userAgent,
|
|
137
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
138
|
+
}, options);
|
|
139
|
+
if (!requestRes.ok) {
|
|
140
|
+
return [requestRes, { status: "invalid" }];
|
|
141
|
+
}
|
|
142
|
+
const req = requestRes.value;
|
|
143
|
+
|
|
144
|
+
const doResult = await client._do(req, {
|
|
145
|
+
context,
|
|
146
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
147
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
148
|
+
retryConfig: context.retryConfig,
|
|
149
|
+
retryCodes: context.retryCodes,
|
|
150
|
+
});
|
|
151
|
+
if (!doResult.ok) {
|
|
152
|
+
return [doResult, { status: "request-error", request: req }];
|
|
153
|
+
}
|
|
154
|
+
const response = doResult.value;
|
|
155
|
+
|
|
156
|
+
const responseFields = {
|
|
157
|
+
HttpMeta: { Response: response, Request: req },
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const [result] = await M.match<
|
|
161
|
+
components.EulerMarketsResponse,
|
|
162
|
+
| errors.HTTPValidationError
|
|
163
|
+
| CompassAPISDKError
|
|
164
|
+
| ResponseValidationError
|
|
165
|
+
| ConnectionError
|
|
166
|
+
| RequestAbortedError
|
|
167
|
+
| RequestTimeoutError
|
|
168
|
+
| InvalidRequestError
|
|
169
|
+
| UnexpectedClientError
|
|
170
|
+
| SDKValidationError
|
|
171
|
+
>(
|
|
172
|
+
M.json(200, components.EulerMarketsResponse$inboundSchema),
|
|
173
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
174
|
+
M.fail("4XX"),
|
|
175
|
+
M.fail("5XX"),
|
|
176
|
+
)(response, req, { extraFields: responseFields });
|
|
177
|
+
if (!result.ok) {
|
|
178
|
+
return [result, { status: "complete", request: req, response }];
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return [result, { status: "complete", request: req, response }];
|
|
182
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
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 {
|
|
11
|
+
EulerMarketCollateral,
|
|
12
|
+
EulerMarketCollateral$inboundSchema,
|
|
13
|
+
} from "./eulermarketcollateral.js";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* An Euler V2 borrow market: a vault to borrow from + the collaterals it accepts.
|
|
17
|
+
*/
|
|
18
|
+
export type EulerMarket = {
|
|
19
|
+
/**
|
|
20
|
+
* EVK vault to borrow from (pass as borrow_vault when borrowing).
|
|
21
|
+
*/
|
|
22
|
+
vault: string;
|
|
23
|
+
/**
|
|
24
|
+
* Symbol of the EVK vault (e.g. eUSDT-2).
|
|
25
|
+
*/
|
|
26
|
+
vaultSymbol: string;
|
|
27
|
+
/**
|
|
28
|
+
* Underlying asset this market lends and borrows.
|
|
29
|
+
*/
|
|
30
|
+
asset: string;
|
|
31
|
+
/**
|
|
32
|
+
* Symbol of the borrowable asset (e.g. USDT).
|
|
33
|
+
*/
|
|
34
|
+
assetSymbol: string;
|
|
35
|
+
/**
|
|
36
|
+
* Decimals of the borrowable asset.
|
|
37
|
+
*/
|
|
38
|
+
assetDecimals: number;
|
|
39
|
+
/**
|
|
40
|
+
* Collateral vaults this market accepts (those currently borrowable, LTV > 0), each with its LTVs.
|
|
41
|
+
*/
|
|
42
|
+
collaterals?: Array<EulerMarketCollateral> | undefined;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** @internal */
|
|
46
|
+
export const EulerMarket$inboundSchema: z.ZodType<
|
|
47
|
+
EulerMarket,
|
|
48
|
+
z.ZodTypeDef,
|
|
49
|
+
unknown
|
|
50
|
+
> = z.object({
|
|
51
|
+
vault: z.string(),
|
|
52
|
+
vault_symbol: z.string(),
|
|
53
|
+
asset: z.string(),
|
|
54
|
+
asset_symbol: z.string(),
|
|
55
|
+
asset_decimals: z.number().int(),
|
|
56
|
+
collaterals: z.array(EulerMarketCollateral$inboundSchema).optional(),
|
|
57
|
+
}).transform((v) => {
|
|
58
|
+
return remap$(v, {
|
|
59
|
+
"vault_symbol": "vaultSymbol",
|
|
60
|
+
"asset_symbol": "assetSymbol",
|
|
61
|
+
"asset_decimals": "assetDecimals",
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
export function eulerMarketFromJSON(
|
|
66
|
+
jsonString: string,
|
|
67
|
+
): SafeParseResult<EulerMarket, SDKValidationError> {
|
|
68
|
+
return safeParse(
|
|
69
|
+
jsonString,
|
|
70
|
+
(x) => EulerMarket$inboundSchema.parse(JSON.parse(x)),
|
|
71
|
+
`Failed to parse 'EulerMarket' from JSON`,
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
* A collateral vault an Euler borrow market accepts, with its loan-to-value.
|
|
13
|
+
*/
|
|
14
|
+
export type EulerMarketCollateral = {
|
|
15
|
+
/**
|
|
16
|
+
* EVK collateral vault to supply into (pass as collateral_vault when borrowing).
|
|
17
|
+
*/
|
|
18
|
+
vault: string;
|
|
19
|
+
/**
|
|
20
|
+
* Underlying asset of the collateral vault.
|
|
21
|
+
*/
|
|
22
|
+
asset: string;
|
|
23
|
+
/**
|
|
24
|
+
* Symbol of the collateral's underlying asset (e.g. USDC).
|
|
25
|
+
*/
|
|
26
|
+
assetSymbol: string;
|
|
27
|
+
/**
|
|
28
|
+
* Maximum loan-to-value when borrowing against this collateral, in percentage (e.g. 94 means 94%).
|
|
29
|
+
*/
|
|
30
|
+
borrowLtv: string;
|
|
31
|
+
/**
|
|
32
|
+
* Loan-to-value at which this collateral is liquidated, in percentage (e.g. 96 means 96%).
|
|
33
|
+
*/
|
|
34
|
+
liquidationLtv: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export const EulerMarketCollateral$inboundSchema: z.ZodType<
|
|
39
|
+
EulerMarketCollateral,
|
|
40
|
+
z.ZodTypeDef,
|
|
41
|
+
unknown
|
|
42
|
+
> = z.object({
|
|
43
|
+
vault: z.string(),
|
|
44
|
+
asset: z.string(),
|
|
45
|
+
asset_symbol: z.string(),
|
|
46
|
+
borrow_ltv: z.string(),
|
|
47
|
+
liquidation_ltv: z.string(),
|
|
48
|
+
}).transform((v) => {
|
|
49
|
+
return remap$(v, {
|
|
50
|
+
"asset_symbol": "assetSymbol",
|
|
51
|
+
"borrow_ltv": "borrowLtv",
|
|
52
|
+
"liquidation_ltv": "liquidationLtv",
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export function eulerMarketCollateralFromJSON(
|
|
57
|
+
jsonString: string,
|
|
58
|
+
): SafeParseResult<EulerMarketCollateral, SDKValidationError> {
|
|
59
|
+
return safeParse(
|
|
60
|
+
jsonString,
|
|
61
|
+
(x) => EulerMarketCollateral$inboundSchema.parse(JSON.parse(x)),
|
|
62
|
+
`Failed to parse 'EulerMarketCollateral' from JSON`,
|
|
63
|
+
);
|
|
64
|
+
}
|
|
@@ -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 { EulerMarket, EulerMarket$inboundSchema } from "./eulermarket.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Curated Euler V2 borrow markets, read from Euler's Governed Perspective.
|
|
13
|
+
*/
|
|
14
|
+
export type EulerMarketsResponse = {
|
|
15
|
+
/**
|
|
16
|
+
* Euler Governed Perspective contract the curated vault set was read from.
|
|
17
|
+
*/
|
|
18
|
+
perspective: string;
|
|
19
|
+
/**
|
|
20
|
+
* Curated borrow markets, each with its accepted collateral vaults and LTVs.
|
|
21
|
+
*/
|
|
22
|
+
markets?: Array<EulerMarket> | undefined;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const EulerMarketsResponse$inboundSchema: z.ZodType<
|
|
27
|
+
EulerMarketsResponse,
|
|
28
|
+
z.ZodTypeDef,
|
|
29
|
+
unknown
|
|
30
|
+
> = z.object({
|
|
31
|
+
perspective: z.string(),
|
|
32
|
+
markets: z.array(EulerMarket$inboundSchema).optional(),
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export function eulerMarketsResponseFromJSON(
|
|
36
|
+
jsonString: string,
|
|
37
|
+
): SafeParseResult<EulerMarketsResponse, SDKValidationError> {
|
|
38
|
+
return safeParse(
|
|
39
|
+
jsonString,
|
|
40
|
+
(x) => EulerMarketsResponse$inboundSchema.parse(JSON.parse(x)),
|
|
41
|
+
`Failed to parse 'EulerMarketsResponse' from JSON`,
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -145,6 +145,9 @@ export * from "./ethenarequesttowithdrawrequest.js";
|
|
|
145
145
|
export * from "./ethenarequesttowithdrawtransactionresponse.js";
|
|
146
146
|
export * from "./ethenaunstakeparams.js";
|
|
147
147
|
export * from "./ethenaunstakerequest.js";
|
|
148
|
+
export * from "./eulermarket.js";
|
|
149
|
+
export * from "./eulermarketcollateral.js";
|
|
150
|
+
export * from "./eulermarketsresponse.js";
|
|
148
151
|
export * from "./fee.js";
|
|
149
152
|
export * from "./feeenum.js";
|
|
150
153
|
export * from "./globalmarketsperpsactivitypartialerror.js";
|
|
@@ -42,6 +42,7 @@ export * from "./v1vaultsvault.js";
|
|
|
42
42
|
export * from "./v1wildcatmarket.js";
|
|
43
43
|
export * from "./v2cctpmint.js";
|
|
44
44
|
export * from "./v2creditbalances.js";
|
|
45
|
+
export * from "./v2crediteulermarkets.js";
|
|
45
46
|
export * from "./v2creditpositions.js";
|
|
46
47
|
export * from "./v2earnaavemarkets.js";
|
|
47
48
|
export * from "./v2earnbalances.js";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
export const V2CreditEulerMarketsChain = {
|
|
9
|
+
Arbitrum: "arbitrum",
|
|
10
|
+
Base: "base",
|
|
11
|
+
Ethereum: "ethereum",
|
|
12
|
+
Tempo: "tempo",
|
|
13
|
+
} as const;
|
|
14
|
+
export type V2CreditEulerMarketsChain = ClosedEnum<
|
|
15
|
+
typeof V2CreditEulerMarketsChain
|
|
16
|
+
>;
|
|
17
|
+
|
|
18
|
+
export type V2CreditEulerMarketsRequest = {
|
|
19
|
+
chain: V2CreditEulerMarketsChain;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const V2CreditEulerMarketsChain$outboundSchema: z.ZodNativeEnum<
|
|
24
|
+
typeof V2CreditEulerMarketsChain
|
|
25
|
+
> = z.nativeEnum(V2CreditEulerMarketsChain);
|
|
26
|
+
|
|
27
|
+
/** @internal */
|
|
28
|
+
export type V2CreditEulerMarketsRequest$Outbound = {
|
|
29
|
+
chain: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export const V2CreditEulerMarketsRequest$outboundSchema: z.ZodType<
|
|
34
|
+
V2CreditEulerMarketsRequest$Outbound,
|
|
35
|
+
z.ZodTypeDef,
|
|
36
|
+
V2CreditEulerMarketsRequest
|
|
37
|
+
> = z.object({
|
|
38
|
+
chain: V2CreditEulerMarketsChain$outboundSchema,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export function v2CreditEulerMarketsRequestToJSON(
|
|
42
|
+
v2CreditEulerMarketsRequest: V2CreditEulerMarketsRequest,
|
|
43
|
+
): string {
|
|
44
|
+
return JSON.stringify(
|
|
45
|
+
V2CreditEulerMarketsRequest$outboundSchema.parse(
|
|
46
|
+
v2CreditEulerMarketsRequest,
|
|
47
|
+
),
|
|
48
|
+
);
|
|
49
|
+
}
|
package/src/sdk/credit.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { creditCreditBalances } from "../funcs/creditCreditBalances.js";
|
|
|
6
6
|
import { creditCreditBorrow } from "../funcs/creditCreditBorrow.js";
|
|
7
7
|
import { creditCreditBundle } from "../funcs/creditCreditBundle.js";
|
|
8
8
|
import { creditCreditCreateAccount } from "../funcs/creditCreditCreateAccount.js";
|
|
9
|
+
import { creditCreditEulerMarkets } from "../funcs/creditCreditEulerMarkets.js";
|
|
9
10
|
import { creditCreditPositions } from "../funcs/creditCreditPositions.js";
|
|
10
11
|
import { creditCreditRepay } from "../funcs/creditCreditRepay.js";
|
|
11
12
|
import { creditCreditTransfer } from "../funcs/creditCreditTransfer.js";
|
|
@@ -55,6 +56,28 @@ export class Credit extends ClientSDK {
|
|
|
55
56
|
));
|
|
56
57
|
}
|
|
57
58
|
|
|
59
|
+
/**
|
|
60
|
+
* List curated Euler markets
|
|
61
|
+
*
|
|
62
|
+
* @remarks
|
|
63
|
+
* List curated Euler V2 credit markets for a chain.
|
|
64
|
+
*
|
|
65
|
+
* Euler is permissionless, so credit borrow/repay identify a market by EVK vault
|
|
66
|
+
* address. This returns the borrow markets from Euler's Governed Perspective (the
|
|
67
|
+
* DAO-vetted vault set) -- each with the collateral vaults it accepts and their
|
|
68
|
+
* LTVs -- so callers know which borrow_vault / collateral_vault to use.
|
|
69
|
+
*/
|
|
70
|
+
async creditEulerMarkets(
|
|
71
|
+
request: operations.V2CreditEulerMarketsRequest,
|
|
72
|
+
options?: RequestOptions,
|
|
73
|
+
): Promise<components.EulerMarketsResponse> {
|
|
74
|
+
return unwrapAsync(creditCreditEulerMarkets(
|
|
75
|
+
this,
|
|
76
|
+
request,
|
|
77
|
+
options,
|
|
78
|
+
));
|
|
79
|
+
}
|
|
80
|
+
|
|
58
81
|
/**
|
|
59
82
|
* Create credit account
|
|
60
83
|
*
|