# eos-websocket

> EOS WebSocket

Latest version **0.1.0** (published 2018-09-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install eos-websocket
pnpm add eos-websocket
yarn add eos-websocket
bun add eos-websocket
```

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2018-09-20 |
| First published | 2018-09-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Author | Denis Carriere |
| Maintainers | deniscarriere |

## Links

- npm: https://www.npmjs.com/package/eos-websocket
- Repository: https://github.com/EOS-Nation/eos-websocket
- Homepage: https://github.com/EOS-Nation/eos-websocket#readme
- Issues: https://github.com/EOS-Nation/eos-websocket/issues
- npm.io page: https://npm.io/package/eos-websocket

## Dependencies (1)

- [ws](https://npm.io/package/ws.md) *

## Recent versions

- 0.1.0 (latest) — 2018-09-20

## README

# EOS Websockets/Webhooks

Able to receive a push notification of a transaction (optional Block ID & Traces)

## Install

**npm*

```
$ npm install --save eos-websocket
```

## Javascript

```
import EosWebSocket from "eos-websocket";

const ws = new EosWebSocket("ws://35.203.114.193/v1/stream");

ws.on('open', () => {
    ws.get_table_deltas("eosio", "eosio", "global");
    ws.get_actions("eosio.token", "transfer");
})

ws.on("message", message => {
    console.log(message);
})
```

## Websocket

Listen for all transactions from a particular contract (scope)

```
ws://<SERVER>/v1/transaction/<SCOPE>
ws://<SERVER>/v1/transaction/eosio.token
```

Listen for all transactions from a particular contract (scope) & action

```
ws://<SERVER>/v1/transaction/<SCOPE>/<ACTION>
ws://<SERVER>/v1/transaction/eosio.token/transer
```

## Types of Notifications

1) websocket (and/or socket.io)
2) web hook (we poke your API on trigger)
3) long polling API (eosjs compatible) on steroids

## Related Javascript

- WebSockets (https://github.com/websockets/ws)
- Socket.io (https://github.com/socketio/socket.io)

## Related Video

- Push Irreversible Transaction (https://youtu.be/dO-Le3TTim0?t=34m6s)

## Related Nodeos Plugins

- Watcher & ZeroMQ Nodeos plugin (https://github.com/acoutts/chintai-zeromq-watcher-plugin)

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