# bnc-notify

> Show web3 users realtime transaction notifications

Latest version **1.9.8** (published 2023-01-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install bnc-notify
pnpm add bnc-notify
yarn add bnc-notify
bun add bnc-notify
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.9.8 |
| Published | 2023-01-10 |
| First published | 2019-10-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 1.6 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 49 |
| Author | Aaron Barnard |
| Maintainers | tdawson, aaronbarnard1, cmeisl |
| Keywords | ethereum, web3, blocknative, notifications |

## Links

- npm: https://www.npmjs.com/package/bnc-notify
- Repository: https://github.com/blocknative/notify
- Homepage: https://github.com/blocknative/notify#readme
- Issues: https://github.com/blocknative/notify/issues
- npm.io page: https://npm.io/package/bnc-notify

## Dependencies (5)

- [uuid](https://npm.io/package/uuid.md) ^3.3.3
- [bnc-sdk](https://npm.io/package/bnc-sdk.md) ^4.6.4
- [bignumber.js](https://npm.io/package/bignumber.js.md) ^9.0.0
- [lodash.debounce](https://npm.io/package/lodash.debounce.md) ^4.0.8
- [regenerator-runtime](https://npm.io/package/regenerator-runtime.md) ^0.13.3

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 1.9.8 (latest) — 2023-01-10
- 1.9.7 — 2022-12-02
- 1.9.6 — 2022-10-24
- 1.9.5 — 2022-05-09
- 1.9.4 — 2022-02-14
- 1.9.3 — 2022-01-26
- 1.9.2 — 2021-12-03
- 1.9.1 — 2021-08-17
- 1.9.0 — 2021-08-17
- 1.8.0 — 2021-08-12
- 1.7.0 — 2021-07-08
- 1.6.2 — 2021-06-10
- 1.6.1 — 2021-05-20
- 1.6.0 — 2021-04-14
- 1.5.1 — 2020-12-16
- … 37 more at https://npm.io/package/bnc-notify/versions

## README

# Notify

A JavaScript library for real time notifications for Ethereum transaction state changes.

## Install

`npm install bnc-notify`

## Quick Start

```javascript
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](https://docs.blocknative.com/notify)

---
_Source: https://npm.io/package/bnc-notify · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
