1.0.15 • Published 2 years ago
@3swallet.js/connectors v1.0.15
@3swallet.js/connectors
Connectors for 3S Wallet supported third-parties:
For more details, read the documentation
Installation
- yarn:
yarn add @3swallet.js/connectors
- npm:
npm install @3swallet.js/connectors
Quick start
- web3-react
import { Web3ReactConnector } from '@3swallet.js/connectors'
import { useWeb3React } from '@web3-react/core';
const wallet3s = new Web3ReactConnector({
rpc: { [1]: `https://mainnet.infura.io/v3/${process.env.INFURA_KEY}` },
chainId: 1,
});
const connectors = {wallet3s}
const { active } = useWeb3React();
const setProvider = (type) => {
window.localStorage.setItem('provider', type);
};
const connect = () => {
activate(connectors.wallet3s);
setProvider('wallet3s');
};
- Wagmi
import { WagmiConnector } from '@3swallet.js/connectors'