Compare commits

..

33 Commits

Author SHA1 Message Date
Ian Coleman
927450e169 Release v0.4.1 2020-02-06 20:14:00 +11:00
Ian Coleman
a67554c649 Add tests for RSK network and testnet 2020-02-06 20:11:09 +11:00
Ian Coleman
0bc6361db4 Fix ethercore test 2020-02-06 20:10:52 +11:00
iancoleman
a98d40c43d Merge pull request #397 from aitorp6/master
Added DeepOnion Segwit parameters
2020-02-06 15:00:02 +11:00
iancoleman
54a8e781b4 Merge pull request #396 from ilanolkies/patch-2
Add network
2020-02-06 14:59:34 +11:00
iancoleman
c1d6274224 Merge pull request #393 from ethercore/master
Add EtherCore
2020-02-06 14:58:06 +11:00
aitorp6
c16661aeea Added DeepOnion Segwit parameters 2020-02-04 10:47:11 +01:00
Ilan
e9491c7efd Add network
Based on https://github.com/rsksmart/RSKIPs/blob/master/IPs/RSKIP57.md
2020-01-22 12:16:51 -03:00
Ian Coleman
d07983bc1f Catch nebulas error on some chrome configs
See #395
2020-01-08 17:31:14 +11:00
Ian Coleman
3aa7677ace Directly export libraries where they're required 2020-01-08 17:30:16 +11:00
EtherCore Contributor
9e04576e2f add testcase for ethercore 2020-01-02 00:53:17 +09:00
EtherCore Contributor
8131a07115 Add EtherCore 2020-01-02 00:45:48 +09:00
iancoleman
181b5d61e3 Merge pull request #390 from matthewleon/bugfix/eth-xpub-derivation
Bugfix/eth xpub derivation
2019-12-20 15:58:26 +11:00
Matthew Leon
4dfc681f71 fix Ethereum xpub derivation 2019-12-19 15:37:08 -05:00
Matthew Leon
dfb4fd1be5 add failing test for ETH xpub derivation
see https://github.com/iancoleman/bip39/issues/169
2019-12-19 15:35:31 -05:00
Ian Coleman
aa793f572f Release v0.4.0 2019-12-19 14:48:25 +11:00
Ian Coleman
6973e692b0 Minify third party libraries 2019-12-19 14:32:13 +11:00
Ian Coleman
22f8766947 Replace most libraries with combined libs 2019-12-19 14:21:33 +11:00
Ian Coleman
8017442c50 Add experimental incomplete combined js libs 2019-12-19 14:21:25 +11:00
Ian Coleman
82cf26c1cb Text for multibit mentions change addresses
Closes #376
2019-12-18 11:19:47 +11:00
Ian Coleman
206cbafceb Remove pending from some tests using chrome
Unfortunately firefox pending tests still do not work.
2019-12-18 10:57:29 +11:00
Ian Coleman
9cf02dd452 Make seed field editable 2019-12-18 10:32:25 +11:00
Ian Coleman
f12242014d Add bitcoin regtest params 2019-12-18 09:51:00 +11:00
Ian Coleman
244c76022a Convert mnemonic to hex entropy instead of binary 2019-12-18 09:07:17 +11:00
Ian Coleman
516c16d721 Allow manual override for entropy type 2019-12-17 14:10:45 +11:00
Ian Coleman
f7e9fdf002 Generate addresses for P2WSH and P2WSH-P2SH 2019-12-17 11:46:07 +11:00
Ian Coleman
5c203fab6a Add P2WSH and P2WSH-P2SH for bitcoin and testnet
Address generation still to come.
2019-12-16 13:27:15 +11:00
iancoleman
40d542ba58 Merge pull request #385 from hladik-dan/master
Add Czech language
2019-12-09 09:16:01 +11:00
Daniel Hladík
cc3c35487f Add Czech language 2019-12-06 20:21:43 +01:00
Ian Coleman
76531b610a Release v0.3.14 2019-12-02 10:46:49 +11:00
Ian Coleman
c845ee6f6e Fix energyweb test 2019-12-02 10:44:35 +11:00
Ian Coleman
c394ec3c4f Revert "Fix tests for Pull Request 371"
This reverts commit b130271b2b.
2019-12-02 10:25:09 +11:00
Ian Coleman
55367b989e Partially revert Pull 371 BIP44 Default Change 2019-12-02 10:24:37 +11:00
33 changed files with 3460 additions and 196756 deletions

View File

@@ -1,3 +1,26 @@
# 0.4.1
* Fix no loading on chrome with third-party cookies blocked
* Add EtherCore
* Add RSK network
* Add DeepOnion segwit parameters
* Fix ethereum xpub derivation
# 0.4.0
* Third party libraries deduplicated and minified
* Add text reminder for multibit wallet change addresses
* Seed field can be edited
* Add bitcoin regtest parameters
* Mnemonic conversion to entropy is hex encoded instead of binary
* Entropy type can be manually selected
* Add Bitcoin P2WSH and P2WSH-P2SH
* Add Czech language
# 0.3.14
* Ethereum uses standard BIP44 as per majority of wallets (Issue 378)
# 0.3.13
* Add Thought network

89
libs/combined/index.js Normal file
View File

@@ -0,0 +1,89 @@
/* base-x */
module.exports.basex = require('base-x')
/* bchaddrjs */
module.exports.bchaddr = require('bchaddrjs')
/* bchaddrjs slp */
module.exports.bchaddrSlp = require('bchaddrjs-slp')
/* biginteger */
module.exports.BigInteger = require('javascript-biginteger')
/* bitcoinjs-bip38 */
module.exports.bip38 = require('bip38')
/* bitcoinjs-lib */
module.exports.bitcoin = require('bitcoinjs-lib')
/* buffer */
module.exports.buffer = require('buffer');
/* elastos */
// See https://github.com/iancoleman/bip39/pull/368
// and https://github.com/johnnynanjiang/Elastos.SDK.Keypair.Javascript/tree/iancoleman-bip39
module.exports.elastosjs = require('elastos-wallet-js')
/* ethereum-util */
module.exports.ethUtil = require('ethereumjs-util')
/* fast-levenshtein */
module.exports.levenshtein = require('fast-levenshtein')
/* groestlcoin */
module.exports.groestlcoinjs = require('groestlcoinjs-lib')
/* groestlcoin bip38 */
module.exports.groestlcoinjsBip38 = require('bip38grs')
/* kjua qr codes */
module.exports.kjua = require('kjua')
/* nebulas */
try {
module.exports.nebulas = require('nebulas')
}
catch (e) {
console.warn("Error loading nebulas library");
console.warn(e);
};
/* stellar-util */
let StellarBase = require('stellar-base');
let edHd = require('ed25519-hd-key');
module.exports.stellarUtil = {
getKeypair: function (path, seed) {
const result = edHd.derivePath(path, seed);
return StellarBase.Keypair.fromRawEd25519Seed(result.key);
},
dummyNetwork: {
bip32: {public: 0, private: 0},
messagePrefix: '',
pubKeyHash: 0,
scriptHash: 0,
wif: 0,
},
}
/* unorm */
module.exports.unorm = require('unorm')
/* zxcvbn */
module.exports.zxcvbn = require('zxcvbn')

17
libs/combined/npm-shrinkwrap.json generated Normal file
View File

@@ -0,0 +1,17 @@
{
"dependencies": {
"elastos-wallet-js": {
"version": "git://github.com/johnnynanjiang/Elastos.SDK.Keypair.Javascript.git#491dc51b64efaf0a8aae62028b68e2c8e38fde06",
"dependencies": {
"bitcore-lib-p256": {
"version": "0.16.0",
"dependencies": {
"lodash": {
"version": "4.17.12"
}
}
}
}
}
}
}

2241
libs/combined/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,31 @@
{
"name": "bip39-tool-external-libs",
"version": "0.4.0",
"scripts": {
"build": "browserify index.js --standalone libs | uglifyjs -c > ../../src/js/bip39-libs.js"
},
"dependencies": {
"base-x": "3.0.7",
"bchaddrjs": "0.4.4",
"bchaddrjs-slp": "git://github.com/simpleledger/bchaddrjs.git#af16e44a6bfbe4b3980a62dba50e2f68ed864c6b",
"bip38": "2.0.2",
"bip38grs": "git://github.com/Groestlcoin/bip38grs.git#091975b01679b74dc0a4136bb743fe17791b0151",
"bitcoinjs-lib": "git://github.com/iancoleman/bitcoinjs-lib.git#v3.3.2_16bit",
"buffer": "5.4.3",
"ed25519-hd-key": "^1.0.0",
"elastos-wallet-js": "git://github.com/johnnynanjiang/Elastos.SDK.Keypair.Javascript.git#491dc51b64efaf0a8aae62028b68e2c8e38fde06",
"ethereumjs-util": "6.0.0",
"fast-levenshtein": "2.0.6",
"groestlcoinjs-lib": "git://github.com/Groestlcoin/groestlcoinjs-lib.git#3.3.2",
"javascript-biginteger": "0.9.2",
"kjua": "0.6.0",
"nebulas": "0.5.6",
"stellar-base": "^0.10.0",
"unorm": "1.6.0",
"zxcvbn": "4.4.2"
},
"devDependencies": {
"browserify": "^16.2.3",
"uglify-es": "^3.3.9"
}
}

6
libs/combined/readme.md Normal file
View File

@@ -0,0 +1,6 @@
# Generate libs
```
npm install
npm run build
```

View File

