@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
|
@@ -17,16 +17,18 @@ let value: DebtPosition = {
|
|
|
17
17
|
|
|
18
18
|
## Fields
|
|
19
19
|
|
|
20
|
-
| Field
|
|
21
|
-
|
|
|
22
|
-
| `token`
|
|
23
|
-
| `symbol`
|
|
24
|
-
| `protocol`
|
|
25
|
-
| `vault`
|
|
26
|
-
| `
|
|
27
|
-
| `
|
|
28
|
-
| `
|
|
29
|
-
| `
|
|
30
|
-
| `
|
|
31
|
-
| `
|
|
32
|
-
| `
|
|
20
|
+
| Field | Type | Required | Description | Example |
|
|
21
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
22
|
+
| `token` | *string* | :heavy_check_mark: | Address of the borrow token. | |
|
|
23
|
+
| `symbol` | *string* | :heavy_check_mark: | Symbol of the borrow token (e.g. WETH). | |
|
|
24
|
+
| `protocol` | [components.CreditProtocol](../../models/components/creditprotocol.md) | :heavy_minus_sign: | Which lending protocol a credit action targets.<br/><br/>``AAVE`` is the default so existing callers (which never send a ``protocol``<br/>field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the<br/>Euler V2 path, where the market is identified by EVK vault address(es).<br/>``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is<br/>currently read-only: positions and market discovery only — transaction<br/>builders land with the looping work (COM-7106/7107/7108), so transact<br/>endpoints reject it with a 422. | |
|
|
25
|
+
| `vault` | *string* | :heavy_minus_sign: | Euler only: the EVK borrow vault this debt is owed to. | |
|
|
26
|
+
| `marketId` | *string* | :heavy_minus_sign: | Morpho only: the bytes32 id of the isolated market this debt is owed to. | |
|
|
27
|
+
| `healthFactor` | *string* | :heavy_minus_sign: | 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. | |
|
|
28
|
+
| `amountBorrowed` | *string* | :heavy_check_mark: | Current on-chain debt balance (the vault's underlying asset for Euler). | |
|
|
29
|
+
| `usdValue` | *string* | :heavy_minus_sign: | Debt value in USD. | |
|
|
30
|
+
| `borrowApy` | *string* | :heavy_minus_sign: | Current borrow APY in percentage (e.g. 4.5 means 4.5%). | |
|
|
31
|
+
| `totalBorrowed` | *string* | :heavy_minus_sign: | Total amount borrowed across all borrow events. | |
|
|
32
|
+
| `totalRepaid` | *string* | :heavy_minus_sign: | Total amount repaid across all repay events. | |
|
|
33
|
+
| `interestPaid` | *string* | :heavy_minus_sign: | Interest paid on debt: on_chain_balance + total_repaid - total_borrowed. | |
|
|
34
|
+
| `events` | [components.CreditEvent](../../models/components/creditevent.md)[] | :heavy_minus_sign: | All historical events for this debt reserve. | [] |
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# MorphoLendingMarket
|
|
2
|
+
|
|
3
|
+
A Morpho Blue lending market: one isolated (collateral, loan) pair.
|
|
4
|
+
|
|
5
|
+
## Example Usage
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { MorphoLendingMarket } from "@compass-labs/api-sdk/models/components";
|
|
9
|
+
|
|
10
|
+
let value: MorphoLendingMarket = {
|
|
11
|
+
marketId: "<id>",
|
|
12
|
+
loanToken: "<value>",
|
|
13
|
+
loanTokenSymbol: "<value>",
|
|
14
|
+
loanTokenDecimals: 959829,
|
|
15
|
+
collateralToken: "<value>",
|
|
16
|
+
collateralTokenSymbol: "<value>",
|
|
17
|
+
collateralTokenDecimals: 294886,
|
|
18
|
+
oracle: "<value>",
|
|
19
|
+
irm: "<value>",
|
|
20
|
+
lltv: "<value>",
|
|
21
|
+
utilization: "<value>",
|
|
22
|
+
totalSupplyAssets: "<value>",
|
|
23
|
+
totalBorrowAssets: "<value>",
|
|
24
|
+
availableLiquidity: "<value>",
|
|
25
|
+
fee: "<value>",
|
|
26
|
+
};
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Fields
|
|
30
|
+
|
|
31
|
+
| Field | Type | Required | Description |
|
|
32
|
+
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
33
|
+
| `marketId` | *string* | :heavy_check_mark: | 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. |
|
|
34
|
+
| `loanToken` | *string* | :heavy_check_mark: | Token that is supplied and borrowed in this market. |
|
|
35
|
+
| `loanTokenSymbol` | *string* | :heavy_check_mark: | Symbol of the loan token (e.g. USDC). |
|
|
36
|
+
| `loanTokenDecimals` | *number* | :heavy_check_mark: | Decimals of the loan token. |
|
|
37
|
+
| `collateralToken` | *string* | :heavy_check_mark: | Token accepted as collateral in this market. |
|
|
38
|
+
| `collateralTokenSymbol` | *string* | :heavy_check_mark: | Symbol of the collateral token (e.g. wstETH). |
|
|
39
|
+
| `collateralTokenDecimals` | *number* | :heavy_check_mark: | Decimals of the collateral token. |
|
|
40
|
+
| `oracle` | *string* | :heavy_check_mark: | Oracle pricing the collateral in loan-token terms for this market. |
|
|
41
|
+
| `irm` | *string* | :heavy_check_mark: | Interest rate model contract of this market. |
|
|
42
|
+
| `lltv` | *string* | :heavy_check_mark: | Liquidation loan-to-value in percentage (e.g. 86 means a position is liquidatable once debt exceeds 86% of collateral value). |
|
|
43
|
+
| `supplyApy` | *string* | :heavy_minus_sign: | Current supply APY for lending the loan token, in percentage (e.g. 3.5 means 3.5%). Null if the rate is unavailable. |
|
|
44
|
+
| `borrowApy` | *string* | :heavy_minus_sign: | Current borrow APY for the loan token, in percentage (e.g. 5.25 means 5.25%). Null if the rate is unavailable. |
|
|
45
|
+
| `utilization` | *string* | :heavy_check_mark: | Borrowed share of supplied assets, in percentage 0-100. |
|
|
46
|
+
| `totalSupplyAssets` | *string* | :heavy_check_mark: | Total loan tokens supplied to the market, in token units. |
|
|
47
|
+
| `totalBorrowAssets` | *string* | :heavy_check_mark: | Total loan tokens borrowed from the market, in token units. |
|
|
48
|
+
| `availableLiquidity` | *string* | :heavy_check_mark: | Loan tokens available to borrow or withdraw (supplied - borrowed), in token units. |
|
|
49
|
+
| `fee` | *string* | :heavy_check_mark: | Protocol fee taken from interest, in percentage of interest (e.g. 0 means no fee). |
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# MorphoMarketsResponse
|
|
2
|
+
|
|
3
|
+
Curated Morpho Blue lending markets, read on-chain per request.
|
|
4
|
+
|
|
5
|
+
## Example Usage
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { MorphoMarketsResponse } from "@compass-labs/api-sdk/models/components";
|
|
9
|
+
|
|
10
|
+
let value: MorphoMarketsResponse = {
|
|
11
|
+
morpho: "<value>",
|
|
12
|
+
markets: [],
|
|
13
|
+
};
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Fields
|
|
17
|
+
|
|
18
|
+
| Field | Type | Required | Description | Example |
|
|
19
|
+
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
|
20
|
+
| `morpho` | *string* | :heavy_check_mark: | Morpho Blue singleton contract the markets were read from. | |
|
|
21
|
+
| `markets` | [components.MorphoLendingMarket](../../models/components/morpholendingmarket.md)[] | :heavy_minus_sign: | Curated lending markets with live LLTV, APYs, utilization, and liquidity. | [] |
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# V2CreditMorphoMarketsChain
|
|
2
|
+
|
|
3
|
+
## Example Usage
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
import { V2CreditMorphoMarketsChain } from "@compass-labs/api-sdk/models/operations";
|
|
7
|
+
|
|
8
|
+
let value: V2CreditMorphoMarketsChain = "ethereum";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Values
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
"arbitrum" | "base" | "ethereum" | "tempo"
|
|
15
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# V2CreditMorphoMarketsRequest
|
|
2
|
+
|
|
3
|
+
## Example Usage
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
import { V2CreditMorphoMarketsRequest } from "@compass-labs/api-sdk/models/operations";
|
|
7
|
+
|
|
8
|
+
let value: V2CreditMorphoMarketsRequest = {
|
|
9
|
+
chain: "ethereum",
|
|
10
|
+
};
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Fields
|
|
14
|
+
|
|
15
|
+
| Field | Type | Required | Description | Example |
|
|
16
|
+
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
|
17
|
+
| `chain` | [operations.V2CreditMorphoMarketsChain](../../models/operations/v2creditmorphomarketschain.md) | :heavy_check_mark: | N/A | ethereum |
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* [creditPositions](#creditpositions) - List credit positions
|
|
8
8
|
* [creditBalances](#creditbalances) - Get credit account token balances
|
|
9
9
|
* [creditEulerMarkets](#crediteulermarkets) - List curated Euler markets
|
|
10
|
+
* [creditMorphoMarkets](#creditmorphomarkets) - List curated Morpho markets
|
|
10
11
|
* [creditCreateAccount](#creditcreateaccount) - Create credit account
|
|
11
12
|
* [creditBorrow](#creditborrow) - Borrow against collateral
|
|
12
13
|
* [creditTransfer](#credittransfer) - Transfer tokens to/from Credit Account
|
|
@@ -250,6 +251,85 @@ run();
|
|
|
250
251
|
| errors.HTTPValidationError | 422 | application/json |
|
|
251
252
|
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
252
253
|
|
|
254
|
+
## creditMorphoMarkets
|
|
255
|
+
|
|
256
|
+
List curated Morpho Blue lending markets for a chain.
|
|
257
|
+
|
|
258
|
+
Morpho Blue is permissionless, so credit actions identify a market by its
|
|
259
|
+
bytes32 market id. This returns the curated market set with live LLTV,
|
|
260
|
+
supply/borrow APY, utilization, and available liquidity -- read on-chain per
|
|
261
|
+
request -- so callers know which market_id to use and what it currently costs.
|
|
262
|
+
|
|
263
|
+
### Example Usage
|
|
264
|
+
|
|
265
|
+
<!-- UsageSnippet language="typescript" operationID="v2_credit_morpho_markets" method="get" path="/v2/credit/morpho_markets" -->
|
|
266
|
+
```typescript
|
|
267
|
+
import { CompassApiSDK } from "@compass-labs/api-sdk";
|
|
268
|
+
|
|
269
|
+
const compassApiSDK = new CompassApiSDK({
|
|
270
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
async function run() {
|
|
274
|
+
const result = await compassApiSDK.credit.creditMorphoMarkets({
|
|
275
|
+
chain: "ethereum",
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
console.log(result);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
run();
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Standalone function
|
|
285
|
+
|
|
286
|
+
The standalone function version of this method:
|
|
287
|
+
|
|
288
|
+
```typescript
|
|
289
|
+
import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
|
|
290
|
+
import { creditCreditMorphoMarkets } from "@compass-labs/api-sdk/funcs/creditCreditMorphoMarkets.js";
|
|
291
|
+
|
|
292
|
+
// Use `CompassApiSDKCore` for best tree-shaking performance.
|
|
293
|
+
// You can create one instance of it to use across an application.
|
|
294
|
+
const compassApiSDK = new CompassApiSDKCore({
|
|
295
|
+
apiKeyAuth: "<YOUR_API_KEY_HERE>",
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
async function run() {
|
|
299
|
+
const res = await creditCreditMorphoMarkets(compassApiSDK, {
|
|
300
|
+
chain: "ethereum",
|
|
301
|
+
});
|
|
302
|
+
if (res.ok) {
|
|
303
|
+
const { value: result } = res;
|
|
304
|
+
console.log(result);
|
|
305
|
+
} else {
|
|
306
|
+
console.log("creditCreditMorphoMarkets failed:", res.error);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
run();
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Parameters
|
|
314
|
+
|
|
315
|
+
| Parameter | Type | Required | Description |
|
|
316
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
317
|
+
| `request` | [operations.V2CreditMorphoMarketsRequest](../../models/operations/v2creditmorphomarketsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
318
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
319
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
320
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
321
|
+
|
|
322
|
+
### Response
|
|
323
|
+
|
|
324
|
+
**Promise\<[components.MorphoMarketsResponse](../../models/components/morphomarketsresponse.md)\>**
|
|
325
|
+
|
|
326
|
+
### Errors
|
|
327
|
+
|
|
328
|
+
| Error Type | Status Code | Content Type |
|
|
329
|
+
| -------------------------- | -------------------------- | -------------------------- |
|
|
330
|
+
| errors.HTTPValidationError | 422 | application/json |
|
|
331
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
332
|
+
|
|
253
333
|
## creditCreateAccount
|
|
254
334
|
|
|
255
335
|
Create a Credit Account for a wallet address.
|