Skip to content

Instantly share code, notes, and snippets.

@makevoid
Created September 14, 2018 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makevoid/76ed2ea04aa3f97fde6a70a8c5de0731 to your computer and use it in GitHub Desktop.
Save makevoid/76ed2ea04aa3f97fde6a70a8c5de0731 to your computer and use it in GitHub Desktop.
Bitpay/insight-client demonstration against BCH insight hosted by blockdozer.com
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