From 648d8e3d6bfb7a5e8d6c99f043f90b5272112c83 Mon Sep 17 00:00:00 2001 From: Karan Shahani Date: Fri, 15 Jul 2022 13:33:29 -0400 Subject: [PATCH] fix(multicall): Wrong imports --- .../helpers/balance/token-balance.helper.ts | 4 ++-- .../helpers/position/vault.token-helper.ts | 15 +++++++++------ .../compound.borrow.contract-position-helper.ts | 4 ++-- .../helpers/curve.gauge.is-active-strategy.ts | 4 ++-- .../curve/helpers/curve.gauge.roi-strategy.ts | 8 ++++---- .../curve.rewards-only-gauge.roi-strategy.ts | 4 ++-- ...ing-escrow.contract-position-balance-helper.ts | 6 +++--- ...ing-escrow.contract-position-balance-helper.ts | 6 +++--- .../yearn/helpers/yearn.v1-vault.token-helper.ts | 4 ++-- .../yearn/helpers/yearn.v2-vault.token-helper.ts | 4 ++-- 10 files changed, 31 insertions(+), 28 deletions(-) diff --git a/src/app-toolkit/helpers/balance/token-balance.helper.ts b/src/app-toolkit/helpers/balance/token-balance.helper.ts index 0d216d966..53f3dc4ff 100644 --- a/src/app-toolkit/helpers/balance/token-balance.helper.ts +++ b/src/app-toolkit/helpers/balance/token-balance.helper.ts @@ -3,7 +3,7 @@ import BigNumberJS from 'bignumber.js'; import { identity, isArray, pick } from 'lodash'; import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; -import { EthersMulticall } from '~multicall/multicall.ethers'; +import { IMulticallWrapper } from '~multicall/multicall.interface'; import { ContractType } from '~position/contract.interface'; import { DefaultDataProps, StatsItem, WithMetaType } from '~position/display.interface'; import { AppTokenPositionBalance, BaseTokenBalance } from '~position/position-balance.interface'; @@ -20,7 +20,7 @@ type GetTokenBalancesParams = { address: string; filter?: (contractPosition: AppTokenPosition) => boolean; resolveBalance?: (opts: { - multicall: EthersMulticall; + multicall: IMulticallWrapper; address: string; token: AppTokenPosition; }) => Promise; diff --git a/src/app-toolkit/helpers/position/vault.token-helper.ts b/src/app-toolkit/helpers/position/vault.token-helper.ts index 0b475f240..354427064 100644 --- a/src/app-toolkit/helpers/position/vault.token-helper.ts +++ b/src/app-toolkit/helpers/position/vault.token-helper.ts @@ -10,7 +10,7 @@ import { buildPercentageDisplayItem, } from '~app-toolkit/helpers/presentation/display-item.present'; import { getImagesFromToken } from '~app-toolkit/helpers/presentation/image.present'; -import { EthersMulticall } from '~multicall'; +import { IMulticallWrapper } from '~multicall/multicall.interface'; import { ContractType } from '~position/contract.interface'; import { StatsItem } from '~position/display.interface'; import { AppTokenPosition, ExchangeableAppTokenDataProps, Token } from '~position/position.interface'; @@ -56,20 +56,23 @@ export type VaultTokenHelperParams = { * You can either use static string addresses, leverage the multicall function (which should map to the * the contract passed in via resolveContract) or other methods (such as an external API call). */ - resolveVaultAddresses: (opts: { multicall: EthersMulticall; network: Network }) => string[] | Promise; + resolveVaultAddresses: (opts: { multicall: IMulticallWrapper; network: Network }) => string[] | Promise; /** * The address of an underlying token which correponds to a vault deposit. * You can either use static string addresses, leverage the multicall function (which should map to the * the contract passed in via resolveContract) or other methods (such as an external API call). */ - resolveUnderlyingTokenAddress: (opts: { multicall: EthersMulticall; contract: T }) => string | Promise; + resolveUnderlyingTokenAddress: (opts: { + multicall: IMulticallWrapper; + contract: T; + }) => string | Promise; /** * How do we resolve the reserve (aka: the liquidity or total supply) of a given underlying token. */ resolveReserve: (opts: { address: string; contract: T; - multicall: EthersMulticall; + multicall: IMulticallWrapper; underlyingToken: Token; network: Network; }) => number | Promise; @@ -78,7 +81,7 @@ export type VaultTokenHelperParams = { */ resolvePricePerShare: (opts: { contract: T; - multicall: EthersMulticall; + multicall: IMulticallWrapper; underlyingToken: Token; reserve: number; supply: number; @@ -89,7 +92,7 @@ export type VaultTokenHelperParams = { * e.g: A value of 6 corresponds to 6%, 42.56 would correspond to 42.56%. * If empty, we default to 0 */ - resolveApy?: (opts: { vaultAddress: string; multicall: EthersMulticall; contract: T }) => Promise; + resolveApy?: (opts: { vaultAddress: string; multicall: IMulticallWrapper; contract: T }) => Promise; /** * How do we resolve the label that will be displayed on the frontend. * By default, we will use the symbol. diff --git a/src/apps/compound/helper/compound.borrow.contract-position-helper.ts b/src/apps/compound/helper/compound.borrow.contract-position-helper.ts index 0769e5359..97fc91db2 100644 --- a/src/apps/compound/helper/compound.borrow.contract-position-helper.ts +++ b/src/apps/compound/helper/compound.borrow.contract-position-helper.ts @@ -8,7 +8,7 @@ import { buildPercentageDisplayItem, } from '~app-toolkit/helpers/presentation/display-item.present'; import { getLabelFromToken } from '~app-toolkit/helpers/presentation/image.present'; -import { EthersMulticall } from '~multicall'; +import { IMulticallWrapper } from '~multicall/multicall.interface'; import { ContractType } from '~position/contract.interface'; import { ContractPosition } from '~position/position.interface'; import { borrowed } from '~position/position.utils'; @@ -32,7 +32,7 @@ type CompoundBorrowContractPositionHelperParams = { contract: CompoundCToken; address: string; network: Network; - multicall: EthersMulticall; + multicall: IMulticallWrapper; }) => Promise; }; diff --git a/src/apps/curve/helpers/curve.gauge.is-active-strategy.ts b/src/apps/curve/helpers/curve.gauge.is-active-strategy.ts index 3c50dc614..2d35805d6 100644 --- a/src/apps/curve/helpers/curve.gauge.is-active-strategy.ts +++ b/src/apps/curve/helpers/curve.gauge.is-active-strategy.ts @@ -2,10 +2,10 @@ import { Injectable } from '@nestjs/common'; import { BigNumberish } from 'ethers'; import { SingleStakingFarmContractPositionHelperParams } from '~app-toolkit'; -import { EthersMulticall } from '~multicall'; +import { IMulticallWrapper } from '~multicall/multicall.interface'; type CurveGaugeIsActiveStrategyParams = { - resolveInflationRate: (opts: { multicall: EthersMulticall; contract: T }) => Promise; + resolveInflationRate: (opts: { multicall: IMulticallWrapper; contract: T }) => Promise; }; @Injectable() diff --git a/src/apps/curve/helpers/curve.gauge.roi-strategy.ts b/src/apps/curve/helpers/curve.gauge.roi-strategy.ts index 3d1b89eb4..a8318bbc7 100644 --- a/src/apps/curve/helpers/curve.gauge.roi-strategy.ts +++ b/src/apps/curve/helpers/curve.gauge.roi-strategy.ts @@ -2,14 +2,14 @@ import { Injectable } from '@nestjs/common'; import { BigNumberish } from 'ethers'; import { SingleStakingFarmContractPositionHelperParams } from '~app-toolkit'; -import { EthersMulticall } from '~multicall'; +import { IMulticallWrapper } from '~multicall/multicall.interface'; import { Network } from '~types/network.interface'; type CurveGaugeRoiStrategyParams = { - resolveInflationRate: (opts: { multicall: EthersMulticall; gaugeContract: T }) => Promise; - resolveWorkingSupply: (opts: { multicall: EthersMulticall; gaugeContract: T }) => Promise; + resolveInflationRate: (opts: { multicall: IMulticallWrapper; gaugeContract: T }) => Promise; + resolveWorkingSupply: (opts: { multicall: IMulticallWrapper; gaugeContract: T }) => Promise; resolveRelativeWeight: (opts: { - multicall: EthersMulticall; + multicall: IMulticallWrapper; controllerContract: V; address: string; }) => Promise; diff --git a/src/apps/curve/helpers/curve.rewards-only-gauge.roi-strategy.ts b/src/apps/curve/helpers/curve.rewards-only-gauge.roi-strategy.ts index f985620c3..f176c9ca5 100644 --- a/src/apps/curve/helpers/curve.rewards-only-gauge.roi-strategy.ts +++ b/src/apps/curve/helpers/curve.rewards-only-gauge.roi-strategy.ts @@ -3,7 +3,7 @@ import BigNumber from 'bignumber.js'; import { range, sum } from 'lodash'; import { SingleStakingFarmContractPositionHelperParams } from '~app-toolkit'; -import { EthersMulticall } from '~multicall'; +import { IMulticallWrapper } from '~multicall/multicall.interface'; import { WithMetaType } from '~position/display.interface'; import { Token } from '~position/position.interface'; import { Network } from '~types/network.interface'; @@ -14,7 +14,7 @@ import { CurvePoolDefinition } from '../curve.types'; type GetRewardsInUsdOpts = { rewardStreamAddress: string; rewardTokens: WithMetaType[]; - multicall: EthersMulticall; + multicall: IMulticallWrapper; network: Network; }; diff --git a/src/apps/curve/helpers/curve.vesting-escrow.contract-position-balance-helper.ts b/src/apps/curve/helpers/curve.vesting-escrow.contract-position-balance-helper.ts index 78766d695..201f3d03b 100644 --- a/src/apps/curve/helpers/curve.vesting-escrow.contract-position-balance-helper.ts +++ b/src/apps/curve/helpers/curve.vesting-escrow.contract-position-balance-helper.ts @@ -4,7 +4,7 @@ import { compact, sumBy } from 'lodash'; import { drillBalance } from '~app-toolkit'; import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { EthersMulticall } from '~multicall'; +import { IMulticallWrapper } from '~multicall/multicall.interface'; import { ContractPositionBalance } from '~position/position-balance.interface'; import { isClaimable, isVesting } from '~position/position.utils'; import { Network } from '~types/network.interface'; @@ -17,8 +17,8 @@ type CurveVestingEscrowContractPositionBalanceHelperParams = { groupId: string; network: Network; resolveContract: (opts: { contractFactory: ContractFactory; address: string }) => T; - resolveUnlockedBalance: (opts: { contract: T; multicall: EthersMulticall; address: string }) => Promise; - resolveLockedBalance: (opts: { contract: T; multicall: EthersMulticall; address: string }) => Promise; + resolveUnlockedBalance: (opts: { contract: T; multicall: IMulticallWrapper; address: string }) => Promise; + resolveLockedBalance: (opts: { contract: T; multicall: IMulticallWrapper; address: string }) => Promise; }; @Injectable() diff --git a/src/apps/curve/helpers/curve.voting-escrow.contract-position-balance-helper.ts b/src/apps/curve/helpers/curve.voting-escrow.contract-position-balance-helper.ts index 5cc8f790c..b541bbabe 100644 --- a/src/apps/curve/helpers/curve.voting-escrow.contract-position-balance-helper.ts +++ b/src/apps/curve/helpers/curve.voting-escrow.contract-position-balance-helper.ts @@ -4,7 +4,7 @@ import { compact, sumBy } from 'lodash'; import { drillBalance } from '~app-toolkit'; import { APP_TOOLKIT, IAppToolkit } from '~app-toolkit/app-toolkit.interface'; -import { EthersMulticall } from '~multicall'; +import { IMulticallWrapper } from '~multicall/multicall.interface'; import { ContractPositionBalance } from '~position/position-balance.interface'; import { MetaType } from '~position/position.interface'; import { Network } from '~types/network.interface'; @@ -20,12 +20,12 @@ type CurveVotingEscrowContractPositionBalanceHelperParams = { resolveRewardContract?: (opts: { network: Network; address: string }) => V; resolveLockedTokenBalance: (opts: { contract: T; - multicall: EthersMulticall; + multicall: IMulticallWrapper; address: string; }) => Promise; resolveRewardTokenBalance?: (opts: { contract: V; - multicall: EthersMulticall; + multicall: IMulticallWrapper; address: string; }) => Promise; }; diff --git a/src/apps/yearn/helpers/yearn.v1-vault.token-helper.ts b/src/apps/yearn/helpers/yearn.v1-vault.token-helper.ts index 0e7242176..b04a75dd9 100644 --- a/src/apps/yearn/helpers/yearn.v1-vault.token-helper.ts +++ b/src/apps/yearn/helpers/yearn.v1-vault.token-helper.ts @@ -7,7 +7,7 @@ import { buildPercentageDisplayItem, } from '~app-toolkit/helpers/presentation/display-item.present'; import { getImagesFromToken, getLabelFromToken } from '~app-toolkit/helpers/presentation/image.present'; -import { EthersMulticall } from '~multicall'; +import { IMulticallWrapper } from '~multicall/multicall.interface'; import { ContractType } from '~position/contract.interface'; import { AppTokenPosition } from '~position/position.interface'; import { AppGroupsDefinition } from '~position/position.service'; @@ -47,7 +47,7 @@ export class YearnV1VaultTokenHelper { }: { vaultDefinition: YearnVaultData; network: Network; - multicall: EthersMulticall; + multicall: IMulticallWrapper; }) { const contract = this.yearnContractFactory.yearnVault({ address: vaultDefinition.address, network }); const pricePerShareRaw = await multicall diff --git a/src/apps/yearn/helpers/yearn.v2-vault.token-helper.ts b/src/apps/yearn/helpers/yearn.v2-vault.token-helper.ts index 8e378cf63..e474b129f 100644 --- a/src/apps/yearn/helpers/yearn.v2-vault.token-helper.ts +++ b/src/apps/yearn/helpers/yearn.v2-vault.token-helper.ts @@ -7,7 +7,7 @@ import { buildPercentageDisplayItem, } from '~app-toolkit/helpers/presentation/display-item.present'; import { getImagesFromToken, getLabelFromToken } from '~app-toolkit/helpers/presentation/image.present'; -import { EthersMulticall } from '~multicall'; +import { IMulticallWrapper } from '~multicall/multicall.interface'; import { ContractType } from '~position/contract.interface'; import { AppTokenPosition } from '~position/position.interface'; import { AppGroupsDefinition } from '~position/position.service'; @@ -47,7 +47,7 @@ export class YearnV2VaultTokenHelper { }: { vaultDefinition: YearnVaultData; network: Network; - multicall: EthersMulticall; + multicall: IMulticallWrapper; }) { const contract = this.yearnContractFactory.yearnVaultV2({ address: vaultDefinition.address, network }); const pricePerShareRaw = await multicall