├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── angular-bitcore-wallet-client.js ├── angular-bitcore-wallet-client.min.js ├── bower.json ├── index.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # Compiled binary addons (http://nodejs.org/api/addons.html) 20 | build/Release 21 | 22 | # Dependency directory 23 | # Commenting this out is preferred by some people, see 24 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- 25 | node_modules 26 | bower_components 27 | 28 | # Users Environment Variables 29 | .lock-wscript 30 | 31 | # OSX 32 | 33 | .DS_Store 34 | .AppleDouble 35 | .LSOverride 36 | 37 | # Icon must end with two \r 38 | Icon 39 | 40 | # Thumbnails 41 | ._* 42 | 43 | # Files that might appear on external disk 44 | .Spotlight-V100 45 | .Trashes 46 | 47 | # Directories potentially created on remote AFP share 48 | .AppleDB 49 | .AppleDesktop 50 | Network Trash Folder 51 | Temporary Items 52 | .apdisk 53 | 54 | # VIM ignore 55 | 56 | [._]*.s[a-w][a-z] 57 | [._]s[a-w][a-z] 58 | *.un~ 59 | Session.vim 60 | .netrwhist 61 | *~ 62 | 63 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 BitPay 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | BIN_PATH:=node_modules/.bin/ 2 | 3 | all: angular-bitcore-wallet-client.min.js 4 | 5 | clean: 6 | rm -f angular-bitcore-wallet-client.js 7 | rm -f angular-bitcore-wallet-client.min.js 8 | 9 | angular-bitcore-wallet-client.js: index.js 10 | ${BIN_PATH}browserify $< > $@ 11 | 12 | angular-bitcore-wallet-client.min.js: angular-bitcore-wallet-client.js 13 | ${BIN_PATH}uglify -s $< -o $@ 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # angular-bitcore-wallet-client 2 | 3 | THIS PACKAGE IS NOT LONGER MAINTAINED, SINCE IT WAS INTEGRATIONS INTO COPAY. IF YOU NEED IT, UPDATING BWC VERSION 4 | SHOULD BE STRAIGTH FORWARD. 5 | =- 6 | 7 | 8 | AngularJS module for [bitcore-wallet-client](https://github.com/bitpay/bitcore-wallet-client) 9 | 10 | ## Get started 11 | 12 | ``` 13 | bower install angular-bitcore-wallet-client 14 | ``` 15 | 16 | Add javascript to `index.html` after *angular.js*: 17 | 18 | ```html 19 | 20 | ``` 21 | 22 | Add to your array of AngularJS modules: 23 | 24 | ``` 25 | var modules = [ 26 | 'bwcModule' 27 | ]; 28 | 29 | var myApp = angular.module('myApp', modules); 30 | ``` 31 | 32 | ## Use 33 | 34 | See the [API referece](https://github.com/bitpay/bitcore-wallet-client) for more details. 35 | 36 | ```javascript 37 | angular.module('myApp').factory('myService', 38 | function(bwcService) { 39 | var walletClient = bwcService.getClient(); 40 | walletClient.createWallet('Personal Wallet', 'me', 1, 1, 'livenet', function(err) { 41 | 42 | // Store in 43 | save(walletClient.export()); 44 | 45 | // Read other wallet 46 | var wallet2 = read(...); 47 | var walletClient2 = bwcService(getClient(wallet2)); 48 | 49 | walletClient2.getStatus(function(err, status) { 50 | console.log(status); 51 | }); 52 | }); 53 | } 54 | ); 55 | ``` 56 | See Complete API at [Bitcore Wallet Client Readme](https://github.com/bitpay/bitcore-wallet-client) 57 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-bitcore-wallet-client", 3 | "version": "5.1.2", 4 | "description": "AngularJS module for bitcore-wallet-client library", 5 | "author": "BitPay Inc", 6 | "license": "MIT", 7 | "main": "./index.js", 8 | "repository": { 9 | "type": "git", 10 | "url": "git@github.com:bitpay/angular-bitcore-wallet-client.git" 11 | }, 12 | "ignore": [ 13 | "**/.*", 14 | "lib", 15 | "node_modules", 16 | "bower_components", 17 | "Gruntfile.js", 18 | "Makefile", 19 | "index.js", 20 | "test", 21 | "Makefile", 22 | "package.json" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | var bwcModule = angular.module('bwcModule', []); 2 | var Client = require('bitcore-wallet-client'); 3 | 4 | bwcModule.constant('MODULE_VERSION', '5.1.2'); 5 | 6 | bwcModule.provider("bwcService", function() { 7 | var provider = {}; 8 | 9 | var config = { 10 | baseUrl: 'https://bws.bitpay.com/bws/api', 11 | verbose: null, 12 | timeout: 100000, 13 | transports: ['polling'] 14 | }; 15 | 16 | provider.$get = function() { 17 | var service = {}; 18 | 19 | service.getBitcore = function() { 20 | return Client.Bitcore; 21 | }; 22 | 23 | service.getErrors = function() { 24 | return Client.errors; 25 | }; 26 | 27 | service.getSJCL = function() { 28 | return Client.sjcl; 29 | }; 30 | 31 | service.buildTx = Client.buildTx; 32 | service.parseSecret = Client.parseSecret; 33 | service.Client = Client; 34 | 35 | service.getUtils = function() { 36 | return Client.Utils; 37 | }; 38 | 39 | service.getClient = function(walletData, opts) { 40 | opts = opts || {}; 41 | 42 | //note opts use `bwsurl` all lowercase; 43 | var bwc = new Client({ 44 | baseUrl: opts.bwsurl || config.baseUrl, 45 | verbose: opts.verbose || config.verbose, 46 | timeout: config.timeout, 47 | transports: config.transport 48 | }); 49 | if (walletData) 50 | bwc.import(walletData, opts); 51 | return bwc; 52 | }; 53 | return service; 54 | }; 55 | 56 | return provider; 57 | }); 58 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-bitcore-wallet-client", 3 | "description": "AngularJS module for bitcore-wallet-client library", 4 | "author": "BitPay Inc", 5 | "licence": "MIT", 6 | "version": "5.1.2", 7 | "main": "index.js", 8 | "devDependencies": { 9 | "bitcore-wallet-client": "5.1.2", 10 | "browserify": "^9.0.8", 11 | "grunt": "^1.0.1", 12 | "grunt-contrib-clean": "^1.1.0", 13 | "grunt-contrib-concat": "^1.0.1", 14 | "grunt-contrib-copy": "^1.0.0", 15 | "grunt-contrib-uglify": "^2.3.0", 16 | "uglify": "^0.1.1" 17 | }, 18 | "repository": { 19 | "url": "git://github.com/bitpay/angular-bitcore-wallet-client.git", 20 | "type": "git" 21 | } 22 | } 23 | --------------------------------------------------------------------------------