@compass-labs/api-sdk 2.2.76-rc.3 → 2.2.76
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 +3 -7
- package/codeSamples_typescript.yaml +0 -12
- package/dist/commonjs/models/components/aavelooprequest.d.ts +16 -16
- package/dist/commonjs/models/components/aavelooprequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/aavelooprequest.js +17 -17
- package/dist/commonjs/models/components/aavelooprequest.js.map +1 -1
- package/dist/commonjs/models/components/accountsummary.d.ts +0 -4
- 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 +0 -12
- package/dist/commonjs/models/components/collateralposition.d.ts.map +1 -1
- package/dist/commonjs/models/components/collateralposition.js +0 -4
- package/dist/commonjs/models/components/collateralposition.js.map +1 -1
- package/dist/commonjs/models/components/creditborrowparams.d.ts +0 -9
- package/dist/commonjs/models/components/creditborrowparams.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditborrowparams.js +0 -2
- package/dist/commonjs/models/components/creditborrowparams.js.map +1 -1
- package/dist/commonjs/models/components/creditborrowrequest.d.ts +0 -9
- package/dist/commonjs/models/components/creditborrowrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditborrowrequest.js +0 -2
- package/dist/commonjs/models/components/creditborrowrequest.js.map +1 -1
- package/dist/commonjs/models/components/creditenablecollateralparams.d.ts +0 -4
- 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 +0 -9
- package/dist/commonjs/models/components/creditprotocol.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditprotocol.js +0 -5
- package/dist/commonjs/models/components/creditprotocol.js.map +1 -1
- package/dist/commonjs/models/components/creditrepayparams.d.ts +0 -9
- package/dist/commonjs/models/components/creditrepayparams.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditrepayparams.js +0 -2
- package/dist/commonjs/models/components/creditrepayparams.js.map +1 -1
- package/dist/commonjs/models/components/creditrepayrequest.d.ts +0 -9
- package/dist/commonjs/models/components/creditrepayrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditrepayrequest.js +0 -2
- package/dist/commonjs/models/components/creditrepayrequest.js.map +1 -1
- package/dist/commonjs/models/components/creditsupplyparams.d.ts +0 -9
- package/dist/commonjs/models/components/creditsupplyparams.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditsupplyparams.js +0 -2
- package/dist/commonjs/models/components/creditsupplyparams.js.map +1 -1
- package/dist/commonjs/models/components/creditwithdrawparams.d.ts +0 -9
- package/dist/commonjs/models/components/creditwithdrawparams.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditwithdrawparams.js +0 -2
- package/dist/commonjs/models/components/creditwithdrawparams.js.map +1 -1
- package/dist/commonjs/models/components/debtposition.d.ts +0 -12
- package/dist/commonjs/models/components/debtposition.d.ts.map +1 -1
- package/dist/commonjs/models/components/debtposition.js +0 -4
- package/dist/commonjs/models/components/debtposition.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +0 -6
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +0 -6
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +0 -1
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +0 -1
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/sdk/credit.d.ts +0 -32
- package/dist/commonjs/sdk/credit.d.ts.map +1 -1
- package/dist/commonjs/sdk/credit.js +0 -38
- package/dist/commonjs/sdk/credit.js.map +1 -1
- package/dist/esm/models/components/aavelooprequest.d.ts +16 -16
- package/dist/esm/models/components/aavelooprequest.d.ts.map +1 -1
- package/dist/esm/models/components/aavelooprequest.js +12 -12
- package/dist/esm/models/components/aavelooprequest.js.map +1 -1
- package/dist/esm/models/components/accountsummary.d.ts +0 -4
- 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 +0 -12
- package/dist/esm/models/components/collateralposition.d.ts.map +1 -1
- package/dist/esm/models/components/collateralposition.js +0 -4
- package/dist/esm/models/components/collateralposition.js.map +1 -1
- package/dist/esm/models/components/creditborrowparams.d.ts +0 -9
- package/dist/esm/models/components/creditborrowparams.d.ts.map +1 -1
- package/dist/esm/models/components/creditborrowparams.js +0 -2
- package/dist/esm/models/components/creditborrowparams.js.map +1 -1
- package/dist/esm/models/components/creditborrowrequest.d.ts +0 -9
- package/dist/esm/models/components/creditborrowrequest.d.ts.map +1 -1
- package/dist/esm/models/components/creditborrowrequest.js +0 -2
- package/dist/esm/models/components/creditborrowrequest.js.map +1 -1
- package/dist/esm/models/components/creditenablecollateralparams.d.ts +0 -4
- 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 +0 -9
- package/dist/esm/models/components/creditprotocol.d.ts.map +1 -1
- package/dist/esm/models/components/creditprotocol.js +0 -5
- package/dist/esm/models/components/creditprotocol.js.map +1 -1
- package/dist/esm/models/components/creditrepayparams.d.ts +0 -9
- package/dist/esm/models/components/creditrepayparams.d.ts.map +1 -1
- package/dist/esm/models/components/creditrepayparams.js +0 -2
- package/dist/esm/models/components/creditrepayparams.js.map +1 -1
- package/dist/esm/models/components/creditrepayrequest.d.ts +0 -9
- package/dist/esm/models/components/creditrepayrequest.d.ts.map +1 -1
- package/dist/esm/models/components/creditrepayrequest.js +0 -2
- package/dist/esm/models/components/creditrepayrequest.js.map +1 -1
- package/dist/esm/models/components/creditsupplyparams.d.ts +0 -9
- package/dist/esm/models/components/creditsupplyparams.d.ts.map +1 -1
- package/dist/esm/models/components/creditsupplyparams.js +0 -2
- package/dist/esm/models/components/creditsupplyparams.js.map +1 -1
- package/dist/esm/models/components/creditwithdrawparams.d.ts +0 -9
- package/dist/esm/models/components/creditwithdrawparams.d.ts.map +1 -1
- package/dist/esm/models/components/creditwithdrawparams.js +0 -2
- package/dist/esm/models/components/creditwithdrawparams.js.map +1 -1
- package/dist/esm/models/components/debtposition.d.ts +0 -12
- package/dist/esm/models/components/debtposition.d.ts.map +1 -1
- package/dist/esm/models/components/debtposition.js +0 -4
- package/dist/esm/models/components/debtposition.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +0 -6
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +0 -6
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +0 -1
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +0 -1
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/sdk/credit.d.ts +0 -32
- package/dist/esm/sdk/credit.d.ts.map +1 -1
- package/dist/esm/sdk/credit.js +0 -38
- package/dist/esm/sdk/credit.js.map +1 -1
- package/docs/models/components/aavelooprequest.md +4 -4
- package/docs/models/components/accountsummary.md +10 -10
- package/docs/models/components/collateralposition.md +14 -16
- package/docs/models/components/creditborrowparams.md +9 -10
- package/docs/models/components/creditborrowrequest.md +19 -20
- package/docs/models/components/creditenablecollateralparams.md +6 -6
- package/docs/models/components/creditprotocol.md +1 -5
- package/docs/models/components/creditrepayparams.md +8 -9
- package/docs/models/components/creditrepayrequest.md +18 -19
- package/docs/models/components/creditsupplyparams.md +7 -8
- package/docs/models/components/creditwithdrawparams.md +7 -8
- package/docs/models/components/debtposition.md +13 -15
- package/docs/models/components/{aavelooprequestinitialcollateralamount.md → initialcollateralamount.md} +1 -1
- package/docs/models/components/{aavelooprequestloantovalue.md → loantovalue.md} +1 -1
- package/docs/models/components/{aavelooprequestmaxslippagepercent.md → maxslippagepercent.md} +1 -1
- package/docs/models/components/{aavelooprequestmultiplier.md → multiplier.md} +1 -1
- package/docs/sdks/credit/README.md +0 -186
- package/examples/node_modules/tsx/dist/cli.cjs +1 -1
- package/examples/node_modules/tsx/dist/cli.mjs +1 -1
- package/examples/node_modules/tsx/dist/esm/api/index.cjs +1 -1
- package/examples/node_modules/tsx/dist/esm/api/index.mjs +1 -1
- package/examples/node_modules/tsx/dist/esm/index.cjs +1 -1
- package/examples/node_modules/tsx/dist/esm/index.mjs +1 -1
- package/examples/node_modules/tsx/dist/loader.cjs +1 -1
- package/examples/node_modules/tsx/dist/loader.mjs +1 -1
- package/examples/node_modules/tsx/dist/package-BhsaYzSJ.cjs +1 -0
- package/examples/node_modules/tsx/dist/package-REq4Oepp.mjs +1 -0
- package/examples/node_modules/tsx/dist/register-BBZNEaBg.cjs +2 -0
- package/examples/node_modules/tsx/dist/register-tkXbOgAS.mjs +2 -0
- package/examples/node_modules/tsx/dist/repl.cjs +1 -1
- package/examples/node_modules/tsx/dist/repl.mjs +1 -1
- package/examples/node_modules/tsx/package.json +1 -1
- package/examples/package-lock.json +3 -3
- package/openapi_prepped_for_speakeasy.json +2 -658
- package/package.json +1 -1
- package/src/models/components/aavelooprequest.ts +30 -43
- package/src/models/components/accountsummary.ts +0 -4
- package/src/models/components/collateralposition.ts +0 -16
- package/src/models/components/creditborrowparams.ts +0 -11
- package/src/models/components/creditborrowrequest.ts +0 -11
- package/src/models/components/creditenablecollateralparams.ts +0 -4
- package/src/models/components/creditprotocol.ts +0 -9
- package/src/models/components/creditrepayparams.ts +0 -11
- package/src/models/components/creditrepayrequest.ts +0 -11
- package/src/models/components/creditsupplyparams.ts +0 -11
- package/src/models/components/creditwithdrawparams.ts +0 -11
- package/src/models/components/debtposition.ts +0 -16
- package/src/models/components/index.ts +0 -6
- package/src/models/operations/index.ts +0 -1
- package/src/sdk/credit.ts +0 -54
- package/dist/commonjs/funcs/creditCreditLoop.d.ts +0 -31
- package/dist/commonjs/funcs/creditCreditLoop.d.ts.map +0 -1
- package/dist/commonjs/funcs/creditCreditLoop.js +0 -132
- package/dist/commonjs/funcs/creditCreditLoop.js.map +0 -1
- package/dist/commonjs/funcs/creditCreditMorphoMarkets.d.ts +0 -24
- package/dist/commonjs/funcs/creditCreditMorphoMarkets.d.ts.map +0 -1
- package/dist/commonjs/funcs/creditCreditMorphoMarkets.js +0 -128
- package/dist/commonjs/funcs/creditCreditMorphoMarkets.js.map +0 -1
- package/dist/commonjs/models/components/creditlooppreview.d.ts +0 -45
- package/dist/commonjs/models/components/creditlooppreview.d.ts.map +0 -1
- package/dist/commonjs/models/components/creditlooppreview.js +0 -68
- package/dist/commonjs/models/components/creditlooppreview.js.map +0 -1
- package/dist/commonjs/models/components/creditlooprequest.d.ts +0 -125
- package/dist/commonjs/models/components/creditlooprequest.d.ts.map +0 -1
- package/dist/commonjs/models/components/creditlooprequest.js +0 -98
- package/dist/commonjs/models/components/creditlooprequest.js.map +0 -1
- package/dist/commonjs/models/components/creditloopresponse.d.ts +0 -27
- package/dist/commonjs/models/components/creditloopresponse.d.ts.map +0 -1
- package/dist/commonjs/models/components/creditloopresponse.js +0 -61
- package/dist/commonjs/models/components/creditloopresponse.js.map +0 -1
- package/dist/commonjs/models/components/looplegpreview.d.ts +0 -24
- package/dist/commonjs/models/components/looplegpreview.d.ts.map +0 -1
- package/dist/commonjs/models/components/looplegpreview.js +0 -59
- package/dist/commonjs/models/components/looplegpreview.js.map +0 -1
- package/dist/commonjs/models/components/morpholendingmarket.d.ts +0 -80
- package/dist/commonjs/models/components/morpholendingmarket.d.ts.map +0 -1
- package/dist/commonjs/models/components/morpholendingmarket.js +0 -82
- package/dist/commonjs/models/components/morpholendingmarket.js.map +0 -1
- package/dist/commonjs/models/components/morphomarketsresponse.d.ts +0 -21
- package/dist/commonjs/models/components/morphomarketsresponse.d.ts.map +0 -1
- package/dist/commonjs/models/components/morphomarketsresponse.js +0 -52
- package/dist/commonjs/models/components/morphomarketsresponse.js.map +0 -1
- package/dist/commonjs/models/operations/v2creditmorphomarkets.d.ts +0 -22
- package/dist/commonjs/models/operations/v2creditmorphomarkets.d.ts.map +0 -1
- package/dist/commonjs/models/operations/v2creditmorphomarkets.js +0 -57
- package/dist/commonjs/models/operations/v2creditmorphomarkets.js.map +0 -1
- package/dist/esm/funcs/creditCreditLoop.d.ts +0 -31
- package/dist/esm/funcs/creditCreditLoop.d.ts.map +0 -1
- package/dist/esm/funcs/creditCreditLoop.js +0 -96
- package/dist/esm/funcs/creditCreditLoop.js.map +0 -1
- package/dist/esm/funcs/creditCreditMorphoMarkets.d.ts +0 -24
- package/dist/esm/funcs/creditCreditMorphoMarkets.d.ts.map +0 -1
- package/dist/esm/funcs/creditCreditMorphoMarkets.js +0 -92
- package/dist/esm/funcs/creditCreditMorphoMarkets.js.map +0 -1
- package/dist/esm/models/components/creditlooppreview.d.ts +0 -45
- package/dist/esm/models/components/creditlooppreview.d.ts.map +0 -1
- package/dist/esm/models/components/creditlooppreview.js +0 -31
- package/dist/esm/models/components/creditlooppreview.js.map +0 -1
- package/dist/esm/models/components/creditlooprequest.d.ts +0 -125
- package/dist/esm/models/components/creditlooprequest.d.ts.map +0 -1
- package/dist/esm/models/components/creditlooprequest.js +0 -57
- package/dist/esm/models/components/creditlooprequest.js.map +0 -1
- package/dist/esm/models/components/creditloopresponse.d.ts +0 -27
- package/dist/esm/models/components/creditloopresponse.d.ts.map +0 -1
- package/dist/esm/models/components/creditloopresponse.js +0 -24
- package/dist/esm/models/components/creditloopresponse.js.map +0 -1
- package/dist/esm/models/components/looplegpreview.d.ts +0 -24
- package/dist/esm/models/components/looplegpreview.d.ts.map +0 -1
- package/dist/esm/models/components/looplegpreview.js +0 -22
- package/dist/esm/models/components/looplegpreview.js.map +0 -1
- package/dist/esm/models/components/morpholendingmarket.d.ts +0 -80
- package/dist/esm/models/components/morpholendingmarket.d.ts.map +0 -1
- package/dist/esm/models/components/morpholendingmarket.js +0 -45
- package/dist/esm/models/components/morpholendingmarket.js.map +0 -1
- package/dist/esm/models/components/morphomarketsresponse.d.ts +0 -21
- package/dist/esm/models/components/morphomarketsresponse.d.ts.map +0 -1
- package/dist/esm/models/components/morphomarketsresponse.js +0 -15
- package/dist/esm/models/components/morphomarketsresponse.js.map +0 -1
- package/dist/esm/models/operations/v2creditmorphomarkets.d.ts +0 -22
- package/dist/esm/models/operations/v2creditmorphomarkets.d.ts.map +0 -1
- package/dist/esm/models/operations/v2creditmorphomarkets.js +0 -20
- package/dist/esm/models/operations/v2creditmorphomarkets.js.map +0 -1
- package/docs/models/components/creditlooppreview.md +0 -33
- package/docs/models/components/creditlooprequest.md +0 -41
- package/docs/models/components/creditlooprequestinitialcollateralamount.md +0 -19
- package/docs/models/components/creditlooprequestloantovalue.md +0 -19
- package/docs/models/components/creditlooprequestmaxslippagepercent.md +0 -19
- package/docs/models/components/creditlooprequestmultiplier.md +0 -19
- package/docs/models/components/creditloopresponse.md +0 -30
- package/docs/models/components/looplegpreview.md +0 -21
- package/docs/models/components/morpholendingmarket.md +0 -49
- package/docs/models/components/morphomarketsresponse.md +0 -21
- package/docs/models/operations/v2creditmorphomarketschain.md +0 -15
- package/docs/models/operations/v2creditmorphomarketsrequest.md +0 -17
- package/examples/node_modules/tsx/dist/package-Bj47PlGH.mjs +0 -1
- package/examples/node_modules/tsx/dist/package-DMqO70yR.cjs +0 -1
- package/examples/node_modules/tsx/dist/register-CKju0f8h.cjs +0 -2
- package/examples/node_modules/tsx/dist/register-CqMfTiWi.mjs +0 -2
- package/src/funcs/creditCreditLoop.ts +0 -184
- package/src/funcs/creditCreditMorphoMarkets.ts +0 -182
- package/src/models/components/creditlooppreview.ts +0 -86
- package/src/models/components/creditlooprequest.ts +0 -235
- package/src/models/components/creditloopresponse.ts +0 -65
- package/src/models/components/looplegpreview.ts +0 -54
- package/src/models/components/morpholendingmarket.ts +0 -133
- package/src/models/components/morphomarketsresponse.ts +0 -46
- package/src/models/operations/v2creditmorphomarkets.ts +0 -49
package/package.json
CHANGED
|
@@ -21,22 +21,22 @@ export type AaveLoopRequestChain = ClosedEnum<typeof AaveLoopRequestChain>;
|
|
|
21
21
|
/**
|
|
22
22
|
* Amount of collateral token to supply to Aave
|
|
23
23
|
*/
|
|
24
|
-
export type
|
|
24
|
+
export type InitialCollateralAmount = number | string;
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Leverage multiplier. Total loop collateral will be calculated as `multiplier` x `initial_collateral_amount`
|
|
28
28
|
*/
|
|
29
|
-
export type
|
|
29
|
+
export type Multiplier = number | string;
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Maximum allowed slippage for token swaps in percentage
|
|
33
33
|
*/
|
|
34
|
-
export type
|
|
34
|
+
export type MaxSlippagePercent = number | string;
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Loan To Value percentage of the loop
|
|
38
38
|
*/
|
|
39
|
-
export type
|
|
39
|
+
export type LoanToValue = number | string;
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Request model for executing an Aave loop strategy.
|
|
@@ -99,80 +99,67 @@ export const AaveLoopRequestChain$outboundSchema: z.ZodNativeEnum<
|
|
|
99
99
|
> = z.nativeEnum(AaveLoopRequestChain);
|
|
100
100
|
|
|
101
101
|
/** @internal */
|
|
102
|
-
export type
|
|
102
|
+
export type InitialCollateralAmount$Outbound = number | string;
|
|
103
103
|
|
|
104
104
|
/** @internal */
|
|
105
|
-
export const
|
|
106
|
-
|
|
105
|
+
export const InitialCollateralAmount$outboundSchema: z.ZodType<
|
|
106
|
+
InitialCollateralAmount$Outbound,
|
|
107
107
|
z.ZodTypeDef,
|
|
108
|
-
|
|
108
|
+
InitialCollateralAmount
|
|
109
109
|
> = z.union([z.number(), z.string()]);
|
|
110
110
|
|
|
111
|
-
export function
|
|
112
|
-
|
|
113
|
-
AaveLoopRequestInitialCollateralAmount,
|
|
111
|
+
export function initialCollateralAmountToJSON(
|
|
112
|
+
initialCollateralAmount: InitialCollateralAmount,
|
|
114
113
|
): string {
|
|
115
114
|
return JSON.stringify(
|
|
116
|
-
|
|
117
|
-
aaveLoopRequestInitialCollateralAmount,
|
|
118
|
-
),
|
|
115
|
+
InitialCollateralAmount$outboundSchema.parse(initialCollateralAmount),
|
|
119
116
|
);
|
|
120
117
|
}
|
|
121
118
|
|
|
122
119
|
/** @internal */
|
|
123
|
-
export type
|
|
120
|
+
export type Multiplier$Outbound = number | string;
|
|
124
121
|
|
|
125
122
|
/** @internal */
|
|
126
|
-
export const
|
|
127
|
-
|
|
123
|
+
export const Multiplier$outboundSchema: z.ZodType<
|
|
124
|
+
Multiplier$Outbound,
|
|
128
125
|
z.ZodTypeDef,
|
|
129
|
-
|
|
126
|
+
Multiplier
|
|
130
127
|
> = z.union([z.number(), z.string()]);
|
|
131
128
|
|
|
132
|
-
export function
|
|
133
|
-
|
|
134
|
-
): string {
|
|
135
|
-
return JSON.stringify(
|
|
136
|
-
AaveLoopRequestMultiplier$outboundSchema.parse(aaveLoopRequestMultiplier),
|
|
137
|
-
);
|
|
129
|
+
export function multiplierToJSON(multiplier: Multiplier): string {
|
|
130
|
+
return JSON.stringify(Multiplier$outboundSchema.parse(multiplier));
|
|
138
131
|
}
|
|
139
132
|
|
|
140
133
|
/** @internal */
|
|
141
|
-
export type
|
|
134
|
+
export type MaxSlippagePercent$Outbound = number | string;
|
|
142
135
|
|
|
143
136
|
/** @internal */
|
|
144
|
-
export const
|
|
145
|
-
|
|
137
|
+
export const MaxSlippagePercent$outboundSchema: z.ZodType<
|
|
138
|
+
MaxSlippagePercent$Outbound,
|
|
146
139
|
z.ZodTypeDef,
|
|
147
|
-
|
|
140
|
+
MaxSlippagePercent
|
|
148
141
|
> = z.union([z.number(), z.string()]);
|
|
149
142
|
|
|
150
|
-
export function
|
|
151
|
-
|
|
143
|
+
export function maxSlippagePercentToJSON(
|
|
144
|
+
maxSlippagePercent: MaxSlippagePercent,
|
|
152
145
|
): string {
|
|
153
146
|
return JSON.stringify(
|
|
154
|
-
|
|
155
|
-
aaveLoopRequestMaxSlippagePercent,
|
|
156
|
-
),
|
|
147
|
+
MaxSlippagePercent$outboundSchema.parse(maxSlippagePercent),
|
|
157
148
|
);
|
|
158
149
|
}
|
|
159
150
|
|
|
160
151
|
/** @internal */
|
|
161
|
-
export type
|
|
152
|
+
export type LoanToValue$Outbound = number | string;
|
|
162
153
|
|
|
163
154
|
/** @internal */
|
|
164
|
-
export const
|
|
165
|
-
|
|
155
|
+
export const LoanToValue$outboundSchema: z.ZodType<
|
|
156
|
+
LoanToValue$Outbound,
|
|
166
157
|
z.ZodTypeDef,
|
|
167
|
-
|
|
158
|
+
LoanToValue
|
|
168
159
|
> = z.union([z.number(), z.string()]);
|
|
169
160
|
|
|
170
|
-
export function
|
|
171
|
-
|
|
172
|
-
): string {
|
|
173
|
-
return JSON.stringify(
|
|
174
|
-
AaveLoopRequestLoanToValue$outboundSchema.parse(aaveLoopRequestLoanToValue),
|
|
175
|
-
);
|
|
161
|
+
export function loanToValueToJSON(loanToValue: LoanToValue): string {
|
|
162
|
+
return JSON.stringify(LoanToValue$outboundSchema.parse(loanToValue));
|
|
176
163
|
}
|
|
177
164
|
|
|
178
165
|
/** @internal */
|
|
@@ -30,10 +30,6 @@ 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.
|
|
37
33
|
*/
|
|
38
34
|
protocol?: CreditProtocol | undefined;
|
|
39
35
|
/**
|
|
@@ -33,24 +33,12 @@ 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.
|
|
40
36
|
*/
|
|
41
37
|
protocol?: CreditProtocol | undefined;
|
|
42
38
|
/**
|
|
43
39
|
* Euler only: the EVK collateral vault holding this position.
|
|
44
40
|
*/
|
|
45
41
|
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;
|
|
54
42
|
/**
|
|
55
43
|
* Current on-chain collateral balance (the vault's underlying asset for Euler).
|
|
56
44
|
*/
|
|
@@ -95,8 +83,6 @@ export const CollateralPosition$inboundSchema: z.ZodType<
|
|
|
95
83
|
symbol: z.string(),
|
|
96
84
|
protocol: CreditProtocol$inboundSchema.optional(),
|
|
97
85
|
vault: z.nullable(z.string()).optional(),
|
|
98
|
-
market_id: z.nullable(z.string()).optional(),
|
|
99
|
-
is_pure_supply: z.nullable(z.boolean()).optional(),
|
|
100
86
|
amount_supplied: z.nullable(z.string()),
|
|
101
87
|
usd_value: z.nullable(z.string()).optional(),
|
|
102
88
|
supply_apy: z.nullable(z.string()).optional(),
|
|
@@ -107,8 +93,6 @@ export const CollateralPosition$inboundSchema: z.ZodType<
|
|
|
107
93
|
events: z.array(CreditEvent$inboundSchema).optional(),
|
|
108
94
|
}).transform((v) => {
|
|
109
95
|
return remap$(v, {
|
|
110
|
-
"market_id": "marketId",
|
|
111
|
-
"is_pure_supply": "isPureSupply",
|
|
112
96
|
"amount_supplied": "amountSupplied",
|
|
113
97
|
"usd_value": "usdValue",
|
|
114
98
|
"supply_apy": "supplyApy",
|
|
@@ -56,20 +56,12 @@ 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.
|
|
63
59
|
*/
|
|
64
60
|
protocol?: CreditProtocol | undefined;
|
|
65
61
|
/**
|
|
66
62
|
* Euler only: the EVK vault to borrow from. Required when protocol=EULER.
|
|
67
63
|
*/
|
|
68
64
|
borrowVault?: string | null | undefined;
|
|
69
|
-
/**
|
|
70
|
-
* Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO.
|
|
71
|
-
*/
|
|
72
|
-
marketId?: string | null | undefined;
|
|
73
65
|
};
|
|
74
66
|
|
|
75
67
|
/** @internal */
|
|
@@ -99,7 +91,6 @@ export type CreditBorrowParams$Outbound = {
|
|
|
99
91
|
fee?: CreditFee$Outbound | null | undefined;
|
|
100
92
|
protocol?: string | undefined;
|
|
101
93
|
borrow_vault?: string | null | undefined;
|
|
102
|
-
market_id?: string | null | undefined;
|
|
103
94
|
};
|
|
104
95
|
|
|
105
96
|
/** @internal */
|
|
@@ -115,13 +106,11 @@ export const CreditBorrowParams$outboundSchema: z.ZodType<
|
|
|
115
106
|
fee: z.nullable(CreditFee$outboundSchema).optional(),
|
|
116
107
|
protocol: CreditProtocol$outboundSchema.optional(),
|
|
117
108
|
borrowVault: z.nullable(z.string()).optional(),
|
|
118
|
-
marketId: z.nullable(z.string()).optional(),
|
|
119
109
|
}).transform((v) => {
|
|
120
110
|
return remap$(v, {
|
|
121
111
|
actionType: "action_type",
|
|
122
112
|
interestRateMode: "interest_rate_mode",
|
|
123
113
|
borrowVault: "borrow_vault",
|
|
124
|
-
marketId: "market_id",
|
|
125
114
|
});
|
|
126
115
|
});
|
|
127
116
|
|
|
@@ -51,10 +51,6 @@ 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.
|
|
58
54
|
*/
|
|
59
55
|
protocol?: CreditProtocol | undefined;
|
|
60
56
|
/**
|
|
@@ -65,10 +61,6 @@ export type CreditBorrowRequest = {
|
|
|
65
61
|
* Euler only: the EVK vault to borrow from. Required when protocol=EULER.
|
|
66
62
|
*/
|
|
67
63
|
borrowVault?: string | null | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO.
|
|
70
|
-
*/
|
|
71
|
-
marketId?: string | null | undefined;
|
|
72
64
|
/**
|
|
73
65
|
* Token currently held in the Credit Account to use as input. If the same as collateral_token, no swap is performed. Omit together with amount_in and collateral_token to borrow against existing collateral.
|
|
74
66
|
*/
|
|
@@ -184,7 +176,6 @@ export type CreditBorrowRequest$Outbound = {
|
|
|
184
176
|
protocol?: string | undefined;
|
|
185
177
|
collateral_vault?: string | null | undefined;
|
|
186
178
|
borrow_vault?: string | null | undefined;
|
|
187
|
-
market_id?: string | null | undefined;
|
|
188
179
|
token_in?: string | null | undefined;
|
|
189
180
|
amount_in?: number | string | null | undefined;
|
|
190
181
|
collateral_token?: string | null | undefined;
|
|
@@ -210,7 +201,6 @@ export const CreditBorrowRequest$outboundSchema: z.ZodType<
|
|
|
210
201
|
protocol: CreditProtocol$outboundSchema.optional(),
|
|
211
202
|
collateralVault: z.nullable(z.string()).optional(),
|
|
212
203
|
borrowVault: z.nullable(z.string()).optional(),
|
|
213
|
-
marketId: z.nullable(z.string()).optional(),
|
|
214
204
|
tokenIn: z.nullable(z.string()).optional(),
|
|
215
205
|
amountIn: z.nullable(z.union([z.number(), z.string()])).optional(),
|
|
216
206
|
collateralToken: z.nullable(z.string()).optional(),
|
|
@@ -227,7 +217,6 @@ export const CreditBorrowRequest$outboundSchema: z.ZodType<
|
|
|
227
217
|
return remap$(v, {
|
|
228
218
|
collateralVault: "collateral_vault",
|
|
229
219
|
borrowVault: "borrow_vault",
|
|
230
|
-
marketId: "market_id",
|
|
231
220
|
tokenIn: "token_in",
|
|
232
221
|
amountIn: "amount_in",
|
|
233
222
|
collateralToken: "collateral_token",
|
|
@@ -31,10 +31,6 @@ 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.
|
|
38
34
|
*/
|
|
39
35
|
protocol?: CreditProtocol | undefined;
|
|
40
36
|
/**
|
|
@@ -13,15 +13,10 @@ 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.
|
|
20
16
|
*/
|
|
21
17
|
export const CreditProtocol = {
|
|
22
18
|
Aave: "AAVE",
|
|
23
19
|
Euler: "EULER",
|
|
24
|
-
Morpho: "MORPHO",
|
|
25
20
|
} as const;
|
|
26
21
|
/**
|
|
27
22
|
* Which lending protocol a credit action targets.
|
|
@@ -31,10 +26,6 @@ export const CreditProtocol = {
|
|
|
31
26
|
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
32
27
|
* field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
|
|
33
28
|
* 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.
|
|
38
29
|
*/
|
|
39
30
|
export type CreditProtocol = ClosedEnum<typeof CreditProtocol>;
|
|
40
31
|
|
|
@@ -47,20 +47,12 @@ 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.
|
|
54
50
|
*/
|
|
55
51
|
protocol?: CreditProtocol | undefined;
|
|
56
52
|
/**
|
|
57
53
|
* Euler only: the EVK vault the debt is owed to. Required when protocol=EULER.
|
|
58
54
|
*/
|
|
59
55
|
borrowVault?: string | null | undefined;
|
|
60
|
-
/**
|
|
61
|
-
* Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO.
|
|
62
|
-
*/
|
|
63
|
-
marketId?: string | null | undefined;
|
|
64
56
|
};
|
|
65
57
|
|
|
66
58
|
/** @internal */
|
|
@@ -89,7 +81,6 @@ export type CreditRepayParams$Outbound = {
|
|
|
89
81
|
interest_rate_mode?: string | undefined;
|
|
90
82
|
protocol?: string | undefined;
|
|
91
83
|
borrow_vault?: string | null | undefined;
|
|
92
|
-
market_id?: string | null | undefined;
|
|
93
84
|
};
|
|
94
85
|
|
|
95
86
|
/** @internal */
|
|
@@ -104,13 +95,11 @@ export const CreditRepayParams$outboundSchema: z.ZodType<
|
|
|
104
95
|
interestRateMode: InterestRateMode$outboundSchema.optional(),
|
|
105
96
|
protocol: CreditProtocol$outboundSchema.optional(),
|
|
106
97
|
borrowVault: z.nullable(z.string()).optional(),
|
|
107
|
-
marketId: z.nullable(z.string()).optional(),
|
|
108
98
|
}).transform((v) => {
|
|
109
99
|
return remap$(v, {
|
|
110
100
|
actionType: "action_type",
|
|
111
101
|
interestRateMode: "interest_rate_mode",
|
|
112
102
|
borrowVault: "borrow_vault",
|
|
113
|
-
marketId: "market_id",
|
|
114
103
|
});
|
|
115
104
|
});
|
|
116
105
|
|
|
@@ -46,20 +46,12 @@ 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.
|
|
53
49
|
*/
|
|
54
50
|
protocol?: CreditProtocol | undefined;
|
|
55
51
|
/**
|
|
56
52
|
* Euler only: the EVK vault the debt is owed to (repay target). Required when protocol=EULER.
|
|
57
53
|
*/
|
|
58
54
|
borrowVault?: string | null | undefined;
|
|
59
|
-
/**
|
|
60
|
-
* Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO.
|
|
61
|
-
*/
|
|
62
|
-
marketId?: string | null | undefined;
|
|
63
55
|
/**
|
|
64
56
|
* Euler only: the EVK collateral vault to withdraw from. Required when protocol=EULER and withdrawing collateral.
|
|
65
57
|
*/
|
|
@@ -166,7 +158,6 @@ export type CreditRepayRequest$Outbound = {
|
|
|
166
158
|
chain: string;
|
|
167
159
|
protocol?: string | undefined;
|
|
168
160
|
borrow_vault?: string | null | undefined;
|
|
169
|
-
market_id?: string | null | undefined;
|
|
170
161
|
collateral_vault?: string | null | undefined;
|
|
171
162
|
repay_token: string;
|
|
172
163
|
repay_amount: number | string;
|
|
@@ -191,7 +182,6 @@ export const CreditRepayRequest$outboundSchema: z.ZodType<
|
|
|
191
182
|
chain: Chain$outboundSchema,
|
|
192
183
|
protocol: CreditProtocol$outboundSchema.optional(),
|
|
193
184
|
borrowVault: z.nullable(z.string()).optional(),
|
|
194
|
-
marketId: z.nullable(z.string()).optional(),
|
|
195
185
|
collateralVault: z.nullable(z.string()).optional(),
|
|
196
186
|
repayToken: z.string(),
|
|
197
187
|
repayAmount: z.union([z.number(), z.string()]),
|
|
@@ -207,7 +197,6 @@ export const CreditRepayRequest$outboundSchema: z.ZodType<
|
|
|
207
197
|
}).transform((v) => {
|
|
208
198
|
return remap$(v, {
|
|
209
199
|
borrowVault: "borrow_vault",
|
|
210
|
-
marketId: "market_id",
|
|
211
200
|
collateralVault: "collateral_vault",
|
|
212
201
|
repayToken: "repay_token",
|
|
213
202
|
repayAmount: "repay_amount",
|
|
@@ -35,20 +35,12 @@ 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.
|
|
42
38
|
*/
|
|
43
39
|
protocol?: CreditProtocol | undefined;
|
|
44
40
|
/**
|
|
45
41
|
* Euler only: the EVK collateral vault to supply into. Required when protocol=EULER.
|
|
46
42
|
*/
|
|
47
43
|
collateralVault?: string | null | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO.
|
|
50
|
-
*/
|
|
51
|
-
marketId?: string | null | undefined;
|
|
52
44
|
};
|
|
53
45
|
|
|
54
46
|
/** @internal */
|
|
@@ -76,7 +68,6 @@ export type CreditSupplyParams$Outbound = {
|
|
|
76
68
|
amount: number | string;
|
|
77
69
|
protocol?: string | undefined;
|
|
78
70
|
collateral_vault?: string | null | undefined;
|
|
79
|
-
market_id?: string | null | undefined;
|
|
80
71
|
};
|
|
81
72
|
|
|
82
73
|
/** @internal */
|
|
@@ -90,12 +81,10 @@ export const CreditSupplyParams$outboundSchema: z.ZodType<
|
|
|
90
81
|
amount: z.union([z.number(), z.string()]),
|
|
91
82
|
protocol: CreditProtocol$outboundSchema.optional(),
|
|
92
83
|
collateralVault: z.nullable(z.string()).optional(),
|
|
93
|
-
marketId: z.nullable(z.string()).optional(),
|
|
94
84
|
}).transform((v) => {
|
|
95
85
|
return remap$(v, {
|
|
96
86
|
actionType: "action_type",
|
|
97
87
|
collateralVault: "collateral_vault",
|
|
98
|
-
marketId: "market_id",
|
|
99
88
|
});
|
|
100
89
|
});
|
|
101
90
|
|
|
@@ -35,20 +35,12 @@ 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.
|
|
42
38
|
*/
|
|
43
39
|
protocol?: CreditProtocol | undefined;
|
|
44
40
|
/**
|
|
45
41
|
* Euler only: the EVK collateral vault to withdraw from. Required when protocol=EULER.
|
|
46
42
|
*/
|
|
47
43
|
collateralVault?: string | null | undefined;
|
|
48
|
-
/**
|
|
49
|
-
* Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO.
|
|
50
|
-
*/
|
|
51
|
-
marketId?: string | null | undefined;
|
|
52
44
|
};
|
|
53
45
|
|
|
54
46
|
/** @internal */
|
|
@@ -76,7 +68,6 @@ export type CreditWithdrawParams$Outbound = {
|
|
|
76
68
|
amount: number | string;
|
|
77
69
|
protocol?: string | undefined;
|
|
78
70
|
collateral_vault?: string | null | undefined;
|
|
79
|
-
market_id?: string | null | undefined;
|
|
80
71
|
};
|
|
81
72
|
|
|
82
73
|
/** @internal */
|
|
@@ -90,12 +81,10 @@ export const CreditWithdrawParams$outboundSchema: z.ZodType<
|
|
|
90
81
|
amount: z.union([z.number(), z.string()]),
|
|
91
82
|
protocol: CreditProtocol$outboundSchema.optional(),
|
|
92
83
|
collateralVault: z.nullable(z.string()).optional(),
|
|
93
|
-
marketId: z.nullable(z.string()).optional(),
|
|
94
84
|
}).transform((v) => {
|
|
95
85
|
return remap$(v, {
|
|
96
86
|
actionType: "action_type",
|
|
97
87
|
collateralVault: "collateral_vault",
|
|
98
|
-
marketId: "market_id",
|
|
99
88
|
});
|
|
100
89
|
});
|
|
101
90
|
|
|
@@ -33,24 +33,12 @@ 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.
|
|
40
36
|
*/
|
|
41
37
|
protocol?: CreditProtocol | undefined;
|
|
42
38
|
/**
|
|
43
39
|
* Euler only: the EVK borrow vault this debt is owed to.
|
|
44
40
|
*/
|
|
45
41
|
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;
|
|
54
42
|
/**
|
|
55
43
|
* Current on-chain debt balance (the vault's underlying asset for Euler).
|
|
56
44
|
*/
|
|
@@ -91,8 +79,6 @@ export const DebtPosition$inboundSchema: z.ZodType<
|
|
|
91
79
|
symbol: z.string(),
|
|
92
80
|
protocol: CreditProtocol$inboundSchema.optional(),
|
|
93
81
|
vault: z.nullable(z.string()).optional(),
|
|
94
|
-
market_id: z.nullable(z.string()).optional(),
|
|
95
|
-
health_factor: z.nullable(z.string()).optional(),
|
|
96
82
|
amount_borrowed: z.nullable(z.string()),
|
|
97
83
|
usd_value: z.nullable(z.string()).optional(),
|
|
98
84
|
borrow_apy: z.nullable(z.string()).optional(),
|
|
@@ -102,8 +88,6 @@ export const DebtPosition$inboundSchema: z.ZodType<
|
|
|
102
88
|
events: z.array(CreditEvent$inboundSchema).optional(),
|
|
103
89
|
}).transform((v) => {
|
|
104
90
|
return remap$(v, {
|
|
105
|
-
"market_id": "marketId",
|
|
106
|
-
"health_factor": "healthFactor",
|
|
107
91
|
"amount_borrowed": "amountBorrowed",
|
|
108
92
|
"usd_value": "usdValue",
|
|
109
93
|
"borrow_apy": "borrowApy",
|
|
@@ -102,9 +102,6 @@ export * from "./creditbundleresponse.js";
|
|
|
102
102
|
export * from "./creditenablecollateralparams.js";
|
|
103
103
|
export * from "./creditevent.js";
|
|
104
104
|
export * from "./creditfee.js";
|
|
105
|
-
export * from "./creditlooppreview.js";
|
|
106
|
-
export * from "./creditlooprequest.js";
|
|
107
|
-
export * from "./creditloopresponse.js";
|
|
108
105
|
export * from "./creditpositionsresponse.js";
|
|
109
106
|
export * from "./creditprotocol.js";
|
|
110
107
|
export * from "./creditrepayparams.js";
|
|
@@ -185,7 +182,6 @@ export * from "./globalmarketsperpswithdrawrequest.js";
|
|
|
185
182
|
export * from "./interestratemode.js";
|
|
186
183
|
export * from "./liquidationcall.js";
|
|
187
184
|
export * from "./listaavemarketsresponse.js";
|
|
188
|
-
export * from "./looplegpreview.js";
|
|
189
185
|
export * from "./lpbalance.js";
|
|
190
186
|
export * from "./marketallocation.js";
|
|
191
187
|
export * from "./marketdetail.js";
|
|
@@ -205,9 +201,7 @@ export * from "./morphodepositrequest.js";
|
|
|
205
201
|
export * from "./morphogetmarketresponse.js";
|
|
206
202
|
export * from "./morphogetmarketsresponse.js";
|
|
207
203
|
export * from "./morphogetvaultsresponse.js";
|
|
208
|
-
export * from "./morpholendingmarket.js";
|
|
209
204
|
export * from "./morphomarket.js";
|
|
210
|
-
export * from "./morphomarketsresponse.js";
|
|
211
205
|
export * from "./morphorepayparams.js";
|
|
212
206
|
export * from "./morphorepayrequest.js";
|
|
213
207
|
export * from "./morphosupplycollateralparams.js";
|
|
@@ -43,7 +43,6 @@ 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";
|
|
47
46
|
export * from "./v2creditpositions.js";
|
|
48
47
|
export * from "./v2earnaavemarkets.js";
|
|
49
48
|
export * from "./v2earnbalances.js";
|
package/src/sdk/credit.ts
CHANGED
|
@@ -7,8 +7,6 @@ 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 { creditCreditLoop } from "../funcs/creditCreditLoop.js";
|
|
11
|
-
import { creditCreditMorphoMarkets } from "../funcs/creditCreditMorphoMarkets.js";
|
|
12
10
|
import { creditCreditPositions } from "../funcs/creditCreditPositions.js";
|
|
13
11
|
import { creditCreditRepay } from "../funcs/creditCreditRepay.js";
|
|
14
12
|
import { creditCreditTransfer } from "../funcs/creditCreditTransfer.js";
|
|
@@ -80,28 +78,6 @@ export class Credit extends ClientSDK {
|
|
|
80
78
|
));
|
|
81
79
|
}
|
|
82
80
|
|
|
83
|
-
/**
|
|
84
|
-
* List curated Morpho markets
|
|
85
|
-
*
|
|
86
|
-
* @remarks
|
|
87
|
-
* List curated Morpho Blue lending markets for a chain.
|
|
88
|
-
*
|
|
89
|
-
* Morpho Blue is permissionless, so credit actions identify a market by its
|
|
90
|
-
* bytes32 market id. This returns the curated market set with live LLTV,
|
|
91
|
-
* supply/borrow APY, utilization, and available liquidity -- read on-chain per
|
|
92
|
-
* request -- so callers know which market_id to use and what it currently costs.
|
|
93
|
-
*/
|
|
94
|
-
async creditMorphoMarkets(
|
|
95
|
-
request: operations.V2CreditMorphoMarketsRequest,
|
|
96
|
-
options?: RequestOptions,
|
|
97
|
-
): Promise<components.MorphoMarketsResponse> {
|
|
98
|
-
return unwrapAsync(creditCreditMorphoMarkets(
|
|
99
|
-
this,
|
|
100
|
-
request,
|
|
101
|
-
options,
|
|
102
|
-
));
|
|
103
|
-
}
|
|
104
|
-
|
|
105
81
|
/**
|
|
106
82
|
* Create credit account
|
|
107
83
|
*
|
|
@@ -151,36 +127,6 @@ export class Credit extends ClientSDK {
|
|
|
151
127
|
));
|
|
152
128
|
}
|
|
153
129
|
|
|
154
|
-
/**
|
|
155
|
-
* Open a leveraged loop
|
|
156
|
-
*
|
|
157
|
-
* @remarks
|
|
158
|
-
* Open a leveraged loop into an Aave or Morpho market in ONE atomic transaction.
|
|
159
|
-
*
|
|
160
|
-
* Repeatedly supplies collateral, borrows at the requested loan-to-value, and
|
|
161
|
-
* swaps the borrow back to collateral. Each iteration's supply uses the swap's
|
|
162
|
-
* GUARANTEED minimum output (enforced on-chain), so a fill anywhere within the
|
|
163
|
-
* slippage tolerance can never break a later step; any positive surplus stays
|
|
164
|
-
* in the Credit Account (the preview reports the bound as estimated_max_dust).
|
|
165
|
-
* Very large loops relative to pool depth can still exceed the slippage
|
|
166
|
-
* tolerance through their own cumulative price impact — size accordingly or
|
|
167
|
-
* raise max_slippage_percent.
|
|
168
|
-
*
|
|
169
|
-
* The Credit Account must already hold initial_collateral_amount of
|
|
170
|
-
* collateral_token. For protocol=MORPHO pass a market_id from
|
|
171
|
-
* /v2/credit/morpho_markets.
|
|
172
|
-
*/
|
|
173
|
-
async creditLoop(
|
|
174
|
-
request: components.CreditLoopRequest,
|
|
175
|
-
options?: RequestOptions,
|
|
176
|
-
): Promise<components.CreditLoopResponse> {
|
|
177
|
-
return unwrapAsync(creditCreditLoop(
|
|
178
|
-
this,
|
|
179
|
-
request,
|
|
180
|
-
options,
|
|
181
|
-
));
|
|
182
|
-
}
|
|
183
|
-
|
|
184
130
|
/**
|
|
185
131
|
* Transfer tokens to/from Credit Account
|
|
186
132
|
*
|