Created
September 14, 2018 14:14
-
-
Save makevoid/76ed2ea04aa3f97fde6a70a8c5de0731 to your computer and use it in GitHub Desktop.
Bitpay/insight-client demonstration against BCH insight hosted by blockdozer.com
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
const Insight = require("insight-client") | |
const insightHost = "https://blockdozer.com/insight-api" | |
const insight = new Insight(insightHost) | |
const addrInfo = () => { | |
return new Promise((resolve, reject) => { | |
insight.addr(address, (err, data) => { | |
if (err) { reject(err); return } | |
resolve(data) | |
}) | |
}) | |
} | |
;(async () => { | |
const addressInfo = await addrInfo(address) | |
console.log(addressInfo) | |
// check all the endpoints: https://www.npmjs.com/package/insight-client#endpoints | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment