Skip to content

DecentricCorp/bitcoin-mock

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Simple Bitcoin nodejs mock for testing (Used to test COHORT spec)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%