0.0.18 • Published 5 years ago

web3-detect-network v0.0.18

Weekly downloads
7
License
MIT
Repository
github
Last release
5 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

5 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago