1.0.1 • Published 6 years ago

explorer-api v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

A Simple to use Node.js wrapper for POS/Masternode Explorer API.

const ExplorerAPI = require('../explorerApi');

const ginApi = new ExplorerAPI({
    host: /* MN/POS explorer host here Eg: https://explorer.gincoin.io */
    address: /* MN/POS wallet address here Eg: a_hash_code */,
});

ginApi.getAddress()
    .then(body => {
        console.log(JSON.stringify(body, null, 3));
    })
    .catch(err => {
        console.log(`Error code: ${err.code}`);
    })

ginApi.getRawTransaction({ txid: /* a unique txid */, decrypt: true /* enable decrypt */})
    .then(body => {
        console.log(JSON.stringify(body, null, 3));
    })
    .catch(err => {
        console.log(`Error code: ${err.code}`);
    })
1.0.1

6 years ago