Created
April 15, 2021 17:58
-
-
Save christroutner/bf4eecd3a7150a71399c3448f16d8890 to your computer and use it in GitHub Desktop.
Calculate merit for a BCH address
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 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