-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: type multicall usage #380
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
result: C['functions'][M] extends (...args: any) => Promise<infer T> ? T | undefined : never | ||
} | ||
|
||
type MultipleContractParams< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that *ContractParams
is actually lossy, because it loses the names/documentation around the parameters and only retains their typing. Arguably, this should be explicit so that names are retained for a better devX. wdyt?
import { useWeb3React } from '@web3-react/core' | ||
import { Interface } from 'ethers/lib/utils' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be @ethersproject/contract-interfaces
or something similar, not from the ethers
umbrella package.
@@ -8,9 +8,9 @@ import useIsArgentWallet from './useIsArgentWallet' | |||
export function useArgentWalletContract(): ArgentWalletContract | null { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type is now implied, and can be removed from the function definition.
Adds typings for multicall hooks to improve multicall ergonomics and reduce the chance of misuse (eg ReferenceErrors).
Although functional, this is a POC - it is better to move this into redux-multicall itself so it can be useful for interface and other consumers as well.