npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mywallet

v0.1.7

Published

blockchain.info My Wallet API for node.js

Downloads

12

Readme

myWallet

blockchain.info My Wallet API for node.js

npm package

Documentation

var mywallet = require("mywallet");
var sampleWallet = new mywallet({
  guid: "SECRET",
  password: "SECRET"
});

Make outgoing payments

sampleWallet.payment({
  // if double encryption is enabled
  second_password: "SECRET",
  // recipients bitcoin address
  to: "1AxqCZjGRwRNzqCvQyUEaFN5auxVbWBfdN",
  // amount to send in satoshi
  amount: 10000,
  // send from a specific bitcoin address *optional*
  from: "14D3Y424biYtx8RyJXQGtaNvDFhWGSJmxc",
  // "true" or "false" indicating whether the transaction should be sent through a shared wallet. fees apply *optional*
  shared: true,
  // transaction fee value in satoshi *optional*
  fee: 1000,
  // a public note to include with the transaction *optional*
  note: "i love you"
}, function(err, res) {
  if(err) throw err;
  /*
   * response could be:
   *  {
   *    "message": "Sent 0.1 BTC to 1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq",
   *    "tx_hash": "f322d01ad784e5deeb25464a5781c3b20971c1863679ca506e702e3e33c18e9c",
   *    "notice": "Some funds are pending confirmation and cannot be spent yet (Value 0.001 BTC)"
   *  }
   */
});

Send many transactions

sampleWallet.multiplePayments({
  // if double encryption is enabled
  second_password: "SECRET",
  // recipients bitcoin addresses and amount to send
  to: {
    "1AxqCZjGRwRNzqCvQyUEaFN5auxVbWBfdN": 10000,
    "14D3Y424biYtx8RyJXQGtaNvDFhWGSJmxc": 10000
  },
  // send from a specific bitcoin address *optional*
  from: "12BpKnhWAVUtExZYyZGiucaaKQ56UviMYw",
  //  "true" or "false" indicating whether the transaction should be sent through a shared wallet. fees apply
  shared: true,
  // transaction fee value in satoshi *optional*
  fee: 1000,
  // a public note to include with the transaction *optional*
  note: "i love you"
}, function(err, res) {
  if(err) throw err;
  /*
   * response could be:
   *  {
   *    "message" : "Sent To Multiple Recipients",
   *    "tx_hash" : "f322d01ad784e5deeb25464a5781c3b20971c1863679ca506e702e3e33c18e9c"
   *  }
   */
});

Fetching the wallet balance

sampleWallet.getBalance(function(err, res) {
  if(err) throw err;
  /*
   * response could be:
   *  {
   *    "balance": 1000
   *  }
   */
});

Listing addresses

sampleWallet.getAddresses({
  // the minimum number of confirmations transactions must have before being included in balance of addresses *optional*
  confirmations: 50
}, function(err, res) {
  if(err) throw err;
  /*
   * response could be:
   *  {
   *    "addresses": [
   *      {
   *        "balance": 1400938800,
   *        "address": "1AxqCZjGRwRNzqCvQyUEaFN5auxVbWBfdN",
   *        "label": "SMS Deposits",
   *        "total_received": 5954572400
   *      },
   *      {
   *        "balance": 79434360,
   *        "address": "14D3Y424biYtx8RyJXQGtaNvDFhWGSJmxc",
   *        "label": "My Wallet",
   *        "total_received": 453300048335
   *      },
   *      {
   *        "balance": 0,
   *        "address": "12BpKnhWAVUtExZYyZGiucaaKQ56UviMYw",
   *        "total_received": 0
   *      }
   *    ]
   *  }
   */
});

Getting the balance of an address

sampleWallet.getAddressBalance({
  // the bitcoin address to lookup
  address: "1AxqCZjGRwRNzqCvQyUEaFN5auxVbWBfdN",
  // minimum number of confirmations required. 0 for unconfirmed
  confirmations: 50
}, function(err, res) {
  if(err) throw err;
  /*
   * response could be:
   *  {
   *    "balance": 10000,
   *    "address": "1AxqCZjGRwRNzqCvQyUEaFN5auxVbWBfdN",
   *    "total_received": 1000000
   *  }
   */
});

Generating a new address

sampleWallet.generateAddress({
  // if double encryption is enabled
  second_password: "SECRET",
  // an optional label to attach to this address
  label: "test address"
}, function(err, res) {
  if(err) throw err;
  /*
   * response could be:
   *  {
   *    "address": "1AxqCZjGRwRNzqCvQyUEaFN5auxVbWBfdN",
   *    "label":  "test address"
   *  }
   */
});

Archiving an address

sampleWallet.archiveAddress({
  // if double encryption is enabled
  second_password: "SECRET",
  // the bitcoin address to archive
  address: "1AxqCZjGRwRNzqCvQyUEaFN5auxVbWBfdN"
}, function(err, res) {
  if(err) throw err;
  /*
   * response could be:
   *  {
   *    "archived": "1AxqCZjGRwRNzqCvQyUEaFN5auxVbWBfdN"
   *  }
   */
});

Unarchive an address

sampleWallet.unarchiveAddress({
  // if double encryption is enabled
  second_password: "SECRET",
  // the bitcoin address to unarchive
  address: "1AxqCZjGRwRNzqCvQyUEaFN5auxVbWBfdN"
}, function(err, res) {
  if(err) throw err;
  /*
   * response could be:
   *  {
   *    "active": "1AxqCZjGRwRNzqCvQyUEaFN5auxVbWBfdN"
   *  }
   */
});

Consolidating addresses

sampleWallet.consolidate({
  // if double encryption is enabled
  second_password: "SECRET",
  // sddresses which have not received any transactions in at least this many days will be consolidated
  days: "7"
}, function(err, res) {
  if(err) throw err;
  /*
   * response could be:
   *  {
   *    "consolidated": ["1AxqCZjGRwRNzqCvQyUEaFN5auxVbWBfdN"]
   *  }
   */
});

Satoshi

Satoshi to bitcoin

var btc = sampleWallet.satoshiToBtc(10000);

Bitcoin to satoshi

var satoshi = sampleWallet.btcToSatoshi(1);