Custom Networks
Custom Networks addition and selection
AppKit already comes with a list of supported networks inside of ReownAppKitModalNetworks
class. You can get default supported EVM networks by selecting ReownAppKitModalNetworks.supported['eip155']
and, currently, only EVM Networks are supported (non-EVM support will come soon). Check the list of supported networks
This class also comes with extra networks ReownAppKitModalNetworks.extra['eip155']
and test networks ReownAppKitModalNetworks.test['eip155']
, however, these are not included in the supported list by default.
If these chains are not enough for you or you don't want to support some of them you can modify the list associated to the namespace.
note
It is important that this is done before AppKitModal configuration.
Adding extra and/or test networks to the supported list
// Adding extra networks
final extraNetworks = ReownAppKitModalNetworks.extra['eip155'] ?? [];
ReownAppKitModalNetworks.addNetworks('eip155', extraNetworks);
// Adding test networks
final testNetworks = ReownAppKitModalNetworks.test['eip155'] ?? [];
ReownAppKitModalNetworks.addNetworks('eip155', testNetworks);
Removing Aurora network from the list
ReownAppKitModalNetworks.removeNetworks('eip155', ['1313161554']);
Adding a custom network
final customNetwork = ReownAppKitModalNetworkInfo(
name: 'Ethereum',
chainId: '1',
currency: 'ETH',
rpcUrl: 'https://ethereum-rpc.publicnode.com',
explorerUrl: 'https://etherscan.io',
isTestNetwork: false,
);
ReownAppKitModalNetworks.addNetworks('eip155', [customNetwork]);