@compass-labs/api-sdk 2.2.76-rc.0 → 2.2.76-rc.1
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/creditCreditMorphoMarkets.d.ts +24 -0
- package/dist/commonjs/funcs/creditCreditMorphoMarkets.d.ts.map +1 -0
- package/dist/commonjs/funcs/creditCreditMorphoMarkets.js +128 -0
- package/dist/commonjs/funcs/creditCreditMorphoMarkets.js.map +1 -0
- package/dist/commonjs/models/components/accountsummary.d.ts +4 -0
- package/dist/commonjs/models/components/accountsummary.d.ts.map +1 -1
- package/dist/commonjs/models/components/accountsummary.js.map +1 -1
- package/dist/commonjs/models/components/collateralposition.d.ts +12 -0
- package/dist/commonjs/models/components/collateralposition.d.ts.map +1 -1
- package/dist/commonjs/models/components/collateralposition.js +4 -0
- package/dist/commonjs/models/components/collateralposition.js.map +1 -1
- package/dist/commonjs/models/components/creditborrowparams.d.ts +4 -0
- package/dist/commonjs/models/components/creditborrowparams.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditborrowparams.js.map +1 -1
- package/dist/commonjs/models/components/creditborrowrequest.d.ts +4 -0
- package/dist/commonjs/models/components/creditborrowrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditborrowrequest.js.map +1 -1
- package/dist/commonjs/models/components/creditenablecollateralparams.d.ts +4 -0
- package/dist/commonjs/models/components/creditenablecollateralparams.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditenablecollateralparams.js.map +1 -1
- package/dist/commonjs/models/components/creditprotocol.d.ts +9 -0
- package/dist/commonjs/models/components/creditprotocol.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditprotocol.js +5 -0
- package/dist/commonjs/models/components/creditprotocol.js.map +1 -1
- package/dist/commonjs/models/components/creditrepayparams.d.ts +4 -0
- package/dist/commonjs/models/components/creditrepayparams.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditrepayparams.js.map +1 -1
- package/dist/commonjs/models/components/creditrepayrequest.d.ts +4 -0
- package/dist/commonjs/models/components/creditrepayrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditrepayrequest.js.map +1 -1
- package/dist/commonjs/models/components/creditsupplyparams.d.ts +4 -0
- package/dist/commonjs/models/components/creditsupplyparams.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditsupplyparams.js.map +1 -1
- package/dist/commonjs/models/components/creditwithdrawparams.d.ts +4 -0
- package/dist/commonjs/models/components/creditwithdrawparams.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditwithdrawparams.js.map +1 -1
- package/dist/commonjs/models/components/debtposition.d.ts +12 -0
- package/dist/commonjs/models/components/debtposition.d.ts.map +1 -1
- package/dist/commonjs/models/components/debtposition.js +4 -0
- package/dist/commonjs/models/components/debtposition.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +2 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +2 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/morpholendingmarket.d.ts +80 -0
- package/dist/commonjs/models/components/morpholendingmarket.d.ts.map +1 -0
- package/dist/commonjs/models/components/morpholendingmarket.js +82 -0
- package/dist/commonjs/models/components/morpholendingmarket.js.map +1 -0
- package/dist/commonjs/models/components/morphomarketsresponse.d.ts +21 -0
- package/dist/commonjs/models/components/morphomarketsresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/morphomarketsresponse.js +52 -0
- package/dist/commonjs/models/components/morphomarketsresponse.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/v2creditmorphomarkets.d.ts +22 -0
- package/dist/commonjs/models/operations/v2creditmorphomarkets.d.ts.map +1 -0
- package/dist/commonjs/models/operations/v2creditmorphomarkets.js +57 -0
- package/dist/commonjs/models/operations/v2creditmorphomarkets.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/creditCreditMorphoMarkets.d.ts +24 -0
- package/dist/esm/funcs/creditCreditMorphoMarkets.d.ts.map +1 -0
- package/dist/esm/funcs/creditCreditMorphoMarkets.js +92 -0
- package/dist/esm/funcs/creditCreditMorphoMarkets.js.map +1 -0
- package/dist/esm/models/components/accountsummary.d.ts +4 -0
- package/dist/esm/models/components/accountsummary.d.ts.map +1 -1
- package/dist/esm/models/components/accountsummary.js.map +1 -1
- package/dist/esm/models/components/collateralposition.d.ts +12 -0
- package/dist/esm/models/components/collateralposition.d.ts.map +1 -1
- package/dist/esm/models/components/collateralposition.js +4 -0
- package/dist/esm/models/components/collateralposition.js.map +1 -1
- package/dist/esm/models/components/creditborrowparams.d.ts +4 -0
- package/dist/esm/models/components/creditborrowparams.d.ts.map +1 -1
- package/dist/esm/models/components/creditborrowparams.js.map +1 -1
- package/dist/esm/models/components/creditborrowrequest.d.ts +4 -0
- package/dist/esm/models/components/creditborrowrequest.d.ts.map +1 -1
- package/dist/esm/models/components/creditborrowrequest.js.map +1 -1
- package/dist/esm/models/components/creditenablecollateralparams.d.ts +4 -0
- package/dist/esm/models/components/creditenablecollateralparams.d.ts.map +1 -1
- package/dist/esm/models/components/creditenablecollateralparams.js.map +1 -1
- package/dist/esm/models/components/creditprotocol.d.ts +9 -0
- package/dist/esm/models/components/creditprotocol.d.ts.map +1 -1
- package/dist/esm/models/components/creditprotocol.js +5 -0
- package/dist/esm/models/components/creditprotocol.js.map +1 -1
- package/dist/esm/models/components/creditrepayparams.d.ts +4 -0
- package/dist/esm/models/components/creditrepayparams.d.ts.map +1 -1
- package/dist/esm/models/components/creditrepayparams.js.map +1 -1
- package/dist/esm/models/components/creditrepayrequest.d.ts +4 -0
- package/dist/esm/models/components/creditrepayrequest.d.ts.map +1 -1
- package/dist/esm/models/components/creditrepayrequest.js.map +1 -1
- package/dist/esm/models/components/creditsupplyparams.d.ts +4 -0
- package/dist/esm/models/components/creditsupplyparams.d.ts.map +1 -1
- package/dist/esm/models/components/creditsupplyparams.js.map +1 -1
- package/dist/esm/models/components/creditwithdrawparams.d.ts +4 -0
- package/dist/esm/models/components/creditwithdrawparams.d.ts.map +1 -1
- package/dist/esm/models/components/creditwithdrawparams.js.map +1 -1
- package/dist/esm/models/components/debtposition.d.ts +12 -0
- package/dist/esm/models/components/debtposition.d.ts.map +1 -1
- package/dist/esm/models/components/debtposition.js +4 -0
- package/dist/esm/models/components/debtposition.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +2 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +2 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/morpholendingmarket.d.ts +80 -0
- package/dist/esm/models/components/morpholendingmarket.d.ts.map +1 -0
- package/dist/esm/models/components/morpholendingmarket.js +45 -0
- package/dist/esm/models/components/morpholendingmarket.js.map +1 -0
- package/dist/esm/models/components/morphomarketsresponse.d.ts +21 -0
- package/dist/esm/models/components/morphomarketsresponse.d.ts.map +1 -0
- package/dist/esm/models/components/morphomarketsresponse.js +15 -0
- package/dist/esm/models/components/morphomarketsresponse.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/v2creditmorphomarkets.d.ts +22 -0
- package/dist/esm/models/operations/v2creditmorphomarkets.d.ts.map +1 -0
- package/dist/esm/models/operations/v2creditmorphomarkets.js +20 -0
- package/dist/esm/models/operations/v2creditmorphomarkets.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/accountsummary.md +10 -10
- package/docs/models/components/collateralposition.md +16 -14
- package/docs/models/components/creditborrowparams.md +9 -9
- package/docs/models/components/creditborrowrequest.md +19 -19
- package/docs/models/components/creditenablecollateralparams.md +6 -6
- package/docs/models/components/creditprotocol.md +5 -1
- package/docs/models/components/creditrepayparams.md +8 -8
- package/docs/models/components/creditrepayrequest.md +18 -18
- package/docs/models/components/creditsupplyparams.md +7 -7
- package/docs/models/components/creditwithdrawparams.md +7 -7
- package/docs/models/components/debtposition.md +15 -13
- package/docs/models/components/morpholendingmarket.md +49 -0
- package/docs/models/components/morphomarketsresponse.md +21 -0
- package/docs/models/operations/v2creditmorphomarketschain.md +15 -0
- package/docs/models/operations/v2creditmorphomarketsrequest.md +17 -0
- package/docs/sdks/credit/README.md +80 -0
- package/openapi_prepped_for_speakeasy.json +250 -2
- package/package.json +1 -1
- package/src/funcs/creditCreditMorphoMarkets.ts +182 -0
- package/src/models/components/accountsummary.ts +4 -0
- package/src/models/components/collateralposition.ts +16 -0
- package/src/models/components/creditborrowparams.ts +4 -0
- package/src/models/components/creditborrowrequest.ts +4 -0
- package/src/models/components/creditenablecollateralparams.ts +4 -0
- package/src/models/components/creditprotocol.ts +9 -0
- package/src/models/components/creditrepayparams.ts +4 -0
- package/src/models/components/creditrepayrequest.ts +4 -0
- package/src/models/components/creditsupplyparams.ts +4 -0
- package/src/models/components/creditwithdrawparams.ts +4 -0
- package/src/models/components/debtposition.ts +16 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/components/morpholendingmarket.ts +133 -0
- package/src/models/components/morphomarketsresponse.ts +46 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/v2creditmorphomarkets.ts +49 -0
- package/src/sdk/credit.ts +23 -0
|
@@ -33,12 +33,24 @@ export type DebtPosition = {
|
|
|
33
33
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
34
34
|
* field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
|
|
35
35
|
* Euler V2 path, where the market is identified by EVK vault address(es).
|
|
36
|
+
* ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
|
|
37
|
+
* currently read-only: positions and market discovery only — transaction
|
|
38
|
+
* builders land with the looping work (COM-7106/7107/7108), so transact
|
|
39
|
+
* endpoints reject it with a 422.
|
|
36
40
|
*/
|
|
37
41
|
protocol?: CreditProtocol | undefined;
|
|
38
42
|
/**
|
|
39
43
|
* Euler only: the EVK borrow vault this debt is owed to.
|
|
40
44
|
*/
|
|
41
45
|
vault?: string | null | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Morpho only: the bytes32 id of the isolated market this debt is owed to.
|
|
48
|
+
*/
|
|
49
|
+
marketId?: string | null | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Morpho only: this market's health factor (markets are isolated, so health is per market — below 1 the position is liquidatable). Null for other protocols and when the oracle read fails.
|
|
52
|
+
*/
|
|
53
|
+
healthFactor?: string | null | undefined;
|
|
42
54
|
/**
|
|
43
55
|
* Current on-chain debt balance (the vault's underlying asset for Euler).
|
|
44
56
|
*/
|
|
@@ -79,6 +91,8 @@ export const DebtPosition$inboundSchema: z.ZodType<
|
|
|
79
91
|
symbol: z.string(),
|
|
80
92
|
protocol: CreditProtocol$inboundSchema.optional(),
|
|
81
93
|
vault: z.nullable(z.string()).optional(),
|
|
94
|
+
market_id: z.nullable(z.string()).optional(),
|
|
95
|
+
health_factor: z.nullable(z.string()).optional(),
|
|
82
96
|
amount_borrowed: z.nullable(z.string()),
|
|
83
97
|
usd_value: z.nullable(z.string()).optional(),
|
|
84
98
|
borrow_apy: z.nullable(z.string()).optional(),
|
|
@@ -88,6 +102,8 @@ export const DebtPosition$inboundSchema: z.ZodType<
|
|
|
88
102
|
events: z.array(CreditEvent$inboundSchema).optional(),
|
|
89
103
|
}).transform((v) => {
|
|
90
104
|
return remap$(v, {
|
|
105
|
+
"market_id": "marketId",
|
|
106
|
+
"health_factor": "healthFactor",
|
|
91
107
|
"amount_borrowed": "amountBorrowed",
|
|
92
108
|
"usd_value": "usdValue",
|
|
93
109
|
"borrow_apy": "borrowApy",
|
|
@@ -201,7 +201,9 @@ export * from "./morphodepositrequest.js";
|
|
|
201
201
|
export * from "./morphogetmarketresponse.js";
|
|
202
202
|
export * from "./morphogetmarketsresponse.js";
|
|
203
203
|
export * from "./morphogetvaultsresponse.js";
|
|
204
|
+
export * from "./morpholendingmarket.js";
|
|
204
205
|
export * from "./morphomarket.js";
|
|
206
|
+
export * from "./morphomarketsresponse.js";
|
|
205
207
|
export * from "./morphorepayparams.js";
|
|
206
208
|
export * from "./morphorepayrequest.js";
|
|
207
209
|
export * from "./morphosupplycollateralparams.js";
|
|
@@ -0,0 +1,133 @@
|
|
|
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 Morpho Blue lending market: one isolated (collateral, loan) pair.
|
|
13
|
+
*/
|
|
14
|
+
export type MorphoLendingMarket = {
|
|
15
|
+
/**
|
|
16
|
+
* Morpho Blue market id — the bytes32 keccak of the market's (loanToken, collateralToken, oracle, irm, lltv) tuple. Pass this to the Morpho credit actions to identify the market.
|
|
17
|
+
*/
|
|
18
|
+
marketId: string;
|
|
19
|
+
/**
|
|
20
|
+
* Token that is supplied and borrowed in this market.
|
|
21
|
+
*/
|
|
22
|
+
loanToken: string;
|
|
23
|
+
/**
|
|
24
|
+
* Symbol of the loan token (e.g. USDC).
|
|
25
|
+
*/
|
|
26
|
+
loanTokenSymbol: string;
|
|
27
|
+
/**
|
|
28
|
+
* Decimals of the loan token.
|
|
29
|
+
*/
|
|
30
|
+
loanTokenDecimals: number;
|
|
31
|
+
/**
|
|
32
|
+
* Token accepted as collateral in this market.
|
|
33
|
+
*/
|
|
34
|
+
collateralToken: string;
|
|
35
|
+
/**
|
|
36
|
+
* Symbol of the collateral token (e.g. wstETH).
|
|
37
|
+
*/
|
|
38
|
+
collateralTokenSymbol: string;
|
|
39
|
+
/**
|
|
40
|
+
* Decimals of the collateral token.
|
|
41
|
+
*/
|
|
42
|
+
collateralTokenDecimals: number;
|
|
43
|
+
/**
|
|
44
|
+
* Oracle pricing the collateral in loan-token terms for this market.
|
|
45
|
+
*/
|
|
46
|
+
oracle: string;
|
|
47
|
+
/**
|
|
48
|
+
* Interest rate model contract of this market.
|
|
49
|
+
*/
|
|
50
|
+
irm: string;
|
|
51
|
+
/**
|
|
52
|
+
* Liquidation loan-to-value in percentage (e.g. 86 means a position is liquidatable once debt exceeds 86% of collateral value).
|
|
53
|
+
*/
|
|
54
|
+
lltv: string;
|
|
55
|
+
/**
|
|
56
|
+
* Current supply APY for lending the loan token, in percentage (e.g. 3.5 means 3.5%). Null if the rate is unavailable.
|
|
57
|
+
*/
|
|
58
|
+
supplyApy?: string | null | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Current borrow APY for the loan token, in percentage (e.g. 5.25 means 5.25%). Null if the rate is unavailable.
|
|
61
|
+
*/
|
|
62
|
+
borrowApy?: string | null | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Borrowed share of supplied assets, in percentage 0-100.
|
|
65
|
+
*/
|
|
66
|
+
utilization: string;
|
|
67
|
+
/**
|
|
68
|
+
* Total loan tokens supplied to the market, in token units.
|
|
69
|
+
*/
|
|
70
|
+
totalSupplyAssets: string;
|
|
71
|
+
/**
|
|
72
|
+
* Total loan tokens borrowed from the market, in token units.
|
|
73
|
+
*/
|
|
74
|
+
totalBorrowAssets: string;
|
|
75
|
+
/**
|
|
76
|
+
* Loan tokens available to borrow or withdraw (supplied - borrowed), in token units.
|
|
77
|
+
*/
|
|
78
|
+
availableLiquidity: string;
|
|
79
|
+
/**
|
|
80
|
+
* Protocol fee taken from interest, in percentage of interest (e.g. 0 means no fee).
|
|
81
|
+
*/
|
|
82
|
+
fee: string;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/** @internal */
|
|
86
|
+
export const MorphoLendingMarket$inboundSchema: z.ZodType<
|
|
87
|
+
MorphoLendingMarket,
|
|
88
|
+
z.ZodTypeDef,
|
|
89
|
+
unknown
|
|
90
|
+
> = z.object({
|
|
91
|
+
market_id: z.string(),
|
|
92
|
+
loan_token: z.string(),
|
|
93
|
+
loan_token_symbol: z.string(),
|
|
94
|
+
loan_token_decimals: z.number().int(),
|
|
95
|
+
collateral_token: z.string(),
|
|
96
|
+
collateral_token_symbol: z.string(),
|
|
97
|
+
collateral_token_decimals: z.number().int(),
|
|
98
|
+
oracle: z.string(),
|
|
99
|
+
irm: z.string(),
|
|
100
|
+
lltv: z.string(),
|
|
101
|
+
supply_apy: z.nullable(z.string()).optional(),
|
|
102
|
+
borrow_apy: z.nullable(z.string()).optional(),
|
|
103
|
+
utilization: z.string(),
|
|
104
|
+
total_supply_assets: z.string(),
|
|
105
|
+
total_borrow_assets: z.string(),
|
|
106
|
+
available_liquidity: z.string(),
|
|
107
|
+
fee: z.string(),
|
|
108
|
+
}).transform((v) => {
|
|
109
|
+
return remap$(v, {
|
|
110
|
+
"market_id": "marketId",
|
|
111
|
+
"loan_token": "loanToken",
|
|
112
|
+
"loan_token_symbol": "loanTokenSymbol",
|
|
113
|
+
"loan_token_decimals": "loanTokenDecimals",
|
|
114
|
+
"collateral_token": "collateralToken",
|
|
115
|
+
"collateral_token_symbol": "collateralTokenSymbol",
|
|
116
|
+
"collateral_token_decimals": "collateralTokenDecimals",
|
|
117
|
+
"supply_apy": "supplyApy",
|
|
118
|
+
"borrow_apy": "borrowApy",
|
|
119
|
+
"total_supply_assets": "totalSupplyAssets",
|
|
120
|
+
"total_borrow_assets": "totalBorrowAssets",
|
|
121
|
+
"available_liquidity": "availableLiquidity",
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
export function morphoLendingMarketFromJSON(
|
|
126
|
+
jsonString: string,
|
|
127
|
+
): SafeParseResult<MorphoLendingMarket, SDKValidationError> {
|
|
128
|
+
return safeParse(
|
|
129
|
+
jsonString,
|
|
130
|
+
(x) => MorphoLendingMarket$inboundSchema.parse(JSON.parse(x)),
|
|
131
|
+
`Failed to parse 'MorphoLendingMarket' from JSON`,
|
|
132
|
+
);
|
|
133
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
MorphoLendingMarket,
|
|
11
|
+
MorphoLendingMarket$inboundSchema,
|
|
12
|
+
} from "./morpholendingmarket.js";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Curated Morpho Blue lending markets, read on-chain per request.
|
|
16
|
+
*/
|
|
17
|
+
export type MorphoMarketsResponse = {
|
|
18
|
+
/**
|
|
19
|
+
* Morpho Blue singleton contract the markets were read from.
|
|
20
|
+
*/
|
|
21
|
+
morpho: string;
|
|
22
|
+
/**
|
|
23
|
+
* Curated lending markets with live LLTV, APYs, utilization, and liquidity.
|
|
24
|
+
*/
|
|
25
|
+
markets?: Array<MorphoLendingMarket> | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const MorphoMarketsResponse$inboundSchema: z.ZodType<
|
|
30
|
+
MorphoMarketsResponse,
|
|
31
|
+
z.ZodTypeDef,
|
|
32
|
+
unknown
|
|
33
|
+
> = z.object({
|
|
34
|
+
morpho: z.string(),
|
|
35
|
+
markets: z.array(MorphoLendingMarket$inboundSchema).optional(),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export function morphoMarketsResponseFromJSON(
|
|
39
|
+
jsonString: string,
|
|
40
|
+
): SafeParseResult<MorphoMarketsResponse, SDKValidationError> {
|
|
41
|
+
return safeParse(
|
|
42
|
+
jsonString,
|
|
43
|
+
(x) => MorphoMarketsResponse$inboundSchema.parse(JSON.parse(x)),
|
|
44
|
+
`Failed to parse 'MorphoMarketsResponse' from JSON`,
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -43,6 +43,7 @@ export * from "./v1wildcatmarket.js";
|
|
|
43
43
|
export * from "./v2cctpmint.js";
|
|
44
44
|
export * from "./v2creditbalances.js";
|
|
45
45
|
export * from "./v2crediteulermarkets.js";
|
|
46
|
+
export * from "./v2creditmorphomarkets.js";
|
|
46
47
|
export * from "./v2creditpositions.js";
|
|
47
48
|
export * from "./v2earnaavemarkets.js";
|
|
48
49
|
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 V2CreditMorphoMarketsChain = {
|
|
9
|
+
Arbitrum: "arbitrum",
|
|
10
|
+
Base: "base",
|
|
11
|
+
Ethereum: "ethereum",
|
|
12
|
+
Tempo: "tempo",
|
|
13
|
+
} as const;
|
|
14
|
+
export type V2CreditMorphoMarketsChain = ClosedEnum<
|
|
15
|
+
typeof V2CreditMorphoMarketsChain
|
|
16
|
+
>;
|
|
17
|
+
|
|
18
|
+
export type V2CreditMorphoMarketsRequest = {
|
|
19
|
+
chain: V2CreditMorphoMarketsChain;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const V2CreditMorphoMarketsChain$outboundSchema: z.ZodNativeEnum<
|
|
24
|
+
typeof V2CreditMorphoMarketsChain
|
|
25
|
+
> = z.nativeEnum(V2CreditMorphoMarketsChain);
|
|
26
|
+
|
|
27
|
+
/** @internal */
|
|
28
|
+
export type V2CreditMorphoMarketsRequest$Outbound = {
|
|
29
|
+
chain: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export const V2CreditMorphoMarketsRequest$outboundSchema: z.ZodType<
|
|
34
|
+
V2CreditMorphoMarketsRequest$Outbound,
|
|
35
|
+
z.ZodTypeDef,
|
|
36
|
+
V2CreditMorphoMarketsRequest
|
|
37
|
+
> = z.object({
|
|
38
|
+
chain: V2CreditMorphoMarketsChain$outboundSchema,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export function v2CreditMorphoMarketsRequestToJSON(
|
|
42
|
+
v2CreditMorphoMarketsRequest: V2CreditMorphoMarketsRequest,
|
|
43
|
+
): string {
|
|
44
|
+
return JSON.stringify(
|
|
45
|
+
V2CreditMorphoMarketsRequest$outboundSchema.parse(
|
|
46
|
+
v2CreditMorphoMarketsRequest,
|
|
47
|
+
),
|
|
48
|
+
);
|
|
49
|
+
}
|
package/src/sdk/credit.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { creditCreditBorrow } from "../funcs/creditCreditBorrow.js";
|
|
|
7
7
|
import { creditCreditBundle } from "../funcs/creditCreditBundle.js";
|
|
8
8
|
import { creditCreditCreateAccount } from "../funcs/creditCreditCreateAccount.js";
|
|
9
9
|
import { creditCreditEulerMarkets } from "../funcs/creditCreditEulerMarkets.js";
|
|
10
|
+
import { creditCreditMorphoMarkets } from "../funcs/creditCreditMorphoMarkets.js";
|
|
10
11
|
import { creditCreditPositions } from "../funcs/creditCreditPositions.js";
|
|
11
12
|
import { creditCreditRepay } from "../funcs/creditCreditRepay.js";
|
|
12
13
|
import { creditCreditTransfer } from "../funcs/creditCreditTransfer.js";
|
|
@@ -78,6 +79,28 @@ export class Credit extends ClientSDK {
|
|
|
78
79
|
));
|
|
79
80
|
}
|
|
80
81
|
|
|
82
|
+
/**
|
|
83
|
+
* List curated Morpho markets
|
|
84
|
+
*
|
|
85
|
+
* @remarks
|
|
86
|
+
* List curated Morpho Blue lending markets for a chain.
|
|
87
|
+
*
|
|
88
|
+
* Morpho Blue is permissionless, so credit actions identify a market by its
|
|
89
|
+
* bytes32 market id. This returns the curated market set with live LLTV,
|
|
90
|
+
* supply/borrow APY, utilization, and available liquidity -- read on-chain per
|
|
91
|
+
* request -- so callers know which market_id to use and what it currently costs.
|
|
92
|
+
*/
|
|
93
|
+
async creditMorphoMarkets(
|
|
94
|
+
request: operations.V2CreditMorphoMarketsRequest,
|
|
95
|
+
options?: RequestOptions,
|
|
96
|
+
): Promise<components.MorphoMarketsResponse> {
|
|
97
|
+
return unwrapAsync(creditCreditMorphoMarkets(
|
|
98
|
+
this,
|
|
99
|
+
request,
|
|
100
|
+
options,
|
|
101
|
+
));
|
|
102
|
+
}
|
|
103
|
+
|
|
81
104
|
/**
|
|
82
105
|
* Create credit account
|
|
83
106
|
*
|