Created
February 15, 2023 22:44
-
-
Save WietseWind/70cdd872d4ff34065608ade95ce20246 to your computer and use it in GitHub Desktop.
Xumm WebSocket test
This file contains 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
import { Xumm } from 'xumm' | |
import WebSocket from 'ws' | |
const xumm = new Xumm('xxxxxx', 'yyyyyy') | |
const payload = await xumm.payload?.create({ TransactionType: "SignIn" }) | |
console.log(payload.refs.websocket_status) | |
const ws = new WebSocket(payload.refs.websocket_status) | |
ws.on('open', function open() { | |
console.log('WebSocket opened') | |
}); | |
ws.on('message', function message(data) { | |
console.log('Received: %s', data) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment