1.0.6 • Published 2 years ago

react-wallet-connector v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-wallet-connector

Made with create-react-library

NPM JavaScript Style Guide

Install

yarn add react-wallet-connector

preview

Usage

Requrirements

Pass the connection options in an object as seen on WalletConnectionsByName.

enum Network {
  Main = 1,
  Ropsten = 3,
  Rinkeby = 4,
  Goerli = 5,
  Kovan = 42
}

const CURRENT_NETWORK = Network.Rinkeby

const INFURA_URLS = {
  1: 'https://mainnet.infura.io/v3/<INFURA KEY>',
  4: 'https://rinkeby.infura.io/v3/<INFURA KEY>'
}

const WalletConnectorsByName = {
  MetaMask: {
    connector: new InjectedConnector({
      supportedChainIds: [1, 3, 4, 5, 42]
    })
  },
  WalletConnect: {
    connector: new WalletConnectConnector({
      rpc: INFURA_URLS,
      bridge: 'https://bridge.walletconnect.org',
      qrcode: true
    })
  },
  Coinbase: {
    connector: new WalletLinkConnector({
      url: INFURA_URLS[CURRENT_NETWORK],
      supportedChainIds: [Network.Main, Network.Rinkeby],
      appName: 'web3-react example'
    })
  },
  Ledger: {
    connector: new LedgerConnector({
      chainId: 1,
      url: INFURA_URLS[CURRENT_NETWORK],
      pollingInterval: 8000
    })
  },
  Trezor: {
    connector: new TrezorConnector({
      chainId: 1,
      url: INFURA_URLS[CURRENT_NETWORK],
      pollingInterval: 8000,
      manifestEmail: 'dummy@abc.xyz',
      manifestAppUrl: 'https://8rg3h.csb.app/'
    })
  },
  Fortmatic: {
    connector: new FortmaticConnector({
      apiKey: '<API KEY>',
      chainId: 1
    })
  },
  Authereum: {
    connector: new AuthereumConnector({
      chainId: CURRENT_NETWORK
    })
  }
}

<ConnectWallet
  connectors={WalletConnectorsByName}
  infuraUrls={INFURA_URLS}
/>

License

MIT © howitworks18

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago