Skip to content

Instantly share code, notes, and snippets.

@WietseWind
Created February 15, 2023 22:44
Show Gist options
  • Save WietseWind/70cdd872d4ff34065608ade95ce20246 to your computer and use it in GitHub Desktop.
Save WietseWind/70cdd872d4ff34065608ade95ce20246 to your computer and use it in GitHub Desktop.
Xumm WebSocket test
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