original repo: https://github.com/rsksmart/rLogin-web3-react-connector adds additional supportedChainIds to it
@rsksmart/rlogin-web3-react-connector
Wrapper for rLogin to make easier integrations with web3-react apps
A Web3 React provider for rLogin. This package can be used with existing Web3 React implementations where you want to use the rLogin provider selector.
Features
Uses the rLogin provider selector, and authenticaion or data vault if required, and passes the provider to the Web3 React implementation.
Implementation
Add the dependecy to your project:
yarn add @rsksmart/rlogin-web3react-provider --save
Then connect with rLogin, convert the response with this package, and pass it to Web3React:
const { activate } = useWeb3React()
rLogin.connect()
.then(rloginResponse => new Web3ReactProvider(rloginResponse))
.then(connector => activate(connector, undefined, true))
Implementation notes
- Tested with Metamask and WalletConnect.
- Portis has known issues with estimating the gas price. You must use
request
when sending transacitons. See the rLogin docs for additional information about this error.
Run for development
Install dependencies:
npm i
Run unit tests
npm test
Coverage report with:
npm run test:coverage
Run linter
npm run lint
Auto-fix:
npm run lint:fix
Build for production
npm run build