@compass-labs/api-sdk 2.2.75 → 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 +7 -3
- package/codeSamples_typescript.yaml +12 -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/funcs/tokenizedAssetsTokenizedAssetsRedemptions.d.ts +30 -0
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsRedemptions.d.ts.map +1 -0
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsRedemptions.js +136 -0
- package/dist/commonjs/funcs/tokenizedAssetsTokenizedAssetsRedemptions.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/compassapibackendv2modelstokenizedassetsmarketmarket.d.ts +8 -6
- package/dist/commonjs/models/components/compassapibackendv2modelstokenizedassetsmarketmarket.d.ts.map +1 -1
- package/dist/commonjs/models/components/compassapibackendv2modelstokenizedassetsmarketmarket.js +3 -3
- package/dist/commonjs/models/components/compassapibackendv2modelstokenizedassetsmarketmarket.js.map +1 -1
- package/dist/commonjs/models/components/compassapibackendv2modelstokenizedassetsreadresponsepositionsposition.d.ts +4 -2
- package/dist/commonjs/models/components/compassapibackendv2modelstokenizedassetsreadresponsepositionsposition.d.ts.map +1 -1
- package/dist/commonjs/models/components/compassapibackendv2modelstokenizedassetsreadresponsepositionsposition.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 +4 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +4 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/marketdetail.d.ts +8 -6
- package/dist/commonjs/models/components/marketdetail.d.ts.map +1 -1
- package/dist/commonjs/models/components/marketdetail.js +3 -3
- package/dist/commonjs/models/components/marketdetail.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/components/redemption.d.ts +52 -0
- package/dist/commonjs/models/components/redemption.d.ts.map +1 -0
- package/dist/commonjs/models/components/redemption.js +73 -0
- package/dist/commonjs/models/components/redemption.js.map +1 -0
- package/dist/commonjs/models/components/redemptionsresponse.d.ts +17 -0
- package/dist/commonjs/models/components/redemptionsresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/redemptionsresponse.js +51 -0
- package/dist/commonjs/models/components/redemptionsresponse.js.map +1 -0
- package/dist/commonjs/models/components/tokenizedassetclass.d.ts +9 -4
- package/dist/commonjs/models/components/tokenizedassetclass.d.ts.map +1 -1
- package/dist/commonjs/models/components/tokenizedassetclass.js +5 -2
- package/dist/commonjs/models/components/tokenizedassetclass.js.map +1 -1
- package/dist/commonjs/models/components/tokenizedassetprovider.d.ts +1 -0
- package/dist/commonjs/models/components/tokenizedassetprovider.d.ts.map +1 -1
- package/dist/commonjs/models/components/tokenizedassetprovider.js +1 -0
- package/dist/commonjs/models/components/tokenizedassetprovider.js.map +1 -1
- package/dist/commonjs/models/components/tokenizedassetstraderesponse.d.ts +22 -0
- package/dist/commonjs/models/components/tokenizedassetstraderesponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/tokenizedassetstraderesponse.js +14 -1
- package/dist/commonjs/models/components/tokenizedassetstraderesponse.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +2 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +2 -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/models/operations/v2tokenizedassetsredemptions.d.ts +43 -0
- package/dist/commonjs/models/operations/v2tokenizedassetsredemptions.d.ts.map +1 -0
- package/dist/commonjs/models/operations/v2tokenizedassetsredemptions.js +64 -0
- package/dist/commonjs/models/operations/v2tokenizedassetsredemptions.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/commonjs/sdk/tokenizedassets.d.ts +18 -0
- package/dist/commonjs/sdk/tokenizedassets.d.ts.map +1 -1
- package/dist/commonjs/sdk/tokenizedassets.js +21 -0
- package/dist/commonjs/sdk/tokenizedassets.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/funcs/tokenizedAssetsTokenizedAssetsRedemptions.d.ts +30 -0
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsRedemptions.d.ts.map +1 -0
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsRedemptions.js +100 -0
- package/dist/esm/funcs/tokenizedAssetsTokenizedAssetsRedemptions.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/compassapibackendv2modelstokenizedassetsmarketmarket.d.ts +8 -6
- package/dist/esm/models/components/compassapibackendv2modelstokenizedassetsmarketmarket.d.ts.map +1 -1
- package/dist/esm/models/components/compassapibackendv2modelstokenizedassetsmarketmarket.js +3 -3
- package/dist/esm/models/components/compassapibackendv2modelstokenizedassetsmarketmarket.js.map +1 -1
- package/dist/esm/models/components/compassapibackendv2modelstokenizedassetsreadresponsepositionsposition.d.ts +4 -2
- package/dist/esm/models/components/compassapibackendv2modelstokenizedassetsreadresponsepositionsposition.d.ts.map +1 -1
- package/dist/esm/models/components/compassapibackendv2modelstokenizedassetsreadresponsepositionsposition.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 +4 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +4 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/marketdetail.d.ts +8 -6
- package/dist/esm/models/components/marketdetail.d.ts.map +1 -1
- package/dist/esm/models/components/marketdetail.js +3 -3
- package/dist/esm/models/components/marketdetail.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/components/redemption.d.ts +52 -0
- package/dist/esm/models/components/redemption.d.ts.map +1 -0
- package/dist/esm/models/components/redemption.js +36 -0
- package/dist/esm/models/components/redemption.js.map +1 -0
- package/dist/esm/models/components/redemptionsresponse.d.ts +17 -0
- package/dist/esm/models/components/redemptionsresponse.d.ts.map +1 -0
- package/dist/esm/models/components/redemptionsresponse.js +14 -0
- package/dist/esm/models/components/redemptionsresponse.js.map +1 -0
- package/dist/esm/models/components/tokenizedassetclass.d.ts +9 -4
- package/dist/esm/models/components/tokenizedassetclass.d.ts.map +1 -1
- package/dist/esm/models/components/tokenizedassetclass.js +5 -2
- package/dist/esm/models/components/tokenizedassetclass.js.map +1 -1
- package/dist/esm/models/components/tokenizedassetprovider.d.ts +1 -0
- package/dist/esm/models/components/tokenizedassetprovider.d.ts.map +1 -1
- package/dist/esm/models/components/tokenizedassetprovider.js +1 -0
- package/dist/esm/models/components/tokenizedassetprovider.js.map +1 -1
- package/dist/esm/models/components/tokenizedassetstraderesponse.d.ts +22 -0
- package/dist/esm/models/components/tokenizedassetstraderesponse.d.ts.map +1 -1
- package/dist/esm/models/components/tokenizedassetstraderesponse.js +13 -0
- package/dist/esm/models/components/tokenizedassetstraderesponse.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +2 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +2 -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/models/operations/v2tokenizedassetsredemptions.d.ts +43 -0
- package/dist/esm/models/operations/v2tokenizedassetsredemptions.d.ts.map +1 -0
- package/dist/esm/models/operations/v2tokenizedassetsredemptions.js +27 -0
- package/dist/esm/models/operations/v2tokenizedassetsredemptions.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/dist/esm/sdk/tokenizedassets.d.ts +18 -0
- package/dist/esm/sdk/tokenizedassets.d.ts.map +1 -1
- package/dist/esm/sdk/tokenizedassets.js +21 -0
- package/dist/esm/sdk/tokenizedassets.js.map +1 -1
- package/docs/models/components/accountsummary.md +10 -10
- package/docs/models/components/collateralposition.md +16 -14
- package/docs/models/components/compassapibackendv2modelstokenizedassetsmarketmarket.md +21 -18
- package/docs/models/components/compassapibackendv2modelstokenizedassetsreadresponsepositionsposition.md +15 -15
- 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/marketdetail.md +32 -29
- package/docs/models/components/morpholendingmarket.md +49 -0
- package/docs/models/components/morphomarketsresponse.md +21 -0
- package/docs/models/components/redemption.md +27 -0
- package/docs/models/components/redemptionsresponse.md +19 -0
- package/docs/models/components/redemptionstatus.md +17 -0
- package/docs/models/components/settlement.md +17 -0
- package/docs/models/components/tokenizedassetclass.md +6 -4
- package/docs/models/components/tokenizedassetprovider.md +2 -2
- package/docs/models/components/tokenizedassetstraderesponse.md +9 -6
- package/docs/models/operations/v2creditmorphomarketschain.md +15 -0
- package/docs/models/operations/v2creditmorphomarketsrequest.md +17 -0
- package/docs/models/operations/v2tokenizedassetsredemptionschain.md +17 -0
- package/docs/models/operations/v2tokenizedassetsredemptionsrequest.md +21 -0
- package/docs/sdks/credit/README.md +80 -0
- package/docs/sdks/tokenizedassets/README.md +90 -0
- package/openapi_prepped_for_speakeasy.json +451 -21
- package/package.json +1 -1
- package/src/funcs/creditCreditMorphoMarkets.ts +182 -0
- package/src/funcs/tokenizedAssetsTokenizedAssetsRedemptions.ts +192 -0
- package/src/models/components/accountsummary.ts +4 -0
- package/src/models/components/collateralposition.ts +16 -0
- package/src/models/components/compassapibackendv2modelstokenizedassetsmarketmarket.ts +11 -9
- package/src/models/components/compassapibackendv2modelstokenizedassetsreadresponsepositionsposition.ts +4 -2
- 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 +4 -0
- package/src/models/components/marketdetail.ts +11 -9
- package/src/models/components/morpholendingmarket.ts +133 -0
- package/src/models/components/morphomarketsresponse.ts +46 -0
- package/src/models/components/redemption.ts +89 -0
- package/src/models/components/redemptionsresponse.ts +38 -0
- package/src/models/components/tokenizedassetclass.ts +9 -4
- package/src/models/components/tokenizedassetprovider.ts +1 -0
- package/src/models/components/tokenizedassetstraderesponse.ts +28 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/v2creditmorphomarkets.ts +49 -0
- package/src/models/operations/v2tokenizedassetsredemptions.ts +72 -0
- package/src/sdk/credit.ts +23 -0
- package/src/sdk/tokenizedassets.ts +29 -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 Morpho markets
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* List curated Morpho Blue lending markets for a chain.
|
|
35
|
+
*
|
|
36
|
+
* Morpho Blue is permissionless, so credit actions identify a market by its
|
|
37
|
+
* bytes32 market id. This returns the curated market set with live LLTV,
|
|
38
|
+
* supply/borrow APY, utilization, and available liquidity -- read on-chain per
|
|
39
|
+
* request -- so callers know which market_id to use and what it currently costs.
|
|
40
|
+
*/
|
|
41
|
+
export function creditCreditMorphoMarkets(
|
|
42
|
+
client: CompassApiSDKCore,
|
|
43
|
+
request: operations.V2CreditMorphoMarketsRequest,
|
|
44
|
+
options?: RequestOptions,
|
|
45
|
+
): APIPromise<
|
|
46
|
+
Result<
|
|
47
|
+
components.MorphoMarketsResponse,
|
|
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.V2CreditMorphoMarketsRequest,
|
|
69
|
+
options?: RequestOptions,
|
|
70
|
+
): Promise<
|
|
71
|
+
[
|
|
72
|
+
Result<
|
|
73
|
+
components.MorphoMarketsResponse,
|
|
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.V2CreditMorphoMarketsRequest$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/morpho_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_morpho_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.MorphoMarketsResponse,
|
|
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.MorphoMarketsResponse$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,192 @@
|
|
|
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
|
+
* Get IXS vault redemption requests for an owner
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Get an owner's IXS vault redemption requests (async redemption status).
|
|
35
|
+
*
|
|
36
|
+
* IXS managed-vault **sells** are asynchronous: `/transact/sell` returns a
|
|
37
|
+
* `requestRedeem` transaction, and the vault operator settles it off-chain
|
|
38
|
+
* later. This endpoint reconstructs the owner's requests directly from the
|
|
39
|
+
* vault on every call (Compass persists no async state) — each entry carries
|
|
40
|
+
* its `status` (`pending` | `finalized` | `rejected`), the `shares` requested,
|
|
41
|
+
* and, while `pending`, the `expected_net_assets` it would settle for at the
|
|
42
|
+
* current NAV (a preview, not a guarantee).
|
|
43
|
+
*
|
|
44
|
+
* IXS vaults live on BNB Smart Chain — pass `chain=bsc` (the default) and the
|
|
45
|
+
* `vault` handle (default `ixv1`).
|
|
46
|
+
*/
|
|
47
|
+
export function tokenizedAssetsTokenizedAssetsRedemptions(
|
|
48
|
+
client: CompassApiSDKCore,
|
|
49
|
+
request: operations.V2TokenizedAssetsRedemptionsRequest,
|
|
50
|
+
options?: RequestOptions,
|
|
51
|
+
): APIPromise<
|
|
52
|
+
Result<
|
|
53
|
+
components.RedemptionsResponse,
|
|
54
|
+
| errors.TokenizedAssetsErrorResponse
|
|
55
|
+
| CompassAPISDKError
|
|
56
|
+
| ResponseValidationError
|
|
57
|
+
| ConnectionError
|
|
58
|
+
| RequestAbortedError
|
|
59
|
+
| RequestTimeoutError
|
|
60
|
+
| InvalidRequestError
|
|
61
|
+
| UnexpectedClientError
|
|
62
|
+
| SDKValidationError
|
|
63
|
+
>
|
|
64
|
+
> {
|
|
65
|
+
return new APIPromise($do(
|
|
66
|
+
client,
|
|
67
|
+
request,
|
|
68
|
+
options,
|
|
69
|
+
));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async function $do(
|
|
73
|
+
client: CompassApiSDKCore,
|
|
74
|
+
request: operations.V2TokenizedAssetsRedemptionsRequest,
|
|
75
|
+
options?: RequestOptions,
|
|
76
|
+
): Promise<
|
|
77
|
+
[
|
|
78
|
+
Result<
|
|
79
|
+
components.RedemptionsResponse,
|
|
80
|
+
| errors.TokenizedAssetsErrorResponse
|
|
81
|
+
| CompassAPISDKError
|
|
82
|
+
| ResponseValidationError
|
|
83
|
+
| ConnectionError
|
|
84
|
+
| RequestAbortedError
|
|
85
|
+
| RequestTimeoutError
|
|
86
|
+
| InvalidRequestError
|
|
87
|
+
| UnexpectedClientError
|
|
88
|
+
| SDKValidationError
|
|
89
|
+
>,
|
|
90
|
+
APICall,
|
|
91
|
+
]
|
|
92
|
+
> {
|
|
93
|
+
const parsed = safeParse(
|
|
94
|
+
request,
|
|
95
|
+
(value) =>
|
|
96
|
+
operations.V2TokenizedAssetsRedemptionsRequest$outboundSchema.parse(
|
|
97
|
+
value,
|
|
98
|
+
),
|
|
99
|
+
"Input validation failed",
|
|
100
|
+
);
|
|
101
|
+
if (!parsed.ok) {
|
|
102
|
+
return [parsed, { status: "invalid" }];
|
|
103
|
+
}
|
|
104
|
+
const payload = parsed.value;
|
|
105
|
+
const body = null;
|
|
106
|
+
|
|
107
|
+
const path = pathToFunc("/v2/tokenized_assets/redemptions")();
|
|
108
|
+
|
|
109
|
+
const query = encodeFormQuery({
|
|
110
|
+
"chain": payload.chain,
|
|
111
|
+
"owner": payload.owner,
|
|
112
|
+
"vault": payload.vault,
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
const headers = new Headers(compactMap({
|
|
116
|
+
Accept: "application/json",
|
|
117
|
+
}));
|
|
118
|
+
|
|
119
|
+
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
120
|
+
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
121
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
122
|
+
|
|
123
|
+
const context = {
|
|
124
|
+
options: client._options,
|
|
125
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
126
|
+
operationID: "v2_tokenized_assets_redemptions",
|
|
127
|
+
oAuth2Scopes: null,
|
|
128
|
+
|
|
129
|
+
resolvedSecurity: requestSecurity,
|
|
130
|
+
|
|
131
|
+
securitySource: client._options.apiKeyAuth,
|
|
132
|
+
retryConfig: options?.retries
|
|
133
|
+
|| client._options.retryConfig
|
|
134
|
+
|| { strategy: "none" },
|
|
135
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const requestRes = client._createRequest(context, {
|
|
139
|
+
security: requestSecurity,
|
|
140
|
+
method: "GET",
|
|
141
|
+
baseURL: options?.serverURL,
|
|
142
|
+
path: path,
|
|
143
|
+
headers: headers,
|
|
144
|
+
query: query,
|
|
145
|
+
body: body,
|
|
146
|
+
userAgent: client._options.userAgent,
|
|
147
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
148
|
+
}, options);
|
|
149
|
+
if (!requestRes.ok) {
|
|
150
|
+
return [requestRes, { status: "invalid" }];
|
|
151
|
+
}
|
|
152
|
+
const req = requestRes.value;
|
|
153
|
+
|
|
154
|
+
const doResult = await client._do(req, {
|
|
155
|
+
context,
|
|
156
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
157
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
158
|
+
retryConfig: context.retryConfig,
|
|
159
|
+
retryCodes: context.retryCodes,
|
|
160
|
+
});
|
|
161
|
+
if (!doResult.ok) {
|
|
162
|
+
return [doResult, { status: "request-error", request: req }];
|
|
163
|
+
}
|
|
164
|
+
const response = doResult.value;
|
|
165
|
+
|
|
166
|
+
const responseFields = {
|
|
167
|
+
HttpMeta: { Response: response, Request: req },
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
const [result] = await M.match<
|
|
171
|
+
components.RedemptionsResponse,
|
|
172
|
+
| errors.TokenizedAssetsErrorResponse
|
|
173
|
+
| CompassAPISDKError
|
|
174
|
+
| ResponseValidationError
|
|
175
|
+
| ConnectionError
|
|
176
|
+
| RequestAbortedError
|
|
177
|
+
| RequestTimeoutError
|
|
178
|
+
| InvalidRequestError
|
|
179
|
+
| UnexpectedClientError
|
|
180
|
+
| SDKValidationError
|
|
181
|
+
>(
|
|
182
|
+
M.json(200, components.RedemptionsResponse$inboundSchema),
|
|
183
|
+
M.jsonErr(422, errors.TokenizedAssetsErrorResponse$inboundSchema),
|
|
184
|
+
M.fail("4XX"),
|
|
185
|
+
M.fail("5XX"),
|
|
186
|
+
)(response, req, { extraFields: responseFields });
|
|
187
|
+
if (!result.ok) {
|
|
188
|
+
return [result, { status: "complete", request: req, response }];
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return [result, { status: "complete", request: req, response }];
|
|
192
|
+
}
|
|
@@ -30,6 +30,10 @@ export type AccountSummary = {
|
|
|
30
30
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
31
31
|
* field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
|
|
32
32
|
* Euler V2 path, where the market is identified by EVK vault address(es).
|
|
33
|
+
* ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
|
|
34
|
+
* currently read-only: positions and market discovery only — transaction
|
|
35
|
+
* builders land with the looping work (COM-7106/7107/7108), so transact
|
|
36
|
+
* endpoints reject it with a 422.
|
|
33
37
|
*/
|
|
34
38
|
protocol?: CreditProtocol | undefined;
|
|
35
39
|
/**
|
|
@@ -33,12 +33,24 @@ export type CollateralPosition = {
|
|
|
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 collateral vault holding this position.
|
|
40
44
|
*/
|
|
41
45
|
vault?: string | null | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Morpho only: the bytes32 id of the isolated market holding this position.
|
|
48
|
+
*/
|
|
49
|
+
marketId?: string | null | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Morpho only: true when this is a loan-asset supply position (earning supply APY) rather than collateral backing borrows.
|
|
52
|
+
*/
|
|
53
|
+
isPureSupply?: boolean | null | undefined;
|
|
42
54
|
/**
|
|
43
55
|
* Current on-chain collateral balance (the vault's underlying asset for Euler).
|
|
44
56
|
*/
|
|
@@ -83,6 +95,8 @@ export const CollateralPosition$inboundSchema: z.ZodType<
|
|
|
83
95
|
symbol: z.string(),
|
|
84
96
|
protocol: CreditProtocol$inboundSchema.optional(),
|
|
85
97
|
vault: z.nullable(z.string()).optional(),
|
|
98
|
+
market_id: z.nullable(z.string()).optional(),
|
|
99
|
+
is_pure_supply: z.nullable(z.boolean()).optional(),
|
|
86
100
|
amount_supplied: z.nullable(z.string()),
|
|
87
101
|
usd_value: z.nullable(z.string()).optional(),
|
|
88
102
|
supply_apy: z.nullable(z.string()).optional(),
|
|
@@ -93,6 +107,8 @@ export const CollateralPosition$inboundSchema: z.ZodType<
|
|
|
93
107
|
events: z.array(CreditEvent$inboundSchema).optional(),
|
|
94
108
|
}).transform((v) => {
|
|
95
109
|
return remap$(v, {
|
|
110
|
+
"market_id": "marketId",
|
|
111
|
+
"is_pure_supply": "isPureSupply",
|
|
96
112
|
"amount_supplied": "amountSupplied",
|
|
97
113
|
"usd_value": "usdValue",
|
|
98
114
|
"supply_apy": "supplyApy",
|
|
@@ -34,7 +34,7 @@ export type CompassApiBackendV2ModelsTokenizedAssetsMarketMarket = {
|
|
|
34
34
|
*/
|
|
35
35
|
name: string;
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* On-chain ERC-20 address for this token, on the network given by `chain`.
|
|
38
38
|
*/
|
|
39
39
|
contractAddress: string;
|
|
40
40
|
/**
|
|
@@ -64,21 +64,23 @@ export type CompassApiBackendV2ModelsTokenizedAssetsMarketMarket = {
|
|
|
64
64
|
/**
|
|
65
65
|
* Issuer/provider of a tokenized asset.
|
|
66
66
|
*/
|
|
67
|
-
provider
|
|
67
|
+
provider: TokenizedAssetProvider;
|
|
68
68
|
/**
|
|
69
69
|
* Asset class of a tokenized asset.
|
|
70
70
|
*
|
|
71
71
|
* @remarks
|
|
72
72
|
*
|
|
73
73
|
* `EQUITY` trades via the order endpoints (build/submit/cancel); the RWA
|
|
74
|
-
* yield classes (`T_BILLS`, `BASIS_TRADE`, `BTC_YIELD`)
|
|
75
|
-
* swap-based `transact/buy` and `transact/sell` endpoints.
|
|
74
|
+
* yield classes (`T_BILLS`, `BASIS_TRADE`, `BTC_YIELD`) and `MANAGED_VAULT`
|
|
75
|
+
* trade via the swap-based `transact/buy` and `transact/sell` endpoints.
|
|
76
|
+
* `MANAGED_VAULT` (IXS ERC-4626 vaults) is special in that a sell is an
|
|
77
|
+
* *asynchronous* redemption request settled off-chain by the vault operator.
|
|
76
78
|
*/
|
|
77
|
-
assetClass
|
|
79
|
+
assetClass: TokenizedAssetClass;
|
|
78
80
|
/**
|
|
79
81
|
* The chain to use.
|
|
80
82
|
*/
|
|
81
|
-
chain
|
|
83
|
+
chain: Chain;
|
|
82
84
|
/**
|
|
83
85
|
* Trailing 7-day annualized NAV growth (decimal fraction string, e.g. '0.0512' = 5.12%). RWA yield assets only; null until enough NAV history exists.
|
|
84
86
|
*/
|
|
@@ -110,9 +112,9 @@ export const CompassApiBackendV2ModelsTokenizedAssetsMarketMarket$inboundSchema:
|
|
|
110
112
|
change_24h_pct: z.nullable(z.string()).optional(),
|
|
111
113
|
sectors: z.array(z.string()).optional(),
|
|
112
114
|
region_exposure: z.array(z.string()).optional(),
|
|
113
|
-
provider: TokenizedAssetProvider$inboundSchema
|
|
114
|
-
asset_class: TokenizedAssetClass$inboundSchema
|
|
115
|
-
chain: Chain$inboundSchema
|
|
115
|
+
provider: TokenizedAssetProvider$inboundSchema,
|
|
116
|
+
asset_class: TokenizedAssetClass$inboundSchema,
|
|
117
|
+
chain: Chain$inboundSchema,
|
|
116
118
|
apy_7d: z.nullable(z.string()).optional(),
|
|
117
119
|
apy_30d: z.nullable(z.string()).optional(),
|
|
118
120
|
tvl_usd: z.nullable(z.string()).optional(),
|
|
@@ -72,8 +72,10 @@ export type CompassApiBackendV2ModelsTokenizedAssetsReadResponsePositionsPositio
|
|
|
72
72
|
* @remarks
|
|
73
73
|
*
|
|
74
74
|
* `EQUITY` trades via the order endpoints (build/submit/cancel); the RWA
|
|
75
|
-
* yield classes (`T_BILLS`, `BASIS_TRADE`, `BTC_YIELD`)
|
|
76
|
-
* swap-based `transact/buy` and `transact/sell` endpoints.
|
|
75
|
+
* yield classes (`T_BILLS`, `BASIS_TRADE`, `BTC_YIELD`) and `MANAGED_VAULT`
|
|
76
|
+
* trade via the swap-based `transact/buy` and `transact/sell` endpoints.
|
|
77
|
+
* `MANAGED_VAULT` (IXS ERC-4626 vaults) is special in that a sell is an
|
|
78
|
+
* *asynchronous* redemption request settled off-chain by the vault operator.
|
|
77
79
|
*/
|
|
78
80
|
assetClass?: TokenizedAssetClass | undefined;
|
|
79
81
|
/**
|
|
@@ -56,6 +56,10 @@ export type CreditBorrowParams = {
|
|
|
56
56
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
57
57
|
* field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
|
|
58
58
|
* Euler V2 path, where the market is identified by EVK vault address(es).
|
|
59
|
+
* ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
|
|
60
|
+
* currently read-only: positions and market discovery only — transaction
|
|
61
|
+
* builders land with the looping work (COM-7106/7107/7108), so transact
|
|
62
|
+
* endpoints reject it with a 422.
|
|
59
63
|
*/
|
|
60
64
|
protocol?: CreditProtocol | undefined;
|
|
61
65
|
/**
|
|
@@ -51,6 +51,10 @@ export type CreditBorrowRequest = {
|
|
|
51
51
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
52
52
|
* field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
|
|
53
53
|
* Euler V2 path, where the market is identified by EVK vault address(es).
|
|
54
|
+
* ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
|
|
55
|
+
* currently read-only: positions and market discovery only — transaction
|
|
56
|
+
* builders land with the looping work (COM-7106/7107/7108), so transact
|
|
57
|
+
* endpoints reject it with a 422.
|
|
54
58
|
*/
|
|
55
59
|
protocol?: CreditProtocol | undefined;
|
|
56
60
|
/**
|
|
@@ -31,6 +31,10 @@ export type CreditEnableCollateralParams = {
|
|
|
31
31
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
32
32
|
* field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
|
|
33
33
|
* Euler V2 path, where the market is identified by EVK vault address(es).
|
|
34
|
+
* ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
|
|
35
|
+
* currently read-only: positions and market discovery only — transaction
|
|
36
|
+
* builders land with the looping work (COM-7106/7107/7108), so transact
|
|
37
|
+
* endpoints reject it with a 422.
|
|
34
38
|
*/
|
|
35
39
|
protocol?: CreditProtocol | undefined;
|
|
36
40
|
/**
|
|
@@ -13,10 +13,15 @@ import { ClosedEnum } from "../../types/enums.js";
|
|
|
13
13
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
14
14
|
* field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
|
|
15
15
|
* Euler V2 path, where the market is identified by EVK vault address(es).
|
|
16
|
+
* ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
|
|
17
|
+
* currently read-only: positions and market discovery only — transaction
|
|
18
|
+
* builders land with the looping work (COM-7106/7107/7108), so transact
|
|
19
|
+
* endpoints reject it with a 422.
|
|
16
20
|
*/
|
|
17
21
|
export const CreditProtocol = {
|
|
18
22
|
Aave: "AAVE",
|
|
19
23
|
Euler: "EULER",
|
|
24
|
+
Morpho: "MORPHO",
|
|
20
25
|
} as const;
|
|
21
26
|
/**
|
|
22
27
|
* Which lending protocol a credit action targets.
|
|
@@ -26,6 +31,10 @@ export const CreditProtocol = {
|
|
|
26
31
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
27
32
|
* field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
|
|
28
33
|
* Euler V2 path, where the market is identified by EVK vault address(es).
|
|
34
|
+
* ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
|
|
35
|
+
* currently read-only: positions and market discovery only — transaction
|
|
36
|
+
* builders land with the looping work (COM-7106/7107/7108), so transact
|
|
37
|
+
* endpoints reject it with a 422.
|
|
29
38
|
*/
|
|
30
39
|
export type CreditProtocol = ClosedEnum<typeof CreditProtocol>;
|
|
31
40
|
|
|
@@ -47,6 +47,10 @@ export type CreditRepayParams = {
|
|
|
47
47
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
48
48
|
* field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
|
|
49
49
|
* Euler V2 path, where the market is identified by EVK vault address(es).
|
|
50
|
+
* ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
|
|
51
|
+
* currently read-only: positions and market discovery only — transaction
|
|
52
|
+
* builders land with the looping work (COM-7106/7107/7108), so transact
|
|
53
|
+
* endpoints reject it with a 422.
|
|
50
54
|
*/
|
|
51
55
|
protocol?: CreditProtocol | undefined;
|
|
52
56
|
/**
|
|
@@ -46,6 +46,10 @@ export type CreditRepayRequest = {
|
|
|
46
46
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
47
47
|
* field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
|
|
48
48
|
* Euler V2 path, where the market is identified by EVK vault address(es).
|
|
49
|
+
* ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
|
|
50
|
+
* currently read-only: positions and market discovery only — transaction
|
|
51
|
+
* builders land with the looping work (COM-7106/7107/7108), so transact
|
|
52
|
+
* endpoints reject it with a 422.
|
|
49
53
|
*/
|
|
50
54
|
protocol?: CreditProtocol | undefined;
|
|
51
55
|
/**
|
|
@@ -35,6 +35,10 @@ export type CreditSupplyParams = {
|
|
|
35
35
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
36
36
|
* field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
|
|
37
37
|
* Euler V2 path, where the market is identified by EVK vault address(es).
|
|
38
|
+
* ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
|
|
39
|
+
* currently read-only: positions and market discovery only — transaction
|
|
40
|
+
* builders land with the looping work (COM-7106/7107/7108), so transact
|
|
41
|
+
* endpoints reject it with a 422.
|
|
38
42
|
*/
|
|
39
43
|
protocol?: CreditProtocol | undefined;
|
|
40
44
|
/**
|
|
@@ -35,6 +35,10 @@ export type CreditWithdrawParams = {
|
|
|
35
35
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
36
36
|
* field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
|
|
37
37
|
* Euler V2 path, where the market is identified by EVK vault address(es).
|
|
38
|
+
* ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
|
|
39
|
+
* currently read-only: positions and market discovery only — transaction
|
|
40
|
+
* builders land with the looping work (COM-7106/7107/7108), so transact
|
|
41
|
+
* endpoints reject it with a 422.
|
|
38
42
|
*/
|
|
39
43
|
protocol?: CreditProtocol | undefined;
|
|
40
44
|
/**
|
|
@@ -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";
|
|
@@ -262,6 +264,8 @@ export * from "./pricepoint.js";
|
|
|
262
264
|
export * from "./protocol.js";
|
|
263
265
|
export * from "./quote.js";
|
|
264
266
|
export * from "./quotefee.js";
|
|
267
|
+
export * from "./redemption.js";
|
|
268
|
+
export * from "./redemptionsresponse.js";
|
|
265
269
|
export * from "./repay.js";
|
|
266
270
|
export * from "./reserve.js";
|
|
267
271
|
export * from "./reserveinfo.js";
|