bitcoin-mock

0.0.5 • Public • Published

bitcoin-mock

A simple nodejs library for mocking bitcoin.

Usage

var bitcoinMock = require('bitcoin-mock');
var client = new bitcoinMock.Client();
 
client.getBalance('*', 6, function(err, reply) {
  console.log(reply); // 0
});

Supported commands

  • getbalance
  • gettransaction
  • getblock
  • importprivkey
  • setaccount
  • sendmany
  • sendtoaddress

Additional commands

  • pushTransaction(account, confirmations, category, amount)

Creates a new transaction.

  • pushBlock(confirmations, [txids])

Creates a new block.

  • flush()

Flush everything.

  • _transactions, _blocks, _accounts

Objects used to store information. By quering them you can check if your code works as expected.

What's missing

  • All unsupported commands
  • Some commands don't support optional parameters

Readme

Keywords

Package Sidebar

Install

npm i bitcoin-mock

Weekly Downloads

0

Version

0.0.5

License

ISC

Last publish

Collaborators

  • anton.nesterov