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

Add custom RPCs for all evm chains #404

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/wagmiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,22 @@ import { WagmiAdapter } from '@reown/appkit-adapter-wagmi';
import { createAppKit } from '@reown/appkit/react';

// If we have an Alchemy API key, we can use it to fetch data from Polygon, otherwise use the default endpoint
// TODO we need to add better RPCs because metamask warns about unkown ones (defaults). Avalanche, base, etc.
const transports = config.alchemyApiKey
? {
[polygon.id]: http(`https://polygon-mainnet.g.alchemy.com/v2/${config.alchemyApiKey}`),
[mainnet.id]: http(`https://eth-mainnet.g.alchemy.com/v2/${config.alchemyApiKey}`),
[bsc.id]: http(`https://bnb-mainnet.g.alchemy.com/v2/${config.alchemyApiKey}`),
[arbitrum.id]: http(`https://arb-mainnet.g.alchemy.com/v2/${config.alchemyApiKey}`),
[base.id]: http(`https://base-mainnet.g.alchemy.com/v2/${config.alchemyApiKey}`),
[avalanche.id]: http(`https://avax-mainnet.g.alchemy.com/v2/${config.alchemyApiKey}`),
}
: {
[polygon.id]: http(''),
Copy link
Member

Choose a reason for hiding this comment

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

There seems to be a type issue. I assume you'll have to define the new ones here with the fallback as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup!

[mainnet.id]: http(''),
[bsc.id]: http(''),
[arbitrum.id]: http(''),
[base.id]: http(''),
[avalanche.id]: http(''),
};

// 2. Create a metadata object - optional
Expand Down
Loading