impermax-sdk 1.2.112 → 2.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/lib/abis/ImpermaxABI.d.ts +2 -2
- package/lib/abis/ImpermaxABI.js +3 -3
- package/lib/abis/contracts/ClaimAggregator.json +2015 -2015
- package/lib/abis/contracts/IAllowanceTransfer.json +3772 -0
- package/lib/abis/contracts/IBorrowable.json +13207 -13207
- package/lib/abis/contracts/IClaimable.json +406 -406
- package/lib/abis/contracts/ICollateral.json +9052 -9052
- package/lib/abis/contracts/IERC20.json +2376 -2376
- package/lib/abis/contracts/IERC721.json +3515 -0
- package/lib/abis/contracts/IFactory.json +3660 -3660
- package/lib/abis/contracts/IFarmingPool.json +3584 -3584
- package/lib/abis/contracts/ILendingVaultV1.json +8358 -8358
- package/lib/abis/contracts/IMerkleDistributor.json +1134 -1134
- package/lib/abis/contracts/IRouter02.json +7283 -7283
- package/lib/abis/contracts/ISimpleUniswapOracle.json +1469 -1469
- package/lib/abis/contracts/IStakedLPToken.json +7309 -7309
- package/lib/abis/contracts/IStakingRewards.json +1036 -1036
- package/lib/abis/contracts/ITokenizedUniswapV2Position.json +4167 -0
- package/lib/abis/contracts/ITokenizedUniswapV3Position.json +5539 -0
- package/lib/abis/contracts/IUniswapV2Factory.json +1690 -1690
- package/lib/abis/contracts/IUniswapV2Pair.json +6761 -6761
- package/lib/abis/contracts/IUniswapV3Pool.json +6606 -0
- package/lib/abis/contracts/ImpermaxChef.json +20945 -20945
- package/lib/abis/contracts/ImpermaxConfigManager.json +31595 -31595
- package/lib/abis/contracts/ImpermaxV3Borrowable.json +22131 -0
- package/lib/abis/contracts/ImpermaxV3Collateral.json +22988 -0
- package/lib/abis/contracts/ImpermaxV3Factory.json +17645 -0
- package/lib/abis/contracts/ImpermaxV3UniV2Router01.json +32488 -0
- package/lib/abis/contracts/ImpermaxV3UniV3Router01.json +37742 -0
- package/lib/abis/contracts/LendingVaultWatcher01.json +4076 -4076
- package/lib/abis/contracts/PoolTokenRouter01.json +9058 -0
- package/lib/config/amms.d.ts +102 -104
- package/lib/config/amms.js +433 -436
- package/lib/config/chainId.d.ts +2 -0
- package/lib/config/chainId.js +26 -0
- package/lib/config/contracts/claim-aggregators.d.ts +2 -2
- package/lib/config/contracts/claim-aggregators.js +26 -26
- package/lib/config/contracts/impermax-chef.d.ts +2 -2
- package/lib/config/contracts/impermax-chef.js +27 -27
- package/lib/config/contracts/impermax-config-manager.d.ts +2 -2
- package/lib/config/contracts/impermax-config-manager.js +26 -26
- package/lib/config/contracts/impermax-factories.d.ts +4 -4
- package/lib/config/contracts/impermax-factories.js +87 -87
- package/lib/config/contracts/imxes.d.ts +2 -2
- package/lib/config/contracts/imxes.js +26 -26
- package/lib/config/contracts/lending-vault-watcher.d.ts +2 -2
- package/lib/config/contracts/lending-vault-watcher.js +26 -26
- package/lib/config/contracts/merkle-distributors.d.ts +4 -4
- package/lib/config/contracts/merkle-distributors.js +70 -70
- package/lib/config/contracts/routers.d.ts +4 -3
- package/lib/config/contracts/routers.js +118 -94
- package/lib/config/contracts/simple-uniswap-oracles.d.ts +2 -2
- package/lib/config/contracts/simple-uniswap-oracles.js +49 -49
- package/lib/config/contracts/weths.d.ts +2 -2
- package/lib/config/contracts/weths.js +27 -27
- package/lib/config/debank-ids.d.ts +2 -2
- package/lib/config/debank-ids.js +26 -26
- package/lib/config/endpoints/merkle-distributors.d.ts +4 -4
- package/lib/config/endpoints/merkle-distributors.js +70 -70
- package/lib/config/eth.d.ts +3 -3
- package/lib/config/eth.js +48 -48
- package/lib/config/factories.d.ts +7 -7
- package/lib/config/factories.js +31 -30
- package/lib/config/farms.d.ts +109 -111
- package/lib/config/farms.js +207 -210
- package/lib/config/general.d.ts +5 -5
- package/lib/config/general.js +8 -8
- package/lib/config/subgraphs.d.ts +45 -45
- package/lib/config/subgraphs.js +187 -187
- package/lib/config/types.d.ts +85 -72
- package/lib/config/types.js +72 -58
- package/lib/index.d.ts +36 -35
- package/lib/index.js +159 -152
- package/lib/offchain/account/index.d.ts +9 -7
- package/lib/offchain/account/index.js +43 -39
- package/lib/offchain/account/lendingPool/borrowable.d.ts +14 -0
- package/lib/offchain/account/lendingPool/borrowable.js +73 -0
- package/lib/offchain/account/lendingPool/collateral.d.ts +12 -0
- package/lib/offchain/account/lendingPool/collateral.js +42 -0
- package/lib/offchain/account/lendingPool/index.d.ts +6 -5
- package/lib/offchain/account/lendingPool/index.js +14 -12
- package/lib/offchain/account/lendingPool/offchainAccountBorrowable.d.ts +14 -17
- package/lib/offchain/account/lendingPool/offchainAccountBorrowable.js +45 -71
- package/lib/offchain/account/lendingPool/offchainAccountCollateral.d.ts +11 -13
- package/lib/offchain/account/lendingPool/offchainAccountCollateral.js +31 -43
- package/lib/offchain/account/lendingPool/offchainAccountLendingPool.d.ts +28 -21
- package/lib/offchain/account/lendingPool/offchainAccountLendingPool.js +69 -68
- package/lib/offchain/account/lendingPool/offchainLeveragedPosition.d.ts +25 -0
- package/lib/offchain/account/lendingPool/offchainLeveragedPosition.js +116 -0
- package/lib/offchain/account/lendingVault.d.ts +11 -0
- package/lib/offchain/account/lendingVault.js +38 -0
- package/lib/offchain/account/offchainAccount.d.ts +25 -25
- package/lib/offchain/account/offchainAccount.js +129 -129
- package/lib/offchain/account/offchainAccountLendingVault.d.ts +16 -16
- package/lib/offchain/account/offchainAccountLendingVault.js +64 -64
- package/lib/offchain/account/offchainAccountPoolToken.d.ts +7 -7
- package/lib/offchain/account/offchainAccountPoolToken.js +24 -24
- package/lib/offchain/account/offchainMultichainAccount.d.ts +34 -0
- package/lib/offchain/account/offchainMultichainAccount.js +66 -0
- package/lib/offchain/account/poolToken.d.ts +6 -0
- package/lib/offchain/account/poolToken.js +21 -0
- package/lib/offchain/account/vault/index.d.ts +3 -0
- package/lib/offchain/account/vault/index.js +7 -0
- package/lib/offchain/account/vault/offchainAccountVault.d.ts +16 -0
- package/lib/offchain/account/vault/offchainAccountVault.js +64 -0
- package/lib/offchain/configManager/index.d.ts +5 -5
- package/lib/offchain/configManager/index.js +12 -12
- package/lib/offchain/configManager/offchainConfigManager.d.ts +25 -25
- package/lib/offchain/configManager/offchainConfigManager.js +76 -76
- package/lib/offchain/configManager/offchainConfigManagerInitializer.d.ts +6 -6
- package/lib/offchain/configManager/offchainConfigManagerInitializer.js +53 -53
- package/lib/offchain/configManager/offchainPairConfig.d.ts +40 -40
- package/lib/offchain/configManager/offchainPairConfig.js +86 -86
- package/lib/offchain/configManager/offchainProposal.d.ts +17 -17
- package/lib/offchain/configManager/offchainProposal.js +53 -53
- package/lib/offchain/index.d.ts +15 -14
- package/lib/offchain/index.js +55 -53
- package/lib/offchain/initializer.d.ts +32 -0
- package/lib/offchain/initializer.js +627 -0
- package/lib/offchain/lendingPool/borrowable.d.ts +55 -0
- package/lib/offchain/lendingPool/borrowable.js +351 -0
- package/lib/offchain/lendingPool/collateral.d.ts +17 -0
- package/lib/offchain/lendingPool/collateral.js +72 -0
- package/lib/offchain/lendingPool/index.d.ts +5 -5
- package/lib/offchain/lendingPool/index.js +12 -12
- package/lib/offchain/lendingPool/offchainBorrowable.d.ts +59 -59
- package/lib/offchain/lendingPool/offchainBorrowable.js +366 -366
- package/lib/offchain/lendingPool/offchainCollateral.d.ts +20 -19
- package/lib/offchain/lendingPool/offchainCollateral.js +81 -75
- package/lib/offchain/lendingPool/offchainLendingPool.d.ts +60 -47
- package/lib/offchain/lendingPool/offchainLendingPool.js +277 -230
- package/lib/offchain/lendingVault.d.ts +22 -0
- package/lib/offchain/lendingVault.js +115 -0
- package/lib/offchain/offchain.d.ts +106 -113
- package/lib/offchain/offchain.js +248 -251
- package/lib/offchain/offchainAPRHelper.d.ts +45 -45
- package/lib/offchain/offchainAPRHelper.js +239 -239
- package/lib/offchain/offchainEndpointManager.d.ts +25 -25
- package/lib/offchain/offchainEndpointManager.js +126 -126
- package/lib/offchain/offchainInitializer.d.ts +52 -52
- package/lib/offchain/offchainInitializer.js +792 -792
- package/lib/offchain/offchainLendingVault.d.ts +25 -25
- package/lib/offchain/offchainLendingVault.js +114 -114
- package/lib/offchain/offchainMultichain.d.ts +50 -0
- package/lib/offchain/offchainMultichain.js +75 -0
- package/lib/offchain/offchainPoolToken.d.ts +21 -21
- package/lib/offchain/offchainPoolToken.js +128 -128
- package/lib/offchain/offchainPriceHelper.d.ts +22 -22
- package/lib/offchain/offchainPriceHelper.js +364 -364
- package/lib/offchain/offchainSolidexHelper.d.ts +16 -16
- package/lib/offchain/offchainSolidexHelper.js +58 -58
- package/lib/offchain/offchainTypes.d.ts +212 -212
- package/lib/offchain/offchainTypes.js +3 -3
- package/lib/offchain/poolToken.d.ts +20 -0
- package/lib/offchain/poolToken.js +120 -0
- package/lib/offchain/priceHelper.d.ts +21 -0
- package/lib/offchain/priceHelper.js +195 -0
- package/lib/offchain/queries/apis/ponder/index.d.ts +14 -14
- package/lib/offchain/queries/apis/ponder/index.js +281 -281
- package/lib/offchain/queries/apis/thegraph/index.d.ts +19 -19
- package/lib/offchain/queries/apis/thegraph/index.js +355 -355
- package/lib/offchain/queries/index.d.ts +20 -20
- package/lib/offchain/queries/index.js +51 -51
- package/lib/offchain/queries/interfaces/query-builder.d.ts +19 -19
- package/lib/offchain/queries/interfaces/query-builder.js +2 -2
- package/lib/offchain/queries/interfaces/transformers.js +9 -9
- package/lib/offchain/query.d.ts +15 -0
- package/lib/offchain/query.js +323 -0
- package/lib/offchain/solidexHelper.d.ts +16 -0
- package/lib/offchain/solidexHelper.js +58 -0
- package/lib/offchain/types.d.ts +150 -0
- package/lib/offchain/types.js +3 -0
- package/lib/offchain/vault/index.d.ts +6 -0
- package/lib/offchain/vault/index.js +14 -0
- package/lib/offchain/vault/offchainHedgedVault.d.ts +9 -0
- package/lib/offchain/vault/offchainHedgedVault.js +57 -0
- package/lib/offchain/vault/offchainLendingVault.d.ts +16 -0
- package/lib/offchain/vault/offchainLendingVault.js +73 -0
- package/lib/offchain/vault/offchainLeveragedVault.d.ts +9 -0
- package/lib/offchain/vault/offchainLeveragedVault.js +57 -0
- package/lib/offchain/vault/offchainVault.d.ts +34 -0
- package/lib/offchain/vault/offchainVault.js +130 -0
- package/lib/onchain/account/index.d.ts +6 -6
- package/lib/onchain/account/index.js +38 -38
- package/lib/onchain/account/interactions/index.d.ts +28 -0
- package/lib/onchain/account/interactions/index.js +158 -0
- package/lib/onchain/account/interactions/lendingPool/borrowable.d.ts +16 -0
- package/lib/onchain/account/interactions/lendingPool/borrowable.js +49 -0
- package/lib/onchain/account/interactions/lendingPool/collateral.d.ts +15 -0
- package/lib/onchain/account/interactions/lendingPool/collateral.js +33 -0
- package/lib/onchain/account/interactions/lendingPool/index.d.ts +41 -0
- package/lib/onchain/account/interactions/lendingPool/index.js +120 -0
- package/lib/onchain/account/interactions/lendingVault.d.ts +10 -0
- package/lib/onchain/account/interactions/lendingVault.js +12 -0
- package/lib/onchain/account/interactions/poolToken.d.ts +33 -0
- package/lib/onchain/account/interactions/poolToken.js +180 -0
- package/lib/onchain/account/lendingPool/borrowable.d.ts +29 -0
- package/lib/onchain/account/lendingPool/borrowable.js +135 -0
- package/lib/onchain/account/lendingPool/collateral.d.ts +15 -0
- package/lib/onchain/account/lendingPool/collateral.js +66 -0
- package/lib/onchain/account/lendingPool/index.d.ts +12 -5
- package/lib/onchain/account/lendingPool/index.js +49 -12
- package/lib/onchain/account/lendingPool/nftlp/index.d.ts +4 -0
- package/lib/onchain/account/lendingPool/nftlp/index.js +11 -0
- package/lib/onchain/account/lendingPool/nftlp/onchainAccountNftlp.d.ts +7 -0
- package/lib/onchain/account/lendingPool/nftlp/onchainAccountNftlp.js +12 -0
- package/lib/onchain/account/lendingPool/nftlp/onchainAccountNftlpUniswapV3.d.ts +4 -0
- package/lib/onchain/account/lendingPool/nftlp/onchainAccountNftlpUniswapV3.js +13 -0
- package/lib/onchain/account/lendingPool/onchainAccountBorrowable.d.ts +39 -34
- package/lib/onchain/account/lendingPool/onchainAccountBorrowable.js +131 -176
- package/lib/onchain/account/lendingPool/onchainAccountBorrowableV2.d.ts +10 -0
- package/lib/onchain/account/lendingPool/onchainAccountBorrowableV2.js +55 -0
- package/lib/onchain/account/lendingPool/onchainAccountBorrowableV3.d.ts +10 -0
- package/lib/onchain/account/lendingPool/onchainAccountBorrowableV3.js +28 -0
- package/lib/onchain/account/lendingPool/onchainAccountCollateral.d.ts +10 -23
- package/lib/onchain/account/lendingPool/onchainAccountCollateral.js +26 -109
- package/lib/onchain/account/lendingPool/onchainAccountCollateralV2.d.ts +25 -0
- package/lib/onchain/account/lendingPool/onchainAccountCollateralV2.js +99 -0
- package/lib/onchain/account/lendingPool/onchainAccountCollateralV3.d.ts +18 -0
- package/lib/onchain/account/lendingPool/onchainAccountCollateralV3.js +44 -0
- package/lib/onchain/account/lendingPool/onchainAccountLendingPool.d.ts +42 -57
- package/lib/onchain/account/lendingPool/onchainAccountLendingPool.js +142 -352
- package/lib/onchain/account/lendingPool/onchainAccountLendingPoolV2.d.ts +44 -0
- package/lib/onchain/account/lendingPool/onchainAccountLendingPoolV2.js +285 -0
- package/lib/onchain/account/lendingPool/onchainAccountLendingPoolV3.d.ts +27 -0
- package/lib/onchain/account/lendingPool/onchainAccountLendingPoolV3.js +32 -0
- package/lib/onchain/account/lendingVault.d.ts +10 -0
- package/lib/onchain/account/lendingVault.js +35 -0
- package/lib/onchain/account/onchainAccount.d.ts +32 -32
- package/lib/onchain/account/onchainAccount.js +166 -167
- package/lib/onchain/account/onchainAccountLendingVault.d.ts +19 -19
- package/lib/onchain/account/onchainAccountLendingVault.js +48 -48
- package/lib/onchain/account/onchainAccountPoolToken.d.ts +30 -30
- package/lib/onchain/account/onchainAccountPoolToken.js +86 -86
- package/lib/onchain/account/poolToken.d.ts +24 -0
- package/lib/onchain/account/poolToken.js +84 -0
- package/lib/onchain/configManager/index.d.ts +5 -5
- package/lib/onchain/configManager/index.js +12 -12
- package/lib/onchain/configManager/onchainConfigManager.d.ts +12 -12
- package/lib/onchain/configManager/onchainConfigManager.js +38 -38
- package/lib/onchain/configManager/onchainPairConfig.d.ts +38 -38
- package/lib/onchain/configManager/onchainPairConfig.js +85 -85
- package/lib/onchain/configManager/onchainProposal.d.ts +17 -17
- package/lib/onchain/configManager/onchainProposal.js +55 -55
- package/lib/onchain/contractsHelper.d.ts +29 -0
- package/lib/onchain/contractsHelper.js +52 -0
- package/lib/onchain/impermaxFactory/index.d.ts +7 -5
- package/lib/onchain/impermaxFactory/index.js +39 -35
- package/lib/onchain/impermaxFactory/lendingPool/borrowable.d.ts +36 -0
- package/lib/onchain/impermaxFactory/lendingPool/borrowable.js +153 -0
- package/lib/onchain/impermaxFactory/lendingPool/collateral.d.ts +17 -0
- package/lib/onchain/impermaxFactory/lendingPool/collateral.js +59 -0
- package/lib/onchain/impermaxFactory/lendingPool/index.d.ts +12 -5
- package/lib/onchain/impermaxFactory/lendingPool/index.js +50 -12
- package/lib/onchain/impermaxFactory/lendingPool/nftlp/index.d.ts +4 -0
- package/lib/onchain/impermaxFactory/lendingPool/nftlp/index.js +11 -0
- package/lib/onchain/impermaxFactory/lendingPool/nftlp/onchainNftlp.d.ts +22 -0
- package/lib/onchain/impermaxFactory/lendingPool/nftlp/onchainNftlp.js +19 -0
- package/lib/onchain/impermaxFactory/lendingPool/nftlp/onchainNftlpUniswapV3.d.ts +24 -0
- package/lib/onchain/impermaxFactory/lendingPool/nftlp/onchainNftlpUniswapV3.js +90 -0
- package/lib/onchain/impermaxFactory/lendingPool/onchainBorrowable.d.ts +38 -34
- package/lib/onchain/impermaxFactory/lendingPool/onchainBorrowable.js +137 -156
- package/lib/onchain/impermaxFactory/lendingPool/onchainBorrowableV2.d.ts +9 -0
- package/lib/onchain/impermaxFactory/lendingPool/onchainBorrowableV2.js +36 -0
- package/lib/onchain/impermaxFactory/lendingPool/onchainBorrowableV3.d.ts +7 -0
- package/lib/onchain/impermaxFactory/lendingPool/onchainBorrowableV3.js +23 -0
- package/lib/onchain/impermaxFactory/lendingPool/onchainCollateral.d.ts +8 -19
- package/lib/onchain/impermaxFactory/lendingPool/onchainCollateral.js +24 -61
- package/lib/onchain/impermaxFactory/lendingPool/onchainCollateralV2.d.ts +20 -0
- package/lib/onchain/impermaxFactory/lendingPool/onchainCollateralV2.js +58 -0
- package/lib/onchain/impermaxFactory/lendingPool/onchainCollateralV3.d.ts +13 -0
- package/lib/onchain/impermaxFactory/lendingPool/onchainCollateralV3.js +36 -0
- package/lib/onchain/impermaxFactory/lendingPool/onchainLendingPool.d.ts +43 -58
- package/lib/onchain/impermaxFactory/lendingPool/onchainLendingPool.js +81 -367
- package/lib/onchain/impermaxFactory/lendingPool/onchainLendingPoolV2.d.ts +76 -0
- package/lib/onchain/impermaxFactory/lendingPool/onchainLendingPoolV2.js +338 -0
- package/lib/onchain/impermaxFactory/lendingPool/onchainLendingPoolV3.d.ts +42 -0
- package/lib/onchain/impermaxFactory/lendingPool/onchainLendingPoolV3.js +39 -0
- package/lib/onchain/impermaxFactory/onchainImpermaxFactory.d.ts +26 -16
- package/lib/onchain/impermaxFactory/onchainImpermaxFactory.js +42 -52
- package/lib/onchain/impermaxFactory/onchainImpermaxFactoryV2.d.ts +16 -0
- package/lib/onchain/impermaxFactory/onchainImpermaxFactoryV2.js +81 -0
- package/lib/onchain/impermaxFactory/onchainImpermaxFactoryV3.d.ts +16 -0
- package/lib/onchain/impermaxFactory/onchainImpermaxFactoryV3.js +88 -0
- package/lib/onchain/index.d.ts +10 -10
- package/lib/onchain/index.js +49 -49
- package/lib/onchain/interactions/index.d.ts +8 -8
- package/lib/onchain/interactions/index.js +41 -41
- package/lib/onchain/interactions/lendingPool/borrowable.d.ts +14 -0
- package/lib/onchain/interactions/lendingPool/borrowable.js +47 -0
- package/lib/onchain/interactions/lendingPool/collateral.d.ts +13 -0
- package/lib/onchain/interactions/lendingPool/collateral.js +31 -0
- package/lib/onchain/interactions/lendingPool/index.d.ts +12 -5
- package/lib/onchain/interactions/lendingPool/index.js +49 -12
- package/lib/onchain/interactions/lendingPool/nftlp/index.d.ts +4 -0
- package/lib/onchain/interactions/lendingPool/nftlp/index.js +11 -0
- package/lib/onchain/interactions/lendingPool/nftlp/onchainInteractionsNftlp.d.ts +7 -0
- package/lib/onchain/interactions/lendingPool/nftlp/onchainInteractionsNftlp.js +12 -0
- package/lib/onchain/interactions/lendingPool/nftlp/onchainInteractionsNftlpUniswapV3.d.ts +4 -0
- package/lib/onchain/interactions/lendingPool/nftlp/onchainInteractionsNftlpUniswapV3.js +13 -0
- package/lib/onchain/interactions/lendingPool/onchainInteractionsBorrowable.d.ts +17 -21
- package/lib/onchain/interactions/lendingPool/onchainInteractionsBorrowable.js +24 -56
- package/lib/onchain/interactions/lendingPool/onchainInteractionsBorrowableV2.d.ts +15 -0
- package/lib/onchain/interactions/lendingPool/onchainInteractionsBorrowableV2.js +63 -0
- package/lib/onchain/interactions/lendingPool/onchainInteractionsBorrowableV3.d.ts +9 -0
- package/lib/onchain/interactions/lendingPool/onchainInteractionsBorrowableV3.js +14 -0
- package/lib/onchain/interactions/lendingPool/onchainInteractionsCollateral.d.ts +7 -19
- package/lib/onchain/interactions/lendingPool/onchainInteractionsCollateral.js +11 -43
- package/lib/onchain/interactions/lendingPool/onchainInteractionsCollateralV2.d.ts +20 -0
- package/lib/onchain/interactions/lendingPool/onchainInteractionsCollateralV2.js +48 -0
- package/lib/onchain/interactions/lendingPool/onchainInteractionsCollateralV3.d.ts +13 -0
- package/lib/onchain/interactions/lendingPool/onchainInteractionsCollateralV3.js +20 -0
- package/lib/onchain/interactions/lendingPool/onchainInteractionsLendingPool.d.ts +31 -46
- package/lib/onchain/interactions/lendingPool/onchainInteractionsLendingPool.js +53 -135
- package/lib/onchain/interactions/lendingPool/onchainInteractionsLendingPoolV2.d.ts +42 -0
- package/lib/onchain/interactions/lendingPool/onchainInteractionsLendingPoolV2.js +114 -0
- package/lib/onchain/interactions/lendingPool/onchainInteractionsLendingPoolV3.d.ts +27 -0
- package/lib/onchain/interactions/lendingPool/onchainInteractionsLendingPoolV3.js +32 -0
- package/lib/onchain/interactions/lendingVault.d.ts +8 -0
- package/lib/onchain/interactions/lendingVault.js +15 -0
- package/lib/onchain/interactions/onchainInteractions.d.ts +31 -31
- package/lib/onchain/interactions/onchainInteractions.js +136 -137
- package/lib/onchain/interactions/onchainInteractionsConfigManager.d.ts +17 -17
- package/lib/onchain/interactions/onchainInteractionsConfigManager.js +44 -44
- package/lib/onchain/interactions/onchainInteractionsLendingVault.d.ts +14 -14
- package/lib/onchain/interactions/onchainInteractionsLendingVault.js +21 -21
- package/lib/onchain/interactions/onchainInteractionsPoolToken.d.ts +35 -35
- package/lib/onchain/interactions/onchainInteractionsPoolToken.js +134 -186
- package/lib/onchain/interactions/poolToken.d.ts +31 -0
- package/lib/onchain/interactions/poolToken.js +181 -0
- package/lib/onchain/lendingVault.d.ts +17 -0
- package/lib/onchain/lendingVault.js +56 -0
- package/lib/onchain/onchain.d.ts +38 -35
- package/lib/onchain/onchain.js +78 -70
- package/lib/onchain/onchainContractsHelper.d.ts +42 -31
- package/lib/onchain/onchainContractsHelper.js +90 -56
- package/lib/onchain/onchainLendingVault.d.ts +22 -22
- package/lib/onchain/onchainLendingVault.js +69 -69
- package/lib/onchain/onchainPermitHelper.d.ts +21 -0
- package/lib/onchain/onchainPermitHelper.js +198 -0
- package/lib/onchain/onchainPoolToken.d.ts +35 -35
- package/lib/onchain/onchainPoolToken.js +129 -129
- package/lib/onchain/onchainTypes.d.ts +70 -64
- package/lib/onchain/onchainTypes.js +14 -14
- package/lib/onchain/poolToken.d.ts +32 -0
- package/lib/onchain/poolToken.js +121 -0
- package/lib/onchain/types.d.ts +45 -0
- package/lib/onchain/types.js +14 -0
- package/lib/utils/ether-utils.d.ts +5 -5
- package/lib/utils/ether-utils.js +26 -26
- package/lib/utils/index.d.ts +3 -3
- package/lib/utils/index.js +16 -16
- package/lib/utils/lliquidity-math.d.ts +30 -30
- package/lib/utils/lliquidity-math.js +139 -139
- package/lib/utils/price-from-reserves.d.ts +2 -0
- package/lib/utils/price-from-reserves.js +19 -0
- package/package.json +36 -36
package/lib/onchain/onchain.d.ts
CHANGED
|
@@ -1,35 +1,38 @@
|
|
|
1
|
-
import { Address, AddressIndex, Factory, FactoryIndex, Networks } from '../config/types';
|
|
2
|
-
import Offchain from '../offchain';
|
|
3
|
-
import OnchainContractsHelper from './onchainContractsHelper';
|
|
4
|
-
import OnchainImpermaxFactory from './impermaxFactory';
|
|
5
|
-
import OnchainLendingVault from './onchainLendingVault';
|
|
6
|
-
import OnchainAccount from './account';
|
|
7
|
-
import OnchainInteractions from './interactions';
|
|
8
|
-
import { OnchainConfig } from './onchainTypes';
|
|
9
|
-
import OnchainConfigManager from './configManager';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
readonly
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
protected
|
|
21
|
-
protected
|
|
22
|
-
protected
|
|
23
|
-
protected
|
|
24
|
-
protected
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
import { Address, AddressIndex, Factory, FactoryIndex, Networks } from '../config/types';
|
|
2
|
+
import Offchain from '../offchain';
|
|
3
|
+
import OnchainContractsHelper from './onchainContractsHelper';
|
|
4
|
+
import OnchainImpermaxFactory from './impermaxFactory';
|
|
5
|
+
import OnchainLendingVault from './onchainLendingVault';
|
|
6
|
+
import OnchainAccount from './account';
|
|
7
|
+
import OnchainInteractions from './interactions';
|
|
8
|
+
import { OnchainConfig } from './onchainTypes';
|
|
9
|
+
import OnchainConfigManager from './configManager';
|
|
10
|
+
import OnchainPermitHelper from "./onchainPermitHelper";
|
|
11
|
+
export default class Onchain {
|
|
12
|
+
readonly network: Networks;
|
|
13
|
+
private readonly offchain;
|
|
14
|
+
readonly web3: any;
|
|
15
|
+
readonly chainId: number;
|
|
16
|
+
readonly uiMargin: number;
|
|
17
|
+
readonly dust: number;
|
|
18
|
+
readonly liquidityBuffer: number;
|
|
19
|
+
priceInverted: boolean;
|
|
20
|
+
protected contractsHelper: OnchainContractsHelper;
|
|
21
|
+
protected permitHelper: OnchainPermitHelper;
|
|
22
|
+
protected configManager: OnchainConfigManager;
|
|
23
|
+
protected factories: FactoryIndex<OnchainImpermaxFactory>;
|
|
24
|
+
protected lendingVaults: AddressIndex<OnchainLendingVault>;
|
|
25
|
+
protected accounts: AddressIndex<OnchainAccount>;
|
|
26
|
+
protected interactions: AddressIndex<OnchainInteractions>;
|
|
27
|
+
constructor(cfg: OnchainConfig);
|
|
28
|
+
cleanCache(): void;
|
|
29
|
+
setPriceInverted(priceInverted: boolean): void;
|
|
30
|
+
getOffchain: () => Offchain;
|
|
31
|
+
getContractHelper: () => OnchainContractsHelper;
|
|
32
|
+
getPermitHelper: () => OnchainPermitHelper;
|
|
33
|
+
getConfigManager: () => OnchainConfigManager;
|
|
34
|
+
getImpermaxFactory(factory: Factory): OnchainImpermaxFactory;
|
|
35
|
+
getLendingVault(vaultAddress: Address): OnchainLendingVault;
|
|
36
|
+
getAccount(address: Address): OnchainAccount;
|
|
37
|
+
getInteractions(address: Address): OnchainInteractions;
|
|
38
|
+
}
|
package/lib/onchain/onchain.js
CHANGED
|
@@ -1,70 +1,78 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
30
|
-
this.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const types_1 = require("../config/types");
|
|
7
|
+
const onchainContractsHelper_1 = __importDefault(require("./onchainContractsHelper"));
|
|
8
|
+
const impermaxFactory_1 = require("./impermaxFactory");
|
|
9
|
+
const onchainLendingVault_1 = __importDefault(require("./onchainLendingVault"));
|
|
10
|
+
const account_1 = __importDefault(require("./account"));
|
|
11
|
+
const interactions_1 = __importDefault(require("./interactions"));
|
|
12
|
+
const configManager_1 = __importDefault(require("./configManager"));
|
|
13
|
+
const onchainPermitHelper_1 = __importDefault(require("./onchainPermitHelper"));
|
|
14
|
+
class Onchain {
|
|
15
|
+
constructor(cfg) {
|
|
16
|
+
this.getOffchain = () => this.offchain;
|
|
17
|
+
this.getContractHelper = () => this.contractsHelper;
|
|
18
|
+
this.getPermitHelper = () => this.permitHelper;
|
|
19
|
+
this.getConfigManager = () => this.configManager;
|
|
20
|
+
this.network = cfg.network;
|
|
21
|
+
this.offchain = cfg.offchain;
|
|
22
|
+
this.web3 = cfg.web3;
|
|
23
|
+
this.chainId = cfg.chainId;
|
|
24
|
+
this.uiMargin = 1.1;
|
|
25
|
+
this.liquidityBuffer = 0.0001; // always leave 0.01% liquidity to avoid failures due to exchangeRate increase
|
|
26
|
+
this.dust = 1.00000001;
|
|
27
|
+
this.priceInverted = cfg.priceInverted ? cfg.priceInverted : false;
|
|
28
|
+
this.contractsHelper = new onchainContractsHelper_1.default(this);
|
|
29
|
+
this.permitHelper = new onchainPermitHelper_1.default(this);
|
|
30
|
+
this.configManager = new configManager_1.default(this);
|
|
31
|
+
this.factories = {};
|
|
32
|
+
this.accounts = {};
|
|
33
|
+
this.lendingVaults = {};
|
|
34
|
+
this.interactions = {};
|
|
35
|
+
}
|
|
36
|
+
cleanCache() {
|
|
37
|
+
for (const factory in this.factories) {
|
|
38
|
+
this.factories[factory].cleanCache();
|
|
39
|
+
}
|
|
40
|
+
for (const address in this.lendingVaults) {
|
|
41
|
+
this.lendingVaults[address].cleanCache();
|
|
42
|
+
}
|
|
43
|
+
for (const address in this.accounts) {
|
|
44
|
+
this.accounts[address].cleanCache();
|
|
45
|
+
}
|
|
46
|
+
for (const address in this.interactions) {
|
|
47
|
+
this.interactions[address].cleanCache();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
setPriceInverted(priceInverted) {
|
|
51
|
+
this.priceInverted = priceInverted;
|
|
52
|
+
}
|
|
53
|
+
getImpermaxFactory(factory) {
|
|
54
|
+
if (!this.factories[factory]) {
|
|
55
|
+
if (factory == types_1.Factory.V3)
|
|
56
|
+
this.factories[factory] = new impermaxFactory_1.OnchainImpermaxFactoryV3(this, factory);
|
|
57
|
+
else
|
|
58
|
+
this.factories[factory] = new impermaxFactory_1.OnchainImpermaxFactoryV2(this, factory);
|
|
59
|
+
}
|
|
60
|
+
return this.factories[factory];
|
|
61
|
+
}
|
|
62
|
+
getLendingVault(vaultAddress) {
|
|
63
|
+
if (!this.lendingVaults[vaultAddress])
|
|
64
|
+
this.lendingVaults[vaultAddress] = new onchainLendingVault_1.default(this, vaultAddress);
|
|
65
|
+
return this.lendingVaults[vaultAddress];
|
|
66
|
+
}
|
|
67
|
+
getAccount(address) {
|
|
68
|
+
if (!this.accounts[address])
|
|
69
|
+
this.accounts[address] = new account_1.default(this, address);
|
|
70
|
+
return this.accounts[address];
|
|
71
|
+
}
|
|
72
|
+
getInteractions(address) {
|
|
73
|
+
if (!this.interactions[address])
|
|
74
|
+
this.interactions[address] = new interactions_1.default(this, address);
|
|
75
|
+
return this.interactions[address];
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.default = Onchain;
|
|
@@ -1,31 +1,42 @@
|
|
|
1
|
-
import { Contract } from "./onchainTypes";
|
|
2
|
-
import Onchain from "./index";
|
|
3
|
-
import { Address } from '../config/types';
|
|
4
|
-
export default class OnchainContractsHelper {
|
|
5
|
-
private readonly onchain;
|
|
6
|
-
readonly impermaxChef: Contract;
|
|
7
|
-
readonly merkleDistributorIbex: Contract;
|
|
8
|
-
merkleDistributorIbex2: Contract;
|
|
9
|
-
merkleDistributorEth: Contract;
|
|
10
|
-
claimAggregator: Contract;
|
|
11
|
-
constructor(onchain: Onchain);
|
|
12
|
-
private newContract;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import { Contract } from "./onchainTypes";
|
|
2
|
+
import Onchain from "./index";
|
|
3
|
+
import { Address } from '../config/types';
|
|
4
|
+
export default class OnchainContractsHelper {
|
|
5
|
+
private readonly onchain;
|
|
6
|
+
readonly impermaxChef: Contract;
|
|
7
|
+
readonly merkleDistributorIbex: Contract;
|
|
8
|
+
merkleDistributorIbex2: Contract;
|
|
9
|
+
merkleDistributorEth: Contract;
|
|
10
|
+
claimAggregator: Contract;
|
|
11
|
+
constructor(onchain: Onchain);
|
|
12
|
+
private newContract;
|
|
13
|
+
newERC20: (address: Address) => any;
|
|
14
|
+
newERC721: (address: Address) => any;
|
|
15
|
+
newPermit2: (address: Address) => any;
|
|
16
|
+
newPoolTokenRouter: (address: Address) => any;
|
|
17
|
+
newMerkleDistributor: (address: Address) => any;
|
|
18
|
+
newFarmingPool: (address: Address) => any;
|
|
19
|
+
newClaimAggregator: (address: Address) => any;
|
|
20
|
+
newClaimable: (address: Address) => any;
|
|
21
|
+
newStakingRewards: (address: Address) => any;
|
|
22
|
+
newImpermaxChef: (address: Address) => any;
|
|
23
|
+
newLendingVault: (address: Address) => any;
|
|
24
|
+
newLendingVaultWatcher: (address: Address) => any;
|
|
25
|
+
newImpermaxConfigManager: (address: Address) => any;
|
|
26
|
+
newFactoryV2: (address: Address) => any;
|
|
27
|
+
newSimpleUniswapOracle: (address: Address) => any;
|
|
28
|
+
newCollateralV2: (address: Address) => any;
|
|
29
|
+
newBorrowableV2: (address: Address) => any;
|
|
30
|
+
newStakedLPToken: (address: Address) => any;
|
|
31
|
+
newRouterV2: (address: Address) => any;
|
|
32
|
+
newFactoryV3: (address: Address) => any;
|
|
33
|
+
newBorrowableV3: (address: Address) => any;
|
|
34
|
+
newCollateralV3: (address: Address) => any;
|
|
35
|
+
newRouterUniV2: (address: Address) => any;
|
|
36
|
+
newRouterUniV3: (address: Address) => any;
|
|
37
|
+
newNftlpUniV2: (address: Address) => any;
|
|
38
|
+
newNftlpUniV3: (address: Address) => any;
|
|
39
|
+
newUniswapV2Pair: (address: Address) => any;
|
|
40
|
+
newUniswapV2Factory: (address: Address) => any;
|
|
41
|
+
newUniswapV3Pool: (address: Address) => any;
|
|
42
|
+
}
|
|
@@ -1,56 +1,90 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
this.
|
|
47
|
-
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
50
|
-
this.
|
|
51
|
-
|
|
52
|
-
this.
|
|
53
|
-
this.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const impermax_chef_1 = require("../config/contracts/impermax-chef");
|
|
7
|
+
const claim_aggregators_1 = require("../config/contracts/claim-aggregators");
|
|
8
|
+
const merkle_distributors_1 = require("../config/contracts/merkle-distributors");
|
|
9
|
+
// Generic
|
|
10
|
+
const IERC20_json_1 = __importDefault(require("../abis/contracts/IERC20.json"));
|
|
11
|
+
const IERC721_json_1 = __importDefault(require("../abis/contracts/IERC721.json"));
|
|
12
|
+
const IAllowanceTransfer_json_1 = __importDefault(require("../abis/contracts/IAllowanceTransfer.json"));
|
|
13
|
+
// Impermax
|
|
14
|
+
const PoolTokenRouter01_json_1 = __importDefault(require("../abis/contracts/PoolTokenRouter01.json"));
|
|
15
|
+
const ImpermaxChef_json_1 = __importDefault(require("../abis/contracts/ImpermaxChef.json"));
|
|
16
|
+
const IMerkleDistributor_json_1 = __importDefault(require("../abis/contracts/IMerkleDistributor.json"));
|
|
17
|
+
const IFarmingPool_json_1 = __importDefault(require("../abis/contracts/IFarmingPool.json"));
|
|
18
|
+
const ClaimAggregator_json_1 = __importDefault(require("../abis/contracts/ClaimAggregator.json"));
|
|
19
|
+
const IClaimable_json_1 = __importDefault(require("../abis/contracts/IClaimable.json"));
|
|
20
|
+
const ILendingVaultV1_json_1 = __importDefault(require("../abis/contracts/ILendingVaultV1.json"));
|
|
21
|
+
const LendingVaultWatcher01_json_1 = __importDefault(require("../abis/contracts/LendingVaultWatcher01.json"));
|
|
22
|
+
const ImpermaxConfigManager_json_1 = __importDefault(require("../abis/contracts/ImpermaxConfigManager.json"));
|
|
23
|
+
// Impermax V2
|
|
24
|
+
const IFactory_json_1 = __importDefault(require("../abis/contracts/IFactory.json"));
|
|
25
|
+
const ISimpleUniswapOracle_json_1 = __importDefault(require("../abis/contracts/ISimpleUniswapOracle.json"));
|
|
26
|
+
const IBorrowable_json_1 = __importDefault(require("../abis/contracts/IBorrowable.json"));
|
|
27
|
+
const ICollateral_json_1 = __importDefault(require("../abis/contracts/ICollateral.json"));
|
|
28
|
+
const IStakedLPToken_json_1 = __importDefault(require("../abis/contracts/IStakedLPToken.json"));
|
|
29
|
+
const IRouter02_json_1 = __importDefault(require("../abis/contracts/IRouter02.json"));
|
|
30
|
+
// Impermax V3
|
|
31
|
+
const ImpermaxV3Factory_json_1 = __importDefault(require("../abis/contracts/ImpermaxV3Factory.json"));
|
|
32
|
+
const ImpermaxV3Borrowable_json_1 = __importDefault(require("../abis/contracts/ImpermaxV3Borrowable.json"));
|
|
33
|
+
const ImpermaxV3Collateral_json_1 = __importDefault(require("../abis/contracts/ImpermaxV3Collateral.json"));
|
|
34
|
+
const ImpermaxV3UniV3Router01_json_1 = __importDefault(require("../abis/contracts/ImpermaxV3UniV3Router01.json"));
|
|
35
|
+
const ImpermaxV3UniV2Router01_json_1 = __importDefault(require("../abis/contracts/ImpermaxV3UniV2Router01.json"));
|
|
36
|
+
// Nftlps
|
|
37
|
+
const ITokenizedUniswapV2Position_json_1 = __importDefault(require("../abis/contracts/ITokenizedUniswapV2Position.json"));
|
|
38
|
+
const ITokenizedUniswapV3Position_json_1 = __importDefault(require("../abis/contracts/ITokenizedUniswapV3Position.json"));
|
|
39
|
+
// External
|
|
40
|
+
const IStakingRewards_json_1 = __importDefault(require("../abis/contracts/IStakingRewards.json"));
|
|
41
|
+
const IUniswapV2Pair_json_1 = __importDefault(require("../abis/contracts/IUniswapV2Pair.json"));
|
|
42
|
+
const IUniswapV2Factory_json_1 = __importDefault(require("../abis/contracts/IUniswapV2Factory.json"));
|
|
43
|
+
const IUniswapV3Pool_json_1 = __importDefault(require("../abis/contracts/IUniswapV3Pool.json"));
|
|
44
|
+
class OnchainContractsHelper {
|
|
45
|
+
constructor(onchain) {
|
|
46
|
+
this.newContract = (abi, address) => new this.onchain.web3.eth.Contract(abi, address);
|
|
47
|
+
// Generic
|
|
48
|
+
this.newERC20 = (address) => this.newContract(IERC20_json_1.default.abi, address);
|
|
49
|
+
this.newERC721 = (address) => this.newContract(IERC721_json_1.default.abi, address);
|
|
50
|
+
this.newPermit2 = (address) => this.newContract(IAllowanceTransfer_json_1.default.abi, address);
|
|
51
|
+
// Impermax
|
|
52
|
+
this.newPoolTokenRouter = (address) => this.newContract(PoolTokenRouter01_json_1.default.abi, address);
|
|
53
|
+
this.newMerkleDistributor = (address) => this.newContract(IMerkleDistributor_json_1.default.abi, address);
|
|
54
|
+
this.newFarmingPool = (address) => this.newContract(IFarmingPool_json_1.default.abi, address);
|
|
55
|
+
this.newClaimAggregator = (address) => this.newContract(ClaimAggregator_json_1.default.abi, address);
|
|
56
|
+
this.newClaimable = (address) => this.newContract(IClaimable_json_1.default.abi, address);
|
|
57
|
+
this.newStakingRewards = (address) => this.newContract(IStakingRewards_json_1.default.abi, address);
|
|
58
|
+
this.newImpermaxChef = (address) => this.newContract(ImpermaxChef_json_1.default.abi, address);
|
|
59
|
+
this.newLendingVault = (address) => this.newContract(ILendingVaultV1_json_1.default.abi, address);
|
|
60
|
+
this.newLendingVaultWatcher = (address) => this.newContract(LendingVaultWatcher01_json_1.default.abi, address);
|
|
61
|
+
this.newImpermaxConfigManager = (address) => this.newContract(ImpermaxConfigManager_json_1.default.abi, address);
|
|
62
|
+
// Impermax V2
|
|
63
|
+
this.newFactoryV2 = (address) => this.newContract(IFactory_json_1.default.abi, address);
|
|
64
|
+
this.newSimpleUniswapOracle = (address) => this.newContract(ISimpleUniswapOracle_json_1.default.abi, address);
|
|
65
|
+
this.newCollateralV2 = (address) => this.newContract(ICollateral_json_1.default.abi, address);
|
|
66
|
+
this.newBorrowableV2 = (address) => this.newContract(IBorrowable_json_1.default.abi, address);
|
|
67
|
+
this.newStakedLPToken = (address) => this.newContract(IStakedLPToken_json_1.default.abi, address);
|
|
68
|
+
this.newRouterV2 = (address) => this.newContract(IRouter02_json_1.default.abi, address);
|
|
69
|
+
// Impermax V3
|
|
70
|
+
this.newFactoryV3 = (address) => this.newContract(ImpermaxV3Factory_json_1.default.abi, address);
|
|
71
|
+
this.newBorrowableV3 = (address) => this.newContract(ImpermaxV3Borrowable_json_1.default.abi, address);
|
|
72
|
+
this.newCollateralV3 = (address) => this.newContract(ImpermaxV3Collateral_json_1.default.abi, address);
|
|
73
|
+
this.newRouterUniV2 = (address) => this.newContract(ImpermaxV3UniV2Router01_json_1.default.abi, address);
|
|
74
|
+
this.newRouterUniV3 = (address) => this.newContract(ImpermaxV3UniV3Router01_json_1.default.abi, address);
|
|
75
|
+
// Nftlps
|
|
76
|
+
this.newNftlpUniV2 = (address) => this.newContract(ITokenizedUniswapV2Position_json_1.default.abi, address);
|
|
77
|
+
this.newNftlpUniV3 = (address) => this.newContract(ITokenizedUniswapV3Position_json_1.default.abi, address);
|
|
78
|
+
// External
|
|
79
|
+
this.newUniswapV2Pair = (address) => this.newContract(IUniswapV2Pair_json_1.default.abi, address);
|
|
80
|
+
this.newUniswapV2Factory = (address) => this.newContract(IUniswapV2Factory_json_1.default.abi, address);
|
|
81
|
+
this.newUniswapV3Pool = (address) => this.newContract(IUniswapV3Pool_json_1.default.abi, address);
|
|
82
|
+
this.onchain = onchain;
|
|
83
|
+
this.impermaxChef = this.newImpermaxChef(impermax_chef_1.IMPERMAX_CHEF[this.onchain.network]);
|
|
84
|
+
this.merkleDistributorIbex = this.newMerkleDistributor(merkle_distributors_1.MERKLE_DISTRIBUTOR_IBEX[this.onchain.network]);
|
|
85
|
+
this.merkleDistributorIbex2 = this.newMerkleDistributor(merkle_distributors_1.MERKLE_DISTRIBUTOR_IBEX_2[this.onchain.network]);
|
|
86
|
+
this.merkleDistributorEth = this.newMerkleDistributor(merkle_distributors_1.MERKLE_DISTRIBUTOR_ETH[this.onchain.network]);
|
|
87
|
+
this.claimAggregator = this.newClaimAggregator(claim_aggregators_1.CLAIM_AGGREGATOR[this.onchain.network]);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.default = OnchainContractsHelper;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import OnchainPoolToken from "./onchainPoolToken";
|
|
2
|
-
import { Contract } from "ethers";
|
|
3
|
-
import { Address } from '../config/types';
|
|
4
|
-
import Onchain from './index';
|
|
5
|
-
import
|
|
6
|
-
export default class OnchainLendingVault extends OnchainPoolToken {
|
|
7
|
-
private readonly onchain;
|
|
8
|
-
private readonly vaultAddress;
|
|
9
|
-
private lendingVaultCache;
|
|
10
|
-
constructor(onchain: Onchain, vaultAddress: Address);
|
|
11
|
-
cleanCache(): void;
|
|
12
|
-
getOnchain: () => Onchain;
|
|
13
|
-
getVaultAddress: () => string;
|
|
14
|
-
getContractHelper: () => import("./onchainContractsHelper").default;
|
|
15
|
-
getPoolTokenAddress(): Promise<Address>;
|
|
16
|
-
getOffchainPoolToken(): Promise<
|
|
17
|
-
getOffchainLendingVault: () => Promise<
|
|
18
|
-
protected initializePoolToken(): Promise<Contract>;
|
|
19
|
-
protected initializeToken(): Promise<Contract>;
|
|
20
|
-
private initializeAvailableLiquidity;
|
|
21
|
-
getAvailableLiquidity(): Promise<number>;
|
|
22
|
-
}
|
|
1
|
+
import OnchainPoolToken from "./onchainPoolToken";
|
|
2
|
+
import { Contract } from "ethers";
|
|
3
|
+
import { Address } from '../config/types';
|
|
4
|
+
import Onchain from './index';
|
|
5
|
+
import OffchainVault from '../offchain/vault/offchainVault';
|
|
6
|
+
export default class OnchainLendingVault extends OnchainPoolToken {
|
|
7
|
+
private readonly onchain;
|
|
8
|
+
private readonly vaultAddress;
|
|
9
|
+
private lendingVaultCache;
|
|
10
|
+
constructor(onchain: Onchain, vaultAddress: Address);
|
|
11
|
+
cleanCache(): void;
|
|
12
|
+
getOnchain: () => Onchain;
|
|
13
|
+
getVaultAddress: () => string;
|
|
14
|
+
getContractHelper: () => import("./onchainContractsHelper").default;
|
|
15
|
+
getPoolTokenAddress(): Promise<Address>;
|
|
16
|
+
getOffchainPoolToken(): Promise<OffchainVault>;
|
|
17
|
+
getOffchainLendingVault: () => Promise<OffchainVault>;
|
|
18
|
+
protected initializePoolToken(): Promise<Contract>;
|
|
19
|
+
protected initializeToken(): Promise<Contract>;
|
|
20
|
+
private initializeAvailableLiquidity;
|
|
21
|
+
getAvailableLiquidity(): Promise<number>;
|
|
22
|
+
}
|