Custom Networks
Custom Networks addition and selection
AppKit already comes with a list of supported networks inside of ReownAppKitModalNetworks
class. You can get supported EVM networks by selecting ReownAppKitModalNetworks.supported['eip155']
and, currently, only EVM Networks are supported (non-EVM support will come soon)
You can also get supported test networks by doing ReownAppKitModalNetworks.test['eip155']
.
Check the list of suppoted networks here https://github.com/reown-com/blockchain-api/blob/master/SUPPORTED_CHAINS.md#list-of-supported-chains
However, if these chains are not enough or you don't want to support any of them you can modify the list associated to the namespace.
It is important that this is done before AppKitModal configuration.
// Example adding extra and test networks
final extraNetworks = ReownAppKitModalNetworks.extra['eip155'] ?? [];
ReownAppKitModalNetworks.addNetworks('eip155', extraNetworks);
final testNetworks = ReownAppKitModalNetworks.test['eip155'] ?? [];
ReownAppKitModalNetworks.addNetworks('eip155', testNetworks);
// Example removing Aurora network from the list
ReownAppKitModalNetworks.removeNetworks('eip155', ['1313161554']);
You can also create and add a custom network. For instance...
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]);