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

Commit

Permalink
fix(multicall): Fix typing on wrap function for Multicall wrapper (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
immasandwich authored May 9, 2022
1 parent fed00bf commit ac3b4d8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/multicall/multicall.ethers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export type ContractCall = {
params: any[];
};

type TargetContract = Pick<Contract, 'functions' | 'interface' | 'callStatic' | 'address'>;

export class EthersMulticall {
private multicall: Multicall;
private dataLoader: DataLoader<ContractCall, any>;
Expand Down Expand Up @@ -57,7 +59,7 @@ export class EthersMulticall {
return result;
}

wrap<T extends Contract>(contract: T) {
wrap<T extends TargetContract>(contract: T) {
const abi = contract.interface.fragments;
const multicallContract = new MulticallContract(contract.address, abi as any);

Expand Down

0 comments on commit ac3b4d8

Please sign in to comment.