@compass-labs/api-sdk 2.2.76 → 2.2.77-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 +9 -3
- package/codeSamples_typescript.yaml +18 -0
- package/dist/commonjs/funcs/creditCreditLoop.d.ts +31 -0
- package/dist/commonjs/funcs/creditCreditLoop.d.ts.map +1 -0
- package/dist/commonjs/funcs/creditCreditLoop.js +132 -0
- package/dist/commonjs/funcs/creditCreditLoop.js.map +1 -0
- package/dist/commonjs/funcs/creditCreditLoopedPositions.d.ts +26 -0
- package/dist/commonjs/funcs/creditCreditLoopedPositions.d.ts.map +1 -0
- package/dist/commonjs/funcs/creditCreditLoopedPositions.js +131 -0
- package/dist/commonjs/funcs/creditCreditLoopedPositions.js.map +1 -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/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- 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 +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/createaccountrequest.d.ts +1 -0
- package/dist/commonjs/models/components/createaccountrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/createaccountrequest.js +1 -0
- package/dist/commonjs/models/components/createaccountrequest.js.map +1 -1
- package/dist/commonjs/models/components/createcreditaccountrequest.d.ts +1 -0
- package/dist/commonjs/models/components/createcreditaccountrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/createcreditaccountrequest.js +1 -0
- package/dist/commonjs/models/components/createcreditaccountrequest.js.map +1 -1
- package/dist/commonjs/models/components/creditborrowparams.d.ts +9 -0
- package/dist/commonjs/models/components/creditborrowparams.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditborrowparams.js +2 -0
- package/dist/commonjs/models/components/creditborrowparams.js.map +1 -1
- package/dist/commonjs/models/components/creditborrowrequest.d.ts +9 -0
- package/dist/commonjs/models/components/creditborrowrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditborrowrequest.js +2 -0
- 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/creditloopedpositionsresponse.d.ts +26 -0
- package/dist/commonjs/models/components/creditloopedpositionsresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/creditloopedpositionsresponse.js +60 -0
- package/dist/commonjs/models/components/creditloopedpositionsresponse.js.map +1 -0
- package/dist/commonjs/models/components/creditlooppreview.d.ts +45 -0
- package/dist/commonjs/models/components/creditlooppreview.d.ts.map +1 -0
- package/dist/commonjs/models/components/creditlooppreview.js +68 -0
- package/dist/commonjs/models/components/creditlooppreview.js.map +1 -0
- package/dist/commonjs/models/components/creditlooprequest.d.ts +125 -0
- package/dist/commonjs/models/components/creditlooprequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/creditlooprequest.js +98 -0
- package/dist/commonjs/models/components/creditlooprequest.js.map +1 -0
- package/dist/commonjs/models/components/creditloopresponse.d.ts +27 -0
- package/dist/commonjs/models/components/creditloopresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/creditloopresponse.js +61 -0
- package/dist/commonjs/models/components/creditloopresponse.js.map +1 -0
- 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 +9 -0
- package/dist/commonjs/models/components/creditrepayparams.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditrepayparams.js +2 -0
- package/dist/commonjs/models/components/creditrepayparams.js.map +1 -1
- package/dist/commonjs/models/components/creditrepayrequest.d.ts +9 -0
- package/dist/commonjs/models/components/creditrepayrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditrepayrequest.js +2 -0
- package/dist/commonjs/models/components/creditrepayrequest.js.map +1 -1
- package/dist/commonjs/models/components/creditsupplyparams.d.ts +9 -0
- package/dist/commonjs/models/components/creditsupplyparams.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditsupplyparams.js +2 -0
- package/dist/commonjs/models/components/creditsupplyparams.js.map +1 -1
- package/dist/commonjs/models/components/creditwithdrawparams.d.ts +9 -0
- package/dist/commonjs/models/components/creditwithdrawparams.d.ts.map +1 -1
- package/dist/commonjs/models/components/creditwithdrawparams.js +2 -0
- 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 +12 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +12 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/loopedposition.d.ts +88 -0
- package/dist/commonjs/models/components/loopedposition.d.ts.map +1 -0
- package/dist/commonjs/models/components/loopedposition.js +85 -0
- package/dist/commonjs/models/components/loopedposition.js.map +1 -0
- package/dist/commonjs/models/components/loopedpositioncurrentstate.d.ts +58 -0
- package/dist/commonjs/models/components/loopedpositioncurrentstate.d.ts.map +1 -0
- package/dist/commonjs/models/components/loopedpositioncurrentstate.js +77 -0
- package/dist/commonjs/models/components/loopedpositioncurrentstate.js.map +1 -0
- package/dist/commonjs/models/components/loopedpositionhistoryentry.d.ts +71 -0
- package/dist/commonjs/models/components/loopedpositionhistoryentry.d.ts.map +1 -0
- package/dist/commonjs/models/components/loopedpositionhistoryentry.js +85 -0
- package/dist/commonjs/models/components/loopedpositionhistoryentry.js.map +1 -0
- package/dist/commonjs/models/components/loopedpositiontotals.d.ts +40 -0
- package/dist/commonjs/models/components/loopedpositiontotals.d.ts.map +1 -0
- package/dist/commonjs/models/components/loopedpositiontotals.js +67 -0
- package/dist/commonjs/models/components/loopedpositiontotals.js.map +1 -0
- package/dist/commonjs/models/components/looplegpreview.d.ts +24 -0
- package/dist/commonjs/models/components/looplegpreview.d.ts.map +1 -0
- package/dist/commonjs/models/components/looplegpreview.js +59 -0
- package/dist/commonjs/models/components/looplegpreview.js.map +1 -0
- 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/swapinfo.d.ts +48 -0
- package/dist/commonjs/models/components/swapinfo.d.ts.map +1 -0
- package/dist/commonjs/models/components/swapinfo.js +66 -0
- package/dist/commonjs/models/components/swapinfo.js.map +1 -0
- 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/v2creditbalances.d.ts +1 -0
- package/dist/commonjs/models/operations/v2creditbalances.d.ts.map +1 -1
- package/dist/commonjs/models/operations/v2creditbalances.js +1 -0
- package/dist/commonjs/models/operations/v2creditbalances.js.map +1 -1
- package/dist/commonjs/models/operations/v2crediteulermarkets.d.ts +1 -0
- package/dist/commonjs/models/operations/v2crediteulermarkets.d.ts.map +1 -1
- package/dist/commonjs/models/operations/v2crediteulermarkets.js +1 -0
- package/dist/commonjs/models/operations/v2crediteulermarkets.js.map +1 -1
- package/dist/commonjs/models/operations/v2creditloopedpositions.d.ts +28 -0
- package/dist/commonjs/models/operations/v2creditloopedpositions.d.ts.map +1 -0
- package/dist/commonjs/models/operations/v2creditloopedpositions.js +59 -0
- package/dist/commonjs/models/operations/v2creditloopedpositions.js.map +1 -0
- package/dist/commonjs/models/operations/v2creditmorphomarkets.d.ts +23 -0
- package/dist/commonjs/models/operations/v2creditmorphomarkets.d.ts.map +1 -0
- package/dist/commonjs/models/operations/v2creditmorphomarkets.js +58 -0
- package/dist/commonjs/models/operations/v2creditmorphomarkets.js.map +1 -0
- package/dist/commonjs/models/operations/v2creditpositions.d.ts +1 -0
- package/dist/commonjs/models/operations/v2creditpositions.d.ts.map +1 -1
- package/dist/commonjs/models/operations/v2creditpositions.js +1 -0
- package/dist/commonjs/models/operations/v2creditpositions.js.map +1 -1
- package/dist/commonjs/models/operations/v2earnbalances.d.ts +1 -0
- package/dist/commonjs/models/operations/v2earnbalances.d.ts.map +1 -1
- package/dist/commonjs/models/operations/v2earnbalances.js +1 -0
- package/dist/commonjs/models/operations/v2earnbalances.js.map +1 -1
- package/dist/commonjs/models/operations/v2earnpositions.d.ts +1 -0
- package/dist/commonjs/models/operations/v2earnpositions.d.ts.map +1 -1
- package/dist/commonjs/models/operations/v2earnpositions.js +1 -0
- package/dist/commonjs/models/operations/v2earnpositions.js.map +1 -1
- package/dist/commonjs/sdk/credit.d.ts +46 -0
- package/dist/commonjs/sdk/credit.d.ts.map +1 -1
- package/dist/commonjs/sdk/credit.js +55 -0
- package/dist/commonjs/sdk/credit.js.map +1 -1
- package/dist/esm/funcs/creditCreditLoop.d.ts +31 -0
- package/dist/esm/funcs/creditCreditLoop.d.ts.map +1 -0
- package/dist/esm/funcs/creditCreditLoop.js +96 -0
- package/dist/esm/funcs/creditCreditLoop.js.map +1 -0
- package/dist/esm/funcs/creditCreditLoopedPositions.d.ts +26 -0
- package/dist/esm/funcs/creditCreditLoopedPositions.d.ts.map +1 -0
- package/dist/esm/funcs/creditCreditLoopedPositions.js +95 -0
- package/dist/esm/funcs/creditCreditLoopedPositions.js.map +1 -0
- 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/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- 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 +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/createaccountrequest.d.ts +1 -0
- package/dist/esm/models/components/createaccountrequest.d.ts.map +1 -1
- package/dist/esm/models/components/createaccountrequest.js +1 -0
- package/dist/esm/models/components/createaccountrequest.js.map +1 -1
- package/dist/esm/models/components/createcreditaccountrequest.d.ts +1 -0
- package/dist/esm/models/components/createcreditaccountrequest.d.ts.map +1 -1
- package/dist/esm/models/components/createcreditaccountrequest.js +1 -0
- package/dist/esm/models/components/createcreditaccountrequest.js.map +1 -1
- package/dist/esm/models/components/creditborrowparams.d.ts +9 -0
- package/dist/esm/models/components/creditborrowparams.d.ts.map +1 -1
- package/dist/esm/models/components/creditborrowparams.js +2 -0
- package/dist/esm/models/components/creditborrowparams.js.map +1 -1
- package/dist/esm/models/components/creditborrowrequest.d.ts +9 -0
- package/dist/esm/models/components/creditborrowrequest.d.ts.map +1 -1
- package/dist/esm/models/components/creditborrowrequest.js +2 -0
- 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/creditloopedpositionsresponse.d.ts +26 -0
- package/dist/esm/models/components/creditloopedpositionsresponse.d.ts.map +1 -0
- package/dist/esm/models/components/creditloopedpositionsresponse.js +23 -0
- package/dist/esm/models/components/creditloopedpositionsresponse.js.map +1 -0
- package/dist/esm/models/components/creditlooppreview.d.ts +45 -0
- package/dist/esm/models/components/creditlooppreview.d.ts.map +1 -0
- package/dist/esm/models/components/creditlooppreview.js +31 -0
- package/dist/esm/models/components/creditlooppreview.js.map +1 -0
- package/dist/esm/models/components/creditlooprequest.d.ts +125 -0
- package/dist/esm/models/components/creditlooprequest.d.ts.map +1 -0
- package/dist/esm/models/components/creditlooprequest.js +57 -0
- package/dist/esm/models/components/creditlooprequest.js.map +1 -0
- package/dist/esm/models/components/creditloopresponse.d.ts +27 -0
- package/dist/esm/models/components/creditloopresponse.d.ts.map +1 -0
- package/dist/esm/models/components/creditloopresponse.js +24 -0
- package/dist/esm/models/components/creditloopresponse.js.map +1 -0
- 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 +9 -0
- package/dist/esm/models/components/creditrepayparams.d.ts.map +1 -1
- package/dist/esm/models/components/creditrepayparams.js +2 -0
- package/dist/esm/models/components/creditrepayparams.js.map +1 -1
- package/dist/esm/models/components/creditrepayrequest.d.ts +9 -0
- package/dist/esm/models/components/creditrepayrequest.d.ts.map +1 -1
- package/dist/esm/models/components/creditrepayrequest.js +2 -0
- package/dist/esm/models/components/creditrepayrequest.js.map +1 -1
- package/dist/esm/models/components/creditsupplyparams.d.ts +9 -0
- package/dist/esm/models/components/creditsupplyparams.d.ts.map +1 -1
- package/dist/esm/models/components/creditsupplyparams.js +2 -0
- package/dist/esm/models/components/creditsupplyparams.js.map +1 -1
- package/dist/esm/models/components/creditwithdrawparams.d.ts +9 -0
- package/dist/esm/models/components/creditwithdrawparams.d.ts.map +1 -1
- package/dist/esm/models/components/creditwithdrawparams.js +2 -0
- 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 +12 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +12 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/loopedposition.d.ts +88 -0
- package/dist/esm/models/components/loopedposition.d.ts.map +1 -0
- package/dist/esm/models/components/loopedposition.js +48 -0
- package/dist/esm/models/components/loopedposition.js.map +1 -0
- package/dist/esm/models/components/loopedpositioncurrentstate.d.ts +58 -0
- package/dist/esm/models/components/loopedpositioncurrentstate.d.ts.map +1 -0
- package/dist/esm/models/components/loopedpositioncurrentstate.js +40 -0
- package/dist/esm/models/components/loopedpositioncurrentstate.js.map +1 -0
- package/dist/esm/models/components/loopedpositionhistoryentry.d.ts +71 -0
- package/dist/esm/models/components/loopedpositionhistoryentry.d.ts.map +1 -0
- package/dist/esm/models/components/loopedpositionhistoryentry.js +48 -0
- package/dist/esm/models/components/loopedpositionhistoryentry.js.map +1 -0
- package/dist/esm/models/components/loopedpositiontotals.d.ts +40 -0
- package/dist/esm/models/components/loopedpositiontotals.d.ts.map +1 -0
- package/dist/esm/models/components/loopedpositiontotals.js +30 -0
- package/dist/esm/models/components/loopedpositiontotals.js.map +1 -0
- package/dist/esm/models/components/looplegpreview.d.ts +24 -0
- package/dist/esm/models/components/looplegpreview.d.ts.map +1 -0
- package/dist/esm/models/components/looplegpreview.js +22 -0
- package/dist/esm/models/components/looplegpreview.js.map +1 -0
- 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/swapinfo.d.ts +48 -0
- package/dist/esm/models/components/swapinfo.d.ts.map +1 -0
- package/dist/esm/models/components/swapinfo.js +29 -0
- package/dist/esm/models/components/swapinfo.js.map +1 -0
- 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/v2creditbalances.d.ts +1 -0
- package/dist/esm/models/operations/v2creditbalances.d.ts.map +1 -1
- package/dist/esm/models/operations/v2creditbalances.js +1 -0
- package/dist/esm/models/operations/v2creditbalances.js.map +1 -1
- package/dist/esm/models/operations/v2crediteulermarkets.d.ts +1 -0
- package/dist/esm/models/operations/v2crediteulermarkets.d.ts.map +1 -1
- package/dist/esm/models/operations/v2crediteulermarkets.js +1 -0
- package/dist/esm/models/operations/v2crediteulermarkets.js.map +1 -1
- package/dist/esm/models/operations/v2creditloopedpositions.d.ts +28 -0
- package/dist/esm/models/operations/v2creditloopedpositions.d.ts.map +1 -0
- package/dist/esm/models/operations/v2creditloopedpositions.js +22 -0
- package/dist/esm/models/operations/v2creditloopedpositions.js.map +1 -0
- package/dist/esm/models/operations/v2creditmorphomarkets.d.ts +23 -0
- package/dist/esm/models/operations/v2creditmorphomarkets.d.ts.map +1 -0
- package/dist/esm/models/operations/v2creditmorphomarkets.js +21 -0
- package/dist/esm/models/operations/v2creditmorphomarkets.js.map +1 -0
- package/dist/esm/models/operations/v2creditpositions.d.ts +1 -0
- package/dist/esm/models/operations/v2creditpositions.d.ts.map +1 -1
- package/dist/esm/models/operations/v2creditpositions.js +1 -0
- package/dist/esm/models/operations/v2creditpositions.js.map +1 -1
- package/dist/esm/models/operations/v2earnbalances.d.ts +1 -0
- package/dist/esm/models/operations/v2earnbalances.d.ts.map +1 -1
- package/dist/esm/models/operations/v2earnbalances.js +1 -0
- package/dist/esm/models/operations/v2earnbalances.js.map +1 -1
- package/dist/esm/models/operations/v2earnpositions.d.ts +1 -0
- package/dist/esm/models/operations/v2earnpositions.d.ts.map +1 -1
- package/dist/esm/models/operations/v2earnpositions.js +1 -0
- package/dist/esm/models/operations/v2earnpositions.js.map +1 -1
- package/dist/esm/sdk/credit.d.ts +46 -0
- package/dist/esm/sdk/credit.d.ts.map +1 -1
- package/dist/esm/sdk/credit.js +55 -0
- package/dist/esm/sdk/credit.js.map +1 -1
- package/docs/models/components/aavelooprequest.md +4 -4
- package/docs/models/components/{initialcollateralamount.md → aavelooprequestinitialcollateralamount.md} +1 -1
- package/docs/models/components/{loantovalue.md → aavelooprequestloantovalue.md} +1 -1
- package/docs/models/components/{maxslippagepercent.md → aavelooprequestmaxslippagepercent.md} +1 -1
- package/docs/models/components/{multiplier.md → aavelooprequestmultiplier.md} +1 -1
- package/docs/models/components/accountsummary.md +10 -10
- package/docs/models/components/classification.md +17 -0
- package/docs/models/components/collateralposition.md +16 -14
- package/docs/models/components/createaccountrequestchain.md +1 -1
- package/docs/models/components/createcreditaccountrequestchain.md +1 -1
- package/docs/models/components/creditborrowparams.md +10 -9
- package/docs/models/components/creditborrowrequest.md +20 -19
- package/docs/models/components/creditenablecollateralparams.md +6 -6
- package/docs/models/components/creditloopedpositionsresponse.md +30 -0
- package/docs/models/components/creditlooppreview.md +33 -0
- package/docs/models/components/creditlooprequest.md +41 -0
- package/docs/models/components/creditlooprequestinitialcollateralamount.md +19 -0
- package/docs/models/components/creditlooprequestloantovalue.md +19 -0
- package/docs/models/components/creditlooprequestmaxslippagepercent.md +19 -0
- package/docs/models/components/creditlooprequestmultiplier.md +19 -0
- package/docs/models/components/creditloopresponse.md +30 -0
- package/docs/models/components/creditprotocol.md +5 -1
- package/docs/models/components/creditrepayparams.md +9 -8
- package/docs/models/components/creditrepayrequest.md +19 -18
- package/docs/models/components/creditsupplyparams.md +8 -7
- package/docs/models/components/creditwithdrawparams.md +8 -7
- package/docs/models/components/debtposition.md +15 -13
- package/docs/models/components/healthfactorscope.md +17 -0
- package/docs/models/components/loopedposition.md +46 -0
- package/docs/models/components/loopedpositioncurrentstate.md +28 -0
- package/docs/models/components/loopedpositionhistoryentry.md +33 -0
- package/docs/models/components/loopedpositionstatus.md +17 -0
- package/docs/models/components/loopedpositiontotals.md +31 -0
- package/docs/models/components/looplegpreview.md +21 -0
- package/docs/models/components/morpholendingmarket.md +49 -0
- package/docs/models/components/morphomarketsresponse.md +21 -0
- package/docs/models/components/swapinfo.md +36 -0
- package/docs/models/operations/v2creditbalanceschain.md +1 -1
- package/docs/models/operations/v2crediteulermarketschain.md +1 -1
- package/docs/models/operations/v2creditloopedpositionschain.md +15 -0
- package/docs/models/operations/v2creditloopedpositionsrequest.md +19 -0
- package/docs/models/operations/v2creditmorphomarketschain.md +15 -0
- package/docs/models/operations/v2creditmorphomarketsrequest.md +17 -0
- package/docs/models/operations/v2creditpositionschain.md +1 -1
- package/docs/models/operations/v2earnbalanceschain.md +1 -1
- package/docs/models/operations/v2earnpositionschain.md +1 -1
- package/docs/sdks/credit/README.md +270 -0
- package/openapi_prepped_for_speakeasy.json +1331 -157
- package/package.json +1 -1
- package/src/funcs/creditCreditLoop.ts +184 -0
- package/src/funcs/creditCreditLoopedPositions.ts +185 -0
- package/src/funcs/creditCreditMorphoMarkets.ts +182 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/aavelooprequest.ts +43 -30
- package/src/models/components/accountsummary.ts +4 -0
- package/src/models/components/collateralposition.ts +16 -0
- package/src/models/components/createaccountrequest.ts +1 -0
- package/src/models/components/createcreditaccountrequest.ts +1 -0
- package/src/models/components/creditborrowparams.ts +11 -0
- package/src/models/components/creditborrowrequest.ts +11 -0
- package/src/models/components/creditenablecollateralparams.ts +4 -0
- package/src/models/components/creditloopedpositionsresponse.ts +61 -0
- package/src/models/components/creditlooppreview.ts +86 -0
- package/src/models/components/creditlooprequest.ts +235 -0
- package/src/models/components/creditloopresponse.ts +65 -0
- package/src/models/components/creditprotocol.ts +9 -0
- package/src/models/components/creditrepayparams.ts +11 -0
- package/src/models/components/creditrepayrequest.ts +11 -0
- package/src/models/components/creditsupplyparams.ts +11 -0
- package/src/models/components/creditwithdrawparams.ts +11 -0
- package/src/models/components/debtposition.ts +16 -0
- package/src/models/components/index.ts +12 -0
- package/src/models/components/loopedposition.ts +149 -0
- package/src/models/components/loopedpositioncurrentstate.ts +101 -0
- package/src/models/components/loopedpositionhistoryentry.ts +115 -0
- package/src/models/components/loopedpositiontotals.ts +78 -0
- package/src/models/components/looplegpreview.ts +54 -0
- package/src/models/components/morpholendingmarket.ts +133 -0
- package/src/models/components/morphomarketsresponse.ts +46 -0
- package/src/models/components/swapinfo.ts +85 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/v2creditbalances.ts +1 -0
- package/src/models/operations/v2crediteulermarkets.ts +1 -0
- package/src/models/operations/v2creditloopedpositions.ts +56 -0
- package/src/models/operations/v2creditmorphomarkets.ts +50 -0
- package/src/models/operations/v2creditpositions.ts +1 -0
- package/src/models/operations/v2earnbalances.ts +1 -0
- package/src/models/operations/v2earnpositions.ts +1 -0
- package/src/sdk/credit.ts +79 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import {
|
|
12
|
+
CreditProtocol,
|
|
13
|
+
CreditProtocol$inboundSchema,
|
|
14
|
+
} from "./creditprotocol.js";
|
|
15
|
+
import {
|
|
16
|
+
LoopedPositionCurrentState,
|
|
17
|
+
LoopedPositionCurrentState$inboundSchema,
|
|
18
|
+
} from "./loopedpositioncurrentstate.js";
|
|
19
|
+
import {
|
|
20
|
+
LoopedPositionHistoryEntry,
|
|
21
|
+
LoopedPositionHistoryEntry$inboundSchema,
|
|
22
|
+
} from "./loopedpositionhistoryentry.js";
|
|
23
|
+
import {
|
|
24
|
+
LoopedPositionTotals,
|
|
25
|
+
LoopedPositionTotals$inboundSchema,
|
|
26
|
+
} from "./loopedpositiontotals.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Whether the position is currently open or fully closed.
|
|
30
|
+
*/
|
|
31
|
+
export const LoopedPositionStatus = {
|
|
32
|
+
Open: "OPEN",
|
|
33
|
+
Closed: "CLOSED",
|
|
34
|
+
} as const;
|
|
35
|
+
/**
|
|
36
|
+
* Whether the position is currently open or fully closed.
|
|
37
|
+
*/
|
|
38
|
+
export type LoopedPositionStatus = ClosedEnum<typeof LoopedPositionStatus>;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* A single looped (leveraged) position with its full history.
|
|
42
|
+
*/
|
|
43
|
+
export type LoopedPosition = {
|
|
44
|
+
/**
|
|
45
|
+
* Which lending protocol a credit action targets.
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
*
|
|
49
|
+
* ``AAVE`` is the default so existing callers (which never send a ``protocol``
|
|
50
|
+
* field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the
|
|
51
|
+
* Euler V2 path, where the market is identified by EVK vault address(es).
|
|
52
|
+
* ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is
|
|
53
|
+
* currently read-only: positions and market discovery only — transaction
|
|
54
|
+
* builders land with the looping work (COM-7106/7107/7108), so transact
|
|
55
|
+
* endpoints reject it with a 422.
|
|
56
|
+
*/
|
|
57
|
+
protocol: CreditProtocol;
|
|
58
|
+
/**
|
|
59
|
+
* Morpho only: the bytes32 id of the isolated market.
|
|
60
|
+
*/
|
|
61
|
+
marketId?: string | null | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Address of the collateral token.
|
|
64
|
+
*/
|
|
65
|
+
collateralToken: string;
|
|
66
|
+
/**
|
|
67
|
+
* Symbol of the collateral token.
|
|
68
|
+
*/
|
|
69
|
+
collateralSymbol: string;
|
|
70
|
+
/**
|
|
71
|
+
* Address of the debt token.
|
|
72
|
+
*/
|
|
73
|
+
debtToken: string;
|
|
74
|
+
/**
|
|
75
|
+
* Symbol of the debt token.
|
|
76
|
+
*/
|
|
77
|
+
debtSymbol: string;
|
|
78
|
+
/**
|
|
79
|
+
* Whether the position is currently open or fully closed.
|
|
80
|
+
*/
|
|
81
|
+
status: LoopedPositionStatus;
|
|
82
|
+
/**
|
|
83
|
+
* Timestamp of the position's first transaction.
|
|
84
|
+
*/
|
|
85
|
+
openedAt: Date;
|
|
86
|
+
/**
|
|
87
|
+
* Timestamp the position was fully closed; null while open.
|
|
88
|
+
*/
|
|
89
|
+
closedAt?: Date | null | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Live on-chain state; null for CLOSED positions.
|
|
92
|
+
*/
|
|
93
|
+
current?: LoopedPositionCurrentState | null | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Lifetime totals across all of a looped position's transactions.
|
|
96
|
+
*/
|
|
97
|
+
totals: LoopedPositionTotals;
|
|
98
|
+
/**
|
|
99
|
+
* All transactions for this position, chronological.
|
|
100
|
+
*/
|
|
101
|
+
history?: Array<LoopedPositionHistoryEntry> | undefined;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/** @internal */
|
|
105
|
+
export const LoopedPositionStatus$inboundSchema: z.ZodNativeEnum<
|
|
106
|
+
typeof LoopedPositionStatus
|
|
107
|
+
> = z.nativeEnum(LoopedPositionStatus);
|
|
108
|
+
|
|
109
|
+
/** @internal */
|
|
110
|
+
export const LoopedPosition$inboundSchema: z.ZodType<
|
|
111
|
+
LoopedPosition,
|
|
112
|
+
z.ZodTypeDef,
|
|
113
|
+
unknown
|
|
114
|
+
> = z.object({
|
|
115
|
+
protocol: CreditProtocol$inboundSchema,
|
|
116
|
+
market_id: z.nullable(z.string()).optional(),
|
|
117
|
+
collateral_token: z.string(),
|
|
118
|
+
collateral_symbol: z.string(),
|
|
119
|
+
debt_token: z.string(),
|
|
120
|
+
debt_symbol: z.string(),
|
|
121
|
+
status: LoopedPositionStatus$inboundSchema,
|
|
122
|
+
opened_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
123
|
+
closed_at: z.nullable(
|
|
124
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
125
|
+
).optional(),
|
|
126
|
+
current: z.nullable(LoopedPositionCurrentState$inboundSchema).optional(),
|
|
127
|
+
totals: LoopedPositionTotals$inboundSchema,
|
|
128
|
+
history: z.array(LoopedPositionHistoryEntry$inboundSchema).optional(),
|
|
129
|
+
}).transform((v) => {
|
|
130
|
+
return remap$(v, {
|
|
131
|
+
"market_id": "marketId",
|
|
132
|
+
"collateral_token": "collateralToken",
|
|
133
|
+
"collateral_symbol": "collateralSymbol",
|
|
134
|
+
"debt_token": "debtToken",
|
|
135
|
+
"debt_symbol": "debtSymbol",
|
|
136
|
+
"opened_at": "openedAt",
|
|
137
|
+
"closed_at": "closedAt",
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
export function loopedPositionFromJSON(
|
|
142
|
+
jsonString: string,
|
|
143
|
+
): SafeParseResult<LoopedPosition, SDKValidationError> {
|
|
144
|
+
return safeParse(
|
|
145
|
+
jsonString,
|
|
146
|
+
(x) => LoopedPosition$inboundSchema.parse(JSON.parse(x)),
|
|
147
|
+
`Failed to parse 'LoopedPosition' from JSON`,
|
|
148
|
+
);
|
|
149
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 'market' for Morpho (isolated per-market health). 'account' for Aave: collateral is pooled, so all collateral backs all debt and this health factor is shared by every Aave position on the account — see aave_account_summary for the account-level figures.
|
|
14
|
+
*/
|
|
15
|
+
export const HealthFactorScope = {
|
|
16
|
+
Market: "market",
|
|
17
|
+
Account: "account",
|
|
18
|
+
} as const;
|
|
19
|
+
/**
|
|
20
|
+
* 'market' for Morpho (isolated per-market health). 'account' for Aave: collateral is pooled, so all collateral backs all debt and this health factor is shared by every Aave position on the account — see aave_account_summary for the account-level figures.
|
|
21
|
+
*/
|
|
22
|
+
export type HealthFactorScope = ClosedEnum<typeof HealthFactorScope>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Live on-chain state of an OPEN looped position.
|
|
26
|
+
*/
|
|
27
|
+
export type LoopedPositionCurrentState = {
|
|
28
|
+
/**
|
|
29
|
+
* Current on-chain collateral amount for this position.
|
|
30
|
+
*/
|
|
31
|
+
collateralAmount: string | null;
|
|
32
|
+
/**
|
|
33
|
+
* Current on-chain debt amount for this position.
|
|
34
|
+
*/
|
|
35
|
+
debtAmount: string | null;
|
|
36
|
+
/**
|
|
37
|
+
* Collateral value in USD (null if unpriced).
|
|
38
|
+
*/
|
|
39
|
+
collateralUsd?: string | null | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Debt value in USD (null if unpriced).
|
|
42
|
+
*/
|
|
43
|
+
debtUsd?: string | null | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Net position value in USD (collateral - debt); null if unpriced.
|
|
46
|
+
*/
|
|
47
|
+
netUsdValue?: string | null | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Leverage multiplier: collateral_usd / (collateral_usd - debt_usd). Null when unpriced or net value is non-positive.
|
|
50
|
+
*/
|
|
51
|
+
leverage?: string | null | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Health factor. Above 1 is safe; below 1 risks liquidation. See health_factor_scope for what it covers.
|
|
54
|
+
*/
|
|
55
|
+
healthFactor?: string | null | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* 'market' for Morpho (isolated per-market health). 'account' for Aave: collateral is pooled, so all collateral backs all debt and this health factor is shared by every Aave position on the account — see aave_account_summary for the account-level figures.
|
|
58
|
+
*/
|
|
59
|
+
healthFactorScope: HealthFactorScope;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/** @internal */
|
|
63
|
+
export const HealthFactorScope$inboundSchema: z.ZodNativeEnum<
|
|
64
|
+
typeof HealthFactorScope
|
|
65
|
+
> = z.nativeEnum(HealthFactorScope);
|
|
66
|
+
|
|
67
|
+
/** @internal */
|
|
68
|
+
export const LoopedPositionCurrentState$inboundSchema: z.ZodType<
|
|
69
|
+
LoopedPositionCurrentState,
|
|
70
|
+
z.ZodTypeDef,
|
|
71
|
+
unknown
|
|
72
|
+
> = z.object({
|
|
73
|
+
collateral_amount: z.nullable(z.string()),
|
|
74
|
+
debt_amount: z.nullable(z.string()),
|
|
75
|
+
collateral_usd: z.nullable(z.string()).optional(),
|
|
76
|
+
debt_usd: z.nullable(z.string()).optional(),
|
|
77
|
+
net_usd_value: z.nullable(z.string()).optional(),
|
|
78
|
+
leverage: z.nullable(z.string()).optional(),
|
|
79
|
+
health_factor: z.nullable(z.string()).optional(),
|
|
80
|
+
health_factor_scope: HealthFactorScope$inboundSchema,
|
|
81
|
+
}).transform((v) => {
|
|
82
|
+
return remap$(v, {
|
|
83
|
+
"collateral_amount": "collateralAmount",
|
|
84
|
+
"debt_amount": "debtAmount",
|
|
85
|
+
"collateral_usd": "collateralUsd",
|
|
86
|
+
"debt_usd": "debtUsd",
|
|
87
|
+
"net_usd_value": "netUsdValue",
|
|
88
|
+
"health_factor": "healthFactor",
|
|
89
|
+
"health_factor_scope": "healthFactorScope",
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
export function loopedPositionCurrentStateFromJSON(
|
|
94
|
+
jsonString: string,
|
|
95
|
+
): SafeParseResult<LoopedPositionCurrentState, SDKValidationError> {
|
|
96
|
+
return safeParse(
|
|
97
|
+
jsonString,
|
|
98
|
+
(x) => LoopedPositionCurrentState$inboundSchema.parse(JSON.parse(x)),
|
|
99
|
+
`Failed to parse 'LoopedPositionCurrentState' from JSON`,
|
|
100
|
+
);
|
|
101
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import { CreditEvent, CreditEvent$inboundSchema } from "./creditevent.js";
|
|
12
|
+
import { SwapInfo, SwapInfo$inboundSchema } from "./swapinfo.js";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* What this transaction did to the position: loop_open / loop_increase (lever up with a swap), unwind (delever), single-sided supply/withdraw/borrow/repay, liquidation, or mixed.
|
|
16
|
+
*/
|
|
17
|
+
export const Classification = {
|
|
18
|
+
LoopOpen: "loop_open",
|
|
19
|
+
LoopIncrease: "loop_increase",
|
|
20
|
+
Unwind: "unwind",
|
|
21
|
+
Supply: "supply",
|
|
22
|
+
Withdraw: "withdraw",
|
|
23
|
+
Borrow: "borrow",
|
|
24
|
+
Repay: "repay",
|
|
25
|
+
Liquidation: "liquidation",
|
|
26
|
+
Mixed: "mixed",
|
|
27
|
+
} as const;
|
|
28
|
+
/**
|
|
29
|
+
* What this transaction did to the position: loop_open / loop_increase (lever up with a swap), unwind (delever), single-sided supply/withdraw/borrow/repay, liquidation, or mixed.
|
|
30
|
+
*/
|
|
31
|
+
export type Classification = ClosedEnum<typeof Classification>;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* One transaction in a looped position's lifetime.
|
|
35
|
+
*/
|
|
36
|
+
export type LoopedPositionHistoryEntry = {
|
|
37
|
+
/**
|
|
38
|
+
* Transaction hash.
|
|
39
|
+
*/
|
|
40
|
+
transactionHash: string;
|
|
41
|
+
/**
|
|
42
|
+
* Block number of the transaction.
|
|
43
|
+
*/
|
|
44
|
+
blockNumber: number;
|
|
45
|
+
/**
|
|
46
|
+
* Timestamp of the transaction.
|
|
47
|
+
*/
|
|
48
|
+
blockTimestamp: Date;
|
|
49
|
+
/**
|
|
50
|
+
* What this transaction did to the position: loop_open / loop_increase (lever up with a swap), unwind (delever), single-sided supply/withdraw/borrow/repay, liquidation, or mixed.
|
|
51
|
+
*/
|
|
52
|
+
classification: Classification;
|
|
53
|
+
/**
|
|
54
|
+
* Loop transactions only: number of borrow legs in this transaction (one per loop iteration). Null for non-loop transactions.
|
|
55
|
+
*/
|
|
56
|
+
iterations?: number | null | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Signed change in collateral in this transaction (positive = added).
|
|
59
|
+
*/
|
|
60
|
+
collateralDelta: string;
|
|
61
|
+
/**
|
|
62
|
+
* Signed change in debt in this transaction (positive = borrowed).
|
|
63
|
+
*/
|
|
64
|
+
debtDelta: string;
|
|
65
|
+
/**
|
|
66
|
+
* The swap leg detected in this transaction, if any.
|
|
67
|
+
*/
|
|
68
|
+
swap?: SwapInfo | null | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* The raw lending events that make up this transaction (Morpho supply_collateral maps to 'supply', withdraw_collateral to 'withdraw').
|
|
71
|
+
*/
|
|
72
|
+
events?: Array<CreditEvent> | undefined;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/** @internal */
|
|
76
|
+
export const Classification$inboundSchema: z.ZodNativeEnum<
|
|
77
|
+
typeof Classification
|
|
78
|
+
> = z.nativeEnum(Classification);
|
|
79
|
+
|
|
80
|
+
/** @internal */
|
|
81
|
+
export const LoopedPositionHistoryEntry$inboundSchema: z.ZodType<
|
|
82
|
+
LoopedPositionHistoryEntry,
|
|
83
|
+
z.ZodTypeDef,
|
|
84
|
+
unknown
|
|
85
|
+
> = z.object({
|
|
86
|
+
transaction_hash: z.string(),
|
|
87
|
+
block_number: z.number().int(),
|
|
88
|
+
block_timestamp: z.string().datetime({ offset: true }).transform(v =>
|
|
89
|
+
new Date(v)
|
|
90
|
+
),
|
|
91
|
+
classification: Classification$inboundSchema,
|
|
92
|
+
iterations: z.nullable(z.number().int()).optional(),
|
|
93
|
+
collateral_delta: z.string(),
|
|
94
|
+
debt_delta: z.string(),
|
|
95
|
+
swap: z.nullable(SwapInfo$inboundSchema).optional(),
|
|
96
|
+
events: z.array(CreditEvent$inboundSchema).optional(),
|
|
97
|
+
}).transform((v) => {
|
|
98
|
+
return remap$(v, {
|
|
99
|
+
"transaction_hash": "transactionHash",
|
|
100
|
+
"block_number": "blockNumber",
|
|
101
|
+
"block_timestamp": "blockTimestamp",
|
|
102
|
+
"collateral_delta": "collateralDelta",
|
|
103
|
+
"debt_delta": "debtDelta",
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
export function loopedPositionHistoryEntryFromJSON(
|
|
108
|
+
jsonString: string,
|
|
109
|
+
): SafeParseResult<LoopedPositionHistoryEntry, SDKValidationError> {
|
|
110
|
+
return safeParse(
|
|
111
|
+
jsonString,
|
|
112
|
+
(x) => LoopedPositionHistoryEntry$inboundSchema.parse(JSON.parse(x)),
|
|
113
|
+
`Failed to parse 'LoopedPositionHistoryEntry' from JSON`,
|
|
114
|
+
);
|
|
115
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Lifetime totals across all of a looped position's transactions.
|
|
13
|
+
*/
|
|
14
|
+
export type LoopedPositionTotals = {
|
|
15
|
+
/**
|
|
16
|
+
* Total collateral added over the position's lifetime.
|
|
17
|
+
*/
|
|
18
|
+
totalCollateralAdded: string;
|
|
19
|
+
/**
|
|
20
|
+
* Total collateral removed over the position's lifetime.
|
|
21
|
+
*/
|
|
22
|
+
totalCollateralRemoved: string;
|
|
23
|
+
/**
|
|
24
|
+
* Total debt borrowed over the position's lifetime.
|
|
25
|
+
*/
|
|
26
|
+
totalDebtAdded: string;
|
|
27
|
+
/**
|
|
28
|
+
* Total debt repaid over the position's lifetime.
|
|
29
|
+
*/
|
|
30
|
+
totalDebtRemoved: string;
|
|
31
|
+
/**
|
|
32
|
+
* Number of loop_open + loop_increase transactions.
|
|
33
|
+
*/
|
|
34
|
+
loopTxCount: number;
|
|
35
|
+
/**
|
|
36
|
+
* Number of unwind transactions.
|
|
37
|
+
*/
|
|
38
|
+
unwindTxCount: number;
|
|
39
|
+
/**
|
|
40
|
+
* Number of liquidation events.
|
|
41
|
+
*/
|
|
42
|
+
liquidationCount: number;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** @internal */
|
|
46
|
+
export const LoopedPositionTotals$inboundSchema: z.ZodType<
|
|
47
|
+
LoopedPositionTotals,
|
|
48
|
+
z.ZodTypeDef,
|
|
49
|
+
unknown
|
|
50
|
+
> = z.object({
|
|
51
|
+
total_collateral_added: z.string(),
|
|
52
|
+
total_collateral_removed: z.string(),
|
|
53
|
+
total_debt_added: z.string(),
|
|
54
|
+
total_debt_removed: z.string(),
|
|
55
|
+
loop_tx_count: z.number().int(),
|
|
56
|
+
unwind_tx_count: z.number().int(),
|
|
57
|
+
liquidation_count: z.number().int(),
|
|
58
|
+
}).transform((v) => {
|
|
59
|
+
return remap$(v, {
|
|
60
|
+
"total_collateral_added": "totalCollateralAdded",
|
|
61
|
+
"total_collateral_removed": "totalCollateralRemoved",
|
|
62
|
+
"total_debt_added": "totalDebtAdded",
|
|
63
|
+
"total_debt_removed": "totalDebtRemoved",
|
|
64
|
+
"loop_tx_count": "loopTxCount",
|
|
65
|
+
"unwind_tx_count": "unwindTxCount",
|
|
66
|
+
"liquidation_count": "liquidationCount",
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export function loopedPositionTotalsFromJSON(
|
|
71
|
+
jsonString: string,
|
|
72
|
+
): SafeParseResult<LoopedPositionTotals, SDKValidationError> {
|
|
73
|
+
return safeParse(
|
|
74
|
+
jsonString,
|
|
75
|
+
(x) => LoopedPositionTotals$inboundSchema.parse(JSON.parse(x)),
|
|
76
|
+
`Failed to parse 'LoopedPositionTotals' from JSON`,
|
|
77
|
+
);
|
|
78
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* One planned loop iteration.
|
|
13
|
+
*/
|
|
14
|
+
export type LoopLegPreview = {
|
|
15
|
+
/**
|
|
16
|
+
* Collateral supplied this iteration (token units).
|
|
17
|
+
*/
|
|
18
|
+
supplyAmount: string | null;
|
|
19
|
+
/**
|
|
20
|
+
* Loan borrowed this iteration; null on the final supply-only iteration.
|
|
21
|
+
*/
|
|
22
|
+
borrowAmount?: string | null | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Guaranteed swap output (collateral units) — the next iteration's supply. Enforced on-chain by the swap's minimum-return.
|
|
25
|
+
*/
|
|
26
|
+
minSwapOut?: string | null | undefined;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const LoopLegPreview$inboundSchema: z.ZodType<
|
|
31
|
+
LoopLegPreview,
|
|
32
|
+
z.ZodTypeDef,
|
|
33
|
+
unknown
|
|
34
|
+
> = z.object({
|
|
35
|
+
supply_amount: z.nullable(z.string()),
|
|
36
|
+
borrow_amount: z.nullable(z.string()).optional(),
|
|
37
|
+
min_swap_out: z.nullable(z.string()).optional(),
|
|
38
|
+
}).transform((v) => {
|
|
39
|
+
return remap$(v, {
|
|
40
|
+
"supply_amount": "supplyAmount",
|
|
41
|
+
"borrow_amount": "borrowAmount",
|
|
42
|
+
"min_swap_out": "minSwapOut",
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export function loopLegPreviewFromJSON(
|
|
47
|
+
jsonString: string,
|
|
48
|
+
): SafeParseResult<LoopLegPreview, SDKValidationError> {
|
|
49
|
+
return safeParse(
|
|
50
|
+
jsonString,
|
|
51
|
+
(x) => LoopLegPreview$inboundSchema.parse(JSON.parse(x)),
|
|
52
|
+
`Failed to parse 'LoopLegPreview' from JSON`,
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A Morpho Blue lending market: one isolated (collateral, loan) pair.
|
|
13
|
+
*/
|
|
14
|
+
export type MorphoLendingMarket = {
|
|
15
|
+
/**
|
|
16
|
+
* Morpho Blue market id — the bytes32 keccak of the market's (loanToken, collateralToken, oracle, irm, lltv) tuple. Pass this to the Morpho credit actions to identify the market.
|
|
17
|
+
*/
|
|
18
|
+
marketId: string;
|
|
19
|
+
/**
|
|
20
|
+
* Token that is supplied and borrowed in this market.
|
|
21
|
+
*/
|
|
22
|
+
loanToken: string;
|
|
23
|
+
/**
|
|
24
|
+
* Symbol of the loan token (e.g. USDC).
|
|
25
|
+
*/
|
|
26
|
+
loanTokenSymbol: string;
|
|
27
|
+
/**
|
|
28
|
+
* Decimals of the loan token.
|
|
29
|
+
*/
|
|
30
|
+
loanTokenDecimals: number;
|
|
31
|
+
/**
|
|
32
|
+
* Token accepted as collateral in this market.
|
|
33
|
+
*/
|
|
34
|
+
collateralToken: string;
|
|
35
|
+
/**
|
|
36
|
+
* Symbol of the collateral token (e.g. wstETH).
|
|
37
|
+
*/
|
|
38
|
+
collateralTokenSymbol: string;
|
|
39
|
+
/**
|
|
40
|
+
* Decimals of the collateral token.
|
|
41
|
+
*/
|
|
42
|
+
collateralTokenDecimals: number;
|
|
43
|
+
/**
|
|
44
|
+
* Oracle pricing the collateral in loan-token terms for this market.
|
|
45
|
+
*/
|
|
46
|
+
oracle: string;
|
|
47
|
+
/**
|
|
48
|
+
* Interest rate model contract of this market.
|
|
49
|
+
*/
|
|
50
|
+
irm: string;
|
|
51
|
+
/**
|
|
52
|
+
* Liquidation loan-to-value in percentage (e.g. 86 means a position is liquidatable once debt exceeds 86% of collateral value).
|
|
53
|
+
*/
|
|
54
|
+
lltv: string;
|
|
55
|
+
/**
|
|
56
|
+
* Current supply APY for lending the loan token, in percentage (e.g. 3.5 means 3.5%). Null if the rate is unavailable.
|
|
57
|
+
*/
|
|
58
|
+
supplyApy?: string | null | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Current borrow APY for the loan token, in percentage (e.g. 5.25 means 5.25%). Null if the rate is unavailable.
|
|
61
|
+
*/
|
|
62
|
+
borrowApy?: string | null | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Borrowed share of supplied assets, in percentage 0-100.
|
|
65
|
+
*/
|
|
66
|
+
utilization: string;
|
|
67
|
+
/**
|
|
68
|
+
* Total loan tokens supplied to the market, in token units.
|
|
69
|
+
*/
|
|
70
|
+
totalSupplyAssets: string;
|
|
71
|
+
/**
|
|
72
|
+
* Total loan tokens borrowed from the market, in token units.
|
|
73
|
+
*/
|
|
74
|
+
totalBorrowAssets: string;
|
|
75
|
+
/**
|
|
76
|
+
* Loan tokens available to borrow or withdraw (supplied - borrowed), in token units.
|
|
77
|
+
*/
|
|
78
|
+
availableLiquidity: string;
|
|
79
|
+
/**
|
|
80
|
+
* Protocol fee taken from interest, in percentage of interest (e.g. 0 means no fee).
|
|
81
|
+
*/
|
|
82
|
+
fee: string;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/** @internal */
|
|
86
|
+
export const MorphoLendingMarket$inboundSchema: z.ZodType<
|
|
87
|
+
MorphoLendingMarket,
|
|
88
|
+
z.ZodTypeDef,
|
|
89
|
+
unknown
|
|
90
|
+
> = z.object({
|
|
91
|
+
market_id: z.string(),
|
|
92
|
+
loan_token: z.string(),
|
|
93
|
+
loan_token_symbol: z.string(),
|
|
94
|
+
loan_token_decimals: z.number().int(),
|
|
95
|
+
collateral_token: z.string(),
|
|
96
|
+
collateral_token_symbol: z.string(),
|
|
97
|
+
collateral_token_decimals: z.number().int(),
|
|
98
|
+
oracle: z.string(),
|
|
99
|
+
irm: z.string(),
|
|
100
|
+
lltv: z.string(),
|
|
101
|
+
supply_apy: z.nullable(z.string()).optional(),
|
|
102
|
+
borrow_apy: z.nullable(z.string()).optional(),
|
|
103
|
+
utilization: z.string(),
|
|
104
|
+
total_supply_assets: z.string(),
|
|
105
|
+
total_borrow_assets: z.string(),
|
|
106
|
+
available_liquidity: z.string(),
|
|
107
|
+
fee: z.string(),
|
|
108
|
+
}).transform((v) => {
|
|
109
|
+
return remap$(v, {
|
|
110
|
+
"market_id": "marketId",
|
|
111
|
+
"loan_token": "loanToken",
|
|
112
|
+
"loan_token_symbol": "loanTokenSymbol",
|
|
113
|
+
"loan_token_decimals": "loanTokenDecimals",
|
|
114
|
+
"collateral_token": "collateralToken",
|
|
115
|
+
"collateral_token_symbol": "collateralTokenSymbol",
|
|
116
|
+
"collateral_token_decimals": "collateralTokenDecimals",
|
|
117
|
+
"supply_apy": "supplyApy",
|
|
118
|
+
"borrow_apy": "borrowApy",
|
|
119
|
+
"total_supply_assets": "totalSupplyAssets",
|
|
120
|
+
"total_borrow_assets": "totalBorrowAssets",
|
|
121
|
+
"available_liquidity": "availableLiquidity",
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
export function morphoLendingMarketFromJSON(
|
|
126
|
+
jsonString: string,
|
|
127
|
+
): SafeParseResult<MorphoLendingMarket, SDKValidationError> {
|
|
128
|
+
return safeParse(
|
|
129
|
+
jsonString,
|
|
130
|
+
(x) => MorphoLendingMarket$inboundSchema.parse(JSON.parse(x)),
|
|
131
|
+
`Failed to parse 'MorphoLendingMarket' from JSON`,
|
|
132
|
+
);
|
|
133
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
MorphoLendingMarket,
|
|
11
|
+
MorphoLendingMarket$inboundSchema,
|
|
12
|
+
} from "./morpholendingmarket.js";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Curated Morpho Blue lending markets, read on-chain per request.
|
|
16
|
+
*/
|
|
17
|
+
export type MorphoMarketsResponse = {
|
|
18
|
+
/**
|
|
19
|
+
* Morpho Blue singleton contract the markets were read from.
|
|
20
|
+
*/
|
|
21
|
+
morpho: string;
|
|
22
|
+
/**
|
|
23
|
+
* Curated lending markets with live LLTV, APYs, utilization, and liquidity.
|
|
24
|
+
*/
|
|
25
|
+
markets?: Array<MorphoLendingMarket> | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const MorphoMarketsResponse$inboundSchema: z.ZodType<
|
|
30
|
+
MorphoMarketsResponse,
|
|
31
|
+
z.ZodTypeDef,
|
|
32
|
+
unknown
|
|
33
|
+
> = z.object({
|
|
34
|
+
morpho: z.string(),
|
|
35
|
+
markets: z.array(MorphoLendingMarket$inboundSchema).optional(),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export function morphoMarketsResponseFromJSON(
|
|
39
|
+
jsonString: string,
|
|
40
|
+
): SafeParseResult<MorphoMarketsResponse, SDKValidationError> {
|
|
41
|
+
return safeParse(
|
|
42
|
+
jsonString,
|
|
43
|
+
(x) => MorphoMarketsResponse$inboundSchema.parse(JSON.parse(x)),
|
|
44
|
+
`Failed to parse 'MorphoMarketsResponse' from JSON`,
|
|
45
|
+
);
|
|
46
|
+
}
|