mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-07 03:12:14 +00:00
Compare commits
64 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c4f0c2908f | ||
|
|
941b099f14 | ||
|
|
83f23081a3 | ||
|
|
1dab87d842 | ||
|
|
83c580c678 | ||
|
|
8b44f5d19a | ||
|
|
a7705b8ebc | ||
|
|
f2081ee467 | ||
|
|
f50464249c | ||
|
|
ed720546bf | ||
|
|
e8f27ba2c3 | ||
|
|
be946a2061 | ||
|
|
a636b24619 | ||
|
|
f8fd590588 | ||
|
|
02eeb81713 | ||
|
|
18d64d9586 | ||
|
|
5b5b11fd96 | ||
|
|
2c86fb4746 | ||
|
|
85711db3bb | ||
|
|
1820b6ac67 | ||
|
|
b500a60e28 | ||
|
|
942de1bc5e | ||
|
|
43bef4e19d | ||
|
|
20bd34b014 | ||
|
|
23f393acfb | ||
|
|
c560e01e91 | ||
|
|
a362ff2f62 | ||
|
|
9a82f12b91 | ||
|
|
5e376b8903 | ||
|
|
90422a41af | ||
|
|
f3314418fb | ||
|
|
7da8c22eaf | ||
|
|
d9ad938b52 | ||
|
|
f7f579f5f5 | ||
|
|
2cd19306b2 | ||
|
|
545348d159 | ||
|
|
8835afe8a2 | ||
|
|
38e6aaed84 | ||
|
|
f7125606bf | ||
|
|
5b0b1a5c9a | ||
|
|
71573cb380 | ||
|
|
c64ff95697 | ||
|
|
6d2e202083 | ||
|
|
0cb81e1117 | ||
|
|
32ade2fbf7 | ||
|
|
ac7f150a79 | ||
|
|
134213954d | ||
|
|
253f4cb75f | ||
|
|
ebbb057dfa | ||
|
|
38626a2d1f | ||
|
|
990ce0d072 | ||
|
|
1ca3784b0a | ||
|
|
1b54929bda | ||
|
|
d75ddf4ea8 | ||
|
|
ad07c1c0b5 | ||
|
|
0b911fc20f | ||
|
|
73ccaa1357 | ||
|
|
bd1ecd20f9 | ||
|
|
e3668fb51f | ||
|
|
3c222e57df | ||
|
|
16ff1df7ab | ||
|
|
f2f8d8177e | ||
|
|
877b8bdfec | ||
|
|
5e211c6959 |
25
changelog.md
25
changelog.md
@@ -1,3 +1,28 @@
|
||||
# 0.5.3
|
||||
|
||||
Add Starname network
|
||||
Add Terra network
|
||||
Add Bitcoin Private network
|
||||
Add Thorchain network
|
||||
Change Xwc network to Xwcc and add new Xwc
|
||||
Fix Bip85 works without mnemonic (using xprv)
|
||||
Fix extended key not updating when switching tabs
|
||||
Fix incorrect html closing tag
|
||||
|
||||
# 0.5.2
|
||||
|
||||
* Show ethereum private keys with correct padding
|
||||
|
||||
# 0.5.1
|
||||
|
||||
* Add Portuguese language
|
||||
* Add BIP85
|
||||
* Add Ritocoin
|
||||
* Add Cosmos Hub
|
||||
* Add ZooBC
|
||||
* Add Zcoin/Firo rebranded coin
|
||||
* Update Namecoin WIF
|
||||
|
||||
# 0.5.0
|
||||
|
||||
* Remove bias from base 6 and base 10 entropy
|
||||
|
||||
@@ -45,10 +45,10 @@ cd tests
|
||||
npm install --global jasmine
|
||||
npm install selenium-webdriver
|
||||
# install gecko webdriver for firefox
|
||||
wget https://github.com/mozilla/geckodriver/releases/download/v0.27.0/geckodriver-v0.27.0-linux64.tar.gz --output-document=/tmp/geckodriver.tar.gz
|
||||
wget https://github.com/mozilla/geckodriver/releases/download/v0.29.0/geckodriver-v0.29.0-linux64.tar.gz --output-document=/tmp/geckodriver.tar.gz
|
||||
tar -xf /tmp/geckodriver.tar.gz -C $HOME/.bin
|
||||
# install chrome webdriver for chromium
|
||||
wget https://chromedriver.storage.googleapis.com/85.0.4183.87/chromedriver_linux64.zip --output-document=/tmp/chromedriver.zip
|
||||
wget https://chromedriver.storage.googleapis.com/88.0.4324.96/chromedriver_linux64.zip --output-document=/tmp/chromedriver.zip
|
||||
unzip /tmp/chromedriver.zip -d $HOME/.bin
|
||||
|
||||
# to run tests
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
module.exports.basex = require('base-x')
|
||||
|
||||
/* base32 */
|
||||
|
||||
module.exports.base32 = require('base32.js')
|
||||
|
||||
/* bchaddrjs */
|
||||
|
||||
module.exports.bchaddr = require('bchaddrjs')
|
||||
@@ -10,6 +14,10 @@ module.exports.bchaddr = require('bchaddrjs')
|
||||
|
||||
module.exports.bchaddrSlp = require('bchaddrjs-slp')
|
||||
|
||||
/* bech32 */
|
||||
|
||||
module.exports.bech32 = require('bech32')
|
||||
|
||||
/* biginteger */
|
||||
|
||||
module.exports.BigInteger = require('javascript-biginteger')
|
||||
@@ -18,6 +26,10 @@ module.exports.BigInteger = require('javascript-biginteger')
|
||||
|
||||
module.exports.bip38 = require('bip38')
|
||||
|
||||
/* bip85 */
|
||||
|
||||
module.exports.bip85 = require('bip85')
|
||||
|
||||
/* bitcoinjs-lib */
|
||||
|
||||
module.exports.bitcoin = require('bitcoinjs-lib')
|
||||
@@ -80,6 +92,35 @@ module.exports.stellarUtil = {
|
||||
},
|
||||
}
|
||||
|
||||
/* zoobc-util */
|
||||
|
||||
let base32 = require('base32.js');
|
||||
let nbl = require('nebulas');
|
||||
module.exports.zoobcUtil = {
|
||||
getKeypair: function (path, seed) {
|
||||
const { key, chainCode} = edHd.derivePath(path, seed);
|
||||
const pubKey = edHd.getPublicKey(key);
|
||||
return {key,chainCode, pubKey};
|
||||
},
|
||||
getZBCAddress(publicKey, prefix = "ZBC") {
|
||||
const prefixDefault = ["ZBC", "ZNK", "ZBL", "ZTX"];
|
||||
const valid = prefixDefault.indexOf(prefix) > -1;
|
||||
if (valid) {
|
||||
var bytes = new Uint8Array(35);
|
||||
for (let i = 0; i < 32; i++) bytes[i] = publicKey[i];
|
||||
for (let i = 0; i < 3; i++) bytes[i + 32] = prefix.charCodeAt(i);
|
||||
const checksum = nbl.CryptoUtils.sha3(bytes);
|
||||
for (let i = 0; i < 3; i++) bytes[i + 32] = Number(checksum[i]);
|
||||
var segs = [prefix];
|
||||
var b32 = base32.encode(bytes);
|
||||
for (let i = 0; i < 7; i++) segs.push(b32.substr(i * 8, 8));
|
||||
return segs.join("_");
|
||||
} else {
|
||||
throw new Error("The Prefix not available!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* nano-util */
|
||||
|
||||
let NanoBase = require('nanocurrency-web');
|
||||
|
||||
17
libs/combined/npm-shrinkwrap.json
generated
17
libs/combined/npm-shrinkwrap.json
generated
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
3611
libs/combined/package-lock.json
generated
3611
libs/combined/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -8,8 +8,10 @@
|
||||
"base-x": "3.0.7",
|
||||
"bchaddrjs": "0.4.4",
|
||||
"bchaddrjs-slp": "git://github.com/simpleledger/bchaddrjs.git#af16e44a6bfbe4b3980a62dba50e2f68ed864c6b",
|
||||
"bech32": "1.1.4",
|
||||
"bip38": "2.0.2",
|
||||
"bip38grs": "git://github.com/Groestlcoin/bip38grs.git#091975b01679b74dc0a4136bb743fe17791b0151",
|
||||
"bip85": "0.0.3",
|
||||
"bitcoinjs-lib": "git://github.com/iancoleman/bitcoinjs-lib.git#v3.3.2_16bit",
|
||||
"bs58": "^4.0.1",
|
||||
"buffer": "^5.4.3",
|
||||
|
||||
118
src/index.html
118
src/index.html
@@ -15,7 +15,7 @@
|
||||
<div class="container">
|
||||
|
||||
<h1 class="text-center">Mnemonic Code Converter</h1>
|
||||
<p class="version">v0.5.0</p>
|
||||
<p class="version">v0.5.3</p>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@@ -194,6 +194,7 @@
|
||||
<a href="#italian" title="Italian">Italiano</a>
|
||||
<a href="#korean" title="Korean">한국어</a>
|
||||
<a href="#czech" title="Czech">Čeština</a>
|
||||
<a href="#portuguese" title="Portuguese">Português</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -248,6 +249,113 @@
|
||||
<textarea id="root-key" class="root-key private-data form-control" data-show-qr autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-2"></div>
|
||||
<div class="col-sm-10">
|
||||
<label class="control-label text-weight-normal">
|
||||
<input type="checkbox" class="showBip85" />
|
||||
Show BIP85
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group bip85 hidden">
|
||||
<div class="form-group text-danger">
|
||||
<label class="col-sm-2 control-label">Warning</label>
|
||||
<div class="col-sm-10 form-control-static">
|
||||
This is an advanced feature and should only be used if you understand what it does.
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2"></label>
|
||||
<div class="col-sm-10">
|
||||
<p>
|
||||
The value of the "BIP85 Child Key" field shown below is not used
|
||||
elsewhere on this page. It can be used as a new key.
|
||||
</p>
|
||||
<p>
|
||||
In case of the BIP39 application, you can paste it into the "BIP39 Mnemonic"
|
||||
field to use it as a new mnemonic.
|
||||
</p>
|
||||
<p>
|
||||
Please read the
|
||||
<a href="https://github.com/bitcoin/bips/blob/master/bip-0085.mediawiki" target="_blank">
|
||||
BIP85 spec
|
||||
</a>
|
||||
for more information.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<label for="bip85-application" class="col-sm-2 control-label">BIP85 Application</label>
|
||||
<div class="col-sm-10">
|
||||
<select id="bip85-application" class="form-control">
|
||||
<option value="bip39" selected>BIP39</option>
|
||||
<option value="wif">WIF</option>
|
||||
<option value="xprv">Xprv</option>
|
||||
<option value="hex">Hex</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group bip85 bip85-mnemonic-language-input hidden">
|
||||
<label for="bip85-mnemonic-language" class="col-sm-2 control-label">BIP85 Mnemonic Language</label>
|
||||
<div class="col-sm-10 languages">
|
||||
<select id="bip85-mnemonic-language" class="strength form-control">
|
||||
<option value="0" selected>English</option>
|
||||
<!--<option value="1">日本語</option>
|
||||
<option value="2">한국어</option>
|
||||
<option value="3">Español</option>
|
||||
<option value="4">中文(简体)</option>
|
||||
<option value="5">中文(繁體)</option>
|
||||
<option value="6">Français</option>
|
||||
<option value="7">Italiano</option>
|
||||
<option value="8">Čeština</option>
|
||||
<option value="9">Português</option>-->
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group bip85 bip85-mnemonic-length-input hidden">
|
||||
<label for="bip85-mnemonic-length" class="col-sm-2 control-label">BIP85 Mnemonic Length</label>
|
||||
<div class="col-sm-10">
|
||||
<select id="bip85-mnemonic-length" class="strength form-control">
|
||||
<option value="12" selected>12</option>
|
||||
<option value="18">18</option>
|
||||
<option value="24">24</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group bip85 hidden">
|
||||
<span class="bip85-bytes-input">
|
||||
<label for="bip85-bytes" class="col-sm-2 control-label">BIP85 Bytes</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="bip85-bytes" type="text" class="change form-control" value="64" />
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="form-group bip85 bip85-index-input hidden">
|
||||
<label for="bip85-index" class="col-sm-2 control-label">BIP85 Index</label>
|
||||
<div class="col-sm-10">
|
||||
<input id="bip85-index" type="text" class="change form-control" value="0" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group bip85 hidden">
|
||||
<label for="phrase" class="col-sm-2 control-label">BIP85 Child Key</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea
|
||||
id="bip85Field"
|
||||
data-show-qr
|
||||
class="bip85Field private-data form-control"
|
||||
title="BIP85 Child Key"
|
||||
rows="3"
|
||||
></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group litecoin-ltub-container hidden">
|
||||
<label for="litecoin-use-ltub" class="col-sm-2 control-label">Prefixes</label>
|
||||
<div class="col-sm-10 checkbox">
|
||||
@@ -802,6 +910,11 @@
|
||||
Read more at the
|
||||
<a href="https://github.com/bitcoin/bips/blob/master/bip-0049.mediawiki" target="_blank">official BIP49 spec</a>
|
||||
</p>
|
||||
<h3>BIP85 <span class="small">Deterministic Entropy From BIP32 Keychains</span></h3>
|
||||
<p>
|
||||
Read more at the
|
||||
<a href="https://github.com/bitcoin/bips/blob/master/bip-0085.mediawiki" target="_blank">official BIP85 spec</a>
|
||||
</p>
|
||||
<h3 id="entropy-notes">Entropy</h3>
|
||||
<p>
|
||||
<span>Entropy values should not include the BIP39 checksum. This is automatically added by the tool.</span>
|
||||
@@ -988,8 +1101,10 @@
|
||||
<script src="js/ripple-util.js"></script>
|
||||
<script src="js/jingtum-util.js"></script>
|
||||
<script src="js/casinocoin-util.js"></script>
|
||||
<script src="js/cosmos-util.js"></script>
|
||||
<script src="js/eos-util.js"></script>
|
||||
<script src="js/fio-util.js"></script>
|
||||
<script src="js/xwc-util.js"></script>
|
||||
<script src="js/sjcl-bip39.js"></script>
|
||||
<script src="js/wordlist_english.js"></script>
|
||||
<script src="js/wordlist_japanese.js"></script>
|
||||
@@ -1000,6 +1115,7 @@
|
||||
<script src="js/wordlist_italian.js"></script>
|
||||
<script src="js/wordlist_korean.js"></script>
|
||||
<script src="js/wordlist_czech.js"></script>
|
||||
<script src="js/wordlist_portuguese.js"></script>
|
||||
<script src="js/jsbip39.js"></script>
|
||||
<script src="js/entropy.js"></script>
|
||||
<script src="js/index.js"></script>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -114,7 +114,7 @@ libs.bitcoin.networks.namecoin = {
|
||||
},
|
||||
pubKeyHash: 0x34,
|
||||
scriptHash: 0x0D,
|
||||
wif: 0x80
|
||||
wif: 0xb4
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.peercoin = {
|
||||
@@ -768,6 +768,28 @@ libs.bitcoin.networks.feathercoin = {
|
||||
wif: 0x8e,
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.firo = {
|
||||
messagePrefix: '\x18Firo Signed Message:\n',
|
||||
bip32: {
|
||||
public: 0x0488B21E,
|
||||
private: 0x0488ADE4,
|
||||
},
|
||||
pubKeyHash: 0x52,
|
||||
scriptHash: 0x07,
|
||||
wif: 0xd2,
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.zcoin = {
|
||||
messagePrefix: '\x18Zcoin Signed Message:\n',
|
||||
bip32: {
|
||||
public: 0x0488B21E,
|
||||
private: 0x0488ADE4,
|
||||
},
|
||||
pubKeyHash: 0x52,
|
||||
scriptHash: 0x07,
|
||||
wif: 0xd2,
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.firstcoin = {
|
||||
messagePrefix: '\x18FirstCoin Signed Message:\n',
|
||||
bip32: {
|
||||
@@ -1197,6 +1219,17 @@ libs.bitcoin.networks.revolutionvr = {
|
||||
wif: 0xc6,
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.ritocoin = {
|
||||
messagePrefix: '\x15Rito Signed Message:\n',
|
||||
bip32: {
|
||||
public: 0x0488B21E,
|
||||
private: 0x0488ADE4,
|
||||
},
|
||||
pubKeyHash: 0x19,
|
||||
scriptHash: 0x69,
|
||||
wif: 0x8b,
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.rsk = {
|
||||
messagePrefix: '\x18RSK Signed Message:\n',
|
||||
bip32: {
|
||||
@@ -1465,17 +1498,6 @@ libs.bitcoin.networks.wincoin = {
|
||||
wif: 0xc9,
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.zcoin = {
|
||||
messagePrefix: '\x18Zcoin Signed Message:\n',
|
||||
bip32: {
|
||||
public: 0x0488B21E,
|
||||
private: 0x0488ADE4,
|
||||
},
|
||||
pubKeyHash: 0x52,
|
||||
scriptHash: 0x07,
|
||||
wif: 0xd2,
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.zcash = {
|
||||
messagePrefix: '\x18Zcash Signed Message:\n',
|
||||
bip32: {
|
||||
@@ -1509,6 +1531,17 @@ libs.bitcoin.networks.bitcoinprivate = {
|
||||
wif: 0x80,
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.bitcoinprivatetestnet = {
|
||||
messagePrefix: '\x18BitcoinPrivate Signed Message:\n',
|
||||
bip32: {
|
||||
public: 0x043587CF,
|
||||
private: 0x04358394,
|
||||
},
|
||||
pubKeyHash: 0x1957,
|
||||
scriptHash: 0x19E0,
|
||||
wif: 0xEF,
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.bitcoinz = {
|
||||
messagePrefix: '\x18BitcoinZ Signed Message:\n',
|
||||
bip32: {
|
||||
@@ -1542,6 +1575,18 @@ libs.bitcoin.networks.hush3 = {
|
||||
wif: 0xBC,
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.zoobc = {
|
||||
messagePrefix: '\x18ZooBC Signed Message:\n',
|
||||
bech32: 'bc',
|
||||
bip32: {
|
||||
public: 0x0488b21e,
|
||||
private: 0x0488ade4,
|
||||
},
|
||||
pubKeyHash: 0x00,
|
||||
scriptHash: 0x05,
|
||||
wif: 0x80,
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.zclassic = {
|
||||
messagePrefix: '\x18Zcash Signed Message:\n',
|
||||
bip32: {
|
||||
|
||||
13
src/js/cosmos-util.js
Normal file
13
src/js/cosmos-util.js
Normal file
@@ -0,0 +1,13 @@
|
||||
function CosmosBufferToPublic(pubBuf, hrp = "cosmos") {
|
||||
const Buffer = libs.buffer.Buffer;
|
||||
const AminoSecp256k1PubkeyPrefix = Buffer.from("EB5AE987", "hex");
|
||||
const AminoSecp256k1PubkeyLength = Buffer.from("21", "hex");
|
||||
pubBuf = Buffer.concat([AminoSecp256k1PubkeyPrefix, AminoSecp256k1PubkeyLength, pubBuf]);
|
||||
return libs.bech32.encode(`${hrp}pub`, libs.bech32.toWords(pubBuf));
|
||||
}
|
||||
|
||||
function CosmosBufferToAddress(pubBuf, hrp = "cosmos") {
|
||||
const sha256_ed = libs.createHash("sha256").update(pubBuf).digest();
|
||||
const ripemd160_ed = libs.createHash("rmd160").update(sha256_ed).digest();
|
||||
return libs.bech32.encode(hrp, libs.bech32.toWords(ripemd160_ed));
|
||||
}
|
||||
227
src/js/index.js
227
src/js/index.js
@@ -94,6 +94,18 @@
|
||||
DOM.bip84accountXprv = $("#bip84 .account-xprv");
|
||||
DOM.bip84accountXpub = $("#bip84 .account-xpub");
|
||||
DOM.bip84change = $("#bip84 .change");
|
||||
DOM.bip85 = $('.bip85');
|
||||
DOM.showBip85 = $('.showBip85');
|
||||
DOM.bip85Field = $('.bip85Field');
|
||||
DOM.bip85application = $('#bip85-application');
|
||||
DOM.bip85mnemonicLanguage = $('#bip85-mnemonic-language');
|
||||
DOM.bip85mnemonicLanguageInput = $('.bip85-mnemonic-language-input');
|
||||
DOM.bip85mnemonicLength = $('#bip85-mnemonic-length');
|
||||
DOM.bip85mnemonicLengthInput = $('.bip85-mnemonic-length-input');
|
||||
DOM.bip85index = $('#bip85-index');
|
||||
DOM.bip85indexInput = $('.bip85-index-input');
|
||||
DOM.bip85bytes = $('#bip85-bytes');
|
||||
DOM.bip85bytesInput = $('.bip85-bytes-input');
|
||||
DOM.bip141unavailable = $("#bip141 .unavailable");
|
||||
DOM.bip141available = $("#bip141 .available");
|
||||
DOM.bip141path = $("#bip141-path");
|
||||
@@ -141,6 +153,7 @@
|
||||
DOM.more.on("click", showMore);
|
||||
DOM.seed.on("input", delayedSeedChanged);
|
||||
DOM.rootKey.on("input", delayedRootKeyChanged);
|
||||
DOM.showBip85.on('change', toggleBip85);
|
||||
DOM.litecoinUseLtub.on("change", litecoinUseLtubChanged);
|
||||
DOM.bip32path.on("input", calcForDerivationPath);
|
||||
DOM.bip44account.on("input", calcForDerivationPath);
|
||||
@@ -149,6 +162,11 @@
|
||||
DOM.bip49change.on("input", calcForDerivationPath);
|
||||
DOM.bip84account.on("input", calcForDerivationPath);
|
||||
DOM.bip84change.on("input", calcForDerivationPath);
|
||||
DOM.bip85application.on('input', calcBip85);
|
||||
DOM.bip85mnemonicLanguage.on('change', calcBip85);
|
||||
DOM.bip85mnemonicLength.on('change', calcBip85);
|
||||
DOM.bip85index.on('input', calcBip85);
|
||||
DOM.bip85bytes.on('input', calcBip85);
|
||||
DOM.bip141path.on("input", calcForDerivationPath);
|
||||
DOM.bip141semantics.on("change", tabChanged);
|
||||
DOM.tab.on("shown.bs.tab", tabChanged);
|
||||
@@ -268,6 +286,7 @@
|
||||
var passphrase = DOM.passphrase.val();
|
||||
calcBip32RootKeyFromSeed(phrase, passphrase);
|
||||
calcForDerivationPath();
|
||||
calcBip85();
|
||||
// Show the word indexes
|
||||
showWordIndexes();
|
||||
writeSplitPhrase(phrase);
|
||||
@@ -277,6 +296,7 @@
|
||||
showPending();
|
||||
adjustNetworkForSegwit();
|
||||
var phrase = DOM.phrase.val();
|
||||
var seed = DOM.seed.val();
|
||||
if (phrase != "") {
|
||||
// Calculate and display for mnemonic
|
||||
var errorText = findPhraseErrors(phrase);
|
||||
@@ -288,6 +308,11 @@
|
||||
var passphrase = DOM.passphrase.val();
|
||||
calcBip32RootKeyFromSeed(phrase, passphrase);
|
||||
}
|
||||
else if (seed != "") {
|
||||
bip32RootKey = libs.bitcoin.HDNode.fromSeedHex(seed, network);
|
||||
var rootKeyBase58 = bip32RootKey.toBase58();
|
||||
DOM.rootKey.val(rootKeyBase58);
|
||||
}
|
||||
else {
|
||||
// Calculate and display for root key
|
||||
var rootKeyBase58 = DOM.rootKey.val();
|
||||
@@ -404,6 +429,7 @@
|
||||
}
|
||||
// Calculate and display
|
||||
calcForDerivationPath();
|
||||
calcBip85();
|
||||
}
|
||||
|
||||
function rootKeyChanged() {
|
||||
@@ -418,6 +444,7 @@
|
||||
// Calculate and display
|
||||
calcBip32RootKeyFromBase58(rootKeyBase58);
|
||||
calcForDerivationPath();
|
||||
calcBip85();
|
||||
}
|
||||
|
||||
function litecoinUseLtubChanged() {
|
||||
@@ -440,6 +467,78 @@
|
||||
}
|
||||
}
|
||||
|
||||
function toggleBip85() {
|
||||
if (DOM.showBip85.prop('checked')) {
|
||||
DOM.bip85.removeClass('hidden');
|
||||
calcBip85();
|
||||
} else {
|
||||
DOM.bip85.addClass('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
function toggleBip85Fields() {
|
||||
if (DOM.showBip85.prop('checked')) {
|
||||
DOM.bip85mnemonicLanguageInput.addClass('hidden');
|
||||
DOM.bip85mnemonicLengthInput.addClass('hidden');
|
||||
DOM.bip85bytesInput.addClass('hidden');
|
||||
|
||||
var app = DOM.bip85application.val();
|
||||
if (app === 'bip39') {
|
||||
DOM.bip85mnemonicLanguageInput.removeClass('hidden');
|
||||
DOM.bip85mnemonicLengthInput.removeClass('hidden');
|
||||
} else if (app === 'hex') {
|
||||
DOM.bip85bytesInput.removeClass('hidden');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function calcBip85() {
|
||||
if (!DOM.showBip85.prop('checked')) {
|
||||
return
|
||||
}
|
||||
|
||||
toggleBip85Fields();
|
||||
|
||||
var app = DOM.bip85application.val();
|
||||
|
||||
var rootKeyBase58 = DOM.rootKey.val();
|
||||
if (!rootKeyBase58) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
// try parsing using base network params
|
||||
// The bip85 lib only understands xpubs, so compute it
|
||||
var rootKey = libs.bitcoin.HDNode.fromBase58(rootKeyBase58, network);
|
||||
rootKey.keyPair.network = libs.bitcoin.networks['bitcoin']
|
||||
var master = libs.bip85.BIP85.fromBase58(rootKey.toBase58());
|
||||
|
||||
var result;
|
||||
|
||||
const index = parseInt(DOM.bip85index.val(), 10);
|
||||
|
||||
if (app === 'bip39') {
|
||||
const language = parseInt(DOM.bip85mnemonicLanguage.val(), 10);
|
||||
const length = parseInt(DOM.bip85mnemonicLength.val(), 10);
|
||||
|
||||
result = master.deriveBIP39(language, length, index).toMnemonic();
|
||||
} else if (app === 'wif') {
|
||||
result = master.deriveWIF(index).toWIF();
|
||||
} else if (app === 'xprv') {
|
||||
result = master.deriveXPRV(index).toXPRV();
|
||||
} else if (app === 'hex') {
|
||||
const bytes = parseInt(DOM.bip85bytes.val(), 10);
|
||||
|
||||
result = master.deriveHex(bytes, index).toEntropy();
|
||||
}
|
||||
|
||||
hideValidationError();
|
||||
DOM.bip85Field.val(result);
|
||||
} catch (e) {
|
||||
showValidationError('BIP85: ' + e.message);
|
||||
DOM.bip85Field.val('');
|
||||
}
|
||||
}
|
||||
|
||||
function calcForDerivationPath() {
|
||||
clearDerivedKeys();
|
||||
clearAddressesList();
|
||||
@@ -1148,7 +1247,7 @@
|
||||
address = libs.ethUtil.addHexPrefix(checksumAddress);
|
||||
pubkey = libs.ethUtil.addHexPrefix(pubkey);
|
||||
if (hasPrivkey) {
|
||||
privkey = libs.ethUtil.bufferToHex(keyPair.d.toBuffer());
|
||||
privkey = libs.ethUtil.bufferToHex(keyPair.d.toBuffer(32));
|
||||
}
|
||||
}
|
||||
//TRX is different
|
||||
@@ -1258,6 +1357,27 @@
|
||||
address = libs.bchaddrSlp.toSlpAddress(address);
|
||||
}
|
||||
}
|
||||
|
||||
// ZooBC address format may vary
|
||||
if (networks[DOM.network.val()].name == "ZBC - ZooBlockchain") {
|
||||
|
||||
var purpose = parseIntNoNaN(DOM.bip44purpose.val(), 44);
|
||||
var coin = parseIntNoNaN(DOM.bip44coin.val(), 0);
|
||||
var path = "m/";
|
||||
path += purpose + "'/";
|
||||
path += coin + "'/" + index + "'";
|
||||
var result = libs.zoobcUtil.getKeypair(path, seed);
|
||||
|
||||
let publicKey = result.pubKey.slice(1, 33);
|
||||
let privateKey = result.key;
|
||||
|
||||
privkey = privateKey.toString('hex');
|
||||
pubkey = publicKey.toString('hex');
|
||||
|
||||
indexText = path;
|
||||
address = libs.zoobcUtil.getZBCAddress(publicKey, 'ZBC');
|
||||
}
|
||||
|
||||
// Segwit addresses are different
|
||||
if (isSegwit) {
|
||||
if (!segwitAvailable) {
|
||||
@@ -1308,7 +1428,41 @@
|
||||
privkey = FIObufferToPrivate(keyPair.d.toBuffer(32));
|
||||
}
|
||||
|
||||
//Groestlcoin Addresses are different
|
||||
if (networks[DOM.network.val()].name == "ATOM - Cosmos Hub") {
|
||||
const hrp = "cosmos";
|
||||
address = CosmosBufferToAddress(keyPair.getPublicKeyBuffer(), hrp);
|
||||
pubkey = CosmosBufferToPublic(keyPair.getPublicKeyBuffer(), hrp);
|
||||
privkey = keyPair.d.toBuffer().toString("base64");
|
||||
}
|
||||
|
||||
if (networks[DOM.network.val()].name == "RUNE - THORChain") {
|
||||
const hrp = "thor";
|
||||
address = CosmosBufferToAddress(keyPair.getPublicKeyBuffer(), hrp);
|
||||
pubkey = keyPair.getPublicKeyBuffer().toString("hex");
|
||||
privkey = keyPair.d.toBuffer().toString("hex");
|
||||
}
|
||||
|
||||
if (networks[DOM.network.val()].name == "XWC - Whitecoin"){
|
||||
address = XWCbufferToAddress(keyPair.getPublicKeyBuffer());
|
||||
pubkey = XWCbufferToPublic(keyPair.getPublicKeyBuffer());
|
||||
privkey = XWCbufferToPrivate(keyPair.d.toBuffer(32));
|
||||
}
|
||||
|
||||
if (networks[DOM.network.val()].name == "LUNA - Terra") {
|
||||
const hrp = "terra";
|
||||
address = CosmosBufferToAddress(keyPair.getPublicKeyBuffer(), hrp);
|
||||
pubkey = keyPair.getPublicKeyBuffer().toString("hex");
|
||||
privkey = keyPair.d.toBuffer().toString("hex");
|
||||
}
|
||||
|
||||
if (networks[DOM.network.val()].name == "IOV - Starname") {
|
||||
const hrp = "star";
|
||||
address = CosmosBufferToAddress(keyPair.getPublicKeyBuffer(), hrp);
|
||||
pubkey = CosmosBufferToPublic(keyPair.getPublicKeyBuffer(), hrp);
|
||||
privkey = keyPair.d.toBuffer().toString("base64");
|
||||
}
|
||||
|
||||
//Groestlcoin Addresses are different
|
||||
if(isGRS()) {
|
||||
|
||||
if (isSegwit) {
|
||||
@@ -2123,6 +2277,13 @@
|
||||
setHdCoin(357);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "ATOM - Cosmos Hub",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.bitcoin;
|
||||
setHdCoin(118);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "AUR - Auroracoin",
|
||||
onSelect: function() {
|
||||
@@ -2265,6 +2426,13 @@
|
||||
setHdCoin(183);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "BTCPt - Bitcoin Private Testnet",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.bitcoinprivatetestnet;
|
||||
setHdCoin(1);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "BSC - Binance Smart Chain",
|
||||
onSelect: function() {
|
||||
@@ -2593,7 +2761,14 @@
|
||||
network = libs.bitcoin.networks.bitcoin;
|
||||
setHdCoin(235);
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "FIRO - Firo (Zcoin rebrand)",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.firo;
|
||||
setHdCoin(136);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "FIX - FIX",
|
||||
onSelect: function() {
|
||||
@@ -2720,6 +2895,13 @@
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "IOV - Starname",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.bitcoin;
|
||||
setHdCoin(234);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "IXC - Ixcoin",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.ixcoin;
|
||||
@@ -2808,6 +2990,13 @@
|
||||
setHdCoin(221);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "LUNA - Terra",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.bitcoin;
|
||||
setHdCoin(330);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "LYNX - Lynx",
|
||||
onSelect: function() {
|
||||
@@ -3121,6 +3310,20 @@
|
||||
setHdCoin(4);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "RITO - Ritocoin",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.ritocoin;
|
||||
setHdCoin(19169);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "RUNE - THORChain",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.bitcoin;
|
||||
setHdCoin(931);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "RVR - RevolutionVR",
|
||||
onSelect: function() {
|
||||
@@ -3430,19 +3633,26 @@
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "XWC - Whitecoin",
|
||||
name: "XWCC - Whitecoin Classic",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.whitecoin;
|
||||
setHdCoin(155);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "XZC - Zcoin",
|
||||
name: "XZC - Zcoin (rebranded to Firo)",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.zcoin;
|
||||
setHdCoin(136);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "ZBC - ZooBlockchain",
|
||||
onSelect: function () {
|
||||
network = libs.bitcoin.networks.zoobc;
|
||||
setHdCoin(883);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "ZCL - Zclassic",
|
||||
onSelect: function() {
|
||||
@@ -3464,6 +3674,13 @@
|
||||
setHdCoin(121);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "XWC - Whitecoin",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.bitcoin;
|
||||
setHdCoin(559);
|
||||
},
|
||||
}
|
||||
]
|
||||
|
||||
var clients = [
|
||||
|
||||
@@ -163,7 +163,7 @@ libs.bitcoin.networks.regtest.p2wshInP2sh = {
|
||||
scriptHash: 0xc4,
|
||||
wif: 0xef
|
||||
};
|
||||
|
||||
|
||||
libs.bitcoin.networks.cranepay.p2wpkhInP2sh = {
|
||||
baseNetwork: "cranepay",
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
|
||||
197
src/js/wordlist_portuguese.js
Normal file
197
src/js/wordlist_portuguese.js
Normal file
@@ -0,0 +1,197 @@
|
||||
WORDLISTS = typeof
|
||||
WORDLISTS == "undefined" ? {}: WORDLISTS;
|
||||
WORDLISTS["portuguese"] = [
|
||||
"abacate", "abaixo", "abalar", "abater", "abduzir", "abelha", "aberto", "abismo", "abotoar", "abranger", "abreviar",
|
||||
"abrigar", "abrupto", "absinto", "absoluto", "absurdo", "abutre", "acabado", "acalmar", "acampar", "acanhar",
|
||||
"acaso", "aceitar", "acelerar", "acenar", "acervo", "acessar", "acetona", "achatar", "acidez", "acima", "acionado",
|
||||
"acirrar", "aclamar", "aclive", "acolhida", "acomodar", "acoplar", "acordar", "acumular", "acusador", "adaptar",
|
||||
"adega", "adentro", "adepto", "adequar", "aderente", "adesivo", "adeus", "adiante", "aditivo", "adjetivo",
|
||||
"adjunto", "admirar", "adorar", "adquirir", "adubo", "adverso", "advogado", "aeronave", "afastar", "aferir",
|
||||
"afetivo", "afinador", "afivelar", "aflito", "afluente", "afrontar", "agachar", "agarrar", "agasalho", "agenciar",
|
||||
"agilizar", "agiota", "agitado", "agora", "agradar", "agreste", "agrupar", "aguardar", "agulha", "ajoelhar",
|
||||
"ajudar", "ajustar", "alameda", "alarme", "alastrar", "alavanca", "albergue", "albino", "alcatra", "aldeia",
|
||||
"alecrim", "alegria", "alertar", "alface", "alfinete", "algum", "alheio", "aliar", "alicate", "alienar", "alinhar",
|
||||
"aliviar", "almofada", "alocar", "alpiste", "alterar", "altitude", "alucinar", "alugar", "aluno", "alusivo", "alvo",
|
||||
"amaciar", "amador", "amarelo", "amassar", "ambas", "ambiente", "ameixa", "amenizar", "amido", "amistoso",
|
||||
"amizade", "amolador", "amontoar", "amoroso", "amostra", "amparar", "ampliar", "ampola", "anagrama", "analisar",
|
||||
"anarquia", "anatomia", "andaime", "anel", "anexo", "angular", "animar", "anjo", "anomalia", "anotado", "ansioso",
|
||||
"anterior", "anuidade", "anunciar", "anzol", "apagador", "apalpar", "apanhado", "apego", "apelido", "apertada",
|
||||
"apesar", "apetite", "apito", "aplauso", "aplicada", "apoio", "apontar", "aposta", "aprendiz", "aprovar", "aquecer",
|
||||
"arame", "aranha", "arara", "arcada", "ardente", "areia", "arejar", "arenito", "aresta", "argiloso", "argola",
|
||||
"arma", "arquivo", "arraial", "arrebate", "arriscar", "arroba", "arrumar", "arsenal", "arterial", "artigo",
|
||||
"arvoredo", "asfaltar", "asilado", "aspirar", "assador", "assinar", "assoalho", "assunto", "astral", "atacado",
|
||||
"atadura", "atalho", "atarefar", "atear", "atender", "aterro", "ateu", "atingir", "atirador", "ativo", "atoleiro",
|
||||
"atracar", "atrevido", "atriz", "atual", "atum", "auditor", "aumentar", "aura", "aurora", "autismo", "autoria",
|
||||
"autuar", "avaliar", "avante", "avaria", "avental", "avesso", "aviador", "avisar", "avulso", "axila", "azarar",
|
||||
"azedo", "azeite", "azulejo", "babar", "babosa", "bacalhau", "bacharel", "bacia", "bagagem", "baiano", "bailar",
|
||||
"baioneta", "bairro", "baixista", "bajular", "baleia", "baliza", "balsa", "banal", "bandeira", "banho", "banir",
|
||||
"banquete", "barato", "barbado", "baronesa", "barraca", "barulho", "baseado", "bastante", "batata", "batedor",
|
||||
"batida", "batom", "batucar", "baunilha", "beber", "beijo", "beirada", "beisebol", "beldade", "beleza", "belga",
|
||||
"beliscar", "bendito", "bengala", "benzer", "berimbau", "berlinda", "berro", "besouro", "bexiga", "bezerro", "bico",
|
||||
"bicudo", "bienal", "bifocal", "bifurcar", "bigorna", "bilhete", "bimestre", "bimotor", "biologia", "biombo",
|
||||
"biosfera", "bipolar", "birrento", "biscoito", "bisneto", "bispo", "bissexto", "bitola", "bizarro", "blindado",
|
||||
"bloco", "bloquear", "boato", "bobagem", "bocado", "bocejo", "bochecha", "boicotar", "bolada", "boletim", "bolha",
|
||||
"bolo", "bombeiro", "bonde", "boneco", "bonita", "borbulha", "borda", "boreal", "borracha", "bovino", "boxeador",
|
||||
"branco", "brasa", "braveza", "breu", "briga", "brilho", "brincar", "broa", "brochura", "bronzear", "broto",
|
||||
"bruxo", "bucha", "budismo", "bufar", "bule", "buraco", "busca", "busto", "buzina", "cabana", "cabelo", "cabide",
|
||||
"cabo", "cabrito", "cacau", "cacetada", "cachorro", "cacique", "cadastro", "cadeado", "cafezal", "caiaque",
|
||||
"caipira", "caixote", "cajado", "caju", "calafrio", "calcular", "caldeira", "calibrar", "calmante", "calota",
|
||||
"camada", "cambista", "camisa", "camomila", "campanha", "camuflar", "canavial", "cancelar", "caneta", "canguru",
|
||||
"canhoto", "canivete", "canoa", "cansado", "cantar", "canudo", "capacho", "capela", "capinar", "capotar",
|
||||
"capricho", "captador", "capuz", "caracol", "carbono", "cardeal", "careca", "carimbar", "carneiro", "carpete",
|
||||
"carreira", "cartaz", "carvalho", "casaco", "casca", "casebre", "castelo", "casulo", "catarata", "cativar", "caule",
|
||||
"causador", "cautelar", "cavalo", "caverna", "cebola", "cedilha", "cegonha", "celebrar", "celular", "cenoura",
|
||||
"censo", "centeio", "cercar", "cerrado", "certeiro", "cerveja", "cetim", "cevada", "chacota", "chaleira", "chamado",
|
||||
"chapada", "charme", "chatice", "chave", "chefe", "chegada", "cheiro", "cheque", "chicote", "chifre", "chinelo",
|
||||
"chocalho", "chover", "chumbo", "chutar", "chuva", "cicatriz", "ciclone", "cidade", "cidreira", "ciente", "cigana",
|
||||
"cimento", "cinto", "cinza", "ciranda", "circuito", "cirurgia", "citar", "clareza", "clero", "clicar", "clone",
|
||||
"clube", "coado", "coagir", "cobaia", "cobertor", "cobrar", "cocada", "coelho", "coentro", "coeso", "cogumelo",
|
||||
"coibir", "coifa", "coiote", "colar", "coleira", "colher", "colidir", "colmeia", "colono", "coluna", "comando",
|
||||
"combinar", "comentar", "comitiva", "comover", "complexo", "comum", "concha", "condor", "conectar", "confuso",
|
||||
"congelar", "conhecer", "conjugar", "consumir", "contrato", "convite", "cooperar", "copeiro", "copiador", "copo",
|
||||
"coquetel", "coragem", "cordial", "corneta", "coronha", "corporal", "correio", "cortejo", "coruja", "corvo",
|
||||
"cosseno", "costela", "cotonete", "couro", "couve", "covil", "cozinha", "cratera", "cravo", "creche", "credor",
|
||||
"creme", "crer", "crespo", "criada", "criminal", "crioulo", "crise", "criticar", "crosta", "crua", "cruzeiro",
|
||||
"cubano", "cueca", "cuidado", "cujo", "culatra", "culminar", "culpar", "cultura", "cumprir", "cunhado", "cupido",
|
||||
"curativo", "curral", "cursar", "curto", "cuspir", "custear", "cutelo", "damasco", "datar", "debater", "debitar",
|
||||
"deboche", "debulhar", "decalque", "decimal", "declive", "decote", "decretar", "dedal", "dedicado", "deduzir",
|
||||
"defesa", "defumar", "degelo", "degrau", "degustar", "deitado", "deixar", "delator", "delegado", "delinear",
|
||||
"delonga", "demanda", "demitir", "demolido", "dentista", "depenado", "depilar", "depois", "depressa", "depurar",
|
||||
"deriva", "derramar", "desafio", "desbotar", "descanso", "desenho", "desfiado", "desgaste", "desigual", "deslize",
|
||||
"desmamar", "desova", "despesa", "destaque", "desviar", "detalhar", "detentor", "detonar", "detrito", "deusa",
|
||||
"dever", "devido", "devotado", "dezena", "diagrama", "dialeto", "didata", "difuso", "digitar", "dilatado",
|
||||
"diluente", "diminuir", "dinastia", "dinheiro", "diocese", "direto", "discreta", "disfarce", "disparo", "disquete",
|
||||
"dissipar", "distante", "ditador", "diurno", "diverso", "divisor", "divulgar", "dizer", "dobrador", "dolorido",
|
||||
"domador", "dominado", "donativo", "donzela", "dormente", "dorsal", "dosagem", "dourado", "doutor", "drenagem",
|
||||
"drible", "drogaria", "duelar", "duende", "dueto", "duplo", "duquesa", "durante", "duvidoso", "eclodir", "ecoar",
|
||||
"ecologia", "edificar", "edital", "educado", "efeito", "efetivar", "ejetar", "elaborar", "eleger", "eleitor",
|
||||
"elenco", "elevador", "eliminar", "elogiar", "embargo", "embolado", "embrulho", "embutido", "emenda", "emergir",
|
||||
"emissor", "empatia", "empenho", "empinado", "empolgar", "emprego", "empurrar", "emulador", "encaixe", "encenado",
|
||||
"enchente", "encontro", "endeusar", "endossar", "enfaixar", "enfeite", "enfim", "engajado", "engenho", "englobar",
|
||||
"engomado", "engraxar", "enguia", "enjoar", "enlatar", "enquanto", "enraizar", "enrolado", "enrugar", "ensaio",
|
||||
"enseada", "ensino", "ensopado", "entanto", "enteado", "entidade", "entortar", "entrada", "entulho", "envergar",
|
||||
"enviado", "envolver", "enxame", "enxerto", "enxofre", "enxuto", "epiderme", "equipar", "ereto", "erguido",
|
||||
"errata", "erva", "ervilha", "esbanjar", "esbelto", "escama", "escola", "escrita", "escuta", "esfinge", "esfolar",
|
||||
"esfregar", "esfumado", "esgrima", "esmalte", "espanto", "espelho", "espiga", "esponja", "espreita", "espumar",
|
||||
"esquerda", "estaca", "esteira", "esticar", "estofado", "estrela", "estudo", "esvaziar", "etanol", "etiqueta",
|
||||
"euforia", "europeu", "evacuar", "evaporar", "evasivo", "eventual", "evidente", "evoluir", "exagero", "exalar",
|
||||
"examinar", "exato", "exausto", "excesso", "excitar", "exclamar", "executar", "exemplo", "exibir", "exigente",
|
||||
"exonerar", "expandir", "expelir", "expirar", "explanar", "exposto", "expresso", "expulsar", "externo", "extinto",
|
||||
"extrato", "fabricar", "fabuloso", "faceta", "facial", "fada", "fadiga", "faixa", "falar", "falta", "familiar",
|
||||
"fandango", "fanfarra", "fantoche", "fardado", "farelo", "farinha", "farofa", "farpa", "fartura", "fatia", "fator",
|
||||
"favorita", "faxina", "fazenda", "fechado", "feijoada", "feirante", "felino", "feminino", "fenda", "feno", "fera",
|
||||
"feriado", "ferrugem", "ferver", "festejar", "fetal", "feudal", "fiapo", "fibrose", "ficar", "ficheiro", "figurado",
|
||||
"fileira", "filho", "filme", "filtrar", "firmeza", "fisgada", "fissura", "fita", "fivela", "fixador", "fixo",
|
||||
"flacidez", "flamingo", "flanela", "flechada", "flora", "flutuar", "fluxo", "focal", "focinho", "fofocar", "fogo",
|
||||
"foguete", "foice", "folgado", "folheto", "forjar", "formiga", "forno", "forte", "fosco", "fossa", "fragata",
|
||||
"fralda", "frango", "frasco", "fraterno", "freira", "frente", "fretar", "frieza", "friso", "fritura", "fronha",
|
||||
"frustrar", "fruteira", "fugir", "fulano", "fuligem", "fundar", "fungo", "funil", "furador", "furioso", "futebol",
|
||||
"gabarito", "gabinete", "gado", "gaiato", "gaiola", "gaivota", "galega", "galho", "galinha", "galocha", "ganhar",
|
||||
"garagem", "garfo", "gargalo", "garimpo", "garoupa", "garrafa", "gasoduto", "gasto", "gata", "gatilho", "gaveta",
|
||||
"gazela", "gelado", "geleia", "gelo", "gemada", "gemer", "gemido", "generoso", "gengiva", "genial", "genoma",
|
||||
"genro", "geologia", "gerador", "germinar", "gesso", "gestor", "ginasta", "gincana", "gingado", "girafa", "girino",
|
||||
"glacial", "glicose", "global", "glorioso", "goela", "goiaba", "golfe", "golpear", "gordura", "gorjeta", "gorro",
|
||||
"gostoso", "goteira", "governar", "gracejo", "gradual", "grafite", "gralha", "grampo", "granada", "gratuito",
|
||||
"graveto", "graxa", "grego", "grelhar", "greve", "grilo", "grisalho", "gritaria", "grosso", "grotesco", "grudado",
|
||||
"grunhido", "gruta", "guache", "guarani", "guaxinim", "guerrear", "guiar", "guincho", "guisado", "gula", "guloso",
|
||||
"guru", "habitar", "harmonia", "haste", "haver", "hectare", "herdar", "heresia", "hesitar", "hiato", "hibernar",
|
||||
"hidratar", "hiena", "hino", "hipismo", "hipnose", "hipoteca", "hoje", "holofote", "homem", "honesto", "honrado",
|
||||
"hormonal", "hospedar", "humorado", "iate", "ideia", "idoso", "ignorado", "igreja", "iguana", "ileso", "ilha",
|
||||
"iludido", "iluminar", "ilustrar", "imagem", "imediato", "imenso", "imersivo", "iminente", "imitador", "imortal",
|
||||
"impacto", "impedir", "implante", "impor", "imprensa", "impune", "imunizar", "inalador", "inapto", "inativo",
|
||||
"incenso", "inchar", "incidir", "incluir", "incolor", "indeciso", "indireto", "indutor", "ineficaz", "inerente",
|
||||
"infantil", "infestar", "infinito", "inflamar", "informal", "infrator", "ingerir", "inibido", "inicial", "inimigo",
|
||||
"injetar", "inocente", "inodoro", "inovador", "inox", "inquieto", "inscrito", "inseto", "insistir", "inspetor",
|
||||
"instalar", "insulto", "intacto", "integral", "intimar", "intocado", "intriga", "invasor", "inverno", "invicto",
|
||||
"invocar", "iogurte", "iraniano", "ironizar", "irreal", "irritado", "isca", "isento", "isolado", "isqueiro",
|
||||
"italiano", "janeiro", "jangada", "janta", "jararaca", "jardim", "jarro", "jasmim", "jato", "javali", "jazida",
|
||||
"jejum", "joaninha", "joelhada", "jogador", "joia", "jornal", "jorrar", "jovem", "juba", "judeu", "judoca", "juiz",
|
||||
"julgador", "julho", "jurado", "jurista", "juro", "justa", "labareda", "laboral", "lacre", "lactante", "ladrilho",
|
||||
"lagarta", "lagoa", "laje", "lamber", "lamentar", "laminar", "lampejo", "lanche", "lapidar", "lapso", "laranja",
|
||||
"lareira", "largura", "lasanha", "lastro", "lateral", "latido", "lavanda", "lavoura", "lavrador", "laxante",
|
||||
"lazer", "lealdade", "lebre", "legado", "legendar", "legista", "leigo", "leiloar", "leitura", "lembrete", "leme",
|
||||
"lenhador", "lentilha", "leoa", "lesma", "leste", "letivo", "letreiro", "levar", "leveza", "levitar", "liberal",
|
||||
"libido", "liderar", "ligar", "ligeiro", "limitar", "limoeiro", "limpador", "linda", "linear", "linhagem",
|
||||
"liquidez", "listagem", "lisura", "litoral", "livro", "lixa", "lixeira", "locador", "locutor", "lojista", "lombo",
|
||||
"lona", "longe", "lontra", "lorde", "lotado", "loteria", "loucura", "lousa", "louvar", "luar", "lucidez", "lucro",
|
||||
"luneta", "lustre", "lutador", "luva", "macaco", "macete", "machado", "macio", "madeira", "madrinha", "magnata",
|
||||
"magreza", "maior", "mais", "malandro", "malha", "malote", "maluco", "mamilo", "mamoeiro", "mamute", "manada",
|
||||
"mancha", "mandato", "manequim", "manhoso", "manivela", "manobrar", "mansa", "manter", "manusear", "mapeado",
|
||||
"maquinar", "marcador", "maresia", "marfim", "margem", "marinho", "marmita", "maroto", "marquise", "marreco",
|
||||
"martelo", "marujo", "mascote", "masmorra", "massagem", "mastigar", "matagal", "materno", "matinal", "matutar",
|
||||
"maxilar", "medalha", "medida", "medusa", "megafone", "meiga", "melancia", "melhor", "membro", "memorial", "menino",
|
||||
"menos", "mensagem", "mental", "merecer", "mergulho", "mesada", "mesclar", "mesmo", "mesquita", "mestre", "metade",
|
||||
"meteoro", "metragem", "mexer", "mexicano", "micro", "migalha", "migrar", "milagre", "milenar", "milhar", "mimado",
|
||||
"minerar", "minhoca", "ministro", "minoria", "miolo", "mirante", "mirtilo", "misturar", "mocidade", "moderno",
|
||||
"modular", "moeda", "moer", "moinho", "moita", "moldura", "moleza", "molho", "molinete", "molusco", "montanha",
|
||||
"moqueca", "morango", "morcego", "mordomo", "morena", "mosaico", "mosquete", "mostarda", "motel", "motim", "moto",
|
||||
"motriz", "muda", "muito", "mulata", "mulher", "multar", "mundial", "munido", "muralha", "murcho", "muscular",
|
||||
"museu", "musical", "nacional", "nadador", "naja", "namoro", "narina", "narrado", "nascer", "nativa", "natureza",
|
||||
"navalha", "navegar", "navio", "neblina", "nebuloso", "negativa", "negociar", "negrito", "nervoso", "neta",
|
||||
"neural", "nevasca", "nevoeiro", "ninar", "ninho", "nitidez", "nivelar", "nobreza", "noite", "noiva", "nomear",
|
||||
"nominal", "nordeste", "nortear", "notar", "noticiar", "noturno", "novelo", "novilho", "novo", "nublado", "nudez",
|
||||
"numeral", "nupcial", "nutrir", "nuvem", "obcecado", "obedecer", "objetivo", "obrigado", "obscuro", "obstetra",
|
||||
"obter", "obturar", "ocidente", "ocioso", "ocorrer", "oculista", "ocupado", "ofegante", "ofensiva", "oferenda",
|
||||
"oficina", "ofuscado", "ogiva", "olaria", "oleoso", "olhar", "oliveira", "ombro", "omelete", "omisso", "omitir",
|
||||
"ondulado", "oneroso", "ontem", "opcional", "operador", "oponente", "oportuno", "oposto", "orar", "orbitar",
|
||||
"ordem", "ordinal", "orfanato", "orgasmo", "orgulho", "oriental", "origem", "oriundo", "orla", "ortodoxo",
|
||||
"orvalho", "oscilar", "ossada", "osso", "ostentar", "otimismo", "ousadia", "outono", "outubro", "ouvido", "ovelha",
|
||||
"ovular", "oxidar", "oxigenar", "pacato", "paciente", "pacote", "pactuar", "padaria", "padrinho", "pagar", "pagode",
|
||||
"painel", "pairar", "paisagem", "palavra", "palestra", "palheta", "palito", "palmada", "palpitar", "pancada",
|
||||
"panela", "panfleto", "panqueca", "pantanal", "papagaio", "papelada", "papiro", "parafina", "parcial", "pardal",
|
||||
"parede", "partida", "pasmo", "passado", "pastel", "patamar", "patente", "patinar", "patrono", "paulada", "pausar",
|
||||
"peculiar", "pedalar", "pedestre", "pediatra", "pedra", "pegada", "peitoral", "peixe", "pele", "pelicano", "penca",
|
||||
"pendurar", "peneira", "penhasco", "pensador", "pente", "perceber", "perfeito", "pergunta", "perito", "permitir",
|
||||
"perna", "perplexo", "persiana", "pertence", "peruca", "pescado", "pesquisa", "pessoa", "petiscar", "piada",
|
||||
"picado", "piedade", "pigmento", "pilastra", "pilhado", "pilotar", "pimenta", "pincel", "pinguim", "pinha",
|
||||
"pinote", "pintar", "pioneiro", "pipoca", "piquete", "piranha", "pires", "pirueta", "piscar", "pistola", "pitanga",
|
||||
"pivete", "planta", "plaqueta", "platina", "plebeu", "plumagem", "pluvial", "pneu", "poda", "poeira", "poetisa",
|
||||
"polegada", "policiar", "poluente", "polvilho", "pomar", "pomba", "ponderar", "pontaria", "populoso", "porta",
|
||||
"possuir", "postal", "pote", "poupar", "pouso", "povoar", "praia", "prancha", "prato", "praxe", "prece", "predador",
|
||||
"prefeito", "premiar", "prensar", "preparar", "presilha", "pretexto", "prevenir", "prezar", "primata", "princesa",
|
||||
"prisma", "privado", "processo", "produto", "profeta", "proibido", "projeto", "prometer", "propagar", "prosa",
|
||||
"protetor", "provador", "publicar", "pudim", "pular", "pulmonar", "pulseira", "punhal", "punir", "pupilo", "pureza",
|
||||
"puxador", "quadra", "quantia", "quarto", "quase", "quebrar", "queda", "queijo", "quente", "querido", "quimono",
|
||||
"quina", "quiosque", "rabanada", "rabisco", "rachar", "racionar", "radial", "raiar", "rainha", "raio", "raiva",
|
||||
"rajada", "ralado", "ramal", "ranger", "ranhura", "rapadura", "rapel", "rapidez", "raposa", "raquete", "raridade",
|
||||
"rasante", "rascunho", "rasgar", "raspador", "rasteira", "rasurar", "ratazana", "ratoeira", "realeza", "reanimar",
|
||||
"reaver", "rebaixar", "rebelde", "rebolar", "recado", "recente", "recheio", "recibo", "recordar", "recrutar",
|
||||
"recuar", "rede", "redimir", "redonda", "reduzida", "reenvio", "refinar", "refletir", "refogar", "refresco",
|
||||
"refugiar", "regalia", "regime", "regra", "reinado", "reitor", "rejeitar", "relativo", "remador", "remendo",
|
||||
"remorso", "renovado", "reparo", "repelir", "repleto", "repolho", "represa", "repudiar", "requerer", "resenha",
|
||||
"resfriar", "resgatar", "residir", "resolver", "respeito", "ressaca", "restante", "resumir", "retalho", "reter",
|
||||
"retirar", "retomada", "retratar", "revelar", "revisor", "revolta", "riacho", "rica", "rigidez", "rigoroso",
|
||||
"rimar", "ringue", "risada", "risco", "risonho", "robalo", "rochedo", "rodada", "rodeio", "rodovia", "roedor",
|
||||
"roleta", "romano", "roncar", "rosado", "roseira", "rosto", "rota", "roteiro", "rotina", "rotular", "rouco",
|
||||
"roupa", "roxo", "rubro", "rugido", "rugoso", "ruivo", "rumo", "rupestre", "russo", "sabor", "saciar", "sacola",
|
||||
"sacudir", "sadio", "safira", "saga", "sagrada", "saibro", "salada", "saleiro", "salgado", "saliva", "salpicar",
|
||||
"salsicha", "saltar", "salvador", "sambar", "samurai", "sanar", "sanfona", "sangue", "sanidade", "sapato", "sarda",
|
||||
"sargento", "sarjeta", "saturar", "saudade", "saxofone", "sazonal", "secar", "secular", "seda", "sedento",
|
||||
"sediado", "sedoso", "sedutor", "segmento", "segredo", "segundo", "seiva", "seleto", "selvagem", "semanal",
|
||||
"semente", "senador", "senhor", "sensual", "sentado", "separado", "sereia", "seringa", "serra", "servo", "setembro",
|
||||
"setor", "sigilo", "silhueta", "silicone", "simetria", "simpatia", "simular", "sinal", "sincero", "singular",
|
||||
"sinopse", "sintonia", "sirene", "siri", "situado", "soberano", "sobra", "socorro", "sogro", "soja", "solda",
|
||||
"soletrar", "solteiro", "sombrio", "sonata", "sondar", "sonegar", "sonhador", "sono", "soprano", "soquete",
|
||||
"sorrir", "sorteio", "sossego", "sotaque", "soterrar", "sovado", "sozinho", "suavizar", "subida", "submerso",
|
||||
"subsolo", "subtrair", "sucata", "sucesso", "suco", "sudeste", "sufixo", "sugador", "sugerir", "sujeito", "sulfato",
|
||||
"sumir", "suor", "superior", "suplicar", "suposto", "suprimir", "surdina", "surfista", "surpresa", "surreal",
|
||||
"surtir", "suspiro", "sustento", "tabela", "tablete", "tabuada", "tacho", "tagarela", "talher", "talo", "talvez",
|
||||
"tamanho", "tamborim", "tampa", "tangente", "tanto", "tapar", "tapioca", "tardio", "tarefa", "tarja", "tarraxa",
|
||||
"tatuagem", "taurino", "taxativo", "taxista", "teatral", "tecer", "tecido", "teclado", "tedioso", "teia", "teimar",
|
||||
"telefone", "telhado", "tempero", "tenente", "tensor", "tentar", "termal", "terno", "terreno", "tese", "tesoura",
|
||||
"testado", "teto", "textura", "texugo", "tiara", "tigela", "tijolo", "timbrar", "timidez", "tingido", "tinteiro",
|
||||
"tiragem", "titular", "toalha", "tocha", "tolerar", "tolice", "tomada", "tomilho", "tonel", "tontura", "topete",
|
||||
"tora", "torcido", "torneio", "torque", "torrada", "torto", "tostar", "touca", "toupeira", "toxina", "trabalho",
|
||||
"tracejar", "tradutor", "trafegar", "trajeto", "trama", "trancar", "trapo", "traseiro", "tratador", "travar",
|
||||
"treino", "tremer", "trepidar", "trevo", "triagem", "tribo", "triciclo", "tridente", "trilogia", "trindade",
|
||||
"triplo", "triturar", "triunfal", "trocar", "trombeta", "trova", "trunfo", "truque", "tubular", "tucano", "tudo",
|
||||
"tulipa", "tupi", "turbo", "turma", "turquesa", "tutelar", "tutorial", "uivar", "umbigo", "unha", "unidade",
|
||||
"uniforme", "urologia", "urso", "urtiga", "urubu", "usado", "usina", "usufruir", "vacina", "vadiar", "vagaroso",
|
||||
"vaidoso", "vala", "valente", "validade", "valores", "vantagem", "vaqueiro", "varanda", "vareta", "varrer",
|
||||
"vascular", "vasilha", "vassoura", "vazar", "vazio", "veado", "vedar", "vegetar", "veicular", "veleiro", "velhice",
|
||||
"veludo", "vencedor", "vendaval", "venerar", "ventre", "verbal", "verdade", "vereador", "vergonha", "vermelho",
|
||||
"verniz", "versar", "vertente", "vespa", "vestido", "vetorial", "viaduto", "viagem", "viajar", "viatura",
|
||||
"vibrador", "videira", "vidraria", "viela", "viga", "vigente", "vigiar", "vigorar", "vilarejo", "vinco", "vinheta",
|
||||
"vinil", "violeta", "virada", "virtude", "visitar", "visto", "vitral", "viveiro", "vizinho", "voador", "voar",
|
||||
"vogal", "volante", "voleibol", "voltagem", "volumoso", "vontade", "vulto", "vuvuzela", "xadrez", "xarope", "xeque",
|
||||
"xeretar", "xerife", "xingar", "zangado", "zarpar", "zebu", "zelador", "zombar", "zoologia", "zumbido"]
|
||||
28
src/js/xwc-util.js
Normal file
28
src/js/xwc-util.js
Normal file
@@ -0,0 +1,28 @@
|
||||
function XWCbufferToAddress(pubBuf){
|
||||
const Buffer = libs.buffer.Buffer;
|
||||
const XWC_ADDRESS_PREFIX = "XWC";
|
||||
const XWC_NORMAL_ADDRESS_VERSION = "35"
|
||||
let addrData = libs.createHash("rmd160").update( libs.createHash("sha512").update(pubBuf).digest()).digest();
|
||||
let addrBuf = Buffer.concat([Buffer.from(XWC_NORMAL_ADDRESS_VERSION, "hex") ,addrData])
|
||||
let checksum = libs.createHash("rmd160").update(addrBuf).digest("hex").slice(0, 8);
|
||||
addrBuf = Buffer.concat([addrBuf, Buffer.from(checksum, "hex")]);
|
||||
return XWC_ADDRESS_PREFIX.concat(libs.bs58.encode(addrBuf));
|
||||
}
|
||||
|
||||
function XWCbufferToPublic(pubBuf) {
|
||||
const Buffer = libs.buffer.Buffer;
|
||||
const XWC_PUBLIC_PREFIX = "XWC";
|
||||
let checksum = libs.createHash("rmd160").update(pubBuf).digest("hex").slice(0, 8);
|
||||
pubBuf = Buffer.concat([pubBuf, Buffer.from(checksum, "hex")]);
|
||||
return XWC_PUBLIC_PREFIX.concat(libs.bs58.encode(pubBuf));
|
||||
}
|
||||
|
||||
function XWCbufferToPrivate(privBuf) {
|
||||
const Buffer = libs.buffer.Buffer;
|
||||
const XWC_PRIVATE_PREFIX = "80";
|
||||
privBuf = Buffer.concat([Buffer.from(XWC_PRIVATE_PREFIX, "hex"), privBuf]);
|
||||
let tmp = libs.createHash("sha256").update(privBuf).digest();
|
||||
let checksum = libs.createHash("sha256").update(tmp).digest("hex").slice(0, 8);
|
||||
privBuf = Buffer.concat([privBuf, Buffer.from(checksum, "hex")]);
|
||||
return libs.bs58.encode(privBuf);
|
||||
}
|
||||
@@ -168,6 +168,17 @@ function selectNetwork(name) {
|
||||
}, name);
|
||||
}
|
||||
|
||||
function selectBip85Language(language) {
|
||||
driver.executeScript(function() {
|
||||
var selectText = arguments[0];
|
||||
$(".bip85-mnemonic-language option[selected]").removeAttr("selected");
|
||||
$(".bip85-mnemonic-language option").filter(function(i,e) {
|
||||
return $(e).html() == selectText;
|
||||
}).prop("selected", true);
|
||||
$(".bip85-mnemonic-language").trigger("change");
|
||||
}, language);
|
||||
}
|
||||
|
||||
function testEntropyType(done, entropyText, entropyTypeUnsafe) {
|
||||
// entropy type is compiled into regexp so needs escaping
|
||||
// see https://stackoverflow.com/a/2593661
|
||||
@@ -640,7 +651,7 @@ it('Allows selection of namecoin', function(done) {
|
||||
phrase: "abandon abandon ability",
|
||||
firstAddress: "Mw2vK2Bvex1yYtYF6sfbEg2YGoUc98YUD2",
|
||||
firstPubKey: "0398066486fe87cbcb9da8e29d180b44937b6c43ad1ec4d3bddd77b7905765937e",
|
||||
firstPrivKey: "L4A8sSkrGndiXyZdj6Fnju8Wu76s96cdHHmPxV3C5M2R2w4GVNco",
|
||||
firstPrivKey: "TkJvbqVdNnGsCtFaV2nE8x3qqhYnYriRkGAB4747cEDRg9VUKKiz",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
@@ -906,6 +917,26 @@ it('Allows selection of Aryacoin', function(done) {
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Cosmos Hub', function(done) {
|
||||
var params = {
|
||||
selectText: "ATOM - Cosmos Hub",
|
||||
phrase: "abandon abandon ability",
|
||||
firstAddress: "cosmos17mkch9syem8gtf6wh7p38thdgav6dwezpkylny",
|
||||
firstPubKey: "cosmospub1addwnpepq0sgn66ty4suk5vx3hsmxxqd5z3amegqwlu59funrzyz5u8r9758qhl84ys",
|
||||
firstPrivKey: "zUnETPxmE2vkHzLHTAlO9wg8PL/GEEBc1I4yVwvSV8M=",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Terra', function(done) {
|
||||
var params = {
|
||||
selectText: "LUNA - Terra",
|
||||
phrase: "abandon abandon ability",
|
||||
firstAddress: "terra1txr4jwel3vjl64vrc08pljnjryqkhtffmyp265",
|
||||
firstPubKey: "028e7658e3debb2d9d458919bfba0e85b0220e845f7552176f30a52acd0f809d71",
|
||||
firstPrivKey: "d611b211e370aa1edd9743acd6ce537d16fade85d7ae7e88b32f3a0483f52535",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Auroracoin', function(done) {
|
||||
var params = {
|
||||
selectText: "AUR - Auroracoin",
|
||||
@@ -966,6 +997,16 @@ it('Allows selection of Bitcoin Private', function(done) {
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Bitcoin Private testnet', function(done) {
|
||||
var params = {
|
||||
selectText: "BTCPt - Bitcoin Private Testnet",
|
||||
phrase: "abandon abandon ability",
|
||||
firstAddress: "n1UcUUSDfDppfzh7XLJNHmZkLdbTQg3VAZL",
|
||||
firstPubKey: "0382a5450765e2025bdb5f7d109c9254a11ef97a566228bf171d80ecb348763bb0",
|
||||
firstPrivKey: "cV3coiYD2NhHKfhC6Gb8DzpvPzcGYYExYxuNxpUtKq3VUJrkFLZx",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Bitcoin SV', function(done) {
|
||||
var params = {
|
||||
selectText: "BSV - BitcoinSV",
|
||||
@@ -1214,6 +1255,26 @@ it('Allows selection of FIO', function(done) {
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Firo', function(done) {
|
||||
var params = {
|
||||
selectText: "FIRO - Firo (Zcoin rebrand)",
|
||||
phrase: "abandon abandon ability",
|
||||
firstAddress: "a6VcMdP4XgAA9Tr7xNszmPG5FZpfRf17Cq",
|
||||
firstPubKey: "0236f2348c32dc62d69488b01988ed1154df261723ec60461cb6e62189984c62db",
|
||||
firstPrivKey: "Y8k3XQRQrJoABEao4Sw45s744g6xth7yviNqFcN7zqPqKUJrrKTQ",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Zcoin', function(done) {
|
||||
var params = {
|
||||
selectText: "XZC - Zcoin (rebranded to Firo)",
|
||||
phrase: "abandon abandon ability",
|
||||
firstAddress: "a6VcMdP4XgAA9Tr7xNszmPG5FZpfRf17Cq",
|
||||
firstPubKey: "0236f2348c32dc62d69488b01988ed1154df261723ec60461cb6e62189984c62db",
|
||||
firstPrivKey: "Y8k3XQRQrJoABEao4Sw45s744g6xth7yviNqFcN7zqPqKUJrrKTQ",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Firstcoin', function(done) {
|
||||
var params = {
|
||||
selectText: "FRST - Firstcoin",
|
||||
@@ -1314,6 +1375,16 @@ it('Allows selection of Iop', function(done) {
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Starname', function(done) {
|
||||
var params = {
|
||||
selectText: "IOV - Starname",
|
||||
phrase: "abandon abandon ability",
|
||||
firstAddress: "star1xgfvgq40r7ff8ylw9l95dw56xnr0pvtjnlp7h4",
|
||||
firstPubKey: "starpub1addwnpepqg9x5cft48hcgx25vyzeyygntl7pt763datr6v50hrecafyane54xlqdxkd",
|
||||
firstPrivKey: "bGI4BNRvMYT1lbCOoH000HvNFPkyXms9n3Xp1X/7E80=",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Ixcoin', function(done) {
|
||||
var params = {
|
||||
selectText: "IXC - Ixcoin",
|
||||
@@ -1604,6 +1675,16 @@ it('Allows selection of RevolutionVR', function(done) {
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Ritocoin', function(done) {
|
||||
var params = {
|
||||
selectText: "RITO - Ritocoin",
|
||||
phrase: "abandon abandon ability",
|
||||
firstAddress: "BMbHdwDiuaZh4ATp8Xapf4srv3swzAGgkf",
|
||||
firstPubKey: "036f5f55dc37fa97294a2a5ae4d92735d4392d4405cbbebebf2d70d5d6781be622",
|
||||
firstPrivKey: "Mdaumz3494kxCeiEBame4ZBzjtTQ5mYzD8notv2EBW8FcNy3PiYd",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Rubycoin', function(done) {
|
||||
var params = {
|
||||
selectText: "RBY - Rubycoin",
|
||||
@@ -1614,6 +1695,16 @@ it('Allows selection of Rubycoin', function(done) {
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of THORChain', function(done) {
|
||||
var params = {
|
||||
selectText: "RUNE - THORChain",
|
||||
phrase: "flip vicious divorce angle toward say derive blue refuse load word creek once expire bounce",
|
||||
firstAddress: "thor1zp3yx758t64vqvu8776vnwd0udrs2vwuxhc4ep",
|
||||
firstPubKey: "02fa85b75ef37fe3a4f4a6d62352aa7de070d2b39af9c55be26f079d01f406851d",
|
||||
firstPrivKey: "6020c0d5a9a8689c491c6a8f36beb70bf459e129e1428fed64aaf594beee54a6",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Salus', function(done) {
|
||||
var params = {
|
||||
selectText: "SLS - Salus",
|
||||
@@ -1824,9 +1915,9 @@ it('Allows selection of VeChain', function(done) {
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Whitecoin', function(done) {
|
||||
it('Allows selection of Whitecoin Classic', function(done) {
|
||||
var params = {
|
||||
selectText: "XWC - Whitecoin",
|
||||
selectText: "XWCC - Whitecoin Classic",
|
||||
phrase: "abandon abandon ability",
|
||||
firstAddress: "WcSwCAUqrSgeSYbsaS3SSWWhsx8KRYTFDR",
|
||||
firstPubKey: "03d3f4fa758f6260bfb39664d248a32258b53a90a71224db056ee79abaa3e9f208",
|
||||
@@ -1834,6 +1925,16 @@ it('Allows selection of Whitecoin', function(done) {
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Whitecoin', function(done) {
|
||||
var params = {
|
||||
selectText: "XWC - Whitecoin",
|
||||
phrase: "abandon abandon ability",
|
||||
firstAddress: "XWCNY5EQsC55ifxRVEbP7H28yc3TMXC2pqsb5",
|
||||
firstPubKey: "XWC68fEy4cCc8G1UWyeMPnQ5NjEhMUFSvu1oz4gLKxvj3dPvh7v18",
|
||||
firstPrivKey: "5K8toD6TYy5DMHkxjpywXNLj4M6CjZAT5h12uhRuVuBBRtci8Zw",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Wincoin', function(done) {
|
||||
var params = {
|
||||
selectText: "WC - Wincoin",
|
||||
@@ -1844,16 +1945,6 @@ it('Allows selection of Wincoin', function(done) {
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Zcoin', function(done) {
|
||||
var params = {
|
||||
selectText: "XZC - Zcoin",
|
||||
phrase: "abandon abandon ability",
|
||||
firstAddress: "a6VcMdP4XgAA9Tr7xNszmPG5FZpfRf17Cq",
|
||||
firstPubKey: "0236f2348c32dc62d69488b01988ed1154df261723ec60461cb6e62189984c62db",
|
||||
firstPrivKey: "Y8k3XQRQrJoABEao4Sw45s744g6xth7yviNqFcN7zqPqKUJrrKTQ",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Zcash', function(done) {
|
||||
var params = {
|
||||
selectText: "ZEC - Zcash",
|
||||
@@ -2307,6 +2398,17 @@ it('Allows selection of TRX on Tron', function(done) {
|
||||
testNetwork(done, params);
|
||||
});
|
||||
|
||||
it('Allows selection of ZooBlockchain', function(done) {
|
||||
var params = {
|
||||
selectText: "ZBC - ZooBlockchain",
|
||||
phrase: "shy invest oxygen real lunar moral merge corn program air affair amazing dove imitate combine solve library fresh case alcohol pole question act thing",
|
||||
firstAddress: "ZBC_MGEZVH3U_SXPCBHTU_KSWDPQ4X_K6MSI3VR_CQAYMTLC_RXUMM3DJ_LFABCAXA",
|
||||
firstPubKey: "61899a9f7495de209e7454ac37c3975799246eb11401864d628de8c66c695940",
|
||||
firstPrivKey: "adb11e79068fa7366ec4f5963ad57115d666b1ad2b369b92d962563adf7dd48b",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
|
||||
// BIP39 seed is set from phrase
|
||||
it('Sets the bip39 seed from the prhase', function(done) {
|
||||
driver.findElement(By.css('.phrase'))
|
||||
@@ -4960,6 +5062,43 @@ it('Shows split prase cards', function(done) {
|
||||
});
|
||||
});
|
||||
|
||||
// Pull Request 454 https://github.com/iancoleman/bip39/pull/454
|
||||
// Add BIP85 support
|
||||
it('Show BIP85', function(done) {
|
||||
var originalPhrase = "install scatter logic circle pencil average fall shoe quantum disease suspect usage";
|
||||
driver.findElement(By.css('.phrase'))
|
||||
.sendKeys(originalPhrase);
|
||||
driver.sleep(generateDelay).then(function() {
|
||||
driver.findElement(By.css('.showBip85')).click();
|
||||
driver.findElement(By.css('.showBip85')).isSelected().then(function(isSelected) {
|
||||
expect(isSelected).toBe(true)
|
||||
driver.findElement(By.css('#bip85Field')).getAttribute("value").then(function(childMnemonic) {
|
||||
expect(childMnemonic).toBe('girl mad pet galaxy egg matter matrix prison refuse sense ordinary nose')
|
||||
done();
|
||||
})
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('Show BIP85 in non-English languages', function(done) {
|
||||
pending("BIP85 library update");
|
||||
var originalPhrase = "install scatter logic circle pencil average fall shoe quantum disease suspect usage";
|
||||
driver.findElement(By.css('.phrase'))
|
||||
.sendKeys(originalPhrase);
|
||||
driver.sleep(generateDelay).then(function() {
|
||||
driver.findElement(By.css('.showBip85')).click();
|
||||
selectBip85Language("3");
|
||||
driver.findElement(By.css('.showBip85')).isSelected().then(function(isSelected) {
|
||||
expect(isSelected).toBe(true)
|
||||
driver.findElement(By.css('#bip85Field')).getAttribute("value").then(function(childMnemonic) {
|
||||
expect(childMnemonic).not.toBe('girl mad pet galaxy egg matter matrix prison refuse sense ordinary nose')
|
||||
//expect(childMnemonic).toBe('Not sure yet, something Spanish')
|
||||
done();
|
||||
})
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// It allows manually specifying the entropy type
|
||||
it('Allows entropy type to be manually selected', function(done) {
|
||||
driver.findElement(By.css('.use-entropy'))
|
||||
@@ -5033,4 +5172,26 @@ it('Generates ethereum addresses from a public key', function(done) {
|
||||
});
|
||||
});
|
||||
|
||||
// https://github.com/iancoleman/bip39/issues/469
|
||||
it('Generates ethereum private keys with the correct padding', function(done) {
|
||||
var phrase = "flip vicious divorce angle toward say derive blue refuse load word creek once expire bounce";
|
||||
let withoutPadding = "0x53121fc5d193e623d2dbf43b2a96640bbed16bd530947fff8dda12f1aec828";
|
||||
let withPadding = "0x0053121fc5d193e623d2dbf43b2a96640bbed16bd530947fff8dda12f1aec828";
|
||||
let skIndex = 15;
|
||||
driver.findElement(By.css('.phrase'))
|
||||
.sendKeys(phrase);
|
||||
selectNetwork('ETH - Ethereum');
|
||||
driver.sleep(generateDelay).then(function() {
|
||||
driver.findElements(By.css(".privkey"))
|
||||
.then(function(els) {
|
||||
els[skIndex].getText()
|
||||
.then(function(sk) {
|
||||
expect(sk).toBe(withPadding);
|
||||
expect(sk).not.toBe(withoutPadding);
|
||||
done();
|
||||
});
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user