Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Litecoinify a Bit More #14

Open
wants to merge 1 commit into
base: litecoin
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/cli
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var util = require('../lib/utils/util');
var co = require('../lib/utils/co');
var Client = require('../lib/http/client');
var Wallet = require('../lib/http/wallet');
var Amount = require('../lib/btc/amount');
var Amount = require('../lib/ltc/amount');
var main;

function CLI() {
Expand Down
6 changes: 3 additions & 3 deletions browser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@
<script src="/bcoin.js"></script>
</head>
<body>
<h1>Bcoin, the browser full node</h1>
<h1>Lcoin, the browser full node</h1>
<small>Welcome. Your machine is currently validating the blockchain.
The blocks and wallet are stored on your local disk with indexed DB. You are
connecting to the actual bitcoin P2P network via a websocket-&gt;tcp proxy.
Enjoy. (See the <a href="https://github.com/bcoin-org/bcoin" target="_blank">bcoin repo</a> for
Enjoy. (See the <a href="https://github.com/bcoin-org/lcoin" target="_blank">bcoin repo</a> for
more bitcoin magic).</small>
<div class="tx">
<div>Chain State: <span id="state"></span></div>
Expand All @@ -96,7 +96,7 @@ <h1>Bcoin, the browser full node</h1>
<div id="wallet" class="wallet"></div>
<form id="send" class="send" action="#">
<input type="text" name="address" id="address" placeholder="Address">
<input type="text" name="amount" id="amount" placeholder="Amount (BTC)">
<input type="text" name="amount" id="amount" placeholder="Amount (LTC)">
<input type="submit" value="Send">
</form>
<input type="button" id="newaddr" value="New Address">
Expand Down
2 changes: 1 addition & 1 deletion lib/blockchain/chaindb.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var assert = require('assert');
var util = require('../utils/util');
var BufferReader = require('../utils/reader');
var StaticWriter = require('../utils/staticwriter');
var Amount = require('../btc/amount');
var Amount = require('../ltc/amount');
var encoding = require('../utils/encoding');
var co = require('../utils/co');
var Network = require('../protocol/network');
Expand Down
6 changes: 3 additions & 3 deletions lib/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ function Environment() {
this.require('chainentry', './blockchain/chainentry');

// BTC
this.require('btc', './btc');
this.require('amount', './btc/amount');
this.require('uri', './btc/uri');
this.require('btc', './ltc');
this.require('amount', './ltc/amount');
this.require('uri', './ltc/uri');

// Coins
this.require('coins', './coins');
Expand Down
2 changes: 1 addition & 1 deletion lib/http/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
var Network = require('../protocol/network');
var AsyncObject = require('../utils/asyncobject');
var RPCClient = require('./rpcclient');
var Amount = require('../btc/amount');
var Amount = require('../ltc/amount');
var util = require('../utils/util');
var co = require('../utils/co');
var request = require('./request');
Expand Down
2 changes: 1 addition & 1 deletion lib/http/rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var crypto = require('../crypto/crypto');
var assert = require('assert');
var common = require('../blockchain/common');
var ec = require('../crypto/ec');
var Amount = require('../btc/amount');
var Amount = require('../ltc/amount');
var NetAddress = require('../primitives/netaddress');
var Script = require('../script/script');
var Address = require('../primitives/address');
Expand Down
2 changes: 1 addition & 1 deletion lib/http/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var HTTPBase = require('./base');
var util = require('../utils/util');
var co = require('../utils/co');
var base58 = require('../utils/base58');
var Amount = require('../btc/amount');
var Amount = require('../ltc/amount');
var Bloom = require('../utils/bloom');
var TX = require('../primitives/tx');
var Outpoint = require('../primitives/outpoint');
Expand Down
8 changes: 4 additions & 4 deletions lib/btc/amount.js → lib/ltc/amount.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* amount.js - amount object for bcoin
* amount.js - amount object for lcoin
* Copyright (c) 2014-2017, Christopher Jeffrey (MIT License).
* https://github.com/bcoin-org/bcoin
*/
Expand All @@ -10,8 +10,8 @@ var assert = require('assert');
var util = require('../utils/util');

/**
* Represents a bitcoin amount (satoshis internally).
* @alias module:btc.Amount
* Represents a litecoin amount (satoshis internally).
* @alias module:ltc.Amount
* @constructor
* @param {(String|Number)?} value
* @param {String?} unit
Expand Down Expand Up @@ -124,7 +124,7 @@ Amount.prototype.to = function to(unit, num) {
};

/**
* Convert amount to bitcoin string.
* Convert amount to litecoin string.
* @returns {String}
*/

Expand Down
2 changes: 1 addition & 1 deletion lib/btc/index.js → lib/ltc/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* @module btc
* @module ltc
*/

exports.Amount = require('./amount');
Expand Down
12 changes: 6 additions & 6 deletions lib/btc/uri.js → lib/ltc/uri.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* uri.js - bitcoin uri parsing for bcoin
* uri.js - litecoin uri parsing for lcoin
* Copyright (c) 2014-2017, Christopher Jeffrey (MIT License).
* https://github.com/bcoin-org/bcoin
*/
Expand All @@ -12,8 +12,8 @@ var Amount = require('./amount');
var assert = require('assert');

/**
* Represents a bitcoin URI.
* @alias module:btc.URI
* Represents a litecoin URI.
* @alias module:ltc.URI
* @constructor
* @param {Object|String} options
* @property {Address} address
Expand Down Expand Up @@ -96,11 +96,11 @@ URI.prototype.fromString = function fromString(str, network) {
var prefix, index, query, address;

assert(typeof str === 'string');
assert(str.length > 8, 'Not a bitcoin URI.');
assert(str.length > 8, 'Not a litecoin URI.');

prefix = str.substring(0, 8);

assert(prefix === 'litecoin:', 'Not a bitcoin URI.');
assert(prefix === 'litecoin:', 'Not a litecoin URI.');

str = str.substring(8);

Expand Down Expand Up @@ -179,7 +179,7 @@ URI.prototype.toString = function toString() {
};

/**
* Inspect bitcoin uri.
* Inspect litecoin uri.
* @returns {String}
*/

Expand Down
2 changes: 1 addition & 1 deletion lib/mining/miner.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var util = require('../utils/util');
var co = require('../utils/co');
var Heap = require('../utils/heap');
var AsyncObject = require('../utils/asyncobject');
var Amount = require('../btc/amount');
var Amount = require('../ltc/amount');
var Address = require('../primitives/address');
var BlockTemplate = require('./template');
var Network = require('../protocol/network');
Expand Down
2 changes: 1 addition & 1 deletion lib/primitives/coin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
var assert = require('assert');
var util = require('../utils/util');
var Network = require('../protocol/network');
var Amount = require('../btc/amount');
var Amount = require('../ltc/amount');
var Output = require('./output');
var Script = require('../script/script');
var Network = require('../protocol/network');
Expand Down
2 changes: 1 addition & 1 deletion lib/primitives/mtx.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var workerPool = require('../workers/workerpool').pool;
var encoding = require('../utils/encoding');
var consensus = require('../protocol/consensus');
var policy = require('../protocol/policy');
var Amount = require('../btc/amount');
var Amount = require('../ltc/amount');
var opcodes = Script.opcodes;

/**
Expand Down
6 changes: 3 additions & 3 deletions lib/primitives/output.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/*!
* output.js - output object for bcoin
* output.js - output object for lcoin
* Copyright (c) 2014-2015, Fedor Indutny (MIT License)
* Copyright (c) 2014-2017, Christopher Jeffrey (MIT License).
* https://github.com/bcoin-org/bcoin
* https://github.com/bcoin-org/lcoin
*/

'use strict';

var assert = require('assert');
var util = require('../utils/util');
var Amount = require('../btc/amount');
var Amount = require('../ltc/amount');
var Network = require('../protocol/network');
var Address = require('../primitives/address');
var Script = require('../script/script');
Expand Down
2 changes: 1 addition & 1 deletion lib/primitives/tx.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var encoding = require('../utils/encoding');
var co = require('../utils/co');
var crypto = require('../crypto/crypto');
var ec = require('../crypto/ec');
var Amount = require('../btc/amount');
var Amount = require('../ltc/amount');
var Network = require('../protocol/network');
var Script = require('../script/script');
var BufferReader = require('../utils/reader');
Expand Down
2 changes: 1 addition & 1 deletion lib/wallet/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var AsyncObject = require('../utils/asyncobject');
var TX = require('../primitives/tx');
var BlockMeta = require('./records').BlockMeta;
var Headers = require('../primitives/headers');
var Amount = require('../btc/amount');
var Amount = require('../ltc/amount');
var util = require('../utils/util');
var BufferReader = require('../utils/reader');
var co = require('../utils/co');
Expand Down
2 changes: 1 addition & 1 deletion lib/wallet/rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var fs = require('../utils/fs');
var util = require('../utils/util');
var co = require('../utils/co');
var crypto = require('../crypto/crypto');
var Amount = require('../btc/amount');
var Amount = require('../ltc/amount');
var Script = require('../script/script');
var Address = require('../primitives/address');
var KeyRing = require('../primitives/keyring');
Expand Down
2 changes: 1 addition & 1 deletion lib/wallet/txdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var co = require('../utils/co');
var assert = require('assert');
var BufferReader = require('../utils/reader');
var StaticWriter = require('../utils/staticwriter');
var Amount = require('../btc/amount');
var Amount = require('../ltc/amount');
var CoinView = require('../coins/coinview');
var Coin = require('../primitives/coin');
var Outpoint = require('../primitives/outpoint');
Expand Down
Loading