@@ -106,3 +106,6 @@ body {
.visual-privacy .private-data {
display: none;
}
.text-weight-normal {
font-weight: normal !important;
}

View File

@@ -15,7 +15,7 @@
<div class="container">
<h1 class="text-center">Mnemonic Code Converter</h1>
<p class="version">v0.3.13</p>
<p class="version">v0.4.1</p>
<hr>
<div class="row">
<div class="col-md-12">
@@ -123,12 +123,42 @@
<div class="col-sm-3">
<p>Valid entropy values include:</p>
<ul>
<li><strong>Binary</strong> [0-1]<br>101010011</li>
<li><strong>Base 6</strong> [0-5]<br>123434014</li>
<li><strong>Dice</strong> [1-6]<br>62535634</li>
<li><strong>Base 10</strong> [0-9]<br>90834528</li>
<li><strong>Hex</strong> [0-9A-F]<br>4187a8bfd9</li>
<li><strong>Card</strong> [A2-9TJQK][CDHS]<br>ahqs9dtc</li>
<li>
<label>
<input type="radio" name="entropy-type" value="binary">
<strong>Binary</strong> [0-1]<br>101010011
</label>
</li>
<li>
<label>
<input type="radio" name="entropy-type" value="base 6">
<strong>Base 6</strong> [0-5]<br>123434014
</label>
</li>
<li>
<label>
<input type="radio" name="entropy-type" value="dice">
<strong>Dice</strong> [1-6]<br>62535634
</label>
</li>
<li>
<label>
<input type="radio" name="entropy-type" value="base 10">
<strong>Base 10</strong> [0-9]<br>90834528
</label>
</li>
<li>
<label>
<input type="radio" name="entropy-type" value="hexadecimal" checked>
<strong>Hex</strong> [0-9A-F]<br>4187a8bfd9
</label>
</li>
<li>
<label>
<input type="radio" name="entropy-type" value="card">
<strong>Card</strong> [A2-9TJQK][CDHS]<br>ahqs9dtc
</label>
</li>
</ul>
</div>
</div>
@@ -163,6 +193,7 @@
<a href="#french" title="French">Français</a>
<a href="#italian" title="Italian">Italiano</a>
<a href="#korean" title="Korean">한국어</a>
<a href="#czech" title="Czech">Čeština</a>
</div>
</div>
</div>
@@ -190,7 +221,7 @@
<div class="form-group">
<label for="seed" class="col-sm-2 control-label">BIP39 Seed</label>
<div class="col-sm-10">
<textarea id="seed" class="seed private-data form-control" readonly="readonly" data-show-qr autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
<textarea id="seed" class="seed private-data form-control" data-show-qr autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
</div>
</div>
<div class="form-group">
@@ -282,10 +313,7 @@
<a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change" target="_blank">External / Internal</a>
</label>
<div class="col-sm-10">
<div class="input-group">
<input id="change-bip44" type="text" class="change form-control" value="0">
<a class="default-bip44-change-value btn btn-primary input-group-addon" role="button">Default</a>
</div>
<input id="change-bip44" type="text" class="change form-control" value="0">
</div>
</div>
<div class="form-group">
@@ -368,6 +396,7 @@
<div class="col-sm-10">
<p class="form-control no-border">
<span>Use path <code>m/0'/0</code>.</span>
<span>For change addresses use path <code>m/0'/1</code>.</span>
</p>
<p class="form-control no-border">
<span>For more info see</span>
@@ -511,6 +540,8 @@
<select class="form-control bip141-semantics">
<option value="p2wpkh">P2WPKH</option>
<option value="p2wpkh-p2sh" selected>P2WPKH nested in P2SH</option>
<option value="p2wsh">P2WSH (1-of-1 multisig)</option>
<option value="p2wsh-p2sh">P2WSH nested in P2SH (1-of-1 multisig)</option>
</select>
</div>
</div>
@@ -926,25 +957,13 @@
<td class="privkey private-data"><span data-show-qr></span></td>
</tr>
</script>
<script src="js/polyfill.es6.js"></script>
<script src="js/basex.js"></script>
<script src="js/unorm.js"></script>
<script src="js/jquery-3.2.1.js"></script>
<script src="js/bootstrap-3.3.7.js"></script>
<script src="js/levenshtein.js"></script>
<script src="js/kjua-0.1.1.min.js"></script>
<script src="js/bitcoinjs-3.3.2.js"></script>
<script src="js/bip39-libs.js"></script>
<script src="js/bitcoinjs-extensions.js"></script>
<script src="js/bitcoinjs-bip38-2.0.2.js"></script>
<script src="js/groestlcoinjs-3.3.2.js"></script>
<script src="js/groestlcoinjs-bip38-2.0.2.js"></script>
<script src="js/elastos-1.0.9.min.js"></script>
<script src="js/segwit-parameters.js"></script>
<script src="js/ethereumjs-util.js"></script>
<script src="js/ripple-util.js"></script>
<script src="js/casinocoin-util.js"></script>
<script src="js/bchaddrjs-0.2.1.js"></script>
<script src="js/nebulas-account.js"></script>
<script src="js/eos-util.js"></script>
<script src="js/sjcl-bip39.js"></script>
<script src="js/wordlist_english.js"></script>
@@ -955,11 +974,9 @@
<script src="js/wordlist_french.js"></script>
<script src="js/wordlist_italian.js"></script>
<script src="js/wordlist_korean.js"></script>
<script src="js/wordlist_czech.js"></script>
<script src="js/jsbip39.js"></script>
<script src="js/biginteger.js"></script>
<script src="js/zxcvbn.js"></script>
<script src="js/entropy.js"></script>
<script src="js/stellar-util.js"></script>
<script src="js/index.js"></script>
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1
src/js/bip39-libs.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,9 @@
function convertCasinoCoinAdrr(address) {
return window.basex('cpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2brdeCg65jkm8oFqi1tuvAxyz').encode(
window.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(address)
return libs.basex('cpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2brdeCg65jkm8oFqi1tuvAxyz').encode(
libs.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(address)
)
}
function convertCasinoCoinPriv(priv) {
return window.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(priv).toString("hex").slice(2,66)
return libs.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(priv).toString("hex").slice(2,66)
}

File diff suppressed because one or more lines are too long

View File

@@ -16,7 +16,7 @@
window.Entropy = new (function() {
var TWO = new BigInteger(2);
var TWO = new libs.BigInteger.BigInteger(2);
// matchers returns an array of the matched events for each type of entropy.
// eg
@@ -67,9 +67,9 @@ window.Entropy = new (function() {
return ints;
}
this.fromString = function(rawEntropyStr) {
this.fromString = function(rawEntropyStr, baseStr) {
// Find type of entropy being used (binary, hex, dice etc)
var base = getBase(rawEntropyStr);
var base = getBase(rawEntropyStr, baseStr);
// Convert dice to base6 entropy (ie 1-6 to 0-5)
// This is done by changing all 6s to 0s
if (base.str == "dice") {
@@ -103,11 +103,11 @@ window.Entropy = new (function() {
// Convert base.ints to BigInteger.
// Due to using unusual bases, eg cards of base52, this is not as simple as
// using BigInteger.parse()
var entropyInt = BigInteger.ZERO;
var entropyInt = libs.BigInteger.BigInteger.ZERO;
for (var i=base.ints.length-1; i>=0; i--) {
var thisInt = BigInteger.parse(base.ints[i]);
var thisInt = libs.BigInteger.BigInteger.parse(base.ints[i]);
var power = (base.ints.length - 1) - i;
var additionalEntropy = BigInteger.parse(base.asInt).pow(power).multiply(thisInt);
var additionalEntropy = libs.BigInteger.BigInteger.parse(base.asInt).pow(power).multiply(thisInt);
entropyInt = entropyInt.add(additionalEntropy);
}
// Convert entropy to binary
@@ -166,13 +166,14 @@ window.Entropy = new (function() {
return s;
}
function getBase(str) {
function getBase(str, baseStr) {
// Need to get the lowest base for the supplied entropy.
// This prevents interpreting, say, dice rolls as hexadecimal.
var binaryMatches = matchers.binary(str);
var hexMatches = matchers.hex(str);
var autodetect = baseStr === undefined;
// Find the lowest base that can be used, whilst ignoring any irrelevant chars
if (binaryMatches.length == hexMatches.length && hexMatches.length > 0) {
if ((binaryMatches.length == hexMatches.length && hexMatches.length > 0 && autodetect) || baseStr === "binary") {
var ints = binaryMatches.map(function(i) { return parseInt(i, 2) });
return {
ints: ints,
@@ -183,7 +184,7 @@ window.Entropy = new (function() {
}
}
var cardMatches = matchers.card(str);
if (cardMatches.length >= hexMatches.length / 2) {
if ((cardMatches.length >= hexMatches.length / 2 && autodetect) || baseStr === "card") {
var ints = convertCardsToInts(cardMatches);
return {
ints: ints,
@@ -194,7 +195,7 @@ window.Entropy = new (function() {
}
}
var diceMatches = matchers.dice(str);
if (diceMatches.length == hexMatches.length && hexMatches.length > 0) {
if ((diceMatches.length == hexMatches.length && hexMatches.length > 0 && autodetect) || baseStr === "dice") {
var ints = diceMatches.map(function(i) { return parseInt(i) });
return {
ints: ints,
@@ -205,7 +206,7 @@ window.Entropy = new (function() {
}
}
var base6Matches = matchers.base6(str);
if (base6Matches.length == hexMatches.length && hexMatches.length > 0) {
if ((base6Matches.length == hexMatches.length && hexMatches.length > 0 && autodetect) || baseStr === "base 6") {
var ints = base6Matches.map(function(i) { return parseInt(i) });
return {
ints: ints,
@@ -216,7 +217,7 @@ window.Entropy = new (function() {
}
}
var base10Matches = matchers.base10(str);
if (base10Matches.length == hexMatches.length && hexMatches.length > 0) {
if ((base10Matches.length == hexMatches.length && hexMatches.length > 0 && autodetect) || baseStr === "base 10") {
var ints = base10Matches.map(function(i) { return parseInt(i) });
return {
ints: ints,
@@ -327,7 +328,7 @@ window.Entropy = new (function() {
// Math.LOG2E
// log2(8) gave 2.9999999999999996 which when floored causes issues.
// So instead use the BigInteger library to get it right.
return BigInteger.log(x) / BigInteger.log(2);
return libs.BigInteger.BigInteger.log(x) / libs.BigInteger.BigInteger.log(2);
};
// Depends on BigInteger
@@ -335,9 +336,9 @@ window.Entropy = new (function() {
if (n == 0) {
return 1;
}
f = BigInteger.ONE;
f = libs.BigInteger.BigInteger.ONE;
for (var i=1; i<=n; i++) {
f = f.multiply(new BigInteger(i));
f = f.multiply(new libs.BigInteger.BigInteger(i));
}
return f;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,138 +0,0 @@
// source
// https://github.com/hiddentao/fast-levenshtein/blob/2.0.6/levenshtein.js
(function() {
'use strict';
var collator;
try {
collator = (typeof Intl !== "undefined" && typeof Intl.Collator !== "undefined") ? Intl.Collator("generic", { sensitivity: "base" }) : null;
} catch (err){
console.log("Collator could not be initialized and wouldn't be used");
}
// arrays to re-use
var prevRow = [],
str2Char = [];
/**
* Based on the algorithm at http://en.wikipedia.org/wiki/Levenshtein_distance.
*/
var Levenshtein = {
/**
* Calculate levenshtein distance of the two strings.
*
* @param str1 String the first string.
* @param str2 String the second string.
* @param [options] Additional options.
* @param [options.useCollator] Use `Intl.Collator` for locale-sensitive string comparison.
* @return Integer the levenshtein distance (0 and above).
*/
get: function(str1, str2, options) {
var useCollator = (options && collator && options.useCollator);
var str1Len = str1.length,
str2Len = str2.length;
// base cases
if (str1Len === 0) return str2Len;
if (str2Len === 0) return str1Len;
// two rows
var curCol, nextCol, i, j, tmp;
// initialise previous row
for (i=0; i<str2Len; ++i) {
prevRow[i] = i;
str2Char[i] = str2.charCodeAt(i);
}
prevRow[str2Len] = str2Len;
var strCmp;
if (useCollator) {
// calculate current row distance from previous row using collator
for (i = 0; i < str1Len; ++i) {
nextCol = i + 1;
for (j = 0; j < str2Len; ++j) {
curCol = nextCol;
// substution
strCmp = 0 === collator.compare(str1.charAt(i), String.fromCharCode(str2Char[j]));
nextCol = prevRow[j] + (strCmp ? 0 : 1);
// insertion
tmp = curCol + 1;
if (nextCol > tmp) {
nextCol = tmp;
}
// deletion
tmp = prevRow[j + 1] + 1;
if (nextCol > tmp) {
nextCol = tmp;
}
// copy current col value into previous (in preparation for next iteration)
prevRow[j] = curCol;
}
// copy last col value into previous (in preparation for next iteration)
prevRow[j] = nextCol;
}
}
else {
// calculate current row distance from previous row without collator
for (i = 0; i < str1Len; ++i) {
nextCol = i + 1;
for (j = 0; j < str2Len; ++j) {
curCol = nextCol;
// substution
strCmp = str1.charCodeAt(i) === str2Char[j];
nextCol = prevRow[j] + (strCmp ? 0 : 1);
// insertion
tmp = curCol + 1;
if (nextCol > tmp) {
nextCol = tmp;
}
// deletion
tmp = prevRow[j + 1] + 1;
if (nextCol > tmp) {
nextCol = tmp;
}
// copy current col value into previous (in preparation for next iteration)
prevRow[j] = curCol;
}
// copy last col value into previous (in preparation for next iteration)
prevRow[j] = nextCol;
}
}
return nextCol;
}
};
// amd
if (typeof define !== "undefined" && define !== null && define.amd) {
define(function() {
return Levenshtein;
});
}
// commonjs
else if (typeof module !== "undefined" && module !== null && typeof exports !== "undefined" && module.exports === exports) {
module.exports = Levenshtein;
}
// web worker
else if (typeof self !== "undefined" && typeof self.postMessage === 'function' && typeof self.importScripts === 'function') {
self.Levenshtein = Levenshtein;
}
// browser main thread
else if (typeof window !== "undefined" && window !== null) {
window.Levenshtein = Levenshtein;
}
}());

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,10 @@
function convertRippleAdrr(address) {
return window.basex('rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz').encode(
window.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(address)
return libs.basex('rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz').encode(
libs.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(address)
)
}
function convertRipplePriv(priv) {
return window.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(priv).toString("hex").slice(2,66)
return libs.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(priv).toString("hex").slice(2,66)
}

View File

@@ -2,7 +2,7 @@
// p2wpkh
bitcoinjs.bitcoin.networks.bitcoin.p2wpkh = {
libs.bitcoin.networks.bitcoin.p2wpkh = {
baseNetwork: "bitcoin",
messagePrefix: '\x18Bitcoin Signed Message:\n',
bech32: 'bc',
@@ -15,7 +15,7 @@ bitcoinjs.bitcoin.networks.bitcoin.p2wpkh = {
wif: 0x80
};
bitcoinjs.bitcoin.networks.testnet.p2wpkh = {
libs.bitcoin.networks.testnet.p2wpkh = {
baseNetwork: "testnet",
messagePrefix: '\x18Bitcoin Signed Message:\n',
bech32: 'tb',
@@ -28,9 +28,22 @@ bitcoinjs.bitcoin.networks.testnet.p2wpkh = {
wif: 0xef
};
libs.bitcoin.networks.regtest.p2wpkh = {
baseNetwork: "regtest",
messagePrefix: '\x18Bitcoin Signed Message:\n',
bech32: 'bcrt',
bip32: {
public: 0x045f1cf6,
private: 0x045f18bc
},
pubKeyHash: 0x6f,
scriptHash: 0xc4,
wif: 0xef
};
// p2wpkh in p2sh
bitcoinjs.bitcoin.networks.bitcoin.p2wpkhInP2sh = {
libs.bitcoin.networks.bitcoin.p2wpkhInP2sh = {
baseNetwork: "bitcoin",
messagePrefix: '\x18Bitcoin Signed Message:\n',
bech32: 'bc',
@@ -43,7 +56,7 @@ bitcoinjs.bitcoin.networks.bitcoin.p2wpkhInP2sh = {
wif: 0x80
};
bitcoinjs.bitcoin.networks.testnet.p2wpkhInP2sh = {
libs.bitcoin.networks.testnet.p2wpkhInP2sh = {
baseNetwork: "testnet",
messagePrefix: '\x18Bitcoin Signed Message:\n',
bech32: 'tb',
@@ -56,7 +69,102 @@ bitcoinjs.bitcoin.networks.testnet.p2wpkhInP2sh = {
wif: 0xef
};
bitcoinjs.bitcoin.networks.litecoin.p2wpkh = {
libs.bitcoin.networks.regtest.p2wpkhInP2sh = {
baseNetwork: "regtest",
messagePrefix: '\x18Bitcoin Signed Message:\n',
bech32: 'bcrt',
bip32: {
public: 0x044a5262,
private: 0x044a4e28
},
pubKeyHash: 0x6f,
scriptHash: 0xc4,
wif: 0xef
};
// p2wsh
libs.bitcoin.networks.bitcoin.p2wsh = {
baseNetwork: "bitcoin",
messagePrefix: '\x18Bitcoin Signed Message:\n',
bech32: 'bc',
bip32: {
public: 0x02aa7ed3,
private: 0x02aa7a99
},
pubKeyHash: 0x00,
scriptHash: 0x05,
wif: 0x80
};
libs.bitcoin.networks.testnet.p2wsh = {
baseNetwork: "testnet",
messagePrefix: '\x18Bitcoin Signed Message:\n',
bech32: 'tb',
bip32: {
public: 0x02575483,
private: 0x02575048
},
pubKeyHash: 0x6f,
scriptHash: 0xc4,
wif: 0xef
};
libs.bitcoin.networks.regtest.p2wsh = {
baseNetwork: "regtest",
messagePrefix: '\x18Bitcoin Signed Message:\n',
bech32: 'bcrt',
bip32: {
public: 0x02575483,
private: 0x02575048
},
pubKeyHash: 0x6f,
scriptHash: 0xc4,
wif: 0xef
};
// p2wsh in p2sh
libs.bitcoin.networks.bitcoin.p2wshInP2sh = {
baseNetwork: "bitcoin",
messagePrefix: '\x18Bitcoin Signed Message:\n',
bech32: 'bc',
bip32: {
public: 0x0295b43f,
private: 0x0295b005
},
pubKeyHash: 0x00,
scriptHash: 0x05,
wif: 0x80
};
libs.bitcoin.networks.testnet.p2wshInP2sh = {
baseNetwork: "testnet",
messagePrefix: '\x18Bitcoin Signed Message:\n',
bech32: 'tb',
bip32: {
public: 0x024289ef,
private: 0x024285b5
},
pubKeyHash: 0x6f,
scriptHash: 0xc4,
wif: 0xef
};
libs.bitcoin.networks.regtest.p2wshInP2sh = {
baseNetwork: "regtest",
messagePrefix: '\x18Bitcoin Signed Message:\n',
bech32: 'bcrt',
bip32: {
public: 0x024289ef,
private: 0x024285b5
},
pubKeyHash: 0x6f,
scriptHash: 0xc4,
wif: 0xef
};
libs.bitcoin.networks.litecoin.p2wpkh = {
baseNetwork: "litecoin",
messagePrefix: '\x19Litecoin Signed Message:\n',
bech32: 'ltc',
@@ -69,7 +177,7 @@ bitcoinjs.bitcoin.networks.litecoin.p2wpkh = {
wif: 0xb0
};
bitcoinjs.bitcoin.networks.litecoin.p2wpkhInP2sh = {
libs.bitcoin.networks.litecoin.p2wpkhInP2sh = {
baseNetwork: "litecoin",
messagePrefix: '\x19Litecoin Signed Message:\n',
bech32: 'ltc',
@@ -82,7 +190,7 @@ bitcoinjs.bitcoin.networks.litecoin.p2wpkhInP2sh = {
wif: 0xb0
};
bitcoinjs.bitcoin.networks.fujicoin.p2wpkh = {
libs.bitcoin.networks.fujicoin.p2wpkh = {
baseNetwork: "fujicoin",
messagePrefix: '\x19FujiCoin Signed Message:\n',
bech32: 'fc',
@@ -95,7 +203,7 @@ bitcoinjs.bitcoin.networks.fujicoin.p2wpkh = {
wif: 0xa4
};
bitcoinjs.bitcoin.networks.fujicoin.p2wpkhInP2sh = {
libs.bitcoin.networks.fujicoin.p2wpkhInP2sh = {
baseNetwork: "fujicoin",
messagePrefix: '\x19FujiCoin Signed Message:\n',
bech32: 'fc',
@@ -108,7 +216,7 @@ bitcoinjs.bitcoin.networks.fujicoin.p2wpkhInP2sh = {
wif: 0xa4
};
bitcoinjs.bitcoin.networks.vertcoin.p2wpkh = {
libs.bitcoin.networks.vertcoin.p2wpkh = {
baseNetwork: "vertcoin",
messagePrefix: '\x18Vertcoin Signed Message:\n',
bech32: 'vtc',
@@ -121,7 +229,7 @@ bitcoinjs.bitcoin.networks.vertcoin.p2wpkh = {
wif: 0x80
};
bitcoinjs.bitcoin.networks.vertcoin.p2wpkhInP2sh = {
libs.bitcoin.networks.vertcoin.p2wpkhInP2sh = {
baseNetwork: "vertcoin",
messagePrefix: '\x18Vertcoin Signed Message:\n',
bip32: {
@@ -133,7 +241,7 @@ bitcoinjs.bitcoin.networks.vertcoin.p2wpkhInP2sh = {
wif: 0x80
};
bitcoinjs.bitcoin.networks.bgold.p2wpkh = {
libs.bitcoin.networks.bgold.p2wpkh = {
baseNetwork: "bgold",
messagePrefix: '\x1DBitcoin Gold Signed Message:\n',
bech32: 'btg',
@@ -146,7 +254,7 @@ bitcoinjs.bitcoin.networks.bgold.p2wpkh = {
wif: 0x80,
};
bitcoinjs.bitcoin.networks.bgold.p2wpkhInP2sh = {
libs.bitcoin.networks.bgold.p2wpkhInP2sh = {
baseNetwork: "bgold",
messagePrefix: '\x1DBitcoin Gold Signed Message:\n',
bech32: 'btg',
@@ -159,7 +267,7 @@ bitcoinjs.bitcoin.networks.bgold.p2wpkhInP2sh = {
wif: 0x80,
};
bitcoinjs.bitcoin.networks.digibyte.p2wpkh = {
libs.bitcoin.networks.digibyte.p2wpkh = {
baseNetwork: "digibyte",
messagePrefix: 'x19DigiByte Signed Message:\n',
bech32: 'dgb',
@@ -172,7 +280,7 @@ bitcoinjs.bitcoin.networks.digibyte.p2wpkh = {
wif: 0x80
};
bitcoinjs.bitcoin.networks.digibyte.p2wpkhInP2sh = {
libs.bitcoin.networks.digibyte.p2wpkhInP2sh = {
baseNetwork: "digibyte",
messagePrefix: '\x19DigiByte Signed Message:\n',
bech32: 'dgb',
@@ -185,7 +293,7 @@ bitcoinjs.bitcoin.networks.digibyte.p2wpkhInP2sh = {
wif: 0x80
};
bitcoinjs.bitcoin.networks.blockstamp.p2wpkh = {
libs.bitcoin.networks.blockstamp.p2wpkh = {
baseNetwork: "blockstamp",
messagePrefix: '\x18BlockStamp Signed Message:\n',
bech32: 'bc',
@@ -198,7 +306,7 @@ bitcoinjs.bitcoin.networks.blockstamp.p2wpkh = {
wif: 0x80,
};
bitcoinjs.bitcoin.networks.blockstamp.p2wpkhInP2sh = {
libs.bitcoin.networks.blockstamp.p2wpkhInP2sh = {
baseNetwork: "blockstamp",
messagePrefix: '\x18BlockStamp Signed Message:\n',
bech32: 'bc',
@@ -211,7 +319,7 @@ bitcoinjs.bitcoin.networks.blockstamp.p2wpkhInP2sh = {
wif: 0x80,
};
bitcoinjs.bitcoin.networks.nix.p2wpkh = {
libs.bitcoin.networks.nix.p2wpkh = {
baseNetwork: "nix",
messagePrefix: '\x18Nix Signed Message:\n',
bech32: 'nix',
@@ -224,7 +332,7 @@ bitcoinjs.bitcoin.networks.nix.p2wpkh = {
wif: 0x80,
};
bitcoinjs.bitcoin.networks.nix.p2wpkhInP2sh = {
libs.bitcoin.networks.nix.p2wpkhInP2sh = {
baseNetwork: "nix",
messagePrefix: '\x18Nix Signed Message:\n',
bech32: 'nix',
@@ -237,7 +345,7 @@ bitcoinjs.bitcoin.networks.nix.p2wpkhInP2sh = {
wif: 0x80,
};
bitcoinjs.bitcoin.networks.cpuchain.p2wpkh = {
libs.bitcoin.networks.cpuchain.p2wpkh = {
baseNetwork: "cpuchain",
messagePrefix: '\x1DCPUchain Signed Message:\n',
bech32: 'cpu',
@@ -250,7 +358,7 @@ bitcoinjs.bitcoin.networks.cpuchain.p2wpkh = {
wif: 0x80,
};
bitcoinjs.bitcoin.networks.cpuchain.p2wpkhInP2sh = {
libs.bitcoin.networks.cpuchain.p2wpkhInP2sh = {
baseNetwork: "cpuchain",
messagePrefix: '\x1DCPUchain Signed Message:\n',
bech32: 'cpu',
@@ -263,7 +371,7 @@ bitcoinjs.bitcoin.networks.cpuchain.p2wpkhInP2sh = {
wif: 0x80,
};
bitcoinjs.bitcoin.networks.monkeyproject.p2wpkh = {
libs.bitcoin.networks.monkeyproject.p2wpkh = {
baseNetwork: "monkeyproject",
messagePrefix: 'Monkey Signed Message:\n',
bech32: 'monkey',
@@ -276,7 +384,7 @@ bitcoinjs.bitcoin.networks.monkeyproject.p2wpkh = {
wif: 0x37
};
bitcoinjs.bitcoin.networks.monkeyproject.p2wpkhInP2sh = {
libs.bitcoin.networks.monkeyproject.p2wpkhInP2sh = {
baseNetwork: "monkeyproject",
messagePrefix: 'Monkey Signed Message:\n',
bech32: 'monkey',
@@ -289,7 +397,7 @@ bitcoinjs.bitcoin.networks.monkeyproject.p2wpkhInP2sh = {
wif: 0x37
};
bitcoinjs.bitcoin.networks.atom.p2wpkh = {
libs.bitcoin.networks.atom.p2wpkh = {
baseNetwork: "atom",
messagePrefix: '\x18Bitcoin Atom Signed Message:\n',
bech32: 'atom',
@@ -302,7 +410,7 @@ bitcoinjs.bitcoin.networks.atom.p2wpkh = {
wif: 0x80
};
bitcoinjs.bitcoin.networks.atom.p2wpkhInP2sh = {
libs.bitcoin.networks.atom.p2wpkhInP2sh = {
baseNetwork: "atom",
messagePrefix: '\x18Bitcoin Atom Signed Message:\n',
bech32: 'atom',
@@ -315,7 +423,7 @@ bitcoinjs.bitcoin.networks.atom.p2wpkhInP2sh = {
wif: 0x80
};
bitcoinjs.bitcoin.networks.bitcore.p2wpkh = {
libs.bitcoin.networks.bitcore.p2wpkh = {
baseNetwork: "bitcore",
messagePrefix: '\x18BitCore Signed Message:\n',
bech32: 'bitcore',
@@ -328,7 +436,7 @@ bitcoinjs.bitcoin.networks.bitcore.p2wpkh = {
wif: 0x80
};
bitcoinjs.bitcoin.networks.bitcore.p2wpkhInP2sh = {
libs.bitcoin.networks.bitcore.p2wpkhInP2sh = {
baseNetwork: "bitcore",
messagePrefix: '\x18BitCore Signed Message:\n',
bech32: 'bitcore',
@@ -341,7 +449,7 @@ bitcoinjs.bitcoin.networks.bitcore.p2wpkhInP2sh = {
wif: 0x80
};
bitcoinjs.bitcoin.networks.monacoin.p2wpkh = {
libs.bitcoin.networks.monacoin.p2wpkh = {
baseNetwork: "monacoin",
messagePrefix: '\x18Monacoin Signed Message:\n',
bech32: 'monacoin',
@@ -354,7 +462,7 @@ bitcoinjs.bitcoin.networks.monacoin.p2wpkh = {
wif: 0xb0
};
bitcoinjs.bitcoin.networks.monacoin.p2wpkhInP2sh = {
libs.bitcoin.networks.monacoin.p2wpkhInP2sh = {
baseNetwork: "monacoin",
messagePrefix: '\x18Monacoin Signed Message:\n',
bech32: 'monacoin',
@@ -367,7 +475,7 @@ bitcoinjs.bitcoin.networks.monacoin.p2wpkhInP2sh = {
wif: 0xb0
};
bitcoinjs.bitcoin.networks.syscoin.p2wpkh = {
libs.bitcoin.networks.syscoin.p2wpkh = {
baseNetwork: "syscoin",
messagePrefix: '\x18Syscoin Signed Message:\n',
bech32: 'sys',
@@ -380,7 +488,7 @@ bitcoinjs.bitcoin.networks.syscoin.p2wpkh = {
wif: 0x80
};
bitcoinjs.bitcoin.networks.syscoin.p2wpkhInP2sh = {
libs.bitcoin.networks.syscoin.p2wpkhInP2sh = {
baseNetwork: "syscoin",
messagePrefix: '\x18Syscoin Signed Message:\n',
bech32: 'sys',
@@ -393,7 +501,7 @@ bitcoinjs.bitcoin.networks.syscoin.p2wpkhInP2sh = {
wif: 0x80
};
bitcoinjs.bitcoin.networks.viacoin.p2wpkh = {
libs.bitcoin.networks.viacoin.p2wpkh = {
baseNetwork: "viacoin",
messagePrefix: '\x18Viacoin Signed Message:\n',
bech32: 'viacoin',
@@ -406,7 +514,7 @@ bitcoinjs.bitcoin.networks.viacoin.p2wpkh = {
wif: 0xc7
};
bitcoinjs.bitcoin.networks.viacoin.p2wpkhInP2sh = {
libs.bitcoin.networks.viacoin.p2wpkhInP2sh = {
baseNetwork: "viacoin",
messagePrefix: '\x18Viacoin Signed Message:\n',
bech32: 'viacoin',
@@ -419,7 +527,7 @@ bitcoinjs.bitcoin.networks.viacoin.p2wpkhInP2sh = {
wif: 0xc7
};
bitcoinjs.bitcoin.networks.dogecointestnet.p2wpkh = {
libs.bitcoin.networks.dogecointestnet.p2wpkh = {
baseNetwork: "dogecointestnet",
messagePrefix: '\x19Dogecoin Signed Message:\n',
bech32: 'dogecointestnet',
@@ -432,7 +540,7 @@ bitcoinjs.bitcoin.networks.dogecointestnet.p2wpkh = {
wif: 0xf1
};
bitcoinjs.bitcoin.networks.dogecointestnet.p2wpkhInP2sh = {
libs.bitcoin.networks.dogecointestnet.p2wpkhInP2sh = {
baseNetwork: "dogecointestnet",
messagePrefix: '\x19Dogecoin Signed Message:\n',
bech32: 'dogecointestnet',
@@ -445,7 +553,7 @@ bitcoinjs.bitcoin.networks.dogecointestnet.p2wpkhInP2sh = {
wif: 0xf1
};
bitcoinjs.bitcoin.networks.dogecointestnet.p2wpkh = {
libs.bitcoin.networks.dogecointestnet.p2wpkh = {
baseNetwork: "dogecointestnet",
messagePrefix: '\x19Dogecoin Signed Message:\n',
bech32: 'dogecointestnet',
@@ -458,7 +566,7 @@ bitcoinjs.bitcoin.networks.dogecointestnet.p2wpkh = {
wif: 0xf1
};
bitcoinjs.bitcoin.networks.dogecointestnet.p2wpkhInP2sh = {
libs.bitcoin.networks.dogecointestnet.p2wpkhInP2sh = {
baseNetwork: "dogecointestnet",
messagePrefix: '\x19Dogecoin Signed Message:\n',
bech32: 'dogecointestnet',
@@ -471,7 +579,7 @@ bitcoinjs.bitcoin.networks.dogecointestnet.p2wpkhInP2sh = {
wif: 0xf1
};
bitcoinjs.bitcoin.networks.litecointestnet.p2wpkh = {
libs.bitcoin.networks.litecointestnet.p2wpkh = {
baseNetwork: "litecointestnet",
messagePrefix: '\x18Litecoin Signed Message:\n',
bech32: 'litecointestnet',
@@ -484,7 +592,7 @@ bitcoinjs.bitcoin.networks.litecointestnet.p2wpkh = {
wif: 0xef
};
bitcoinjs.bitcoin.networks.litecointestnet.p2wpkhInP2sh = {
libs.bitcoin.networks.litecointestnet.p2wpkhInP2sh = {
baseNetwork: "litecointestnet",
messagePrefix: '\x18Litecoin Signed Message:\n',
bech32: 'litecointestnet',
@@ -497,7 +605,7 @@ bitcoinjs.bitcoin.networks.litecointestnet.p2wpkhInP2sh = {
wif: 0xef
};
bitcoinjs.bitcoin.networks.groestlcoin.p2wpkh = {
libs.bitcoin.networks.groestlcoin.p2wpkh = {
baseNetwork: "groestlcoin",
messagePrefix: '\x19GroestlCoin Signed Message:\n',
bech32: 'grs',
@@ -510,7 +618,7 @@ bitcoinjs.bitcoin.networks.groestlcoin.p2wpkh = {
wif: 0x80,
};
bitcoinjs.bitcoin.networks.groestlcointestnet.p2wpkh = {
libs.bitcoin.networks.groestlcointestnet.p2wpkh = {
baseNetwork: "groestlcointestnet",
messagePrefix: '\x19GroestlCoin Signed Message:\n',
bech32: 'tgrs',
@@ -523,7 +631,7 @@ bitcoinjs.bitcoin.networks.groestlcointestnet.p2wpkh = {
wif: 0xef
};
bitcoinjs.bitcoin.networks.groestlcoin.p2wpkhInP2sh = {
libs.bitcoin.networks.groestlcoin.p2wpkhInP2sh = {
baseNetwork: "groestlcoin",
messagePrefix: '\x19GroestlCoin Signed Message:\n',
bech32: 'grs',
@@ -536,7 +644,7 @@ bitcoinjs.bitcoin.networks.groestlcoin.p2wpkhInP2sh = {
wif: 0x80,
};
bitcoinjs.bitcoin.networks.groestlcointestnet.p2wpkhInP2sh = {
libs.bitcoin.networks.groestlcointestnet.p2wpkhInP2sh = {
baseNetwork: "groestlcointestnet",
messagePrefix: '\x19GroestlCoin Signed Message:\n',
bech32: 'tgrs',
@@ -549,4 +657,30 @@ bitcoinjs.bitcoin.networks.groestlcointestnet.p2wpkhInP2sh = {
wif: 0xef
};
libs.bitcoin.networks.deeponion.p2wpkh = {
baseNetwork: "deeponion",
messagePrefix: '\x18DeepOnion Signed Message:\n',
bech32: 'dpn',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4
},
pubKeyHash: 0x1f,
scriptHash: 0x4e,
wif: 0x9f
};
libs.bitcoin.networks.deeponion.p2wpkhInP2sh = {
baseNetwork: "deeponion",
messagePrefix: '\x18DeepOnion Signed Message:\n',
bech32: 'dpn',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4
},
pubKeyHash: 0x1f,
scriptHash: 0x4e,
wif: 0x9f
};
})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

14
src/js/wordlist_czech.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -412,6 +412,13 @@ it('Allows selection of bitcoin testnet', function(done) {
};
testNetwork(done, params);
});
it('Allows selection of bitcoin regtest', function(done) {
var params = {
selectText: "BTC - Bitcoin RegTest",
firstAddress: "mucaU5iiDaJDb69BHLeDv8JFfGiyg2nJKi",
};
testNetwork(done, params);
});
it('Allows selection of litecoin', function(done) {
var params = {
selectText: "LTC - Litecoin",
@@ -585,10 +592,9 @@ it('Allows selection of peercoin', function(done) {
it('Allows selection of ethereum', function(done) {
var params = {
selectText: "ETH - Ethereum",
firstAddress: "0x20Bb0CD7dd4a255f558bCD1A34D21E27061Ac2CF",
firstAddress: "0xe5815d5902Ad612d49283DEdEc02100Bd44C2772",
};
testNetwork(done, params);
// TODO test private key and public key
});
it('Allows selection of slimcoin', function(done) {
var params = {
@@ -1358,7 +1364,7 @@ it('Allows selection of Vpncoin', function(done) {
it('Allows selection of VeChain', function(done) {
var params = {
selectText: "VET - VeChain",
firstAddress: "0x993680FDF7f4a6AbcD4b9Db23b92Bc6B08AF9e48",
firstAddress: "0xdba55B1B6070f3a733D5eDFf35F0da4A00E455F2",
};
testNetwork(done, params);
});
@@ -1414,21 +1420,21 @@ it('Allows selection of Energi', function(done) {
it('Allows selection of Ethereum Classic', function(done) {
var params = {
selectText: "ETC - Ethereum Classic",
firstAddress: "0x8Ad2bc632591bb442CfBEA19AC919ef16480B162",
firstAddress: "0x3c05e5556693808367afB62eF3b63e35d6eD249A",
};
testNetwork(done, params);
});
it('Allows selection of Pirl', function(done) {
var params = {
selectText: "PIRL - Pirl",
firstAddress: "0xc85E5dc7287F759394E53e5ba62510a35cE0DcFF",
firstAddress: "0xe77FC0723dA122B5025CA79193c28563eB47e776",
};
testNetwork(done, params);
});
it('Allows selection of MIX', function(done) {
var params = {
selectText: "MIX - MIX",
firstAddress: "0x325C6118DD0f788B50998591B2a7A35FB0a4a402",
firstAddress: "0x98BC5e63aeb6A4e82d72850d20710F07E29A29F1",
};
testNetwork(done, params);
});
@@ -1443,28 +1449,28 @@ it('Allows selection of Monkey Project', function(done) {
it('Allows selection of Musicoin', function(done) {
var params = {
selectText: "MUSIC - Musicoin",
firstAddress: "0x600c481Fa6100531357dD49B3aa042A8F56F6AB5",
firstAddress: "0xDc060e4A0b0313ea83Cf6B3A39B9db2D29004897",
};
testNetwork(done, params);
});
it('Allows selection of Poa', function(done) {
var params = {
selectText: "POA - Poa",
firstAddress: "0x6F0d9bA6fda8EAA31f24A9c9fef3321F9851329D",
firstAddress: "0x53aF28d754e106210C3d0467Dd581eaf7e3C5e60",
};
testNetwork(done, params);
});
it('Allows selection of Expanse', function(done) {
var params = {
selectText: "EXP - Expanse",
firstAddress: "0xEc6e7f6782a29353c32A9A104E849605a01546e4",
firstAddress: "0xf57FeAbf26582b6E3E666559d3B1Cc6fB2b2c5F6",
};
testNetwork(done, params);
});
it('Allows selection of Callisto', function(done) {
var params = {
selectText: "CLO - Callisto",
firstAddress: "0x57bE971d6E61315fB957a2BFC9202fbE31f49e89",
firstAddress: "0x4f9364F7420B317266C51Dc8eB979717D4dE3f4E",
};
testNetwork(done, params);
});
@@ -1562,21 +1568,21 @@ it('Allows selection of BlockStamp', function(done) {
it('Allows selection of DEXON', function(done) {
var params = {
selectText: "DXN - DEXON",
firstAddress: "0x7c444Dd705c6Ecd6a4F926aFd38bC96d6BdcC3D5",
firstAddress: "0x136a58788033E028CCd740FbDec6734358DB56Ec",
};
testNetwork(done, params);
});
it('Allows selection of Ellaism', function(done) {
var params = {
selectText: "ELLA - Ellaism",
firstAddress: "0x9DA7b90b0c0Cf7a2EbbE1A20f9d9A663451a2F8D",
firstAddress: "0xa8B0BeA09eeBc41062308546a01d6E544277e2Ca",
};
testNetwork(done, params);
});
it('Allows selection of Ethersocial Network', function(done) {
var params = {
selectText: "ESN - Ethersocial Network",
firstAddress: "0x0685439123f9a1767Bad9b99258d72733783f64C",
firstAddress: "0x6EE99Be2A0C7F887a71e21C8608ACF0aa0D2b767",
};
testNetwork(done, params);
});
@@ -1618,7 +1624,7 @@ it('Allows selection of Elastos', function(done) {
it('Allows selection of Energyweb', function(done) {
var params = {
selectText: "EWT - EnergyWeb",
firstAddress: "0x190aCfa6dA6Ff2D0a28Fbd0e02Aec493bCa5D7f7",
firstAddress: "0x22171474844Fc7E8E99A3A69CCf1eDb5574FdD4c",
};
testNetwork(done, params);
});
@@ -1629,6 +1635,27 @@ it('Allows selection of Thought', function(done) {
};
testNetwork(done, params);
});
it('Allows selection of EtherCore', function(done) {
var params = {
selectText: "ERE - EtherCore",
firstAddress: "0x119e6EAC3Ce1b473D62d9fD847fb0ea222eF1D9e",
};
testNetwork(done, params);
});
it('Allows selection of RBTC - RSK', function(done) {
var params = {
selectText: "RBTC - RSK",
firstAddress: "RGtz5TDdtviAZ9haz1YAUNQzcGVFm5bQrP",
};
testNetwork(done, params);
});
it('Allows selection of tRBTC - RSK Testnet', function(done) {
var params = {
selectText: "tRBTC - RSK Testnet",
firstAddress: "RHkrWgnSdJHxQAqEsMErhUUa4icXY6xUUC",
};
testNetwork(done, params);
});
// BIP39 seed is set from phrase
it('Sets the bip39 seed from the prhase', function(done) {
@@ -2002,11 +2029,7 @@ it('Allows the user to set the BIP32 root key', function(done) {
});
// Setting BIP32 root key clears the existing phrase, passphrase and seed
// TODO this doesn't work in selenium with chrome
it('Confirms the existing phrase should be cleared', function(done) {
if (browser == "chrome") {
pending("Selenium + Chrome headless bug for alert, see https://stackoverflow.com/q/45242264");
}
driver.findElement(By.css('.phrase'))
.sendKeys('A non-blank but invalid value');
driver.findElement(By.css('.root-key'))
@@ -2020,11 +2043,7 @@ it('Confirms the existing phrase should be cleared', function(done) {
});
// Clearing of phrase, passphrase and seed can be cancelled by user
// TODO this doesn't work in selenium with chrome
it('Allows the clearing of the phrase to be cancelled', function(done) {
if (browser == "chrome") {
pending("Selenium + Chrome headless bug for alert, see https://stackoverflow.com/q/45242264");
}
driver.findElement(By.css('.phrase'))
.sendKeys('abandon abandon ability');
driver.sleep(generateDelay).then(function() {
@@ -3694,6 +3713,106 @@ it('Can generate BIP141 addresses with P2WPKH-in-P2SH semanitcs', function(done)
});
});
it('Can generate BIP141 addresses with P2WSH semanitcs', function(done) {
driver.findElement(By.css('#bip141-tab a'))
.click();
// Choose P2WSH
driver.executeScript(function() {
$(".bip141-semantics option[selected]").removeAttr("selected");
$(".bip141-semantics option").filter(function(i,e) {
return $(e).html() == "P2WSH (1-of-1 multisig)";
}).prop("selected", true);
$(".bip141-semantics").trigger("change");
});
driver.findElement(By.css(".phrase"))
.sendKeys("abandon abandon ability");
driver.sleep(generateDelay).then(function() {
driver.findElement(By.css("#root-key"))
.getAttribute("value")
.then(function(rootKey) {
expect(rootKey).toBe("ZprvAhadJRUYsNge9uHspaggavxU1BUQ8QwfT4Z9UGq5sKF2mSt1mVy8EckLAaoBdmLHyP5eYDJ3LxtmzMNnLg2MRFe7QN2ueF4NCH4s5PrCDR6");
getFirstAddress(function(address) {
expect(address).toBe("bc1q2qhee847pv438tgg8hc7mjy38n8dklleshettn344l0tgs0kj5hskz9p9r");
done();
});
})
});
});
it('Can generate BIP141 addresses with P2WSH-in-P2SH semanitcs', function(done) {
driver.findElement(By.css('#bip141-tab a'))
.click();
// Choose P2WSH-in-P2SH
driver.executeScript(function() {
$(".bip141-semantics option[selected]").removeAttr("selected");
$(".bip141-semantics option").filter(function(i,e) {
return $(e).html() == "P2WSH nested in P2SH (1-of-1 multisig)";
}).prop("selected", true);
$(".bip141-semantics").trigger("change");
});
driver.findElement(By.css(".phrase"))
.sendKeys("abandon abandon ability");
driver.sleep(generateDelay).then(function() {
driver.findElement(By.css("#root-key"))
.getAttribute("value")
.then(function(rootKey) {
expect(rootKey).toBe("YprvANkMzkodih9AJc6kzDu4NqrxqDKxBnxAXx2vgswCVJs9iM4nWqoZcZ6C9NqbdrgNZjxqnjhUtJYE74mDcycLd1xWY2LV4LEsvZ1DgqxuAKe");
getFirstAddress(function(address) {
expect(address).toBe("343DLC4vGDyHBbBr9myL8zzZA1MdN9TM1G");
done();
});
})
});
});
it('Uses Vprv for bitcoin testnet p2wsh', function(done) {
selectNetwork("BTC - Bitcoin Testnet");
driver.findElement(By.css('#bip141-tab a'))
.click()
// Choose P2WSH
driver.executeScript(function() {
$(".bip141-semantics option[selected]").removeAttr("selected");
$(".bip141-semantics option").filter(function(i,e) {
return $(e).html() == "P2WSH (1-of-1 multisig)";
}).prop("selected", true);
$(".bip141-semantics").trigger("change");
});
driver.findElement(By.css('.phrase'))
.sendKeys('abandon abandon ability');
driver.sleep(generateDelay).then(function() {
driver.findElement(By.css('.root-key'))
.getAttribute("value")
.then(function(path) {
expect(path).toBe("Vprv16YtLrHXxePM5ja5hXQbiJs5JKDAc4WcaXo5rZcrVMU6bMhUg1oY7fpPku3i819gvMcHvq1h8aELDsyfCEs19vj1Q3iDHRrESWyJConkoT1");
done();
})
});
});
it('Uses Uprv for bitcoin testnet p2wsh-in-p2sh', function(done) {
selectNetwork("BTC - Bitcoin Testnet");
driver.findElement(By.css('#bip141-tab a'))
.click()
// Choose P2WSH-in-P2SH
driver.executeScript(function() {
$(".bip141-semantics option[selected]").removeAttr("selected");
$(".bip141-semantics option").filter(function(i,e) {
return $(e).html() == "P2WSH nested in P2SH (1-of-1 multisig)";
}).prop("selected", true);
$(".bip141-semantics").trigger("change");
});
driver.findElement(By.css('.phrase'))
.sendKeys('abandon abandon ability');
driver.sleep(generateDelay).then(function() {
driver.findElement(By.css('.root-key'))
.getAttribute("value")
.then(function(path) {
expect(path).toBe("Uprv95RJn67y7xyEuRLHenkZYVUx9LkARJzAsVx3ZJMeyHMdVwosWD9K8JTe4Z1FeE4gwBVcnqKF3f82ZvJxkBxHS5E74fYnigxvqeke8ZV3Fp2");
done();
})
});
});
it('Can generate BIP141 addresses with P2WPKH semanitcs', function(done) {
// This result tested against bitcoinjs-lib test spec for segwit address
// using the first private key of this mnemonic and default path m/0
@@ -4143,7 +4262,7 @@ it('Converts mnemonics into raw entropy', function(done) {
driver.findElement(By.css('.entropy'))
.getAttribute("value")
.then(function(entropy) {
expect(entropy).toBe("00000000000000000000000000000001");
expect(entropy).toBe("00000001");
driver.findElement(By.css('.phrase'))
.getAttribute("value")
.then(function(phrase) {
@@ -4185,4 +4304,77 @@ it('Shows split prase cards', function(done) {
});
});
// It allows manually specifying the entropy type
it('Allows entropy type to be manually selected', function(done) {
driver.findElement(By.css('.use-entropy'))
.click();
// use decimal entropy
driver.findElement(By.css('.entropy'))
.sendKeys("91");
// manually change to binary entropy
driver.executeScript(function() {
$(".entropy-container input[value='binary']").click();
});
driver.sleep(entropyFeedbackDelay).then(function() {
driver.findElement(By.css('.entropy-container'))
.getText()
.then(function(text) {
// overide 91 to be just 1
var key = "Filtered Entropy";
var value = "1";
var reText = key + "\\s+" + value;
var re = new RegExp(reText);
expect(text).toMatch(re);
// overide automatic decimal to binary
var key = "Entropy Type";
var value = "binary";
var reText = key + "\\s+" + value;
var re = new RegExp(reText);
expect(text).toMatch(re);
// overide 2 events to 1
var key = "Event Count";
var value = 1;
var reText = key + "\\s+" + value;
var re = new RegExp(reText);
expect(text).toMatch(re);
// overide log2(10)*2 bits to 1 bit
var key = "Total Bits";
var value = 1;
var reText = key + "\\s+" + value;
var re = new RegExp(reText);
expect(text).toMatch(re);
done();
});
});
});
// https://github.com/iancoleman/bip39/issues/388
// Make field for bip39 seed editable
it('Generates addresses when seed is set', function(done) {
driver.findElement(By.css('.seed'))
.sendKeys("20da140d3dd1df8713cefcc4d54ce0e445b4151027a1ab567b832f6da5fcc5afc1c3a3f199ab78b8e0ab4652efd7f414ac2c9a3b81bceb879a70f377aa0a58f3");
driver.sleep(generateDelay).then(function() {
getFirstAddress(function(address) {
expect(address).toBe("1Di3Vp7tBWtyQaDABLAjfWtF6V7hYKJtug");
done();
});
});
});
// https://github.com/iancoleman/bip39/issues/169
it('Generates ethereum addresses from a public key', function(done) {
var pubkey = "xpub68UK3hrMEp2jLPxPASgXSiqiUsQsUWZHCeuu6NqcJLt259LMeWzwDyufXLN1QmjLeLRY5he4QfArDDLbsXiw3xN3kFcYtyDy74BY73RPhhW";
driver.findElement(By.css('.root-key'))
.sendKeys(pubkey);
driver.findElement(By.css('#bip32-tab a'))
.click()
selectNetwork('ETH - Ethereum');
driver.sleep(generateDelay).then(function() {
getFirstAddress(function(address) {
expect(address).toBe("0x1Bd54748903438C7E386b4a3fCbe16237A316a98");
done();
});
});
});
});