Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
bch-consumer
Advanced tools
bch-consumer is a JS library for retrieving eCash or BCH blockchain data from ipfs-bch-wallet-consumer, which in turn gets its information from ipfs-bch-wallet-service. Read the article Realizing the Web3 Cash Stack to learn more about this software stack.
npm install --save bch-consumer
// Configure this constant for your infrastructure.
const RESTURL = 'https://free-bch.fullstack.cash'
// const RESTURL = 'http://localhost:5005'
console.log(`Using this REST URL for bch-consumer: ${RESTURL}`)
// Instantiate bch-consumer
const BchConsumer = require('bch-consumer')
const bchConsumer = new BchConsumer({ restURL: RESTURL })
Here are some simple examples illustrating how to use this library. These examples assume the BCH blockchain.
const addr = 'bitcoincash:qp3sn6vlwz28ntmf3wmyra7jqttfx7z6zgtkygjhc7'
const result = await bchConsumer.bch.getBalance(addr)
console.log('result: ', result)
const addr = 'bitcoincash:qp3sn6vlwz28ntmf3wmyra7jqttfx7z6zgtkygjhc7'
const result = await bchConsumer.bch.getUtxos(addr)
console.log('result: ', result)
const hex = '0100000001000000000000abcdef'
const result = await bchConsumer.bch.sendTx(hex)
console.log('result: ', result)
const addr = 'bitcoincash:qp3sn6vlwz28ntmf3wmyra7jqttfx7z6zgtkygjhc7'
const result = await bchConsumer.bch.getTxHistory(addr)
console.log('result: ', result)
const txids = [
'01517ff1587fa5ffe6f5eb91c99cf3f2d22330cd7ee847e928ce90ca95bf781b'
]
const result = await bchConsumer.bch.getTxData(txids)
console.log('result: ', result)
const addr = 'bitcoincash:qp3sn6vlwz28ntmf3wmyra7jqttfx7z6zgtkygjhc7'
const result = await bchConsumer.msg.getPubKey(addr)
console.log('result: ', result)
FAQs
A npm JS library for interacting with ipfs-bch-wallet-consumer REST API
The npm package bch-consumer receives a total of 7 weekly downloads. As such, bch-consumer popularity was classified as not popular.
We found that bch-consumer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.