• This repository has been archived on 07/Mar/2023
  • Stars
    star
    405
  • Rank 106,656 (Top 3 %)
  • Language
    JavaScript
  • Created about 10 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Blockchain Web Wallet Library - https://support.blockchain.com

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:

More Repositories

1

service-my-wallet-v3

Blockchain Wallet API Service
JavaScript
887
star
2

blockchain-wallet-v4-frontend

Blockchain.com's open source, non-custodial Wallet
TypeScript
758
star
3

My-Wallet-V3-Android

Blockchain Android Wallet
Kotlin
554
star
4

thunder

Off-Chain Bitcoin payments using smart contracts
Java
531
star
5

My-Wallet-V3-iOS

Blockchain iOS Wallet
Swift
369
star
6

receive-payments-demos

Blockchain.info Receive Payments API V2 Demos
PHP
271
star
7

My-Wallet-V3-Frontend

Blockchain Web Wallet Frontend
JavaScript
207
star
8

unused-My-Wallet

Legacy Blockchain Web Wallet - current version is at https://github.com/blockchain/My-Wallet-V3-Frontend
JavaScript
207
star
9

unused-My-Wallet-iPhone

For latest source, please see: https://github.com/blockchain/My-Wallet-V3-iOS
Assembly
127
star
10

lib-exchange-client

C#
124
star
11

Blockchain-Known-Pools

Blockchain Known Pools Tracking Info
109
star
12

my-wallet-backup-decryption-tool

JavaScript
49
star
13

unused-My-Wallet-V3-jar

Deprecated. Now lives here: https://github.com/blockchain/My-Wallet-V3-Android/tree/master/wallet
Java
34
star
14

Checksum-Wallet

Wallet checksums
32
star
15

bc-phone-number

An AngularJS international phone input directive
JavaScript
32
star
16

coin-definitions

Python
31
star
17

My-Wallet-Chrome-Extension

Chrome Extension For Blockchain.info Wallets
Shell
25
star
18

components

Components library for the Blockchain.com ecosystem 💍 🔥
JavaScript
24
star
19

bc-countries

A convenient Javascript countries utilities (e.g: dial codes, country codes, names)
JavaScript
18
star
20

wallet-options

JavaScript
17
star
21

bitcoin-exchange-client

JavaScript
16
star
22

bitcoin-coinify-client

JavaScript
14
star
23

constellation

TypeScript
13
star
24

bitcoin-sfox-client

JavaScript
12
star
25

OpenQuestDB

High performance, low latency multi-value SQL database optimised for time series
Java
10
star
26

Checksum-Explorer

Explorer checksums
9
star
27

My-Wallet-V3-Bower

9
star
28

sre-rust-tss-esapi

Rust
9
star
29

bitcoin-unocoin-client

JavaScript
8
star
30

cashaddrj

Java
8
star
31

api-v1-client-java

Blockchain Bitcoin Developer APIs - Java
Java
7
star
32

digits-trie

Fast prefix operations for strings of digits
JavaScript
6
star
33

bc-css-flags

Countries flags styles using only one picture
CSS
5
star
34

android_tech_dependencies

Empty Android project with standard dependencies
Kotlin
2
star