This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(studio): Add load to Multicall wrapper interface (#2825)
- Loading branch information
1 parent
18379f2
commit ce4285b
Showing
3 changed files
with
13 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
import { Contract } from 'ethers'; | ||
import { FunctionFragment } from '@ethersproject/abi'; | ||
import { Contract, ethers } from 'ethers'; | ||
|
||
import { Multicall } from '~contract/contracts'; | ||
|
||
type TargetContract = Pick<Contract, 'functions' | 'interface' | 'callStatic' | 'address'>; | ||
export type ContractCall = { | ||
fragment: FunctionFragment; | ||
address: string; | ||
params: any[]; | ||
stack?: string; | ||
}; | ||
|
||
export type TargetContract = Pick<Contract, 'functions' | 'interface' | 'callStatic' | 'address'>; | ||
|
||
export interface IMulticallWrapper { | ||
get contract(): Multicall; | ||
load(call: ContractCall): Promise<ethers.utils.Result>; | ||
wrap<T extends TargetContract>(contract: T): T; | ||
} |