Skip to content

Commit

Permalink
Provider
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptickoan committed Apr 22, 2022
1 parent 826b03d commit b42ce00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/hooks/fuse/useFusePools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,23 +154,9 @@ export const fetchPools = async ({
const isNonWhitelistedPools = filter === "unverified-pools";
const isRewardedPools = filter === "rewarded-pools";

// We need the latest blockNumber
const latestBlockNumber = await fuse.provider.getBlockNumber();
const _blockNum = blockNum ? blockNum : latestBlockNumber;

// Get the unix timestamp of the blockNumber
const startBlockTimestamp = await blockNumberToTimeStamp(
fuse.provider,
_blockNum
);

const ddMMYYYY = formatDateToDDMMYY(new Date(startBlockTimestamp * 1000));

const fetchETHPrice = blockNum
? fetchETHPriceAtDate(ddMMYYYY)
: fetchCurrentETHPrice();
const fetchETHPrice = fetchCurrentETHPrice();

const multicallProvider = new providers.MulticallProvider(fuse.provider)
const multicallProvider = new providers.MulticallProvider(fuse.contracts.FusePoolLens.provider)
const multicallFuse = new Fuse(multicallProvider, chainId)

const req = isMyPools
Expand Down
3 changes: 3 additions & 0 deletions src/utils/web3Providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,8 @@ export const initFuseWithProviders = (
fuse.contracts.FusePoolLens = fuse.contracts.FusePoolLens.connect(
new JsonRpcProvider(lensProvider)
);
fuse.contracts.FusePoolLensSecondary = fuse.contracts.FusePoolLensSecondary.connect(
new JsonRpcProvider(lensProvider)
);
return fuse;
};

1 comment on commit b42ce00

@vercel
Copy link

@vercel vercel bot commented on b42ce00 Apr 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.