Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

toshi

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

toshi

node.js wrapper for the toshi bitcoin node

  • 0.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

toshi for node.js

This library is a wrapper for the toshi bitcoin node.

example

var toshi = require('toshi');
toshi = new toshi('https://bitcoin.toshi.io')

toshi.address.balance('1H1sq6Msgt9HjRrBuz8ieZdThzWXS6oPVA', function(err, res){
	console.log(res);
});

Which outputs:

{ hash: '1H1sq6Msgt9HjRrBuz8ieZdThzWXS6oPVA',
  balance: 848827043526,
  received: 4132683944039,
  sent: 3283856900513,
  unconfirmed_received: 0,
  unconfirmed_sent: 0,
  unconfirmed_balance: 0 }

When initiating the new toshi instance if no toshi url is provided then it will default to https://bitcoin.toshi.io. Also it's worth noting that this library will also work with litecoin. Try it out using https://litecoin.toshi.io.

lists

All list functions take an additional optional options parameter which has the fields limit and offset.

toshi.transaction.unconfirmed({limit: 1, offset: 2}, function(err, res){
	console.log(res);
});

functions

Here is a link to the official toshi documentation.

  • address
    • balance(address, cb)
    • transactions(address, options, cb)
    • unspent_outputs(address, options, cb)
  • block
    • paginate(options, cb)
    • get(hash, cb)
    • height(height, cb)
    • latest(cb)
    • transactions(hash, options, cb)
  • transaction
    • get(hash, cb)
    • unconfirmed(options, cb)
    • broadcast(hex, cb)

TODO

Add support for websockets and test out the broadcast function.

Keywords

FAQs

Package last updated on 20 Jan 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc