From bc8e5f4121be595ab6b35b322fe7fc17dab1b685 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Sat, 27 Aug 2016 23:22:04 +1200 Subject: [PATCH] Zcash-ify --- bower.json | 11 ++++++----- gulpfile.js | 2 +- index.js | 6 +++--- lib/uri.js | 8 ++++---- package.json | 14 +++++++++----- test/index.html | 4 ++-- 6 files changed, 25 insertions(+), 20 deletions(-) diff --git a/bower.json b/bower.json index df2bd9b..0d2459d 100644 --- a/bower.json +++ b/bower.json @@ -1,17 +1,18 @@ { - "name": "bitcore-lib", - "main": "./bitcore-lib.min.js", + "name": "bitcore-lib-zcash", + "main": "./bitcore-lib-zcash.min.js", "version": "0.13.19", "homepage": "http://bitcore.io", "authors": [ - "BitPay, Inc." + "BitPay, Inc.", + "Jack Grigg" ], - "description": "A pure, powerful core for your bitcoin project.", + "description": "A pure, powerful core for your zcash project.", "moduleType": [ "globals" ], "keywords": [ - "bitcoin", + "zcash", "bitcore", "btc", "satoshi" diff --git a/gulpfile.js b/gulpfile.js index a42397b..cc75a01 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,5 +1,5 @@ -var bitcoreTasks = require('bitcore-build'); +var bitcoreTasks = require('bitcore-build-zcash'); bitcoreTasks('lib'); diff --git a/index.js b/index.js index 9aa78d9..0a03a9b 100644 --- a/index.js +++ b/index.js @@ -6,9 +6,9 @@ var bitcore = module.exports; bitcore.version = 'v' + require('./package.json').version; bitcore.versionGuard = function(version) { if (version !== undefined) { - var message = 'More than one instance of bitcore-lib found. ' + - 'Please make sure to require bitcore-lib and check that submodules do' + - ' not also include their own bitcore-lib dependency.'; + var message = 'More than one instance of bitcore-lib-zcash found. ' + + 'Please make sure to require bitcore-lib-zcash and check that submodules do' + + ' not also include their own bitcore-lib-zcash dependency.'; throw new Error(message); } }; diff --git a/lib/uri.js b/lib/uri.js index 912a0c3..0f4965a 100644 --- a/lib/uri.js +++ b/lib/uri.js @@ -110,8 +110,8 @@ URI.isValid = function(arg, knownParams) { URI.parse = function(uri) { var info = URL.parse(uri, true); - if (info.protocol !== 'bitcoin:') { - throw new TypeError('Invalid bitcoin URI'); + if (info.protocol !== 'zcash:') { + throw new TypeError('Invalid zcash URI'); } // workaround to host insensitiveness @@ -135,7 +135,7 @@ URI.prototype._fromObject = function(obj) { /* jshint maxcomplexity: 10 */ if (!Address.isValid(obj.address)) { - throw new TypeError('Invalid bitcoin address'); + throw new TypeError('Invalid zcash address'); } this.address = new Address(obj.address); @@ -205,7 +205,7 @@ URI.prototype.toString = function() { _.extend(query, this.extras); return URL.format({ - protocol: 'bitcoin:', + protocol: 'zcash:', host: this.address, query: query }); diff --git a/package.json b/package.json index 69b6f8f..998cae8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "bitcore-lib", + "name": "bitcore-lib-zcash", "version": "0.13.19", - "description": "A pure and powerful JavaScript Bitcoin library.", + "description": "A pure and powerful JavaScript Zcash library.", "author": "BitPay ", "main": "index.js", "scripts": { @@ -54,10 +54,14 @@ { "name": "Wei Lu", "email": "luwei.here@gmail.com" + }, + { + "name": "Jack Grigg", + "email": "jack@z.cash" } ], "keywords": [ - "bitcoin", + "zcash", "transaction", "address", "p2p", @@ -74,7 +78,7 @@ ], "repository": { "type": "git", - "url": "https://github.com/bitpay/bitcore-lib.git" + "url": "https://github.com/str4d/bitcore-lib-zcash.git" }, "browser": { "request": "browser-request" @@ -88,7 +92,7 @@ "lodash": "=3.10.1" }, "devDependencies": { - "bitcore-build": "bitpay/bitcore-build", + "bitcore-build-zcash": "str4d/bitcore-build-zcash", "brfs": "^1.2.0", "chai": "^1.10.0", "gulp": "^3.8.10", diff --git a/test/index.html b/test/index.html index 87c0cf3..0c088c8 100644 --- a/test/index.html +++ b/test/index.html @@ -4,11 +4,11 @@ Mocha - +
- +