Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let listen_slp = async function () {
- var query = {
- "v": 3,
- "q": {"find": {}},
- "r": {"f": "[ .[] | { txid: .tx.h, out: .slp.detail.outputs?, in: .in[0].e.a, token: .slp.detail.tokenIdHex, valid: .slp.valid }]"}
- }
- var socket = new EventSource('https://slpstream.fountainhead.cash/s/'+btoa(JSON.stringify(query)))
- socket.onopen = function() {console.log('Connected to SLPStream at ' + (new Date().getTime()))}
- socket.onmessage = function(event) {
- var event = JSON.parse(event.data)
- if(event.type == 'mempool' && event.data[0].valid) {
- }
- }
- socket.onerror = function(err) {
- console.error('[Error SLPStream at ' + (new Date().getTime()) + ']:')
- console.error(err)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement