Skip to content

Instantly share code, notes, and snippets.

Avatar
👻
One man’s constant is another man’s variable.

Grégory Saive evias

👻
One man’s constant is another man’s variable.
View GitHub Profile
@evias
evias / read_credits.js
Last active May 29, 2017
NEM-sdk: Read Mosaics owned of a given account (Game Credits stored as Mosaic on the NEM Blockchain)
View read_credits.js
console.log("Hello, NEMber");
// Configure a Blockchain endpoint and include SDK
var NEM_HOST = "http://bob.nem.ninja"; // bob is Testnet!
var NEM_PORT = 7890;
var nem = require("nem-sdk").default;
var node = nem.model.objects.create("endpoint")(NEM_HOST, NEM_PORT);
// Issue the Mosaics request for the given Account (insert Player XEM address here)
nem.com.requests.account.mosaics(node, "TCTIMURL5LPKNJYF3OB3ACQVAXO3GK5IU2BJMPSU")