@raac/rpc 1.0.1 → 1.0.2-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/RPCLibrary.js +61 -8
- package/dist/artifacts/core/collectors/FeeCollector.sol/FeeCollector.json +1743 -0
- package/dist/artifacts/core/minters/RAACMinter/RAACMinter.sol/RAACMinter.json +175 -67
- package/dist/artifacts/core/oracles/BaseVRFv2Consumer.sol/BaseVRFv2Consumer.json +279 -0
- package/dist/artifacts/core/pools/LendingPool/LendingPool.sol/LendingPool.json +1231 -195
- package/dist/artifacts/core/pools/StabilityPool/StabilityPool.sol/StabilityPool.json +153 -199
- package/dist/artifacts/core/primitives/RAACHousePrices.sol/RAACHousePrices.json +72 -2
- package/dist/artifacts/core/tokens/DEToken.sol/DEToken.json +2 -2
- package/dist/artifacts/core/tokens/IndexToken.sol/IndexToken.json +770 -0
- package/dist/artifacts/core/tokens/RAACNFT.sol/RAACNFT.json +707 -49
- package/dist/artifacts/core/tokens/RAACToken.sol/RAACToken.json +23 -84
- package/dist/artifacts/core/tokens/RToken.sol/RToken.json +62 -62
- package/dist/artifacts/core/tokens/veRAACToken.sol/veRAACToken.json +2 -2
- package/dist/artifacts/mocks/core/oracles/MockVRFCoordinatorV2.sol/MockVRFCoordinatorV2.json +774 -0
- package/dist/artifacts/zeno/Auction.sol/Auction.json +34 -114
- package/dist/artifacts/zeno/AuctionFactory.sol/AuctionFactory.json +3 -3
- package/dist/artifacts/zeno/Zeno.sol/Zeno.json +3 -3
- package/dist/artifacts/zeno/ZenoFactory.sol/ZenoFactory.json +3 -3
- package/dist/configs/chains/17000.json +127 -0
- package/dist/configs/chains/8453.json +26 -14
- package/dist/configs/chains/index.js +2 -0
- package/dist/configs/createConfig.js +6 -0
- package/dist/contracts/feeCollector/claimRewardFromPool.js +24 -0
- package/dist/contracts/housePrices/getLatestPrice.js +1 -1
- package/dist/contracts/indexToken/getNextRandomNFT.js +30 -0
- package/dist/contracts/indexToken/redeemNFT.js +39 -0
- package/dist/nfts/getAllTokens.js +34 -0
- package/dist/nfts/{addNewBatch.js → getBaseUri.js} +7 -8
- package/dist/nfts/getMintFeePercentage.js +23 -0
- package/dist/nfts/getMintPrice.js +28 -0
- package/dist/nfts/getTokenURI.js +23 -0
- package/dist/nfts/getTokensByOwner.js +35 -0
- package/dist/nfts/getTotalPropertiesCount.js +23 -0
- package/dist/nfts/{getCurrentBatchSize.js → totalNFTSupply.js} +3 -3
- package/dist/pools/lendingPool/borrowFromLendingPool.js +4 -3
- package/dist/pools/lendingPool/borrowFromLendingPoolWithInsurance.js +40 -0
- package/dist/pools/lendingPool/calculateInsuranceFee.js +20 -0
- package/dist/pools/lendingPool/claimReward.js +22 -0
- package/dist/pools/lendingPool/closeLiquidation.js +28 -0
- package/dist/pools/lendingPool/depositNFTToLendingPool.js +0 -1
- package/dist/pools/lendingPool/depositToLendingPool.js +2 -2
- package/dist/pools/lendingPool/getAllUserData.js +28 -0
- package/dist/pools/lendingPool/getEligibleUserDeposits.js +27 -0
- package/dist/pools/lendingPool/getHealthFactor.js +27 -0
- package/dist/pools/lendingPool/getLendingPoolInfo.js +8 -5
- package/dist/pools/lendingPool/getPendingReward.js +20 -0
- package/dist/pools/lendingPool/getPositionDebt.js +27 -0
- package/dist/pools/lendingPool/getPositionScaledDebt.js +27 -0
- package/dist/pools/lendingPool/getPositionView.js +38 -0
- package/dist/pools/lendingPool/getPositionsScaledDebt.js +27 -0
- package/dist/pools/lendingPool/getRawUserDepositsInLendingPool.js +21 -0
- package/dist/pools/lendingPool/getUserCollateralValue.js +27 -0
- package/dist/pools/lendingPool/initializeLiquidation.js +28 -0
- package/dist/pools/lendingPool/repayToLendingPool.js +4 -8
- package/dist/pools/lendingPool/withdrawFromLendingPool.js +2 -2
- package/dist/pools/stabilityPool/depositNFTToStabilityPool.js +40 -0
- package/dist/pools/stabilityPool/getRawUserDepositsInStabilityPool.js +21 -0
- package/dist/pools/stabilityPool/getStabilityPoolInfo.js +2 -12
- package/dist/scripts/index.js +90 -35
- package/dist/types/RPCLibrary.d.ts +61 -8
- package/dist/types/configs/chains/index.d.ts +2 -0
- package/dist/types/configs/createConfig.d.ts +6 -0
- package/dist/types/configs/index.d.ts +1 -0
- package/dist/types/contracts/feeCollector/claimRewardFromPool.d.ts +4 -0
- package/dist/types/contracts/housePrices/getLatestPrice.d.ts +1 -1
- package/dist/types/contracts/indexToken/getNextRandomNFT.d.ts +7 -0
- package/dist/types/contracts/indexToken/redeemNFT.d.ts +4 -0
- package/dist/types/nfts/getAllTokens.d.ts +7 -0
- package/dist/types/nfts/getBaseUri.d.ts +4 -0
- package/dist/types/nfts/getMintFeePercentage.d.ts +4 -0
- package/dist/types/nfts/getMintPrice.d.ts +7 -0
- package/dist/types/nfts/getTokenURI.d.ts +4 -0
- package/dist/types/nfts/getTokensByOwner.d.ts +10 -0
- package/dist/types/nfts/getTotalPropertiesCount.d.ts +4 -0
- package/dist/types/nfts/totalNFTSupply.d.ts +4 -0
- package/dist/types/pools/lendingPool/borrowFromLendingPool.d.ts +1 -1
- package/dist/types/pools/lendingPool/borrowFromLendingPoolWithInsurance.d.ts +4 -0
- package/dist/types/pools/lendingPool/calculateInsuranceFee.d.ts +4 -0
- package/dist/types/pools/lendingPool/claimReward.d.ts +4 -0
- package/dist/types/pools/lendingPool/closeLiquidation.d.ts +11 -0
- package/dist/types/pools/lendingPool/getAllUserData.d.ts +16 -0
- package/dist/types/pools/lendingPool/getEligibleUserDeposits.d.ts +11 -0
- package/dist/types/pools/lendingPool/getHealthFactor.d.ts +11 -0
- package/dist/types/pools/lendingPool/getLendingPoolInfo.d.ts +2 -1
- package/dist/types/pools/lendingPool/getPendingReward.d.ts +4 -0
- package/dist/types/pools/lendingPool/getPositionDebt.d.ts +11 -0
- package/dist/types/pools/lendingPool/getPositionScaledDebt.d.ts +11 -0
- package/dist/types/pools/lendingPool/getPositionView.d.ts +27 -0
- package/dist/types/pools/lendingPool/getPositionsScaledDebt.d.ts +11 -0
- package/dist/types/pools/lendingPool/getRawUserDepositsInLendingPool.d.ts +4 -0
- package/dist/types/pools/lendingPool/getUserCollateralValue.d.ts +11 -0
- package/dist/types/pools/lendingPool/initializeLiquidation.d.ts +11 -0
- package/dist/types/pools/lendingPool/repayToLendingPool.d.ts +2 -2
- package/dist/types/pools/lendingPool/withdrawNFTFromLendingPool.d.ts +1 -1
- package/dist/types/pools/stabilityPool/depositNFTToStabilityPool.d.ts +4 -0
- package/dist/types/pools/stabilityPool/getRawUserDepositsInStabilityPool.d.ts +4 -0
- package/dist/types/pools/stabilityPool/getStabilityPoolInfo.d.ts +1 -3
- package/dist/types/typechain-types/@chainlink/contracts/src/v0.8/index.d.ts +2 -0
- package/dist/types/typechain-types/@chainlink/contracts/src/v0.8/vrf/VRFConsumerBaseV2.d.ts +35 -0
- package/dist/types/typechain-types/@chainlink/contracts/src/v0.8/vrf/index.d.ts +3 -0
- package/dist/types/typechain-types/@chainlink/contracts/src/v0.8/vrf/interfaces/VRFCoordinatorV2Interface.d.ts +156 -0
- package/dist/types/typechain-types/@chainlink/contracts/src/v0.8/vrf/interfaces/index.d.ts +1 -0
- package/dist/types/typechain-types/contracts/core/collectors/FeeCollector.d.ts +446 -221
- package/dist/types/typechain-types/contracts/core/minters/RAACMinter/RAACMinter.d.ts +108 -20
- package/dist/types/typechain-types/contracts/core/minters/RAACReleaseOrchestrator/RAACReleaseOrchestrator.d.ts +6 -16
- package/dist/types/typechain-types/contracts/core/oracles/BaseVRFv2Consumer.d.ts +166 -0
- package/dist/types/typechain-types/contracts/core/oracles/index.d.ts +1 -0
- package/dist/types/typechain-types/contracts/core/pools/LendingPool/LendingPool.d.ts +811 -99
- package/dist/types/typechain-types/contracts/core/pools/StabilityPool/StabilityPool.d.ts +152 -148
- package/dist/types/typechain-types/contracts/core/pools/StabilityPool/index.d.ts +0 -1
- package/dist/types/typechain-types/contracts/core/primitives/RAACHousePrices.d.ts +29 -2
- package/dist/types/typechain-types/contracts/core/tokens/DebtToken.d.ts +65 -51
- package/dist/types/typechain-types/contracts/core/tokens/IndexToken.d.ts +187 -2
- package/dist/types/typechain-types/contracts/core/tokens/RAACNFT.d.ts +413 -19
- package/dist/types/typechain-types/contracts/core/tokens/RToken.d.ts +40 -40
- package/dist/types/typechain-types/contracts/interfaces/core/collectors/IBaseCollector.d.ts +39 -0
- package/dist/types/typechain-types/contracts/interfaces/core/collectors/IFeeCollector.d.ts +317 -130
- package/dist/types/typechain-types/contracts/interfaces/core/collectors/index.d.ts +1 -0
- package/dist/types/typechain-types/contracts/interfaces/core/index.d.ts +2 -0
- package/dist/types/typechain-types/contracts/interfaces/core/minters/RAACMinter/IRAACMinter.d.ts +58 -22
- package/dist/types/typechain-types/contracts/interfaces/core/minters/RAACReleaseOrchestrator/IReleaseOrchestrator.d.ts +5 -3
- package/dist/types/typechain-types/contracts/interfaces/core/oracles/IBaseVRFv2Consumer.d.ts +86 -0
- package/dist/types/typechain-types/contracts/interfaces/core/oracles/index.d.ts +1 -0
- package/dist/types/typechain-types/contracts/interfaces/core/pools/ILiquidityPool.d.ts +83 -45
- package/dist/types/typechain-types/contracts/interfaces/core/pools/LendingPool/ILendingPool.d.ts +539 -54
- package/dist/types/typechain-types/contracts/interfaces/core/pools/StabilityPool/IStabilityPool.d.ts +92 -71
- package/dist/types/typechain-types/contracts/interfaces/core/tokens/IDebtToken.d.ts +123 -27
- package/dist/types/typechain-types/contracts/interfaces/core/tokens/IIndexToken.d.ts +187 -0
- package/dist/types/typechain-types/contracts/interfaces/core/tokens/IRAACNFT.d.ts +243 -17
- package/dist/types/typechain-types/contracts/interfaces/core/tokens/IRToken.d.ts +37 -37
- package/dist/types/typechain-types/contracts/interfaces/core/tokens/index.d.ts +1 -0
- package/dist/types/typechain-types/contracts/interfaces/core/vaults/IBaseVault.d.ts +83 -0
- package/dist/types/typechain-types/contracts/interfaces/core/vaults/index.d.ts +1 -0
- package/dist/types/typechain-types/contracts/interfaces/index.d.ts +0 -1
- package/dist/types/typechain-types/contracts/mocks/core/collectors/index.d.ts +0 -1
- package/dist/types/typechain-types/contracts/mocks/core/governance/proposals/TimelockTestTarget.d.ts +5 -1
- package/dist/types/typechain-types/contracts/mocks/core/index.d.ts +2 -0
- package/dist/types/typechain-types/contracts/mocks/core/oracles/MockVRFCoordinatorV2.d.ts +530 -0
- package/dist/types/typechain-types/contracts/mocks/core/oracles/index.d.ts +1 -0
- package/dist/types/typechain-types/contracts/mocks/core/pools/MockLendingPoolCollector.d.ts +156 -0
- package/dist/types/typechain-types/contracts/mocks/core/pools/MockLendingPoolDebtToken.d.ts +557 -102
- package/dist/types/typechain-types/contracts/mocks/core/pools/MockLiquidityPool.d.ts +486 -0
- package/dist/types/typechain-types/contracts/mocks/core/pools/index.d.ts +2 -0
- package/dist/types/typechain-types/contracts/mocks/core/primitives/MockDistributableContract.d.ts +35 -0
- package/dist/types/typechain-types/contracts/mocks/core/primitives/index.d.ts +1 -0
- package/dist/types/typechain-types/contracts/mocks/core/tokens/MockCollectableUnderlying.d.ts +292 -0
- package/dist/types/typechain-types/contracts/mocks/core/tokens/index.d.ts +1 -0
- package/dist/types/typechain-types/contracts/mocks/core/vaults/MockVault.d.ts +290 -0
- package/dist/types/typechain-types/contracts/mocks/core/vaults/index.d.ts +1 -0
- package/dist/types/typechain-types/contracts/mocks/libraries/MockStringUtils.d.ts +25 -0
- package/dist/types/typechain-types/contracts/mocks/libraries/index.d.ts +1 -0
- package/dist/types/typechain-types/factories/@chainlink/contracts/src/v0.8/index.d.ts +1 -0
- package/dist/types/typechain-types/factories/@chainlink/contracts/src/v0.8/vrf/VRFConsumerBaseV2__factory.d.ts +33 -0
- package/dist/types/typechain-types/factories/@chainlink/contracts/src/v0.8/vrf/index.d.ts +2 -0
- package/dist/types/typechain-types/factories/@chainlink/contracts/src/v0.8/vrf/interfaces/VRFCoordinatorV2Interface__factory.d.ts +171 -0
- package/dist/types/typechain-types/factories/@chainlink/contracts/src/v0.8/vrf/interfaces/index.d.ts +1 -0
- package/dist/types/typechain-types/factories/contracts/core/collectors/FeeCollector__factory.d.ts +571 -194
- package/dist/types/typechain-types/factories/contracts/core/minters/RAACMinter/RAACMinter__factory.d.ts +138 -54
- package/dist/types/typechain-types/factories/contracts/core/minters/RAACReleaseOrchestrator/RAACReleaseOrchestrator__factory.d.ts +5 -31
- package/dist/types/typechain-types/factories/contracts/core/oracles/BaseVRFv2Consumer__factory.d.ts +231 -0
- package/dist/types/typechain-types/factories/contracts/core/oracles/RAACHousePriceOracle__factory.d.ts +1 -1
- package/dist/types/typechain-types/factories/contracts/core/oracles/RAACPrimeRateOracle__factory.d.ts +1 -1
- package/dist/types/typechain-types/factories/contracts/core/oracles/index.d.ts +1 -0
- package/dist/types/typechain-types/factories/contracts/core/pools/LendingPool/LendingPool__factory.d.ts +897 -64
- package/dist/types/typechain-types/factories/contracts/core/pools/StabilityPool/NFTLiquidator__factory.d.ts +1 -1
- package/dist/types/typechain-types/factories/contracts/core/pools/StabilityPool/StabilityPool__factory.d.ts +128 -161
- package/dist/types/typechain-types/factories/contracts/core/pools/StabilityPool/index.d.ts +0 -1
- package/dist/types/typechain-types/factories/contracts/core/primitives/RAACHousePrices__factory.d.ts +54 -1
- package/dist/types/typechain-types/factories/contracts/core/tokens/DebtToken__factory.d.ts +47 -29
- package/dist/types/typechain-types/factories/contracts/core/tokens/IndexToken__factory.d.ts +317 -1
- package/dist/types/typechain-types/factories/contracts/core/tokens/RAACNFT__factory.d.ts +525 -17
- package/dist/types/typechain-types/factories/contracts/core/tokens/RAACToken__factory.d.ts +1 -1
- package/dist/types/typechain-types/factories/contracts/core/tokens/RToken__factory.d.ts +52 -52
- package/dist/types/typechain-types/factories/contracts/core/tokens/VeRAACToken__factory.d.ts +1 -1
- package/dist/types/typechain-types/factories/contracts/interfaces/core/collectors/IBaseCollector__factory.d.ts +33 -0
- package/dist/types/typechain-types/factories/contracts/interfaces/core/collectors/IFeeCollector__factory.d.ts +409 -90
- package/dist/types/typechain-types/factories/contracts/interfaces/core/collectors/index.d.ts +1 -0
- package/dist/types/typechain-types/factories/contracts/interfaces/core/index.d.ts +1 -0
- package/dist/types/typechain-types/factories/contracts/interfaces/core/minters/RAACMinter/IRAACMinter__factory.d.ts +59 -15
- package/dist/types/typechain-types/factories/contracts/interfaces/core/minters/RAACReleaseOrchestrator/IReleaseOrchestrator__factory.d.ts +4 -0
- package/dist/types/typechain-types/factories/contracts/interfaces/core/oracles/IBaseVRFv2Consumer__factory.d.ts +78 -0
- package/dist/types/typechain-types/factories/contracts/interfaces/core/oracles/index.d.ts +1 -0
- package/dist/types/typechain-types/factories/contracts/interfaces/core/pools/ILiquidityPool__factory.d.ts +119 -39
- package/dist/types/typechain-types/factories/contracts/interfaces/core/pools/LendingPool/ILendingPool__factory.d.ts +547 -19
- package/dist/types/typechain-types/factories/contracts/interfaces/core/pools/StabilityPool/IStabilityPool__factory.d.ts +68 -67
- package/dist/types/typechain-types/factories/contracts/interfaces/core/tokens/IDebtToken__factory.d.ts +119 -6
- package/dist/types/typechain-types/factories/{erc721a/contracts/IERC721A__factory.d.ts → contracts/interfaces/core/tokens/IIndexToken__factory.d.ts} +74 -215
- package/dist/types/typechain-types/factories/contracts/interfaces/core/tokens/IRAACNFT__factory.d.ts +274 -10
- package/dist/types/typechain-types/factories/contracts/interfaces/core/tokens/IRToken__factory.d.ts +26 -26
- package/dist/types/typechain-types/factories/contracts/interfaces/core/tokens/index.d.ts +1 -0
- package/dist/types/typechain-types/factories/contracts/interfaces/{IMarketCreator__factory.d.ts → core/vaults/IBaseVault__factory.d.ts} +78 -42
- package/dist/types/typechain-types/factories/contracts/interfaces/core/vaults/index.d.ts +1 -0
- package/dist/types/typechain-types/factories/contracts/interfaces/index.d.ts +0 -1
- package/dist/types/typechain-types/factories/contracts/libraries/pools/ReserveLibrary__factory.d.ts +1 -1
- package/dist/types/typechain-types/factories/contracts/mocks/core/collectors/index.d.ts +0 -1
- package/dist/types/typechain-types/factories/contracts/mocks/core/governance/gauges/MockBaseGauge__factory.d.ts +16 -4
- package/dist/types/typechain-types/factories/contracts/mocks/core/governance/proposals/TimelockTestTarget__factory.d.ts +10 -1
- package/dist/types/typechain-types/factories/contracts/mocks/core/index.d.ts +1 -0
- package/dist/types/typechain-types/factories/contracts/mocks/core/oracles/MockOracle__factory.d.ts +1 -1
- package/dist/types/typechain-types/factories/contracts/mocks/core/oracles/MockVRFCoordinatorV2__factory.d.ts +620 -0
- package/dist/types/typechain-types/factories/contracts/mocks/core/oracles/TestRAACHousePriceOracle__factory.d.ts +1 -1
- package/dist/types/typechain-types/factories/contracts/mocks/core/oracles/TestRAACPrimeRateOracle__factory.d.ts +1 -1
- package/dist/types/typechain-types/factories/contracts/mocks/core/oracles/index.d.ts +1 -0
- package/dist/types/typechain-types/factories/contracts/mocks/core/pools/MockLendingPoolCollector__factory.d.ts +234 -0
- package/dist/types/typechain-types/factories/contracts/mocks/core/pools/MockLendingPoolDebtToken__factory.d.ts +539 -77
- package/dist/types/typechain-types/factories/contracts/mocks/core/pools/MockLendingPool__factory.d.ts +1 -1
- package/dist/types/typechain-types/factories/contracts/mocks/core/pools/MockLiquidityPool__factory.d.ts +795 -0
- package/dist/types/typechain-types/factories/contracts/mocks/core/pools/MockStabilityPool__factory.d.ts +1 -1
- package/dist/types/typechain-types/factories/contracts/mocks/core/pools/index.d.ts +2 -0
- package/dist/types/typechain-types/factories/contracts/mocks/core/primitives/MockDistributableContract__factory.d.ts +68 -0
- package/dist/types/typechain-types/factories/contracts/mocks/core/primitives/index.d.ts +1 -0
- package/dist/types/typechain-types/factories/contracts/mocks/core/tokens/MockCollectableUnderlying__factory.d.ts +451 -0
- package/dist/types/typechain-types/factories/contracts/mocks/core/tokens/index.d.ts +1 -0
- package/dist/types/typechain-types/factories/contracts/mocks/core/vaults/MockVault__factory.d.ts +525 -0
- package/dist/types/typechain-types/factories/contracts/mocks/core/vaults/index.d.ts +1 -0
- package/dist/types/typechain-types/factories/contracts/mocks/libraries/MockStringUtils__factory.d.ts +40 -0
- package/dist/types/typechain-types/factories/contracts/mocks/libraries/index.d.ts +1 -0
- package/dist/types/typechain-types/factories/contracts/mocks/libraries/pools/ReserveLibraryMock__factory.d.ts +1 -1
- package/dist/types/typechain-types/factories/contracts/mocks/tests/VeRAACFuzzHelper__factory.d.ts +1 -1
- package/dist/types/typechain-types/factories/index.d.ts +0 -1
- package/dist/types/typechain-types/index.d.ts +28 -10
- package/dist/types/utils/artifacts.d.ts +677 -39
- package/dist/types/utils/contracts.d.ts +2 -0
- package/dist/utils/artifacts.js +9 -0
- package/package.json +1 -1
- package/dist/nfts/getDepositedNFTs.js +0 -19
- package/dist/nfts/getOwnedNFTs.js +0 -34
- package/dist/types/nfts/addNewBatch.d.ts +0 -4
- package/dist/types/nfts/getCurrentBatchSize.d.ts +0 -4
- package/dist/types/nfts/getDepositedNFTs.d.ts +0 -7
- package/dist/types/nfts/getOwnedNFTs.d.ts +0 -7
- package/dist/types/typechain-types/contracts/core/pools/StabilityPool/MarketCreator.d.ts +0 -274
- package/dist/types/typechain-types/contracts/interfaces/IMarketCreator.d.ts +0 -85
- package/dist/types/typechain-types/contracts/mocks/core/collectors/MockFeeCollector.d.ts +0 -708
- package/dist/types/typechain-types/erc721a/contracts/IERC721A.d.ts +0 -242
- package/dist/types/typechain-types/erc721a/contracts/index.d.ts +0 -1
- package/dist/types/typechain-types/erc721a/index.d.ts +0 -2
- package/dist/types/typechain-types/factories/contracts/core/pools/StabilityPool/MarketCreator__factory.d.ts +0 -405
- package/dist/types/typechain-types/factories/contracts/mocks/core/collectors/MockFeeCollector__factory.d.ts +0 -985
- package/dist/types/typechain-types/factories/erc721a/contracts/index.d.ts +0 -1
- package/dist/types/typechain-types/factories/erc721a/index.d.ts +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Provider } from "ethers";
|
|
2
|
+
import { ChainId } from "../../configs/chains/index";
|
|
3
|
+
/**
|
|
4
|
+
* @description Get the raw debt of the user on a NFT. Equivant to the original amount borrowed on NFT.
|
|
5
|
+
* @param chainId
|
|
6
|
+
* @param address
|
|
7
|
+
* @param provider
|
|
8
|
+
* @returns The raw debt of the user on a NFT
|
|
9
|
+
*/
|
|
10
|
+
declare function getPositionDebt(chainId: ChainId, address: string, tokenId: string, provider: Provider): Promise<bigint>;
|
|
11
|
+
export default getPositionDebt;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Provider } from "ethers";
|
|
2
|
+
import { ChainId } from "../../configs/chains/index";
|
|
3
|
+
/**
|
|
4
|
+
* @description Get the scaled debt of the user on a NFT (contains the accured interest)
|
|
5
|
+
* @param chainId
|
|
6
|
+
* @param address
|
|
7
|
+
* @param provider
|
|
8
|
+
* @returns The debt of the user on a NFT with the accured interest
|
|
9
|
+
*/
|
|
10
|
+
declare function getPositionScaledDebt(chainId: ChainId, address: string, tokenId: string, provider: Provider): Promise<bigint>;
|
|
11
|
+
export default getPositionScaledDebt;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Provider } from "ethers";
|
|
2
|
+
import { ChainId } from "../../configs/chains/index";
|
|
3
|
+
import { ILendingPool } from "../../typechain-types";
|
|
4
|
+
export declare function transformPositionView(positionView: ILendingPool.NFTPositionViewStructOutput): {
|
|
5
|
+
rawDebtBalance: string;
|
|
6
|
+
scaledDebtBalance: string;
|
|
7
|
+
healthFactor: string;
|
|
8
|
+
isUnderLiquidation: boolean;
|
|
9
|
+
liquidationStartTime: string;
|
|
10
|
+
positionIndex: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* @description Return all the information about a NFT position
|
|
14
|
+
* @param chainId
|
|
15
|
+
* @param address
|
|
16
|
+
* @param provider
|
|
17
|
+
* @returns All information about a NFT position
|
|
18
|
+
*/
|
|
19
|
+
declare function getPositionView(chainId: ChainId, address: string, tokenId: string, provider: Provider): Promise<{
|
|
20
|
+
rawDebtBalance: string;
|
|
21
|
+
scaledDebtBalance: string;
|
|
22
|
+
healthFactor: string;
|
|
23
|
+
isUnderLiquidation: boolean;
|
|
24
|
+
liquidationStartTime: string;
|
|
25
|
+
positionIndex: string;
|
|
26
|
+
}>;
|
|
27
|
+
export default getPositionView;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Provider } from "ethers";
|
|
2
|
+
import { ChainId } from "../../configs/chains/index";
|
|
3
|
+
/**
|
|
4
|
+
* @description Get the sum of all the scaled debts of a user over all NFTs
|
|
5
|
+
* @param chainId
|
|
6
|
+
* @param address
|
|
7
|
+
* @param provider
|
|
8
|
+
* @returns The debt of the user
|
|
9
|
+
*/
|
|
10
|
+
declare function getPositionsScaledDebt(chainId: ChainId, address: string, provider: Provider): Promise<bigint>;
|
|
11
|
+
export default getPositionsScaledDebt;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Provider } from "ethers";
|
|
2
|
+
import { ChainId } from "../../configs/chains/index";
|
|
3
|
+
/**
|
|
4
|
+
* @description Sum of the prices of all the NFTS
|
|
5
|
+
* @param chainId
|
|
6
|
+
* @param address
|
|
7
|
+
* @param provider
|
|
8
|
+
* @returns The total value of the collateral
|
|
9
|
+
*/
|
|
10
|
+
declare function getUserCollateralValue(chainId: ChainId, address: string, provider: Provider): Promise<bigint>;
|
|
11
|
+
export default getUserCollateralValue;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ethers, Signer } from "ethers";
|
|
2
|
+
import { ChainId } from "../../configs/chains/index";
|
|
3
|
+
/**
|
|
4
|
+
* @description Get the sum of all the scaled debts of a user over all NFTs
|
|
5
|
+
* @param chainId
|
|
6
|
+
* @param address
|
|
7
|
+
* @param provider
|
|
8
|
+
* @returns The debt of the user
|
|
9
|
+
*/
|
|
10
|
+
declare function initializeLiquidation(chainId: ChainId, address: string, tokenId: string, signer: Signer): Promise<ethers.ContractTransactionResponse>;
|
|
11
|
+
export default initializeLiquidation;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ethers,
|
|
1
|
+
import { ethers, Signer } from "ethers";
|
|
2
2
|
import { ChainId } from "../../configs/chains/index";
|
|
3
|
-
declare function repayToLendingPool(chainId: ChainId, tokenId: string
|
|
3
|
+
declare function repayToLendingPool(chainId: ChainId, tokenId: string, amount: string, signer: Signer): Promise<ethers.ContractTransactionReceipt>;
|
|
4
4
|
export default repayToLendingPool;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ethers, Signer } from "ethers";
|
|
2
2
|
import { ChainId } from "../../configs/chains/index";
|
|
3
|
-
declare function withdrawNFTFromLendingPool(chainId: ChainId, tokenId:
|
|
3
|
+
declare function withdrawNFTFromLendingPool(chainId: ChainId, tokenId: string, signer: Signer): Promise<ethers.ContractTransactionResponse>;
|
|
4
4
|
export default withdrawNFTFromLendingPool;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ethers, Signer } from "ethers";
|
|
2
|
+
import { ChainId } from "../../configs/chains/index";
|
|
3
|
+
declare function depositNFTToStabilityPool(chainId: ChainId, tokenId: string, signer: Signer): Promise<ethers.ContractTransactionReceipt>;
|
|
4
|
+
export default depositNFTToStabilityPool;
|
|
@@ -2,9 +2,7 @@ import { Provider } from "ethers";
|
|
|
2
2
|
import { ChainId } from "../../configs/chains/index";
|
|
3
3
|
declare function getStabilityPoolInfo(chainId: ChainId, address: string, provider: Provider): Promise<{
|
|
4
4
|
totalDeposits: string;
|
|
5
|
-
totalAllocation:
|
|
6
|
-
exchangeRate: string;
|
|
7
|
-
totalRAACRewards: string;
|
|
5
|
+
totalAllocation: any;
|
|
8
6
|
userDeposit: string;
|
|
9
7
|
pendingRewards: string;
|
|
10
8
|
apy: number;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { BaseContract, BigNumberish, BytesLike, FunctionFragment, Result, Interface, ContractRunner, ContractMethod, Listener } from "ethers";
|
|
2
|
+
import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedListener, TypedContractMethod } from "../../../../../common";
|
|
3
|
+
export interface VRFConsumerBaseV2Interface extends Interface {
|
|
4
|
+
getFunction(nameOrSignature: "rawFulfillRandomWords"): FunctionFragment;
|
|
5
|
+
encodeFunctionData(functionFragment: "rawFulfillRandomWords", values: [BigNumberish, BigNumberish[]]): string;
|
|
6
|
+
decodeFunctionResult(functionFragment: "rawFulfillRandomWords", data: BytesLike): Result;
|
|
7
|
+
}
|
|
8
|
+
export interface VRFConsumerBaseV2 extends BaseContract {
|
|
9
|
+
connect(runner?: ContractRunner | null): VRFConsumerBaseV2;
|
|
10
|
+
waitForDeployment(): Promise<this>;
|
|
11
|
+
interface: VRFConsumerBaseV2Interface;
|
|
12
|
+
queryFilter<TCEvent extends TypedContractEvent>(event: TCEvent, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
13
|
+
queryFilter<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
14
|
+
on<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
|
|
15
|
+
on<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>;
|
|
16
|
+
once<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
|
|
17
|
+
once<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>;
|
|
18
|
+
listeners<TCEvent extends TypedContractEvent>(event: TCEvent): Promise<Array<TypedListener<TCEvent>>>;
|
|
19
|
+
listeners(eventName?: string): Promise<Array<Listener>>;
|
|
20
|
+
removeAllListeners<TCEvent extends TypedContractEvent>(event?: TCEvent): Promise<this>;
|
|
21
|
+
rawFulfillRandomWords: TypedContractMethod<[
|
|
22
|
+
requestId: BigNumberish,
|
|
23
|
+
randomWords: BigNumberish[]
|
|
24
|
+
], [
|
|
25
|
+
void
|
|
26
|
+
], "nonpayable">;
|
|
27
|
+
getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
|
|
28
|
+
getFunction(nameOrSignature: "rawFulfillRandomWords"): TypedContractMethod<[
|
|
29
|
+
requestId: BigNumberish,
|
|
30
|
+
randomWords: BigNumberish[]
|
|
31
|
+
], [
|
|
32
|
+
void
|
|
33
|
+
], "nonpayable">;
|
|
34
|
+
filters: {};
|
|
35
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import type { BaseContract, BigNumberish, BytesLike, FunctionFragment, Result, Interface, AddressLike, ContractRunner, ContractMethod, Listener } from "ethers";
|
|
2
|
+
import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedListener, TypedContractMethod } from "../../../../../../common";
|
|
3
|
+
export interface VRFCoordinatorV2InterfaceInterface extends Interface {
|
|
4
|
+
getFunction(nameOrSignature: "acceptSubscriptionOwnerTransfer" | "addConsumer" | "cancelSubscription" | "createSubscription" | "getRequestConfig" | "getSubscription" | "pendingRequestExists" | "removeConsumer" | "requestRandomWords" | "requestSubscriptionOwnerTransfer"): FunctionFragment;
|
|
5
|
+
encodeFunctionData(functionFragment: "acceptSubscriptionOwnerTransfer", values: [BigNumberish]): string;
|
|
6
|
+
encodeFunctionData(functionFragment: "addConsumer", values: [BigNumberish, AddressLike]): string;
|
|
7
|
+
encodeFunctionData(functionFragment: "cancelSubscription", values: [BigNumberish, AddressLike]): string;
|
|
8
|
+
encodeFunctionData(functionFragment: "createSubscription", values?: undefined): string;
|
|
9
|
+
encodeFunctionData(functionFragment: "getRequestConfig", values?: undefined): string;
|
|
10
|
+
encodeFunctionData(functionFragment: "getSubscription", values: [BigNumberish]): string;
|
|
11
|
+
encodeFunctionData(functionFragment: "pendingRequestExists", values: [BigNumberish]): string;
|
|
12
|
+
encodeFunctionData(functionFragment: "removeConsumer", values: [BigNumberish, AddressLike]): string;
|
|
13
|
+
encodeFunctionData(functionFragment: "requestRandomWords", values: [BytesLike, BigNumberish, BigNumberish, BigNumberish, BigNumberish]): string;
|
|
14
|
+
encodeFunctionData(functionFragment: "requestSubscriptionOwnerTransfer", values: [BigNumberish, AddressLike]): string;
|
|
15
|
+
decodeFunctionResult(functionFragment: "acceptSubscriptionOwnerTransfer", data: BytesLike): Result;
|
|
16
|
+
decodeFunctionResult(functionFragment: "addConsumer", data: BytesLike): Result;
|
|
17
|
+
decodeFunctionResult(functionFragment: "cancelSubscription", data: BytesLike): Result;
|
|
18
|
+
decodeFunctionResult(functionFragment: "createSubscription", data: BytesLike): Result;
|
|
19
|
+
decodeFunctionResult(functionFragment: "getRequestConfig", data: BytesLike): Result;
|
|
20
|
+
decodeFunctionResult(functionFragment: "getSubscription", data: BytesLike): Result;
|
|
21
|
+
decodeFunctionResult(functionFragment: "pendingRequestExists", data: BytesLike): Result;
|
|
22
|
+
decodeFunctionResult(functionFragment: "removeConsumer", data: BytesLike): Result;
|
|
23
|
+
decodeFunctionResult(functionFragment: "requestRandomWords", data: BytesLike): Result;
|
|
24
|
+
decodeFunctionResult(functionFragment: "requestSubscriptionOwnerTransfer", data: BytesLike): Result;
|
|
25
|
+
}
|
|
26
|
+
export interface VRFCoordinatorV2Interface extends BaseContract {
|
|
27
|
+
connect(runner?: ContractRunner | null): VRFCoordinatorV2Interface;
|
|
28
|
+
waitForDeployment(): Promise<this>;
|
|
29
|
+
interface: VRFCoordinatorV2InterfaceInterface;
|
|
30
|
+
queryFilter<TCEvent extends TypedContractEvent>(event: TCEvent, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
31
|
+
queryFilter<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
32
|
+
on<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
|
|
33
|
+
on<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>;
|
|
34
|
+
once<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
|
|
35
|
+
once<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>;
|
|
36
|
+
listeners<TCEvent extends TypedContractEvent>(event: TCEvent): Promise<Array<TypedListener<TCEvent>>>;
|
|
37
|
+
listeners(eventName?: string): Promise<Array<Listener>>;
|
|
38
|
+
removeAllListeners<TCEvent extends TypedContractEvent>(event?: TCEvent): Promise<this>;
|
|
39
|
+
acceptSubscriptionOwnerTransfer: TypedContractMethod<[
|
|
40
|
+
subId: BigNumberish
|
|
41
|
+
], [
|
|
42
|
+
void
|
|
43
|
+
], "nonpayable">;
|
|
44
|
+
addConsumer: TypedContractMethod<[
|
|
45
|
+
subId: BigNumberish,
|
|
46
|
+
consumer: AddressLike
|
|
47
|
+
], [
|
|
48
|
+
void
|
|
49
|
+
], "nonpayable">;
|
|
50
|
+
cancelSubscription: TypedContractMethod<[
|
|
51
|
+
subId: BigNumberish,
|
|
52
|
+
to: AddressLike
|
|
53
|
+
], [
|
|
54
|
+
void
|
|
55
|
+
], "nonpayable">;
|
|
56
|
+
createSubscription: TypedContractMethod<[], [bigint], "nonpayable">;
|
|
57
|
+
getRequestConfig: TypedContractMethod<[
|
|
58
|
+
], [
|
|
59
|
+
[bigint, bigint, string[]]
|
|
60
|
+
], "view">;
|
|
61
|
+
getSubscription: TypedContractMethod<[
|
|
62
|
+
subId: BigNumberish
|
|
63
|
+
], [
|
|
64
|
+
[
|
|
65
|
+
bigint,
|
|
66
|
+
bigint,
|
|
67
|
+
string,
|
|
68
|
+
string[]
|
|
69
|
+
] & {
|
|
70
|
+
balance: bigint;
|
|
71
|
+
reqCount: bigint;
|
|
72
|
+
owner: string;
|
|
73
|
+
consumers: string[];
|
|
74
|
+
}
|
|
75
|
+
], "view">;
|
|
76
|
+
pendingRequestExists: TypedContractMethod<[
|
|
77
|
+
subId: BigNumberish
|
|
78
|
+
], [
|
|
79
|
+
boolean
|
|
80
|
+
], "view">;
|
|
81
|
+
removeConsumer: TypedContractMethod<[
|
|
82
|
+
subId: BigNumberish,
|
|
83
|
+
consumer: AddressLike
|
|
84
|
+
], [
|
|
85
|
+
void
|
|
86
|
+
], "nonpayable">;
|
|
87
|
+
requestRandomWords: TypedContractMethod<[
|
|
88
|
+
keyHash: BytesLike,
|
|
89
|
+
subId: BigNumberish,
|
|
90
|
+
minimumRequestConfirmations: BigNumberish,
|
|
91
|
+
callbackGasLimit: BigNumberish,
|
|
92
|
+
numWords: BigNumberish
|
|
93
|
+
], [
|
|
94
|
+
bigint
|
|
95
|
+
], "nonpayable">;
|
|
96
|
+
requestSubscriptionOwnerTransfer: TypedContractMethod<[
|
|
97
|
+
subId: BigNumberish,
|
|
98
|
+
newOwner: AddressLike
|
|
99
|
+
], [
|
|
100
|
+
void
|
|
101
|
+
], "nonpayable">;
|
|
102
|
+
getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
|
|
103
|
+
getFunction(nameOrSignature: "acceptSubscriptionOwnerTransfer"): TypedContractMethod<[subId: BigNumberish], [void], "nonpayable">;
|
|
104
|
+
getFunction(nameOrSignature: "addConsumer"): TypedContractMethod<[
|
|
105
|
+
subId: BigNumberish,
|
|
106
|
+
consumer: AddressLike
|
|
107
|
+
], [
|
|
108
|
+
void
|
|
109
|
+
], "nonpayable">;
|
|
110
|
+
getFunction(nameOrSignature: "cancelSubscription"): TypedContractMethod<[
|
|
111
|
+
subId: BigNumberish,
|
|
112
|
+
to: AddressLike
|
|
113
|
+
], [
|
|
114
|
+
void
|
|
115
|
+
], "nonpayable">;
|
|
116
|
+
getFunction(nameOrSignature: "createSubscription"): TypedContractMethod<[], [bigint], "nonpayable">;
|
|
117
|
+
getFunction(nameOrSignature: "getRequestConfig"): TypedContractMethod<[], [[bigint, bigint, string[]]], "view">;
|
|
118
|
+
getFunction(nameOrSignature: "getSubscription"): TypedContractMethod<[
|
|
119
|
+
subId: BigNumberish
|
|
120
|
+
], [
|
|
121
|
+
[
|
|
122
|
+
bigint,
|
|
123
|
+
bigint,
|
|
124
|
+
string,
|
|
125
|
+
string[]
|
|
126
|
+
] & {
|
|
127
|
+
balance: bigint;
|
|
128
|
+
reqCount: bigint;
|
|
129
|
+
owner: string;
|
|
130
|
+
consumers: string[];
|
|
131
|
+
}
|
|
132
|
+
], "view">;
|
|
133
|
+
getFunction(nameOrSignature: "pendingRequestExists"): TypedContractMethod<[subId: BigNumberish], [boolean], "view">;
|
|
134
|
+
getFunction(nameOrSignature: "removeConsumer"): TypedContractMethod<[
|
|
135
|
+
subId: BigNumberish,
|
|
136
|
+
consumer: AddressLike
|
|
137
|
+
], [
|
|
138
|
+
void
|
|
139
|
+
], "nonpayable">;
|
|
140
|
+
getFunction(nameOrSignature: "requestRandomWords"): TypedContractMethod<[
|
|
141
|
+
keyHash: BytesLike,
|
|
142
|
+
subId: BigNumberish,
|
|
143
|
+
minimumRequestConfirmations: BigNumberish,
|
|
144
|
+
callbackGasLimit: BigNumberish,
|
|
145
|
+
numWords: BigNumberish
|
|
146
|
+
], [
|
|
147
|
+
bigint
|
|
148
|
+
], "nonpayable">;
|
|
149
|
+
getFunction(nameOrSignature: "requestSubscriptionOwnerTransfer"): TypedContractMethod<[
|
|
150
|
+
subId: BigNumberish,
|
|
151
|
+
newOwner: AddressLike
|
|
152
|
+
], [
|
|
153
|
+
void
|
|
154
|
+
], "nonpayable">;
|
|
155
|
+
filters: {};
|
|
156
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { VRFCoordinatorV2Interface } from "./VRFCoordinatorV2Interface";
|