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

blockchain-wallet-client2

v3.44.2

Published

Blockchain.info JavaScript Wallet

Downloads

2

Readme

MyWallet Build Status Coverage Status

JavaScript Model for Blockchain.info wallet.

Build

Install Yarn

yarn # recommended, can also use `npm install`
npm run build

Tests

npm test

Dev

Watch files and re-build

npm run build:watch

Clean

Clean generated files:

make clean

Getting Started

Load dist/my-wallet.js.

Optional: set alias for modules you use

var MyWallet = Blockchain.MyWallet;
var WalletStore = Blockchain.WalletStore;
var Spender = Blockchain.Spender;
var API = Blockchain.API;

Disable logout, if desired, for development work:

MyWallet.disableLogout(true);

// Set an interval, since logout gets reactived by certain parts of the code
window.setInterval(function() { MyWallet.disableLogout(true); }, 60000);

My Wallet communicates about its state with user-defined event listeners. Setup a listener like so:

function myListenerFun(eventName, data) {
    // Handle events
}

// Register listener function with MyWallet
MyWallet.addEventListener(myListenerFun);

Some events that we need to process:

| Event Name | Our Action | | :--- | :--- | | did_multiaddr | Populate wallet statistics on the UI | | hd_wallets_does_not_exist | Create an HD wallet | | on_wallet_decrypt_finish | Get wallet transaction history |

To build an HD wallet with an existing legacy wallet, we must initialize after receiving event notification from MyWallet.

var passphrase = MyWallet.generateHDWalletPassphrase();

MyWallet.initializeHDWallet(passphrase, null, null, _successFun, _errorFun);

Load a wallet from the server, with no 2FA

var guid = "my-wallet-guid-1234-bcde";
var pass = "wallet-password";
var twoFactorCode = null;

MyWallet.fetchWalletJSON(guid, null, null, pass, twoFactorCode,
    successFun, need2FAfun, wrong2FAfun, otherErrorFun);

// Do stuff with the wallet
var LegacyAddresses = MyWallet.getLegacyActiveAddresses();

In order to fetch the wallet history, make a call to get_history:

MyWallet.get_history(_successFun, _errorFun);

get_history will trigger the did_multiaddr event on completion, so the wallet stats and display can be updated.

Security

Security issues can be reported to us in the following venues: