Published: 06 Nov 2019 › Updated: 06 Nov 2019
Spectrum API - NodeJS client code example
NodeJS client code example for Telos Testnet
global.fetch = require('node-fetch')
global.WebSocket = require('ws')
const telosTrxStatus = () =>{
const messageBody = {
"apikey": "test-api-key",
"event": "subscribe",
"type": "get_actions",
"data": {
"account": "eosio",
"actions": ["transfer"]
}
}
const socket = new WebSocket("wss://testnet.telos.eostribe.io/streaming")
socket.onopen = () => {
socket.send(JSON.stringify(messageBody));
}
socket.onmessage = (event) => {
console.log('Telos websocket:', JSON.parse(event.data))
}
socket.onclose = (event)=> {
console.log("Telos socket connection closed:" +event.data)
}
socket.onerror = function(error) {
console.log("Telos websocket got error: " +error.message)
}
}
telosTrxStatus()
Assuming code above is saved in index.html, one can run above code by executing following commands:
npm install node-fetch
node index.js
Feel free to give it a try and provide your feedback at out Telegram channel: https://t.me/EOSTribe
See more posts about Spectrum API on SteemIt: https://steemit.com/@eostribe/
EOS Tribe is committed to continue work on creating innovative solutions for EOSIO.
Leave Spectrum API - NodeJS client code example to:
Read more #spectrum posts
Best Posts From EOS Tribe
We have not curated any of eostribe's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From EOS Tribe
- EOS Tribe joins the WAX Network
- EOS Tribe + EOS USA launch Spectrumeos.io
- EOS Tribe + EOS USA are bringing Spectrum API + Full History API to EOS
- Spectrum API - NodeJS client code example
- Spectrum API - JS Client library with samples
- Spectrum API - Added get_table_rows endpoint
- Spectrum API running on Telos Mainnet
- Spectrum API - get_transaction endpoint available
- Spectrum API - Client JS samples
- Spectrum API running on Telos Testnet
- Spectrum API running on Telos Testnet
- Introducing Spectrum Streaming API for EOSIO
- My reflection on EOS history and current state
- New way to create EOS accounts without any upfront cost
- Easy New Account Creation Process for EOS, BOS, Telos and Meet.One
- KIBISIS Wallet adds support for Meet.One chain
- Kibisis Wallet Update - June 2019
- EOS Tribe open source swift-ecc library
- EOS Tribe announces partnership with StrongBlock
- Kibisis Wallet now available on App Store