Migrating from v1 to v2
Migration overview
it is very easy to upgrade to V2 version.
no code change. only need change to import @deficonnect/web3-connector
package
- v2
- v1
import { DeFiWeb3Connector } from "@deficonnect/web3-connector";
const connector = new DeFiWeb3Connector({
supportedChainIds: [1],
appName: "your app name", // optional
chainType: "eth", // only support 'eth' for DeFiWeb3Connector
chainId: "25", // for eth is 1
rpcUrls: {
1: "https://mainnet.infura.io/v3/INFURA_API_KEY",
25: "https://evm-cronos.crypto.org/",
},
});
connector.activate();
import { DeFiWeb3Connector } from "deficonnect";
const connector = new DeFiWeb3Connector({
supportedChainIds: [1],
rpc: { 1: "https://mainnet.infura.io/v3/INFURA_API_KEY" },
pollingInterval: 15000,
});
connector.activate();