Skip to content

Commit

Permalink
Inject self into own network obj, bump version 0.3.17
Browse files Browse the repository at this point in the history
  • Loading branch information
flowencygit committed Feb 27, 2019
1 parent ff4d394 commit 810a07b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions index.js
Expand Up @@ -21,4 +21,10 @@ bchLib.URI = require('./lib/uri');
// Internal usage, exposed for testing/advanced tweaking
bchLib.Transaction.sighash = require('./lib/transaction/sighash');

// Inject this library into each of its networks as network.lib.
var bchNetworks = require('@owstack/network-lib').getFiltered({currency: bchLib.Networks.currency});
for (var i = 0; i < bchNetworks.length; i++) {
bchNetworks[i].lib = bchLib;
}

module.exports = bchLib;
5 changes: 5 additions & 0 deletions lib/networks.js
@@ -1,5 +1,6 @@
'use strict';

var bchLib = require('../');
var Networks = require('@owstack/network-lib');
var Bip44 = Networks.Bip44;

Expand All @@ -11,6 +12,7 @@ var regtestEnabled = false;
*/

var networks = [{
lib: bchLib,
currency: currency,
description: 'Bitcoin Cash',
name: 'bch',
Expand Down Expand Up @@ -42,6 +44,7 @@ var networks = [{
'seed.deadalnix.me'
]
}, {
lib: bchLib,
currency: currency,
description: 'BCH Testnet',
name: 'bchtest',
Expand Down Expand Up @@ -72,6 +75,7 @@ var networks = [{
'testnet-seed.bitcoin.schildbach.de'
]
}, {
lib: bchLib,
currency: currency,
description: 'BCH Regtest',
name: 'bchreg',
Expand Down Expand Up @@ -203,6 +207,7 @@ module.exports = {
get: BchNetworks.get,
getProtocols: BchNetworks.getProtocols,
getProtocol: BchNetworks.getLivenetProtocol,
currency: currency,
enableRegtest: BchNetworks.enableRegtest,
disableRegtest: BchNetworks.disableRegtest,
defaultNetwork: BchNetworks.get('bch'),
Expand Down
7 changes: 4 additions & 3 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "@owstack/bch-lib",
"version": "0.3.16",
"version": "0.3.17",
"description": "A Javascript library to build bitcoin cash and blockchain-based applications.",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -33,9 +33,10 @@
"request": "browser-request"
},
"dependencies": {
"@owstack/key-lib": "^0.0.37",
"@owstack/network-lib": "^0.0.26",
"@owstack/ows-common": "^0.0.16",
"@owstack/key-lib": "^0.0.36",
"@owstack/network-lib": "^0.0.25",
"acorn": "^6.1.1",
"buffer-compare": "=1.0.0",
"inherits": "=2.0.1"
},
Expand Down

0 comments on commit 810a07b

Please sign in to comment.