0.1.0 • Published 6 years ago

eos-websocket v0.1.0

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

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

Related Video

Related Nodeos Plugins