@deficonnect/defi-link
https://www.npmjs.com/package/deficonnect
Deprecated: This package has been deprecated. Please use this package instead:Install
yarn add "@deficonnect/defi-link"
Usage
web3-react
for if you use web3-react
, it is easy to integrat:
DeFiLinkConnector
has implementAbstractConnector
fromweb3-react
import { DeFiLinkConnector } from '@deficonnect/defi-link'
const connector = new DeFiLinkConnector({
supportedChainIds: [1],
rpc: [1: 'https://mainnet.infura.io/v3/INFURA_API_KEY'],
pollingInterval: 15000,
})
connector.activate()
normally
import { DeFiLinkConnector } from '@deficonnect/defi-link'
import Web3 from "web3"
const connector = new DeFiLinkConnector({
supportedChainIds: [1],
rpc: [1: 'https://mainnet.infura.io/v3/INFURA_API_KEY'],
pollingInterval: 15000,
})
connector.activate()
const provider = await connector.getProvider()
const web3 = new Web3(provider)