1.9.8 • Published 1 year ago
bnc-notify v1.9.8
Notify
A JavaScript library for real time notifications for Ethereum transaction state changes.
Install
npm install bnc-notify
Quick Start
import Notify from 'bnc-notify'
import Web3 from 'web3'
const web3 = new Web3(window.ethereum)
const options = {
dappId: 'Your dappId here',
networkId: 1
}
// initialize notify
const notify = Notify(options)
// get users' account address
const accounts = await window.ethereum.enable()
// send a transaction
web3.eth
.sendTransaction({
from: accounts[0],
to: '0x792ec62e6840bFcCEa00c669521F678CE1236705',
value: '100000'
})
// listen for transaction hash
.on('transactionHash', hash => {
// pass the hash to notify.hash function for transaction updates and notifications
const { emitter } = notify.hash(hash)
// use emitter to listen to transaction events
emitter.on('txSent', console.log)
emitter.on('txPool', console.log)
emitter.on('txConfirmed', console.log)
emitter.on('txSpeedUp', console.log)
emitter.on('txCancel', console.log)
emitter.on('txFailed', console.log)
emitter.on('txStuck', console.log)
emitter.on('all', console.log)
})
Documentation
For detailed documentation head to docs.blocknative.com
1.9.8
1 year ago
1.9.7
1 year ago
1.9.6
2 years ago
1.9.5
2 years ago
1.9.4
2 years ago
1.9.3
2 years ago
1.9.2
2 years ago
1.9.1
3 years ago
1.9.0
3 years ago
1.8.0
3 years ago
1.7.0
3 years ago
1.6.2
3 years ago
1.6.1
3 years ago
1.6.0
3 years ago
1.5.1
3 years ago
1.5.0
4 years ago
1.4.0
4 years ago
1.3.1
4 years ago
1.3.0
4 years ago
1.2.4
4 years ago
1.2.3
4 years ago
1.2.2
4 years ago
1.2.1
4 years ago
1.2.0
4 years ago
1.1.2
4 years ago
1.1.1
4 years ago
1.1.0
4 years ago
1.0.12
4 years ago
1.0.11
4 years ago
1.0.10
4 years ago
1.0.9
4 years ago
1.0.8
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.5
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago
0.2.8
4 years ago
0.2.7
4 years ago
0.2.6
4 years ago
0.2.5
5 years ago
0.2.4
5 years ago
0.2.3
5 years ago
0.2.2
5 years ago
0.2.1
5 years ago
0.2.0
5 years ago
0.1.2
5 years ago
0.1.1
5 years ago
0.1.0
5 years ago