Closed Kamikozz closed 2 years ago
Greetings! Thank you @Kamikozz for your Pull Request and interest in this package.
Do you use addChains
method? With this method you can add custom chains to your project.
Use this example structure in your project to add method:
import { ConnectWallet } from '@amfi/connect-wallet';
const connectWallet = new ConnectWallet();
const chains = [
{
name: 'fantom',
chainID: 250,
hex: '0xfa',
},
{
name: 'fantom-testnet',
chainID: 4002,
hex: '0xfa2',
}
];
// Add chains
connectWallet.addChains(chains);
// Init connect
connectWallet.connect(provider, network, settings).then(
(connected: boolean) => console.log('connect wallet: ', connected),
(err: any) => console.log('connect wallet error: ', err)
);
@amaryfilo Thanks for advice! I've used this method to extend the library's default chains. Works perfectly!
https://docs.fantom.foundation/tutorials/set-up-metamask
https://docs.fantom.foundation/tutorials/set-up-metamask-testnet