@defisaver/positions-sdk 0.0.149 → 0.0.151
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/.mocharc.json +4 -4
- package/.nvmrc +1 -1
- package/.vscode/launch.json +17 -0
- package/.vscode/settings.json +22 -0
- package/README.md +69 -69
- package/cjs/{markets → src/markets}/compound/marketsAssets.js +3 -3
- package/cjs/tests/aaveV2.d.ts +1 -0
- package/cjs/tests/aaveV2.js +109 -0
- package/cjs/tests/aaveV3.d.ts +1 -0
- package/cjs/tests/aaveV3.js +241 -0
- package/cjs/tests/chickenBonds.d.ts +1 -0
- package/cjs/tests/chickenBonds.js +90 -0
- package/cjs/tests/compoundV2.d.ts +1 -0
- package/cjs/tests/compoundV2.js +109 -0
- package/cjs/tests/compoundV3.d.ts +1 -0
- package/cjs/tests/compoundV3.js +247 -0
- package/cjs/tests/curveUsd.d.ts +1 -0
- package/cjs/tests/curveUsd.js +239 -0
- package/cjs/tests/index.js +20 -0
- package/cjs/tests/liquity.d.ts +1 -0
- package/cjs/tests/liquity.js +78 -0
- package/cjs/tests/llamaLend.d.ts +1 -0
- package/cjs/tests/llamaLend.js +119 -0
- package/cjs/tests/maker.d.ts +1 -0
- package/cjs/tests/maker.js +108 -0
- package/cjs/tests/morphoAaveV2.d.ts +1 -0
- package/cjs/tests/morphoAaveV2.js +109 -0
- package/cjs/tests/morphoAaveV3.d.ts +1 -0
- package/cjs/tests/morphoAaveV3.js +109 -0
- package/cjs/tests/morphoBlue.d.ts +1 -0
- package/cjs/tests/morphoBlue.js +470 -0
- package/cjs/tests/spark.d.ts +1 -0
- package/cjs/tests/spark.js +109 -0
- package/cjs/tests/utils/getWeb3Instance.d.ts +2 -0
- package/cjs/tests/utils/getWeb3Instance.js +15 -0
- package/esm/{markets → src/markets}/compound/marketsAssets.js +3 -3
- package/esm/src/types/maker.js +1 -0
- package/esm/tests/aaveV2.d.ts +1 -0
- package/esm/tests/aaveV2.js +84 -0
- package/esm/tests/aaveV3.d.ts +1 -0
- package/esm/tests/aaveV3.js +216 -0
- package/esm/tests/chickenBonds.d.ts +1 -0
- package/esm/tests/chickenBonds.js +65 -0
- package/esm/tests/compoundV2.d.ts +1 -0
- package/esm/tests/compoundV2.js +84 -0
- package/esm/tests/compoundV3.d.ts +1 -0
- package/esm/tests/compoundV3.js +222 -0
- package/esm/tests/curveUsd.d.ts +1 -0
- package/esm/tests/curveUsd.js +214 -0
- package/esm/tests/index.d.ts +2 -0
- package/esm/tests/index.js +19 -0
- package/esm/tests/liquity.d.ts +1 -0
- package/esm/tests/liquity.js +53 -0
- package/esm/tests/llamaLend.d.ts +1 -0
- package/esm/tests/llamaLend.js +94 -0
- package/esm/tests/maker.d.ts +1 -0
- package/esm/tests/maker.js +83 -0
- package/esm/tests/morphoAaveV2.d.ts +1 -0
- package/esm/tests/morphoAaveV2.js +84 -0
- package/esm/tests/morphoAaveV3.d.ts +1 -0
- package/esm/tests/morphoAaveV3.js +84 -0
- package/esm/tests/morphoBlue.d.ts +1 -0
- package/esm/tests/morphoBlue.js +445 -0
- package/esm/tests/spark.d.ts +1 -0
- package/esm/tests/spark.js +84 -0
- package/esm/tests/utils/getWeb3Instance.d.ts +2 -0
- package/esm/tests/utils/getWeb3Instance.js +8 -0
- package/package.json +47 -44
- package/src/aaveV2/index.ts +227 -227
- package/src/aaveV3/index.ts +590 -590
- package/src/assets/index.ts +60 -60
- package/src/chickenBonds/index.ts +123 -123
- package/src/compoundV2/index.ts +219 -219
- package/src/compoundV3/index.ts +281 -281
- package/src/config/contracts.js +1034 -1034
- package/src/constants/index.ts +6 -6
- package/src/contracts.ts +128 -128
- package/src/curveUsd/index.ts +229 -229
- package/src/exchange/index.ts +17 -17
- package/src/helpers/aaveHelpers/index.ts +194 -194
- package/src/helpers/chickenBondsHelpers/index.ts +23 -23
- package/src/helpers/compoundHelpers/index.ts +246 -246
- package/src/helpers/curveUsdHelpers/index.ts +40 -40
- package/src/helpers/index.ts +7 -7
- package/src/helpers/llamaLendHelpers/index.ts +53 -53
- package/src/helpers/makerHelpers/index.ts +94 -94
- package/src/helpers/morphoBlueHelpers/index.ts +115 -115
- package/src/helpers/sparkHelpers/index.ts +150 -150
- package/src/index.ts +46 -46
- package/src/liquity/index.ts +116 -116
- package/src/llamaLend/index.ts +275 -275
- package/src/maker/index.ts +117 -117
- package/src/markets/aave/index.ts +152 -152
- package/src/markets/aave/marketAssets.ts +46 -46
- package/src/markets/compound/index.ts +173 -173
- package/src/markets/compound/marketsAssets.ts +64 -64
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/index.ts +21 -21
- package/src/markets/llamaLend/contractAddresses.ts +141 -141
- package/src/markets/llamaLend/index.ts +235 -235
- package/src/markets/morphoBlue/index.ts +691 -691
- package/src/markets/spark/index.ts +29 -29
- package/src/markets/spark/marketAssets.ts +10 -10
- package/src/moneymarket/moneymarketCommonService.ts +80 -80
- package/src/morphoAaveV2/index.ts +256 -256
- package/src/morphoAaveV3/index.ts +630 -630
- package/src/morphoBlue/index.ts +171 -171
- package/src/multicall/index.ts +22 -22
- package/src/services/dsrService.ts +15 -15
- package/src/services/priceService.ts +21 -21
- package/src/services/utils.ts +54 -54
- package/src/setup.ts +8 -8
- package/src/spark/index.ts +424 -424
- package/src/staking/staking.ts +189 -189
- package/src/types/aave.ts +262 -262
- package/src/types/chickenBonds.ts +45 -45
- package/src/types/common.ts +84 -84
- package/src/types/compound.ts +129 -129
- package/src/types/curveUsd.ts +118 -118
- package/src/types/index.ts +8 -8
- package/src/types/liquity.ts +30 -30
- package/src/types/llamaLend.ts +155 -155
- package/src/types/maker.ts +50 -50
- package/src/types/morphoBlue.ts +144 -144
- package/src/types/spark.ts +127 -127
- /package/cjs/{aaveV2 → src/aaveV2}/index.d.ts +0 -0
- /package/cjs/{aaveV2 → src/aaveV2}/index.js +0 -0
- /package/cjs/{aaveV3 → src/aaveV3}/index.d.ts +0 -0
- /package/cjs/{aaveV3 → src/aaveV3}/index.js +0 -0
- /package/cjs/{assets → src/assets}/index.d.ts +0 -0
- /package/cjs/{assets → src/assets}/index.js +0 -0
- /package/cjs/{chickenBonds → src/chickenBonds}/index.d.ts +0 -0
- /package/cjs/{chickenBonds → src/chickenBonds}/index.js +0 -0
- /package/cjs/{compoundV2 → src/compoundV2}/index.d.ts +0 -0
- /package/cjs/{compoundV2 → src/compoundV2}/index.js +0 -0
- /package/cjs/{compoundV3 → src/compoundV3}/index.d.ts +0 -0
- /package/cjs/{compoundV3 → src/compoundV3}/index.js +0 -0
- /package/cjs/{config → src/config}/contracts.d.ts +0 -0
- /package/cjs/{config → src/config}/contracts.js +0 -0
- /package/cjs/{constants → src/constants}/index.d.ts +0 -0
- /package/cjs/{constants → src/constants}/index.js +0 -0
- /package/cjs/{contracts.d.ts → src/contracts.d.ts} +0 -0
- /package/cjs/{contracts.js → src/contracts.js} +0 -0
- /package/cjs/{curveUsd → src/curveUsd}/index.d.ts +0 -0
- /package/cjs/{curveUsd → src/curveUsd}/index.js +0 -0
- /package/cjs/{exchange → src/exchange}/index.d.ts +0 -0
- /package/cjs/{exchange → src/exchange}/index.js +0 -0
- /package/cjs/{helpers → src/helpers}/aaveHelpers/index.d.ts +0 -0
- /package/cjs/{helpers → src/helpers}/aaveHelpers/index.js +0 -0
- /package/cjs/{helpers → src/helpers}/chickenBondsHelpers/index.d.ts +0 -0
- /package/cjs/{helpers → src/helpers}/chickenBondsHelpers/index.js +0 -0
- /package/cjs/{helpers → src/helpers}/compoundHelpers/index.d.ts +0 -0
- /package/cjs/{helpers → src/helpers}/compoundHelpers/index.js +0 -0
- /package/cjs/{helpers → src/helpers}/curveUsdHelpers/index.d.ts +0 -0
- /package/cjs/{helpers → src/helpers}/curveUsdHelpers/index.js +0 -0
- /package/cjs/{helpers → src/helpers}/index.d.ts +0 -0
- /package/cjs/{helpers → src/helpers}/index.js +0 -0
- /package/cjs/{helpers → src/helpers}/llamaLendHelpers/index.d.ts +0 -0
- /package/cjs/{helpers → src/helpers}/llamaLendHelpers/index.js +0 -0
- /package/cjs/{helpers → src/helpers}/makerHelpers/index.d.ts +0 -0
- /package/cjs/{helpers → src/helpers}/makerHelpers/index.js +0 -0
- /package/cjs/{helpers → src/helpers}/morphoBlueHelpers/index.d.ts +0 -0
- /package/cjs/{helpers → src/helpers}/morphoBlueHelpers/index.js +0 -0
- /package/cjs/{helpers → src/helpers}/sparkHelpers/index.d.ts +0 -0
- /package/cjs/{helpers → src/helpers}/sparkHelpers/index.js +0 -0
- /package/cjs/{index.d.ts → src/index.d.ts} +0 -0
- /package/cjs/{index.js → src/index.js} +0 -0
- /package/cjs/{liquity → src/liquity}/index.d.ts +0 -0
- /package/cjs/{liquity → src/liquity}/index.js +0 -0
- /package/cjs/{llamaLend → src/llamaLend}/index.d.ts +0 -0
- /package/cjs/{llamaLend → src/llamaLend}/index.js +0 -0
- /package/cjs/{maker → src/maker}/index.d.ts +0 -0
- /package/cjs/{maker → src/maker}/index.js +0 -0
- /package/cjs/{markets → src/markets}/aave/index.d.ts +0 -0
- /package/cjs/{markets → src/markets}/aave/index.js +0 -0
- /package/cjs/{markets → src/markets}/aave/marketAssets.d.ts +0 -0
- /package/cjs/{markets → src/markets}/aave/marketAssets.js +0 -0
- /package/cjs/{markets → src/markets}/compound/index.d.ts +0 -0
- /package/cjs/{markets → src/markets}/compound/index.js +0 -0
- /package/cjs/{markets → src/markets}/compound/marketsAssets.d.ts +0 -0
- /package/cjs/{markets → src/markets}/curveUsd/index.d.ts +0 -0
- /package/cjs/{markets → src/markets}/curveUsd/index.js +0 -0
- /package/cjs/{markets → src/markets}/index.d.ts +0 -0
- /package/cjs/{markets → src/markets}/index.js +0 -0
- /package/cjs/{markets → src/markets}/llamaLend/contractAddresses.d.ts +0 -0
- /package/cjs/{markets → src/markets}/llamaLend/contractAddresses.js +0 -0
- /package/cjs/{markets → src/markets}/llamaLend/index.d.ts +0 -0
- /package/cjs/{markets → src/markets}/llamaLend/index.js +0 -0
- /package/cjs/{markets → src/markets}/morphoBlue/index.d.ts +0 -0
- /package/cjs/{markets → src/markets}/morphoBlue/index.js +0 -0
- /package/cjs/{markets → src/markets}/spark/index.d.ts +0 -0
- /package/cjs/{markets → src/markets}/spark/index.js +0 -0
- /package/cjs/{markets → src/markets}/spark/marketAssets.d.ts +0 -0
- /package/cjs/{markets → src/markets}/spark/marketAssets.js +0 -0
- /package/cjs/{moneymarket → src/moneymarket}/index.d.ts +0 -0
- /package/cjs/{moneymarket → src/moneymarket}/index.js +0 -0
- /package/cjs/{moneymarket → src/moneymarket}/moneymarketCommonService.d.ts +0 -0
- /package/cjs/{moneymarket → src/moneymarket}/moneymarketCommonService.js +0 -0
- /package/cjs/{morphoAaveV2 → src/morphoAaveV2}/index.d.ts +0 -0
- /package/cjs/{morphoAaveV2 → src/morphoAaveV2}/index.js +0 -0
- /package/cjs/{morphoAaveV3 → src/morphoAaveV3}/index.d.ts +0 -0
- /package/cjs/{morphoAaveV3 → src/morphoAaveV3}/index.js +0 -0
- /package/cjs/{morphoBlue → src/morphoBlue}/index.d.ts +0 -0
- /package/cjs/{morphoBlue → src/morphoBlue}/index.js +0 -0
- /package/cjs/{multicall → src/multicall}/index.d.ts +0 -0
- /package/cjs/{multicall → src/multicall}/index.js +0 -0
- /package/cjs/{services → src/services}/dsrService.d.ts +0 -0
- /package/cjs/{services → src/services}/dsrService.js +0 -0
- /package/cjs/{services → src/services}/priceService.d.ts +0 -0
- /package/cjs/{services → src/services}/priceService.js +0 -0
- /package/cjs/{services → src/services}/utils.d.ts +0 -0
- /package/cjs/{services → src/services}/utils.js +0 -0
- /package/cjs/{setup.d.ts → src/setup.d.ts} +0 -0
- /package/cjs/{setup.js → src/setup.js} +0 -0
- /package/cjs/{spark → src/spark}/index.d.ts +0 -0
- /package/cjs/{spark → src/spark}/index.js +0 -0
- /package/cjs/{staking → src/staking}/index.d.ts +0 -0
- /package/cjs/{staking → src/staking}/index.js +0 -0
- /package/cjs/{staking → src/staking}/staking.d.ts +0 -0
- /package/cjs/{staking → src/staking}/staking.js +0 -0
- /package/cjs/{types → src/types}/aave.d.ts +0 -0
- /package/cjs/{types → src/types}/aave.js +0 -0
- /package/cjs/{types → src/types}/chickenBonds.d.ts +0 -0
- /package/cjs/{types → src/types}/chickenBonds.js +0 -0
- /package/cjs/{types → src/types}/common.d.ts +0 -0
- /package/cjs/{types → src/types}/common.js +0 -0
- /package/cjs/{types → src/types}/compound.d.ts +0 -0
- /package/cjs/{types → src/types}/compound.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveLendingPoolV2.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveLendingPoolV2.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveLoanInfoV2.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveLoanInfoV2.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveProtocolDataProvider.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveProtocolDataProvider.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveUiIncentiveDataProviderV3.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveUiIncentiveDataProviderV3.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveV3EtherfiLendingPool.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveV3EtherfiLendingPool.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveV3EtherfiPoolAddressesProvider.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveV3EtherfiPoolAddressesProvider.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveV3EtherfiProtocolDataProvider.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveV3EtherfiProtocolDataProvider.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveV3LendingPool.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveV3LendingPool.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveV3LidoLendingPool.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveV3LidoLendingPool.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveV3LidoPoolAddressesProvider.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveV3LidoPoolAddressesProvider.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveV3LidoProtocolDataProvider.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveV3LidoProtocolDataProvider.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveV3PoolAddressesProvider.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveV3PoolAddressesProvider.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveV3ProtocolDataProvider.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveV3ProtocolDataProvider.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveV3View.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/AaveV3View.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/BalanceScanner.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/BalanceScanner.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CETHv3.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CETHv3.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/COMPPriceFeed.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/COMPPriceFeed.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CUSDCev3.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CUSDCev3.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CUSDCv3.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CUSDCv3.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CUSDTv3.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CUSDTv3.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CUSDbCv3.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CUSDbCv3.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CbEth.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CbEth.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/ChickenBondsManager.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/ChickenBondsManager.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/ChickenBondsView.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/ChickenBondsView.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CollSurplusPool.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CollSurplusPool.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CompV3BulkerL2.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CompV3BulkerL2.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CompV3BulkerMainnetETH.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CompV3BulkerMainnetETH.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CompV3BulkerMainnetUSDC.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CompV3BulkerMainnetUSDC.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CompV3View.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CompV3View.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CompoundLoanInfo.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CompoundLoanInfo.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/Comptroller.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/Comptroller.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDETHAmm.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDETHAmm.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDETHController.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDETHController.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDFactory.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDFactory.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDView.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDView.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDWBTCAmm.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDWBTCAmm.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDWBTCController.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDWBTCController.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDsfrxETHAmm.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDsfrxETHAmm.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDsfrxETHController.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDsfrxETHController.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDtBTCAmm.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDtBTCAmm.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDtBTCController.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDtBTCController.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDwstETHAmm.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDwstETHAmm.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDwstETHController.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/CrvUSDwstETHController.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/ETHPriceFeed.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/ETHPriceFeed.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/Erc20.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/Erc20.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/FeedRegistry.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/FeedRegistry.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/GHO.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/GHO.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/GhoDiscountRateStrategy.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/GhoDiscountRateStrategy.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/IAToken.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/IAToken.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/IVariableDebtToken.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/IVariableDebtToken.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/LendingPoolAddressesProvider.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/LendingPoolAddressesProvider.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/Lido.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/Lido.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/LiquityActivePool.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/LiquityActivePool.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/LiquityView.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/LiquityView.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/LlamaLendControllerAbi.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/LlamaLendControllerAbi.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/LlamaLendView.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/LlamaLendView.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/McdDog.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/McdDog.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/McdJug.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/McdJug.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/McdSpotter.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/McdSpotter.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/McdVat.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/McdVat.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/McdView.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/McdView.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/MorphoAaveV2Proxy.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/MorphoAaveV2Proxy.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/MorphoAaveV2View.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/MorphoAaveV2View.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/MorphoAaveV3ProxyEthMarket.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/MorphoAaveV3ProxyEthMarket.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/MorphoBlueView.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/MorphoBlueView.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/Pot.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/Pot.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/PriceFeed.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/PriceFeed.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/REth.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/REth.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/SparkIncentiveDataProvider.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/SparkIncentiveDataProvider.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/SparkLendingPool.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/SparkLendingPool.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/SparkPoolAddressesProvider.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/SparkPoolAddressesProvider.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/SparkProtocolDataProvider.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/SparkProtocolDataProvider.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/SparkView.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/SparkView.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/TroveManager.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/TroveManager.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/USDCPriceFeed.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/USDCPriceFeed.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/UniMulticall.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/UniMulticall.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/WstETH.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/WstETH.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/index.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/index.js +0 -0
- /package/cjs/{types → src/types}/contracts/generated/types.d.ts +0 -0
- /package/cjs/{types → src/types}/contracts/generated/types.js +0 -0
- /package/cjs/{types → src/types}/curveUsd.d.ts +0 -0
- /package/cjs/{types → src/types}/curveUsd.js +0 -0
- /package/cjs/{types → src/types}/index.d.ts +0 -0
- /package/cjs/{types → src/types}/index.js +0 -0
- /package/cjs/{types → src/types}/liquity.d.ts +0 -0
- /package/cjs/{types → src/types}/liquity.js +0 -0
- /package/cjs/{types → src/types}/llamaLend.d.ts +0 -0
- /package/cjs/{types → src/types}/llamaLend.js +0 -0
- /package/cjs/{types → src/types}/maker.d.ts +0 -0
- /package/cjs/{types → src/types}/maker.js +0 -0
- /package/cjs/{types → src/types}/morphoBlue.d.ts +0 -0
- /package/cjs/{types → src/types}/morphoBlue.js +0 -0
- /package/cjs/{types → src/types}/spark.d.ts +0 -0
- /package/cjs/{types → src/types}/spark.js +0 -0
- /package/{esm/setup.d.ts → cjs/tests/index.d.ts} +0 -0
- /package/esm/{aaveV2 → src/aaveV2}/index.d.ts +0 -0
- /package/esm/{aaveV2 → src/aaveV2}/index.js +0 -0
- /package/esm/{aaveV3 → src/aaveV3}/index.d.ts +0 -0
- /package/esm/{aaveV3 → src/aaveV3}/index.js +0 -0
- /package/esm/{assets → src/assets}/index.d.ts +0 -0
- /package/esm/{assets → src/assets}/index.js +0 -0
- /package/esm/{chickenBonds → src/chickenBonds}/index.d.ts +0 -0
- /package/esm/{chickenBonds → src/chickenBonds}/index.js +0 -0
- /package/esm/{compoundV2 → src/compoundV2}/index.d.ts +0 -0
- /package/esm/{compoundV2 → src/compoundV2}/index.js +0 -0
- /package/esm/{compoundV3 → src/compoundV3}/index.d.ts +0 -0
- /package/esm/{compoundV3 → src/compoundV3}/index.js +0 -0
- /package/esm/{config → src/config}/contracts.d.ts +0 -0
- /package/esm/{config → src/config}/contracts.js +0 -0
- /package/esm/{constants → src/constants}/index.d.ts +0 -0
- /package/esm/{constants → src/constants}/index.js +0 -0
- /package/esm/{contracts.d.ts → src/contracts.d.ts} +0 -0
- /package/esm/{contracts.js → src/contracts.js} +0 -0
- /package/esm/{curveUsd → src/curveUsd}/index.d.ts +0 -0
- /package/esm/{curveUsd → src/curveUsd}/index.js +0 -0
- /package/esm/{exchange → src/exchange}/index.d.ts +0 -0
- /package/esm/{exchange → src/exchange}/index.js +0 -0
- /package/esm/{helpers → src/helpers}/aaveHelpers/index.d.ts +0 -0
- /package/esm/{helpers → src/helpers}/aaveHelpers/index.js +0 -0
- /package/esm/{helpers → src/helpers}/chickenBondsHelpers/index.d.ts +0 -0
- /package/esm/{helpers → src/helpers}/chickenBondsHelpers/index.js +0 -0
- /package/esm/{helpers → src/helpers}/compoundHelpers/index.d.ts +0 -0
- /package/esm/{helpers → src/helpers}/compoundHelpers/index.js +0 -0
- /package/esm/{helpers → src/helpers}/curveUsdHelpers/index.d.ts +0 -0
- /package/esm/{helpers → src/helpers}/curveUsdHelpers/index.js +0 -0
- /package/esm/{helpers → src/helpers}/index.d.ts +0 -0
- /package/esm/{helpers → src/helpers}/index.js +0 -0
- /package/esm/{helpers → src/helpers}/llamaLendHelpers/index.d.ts +0 -0
- /package/esm/{helpers → src/helpers}/llamaLendHelpers/index.js +0 -0
- /package/esm/{helpers → src/helpers}/makerHelpers/index.d.ts +0 -0
- /package/esm/{helpers → src/helpers}/makerHelpers/index.js +0 -0
- /package/esm/{helpers → src/helpers}/morphoBlueHelpers/index.d.ts +0 -0
- /package/esm/{helpers → src/helpers}/morphoBlueHelpers/index.js +0 -0
- /package/esm/{helpers → src/helpers}/sparkHelpers/index.d.ts +0 -0
- /package/esm/{helpers → src/helpers}/sparkHelpers/index.js +0 -0
- /package/esm/{index.d.ts → src/index.d.ts} +0 -0
- /package/esm/{index.js → src/index.js} +0 -0
- /package/esm/{liquity → src/liquity}/index.d.ts +0 -0
- /package/esm/{liquity → src/liquity}/index.js +0 -0
- /package/esm/{llamaLend → src/llamaLend}/index.d.ts +0 -0
- /package/esm/{llamaLend → src/llamaLend}/index.js +0 -0
- /package/esm/{maker → src/maker}/index.d.ts +0 -0
- /package/esm/{maker → src/maker}/index.js +0 -0
- /package/esm/{markets → src/markets}/aave/index.d.ts +0 -0
- /package/esm/{markets → src/markets}/aave/index.js +0 -0
- /package/esm/{markets → src/markets}/aave/marketAssets.d.ts +0 -0
- /package/esm/{markets → src/markets}/aave/marketAssets.js +0 -0
- /package/esm/{markets → src/markets}/compound/index.d.ts +0 -0
- /package/esm/{markets → src/markets}/compound/index.js +0 -0
- /package/esm/{markets → src/markets}/compound/marketsAssets.d.ts +0 -0
- /package/esm/{markets → src/markets}/curveUsd/index.d.ts +0 -0
- /package/esm/{markets → src/markets}/curveUsd/index.js +0 -0
- /package/esm/{markets → src/markets}/index.d.ts +0 -0
- /package/esm/{markets → src/markets}/index.js +0 -0
- /package/esm/{markets → src/markets}/llamaLend/contractAddresses.d.ts +0 -0
- /package/esm/{markets → src/markets}/llamaLend/contractAddresses.js +0 -0
- /package/esm/{markets → src/markets}/llamaLend/index.d.ts +0 -0
- /package/esm/{markets → src/markets}/llamaLend/index.js +0 -0
- /package/esm/{markets → src/markets}/morphoBlue/index.d.ts +0 -0
- /package/esm/{markets → src/markets}/morphoBlue/index.js +0 -0
- /package/esm/{markets → src/markets}/spark/index.d.ts +0 -0
- /package/esm/{markets → src/markets}/spark/index.js +0 -0
- /package/esm/{markets → src/markets}/spark/marketAssets.d.ts +0 -0
- /package/esm/{markets → src/markets}/spark/marketAssets.js +0 -0
- /package/esm/{moneymarket → src/moneymarket}/index.d.ts +0 -0
- /package/esm/{moneymarket → src/moneymarket}/index.js +0 -0
- /package/esm/{moneymarket → src/moneymarket}/moneymarketCommonService.d.ts +0 -0
- /package/esm/{moneymarket → src/moneymarket}/moneymarketCommonService.js +0 -0
- /package/esm/{morphoAaveV2 → src/morphoAaveV2}/index.d.ts +0 -0
- /package/esm/{morphoAaveV2 → src/morphoAaveV2}/index.js +0 -0
- /package/esm/{morphoAaveV3 → src/morphoAaveV3}/index.d.ts +0 -0
- /package/esm/{morphoAaveV3 → src/morphoAaveV3}/index.js +0 -0
- /package/esm/{morphoBlue → src/morphoBlue}/index.d.ts +0 -0
- /package/esm/{morphoBlue → src/morphoBlue}/index.js +0 -0
- /package/esm/{multicall → src/multicall}/index.d.ts +0 -0
- /package/esm/{multicall → src/multicall}/index.js +0 -0
- /package/esm/{services → src/services}/dsrService.d.ts +0 -0
- /package/esm/{services → src/services}/dsrService.js +0 -0
- /package/esm/{services → src/services}/priceService.d.ts +0 -0
- /package/esm/{services → src/services}/priceService.js +0 -0
- /package/esm/{services → src/services}/utils.d.ts +0 -0
- /package/esm/{services → src/services}/utils.js +0 -0
- /package/esm/{types/contracts/generated/index.js → src/setup.d.ts} +0 -0
- /package/esm/{setup.js → src/setup.js} +0 -0
- /package/esm/{spark → src/spark}/index.d.ts +0 -0
- /package/esm/{spark → src/spark}/index.js +0 -0
- /package/esm/{staking → src/staking}/index.d.ts +0 -0
- /package/esm/{staking → src/staking}/index.js +0 -0
- /package/esm/{staking → src/staking}/staking.d.ts +0 -0
- /package/esm/{staking → src/staking}/staking.js +0 -0
- /package/esm/{types → src/types}/aave.d.ts +0 -0
- /package/esm/{types → src/types}/aave.js +0 -0
- /package/esm/{types → src/types}/chickenBonds.d.ts +0 -0
- /package/esm/{types → src/types}/chickenBonds.js +0 -0
- /package/esm/{types → src/types}/common.d.ts +0 -0
- /package/esm/{types → src/types}/common.js +0 -0
- /package/esm/{types → src/types}/compound.d.ts +0 -0
- /package/esm/{types → src/types}/compound.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveLendingPoolV2.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveLendingPoolV2.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveLoanInfoV2.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveLoanInfoV2.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveProtocolDataProvider.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveProtocolDataProvider.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveUiIncentiveDataProviderV3.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveUiIncentiveDataProviderV3.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveV3EtherfiLendingPool.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveV3EtherfiLendingPool.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveV3EtherfiPoolAddressesProvider.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveV3EtherfiPoolAddressesProvider.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveV3EtherfiProtocolDataProvider.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveV3EtherfiProtocolDataProvider.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveV3LendingPool.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveV3LendingPool.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveV3LidoLendingPool.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveV3LidoLendingPool.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveV3LidoPoolAddressesProvider.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveV3LidoPoolAddressesProvider.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveV3LidoProtocolDataProvider.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveV3LidoProtocolDataProvider.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveV3PoolAddressesProvider.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveV3PoolAddressesProvider.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveV3ProtocolDataProvider.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveV3ProtocolDataProvider.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveV3View.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/AaveV3View.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/BalanceScanner.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/BalanceScanner.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CETHv3.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CETHv3.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/COMPPriceFeed.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/COMPPriceFeed.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CUSDCev3.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CUSDCev3.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CUSDCv3.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CUSDCv3.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CUSDTv3.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CUSDTv3.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CUSDbCv3.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CUSDbCv3.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CbEth.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CbEth.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/ChickenBondsManager.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/ChickenBondsManager.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/ChickenBondsView.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/ChickenBondsView.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CollSurplusPool.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CollSurplusPool.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CompV3BulkerL2.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CompV3BulkerL2.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CompV3BulkerMainnetETH.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CompV3BulkerMainnetETH.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CompV3BulkerMainnetUSDC.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CompV3BulkerMainnetUSDC.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CompV3View.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CompV3View.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CompoundLoanInfo.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CompoundLoanInfo.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/Comptroller.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/Comptroller.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDETHAmm.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDETHAmm.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDETHController.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDETHController.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDFactory.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDFactory.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDView.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDView.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDWBTCAmm.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDWBTCAmm.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDWBTCController.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDWBTCController.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDsfrxETHAmm.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDsfrxETHAmm.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDsfrxETHController.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDsfrxETHController.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDtBTCAmm.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDtBTCAmm.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDtBTCController.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDtBTCController.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDwstETHAmm.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDwstETHAmm.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDwstETHController.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/CrvUSDwstETHController.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/ETHPriceFeed.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/ETHPriceFeed.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/Erc20.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/Erc20.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/FeedRegistry.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/FeedRegistry.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/GHO.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/GHO.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/GhoDiscountRateStrategy.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/GhoDiscountRateStrategy.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/IAToken.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/IAToken.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/IVariableDebtToken.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/IVariableDebtToken.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/LendingPoolAddressesProvider.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/LendingPoolAddressesProvider.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/Lido.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/Lido.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/LiquityActivePool.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/LiquityActivePool.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/LiquityView.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/LiquityView.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/LlamaLendControllerAbi.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/LlamaLendControllerAbi.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/LlamaLendView.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/LlamaLendView.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/McdDog.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/McdDog.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/McdJug.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/McdJug.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/McdSpotter.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/McdSpotter.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/McdVat.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/McdVat.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/McdView.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/McdView.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/MorphoAaveV2Proxy.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/MorphoAaveV2Proxy.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/MorphoAaveV2View.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/MorphoAaveV2View.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/MorphoAaveV3ProxyEthMarket.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/MorphoAaveV3ProxyEthMarket.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/MorphoBlueView.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/MorphoBlueView.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/Pot.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/Pot.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/PriceFeed.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/PriceFeed.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/REth.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/REth.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/SparkIncentiveDataProvider.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/SparkIncentiveDataProvider.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/SparkLendingPool.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/SparkLendingPool.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/SparkPoolAddressesProvider.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/SparkPoolAddressesProvider.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/SparkProtocolDataProvider.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/SparkProtocolDataProvider.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/SparkView.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/SparkView.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/TroveManager.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/TroveManager.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/USDCPriceFeed.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/USDCPriceFeed.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/UniMulticall.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/UniMulticall.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/WstETH.d.ts +0 -0
- /package/esm/{types → src/types}/contracts/generated/WstETH.js +0 -0
- /package/esm/{types → src/types}/contracts/generated/index.d.ts +0 -0
- /package/esm/{types/contracts/generated/types.js → src/types/contracts/generated/index.js} +0 -0
- /package/esm/{types → src/types}/contracts/generated/types.d.ts +0 -0
- /package/esm/{types/maker.js → src/types/contracts/generated/types.js} +0 -0
- /package/esm/{types → src/types}/curveUsd.d.ts +0 -0
- /package/esm/{types → src/types}/curveUsd.js +0 -0
- /package/esm/{types → src/types}/index.d.ts +0 -0
- /package/esm/{types → src/types}/index.js +0 -0
- /package/esm/{types → src/types}/liquity.d.ts +0 -0
- /package/esm/{types → src/types}/liquity.js +0 -0
- /package/esm/{types → src/types}/llamaLend.d.ts +0 -0
- /package/esm/{types → src/types}/llamaLend.js +0 -0
- /package/esm/{types → src/types}/maker.d.ts +0 -0
- /package/esm/{types → src/types}/morphoBlue.d.ts +0 -0
- /package/esm/{types → src/types}/morphoBlue.js +0 -0
- /package/esm/{types → src/types}/spark.d.ts +0 -0
- /package/esm/{types → src/types}/spark.js +0 -0
package/src/morphoBlue/index.ts
CHANGED
|
@@ -1,171 +1,171 @@
|
|
|
1
|
-
import Web3 from 'web3';
|
|
2
|
-
import Dec from 'decimal.js';
|
|
3
|
-
import { assetAmountInEth, getAssetInfo, getAssetInfoByAddress } from '@defisaver/tokens';
|
|
4
|
-
import {
|
|
5
|
-
Blockish, EthAddress, MMUsedAssets, NetworkNumber, PositionBalances,
|
|
6
|
-
} from '../types/common';
|
|
7
|
-
import {
|
|
8
|
-
FeedRegistryContract,
|
|
9
|
-
MorphoBlueViewContract,
|
|
10
|
-
} from '../contracts';
|
|
11
|
-
import {
|
|
12
|
-
MorphoBlueAssetsData, MorphoBlueMarketData, MorphoBlueMarketInfo, MorphoBluePositionData,
|
|
13
|
-
} from '../types';
|
|
14
|
-
import { WAD, USD_QUOTE } from '../constants';
|
|
15
|
-
import { getStakingApy, STAKING_ASSETS } from '../staking';
|
|
16
|
-
import { wethToEth } from '../services/utils';
|
|
17
|
-
import { getBorrowRate, getMorphoBlueAggregatedPositionData, getSupplyRate } from '../helpers/morphoBlueHelpers';
|
|
18
|
-
|
|
19
|
-
export async function getMorphoBlueMarketData(web3: Web3, network: NetworkNumber, selectedMarket: MorphoBlueMarketData, mainnetWeb3: Web3): Promise<MorphoBlueMarketInfo> {
|
|
20
|
-
const {
|
|
21
|
-
loanToken, collateralToken, oracle, irm, lltv, oracleType,
|
|
22
|
-
} = selectedMarket;
|
|
23
|
-
const lltvInWei = new Dec(lltv).mul(WAD).toString();
|
|
24
|
-
const loanTokenInfo = getAssetInfoByAddress(loanToken, network);
|
|
25
|
-
const collateralTokenInfo = getAssetInfoByAddress(collateralToken, network);
|
|
26
|
-
let loanTokenFeedAddress = loanTokenInfo.addresses[NetworkNumber.Eth];
|
|
27
|
-
if (loanTokenInfo.symbol === 'WETH') {
|
|
28
|
-
const ethAddress = getAssetInfo('ETH').address;
|
|
29
|
-
loanTokenFeedAddress = ethAddress;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const feedRegistryContract = FeedRegistryContract(mainnetWeb3, NetworkNumber.Eth);
|
|
33
|
-
const morphoBlueViewContract = MorphoBlueViewContract(web3, network);
|
|
34
|
-
|
|
35
|
-
const [loanTokenPrice, marketInfo] = await Promise.all([
|
|
36
|
-
loanTokenInfo.symbol === 'USDA' ? '100000000' : feedRegistryContract.methods.latestAnswer(loanTokenFeedAddress, USD_QUOTE).call(),
|
|
37
|
-
morphoBlueViewContract.methods.getMarketInfoNotTuple(loanToken, collateralToken, oracle, irm, lltvInWei).call(),
|
|
38
|
-
]);
|
|
39
|
-
|
|
40
|
-
const supplyRate = getSupplyRate(marketInfo.totalSupplyAssets, marketInfo.totalBorrowAssets, marketInfo.borrowRate, marketInfo.fee);
|
|
41
|
-
const compoundedBorrowRate = getBorrowRate(marketInfo.borrowRate, marketInfo.totalBorrowShares);
|
|
42
|
-
const utillization = new Dec(marketInfo.totalBorrowAssets).div(marketInfo.totalSupplyAssets).mul(100).toString();
|
|
43
|
-
|
|
44
|
-
const oracleScaleFactor = new Dec(36).add(loanTokenInfo.decimals).sub(collateralTokenInfo.decimals).toString();
|
|
45
|
-
const oracleScale = new Dec(10).pow(oracleScaleFactor).toString();
|
|
46
|
-
|
|
47
|
-
const scale = new Dec(10).pow(loanTokenInfo.decimals).toString();
|
|
48
|
-
|
|
49
|
-
const oracleRate = new Dec(marketInfo.oracle).div(oracleScale).toString();
|
|
50
|
-
const assetsData: MorphoBlueAssetsData = {};
|
|
51
|
-
assetsData[wethToEth(loanTokenInfo.symbol)] = {
|
|
52
|
-
symbol: wethToEth(loanTokenInfo.symbol),
|
|
53
|
-
address: loanToken,
|
|
54
|
-
price: new Dec(loanTokenPrice).div(1e8).toString(),
|
|
55
|
-
supplyRate,
|
|
56
|
-
borrowRate: compoundedBorrowRate,
|
|
57
|
-
totalSupply: new Dec(marketInfo.totalSupplyAssets).div(scale).toString(),
|
|
58
|
-
totalBorrow: new Dec(marketInfo.totalBorrowAssets).div(scale).toString(),
|
|
59
|
-
canBeSupplied: true,
|
|
60
|
-
canBeBorrowed: true,
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
assetsData[wethToEth(collateralTokenInfo.symbol)] = {
|
|
64
|
-
symbol: wethToEth(collateralTokenInfo.symbol),
|
|
65
|
-
address: collateralToken,
|
|
66
|
-
price: new Dec(assetsData[wethToEth(loanTokenInfo.symbol)].price).mul(oracleRate).toString(),
|
|
67
|
-
supplyRate: '0',
|
|
68
|
-
borrowRate: '0',
|
|
69
|
-
canBeSupplied: true,
|
|
70
|
-
canBeBorrowed: false,
|
|
71
|
-
};
|
|
72
|
-
if (STAKING_ASSETS.includes(collateralTokenInfo.symbol)) {
|
|
73
|
-
assetsData[collateralTokenInfo.symbol].incentiveSupplyApy = await getStakingApy(collateralTokenInfo.symbol, mainnetWeb3);
|
|
74
|
-
assetsData[collateralTokenInfo.symbol].incentiveSupplyToken = collateralTokenInfo.symbol;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return {
|
|
78
|
-
id: marketInfo.id,
|
|
79
|
-
fee: new Dec(marketInfo.fee).div(WAD).toString(),
|
|
80
|
-
loanToken: wethToEth(loanTokenInfo.symbol),
|
|
81
|
-
collateralToken: wethToEth(collateralTokenInfo.symbol),
|
|
82
|
-
utillization,
|
|
83
|
-
oracle: oracleRate,
|
|
84
|
-
oracleType,
|
|
85
|
-
lltv: new Dec(lltv).toString(),
|
|
86
|
-
minRatio: new Dec(1).div(lltv).mul(100).toString(),
|
|
87
|
-
assetsData,
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export const getMorphoBlueAccountBalances = async (web3: Web3, network: NetworkNumber, block: Blockish, addressMapping: boolean, address: EthAddress, selectedMarket: MorphoBlueMarketData): Promise<PositionBalances> => {
|
|
92
|
-
let balances: PositionBalances = {
|
|
93
|
-
collateral: {},
|
|
94
|
-
debt: {},
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
if (!address) {
|
|
98
|
-
return balances;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const viewContract = MorphoBlueViewContract(web3, network, block);
|
|
102
|
-
const {
|
|
103
|
-
loanToken, collateralToken, oracle, irm, lltv,
|
|
104
|
-
} = selectedMarket;
|
|
105
|
-
const lltvInWei = new Dec(lltv).mul(WAD).toString();
|
|
106
|
-
const marketObject = {
|
|
107
|
-
loanToken, collateralToken, oracle, irm, lltv: lltvInWei,
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
const loanInfo = await viewContract.methods.getUserInfo(marketObject, address).call({}, block);
|
|
111
|
-
const loanTokenInfo = getAssetInfoByAddress(selectedMarket.loanToken, network);
|
|
112
|
-
const collateralTokenInfo = getAssetInfoByAddress(selectedMarket.collateralToken, network);
|
|
113
|
-
|
|
114
|
-
balances = {
|
|
115
|
-
collateral: {
|
|
116
|
-
[addressMapping ? collateralTokenInfo.address.toLowerCase() : wethToEth(collateralTokenInfo.symbol)]: assetAmountInEth(loanInfo.collateral, collateralTokenInfo.symbol),
|
|
117
|
-
},
|
|
118
|
-
debt: {
|
|
119
|
-
[addressMapping ? loanTokenInfo.address.toLowerCase() : wethToEth(loanTokenInfo.symbol)]: assetAmountInEth(loanInfo.borrowedInAssets, loanTokenInfo.symbol),
|
|
120
|
-
},
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
return balances;
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
export async function getMorphoBlueAccountData(web3: Web3, network: NetworkNumber, account: string, selectedMarket: MorphoBlueMarketData, marketInfo: MorphoBlueMarketInfo): Promise<MorphoBluePositionData> {
|
|
127
|
-
const {
|
|
128
|
-
loanToken, collateralToken, oracle, irm, lltv,
|
|
129
|
-
} = selectedMarket;
|
|
130
|
-
const lltvInWei = new Dec(lltv).mul(WAD).toString();
|
|
131
|
-
const marketObject = {
|
|
132
|
-
loanToken, collateralToken, oracle, irm, lltv: lltvInWei,
|
|
133
|
-
};
|
|
134
|
-
const viewContract = MorphoBlueViewContract(web3, network);
|
|
135
|
-
const loanInfo = await viewContract.methods.getUserInfo(marketObject, account).call();
|
|
136
|
-
const usedAssets: MMUsedAssets = {};
|
|
137
|
-
|
|
138
|
-
const loanTokenInfo = marketInfo.assetsData[marketInfo.loanToken];
|
|
139
|
-
const loanTokenSupplied = assetAmountInEth(loanInfo.suppliedInAssets, marketInfo.loanToken);
|
|
140
|
-
const loanTokenBorrowed = assetAmountInEth(loanInfo.borrowedInAssets, marketInfo.loanToken);
|
|
141
|
-
usedAssets[marketInfo.loanToken] = {
|
|
142
|
-
symbol: loanTokenInfo.symbol,
|
|
143
|
-
supplied: loanTokenSupplied,
|
|
144
|
-
borrowed: loanTokenBorrowed,
|
|
145
|
-
isSupplied: new Dec(loanInfo.suppliedInAssets).gt(0),
|
|
146
|
-
isBorrowed: new Dec(loanInfo.borrowedInAssets).gt(0),
|
|
147
|
-
collateral: false,
|
|
148
|
-
suppliedUsd: new Dec(loanTokenSupplied).mul(loanTokenInfo.price).toString(),
|
|
149
|
-
borrowedUsd: new Dec(loanTokenBorrowed).mul(loanTokenInfo.price).toString(),
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
const collateralTokenInfo = marketInfo.assetsData[marketInfo.collateralToken];
|
|
153
|
-
const collateralTokenSupplied = assetAmountInEth(loanInfo.collateral, marketInfo.collateralToken);
|
|
154
|
-
usedAssets[marketInfo.collateralToken] = {
|
|
155
|
-
symbol: collateralTokenInfo.symbol,
|
|
156
|
-
supplied: collateralTokenSupplied,
|
|
157
|
-
borrowed: '0',
|
|
158
|
-
isSupplied: new Dec(loanInfo.collateral).gt(0),
|
|
159
|
-
isBorrowed: false,
|
|
160
|
-
collateral: true,
|
|
161
|
-
suppliedUsd: new Dec(collateralTokenSupplied).mul(collateralTokenInfo.price).toString(),
|
|
162
|
-
borrowedUsd: '0',
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
return {
|
|
166
|
-
supplyShares: loanInfo.supplyShares,
|
|
167
|
-
borrowShares: loanInfo.borrowShares,
|
|
168
|
-
usedAssets,
|
|
169
|
-
...getMorphoBlueAggregatedPositionData({ usedAssets, assetsData: marketInfo.assetsData, marketInfo }),
|
|
170
|
-
};
|
|
171
|
-
}
|
|
1
|
+
import Web3 from 'web3';
|
|
2
|
+
import Dec from 'decimal.js';
|
|
3
|
+
import { assetAmountInEth, getAssetInfo, getAssetInfoByAddress } from '@defisaver/tokens';
|
|
4
|
+
import {
|
|
5
|
+
Blockish, EthAddress, MMUsedAssets, NetworkNumber, PositionBalances,
|
|
6
|
+
} from '../types/common';
|
|
7
|
+
import {
|
|
8
|
+
FeedRegistryContract,
|
|
9
|
+
MorphoBlueViewContract,
|
|
10
|
+
} from '../contracts';
|
|
11
|
+
import {
|
|
12
|
+
MorphoBlueAssetsData, MorphoBlueMarketData, MorphoBlueMarketInfo, MorphoBluePositionData,
|
|
13
|
+
} from '../types';
|
|
14
|
+
import { WAD, USD_QUOTE } from '../constants';
|
|
15
|
+
import { getStakingApy, STAKING_ASSETS } from '../staking';
|
|
16
|
+
import { wethToEth } from '../services/utils';
|
|
17
|
+
import { getBorrowRate, getMorphoBlueAggregatedPositionData, getSupplyRate } from '../helpers/morphoBlueHelpers';
|
|
18
|
+
|
|
19
|
+
export async function getMorphoBlueMarketData(web3: Web3, network: NetworkNumber, selectedMarket: MorphoBlueMarketData, mainnetWeb3: Web3): Promise<MorphoBlueMarketInfo> {
|
|
20
|
+
const {
|
|
21
|
+
loanToken, collateralToken, oracle, irm, lltv, oracleType,
|
|
22
|
+
} = selectedMarket;
|
|
23
|
+
const lltvInWei = new Dec(lltv).mul(WAD).toString();
|
|
24
|
+
const loanTokenInfo = getAssetInfoByAddress(loanToken, network);
|
|
25
|
+
const collateralTokenInfo = getAssetInfoByAddress(collateralToken, network);
|
|
26
|
+
let loanTokenFeedAddress = loanTokenInfo.addresses[NetworkNumber.Eth];
|
|
27
|
+
if (loanTokenInfo.symbol === 'WETH') {
|
|
28
|
+
const ethAddress = getAssetInfo('ETH').address;
|
|
29
|
+
loanTokenFeedAddress = ethAddress;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const feedRegistryContract = FeedRegistryContract(mainnetWeb3, NetworkNumber.Eth);
|
|
33
|
+
const morphoBlueViewContract = MorphoBlueViewContract(web3, network);
|
|
34
|
+
|
|
35
|
+
const [loanTokenPrice, marketInfo] = await Promise.all([
|
|
36
|
+
loanTokenInfo.symbol === 'USDA' ? '100000000' : feedRegistryContract.methods.latestAnswer(loanTokenFeedAddress, USD_QUOTE).call(),
|
|
37
|
+
morphoBlueViewContract.methods.getMarketInfoNotTuple(loanToken, collateralToken, oracle, irm, lltvInWei).call(),
|
|
38
|
+
]);
|
|
39
|
+
|
|
40
|
+
const supplyRate = getSupplyRate(marketInfo.totalSupplyAssets, marketInfo.totalBorrowAssets, marketInfo.borrowRate, marketInfo.fee);
|
|
41
|
+
const compoundedBorrowRate = getBorrowRate(marketInfo.borrowRate, marketInfo.totalBorrowShares);
|
|
42
|
+
const utillization = new Dec(marketInfo.totalBorrowAssets).div(marketInfo.totalSupplyAssets).mul(100).toString();
|
|
43
|
+
|
|
44
|
+
const oracleScaleFactor = new Dec(36).add(loanTokenInfo.decimals).sub(collateralTokenInfo.decimals).toString();
|
|
45
|
+
const oracleScale = new Dec(10).pow(oracleScaleFactor).toString();
|
|
46
|
+
|
|
47
|
+
const scale = new Dec(10).pow(loanTokenInfo.decimals).toString();
|
|
48
|
+
|
|
49
|
+
const oracleRate = new Dec(marketInfo.oracle).div(oracleScale).toString();
|
|
50
|
+
const assetsData: MorphoBlueAssetsData = {};
|
|
51
|
+
assetsData[wethToEth(loanTokenInfo.symbol)] = {
|
|
52
|
+
symbol: wethToEth(loanTokenInfo.symbol),
|
|
53
|
+
address: loanToken,
|
|
54
|
+
price: new Dec(loanTokenPrice).div(1e8).toString(),
|
|
55
|
+
supplyRate,
|
|
56
|
+
borrowRate: compoundedBorrowRate,
|
|
57
|
+
totalSupply: new Dec(marketInfo.totalSupplyAssets).div(scale).toString(),
|
|
58
|
+
totalBorrow: new Dec(marketInfo.totalBorrowAssets).div(scale).toString(),
|
|
59
|
+
canBeSupplied: true,
|
|
60
|
+
canBeBorrowed: true,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
assetsData[wethToEth(collateralTokenInfo.symbol)] = {
|
|
64
|
+
symbol: wethToEth(collateralTokenInfo.symbol),
|
|
65
|
+
address: collateralToken,
|
|
66
|
+
price: new Dec(assetsData[wethToEth(loanTokenInfo.symbol)].price).mul(oracleRate).toString(),
|
|
67
|
+
supplyRate: '0',
|
|
68
|
+
borrowRate: '0',
|
|
69
|
+
canBeSupplied: true,
|
|
70
|
+
canBeBorrowed: false,
|
|
71
|
+
};
|
|
72
|
+
if (STAKING_ASSETS.includes(collateralTokenInfo.symbol)) {
|
|
73
|
+
assetsData[collateralTokenInfo.symbol].incentiveSupplyApy = await getStakingApy(collateralTokenInfo.symbol, mainnetWeb3);
|
|
74
|
+
assetsData[collateralTokenInfo.symbol].incentiveSupplyToken = collateralTokenInfo.symbol;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
id: marketInfo.id,
|
|
79
|
+
fee: new Dec(marketInfo.fee).div(WAD).toString(),
|
|
80
|
+
loanToken: wethToEth(loanTokenInfo.symbol),
|
|
81
|
+
collateralToken: wethToEth(collateralTokenInfo.symbol),
|
|
82
|
+
utillization,
|
|
83
|
+
oracle: oracleRate,
|
|
84
|
+
oracleType,
|
|
85
|
+
lltv: new Dec(lltv).toString(),
|
|
86
|
+
minRatio: new Dec(1).div(lltv).mul(100).toString(),
|
|
87
|
+
assetsData,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export const getMorphoBlueAccountBalances = async (web3: Web3, network: NetworkNumber, block: Blockish, addressMapping: boolean, address: EthAddress, selectedMarket: MorphoBlueMarketData): Promise<PositionBalances> => {
|
|
92
|
+
let balances: PositionBalances = {
|
|
93
|
+
collateral: {},
|
|
94
|
+
debt: {},
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
if (!address) {
|
|
98
|
+
return balances;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const viewContract = MorphoBlueViewContract(web3, network, block);
|
|
102
|
+
const {
|
|
103
|
+
loanToken, collateralToken, oracle, irm, lltv,
|
|
104
|
+
} = selectedMarket;
|
|
105
|
+
const lltvInWei = new Dec(lltv).mul(WAD).toString();
|
|
106
|
+
const marketObject = {
|
|
107
|
+
loanToken, collateralToken, oracle, irm, lltv: lltvInWei,
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const loanInfo = await viewContract.methods.getUserInfo(marketObject, address).call({}, block);
|
|
111
|
+
const loanTokenInfo = getAssetInfoByAddress(selectedMarket.loanToken, network);
|
|
112
|
+
const collateralTokenInfo = getAssetInfoByAddress(selectedMarket.collateralToken, network);
|
|
113
|
+
|
|
114
|
+
balances = {
|
|
115
|
+
collateral: {
|
|
116
|
+
[addressMapping ? collateralTokenInfo.address.toLowerCase() : wethToEth(collateralTokenInfo.symbol)]: assetAmountInEth(loanInfo.collateral, collateralTokenInfo.symbol),
|
|
117
|
+
},
|
|
118
|
+
debt: {
|
|
119
|
+
[addressMapping ? loanTokenInfo.address.toLowerCase() : wethToEth(loanTokenInfo.symbol)]: assetAmountInEth(loanInfo.borrowedInAssets, loanTokenInfo.symbol),
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
return balances;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export async function getMorphoBlueAccountData(web3: Web3, network: NetworkNumber, account: string, selectedMarket: MorphoBlueMarketData, marketInfo: MorphoBlueMarketInfo): Promise<MorphoBluePositionData> {
|
|
127
|
+
const {
|
|
128
|
+
loanToken, collateralToken, oracle, irm, lltv,
|
|
129
|
+
} = selectedMarket;
|
|
130
|
+
const lltvInWei = new Dec(lltv).mul(WAD).toString();
|
|
131
|
+
const marketObject = {
|
|
132
|
+
loanToken, collateralToken, oracle, irm, lltv: lltvInWei,
|
|
133
|
+
};
|
|
134
|
+
const viewContract = MorphoBlueViewContract(web3, network);
|
|
135
|
+
const loanInfo = await viewContract.methods.getUserInfo(marketObject, account).call();
|
|
136
|
+
const usedAssets: MMUsedAssets = {};
|
|
137
|
+
|
|
138
|
+
const loanTokenInfo = marketInfo.assetsData[marketInfo.loanToken];
|
|
139
|
+
const loanTokenSupplied = assetAmountInEth(loanInfo.suppliedInAssets, marketInfo.loanToken);
|
|
140
|
+
const loanTokenBorrowed = assetAmountInEth(loanInfo.borrowedInAssets, marketInfo.loanToken);
|
|
141
|
+
usedAssets[marketInfo.loanToken] = {
|
|
142
|
+
symbol: loanTokenInfo.symbol,
|
|
143
|
+
supplied: loanTokenSupplied,
|
|
144
|
+
borrowed: loanTokenBorrowed,
|
|
145
|
+
isSupplied: new Dec(loanInfo.suppliedInAssets).gt(0),
|
|
146
|
+
isBorrowed: new Dec(loanInfo.borrowedInAssets).gt(0),
|
|
147
|
+
collateral: false,
|
|
148
|
+
suppliedUsd: new Dec(loanTokenSupplied).mul(loanTokenInfo.price).toString(),
|
|
149
|
+
borrowedUsd: new Dec(loanTokenBorrowed).mul(loanTokenInfo.price).toString(),
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
const collateralTokenInfo = marketInfo.assetsData[marketInfo.collateralToken];
|
|
153
|
+
const collateralTokenSupplied = assetAmountInEth(loanInfo.collateral, marketInfo.collateralToken);
|
|
154
|
+
usedAssets[marketInfo.collateralToken] = {
|
|
155
|
+
symbol: collateralTokenInfo.symbol,
|
|
156
|
+
supplied: collateralTokenSupplied,
|
|
157
|
+
borrowed: '0',
|
|
158
|
+
isSupplied: new Dec(loanInfo.collateral).gt(0),
|
|
159
|
+
isBorrowed: false,
|
|
160
|
+
collateral: true,
|
|
161
|
+
suppliedUsd: new Dec(collateralTokenSupplied).mul(collateralTokenInfo.price).toString(),
|
|
162
|
+
borrowedUsd: '0',
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
return {
|
|
166
|
+
supplyShares: loanInfo.supplyShares,
|
|
167
|
+
borrowShares: loanInfo.borrowShares,
|
|
168
|
+
usedAssets,
|
|
169
|
+
...getMorphoBlueAggregatedPositionData({ usedAssets, assetsData: marketInfo.assetsData, marketInfo }),
|
|
170
|
+
};
|
|
171
|
+
}
|
package/src/multicall/index.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import Web3 from 'web3';
|
|
2
|
-
import { UniMulticallContract } from '../contracts';
|
|
3
|
-
import { NetworkNumber } from '../types/common';
|
|
4
|
-
|
|
5
|
-
export const multicall = async (calls: any[], web3: Web3, network: NetworkNumber = NetworkNumber.Eth, blockNumber: 'latest' | number = 'latest') => {
|
|
6
|
-
const multicallContract = UniMulticallContract(web3, network);
|
|
7
|
-
const formattedCalls = calls.map((call) => {
|
|
8
|
-
const callData = web3.eth.abi.encodeFunctionCall(call.abiItem, call.params);
|
|
9
|
-
return { callData, target: call.target || '0x0', gasLimit: call.gasLimit || 1200000 };
|
|
10
|
-
});
|
|
11
|
-
const callResult = await multicallContract.methods.multicall(formattedCalls.filter(item => item.target !== '0x0')).call({}, blockNumber);
|
|
12
|
-
|
|
13
|
-
let formattedResult: any[] = [];
|
|
14
|
-
|
|
15
|
-
callResult.returnData.forEach(([success, gasUsed, result], i) => {
|
|
16
|
-
const formattedRes = result !== '0x'
|
|
17
|
-
? web3.eth.abi.decodeParameters(calls[i].abiItem.outputs, result)
|
|
18
|
-
: undefined;
|
|
19
|
-
formattedResult = [...formattedResult, formattedRes];
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
return formattedResult;
|
|
1
|
+
import Web3 from 'web3';
|
|
2
|
+
import { UniMulticallContract } from '../contracts';
|
|
3
|
+
import { NetworkNumber } from '../types/common';
|
|
4
|
+
|
|
5
|
+
export const multicall = async (calls: any[], web3: Web3, network: NetworkNumber = NetworkNumber.Eth, blockNumber: 'latest' | number = 'latest') => {
|
|
6
|
+
const multicallContract = UniMulticallContract(web3, network);
|
|
7
|
+
const formattedCalls = calls.map((call) => {
|
|
8
|
+
const callData = web3.eth.abi.encodeFunctionCall(call.abiItem, call.params);
|
|
9
|
+
return { callData, target: call.target || '0x0', gasLimit: call.gasLimit || 1200000 };
|
|
10
|
+
});
|
|
11
|
+
const callResult = await multicallContract.methods.multicall(formattedCalls.filter(item => item.target !== '0x0')).call({}, blockNumber);
|
|
12
|
+
|
|
13
|
+
let formattedResult: any[] = [];
|
|
14
|
+
|
|
15
|
+
callResult.returnData.forEach(([success, gasUsed, result], i) => {
|
|
16
|
+
const formattedRes = result !== '0x'
|
|
17
|
+
? web3.eth.abi.decodeParameters(calls[i].abiItem.outputs, result)
|
|
18
|
+
: undefined;
|
|
19
|
+
formattedResult = [...formattedResult, formattedRes];
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
return formattedResult;
|
|
23
23
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import Dec from 'decimal.js';
|
|
2
|
-
import Web3 from 'web3';
|
|
3
|
-
import { NetworkNumber } from '../types/common';
|
|
4
|
-
import { SECONDS_PER_YEAR } from '../constants';
|
|
5
|
-
import { PotContract } from '../contracts';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export const getDsrApy = async (web3: Web3, network: NetworkNumber) => {
|
|
9
|
-
const potContract = PotContract(web3, network);
|
|
10
|
-
return new Dec(await potContract.methods.dsr().call())
|
|
11
|
-
.div(new Dec(1e27))
|
|
12
|
-
.pow(SECONDS_PER_YEAR)
|
|
13
|
-
.sub(1)
|
|
14
|
-
.mul(100)
|
|
15
|
-
.toString();
|
|
1
|
+
import Dec from 'decimal.js';
|
|
2
|
+
import Web3 from 'web3';
|
|
3
|
+
import { NetworkNumber } from '../types/common';
|
|
4
|
+
import { SECONDS_PER_YEAR } from '../constants';
|
|
5
|
+
import { PotContract } from '../contracts';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export const getDsrApy = async (web3: Web3, network: NetworkNumber) => {
|
|
9
|
+
const potContract = PotContract(web3, network);
|
|
10
|
+
return new Dec(await potContract.methods.dsr().call())
|
|
11
|
+
.div(new Dec(1e27))
|
|
12
|
+
.pow(SECONDS_PER_YEAR)
|
|
13
|
+
.sub(1)
|
|
14
|
+
.mul(100)
|
|
15
|
+
.toString();
|
|
16
16
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import Web3 from 'web3';
|
|
2
|
-
import Dec from 'decimal.js';
|
|
3
|
-
import { COMPPriceFeedContract, ETHPriceFeedContract, USDCPriceFeedContract } from '../contracts';
|
|
4
|
-
import { NetworkNumber } from '../types/common';
|
|
5
|
-
|
|
6
|
-
export const getEthPrice = async (web3: Web3) => {
|
|
7
|
-
const contract = ETHPriceFeedContract(web3, NetworkNumber.Eth);
|
|
8
|
-
const price = await contract.methods.latestAnswer().call();
|
|
9
|
-
return new Dec(price).div(1e8).toString();
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const getUSDCPrice = async (web3: Web3) => {
|
|
13
|
-
const contract = USDCPriceFeedContract(web3, NetworkNumber.Eth);
|
|
14
|
-
const price = await contract.methods.latestAnswer().call();
|
|
15
|
-
return new Dec(price).div(1e8).toString();
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const getCompPrice = async (web3: Web3) => {
|
|
19
|
-
const contract = COMPPriceFeedContract(web3, NetworkNumber.Eth);
|
|
20
|
-
const price = await contract.methods.latestAnswer().call();
|
|
21
|
-
return new Dec(price).div(1e8).toString();
|
|
1
|
+
import Web3 from 'web3';
|
|
2
|
+
import Dec from 'decimal.js';
|
|
3
|
+
import { COMPPriceFeedContract, ETHPriceFeedContract, USDCPriceFeedContract } from '../contracts';
|
|
4
|
+
import { NetworkNumber } from '../types/common';
|
|
5
|
+
|
|
6
|
+
export const getEthPrice = async (web3: Web3) => {
|
|
7
|
+
const contract = ETHPriceFeedContract(web3, NetworkNumber.Eth);
|
|
8
|
+
const price = await contract.methods.latestAnswer().call();
|
|
9
|
+
return new Dec(price).div(1e8).toString();
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const getUSDCPrice = async (web3: Web3) => {
|
|
13
|
+
const contract = USDCPriceFeedContract(web3, NetworkNumber.Eth);
|
|
14
|
+
const price = await contract.methods.latestAnswer().call();
|
|
15
|
+
return new Dec(price).div(1e8).toString();
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const getCompPrice = async (web3: Web3) => {
|
|
19
|
+
const contract = COMPPriceFeedContract(web3, NetworkNumber.Eth);
|
|
20
|
+
const price = await contract.methods.latestAnswer().call();
|
|
21
|
+
return new Dec(price).div(1e8).toString();
|
|
22
22
|
};
|
package/src/services/utils.ts
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import Dec from 'decimal.js';
|
|
2
|
-
import { getAssetInfo, getAssetInfoByAddress } from '@defisaver/tokens';
|
|
3
|
-
import { NetworkNumber } from '../types/common';
|
|
4
|
-
|
|
5
|
-
export const isLayer2Network = (networkId: NetworkNumber) => [10, 42161, 8453].includes(+networkId);
|
|
6
|
-
|
|
7
|
-
export const addToObjectIf = (condition: any, item: any) => (condition ? item : {});
|
|
8
|
-
|
|
9
|
-
export const ethToWeth = (maybeEth: any) => maybeEth?.replace(/^ETH$/, 'WETH');
|
|
10
|
-
|
|
11
|
-
export const wethToEth = (maybeWeth: any) => maybeWeth?.replace(/^WETH$/, 'ETH');
|
|
12
|
-
|
|
13
|
-
export const stEthToWstEth = (maybeStEth: any) => maybeStEth?.replace(/^stETH$/, 'wstETH');
|
|
14
|
-
|
|
15
|
-
export const wstEthToStEth = (maybeStEth: any) => maybeStEth?.replace(/^wstETH$/, 'stETH');
|
|
16
|
-
|
|
17
|
-
export const getAbiItem = (abi: any, methodName: string) => abi.find((i: any) => i.name === methodName);
|
|
18
|
-
|
|
19
|
-
export const ADDRESS_REGEX = /0x[0-9a-fA-F]{40}/;
|
|
20
|
-
export const isAddress = (address: string) => typeof address === 'string' && (new RegExp(ADDRESS_REGEX).test(address));
|
|
21
|
-
|
|
22
|
-
export const compareAddresses = (addr1 = '', addr2 = '') => addr1.toLowerCase() === addr2.toLowerCase();
|
|
23
|
-
|
|
24
|
-
export const getWeiAmountForDecimals = (amount: string | number, decimals: number) => new Dec(amount).mul(10 ** decimals).floor().toString();
|
|
25
|
-
|
|
26
|
-
export const getEthAmountForDecimals = (amount: string | number, decimals: string | number) => new Dec(amount).div(10 ** +decimals).toString();
|
|
27
|
-
|
|
28
|
-
export const handleWbtcLegacy = (asset: string) => (asset === 'WBTC Legacy' ? 'WBTC' : asset);
|
|
29
|
-
|
|
30
|
-
export const wethToEthByAddress = (maybeWethAddr: string, chainId = NetworkNumber.Eth) => getAssetInfo(wethToEth(getAssetInfoByAddress(maybeWethAddr, chainId).symbol), chainId).address;
|
|
31
|
-
|
|
32
|
-
export const ethToWethByAddress = (maybeEthAddr: string, chainId = NetworkNumber.Eth) => getAssetInfo(ethToWeth(getAssetInfoByAddress(maybeEthAddr, chainId).symbol), chainId).address;
|
|
33
|
-
|
|
34
|
-
export const bytesToString = (hex: string) => Buffer.from(hex.replace(/^0x/, ''), 'hex')
|
|
35
|
-
.toString()
|
|
36
|
-
// eslint-disable-next-line no-control-regex
|
|
37
|
-
.replace(/\x00/g, '');
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Map an input value from one range (minInput, maxInput) to a value in another range (minOutput, maxOutput)
|
|
41
|
-
*/
|
|
42
|
-
export const mapRange = (input: number | string, minInput: number | string, maxInput: number | string, minOutput:number | string, maxOutput: number | string) => {
|
|
43
|
-
// slope = 1.0 * (output_end - output_start) / (input_end - input_start)
|
|
44
|
-
const inputDiff = new Dec(maxInput).minus(minInput);
|
|
45
|
-
const outputDiff = new Dec(maxOutput).minus(minOutput);
|
|
46
|
-
const slope = new Dec(outputDiff).div(inputDiff);
|
|
47
|
-
|
|
48
|
-
// output = output_start + slope * (input - input_start)
|
|
49
|
-
return new Dec(minOutput).plus(new Dec(slope).mul(new Dec(input).minus(minInput))).toDP(2).toNumber();
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
// eslint-disable-next-line no-bitwise
|
|
53
|
-
export const isEnabledOnBitmap = (bitmap: number, assetId: number) => (BigInt(bitmap) >> BigInt(assetId)) & BigInt(1);
|
|
54
|
-
|
|
1
|
+
import Dec from 'decimal.js';
|
|
2
|
+
import { getAssetInfo, getAssetInfoByAddress } from '@defisaver/tokens';
|
|
3
|
+
import { NetworkNumber } from '../types/common';
|
|
4
|
+
|
|
5
|
+
export const isLayer2Network = (networkId: NetworkNumber) => [10, 42161, 8453].includes(+networkId);
|
|
6
|
+
|
|
7
|
+
export const addToObjectIf = (condition: any, item: any) => (condition ? item : {});
|
|
8
|
+
|
|
9
|
+
export const ethToWeth = (maybeEth: any) => maybeEth?.replace(/^ETH$/, 'WETH');
|
|
10
|
+
|
|
11
|
+
export const wethToEth = (maybeWeth: any) => maybeWeth?.replace(/^WETH$/, 'ETH');
|
|
12
|
+
|
|
13
|
+
export const stEthToWstEth = (maybeStEth: any) => maybeStEth?.replace(/^stETH$/, 'wstETH');
|
|
14
|
+
|
|
15
|
+
export const wstEthToStEth = (maybeStEth: any) => maybeStEth?.replace(/^wstETH$/, 'stETH');
|
|
16
|
+
|
|
17
|
+
export const getAbiItem = (abi: any, methodName: string) => abi.find((i: any) => i.name === methodName);
|
|
18
|
+
|
|
19
|
+
export const ADDRESS_REGEX = /0x[0-9a-fA-F]{40}/;
|
|
20
|
+
export const isAddress = (address: string) => typeof address === 'string' && (new RegExp(ADDRESS_REGEX).test(address));
|
|
21
|
+
|
|
22
|
+
export const compareAddresses = (addr1 = '', addr2 = '') => addr1.toLowerCase() === addr2.toLowerCase();
|
|
23
|
+
|
|
24
|
+
export const getWeiAmountForDecimals = (amount: string | number, decimals: number) => new Dec(amount).mul(10 ** decimals).floor().toString();
|
|
25
|
+
|
|
26
|
+
export const getEthAmountForDecimals = (amount: string | number, decimals: string | number) => new Dec(amount).div(10 ** +decimals).toString();
|
|
27
|
+
|
|
28
|
+
export const handleWbtcLegacy = (asset: string) => (asset === 'WBTC Legacy' ? 'WBTC' : asset);
|
|
29
|
+
|
|
30
|
+
export const wethToEthByAddress = (maybeWethAddr: string, chainId = NetworkNumber.Eth) => getAssetInfo(wethToEth(getAssetInfoByAddress(maybeWethAddr, chainId).symbol), chainId).address;
|
|
31
|
+
|
|
32
|
+
export const ethToWethByAddress = (maybeEthAddr: string, chainId = NetworkNumber.Eth) => getAssetInfo(ethToWeth(getAssetInfoByAddress(maybeEthAddr, chainId).symbol), chainId).address;
|
|
33
|
+
|
|
34
|
+
export const bytesToString = (hex: string) => Buffer.from(hex.replace(/^0x/, ''), 'hex')
|
|
35
|
+
.toString()
|
|
36
|
+
// eslint-disable-next-line no-control-regex
|
|
37
|
+
.replace(/\x00/g, '');
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Map an input value from one range (minInput, maxInput) to a value in another range (minOutput, maxOutput)
|
|
41
|
+
*/
|
|
42
|
+
export const mapRange = (input: number | string, minInput: number | string, maxInput: number | string, minOutput:number | string, maxOutput: number | string) => {
|
|
43
|
+
// slope = 1.0 * (output_end - output_start) / (input_end - input_start)
|
|
44
|
+
const inputDiff = new Dec(maxInput).minus(minInput);
|
|
45
|
+
const outputDiff = new Dec(maxOutput).minus(minOutput);
|
|
46
|
+
const slope = new Dec(outputDiff).div(inputDiff);
|
|
47
|
+
|
|
48
|
+
// output = output_start + slope * (input - input_start)
|
|
49
|
+
return new Dec(minOutput).plus(new Dec(slope).mul(new Dec(input).minus(minInput))).toDP(2).toNumber();
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// eslint-disable-next-line no-bitwise
|
|
53
|
+
export const isEnabledOnBitmap = (bitmap: number, assetId: number) => (BigInt(bitmap) >> BigInt(assetId)) & BigInt(1);
|
|
54
|
+
|
package/src/setup.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import Decimal from 'decimal.js';
|
|
2
|
-
|
|
3
|
-
Decimal.set({
|
|
4
|
-
rounding: Decimal.ROUND_DOWN,
|
|
5
|
-
toExpPos: 9e15,
|
|
6
|
-
toExpNeg: -9e15,
|
|
7
|
-
precision: 50,
|
|
8
|
-
});
|
|
1
|
+
import Decimal from 'decimal.js';
|
|
2
|
+
|
|
3
|
+
Decimal.set({
|
|
4
|
+
rounding: Decimal.ROUND_DOWN,
|
|
5
|
+
toExpPos: 9e15,
|
|
6
|
+
toExpNeg: -9e15,
|
|
7
|
+
precision: 50,
|
|
8
|
+
});
|