0.0.18 • Published 6 years ago

web3-detect-network v0.0.18

Weekly downloads
7
License
MIT
Repository
github
Last release
6 years ago

web3-detect-network

Detect network from Web3 provider.

Install

npm install web3-detect-network

API

  • detectNetwork(web3Provider) -> Promise({object})

    • {object} web3Provider - Web3 provider object

    Returns an object containing id (network ID) and type (network name).

Usage

const detectNetwork = require('web3-detect-network')

;(async () => {

const network = await detectNetwork(web3.currentProvider)

console.log(network)
/*
{
  "id": "4",
  "type": "rinkeby"
}
*/
})()

Test

npm test

License

MIT

0.0.18

6 years ago

0.0.17

7 years ago

0.0.16

7 years ago

0.0.15

8 years ago

0.0.14

8 years ago

0.0.13

8 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago