Skip to content
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

Multichain support #2

Open
architect-dev opened this issue Mar 26, 2024 · 0 comments
Open

Multichain support #2

architect-dev opened this issue Mar 26, 2024 · 0 comments

Comments

@architect-dev
Copy link

Hey, love the package its definitely streamlined my workflow.

I was wondering what you thought of multichain support, would it be possible to parse the wagmi config to fetch the chains that are being used, and allow an address to be set for each chain.

I imagine the api would look something like this:

const abiMap = processTypechainAbis(typechain, {
  ContractName: {
    // defaultAddress: "0x1234...", //  Keep default address If only using one chain, prevent breaking changes
    chains: {
        [mainnet]: "0x01234...",
        [sepolia]: "0x11234...",
    },
  },
});

Then the useContract hook would fetch the correct contract based on the chain that is currently connected, instead of passing in the chain specific address each time it is called.

Let me know what you think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant