Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
blockchain-wallet-client
Advanced tools
Readme
JavaScript Model for Blockchain.info wallet.
yarn # recommended, can also use `npm install`
npm run build
npm test
Watch files and re-build
npm run build:watch
Clean generated files:
make clean
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 issues can be reported to us in the following venues:
FAQs
Blockchain.info JavaScript Wallet
The npm package blockchain-wallet-client receives a total of 17 weekly downloads. As such, blockchain-wallet-client popularity was classified as not popular.
We found that blockchain-wallet-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.