Created
June 24, 2020 07:34
-
-
Save ptsayli/23da2e5095f25bb4155211b45d4e9d39 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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