Skip to content

Instantly share code, notes, and snippets.

@ptsayli
Created June 24, 2020 07:34
Show Gist options
  • Save ptsayli/23da2e5095f25bb4155211b45d4e9d39 to your computer and use it in GitHub Desktop.
Save ptsayli/23da2e5095f25bb4155211b45d4e9d39 to your computer and use it in GitHub Desktop.
const WebSocket = require('ws')
const ws = new WebSocket('wss://ws-mumbai.matic.today/')
ws.on('open', function open() {
ws.send('{"id": 1, "method": "eth_subscribe", "params": ["newDeposits", {}]}')
})
ws.on('message', function incoming(data) {
console.log(data)
})
ws.on('close', function close() {
console.log('closing websocket connection...')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment