@stas-b-woof/compound-react 0.0.2 → 1.0.0
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 +4 -2
- package/dist/cjs/_main_.d.ts +7 -0
- package/dist/cjs/_main_.js +106 -0
- package/dist/{src → cjs}/actions/useActionBuilder.d.ts +0 -1
- package/dist/cjs/actions/useActionBuilder.js +14 -0
- package/dist/{src → cjs}/actions/useActionsBuilder.d.ts +0 -1
- package/dist/cjs/actions/useActionsBuilder.js +14 -0
- package/dist/{src → cjs}/actions/useBorrow.d.ts +0 -1
- package/dist/cjs/actions/useBorrow.js +17 -0
- package/dist/{src → cjs}/actions/usePermitsBuilder.d.ts +0 -1
- package/dist/cjs/actions/usePermitsBuilder.js +14 -0
- package/dist/cjs/actions/usePopulatePermit.d.ts +8 -0
- package/dist/cjs/actions/usePopulatePermit.js +19 -0
- package/dist/{src → cjs}/actions/useRepay.d.ts +0 -1
- package/dist/cjs/actions/useRepay.js +17 -0
- package/dist/{src → cjs}/actions/useSupply.d.ts +0 -1
- package/dist/cjs/actions/useSupply.js +17 -0
- package/dist/{src → cjs}/actions/useWithdraw.d.ts +0 -1
- package/dist/cjs/actions/useWithdraw.js +17 -0
- package/dist/{src → cjs}/actions.d.ts +1 -2
- package/dist/cjs/actions.js +19 -0
- package/dist/cjs/execution/usePopulateTransaction.d.ts +8 -0
- package/dist/cjs/execution/usePopulateTransaction.js +19 -0
- package/dist/cjs/execution/useSendTransaction.d.ts +7 -0
- package/dist/cjs/execution/useSendTransaction.js +17 -0
- package/dist/cjs/execution/useWaitForTransaction.d.ts +5 -0
- package/dist/cjs/execution/useWaitForTransaction.js +17 -0
- package/dist/cjs/execution.d.ts +3 -0
- package/dist/cjs/execution.js +9 -0
- package/dist/{src → cjs}/fetchers/useAccountBasics.d.ts +1 -2
- package/dist/cjs/fetchers/useAccountBasics.js +38 -0
- package/dist/{src → cjs}/fetchers/useAccountCollateralBalance.d.ts +1 -2
- package/dist/cjs/fetchers/useAccountCollateralBalance.js +42 -0
- package/dist/{src → cjs}/fetchers/useAccountLiquidatable.d.ts +1 -2
- package/dist/cjs/fetchers/useAccountLiquidatable.js +35 -0
- package/dist/{src → cjs}/fetchers/useAccountSupplyBalance.d.ts +1 -2
- package/dist/cjs/fetchers/useAccountSupplyBalance.js +38 -0
- package/dist/{src → cjs}/fetchers/useAssetInfo.d.ts +3 -4
- package/dist/cjs/fetchers/useAssetInfo.js +38 -0
- package/dist/{src → cjs}/fetchers/useAssetInfoByAddress.d.ts +1 -2
- package/dist/cjs/fetchers/useAssetInfoByAddress.js +38 -0
- package/dist/{src → cjs}/fetchers/useAssetSupport.d.ts +3 -4
- package/dist/cjs/fetchers/useAssetSupport.js +38 -0
- package/dist/{src → cjs}/fetchers/useBaseAssetReserves.d.ts +1 -2
- package/dist/cjs/fetchers/useBaseAssetReserves.js +34 -0
- package/dist/{src → cjs}/fetchers/useBaseTokenAddress.d.ts +1 -2
- package/dist/cjs/fetchers/useBaseTokenAddress.js +34 -0
- package/dist/{src → cjs}/fetchers/useBaseTokenPriceFeedAddress.d.ts +1 -2
- package/dist/cjs/fetchers/useBaseTokenPriceFeedAddress.js +34 -0
- package/dist/{src → cjs}/fetchers/useBorrowBalance.d.ts +1 -2
- package/dist/cjs/fetchers/useBorrowBalance.js +38 -0
- package/dist/{src → cjs}/fetchers/useBorrowKink.d.ts +1 -2
- package/dist/cjs/fetchers/useBorrowKink.js +34 -0
- package/dist/{src → cjs}/fetchers/useBorrowPerSecondInterestRateBase.d.ts +1 -2
- package/dist/cjs/fetchers/useBorrowPerSecondInterestRateBase.js +34 -0
- package/dist/{src → cjs}/fetchers/useBorrowPerSecondInterestRateSlopeHigh.d.ts +1 -2
- package/dist/cjs/fetchers/useBorrowPerSecondInterestRateSlopeHigh.js +34 -0
- package/dist/{src → cjs}/fetchers/useBorrowPerSecondInterestRateSlopeLow.d.ts +1 -2
- package/dist/cjs/fetchers/useBorrowPerSecondInterestRateSlopeLow.js +34 -0
- package/dist/{src → cjs}/fetchers/useBorrowRate.d.ts +4 -4
- package/dist/cjs/fetchers/useBorrowRate.js +39 -0
- package/dist/{src → cjs}/fetchers/useCollateralQuote.d.ts +4 -5
- package/dist/cjs/fetchers/useCollateralQuote.js +42 -0
- package/dist/{src → cjs}/fetchers/useCollateralReserves.d.ts +1 -2
- package/dist/cjs/fetchers/useCollateralReserves.js +38 -0
- package/dist/{src → cjs}/fetchers/useCollateralSupply.d.ts +1 -2
- package/dist/cjs/fetchers/useCollateralSupply.js +38 -0
- package/dist/{src → cjs}/fetchers/useCollateralsCount.d.ts +1 -2
- package/dist/cjs/fetchers/useCollateralsCount.js +34 -0
- package/dist/{src → cjs}/fetchers/useCometDecimals.d.ts +1 -2
- package/dist/cjs/fetchers/useCometDecimals.js +34 -0
- package/dist/{src → cjs}/fetchers/useFetchers.d.ts +26 -59
- package/dist/cjs/fetchers/useFetchers.js +15 -0
- package/dist/{src → cjs}/fetchers/useLiquidatorPoints.d.ts +1 -2
- package/dist/cjs/fetchers/useLiquidatorPoints.js +38 -0
- package/dist/{src → cjs}/fetchers/useManagerAllowed.d.ts +1 -2
- package/dist/cjs/fetchers/useManagerAllowed.js +42 -0
- package/dist/{src → cjs}/fetchers/useMarket.d.ts +5 -4
- package/dist/cjs/fetchers/useMarket.js +40 -0
- package/dist/{src → cjs}/fetchers/useMarketName.d.ts +1 -2
- package/dist/cjs/fetchers/useMarketName.js +34 -0
- package/dist/{src → cjs}/fetchers/useMarketSymbol.d.ts +1 -2
- package/dist/cjs/fetchers/useMarketSymbol.js +34 -0
- package/dist/{src → cjs}/fetchers/useMarketVersion.d.ts +1 -2
- package/dist/cjs/fetchers/useMarketVersion.js +34 -0
- package/dist/{src → cjs}/fetchers/useMinimalLoanAmount.d.ts +1 -2
- package/dist/cjs/fetchers/useMinimalLoanAmount.js +34 -0
- package/dist/{src → cjs}/fetchers/useSupplyKink.d.ts +1 -2
- package/dist/cjs/fetchers/useSupplyKink.js +34 -0
- package/dist/{src → cjs}/fetchers/useSupplyPerSecondInterestRateBase.d.ts +1 -2
- package/dist/cjs/fetchers/useSupplyPerSecondInterestRateBase.js +34 -0
- package/dist/{src → cjs}/fetchers/useSupplyPerSecondInterestRateSlopeHigh.d.ts +1 -2
- package/dist/cjs/fetchers/useSupplyPerSecondInterestRateSlopeHigh.js +34 -0
- package/dist/{src → cjs}/fetchers/useSupplyPerSecondInterestRateSlopeLow.d.ts +1 -2
- package/dist/cjs/fetchers/useSupplyPerSecondInterestRateSlopeLow.js +34 -0
- package/dist/{src → cjs}/fetchers/useSupplyRate.d.ts +4 -5
- package/dist/cjs/fetchers/useSupplyRate.js +38 -0
- package/dist/{src → cjs}/fetchers/useTotalBorrow.d.ts +1 -2
- package/dist/cjs/fetchers/useTotalBorrow.js +34 -0
- package/dist/{src → cjs}/fetchers/useTotalSupply.d.ts +1 -2
- package/dist/cjs/fetchers/useTotalSupply.js +34 -0
- package/dist/{src → cjs}/fetchers/useTotalsBasic.d.ts +1 -2
- package/dist/cjs/fetchers/useTotalsBasic.js +34 -0
- package/dist/{src → cjs}/fetchers/useUserNonce.d.ts +1 -2
- package/dist/cjs/fetchers/useUserNonce.js +38 -0
- package/dist/{src → cjs}/fetchers/useUtilization.d.ts +1 -2
- package/dist/cjs/fetchers/useUtilization.js +34 -0
- package/dist/{src → cjs}/fetchers.d.ts +0 -7
- package/dist/cjs/fetchers.js +120 -0
- package/dist/{src → cjs}/injection.d.ts +0 -1
- package/dist/cjs/injection.js +16 -0
- package/dist/cjs/package.json +1 -0
- package/dist/{src → cjs}/useCompound.d.ts +2 -3
- package/dist/cjs/useCompound.js +26 -0
- package/dist/{src → cjs}/utils.d.ts +0 -1
- package/dist/cjs/utils.js +41 -0
- package/dist/{src → cjs}/validation/useValidation.d.ts +1 -2
- package/dist/cjs/validation/useValidation.js +50 -0
- package/dist/{src → cjs}/validation.d.ts +0 -1
- package/dist/cjs/validation.js +6 -0
- package/dist/esm/_main_.d.ts +7 -0
- package/dist/esm/_main_.js +7 -0
- package/dist/esm/actions/useActionBuilder.d.ts +5 -0
- package/dist/{src → esm}/actions/useActionBuilder.js +0 -1
- package/dist/esm/actions/useActionsBuilder.d.ts +5 -0
- package/dist/{src → esm}/actions/useActionsBuilder.js +0 -1
- package/dist/esm/actions/useBorrow.d.ts +5 -0
- package/dist/{src → esm}/actions/useBorrow.js +0 -1
- package/dist/esm/actions/usePermitsBuilder.d.ts +5 -0
- package/dist/{src → esm}/actions/usePermitsBuilder.js +0 -1
- package/dist/esm/actions/usePopulatePermit.d.ts +8 -0
- package/dist/{src/actions/useEarn.js → esm/actions/usePopulatePermit.js} +6 -5
- package/dist/esm/actions/useRepay.d.ts +5 -0
- package/dist/{src → esm}/actions/useRepay.js +0 -1
- package/dist/esm/actions/useSupply.d.ts +5 -0
- package/dist/{src → esm}/actions/useSupply.js +0 -1
- package/dist/esm/actions/useWithdraw.d.ts +5 -0
- package/dist/{src → esm}/actions/useWithdraw.js +0 -1
- package/dist/esm/actions.d.ts +8 -0
- package/dist/{src → esm}/actions.js +1 -2
- package/dist/esm/execution/usePopulateTransaction.d.ts +8 -0
- package/dist/esm/execution/usePopulateTransaction.js +16 -0
- package/dist/esm/execution/useSendTransaction.d.ts +7 -0
- package/dist/{src → esm}/execution/useSendTransaction.js +0 -1
- package/dist/esm/execution/useWaitForTransaction.d.ts +5 -0
- package/dist/esm/execution/useWaitForTransaction.js +14 -0
- package/dist/esm/execution.d.ts +3 -0
- package/dist/esm/execution.js +3 -0
- package/dist/esm/fetchers/useAccountBasics.d.ts +14 -0
- package/dist/{src → esm}/fetchers/useAccountBasics.js +1 -1
- package/dist/esm/fetchers/useAccountCollateralBalance.d.ts +16 -0
- package/dist/{src → esm}/fetchers/useAccountCollateralBalance.js +1 -1
- package/dist/esm/fetchers/useAccountLiquidatable.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useAccountLiquidatable.js +1 -1
- package/dist/esm/fetchers/useAccountSupplyBalance.d.ts +14 -0
- package/dist/{src → esm}/fetchers/useAccountSupplyBalance.js +1 -1
- package/dist/esm/fetchers/useAssetInfo.d.ts +14 -0
- package/dist/{src → esm}/fetchers/useAssetInfo.js +3 -3
- package/dist/esm/fetchers/useAssetInfoByAddress.d.ts +14 -0
- package/dist/{src → esm}/fetchers/useAssetInfoByAddress.js +1 -1
- package/dist/esm/fetchers/useAssetSupport.d.ts +14 -0
- package/dist/{src → esm}/fetchers/useAssetSupport.js +3 -3
- package/dist/esm/fetchers/useBaseAssetReserves.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useBaseAssetReserves.js +1 -1
- package/dist/esm/fetchers/useBaseTokenAddress.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useBaseTokenAddress.js +1 -1
- package/dist/esm/fetchers/useBaseTokenPriceFeedAddress.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useBaseTokenPriceFeedAddress.js +1 -1
- package/dist/esm/fetchers/useBorrowBalance.d.ts +14 -0
- package/dist/{src → esm}/fetchers/useBorrowBalance.js +1 -1
- package/dist/esm/fetchers/useBorrowKink.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useBorrowKink.js +1 -1
- package/dist/esm/fetchers/useBorrowPerSecondInterestRateBase.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useBorrowPerSecondInterestRateBase.js +1 -1
- package/dist/esm/fetchers/useBorrowPerSecondInterestRateSlopeHigh.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useBorrowPerSecondInterestRateSlopeHigh.js +1 -1
- package/dist/esm/fetchers/useBorrowPerSecondInterestRateSlopeLow.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useBorrowPerSecondInterestRateSlopeLow.js +1 -1
- package/dist/esm/fetchers/useBorrowRate.d.ts +15 -0
- package/dist/{src → esm}/fetchers/useBorrowRate.js +3 -2
- package/dist/esm/fetchers/useCollateralQuote.d.ts +16 -0
- package/dist/{src → esm}/fetchers/useCollateralQuote.js +1 -1
- package/dist/esm/fetchers/useCollateralReserves.d.ts +14 -0
- package/dist/{src → esm}/fetchers/useCollateralReserves.js +1 -1
- package/dist/esm/fetchers/useCollateralSupply.d.ts +14 -0
- package/dist/{src → esm}/fetchers/useCollateralSupply.js +1 -1
- package/dist/esm/fetchers/useCollateralsCount.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useCollateralsCount.js +1 -1
- package/dist/esm/fetchers/useCometDecimals.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useCometDecimals.js +1 -1
- package/dist/esm/fetchers/useFetchers.d.ts +41 -0
- package/dist/{src → esm}/fetchers/useFetchers.js +0 -1
- package/dist/esm/fetchers/useLiquidatorPoints.d.ts +14 -0
- package/dist/{src → esm}/fetchers/useLiquidatorPoints.js +1 -1
- package/dist/esm/fetchers/useManagerAllowed.d.ts +16 -0
- package/dist/{src → esm}/fetchers/useManagerAllowed.js +1 -1
- package/dist/esm/fetchers/useMarket.d.ts +16 -0
- package/dist/{src → esm}/fetchers/useMarket.js +10 -3
- package/dist/esm/fetchers/useMarketName.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useMarketName.js +1 -1
- package/dist/esm/fetchers/useMarketSymbol.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useMarketSymbol.js +1 -1
- package/dist/esm/fetchers/useMarketVersion.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useMarketVersion.js +1 -1
- package/dist/esm/fetchers/useMinimalLoanAmount.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useMinimalLoanAmount.js +1 -1
- package/dist/esm/fetchers/useSupplyKink.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useSupplyKink.js +1 -1
- package/dist/esm/fetchers/useSupplyPerSecondInterestRateBase.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useSupplyPerSecondInterestRateBase.js +1 -1
- package/dist/esm/fetchers/useSupplyPerSecondInterestRateSlopeHigh.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useSupplyPerSecondInterestRateSlopeHigh.js +1 -1
- package/dist/esm/fetchers/useSupplyPerSecondInterestRateSlopeLow.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useSupplyPerSecondInterestRateSlopeLow.js +1 -1
- package/dist/esm/fetchers/useSupplyRate.d.ts +14 -0
- package/dist/{src → esm}/fetchers/useSupplyRate.js +2 -2
- package/dist/esm/fetchers/useTotalBorrow.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useTotalBorrow.js +1 -1
- package/dist/esm/fetchers/useTotalSupply.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useTotalSupply.js +1 -1
- package/dist/esm/fetchers/useTotalsBasic.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useTotalsBasic.js +1 -1
- package/dist/esm/fetchers/useUserNonce.d.ts +14 -0
- package/dist/{src → esm}/fetchers/useUserNonce.js +1 -1
- package/dist/esm/fetchers/useUtilization.d.ts +12 -0
- package/dist/{src → esm}/fetchers/useUtilization.js +1 -1
- package/dist/esm/fetchers.d.ts +39 -0
- package/dist/{src → esm}/fetchers.js +0 -7
- package/dist/esm/injection.d.ts +11 -0
- package/dist/{src → esm}/injection.js +0 -1
- package/dist/esm/useCompound.d.ts +11 -0
- package/dist/{src → esm}/useCompound.js +2 -3
- package/dist/esm/utils.d.ts +2 -0
- package/dist/{src → esm}/utils.js +0 -5
- package/dist/esm/validation/useValidation.d.ts +15 -0
- package/dist/{src → esm}/validation/useValidation.js +1 -1
- package/dist/esm/validation.d.ts +1 -0
- package/dist/{src → esm}/validation.js +0 -1
- package/package.json +28 -9
- package/dist/src/_main_.d.ts +0 -8
- package/dist/src/_main_.d.ts.map +0 -1
- package/dist/src/_main_.js +0 -8
- package/dist/src/_main_.js.map +0 -1
- package/dist/src/actions/useActionBuilder.d.ts.map +0 -1
- package/dist/src/actions/useActionBuilder.js.map +0 -1
- package/dist/src/actions/useActionsBuilder.d.ts.map +0 -1
- package/dist/src/actions/useActionsBuilder.js.map +0 -1
- package/dist/src/actions/useBorrow.d.ts.map +0 -1
- package/dist/src/actions/useBorrow.js.map +0 -1
- package/dist/src/actions/useEarn.d.ts +0 -6
- package/dist/src/actions/useEarn.d.ts.map +0 -1
- package/dist/src/actions/useEarn.js.map +0 -1
- package/dist/src/actions/usePermitsBuilder.d.ts.map +0 -1
- package/dist/src/actions/usePermitsBuilder.js.map +0 -1
- package/dist/src/actions/useRepay.d.ts.map +0 -1
- package/dist/src/actions/useRepay.js.map +0 -1
- package/dist/src/actions/useSupply.d.ts.map +0 -1
- package/dist/src/actions/useSupply.js.map +0 -1
- package/dist/src/actions/useWithdraw.d.ts.map +0 -1
- package/dist/src/actions/useWithdraw.js.map +0 -1
- package/dist/src/actions.d.ts.map +0 -1
- package/dist/src/actions.js.map +0 -1
- package/dist/src/execution/useSendTransaction.d.ts +0 -7
- package/dist/src/execution/useSendTransaction.d.ts.map +0 -1
- package/dist/src/execution/useSendTransaction.js.map +0 -1
- package/dist/src/execution.d.ts +0 -2
- package/dist/src/execution.d.ts.map +0 -1
- package/dist/src/execution.js +0 -2
- package/dist/src/execution.js.map +0 -1
- package/dist/src/fetchers/useAccountBasics.d.ts.map +0 -1
- package/dist/src/fetchers/useAccountBasics.js.map +0 -1
- package/dist/src/fetchers/useAccountCollateralBalance.d.ts.map +0 -1
- package/dist/src/fetchers/useAccountCollateralBalance.js.map +0 -1
- package/dist/src/fetchers/useAccountLiquidatable.d.ts.map +0 -1
- package/dist/src/fetchers/useAccountLiquidatable.js.map +0 -1
- package/dist/src/fetchers/useAccountSupplyBalance.d.ts.map +0 -1
- package/dist/src/fetchers/useAccountSupplyBalance.js.map +0 -1
- package/dist/src/fetchers/useAssetInfo.d.ts.map +0 -1
- package/dist/src/fetchers/useAssetInfo.js.map +0 -1
- package/dist/src/fetchers/useAssetInfoByAddress.d.ts.map +0 -1
- package/dist/src/fetchers/useAssetInfoByAddress.js.map +0 -1
- package/dist/src/fetchers/useAssetSupport.d.ts.map +0 -1
- package/dist/src/fetchers/useAssetSupport.js.map +0 -1
- package/dist/src/fetchers/useBaseAssetReserves.d.ts.map +0 -1
- package/dist/src/fetchers/useBaseAssetReserves.js.map +0 -1
- package/dist/src/fetchers/useBaseTokenAddress.d.ts.map +0 -1
- package/dist/src/fetchers/useBaseTokenAddress.js.map +0 -1
- package/dist/src/fetchers/useBaseTokenPriceFeedAddress.d.ts.map +0 -1
- package/dist/src/fetchers/useBaseTokenPriceFeedAddress.js.map +0 -1
- package/dist/src/fetchers/useBaseTrackingBorrowSpeed.d.ts +0 -13
- package/dist/src/fetchers/useBaseTrackingBorrowSpeed.d.ts.map +0 -1
- package/dist/src/fetchers/useBaseTrackingBorrowSpeed.js +0 -30
- package/dist/src/fetchers/useBaseTrackingBorrowSpeed.js.map +0 -1
- package/dist/src/fetchers/useBaseTrackingSupplySpeed.d.ts +0 -13
- package/dist/src/fetchers/useBaseTrackingSupplySpeed.d.ts.map +0 -1
- package/dist/src/fetchers/useBaseTrackingSupplySpeed.js +0 -30
- package/dist/src/fetchers/useBaseTrackingSupplySpeed.js.map +0 -1
- package/dist/src/fetchers/useBorrowBalance.d.ts.map +0 -1
- package/dist/src/fetchers/useBorrowBalance.js.map +0 -1
- package/dist/src/fetchers/useBorrowKink.d.ts.map +0 -1
- package/dist/src/fetchers/useBorrowKink.js.map +0 -1
- package/dist/src/fetchers/useBorrowPerSecondInterestRateBase.d.ts.map +0 -1
- package/dist/src/fetchers/useBorrowPerSecondInterestRateBase.js.map +0 -1
- package/dist/src/fetchers/useBorrowPerSecondInterestRateSlopeHigh.d.ts.map +0 -1
- package/dist/src/fetchers/useBorrowPerSecondInterestRateSlopeHigh.js.map +0 -1
- package/dist/src/fetchers/useBorrowPerSecondInterestRateSlopeLow.d.ts.map +0 -1
- package/dist/src/fetchers/useBorrowPerSecondInterestRateSlopeLow.js.map +0 -1
- package/dist/src/fetchers/useBorrowRate.d.ts.map +0 -1
- package/dist/src/fetchers/useBorrowRate.js.map +0 -1
- package/dist/src/fetchers/useCollateralQuote.d.ts.map +0 -1
- package/dist/src/fetchers/useCollateralQuote.js.map +0 -1
- package/dist/src/fetchers/useCollateralReserves.d.ts.map +0 -1
- package/dist/src/fetchers/useCollateralReserves.js.map +0 -1
- package/dist/src/fetchers/useCollateralSupply.d.ts.map +0 -1
- package/dist/src/fetchers/useCollateralSupply.js.map +0 -1
- package/dist/src/fetchers/useCollateralsCount.d.ts.map +0 -1
- package/dist/src/fetchers/useCollateralsCount.js.map +0 -1
- package/dist/src/fetchers/useCometDecimals.d.ts.map +0 -1
- package/dist/src/fetchers/useCometDecimals.js.map +0 -1
- package/dist/src/fetchers/useFetchers.d.ts.map +0 -1
- package/dist/src/fetchers/useFetchers.js.map +0 -1
- package/dist/src/fetchers/useLiquidatorPoints.d.ts.map +0 -1
- package/dist/src/fetchers/useLiquidatorPoints.js.map +0 -1
- package/dist/src/fetchers/useManagerAllowed.d.ts.map +0 -1
- package/dist/src/fetchers/useManagerAllowed.js.map +0 -1
- package/dist/src/fetchers/useMarket.d.ts.map +0 -1
- package/dist/src/fetchers/useMarket.js.map +0 -1
- package/dist/src/fetchers/useMarketName.d.ts.map +0 -1
- package/dist/src/fetchers/useMarketName.js.map +0 -1
- package/dist/src/fetchers/useMarketSymbol.d.ts.map +0 -1
- package/dist/src/fetchers/useMarketSymbol.js.map +0 -1
- package/dist/src/fetchers/useMarketVersion.d.ts.map +0 -1
- package/dist/src/fetchers/useMarketVersion.js.map +0 -1
- package/dist/src/fetchers/useMinimalLoanAmount.d.ts.map +0 -1
- package/dist/src/fetchers/useMinimalLoanAmount.js.map +0 -1
- package/dist/src/fetchers/usePosition.d.ts +0 -17
- package/dist/src/fetchers/usePosition.d.ts.map +0 -1
- package/dist/src/fetchers/usePosition.js +0 -32
- package/dist/src/fetchers/usePosition.js.map +0 -1
- package/dist/src/fetchers/useRewardAccrued.d.ts +0 -15
- package/dist/src/fetchers/useRewardAccrued.d.ts.map +0 -1
- package/dist/src/fetchers/useRewardAccrued.js +0 -34
- package/dist/src/fetchers/useRewardAccrued.js.map +0 -1
- package/dist/src/fetchers/useRewardOwed.d.ts +0 -17
- package/dist/src/fetchers/useRewardOwed.d.ts.map +0 -1
- package/dist/src/fetchers/useRewardOwed.js +0 -38
- package/dist/src/fetchers/useRewardOwed.js.map +0 -1
- package/dist/src/fetchers/useSupplyKink.d.ts.map +0 -1
- package/dist/src/fetchers/useSupplyKink.js.map +0 -1
- package/dist/src/fetchers/useSupplyPerSecondInterestRateBase.d.ts.map +0 -1
- package/dist/src/fetchers/useSupplyPerSecondInterestRateBase.js.map +0 -1
- package/dist/src/fetchers/useSupplyPerSecondInterestRateSlopeHigh.d.ts.map +0 -1
- package/dist/src/fetchers/useSupplyPerSecondInterestRateSlopeHigh.js.map +0 -1
- package/dist/src/fetchers/useSupplyPerSecondInterestRateSlopeLow.d.ts.map +0 -1
- package/dist/src/fetchers/useSupplyPerSecondInterestRateSlopeLow.js.map +0 -1
- package/dist/src/fetchers/useSupplyRate.d.ts.map +0 -1
- package/dist/src/fetchers/useSupplyRate.js.map +0 -1
- package/dist/src/fetchers/useTotalBorrow.d.ts.map +0 -1
- package/dist/src/fetchers/useTotalBorrow.js.map +0 -1
- package/dist/src/fetchers/useTotalSupply.d.ts.map +0 -1
- package/dist/src/fetchers/useTotalSupply.js.map +0 -1
- package/dist/src/fetchers/useTotalsBasic.d.ts.map +0 -1
- package/dist/src/fetchers/useTotalsBasic.js.map +0 -1
- package/dist/src/fetchers/useTrackingIndexScale.d.ts +0 -13
- package/dist/src/fetchers/useTrackingIndexScale.d.ts.map +0 -1
- package/dist/src/fetchers/useTrackingIndexScale.js +0 -30
- package/dist/src/fetchers/useTrackingIndexScale.js.map +0 -1
- package/dist/src/fetchers/useUserNonce.d.ts.map +0 -1
- package/dist/src/fetchers/useUserNonce.js.map +0 -1
- package/dist/src/fetchers/useUtilization.d.ts.map +0 -1
- package/dist/src/fetchers/useUtilization.js.map +0 -1
- package/dist/src/fetchers.d.ts.map +0 -1
- package/dist/src/fetchers.js.map +0 -1
- package/dist/src/injection.d.ts.map +0 -1
- package/dist/src/injection.js.map +0 -1
- package/dist/src/useCompound.d.ts.map +0 -1
- package/dist/src/useCompound.js.map +0 -1
- package/dist/src/utils.d.ts.map +0 -1
- package/dist/src/utils.js.map +0 -1
- package/dist/src/validation/useValidation.d.ts.map +0 -1
- package/dist/src/validation/useValidation.js.map +0 -1
- package/dist/src/validation.d.ts.map +0 -1
- package/dist/src/validation.js.map +0 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toBorrowPerSecondInterestRateSlopeLowQueryKey = toBorrowPerSecondInterestRateSlopeLowQueryKey;
|
|
4
|
+
exports.useBorrowPerSecondInterestRateSlopeLow = useBorrowPerSecondInterestRateSlopeLow;
|
|
5
|
+
const useCompound_js_1 = require("../useCompound.js");
|
|
6
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
7
|
+
const compound_1 = require("@stas-b-woof/compound");
|
|
8
|
+
function toBorrowPerSecondInterestRateSlopeLowQueryKey(args) {
|
|
9
|
+
const { market, block } = args;
|
|
10
|
+
return [
|
|
11
|
+
'useBorrowPerSecondInterestRateSlopeLow',
|
|
12
|
+
`${market ?? 'market'}`,
|
|
13
|
+
`${block ?? 'block'}`,
|
|
14
|
+
];
|
|
15
|
+
}
|
|
16
|
+
function useBorrowPerSecondInterestRateSlopeLow(args) {
|
|
17
|
+
const { market, block } = args ?? {};
|
|
18
|
+
const { client } = (0, useCompound_js_1.useCompound)();
|
|
19
|
+
return (0, react_query_1.useQuery)({
|
|
20
|
+
queryKey: toBorrowPerSecondInterestRateSlopeLowQueryKey({
|
|
21
|
+
market: market,
|
|
22
|
+
...(block !== undefined ? { block } : {}),
|
|
23
|
+
}),
|
|
24
|
+
queryFn: () => {
|
|
25
|
+
(0, compound_1.asserts)(market, 'Market address must be defined');
|
|
26
|
+
return (0, compound_1.getBorrowPerSecondInterestRateSlopeLow)({
|
|
27
|
+
client: client,
|
|
28
|
+
market: market,
|
|
29
|
+
...(block !== undefined ? { block } : {}),
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
enabled: market !== undefined,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
+
import { BigDecimal } from "@stas-b-woof/compound/utils";
|
|
2
3
|
import { type Address, type Optional, type Block, getBorrowRate } from "@stas-b-woof/compound";
|
|
3
4
|
export type ToBorrowRateQueryKeyArgs = {
|
|
4
5
|
market?: Optional<Address>;
|
|
5
|
-
utilization?: Optional<
|
|
6
|
+
utilization?: Optional<BigDecimal>;
|
|
6
7
|
block?: Optional<Block>;
|
|
7
8
|
};
|
|
8
|
-
export declare function toBorrowRateQueryKey(args: ToBorrowRateQueryKeyArgs): readonly ["market" | `0x${string}`,
|
|
9
|
+
export declare function toBorrowRateQueryKey(args: ToBorrowRateQueryKeyArgs): readonly ["useBorrowRate", "market" | `0x${string}`, string, string];
|
|
9
10
|
export type UseBorrowRateArgs = {
|
|
10
11
|
market?: Optional<Address>;
|
|
11
|
-
utilization?: Optional<
|
|
12
|
+
utilization?: Optional<BigDecimal>;
|
|
12
13
|
block?: Optional<Block>;
|
|
13
14
|
};
|
|
14
15
|
export declare function useBorrowRate(args?: Optional<UseBorrowRateArgs>): UseQueryResult<Awaited<ReturnType<typeof getBorrowRate>>>;
|
|
15
|
-
//# sourceMappingURL=useBorrowRate.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toBorrowRateQueryKey = toBorrowRateQueryKey;
|
|
4
|
+
exports.useBorrowRate = useBorrowRate;
|
|
5
|
+
const useCompound_js_1 = require("../useCompound.js");
|
|
6
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
7
|
+
const utils_1 = require("@stas-b-woof/compound/utils");
|
|
8
|
+
const compound_1 = require("@stas-b-woof/compound");
|
|
9
|
+
function toBorrowRateQueryKey(args) {
|
|
10
|
+
const { market, utilization, block } = args;
|
|
11
|
+
return [
|
|
12
|
+
'useBorrowRate',
|
|
13
|
+
`${market ?? 'market'}`,
|
|
14
|
+
`${utilization ?? 'utilization'}`,
|
|
15
|
+
`${block ?? 'block'}`,
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
function useBorrowRate(args) {
|
|
19
|
+
const { market, utilization, block, } = args ?? {};
|
|
20
|
+
const { client } = (0, useCompound_js_1.useCompound)();
|
|
21
|
+
return (0, react_query_1.useQuery)({
|
|
22
|
+
queryKey: toBorrowRateQueryKey({
|
|
23
|
+
market: market,
|
|
24
|
+
utilization: utilization,
|
|
25
|
+
...(block !== undefined ? { block } : {}),
|
|
26
|
+
}),
|
|
27
|
+
queryFn: () => {
|
|
28
|
+
(0, compound_1.asserts)(market, 'Market address must be defined');
|
|
29
|
+
(0, compound_1.asserts)(utilization, 'Utilization must be defined');
|
|
30
|
+
return (0, compound_1.getBorrowRate)({
|
|
31
|
+
client: client,
|
|
32
|
+
market: market,
|
|
33
|
+
utilization: utilization,
|
|
34
|
+
...(block !== undefined ? { block } : {}),
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
enabled: market !== undefined && utilization !== undefined,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import { type Address, type Optional, type Block, getCollateralQuote } from "@stas-b-woof/compound";
|
|
2
|
+
import { type Address, type Optional, type Block, type Amount, getCollateralQuote } from "@stas-b-woof/compound";
|
|
3
3
|
export type ToCollateralQuoteQueryKeyArgs = {
|
|
4
4
|
market?: Optional<Address>;
|
|
5
5
|
asset?: Optional<Address>;
|
|
6
|
-
baseAmount?: Optional<
|
|
6
|
+
baseAmount?: Optional<Amount>;
|
|
7
7
|
block?: Optional<Block>;
|
|
8
8
|
};
|
|
9
|
-
export declare function toCollateralQuoteQueryKey(args: ToCollateralQuoteQueryKeyArgs): readonly ["market" | `0x${string}`, `0x${string}` | "asset",
|
|
9
|
+
export declare function toCollateralQuoteQueryKey(args: ToCollateralQuoteQueryKeyArgs): readonly ["useCollateralQuote", "market" | `0x${string}`, `0x${string}` | "asset", string, string];
|
|
10
10
|
export type UseCollateralQuoteArgs = {
|
|
11
11
|
market?: Optional<Address>;
|
|
12
12
|
asset?: Optional<Address>;
|
|
13
|
-
baseAmount?: Optional<
|
|
13
|
+
baseAmount?: Optional<Amount>;
|
|
14
14
|
block?: Optional<Block>;
|
|
15
15
|
};
|
|
16
16
|
export declare function useCollateralQuote(args?: Optional<UseCollateralQuoteArgs>): UseQueryResult<Awaited<ReturnType<typeof getCollateralQuote>>>;
|
|
17
|
-
//# sourceMappingURL=useCollateralQuote.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toCollateralQuoteQueryKey = toCollateralQuoteQueryKey;
|
|
4
|
+
exports.useCollateralQuote = useCollateralQuote;
|
|
5
|
+
const useCompound_js_1 = require("../useCompound.js");
|
|
6
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
7
|
+
const compound_1 = require("@stas-b-woof/compound");
|
|
8
|
+
function toCollateralQuoteQueryKey(args) {
|
|
9
|
+
const { market, asset, baseAmount, block } = args;
|
|
10
|
+
return [
|
|
11
|
+
'useCollateralQuote',
|
|
12
|
+
`${market ?? 'market'}`,
|
|
13
|
+
`${asset ?? 'asset'}`,
|
|
14
|
+
`${baseAmount ?? 'baseAmount'}`,
|
|
15
|
+
`${block ?? 'block'}`,
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
function useCollateralQuote(args) {
|
|
19
|
+
const { market, asset, baseAmount, block } = args ?? {};
|
|
20
|
+
const { client } = (0, useCompound_js_1.useCompound)();
|
|
21
|
+
return (0, react_query_1.useQuery)({
|
|
22
|
+
queryKey: toCollateralQuoteQueryKey({
|
|
23
|
+
market: market,
|
|
24
|
+
asset: asset,
|
|
25
|
+
baseAmount: baseAmount,
|
|
26
|
+
...(block !== undefined ? { block } : {}),
|
|
27
|
+
}),
|
|
28
|
+
queryFn: () => {
|
|
29
|
+
(0, compound_1.asserts)(market, 'Market address must be defined');
|
|
30
|
+
(0, compound_1.asserts)(asset, 'Asset address must be defined');
|
|
31
|
+
(0, compound_1.asserts)(baseAmount, 'Base amount must be defined');
|
|
32
|
+
return (0, compound_1.getCollateralQuote)({
|
|
33
|
+
client: client,
|
|
34
|
+
market: market,
|
|
35
|
+
asset: asset,
|
|
36
|
+
baseAmount: baseAmount,
|
|
37
|
+
...(block !== undefined ? { block } : {}),
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
enabled: market !== undefined && asset !== undefined && baseAmount !== undefined,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
@@ -5,11 +5,10 @@ export type ToCollateralReservesQueryKeyArgs = {
|
|
|
5
5
|
asset?: Optional<Address>;
|
|
6
6
|
block?: Optional<Block>;
|
|
7
7
|
};
|
|
8
|
-
export declare function toCollateralReservesQueryKey(args: ToCollateralReservesQueryKeyArgs): readonly ["market" | `0x${string}`, `0x${string}` | "asset",
|
|
8
|
+
export declare function toCollateralReservesQueryKey(args: ToCollateralReservesQueryKeyArgs): readonly ["useCollateralReserves", "market" | `0x${string}`, `0x${string}` | "asset", string];
|
|
9
9
|
export type UseCollateralReservesArgs = {
|
|
10
10
|
market?: Optional<Address>;
|
|
11
11
|
asset?: Optional<Address>;
|
|
12
12
|
block?: Optional<Block>;
|
|
13
13
|
};
|
|
14
14
|
export declare function useCollateralReserves(args?: Optional<UseCollateralReservesArgs>): UseQueryResult<Awaited<ReturnType<typeof getCollateralReserves>>>;
|
|
15
|
-
//# sourceMappingURL=useCollateralReserves.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toCollateralReservesQueryKey = toCollateralReservesQueryKey;
|
|
4
|
+
exports.useCollateralReserves = useCollateralReserves;
|
|
5
|
+
const useCompound_js_1 = require("../useCompound.js");
|
|
6
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
7
|
+
const compound_1 = require("@stas-b-woof/compound");
|
|
8
|
+
function toCollateralReservesQueryKey(args) {
|
|
9
|
+
const { market, asset, block } = args;
|
|
10
|
+
return [
|
|
11
|
+
'useCollateralReserves',
|
|
12
|
+
`${market ?? 'market'}`,
|
|
13
|
+
`${asset ?? 'asset'}`,
|
|
14
|
+
`${block ?? 'block'}`,
|
|
15
|
+
];
|
|
16
|
+
}
|
|
17
|
+
function useCollateralReserves(args) {
|
|
18
|
+
const { market, asset, block } = args ?? {};
|
|
19
|
+
const { client } = (0, useCompound_js_1.useCompound)();
|
|
20
|
+
return (0, react_query_1.useQuery)({
|
|
21
|
+
queryKey: toCollateralReservesQueryKey({
|
|
22
|
+
market: market,
|
|
23
|
+
asset: asset,
|
|
24
|
+
...(block !== undefined ? { block } : {}),
|
|
25
|
+
}),
|
|
26
|
+
queryFn: () => {
|
|
27
|
+
(0, compound_1.asserts)(market, 'Market address must be defined');
|
|
28
|
+
(0, compound_1.asserts)(asset, 'Asset address must be defined');
|
|
29
|
+
return (0, compound_1.getCollateralReserves)({
|
|
30
|
+
client: client,
|
|
31
|
+
market: market,
|
|
32
|
+
asset: asset,
|
|
33
|
+
...(block !== undefined ? { block } : {}),
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
enabled: market !== undefined && asset !== undefined,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
@@ -5,11 +5,10 @@ export type ToCollateralSupplyQueryKeyArgs = {
|
|
|
5
5
|
asset?: Optional<Address>;
|
|
6
6
|
block?: Optional<Block>;
|
|
7
7
|
};
|
|
8
|
-
export declare function toCollateralSupplyQueryKey(args: ToCollateralSupplyQueryKeyArgs): readonly ["market" | `0x${string}`, `0x${string}` | "asset",
|
|
8
|
+
export declare function toCollateralSupplyQueryKey(args: ToCollateralSupplyQueryKeyArgs): readonly ["useCollateralSupply", "market" | `0x${string}`, `0x${string}` | "asset", string];
|
|
9
9
|
export type UseCollateralSupplyArgs = {
|
|
10
10
|
market?: Optional<Address>;
|
|
11
11
|
asset?: Optional<Address>;
|
|
12
12
|
block?: Optional<Block>;
|
|
13
13
|
};
|
|
14
14
|
export declare function useCollateralSupply(args?: Optional<UseCollateralSupplyArgs>): UseQueryResult<Awaited<ReturnType<typeof getCollateralSupply>>>;
|
|
15
|
-
//# sourceMappingURL=useCollateralSupply.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toCollateralSupplyQueryKey = toCollateralSupplyQueryKey;
|
|
4
|
+
exports.useCollateralSupply = useCollateralSupply;
|
|
5
|
+
const useCompound_js_1 = require("../useCompound.js");
|
|
6
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
7
|
+
const compound_1 = require("@stas-b-woof/compound");
|
|
8
|
+
function toCollateralSupplyQueryKey(args) {
|
|
9
|
+
const { market, asset, block } = args;
|
|
10
|
+
return [
|
|
11
|
+
'useCollateralSupply',
|
|
12
|
+
`${market ?? 'market'}`,
|
|
13
|
+
`${asset ?? 'asset'}`,
|
|
14
|
+
`${block ?? 'block'}`,
|
|
15
|
+
];
|
|
16
|
+
}
|
|
17
|
+
function useCollateralSupply(args) {
|
|
18
|
+
const { market, asset, block } = args ?? {};
|
|
19
|
+
const { client } = (0, useCompound_js_1.useCompound)();
|
|
20
|
+
return (0, react_query_1.useQuery)({
|
|
21
|
+
queryKey: toCollateralSupplyQueryKey({
|
|
22
|
+
market: market,
|
|
23
|
+
asset: asset,
|
|
24
|
+
...(block !== undefined ? { block } : {}),
|
|
25
|
+
}),
|
|
26
|
+
queryFn: () => {
|
|
27
|
+
(0, compound_1.asserts)(market, 'Market address must be defined');
|
|
28
|
+
(0, compound_1.asserts)(asset, 'Asset address must be defined');
|
|
29
|
+
return (0, compound_1.getCollateralSupply)({
|
|
30
|
+
client: client,
|
|
31
|
+
market: market,
|
|
32
|
+
asset: asset,
|
|
33
|
+
...(block !== undefined ? { block } : {}),
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
enabled: market !== undefined && asset !== undefined,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
@@ -4,10 +4,9 @@ export type ToCollateralsCountQueryKeyArgs = {
|
|
|
4
4
|
market?: Optional<Address>;
|
|
5
5
|
block?: Optional<Block>;
|
|
6
6
|
};
|
|
7
|
-
export declare function toCollateralsCountQueryKey(args: ToCollateralsCountQueryKeyArgs): readonly ["market" | `0x${string}`,
|
|
7
|
+
export declare function toCollateralsCountQueryKey(args: ToCollateralsCountQueryKeyArgs): readonly ["useCollateralsCount", "market" | `0x${string}`, string];
|
|
8
8
|
export type UseCollateralsCountArgs = {
|
|
9
9
|
market?: Optional<Address>;
|
|
10
10
|
block?: Optional<Block>;
|
|
11
11
|
};
|
|
12
12
|
export declare function useCollateralsCount(args?: Optional<UseCollateralsCountArgs>): UseQueryResult<Awaited<ReturnType<typeof getCollateralsNumber>>>;
|
|
13
|
-
//# sourceMappingURL=useCollateralsCount.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toCollateralsCountQueryKey = toCollateralsCountQueryKey;
|
|
4
|
+
exports.useCollateralsCount = useCollateralsCount;
|
|
5
|
+
const useCompound_js_1 = require("../useCompound.js");
|
|
6
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
7
|
+
const compound_1 = require("@stas-b-woof/compound");
|
|
8
|
+
function toCollateralsCountQueryKey(args) {
|
|
9
|
+
const { market, block } = args;
|
|
10
|
+
return [
|
|
11
|
+
'useCollateralsCount',
|
|
12
|
+
`${market ?? 'market'}`,
|
|
13
|
+
`${block ?? 'block'}`,
|
|
14
|
+
];
|
|
15
|
+
}
|
|
16
|
+
function useCollateralsCount(args) {
|
|
17
|
+
const { market, block } = args ?? {};
|
|
18
|
+
const { client } = (0, useCompound_js_1.useCompound)();
|
|
19
|
+
return (0, react_query_1.useQuery)({
|
|
20
|
+
queryKey: toCollateralsCountQueryKey({
|
|
21
|
+
market: market,
|
|
22
|
+
...(block !== undefined ? { block } : {}),
|
|
23
|
+
}),
|
|
24
|
+
queryFn: () => {
|
|
25
|
+
(0, compound_1.asserts)(market, 'Market address must be defined');
|
|
26
|
+
return (0, compound_1.getCollateralsNumber)({
|
|
27
|
+
client: client,
|
|
28
|
+
market: market,
|
|
29
|
+
...(block !== undefined ? { block } : {}),
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
enabled: market !== undefined,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -4,10 +4,9 @@ export type ToCometDecimalsQueryKeyArgs = {
|
|
|
4
4
|
market?: Optional<Address>;
|
|
5
5
|
block?: Optional<Block>;
|
|
6
6
|
};
|
|
7
|
-
export declare function toCometDecimalsQueryKey(args: ToCometDecimalsQueryKeyArgs): readonly ["market" | `0x${string}`,
|
|
7
|
+
export declare function toCometDecimalsQueryKey(args: ToCometDecimalsQueryKeyArgs): readonly ["useCometDecimals", "market" | `0x${string}`, string];
|
|
8
8
|
export type UseCometDecimalsArgs = {
|
|
9
9
|
market?: Optional<Address>;
|
|
10
10
|
block?: Optional<Block>;
|
|
11
11
|
};
|
|
12
12
|
export declare function useCometDecimals(args?: Optional<UseCometDecimalsArgs>): UseQueryResult<Awaited<ReturnType<typeof getCometDecimals>>>;
|
|
13
|
-
//# sourceMappingURL=useCometDecimals.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toCometDecimalsQueryKey = toCometDecimalsQueryKey;
|
|
4
|
+
exports.useCometDecimals = useCometDecimals;
|
|
5
|
+
const useCompound_js_1 = require("../useCompound.js");
|
|
6
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
7
|
+
const compound_1 = require("@stas-b-woof/compound");
|
|
8
|
+
function toCometDecimalsQueryKey(args) {
|
|
9
|
+
const { market, block } = args;
|
|
10
|
+
return [
|
|
11
|
+
'useCometDecimals',
|
|
12
|
+
`${market ?? 'market'}`,
|
|
13
|
+
`${block ?? 'block'}`,
|
|
14
|
+
];
|
|
15
|
+
}
|
|
16
|
+
function useCometDecimals(args) {
|
|
17
|
+
const { market, block } = args ?? {};
|
|
18
|
+
const { client } = (0, useCompound_js_1.useCompound)();
|
|
19
|
+
return (0, react_query_1.useQuery)({
|
|
20
|
+
queryKey: toCometDecimalsQueryKey({
|
|
21
|
+
market: market,
|
|
22
|
+
...(block !== undefined ? { block } : {}),
|
|
23
|
+
}),
|
|
24
|
+
queryFn: () => {
|
|
25
|
+
(0, compound_1.asserts)(market, 'Market address must be defined');
|
|
26
|
+
return (0, compound_1.getCometDecimals)({
|
|
27
|
+
client: client,
|
|
28
|
+
market: market,
|
|
29
|
+
...(block !== undefined ? { block } : {}),
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
enabled: market !== undefined,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -1,74 +1,41 @@
|
|
|
1
1
|
import { type MakeCometFetcherArgs } from "@stas-b-woof/compound";
|
|
2
2
|
export type UseFetchersArgs = Omit<MakeCometFetcherArgs, 'client'>;
|
|
3
3
|
export declare function useFetchers(args: UseFetchersArgs): {
|
|
4
|
-
readonly getAccountSupplyBalance: (args: Omit<import("@stas-b-woof/compound").GetAccountSupplyBalanceArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<
|
|
5
|
-
readonly getMinimalLoanAmount: (args?: Omit<import("@stas-b-woof/compound").GetMinimalLoanAmountArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<
|
|
4
|
+
readonly getAccountSupplyBalance: (args: Omit<import("@stas-b-woof/compound").GetAccountSupplyBalanceArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<import("@stas-b-woof/compound").Amount>;
|
|
5
|
+
readonly getMinimalLoanAmount: (args?: Omit<import("@stas-b-woof/compound").GetMinimalLoanAmountArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<import("@stas-b-woof/compound").Amount>;
|
|
6
6
|
readonly getBaseTokenAddress: (args?: Omit<import("@stas-b-woof/compound").GetBaseTokenAddressArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<`0x${string}`>;
|
|
7
7
|
readonly getBaseTokenPriceFeedAddress: (args?: Omit<import("@stas-b-woof/compound").GetBaseTokenPriceFeedAddressArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<`0x${string}`>;
|
|
8
|
-
readonly
|
|
9
|
-
readonly
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
borrowCollateralFactor: bigint;
|
|
22
|
-
liquidateCollateralFactor: bigint;
|
|
23
|
-
liquidationFactor: bigint;
|
|
24
|
-
supplyCap: bigint;
|
|
25
|
-
}>;
|
|
26
|
-
readonly getAssetInfoByAddress: (args: Omit<import("@stas-b-woof/compound").GetAssetInfoByAddressArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<{
|
|
27
|
-
offset: number;
|
|
28
|
-
asset: `0x${string}`;
|
|
29
|
-
priceFeed: `0x${string}`;
|
|
30
|
-
scale: bigint;
|
|
31
|
-
borrowCollateralFactor: bigint;
|
|
32
|
-
liquidateCollateralFactor: bigint;
|
|
33
|
-
liquidationFactor: bigint;
|
|
34
|
-
supplyCap: bigint;
|
|
35
|
-
}>;
|
|
36
|
-
readonly getBorrowRate: (args: Omit<import("@stas-b-woof/compound").GetBorrowRateArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<bigint>;
|
|
37
|
-
readonly getCollateralReserves: (args: Omit<import("@stas-b-woof/compound").GetCollateralReservesArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<bigint>;
|
|
38
|
-
readonly getBaseAssetReserves: (args?: Omit<import("@stas-b-woof/compound").GetBaseAssetReservesArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<bigint>;
|
|
39
|
-
readonly getSupplyRate: (args: Omit<import("@stas-b-woof/compound").GetSupplyRateArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<bigint>;
|
|
40
|
-
readonly getUtilization: (args?: Omit<import("@stas-b-woof/compound").GetUtilizationArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<bigint>;
|
|
8
|
+
readonly getBorrowBalanceOf: (args: Omit<import("@stas-b-woof/compound").GetBorrowBalanceOfArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<import("@stas-b-woof/compound").Amount>;
|
|
9
|
+
readonly getBorrowKink: (args?: Omit<import("@stas-b-woof/compound").GetBorrowKinkArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<import("@stas-b-woof/compound").BigDecimal>;
|
|
10
|
+
readonly getBorrowPerSecondInterestRateBase: (args?: Omit<import("@stas-b-woof/compound").GetBorrowPerSecondInterestRateBaseArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<import("@stas-b-woof/compound").BigDecimal>;
|
|
11
|
+
readonly getBorrowPerSecondInterestRateSlopeHigh: (args?: Omit<import("@stas-b-woof/compound").GetBorrowPerSecondInterestRateSlopeHighArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<import("@stas-b-woof/compound").BigDecimal>;
|
|
12
|
+
readonly getBorrowPerSecondInterestRateSlopeLow: (args?: Omit<import("@stas-b-woof/compound").GetBorrowPerSecondInterestRateSlopeLowArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<import("@stas-b-woof/compound").BigDecimal>;
|
|
13
|
+
readonly getCometDecimals: (args?: Omit<import("@stas-b-woof/compound").GetCometDecimalsArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<bigint>;
|
|
14
|
+
readonly getAssetInfoByIndex: (args: Omit<import("@stas-b-woof/compound").GetAssetInfoArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<import("@stas-b-woof/compound").GetAssetInfoResult>;
|
|
15
|
+
readonly getAssetInfoByAddress: (args: Omit<import("@stas-b-woof/compound").GetAssetInfoByAddressArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<import("@stas-b-woof/compound").GetAssetInfoByAddressResult>;
|
|
16
|
+
readonly getBorrowRate: (args: Omit<import("@stas-b-woof/compound").GetBorrowRateArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<import("@stas-b-woof/compound").BigDecimal>;
|
|
17
|
+
readonly getCollateralReserves: (args: Omit<import("@stas-b-woof/compound").GetCollateralReservesArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<import("@stas-b-woof/compound").Amount>;
|
|
18
|
+
readonly getBaseAssetReserves: (args?: Omit<import("@stas-b-woof/compound").GetBaseAssetReservesArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<import("@stas-b-woof/compound").Amount>;
|
|
19
|
+
readonly getSupplyRate: (args: Omit<import("@stas-b-woof/compound").GetSupplyRateArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<import("@stas-b-woof/compound").BigDecimal>;
|
|
20
|
+
readonly getUtilization: (args?: Omit<import("@stas-b-woof/compound").GetUtilizationArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<import("@stas-b-woof/compound").BigDecimal>;
|
|
41
21
|
readonly checkIsManagerAllowed: (args: Omit<import("@stas-b-woof/compound").CheckIsManagerAllowedArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<boolean>;
|
|
42
22
|
readonly getCollateralsNumber: (args?: Omit<import("@stas-b-woof/compound").GetCollateralsNumberArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<number>;
|
|
43
|
-
readonly getSupplyKink: (args?: Omit<import("@stas-b-woof/compound").GetSupplyKinkArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<
|
|
44
|
-
readonly getSupplyPerSecondInterestRateBase: (args?: Omit<import("@stas-b-woof/compound").GetSupplyPerSecondInterestRateBaseArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<
|
|
45
|
-
readonly getSupplyPerSecondInterestRateSlopeHigh: (args?: Omit<import("@stas-b-woof/compound").GetSupplyPerSecondInterestRateSlopeHighArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<
|
|
46
|
-
readonly getSupplyPerSecondInterestRateSlopeLow: (args?: Omit<import("@stas-b-woof/compound").GetSupplyPerSecondInterestRateSlopeLowArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<
|
|
47
|
-
readonly getTotalBorrow: (args?: Omit<import("@stas-b-woof/compound").GetTotalBorrowArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<
|
|
48
|
-
readonly getTotalSupply: (args?: Omit<import("@stas-b-woof/compound").GetTotalSupplyArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<
|
|
49
|
-
readonly getCollateralSupply: (args: Omit<import("@stas-b-woof/compound").GetCollateralSupplyArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<
|
|
50
|
-
readonly
|
|
51
|
-
readonly
|
|
52
|
-
readonly getAccountCollateralBalance: (args: Omit<import("@stas-b-woof/compound").GetAccountCollateralBalanceArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<readonly [balance: bigint, bigint]>;
|
|
23
|
+
readonly getSupplyKink: (args?: Omit<import("@stas-b-woof/compound").GetSupplyKinkArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<import("@stas-b-woof/compound").BigDecimal>;
|
|
24
|
+
readonly getSupplyPerSecondInterestRateBase: (args?: Omit<import("@stas-b-woof/compound").GetSupplyPerSecondInterestRateBaseArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<import("@stas-b-woof/compound").BigDecimal>;
|
|
25
|
+
readonly getSupplyPerSecondInterestRateSlopeHigh: (args?: Omit<import("@stas-b-woof/compound").GetSupplyPerSecondInterestRateSlopeHighArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<import("@stas-b-woof/compound").BigDecimal>;
|
|
26
|
+
readonly getSupplyPerSecondInterestRateSlopeLow: (args?: Omit<import("@stas-b-woof/compound").GetSupplyPerSecondInterestRateSlopeLowArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<import("@stas-b-woof/compound").BigDecimal>;
|
|
27
|
+
readonly getTotalBorrow: (args?: Omit<import("@stas-b-woof/compound").GetTotalBorrowArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<import("@stas-b-woof/compound").Amount>;
|
|
28
|
+
readonly getTotalSupply: (args?: Omit<import("@stas-b-woof/compound").GetTotalSupplyArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<import("@stas-b-woof/compound").Amount>;
|
|
29
|
+
readonly getCollateralSupply: (args: Omit<import("@stas-b-woof/compound").GetCollateralSupplyArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<import("@stas-b-woof/compound").Amount>;
|
|
30
|
+
readonly getAccountBasics: (args: Omit<import("@stas-b-woof/compound").GetAccountBasicsArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<import("@stas-b-woof/compound").GetAccountBasicsResult>;
|
|
31
|
+
readonly getAccountCollateralBalance: (args: Omit<import("@stas-b-woof/compound").GetAccountCollateralBalanceArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<import("@stas-b-woof/compound").Amount>;
|
|
53
32
|
readonly getUserNonce: (args: Omit<import("@stas-b-woof/compound").GetUserNonceArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<bigint>;
|
|
54
33
|
readonly getMarketName: (args?: Omit<import("@stas-b-woof/compound").GetMarketNameArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<string>;
|
|
55
34
|
readonly getMarketSymbol: (args?: Omit<import("@stas-b-woof/compound").GetMarketSymbolArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<string>;
|
|
56
|
-
readonly getTotalsBasic: (args?: Omit<import("@stas-b-woof/compound").GetTotalsBasicArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<
|
|
57
|
-
baseSupplyIndex: bigint;
|
|
58
|
-
baseBorrowIndex: bigint;
|
|
59
|
-
trackingSupplyIndex: bigint;
|
|
60
|
-
trackingBorrowIndex: bigint;
|
|
61
|
-
totalSupplyBase: bigint;
|
|
62
|
-
totalBorrowBase: bigint;
|
|
63
|
-
lastAccrualTime: number;
|
|
64
|
-
pauseFlags: number;
|
|
65
|
-
}>;
|
|
66
|
-
readonly getRewardOwed: (args: Omit<import("@stas-b-woof/compound").GetRewardOwedArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<import("@stas-b-woof/compound").GetRewardOwedResult>;
|
|
67
|
-
readonly getRewardAccrued: (args: Omit<import("@stas-b-woof/compound").GetRewardAccruedArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<bigint>;
|
|
35
|
+
readonly getTotalsBasic: (args?: Omit<import("@stas-b-woof/compound").GetTotalsBasicArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<import("@stas-b-woof/compound").GetTotalsBasicResult>;
|
|
68
36
|
readonly checkIsAccountLiquidatable: (args: Omit<import("@stas-b-woof/compound").CheckIsLiquidatableArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<boolean>;
|
|
69
|
-
readonly getCollateralQuote: (args: Omit<import("@stas-b-woof/compound").GetCollateralQuoteArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<
|
|
37
|
+
readonly getCollateralQuote: (args: Omit<import("@stas-b-woof/compound").GetCollateralQuoteArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<import("@stas-b-woof/compound").BigDecimal>;
|
|
70
38
|
readonly getLiquidatorPoints: (args: Omit<import("@stas-b-woof/compound").GetLiquidatorPointsArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<import("@stas-b-woof/compound").GetLiquidatorPointsResult>;
|
|
71
39
|
readonly getMarketVersion: (args?: Omit<import("@stas-b-woof/compound").GetMarketVersionArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs> | undefined) => Promise<string>;
|
|
72
40
|
readonly checkIsAssetSupported: (args: Omit<import("@stas-b-woof/compound").CheckAssetSupportArgs, keyof import("@stas-b-woof/compound").BaseFetcherArgs>) => Promise<import("@stas-b-woof/compound").CheckAssetSupportResult>;
|
|
73
41
|
};
|
|
74
|
-
//# sourceMappingURL=useFetchers.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useFetchers = useFetchers;
|
|
4
|
+
const compound_1 = require("@stas-b-woof/compound");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const useCompound_js_1 = require("../useCompound.js");
|
|
7
|
+
function useFetchers(args) {
|
|
8
|
+
const { client } = (0, useCompound_js_1.useCompound)();
|
|
9
|
+
return (0, react_1.useMemo)(() => {
|
|
10
|
+
return (0, compound_1.makeCometFetcher)({
|
|
11
|
+
client: client,
|
|
12
|
+
...args,
|
|
13
|
+
});
|
|
14
|
+
}, []);
|
|
15
|
+
}
|
|
@@ -5,11 +5,10 @@ export type ToLiquidatorPointsQueryKeyArgs = {
|
|
|
5
5
|
liquidator?: Optional<Address>;
|
|
6
6
|
block?: Optional<Block>;
|
|
7
7
|
};
|
|
8
|
-
export declare function toLiquidatorPointsQueryKey(args: ToLiquidatorPointsQueryKeyArgs): readonly ["market" | `0x${string}`, `0x${string}` | "liquidator",
|
|
8
|
+
export declare function toLiquidatorPointsQueryKey(args: ToLiquidatorPointsQueryKeyArgs): readonly ["useLiquidatorPoints", "market" | `0x${string}`, `0x${string}` | "liquidator", string];
|
|
9
9
|
export type UseLiquidatorPointsArgs = {
|
|
10
10
|
market?: Optional<Address>;
|
|
11
11
|
liquidator?: Optional<Address>;
|
|
12
12
|
block?: Optional<Block>;
|
|
13
13
|
};
|
|
14
14
|
export declare function useLiquidatorPoints(args?: Optional<UseLiquidatorPointsArgs>): UseQueryResult<Awaited<ReturnType<typeof getLiquidatorPoints>>>;
|
|
15
|
-
//# sourceMappingURL=useLiquidatorPoints.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toLiquidatorPointsQueryKey = toLiquidatorPointsQueryKey;
|
|
4
|
+
exports.useLiquidatorPoints = useLiquidatorPoints;
|
|
5
|
+
const useCompound_js_1 = require("../useCompound.js");
|
|
6
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
7
|
+
const compound_1 = require("@stas-b-woof/compound");
|
|
8
|
+
function toLiquidatorPointsQueryKey(args) {
|
|
9
|
+
const { market, liquidator, block } = args;
|
|
10
|
+
return [
|
|
11
|
+
'useLiquidatorPoints',
|
|
12
|
+
`${market ?? 'market'}`,
|
|
13
|
+
`${liquidator ?? 'liquidator'}`,
|
|
14
|
+
`${block ?? 'block'}`,
|
|
15
|
+
];
|
|
16
|
+
}
|
|
17
|
+
function useLiquidatorPoints(args) {
|
|
18
|
+
const { market, liquidator, block } = args ?? {};
|
|
19
|
+
const { client } = (0, useCompound_js_1.useCompound)();
|
|
20
|
+
return (0, react_query_1.useQuery)({
|
|
21
|
+
queryKey: toLiquidatorPointsQueryKey({
|
|
22
|
+
market: market,
|
|
23
|
+
liquidator: liquidator,
|
|
24
|
+
...(block !== undefined ? { block } : {}),
|
|
25
|
+
}),
|
|
26
|
+
queryFn: () => {
|
|
27
|
+
(0, compound_1.asserts)(market, 'Market address must be defined');
|
|
28
|
+
(0, compound_1.asserts)(liquidator, 'Liquidator address must be defined');
|
|
29
|
+
return (0, compound_1.getLiquidatorPoints)({
|
|
30
|
+
client: client,
|
|
31
|
+
market: market,
|
|
32
|
+
liquidator: liquidator,
|
|
33
|
+
...(block !== undefined ? { block } : {}),
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
enabled: market !== undefined && liquidator !== undefined,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
@@ -6,7 +6,7 @@ export type ToManagerAllowedQueryKeyArgs = {
|
|
|
6
6
|
manager?: Optional<Address>;
|
|
7
7
|
block?: Optional<Block>;
|
|
8
8
|
};
|
|
9
|
-
export declare function toManagerAllowedQueryKey(args: ToManagerAllowedQueryKeyArgs): readonly ["market" | `0x${string}`, `0x${string}` | "owner", `0x${string}` | "manager",
|
|
9
|
+
export declare function toManagerAllowedQueryKey(args: ToManagerAllowedQueryKeyArgs): readonly ["useManagerAllowed", "market" | `0x${string}`, `0x${string}` | "owner", `0x${string}` | "manager", string];
|
|
10
10
|
export type UseManagerAllowedArgs = {
|
|
11
11
|
market?: Optional<Address>;
|
|
12
12
|
owner?: Optional<Address>;
|
|
@@ -14,4 +14,3 @@ export type UseManagerAllowedArgs = {
|
|
|
14
14
|
block?: Optional<Block>;
|
|
15
15
|
};
|
|
16
16
|
export declare function useManagerAllowed(args?: Optional<UseManagerAllowedArgs>): UseQueryResult<Awaited<ReturnType<typeof checkIsManagerAllowed>>>;
|
|
17
|
-
//# sourceMappingURL=useManagerAllowed.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toManagerAllowedQueryKey = toManagerAllowedQueryKey;
|
|
4
|
+
exports.useManagerAllowed = useManagerAllowed;
|
|
5
|
+
const useCompound_js_1 = require("../useCompound.js");
|
|
6
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
7
|
+
const compound_1 = require("@stas-b-woof/compound");
|
|
8
|
+
function toManagerAllowedQueryKey(args) {
|
|
9
|
+
const { market, owner, manager, block } = args;
|
|
10
|
+
return [
|
|
11
|
+
'useManagerAllowed',
|
|
12
|
+
`${market ?? 'market'}`,
|
|
13
|
+
`${owner ?? 'owner'}`,
|
|
14
|
+
`${manager ?? 'manager'}`,
|
|
15
|
+
`${block ?? 'block'}`,
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
function useManagerAllowed(args) {
|
|
19
|
+
const { market, owner, manager, block } = args ?? {};
|
|
20
|
+
const { client } = (0, useCompound_js_1.useCompound)();
|
|
21
|
+
return (0, react_query_1.useQuery)({
|
|
22
|
+
queryKey: toManagerAllowedQueryKey({
|
|
23
|
+
market: market,
|
|
24
|
+
owner: owner,
|
|
25
|
+
manager: manager,
|
|
26
|
+
...(block !== undefined ? { block } : {}),
|
|
27
|
+
}),
|
|
28
|
+
queryFn: () => {
|
|
29
|
+
(0, compound_1.asserts)(market, 'Market address must be defined');
|
|
30
|
+
(0, compound_1.asserts)(owner, 'Owner address must be defined');
|
|
31
|
+
(0, compound_1.asserts)(manager, 'Manager address must be defined');
|
|
32
|
+
return (0, compound_1.checkIsManagerAllowed)({
|
|
33
|
+
client: client,
|
|
34
|
+
market: market,
|
|
35
|
+
owner: owner,
|
|
36
|
+
manager: manager,
|
|
37
|
+
...(block !== undefined ? { block } : {}),
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
enabled: market !== undefined && owner !== undefined && manager !== undefined,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { type UseQueryResult } from "@tanstack/react-query";
|
|
2
|
-
import { type Address, type ChainId, type Optional, type Block,
|
|
2
|
+
import { type Address, type ChainId, type Optional, type Block, fetchMarket } from "@stas-b-woof/compound";
|
|
3
3
|
export type ToMarketQueryKeyArgs = {
|
|
4
4
|
chainId?: Optional<ChainId>;
|
|
5
5
|
market?: Optional<Address>;
|
|
6
|
+
account?: Optional<Address>;
|
|
6
7
|
block?: Optional<Block>;
|
|
7
8
|
};
|
|
8
|
-
export declare function toMarketQueryKey(args: ToMarketQueryKeyArgs): readonly [`${number}` | `${bigint}
|
|
9
|
+
export declare function toMarketQueryKey(args: ToMarketQueryKeyArgs): readonly ["useMarket", `${number}` | "chain" | `${bigint}`, "market" | `0x${string}`, `0x${string}` | "account", string];
|
|
9
10
|
export type UseMarketArgs = {
|
|
10
11
|
chainId?: Optional<ChainId>;
|
|
11
12
|
market?: Optional<Address>;
|
|
13
|
+
account?: Optional<Address>;
|
|
12
14
|
block?: Optional<Block>;
|
|
13
15
|
};
|
|
14
|
-
export declare function useMarket(args?: Optional<UseMarketArgs>): UseQueryResult<
|
|
15
|
-
//# sourceMappingURL=useMarket.d.ts.map
|
|
16
|
+
export declare function useMarket(args?: Optional<UseMarketArgs>): UseQueryResult<Awaited<ReturnType<typeof fetchMarket>>>;
|