Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
fix(multicall): Wrong imports
Browse files Browse the repository at this point in the history
  • Loading branch information
immasandwich committed Jul 15, 2022
1 parent 9adb6e7 commit 648d8e3
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 28 deletions.
4 changes: 2 additions & 2 deletions src/app-toolkit/helpers/balance/token-balance.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -20,7 +20,7 @@ type GetTokenBalancesParams<T> = {
address: string;
filter?: (contractPosition: AppTokenPosition<T>) => boolean;
resolveBalance?: (opts: {
multicall: EthersMulticall;
multicall: IMulticallWrapper;
address: string;
token: AppTokenPosition<T>;
}) => Promise<string>;
Expand Down
15 changes: 9 additions & 6 deletions src/app-toolkit/helpers/position/vault.token-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -56,20 +56,23 @@ export type VaultTokenHelperParams<T> = {
* 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<string[]>;
resolveVaultAddresses: (opts: { multicall: IMulticallWrapper; network: Network }) => string[] | Promise<string[]>;
/**
* 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<string | null>;
resolveUnderlyingTokenAddress: (opts: {
multicall: IMulticallWrapper;
contract: T;
}) => string | Promise<string | null>;
/**
* 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<number>;
Expand All @@ -78,7 +81,7 @@ export type VaultTokenHelperParams<T> = {
*/
resolvePricePerShare: (opts: {
contract: T;
multicall: EthersMulticall;
multicall: IMulticallWrapper;
underlyingToken: Token;
reserve: number;
supply: number;
Expand All @@ -89,7 +92,7 @@ export type VaultTokenHelperParams<T> = {
* 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<number>;
resolveApy?: (opts: { vaultAddress: string; multicall: IMulticallWrapper; contract: T }) => Promise<number>;
/**
* How do we resolve the label that will be displayed on the frontend.
* By default, we will use the symbol.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -32,7 +32,7 @@ type CompoundBorrowContractPositionHelperParams = {
contract: CompoundCToken;
address: string;
network: Network;
multicall: EthersMulticall;
multicall: IMulticallWrapper;
}) => Promise<BigNumberish>;
};

Expand Down
4 changes: 2 additions & 2 deletions src/apps/curve/helpers/curve.gauge.is-active-strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> = {
resolveInflationRate: (opts: { multicall: EthersMulticall; contract: T }) => Promise<BigNumberish>;
resolveInflationRate: (opts: { multicall: IMulticallWrapper; contract: T }) => Promise<BigNumberish>;
};

@Injectable()
Expand Down
8 changes: 4 additions & 4 deletions src/apps/curve/helpers/curve.gauge.roi-strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T, V> = {
resolveInflationRate: (opts: { multicall: EthersMulticall; gaugeContract: T }) => Promise<BigNumberish>;
resolveWorkingSupply: (opts: { multicall: EthersMulticall; gaugeContract: T }) => Promise<BigNumberish>;
resolveInflationRate: (opts: { multicall: IMulticallWrapper; gaugeContract: T }) => Promise<BigNumberish>;
resolveWorkingSupply: (opts: { multicall: IMulticallWrapper; gaugeContract: T }) => Promise<BigNumberish>;
resolveRelativeWeight: (opts: {
multicall: EthersMulticall;
multicall: IMulticallWrapper;
controllerContract: V;
address: string;
}) => Promise<BigNumberish>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -14,7 +14,7 @@ import { CurvePoolDefinition } from '../curve.types';
type GetRewardsInUsdOpts = {
rewardStreamAddress: string;
rewardTokens: WithMetaType<Token>[];
multicall: EthersMulticall;
multicall: IMulticallWrapper;
network: Network;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -17,8 +17,8 @@ type CurveVestingEscrowContractPositionBalanceHelperParams<T> = {
groupId: string;
network: Network;
resolveContract: (opts: { contractFactory: ContractFactory; address: string }) => T;
resolveUnlockedBalance: (opts: { contract: T; multicall: EthersMulticall; address: string }) => Promise<BigNumber>;
resolveLockedBalance: (opts: { contract: T; multicall: EthersMulticall; address: string }) => Promise<BigNumber>;
resolveUnlockedBalance: (opts: { contract: T; multicall: IMulticallWrapper; address: string }) => Promise<BigNumber>;
resolveLockedBalance: (opts: { contract: T; multicall: IMulticallWrapper; address: string }) => Promise<BigNumber>;
};

@Injectable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -20,12 +20,12 @@ type CurveVotingEscrowContractPositionBalanceHelperParams<T, V = null> = {
resolveRewardContract?: (opts: { network: Network; address: string }) => V;
resolveLockedTokenBalance: (opts: {
contract: T;
multicall: EthersMulticall;
multicall: IMulticallWrapper;
address: string;
}) => Promise<BigNumberish>;
resolveRewardTokenBalance?: (opts: {
contract: V;
multicall: EthersMulticall;
multicall: IMulticallWrapper;
address: string;
}) => Promise<BigNumberish>;
};
Expand Down
4 changes: 2 additions & 2 deletions src/apps/yearn/helpers/yearn.v1-vault.token-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/apps/yearn/helpers/yearn.v2-vault.token-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 648d8e3

Please sign in to comment.