Skip to content

Instantly share code, notes, and snippets.

@christroutner
Created April 15, 2021 17:58
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 christroutner/bf4eecd3a7150a71399c3448f16d8890 to your computer and use it in GitHub Desktop.
Save christroutner/bf4eecd3a7150a71399c3448f16d8890 to your computer and use it in GitHub Desktop.
Calculate merit for a BCH address
const BCHJS = require('@psf/bch-js')
const bchjs = new BCHJS()
const BchMsgLib = require('bch-message-lib')
const bchMsgLib = new BchMsgLib({bchjs})
const TOKENID =
'38e97c5d7d3585a2cbf3f9580c82ca33985f9cb0845d4dcce220cb709f9538b0' // PSF
const UTXO_DELAY = 100
async function start() {
try {
const addr = 'bitcoincash:qr653cs4dcw0pya54jzp242tajv33mvnsq7g27avls'
const merit = await bchMsgLib.merit.agMerit(addr, TOKENID, UTXO_DELAY)
console.log('merit: ', merit)
} catch(err) {
console.error(err)
}
}
start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment