Created
January 11, 2019 00:21
-
-
Save dymurray/1d42b53b1ca4f3925ed7c055e6b34654 to your computer and use it in GitHub Desktop.
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
var EventSource = require("eventsource") | |
var datapay = require("datapay") | |
var source = new EventSource("https://bitgraph.network/s/ewogICJ2IjogMywKICAicSI6IHsKICAgICJmaW5kIjogewogICAgICAib3V0LmgxIjogIjgwOGQiIAogICAgICAKICAgIH0KICB9LAogICJyIjogewogICAgImYiOiAiWy5bXSB8IC5vdXRbXSB8IHNlbGVjdCguYjAub3A/ID09IDEwNikgfCAuczJdIgogIH0KfQ=="); | |
const privateKey = "" | |
source.onmessage = function(event) { | |
var data = JSON.parse(event.data) | |
console.log(data); | |
console.log(data.type); | |
if (data.type == "mempool") { | |
var key = data; | |
console.log(key) | |
} | |
} | |
const tx = { | |
data: ["0x808d", "Hello"], | |
pay: { key: privateKey } | |
} | |
datapay.send(tx, function(err, res) { | |
console.log("sent " + res) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment