mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-06 19:03:49 +00:00
Compare commits
120 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de71c22328 | ||
|
|
8fd86ecbe0 | ||
|
|
20181be9a0 | ||
|
|
a9bf4823c7 | ||
|
|
52e8f25e11 | ||
|
|
e2fdc5b942 | ||
|
|
450b0a571a | ||
|
|
5c4382c3c1 | ||
|
|
c3c7cebfe4 | ||
|
|
58d84449f4 | ||
|
|
9303d0e078 | ||
|
|
bd1f1706fe | ||
|
|
8d119065f0 | ||
|
|
45a8e2a218 | ||
|
|
d035063dcc | ||
|
|
26d2c54381 | ||
|
|
ecbc254ba3 | ||
|
|
874b6d4e08 | ||
|
|
1fa3f997a2 | ||
|
|
4cf9de3202 | ||
|
|
c04d31f82f | ||
|
|
530a9f6047 | ||
|
|
126af2bee3 | ||
|
|
c7e1af7300 | ||
|
|
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 | ||
|
|
4e59e7d6fc | ||
|
|
8c3a56ec4f | ||
|
|
d31a0ad44b | ||
|
|
4566751b89 | ||
|
|
b386aaa06e | ||
|
|
ef95b4bfad | ||
|
|
30e3d246d4 | ||
|
|
647410b4a6 | ||
|
|
4669c88c67 | ||
|
|
9e865b8e75 | ||
|
|
08713ff9c2 | ||
|
|
ed52cda20d | ||
|
|
8ce57f3c13 | ||
|
|
043717034b | ||
|
|
eb100ec0e4 | ||
|
|
5cbd174c18 | ||
|
|
75722c6d24 | ||
|
|
7e75b98e1f | ||
|
|
47dbf58b6d | ||
|
|
42e00ef56a | ||
|
|
8dbf7d5837 | ||
|
|
bf96267f89 | ||
|
|
995bc58791 | ||
|
|
d7125cda1d | ||
|
|
b674c5710b | ||
|
|
920f7aa078 | ||
|
|
5c6e875f2d | ||
|
|
e086305895 | ||
|
|
863eee8ed7 | ||
|
|
4729ecca04 | ||
|
|
fba7e98aea | ||
|
|
95b306106f |
55
changelog.md
55
changelog.md
@@ -1,3 +1,58 @@
|
||||
# 0.5.6
|
||||
|
||||
* Add warning to not share info from the page
|
||||
|
||||
# 0.5.5
|
||||
|
||||
* Fix BIP85 bug when pressing enter
|
||||
|
||||
# 0.5.4
|
||||
|
||||
* Add Particl network
|
||||
* Add Divi network
|
||||
* Add option to turn autocompute on / off
|
||||
* Add option to set custom number of pbkdf2 rounds
|
||||
* Fix blank mnemonic errors when using only seed
|
||||
|
||||
# 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
|
||||
* Add notes about card entropy
|
||||
* Hide/show split mnemonic cards
|
||||
* Fix link to standalone release file
|
||||
* Add Scribe network
|
||||
* Add Nano network
|
||||
* Add TRX network
|
||||
* Add Binance Smart Chain network
|
||||
* Clean up dependencies for eos-util
|
||||
* Update bootstrap to 3.4.1
|
||||
* Bump library versions
|
||||
|
||||
# 0.4.3
|
||||
|
||||
* Add FIO - Foundation for Interwallet Operability
|
||||
|
||||
58
dev_env_setup.sh
Executable file
58
dev_env_setup.sh
Executable file
@@ -0,0 +1,58 @@
|
||||
# this script is intended to be run in a VM
|
||||
# running ubuntu 20.04 server
|
||||
# from the root directory of this repo
|
||||
|
||||
echo "This script is intended to be run in a VM."
|
||||
echo "It may do things to your OS that you don't want to be peristent."
|
||||
echo "Please type virtualmachine to continue, or Ctrl-C to quit."
|
||||
|
||||
read passage
|
||||
|
||||
if [ "$passage" = "virtualmachine" ]; then
|
||||
echo "Installing dev environment"
|
||||
else
|
||||
echo "Did not type virtualmachine, quitting with no changes applied"
|
||||
exit
|
||||
fi
|
||||
|
||||
# set up place for local binaries
|
||||
mkdir $HOME/.bin
|
||||
echo "export PATH=$PATH:$HOME/.bin" >> $HOME/.bashrc
|
||||
source $HOME/.bashrc
|
||||
|
||||
# allow python3 to be run with python command
|
||||
ln -s /usr/bin/python3 $HOME/.bin/python
|
||||
|
||||
# install firefox and other dependencies
|
||||
sudo apt-get -y install firefox unzip openjdk-11-jre-headless xvfb libxi6 libgconf-2-4 make build-essential
|
||||
# install chrome
|
||||
curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add
|
||||
sudo sh -c "echo \"deb https://dl.google.com/linux/chrome/deb/ stable main\" >> /etc/apt/sources.list.d/google-chrome.list"
|
||||
sudo apt-get -y update
|
||||
sudo apt-get -y install google-chrome-stable
|
||||
|
||||
# install nodejs for running tests
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash
|
||||
# load nvm
|
||||
source $HOME/.bashrc
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
||||
# install latest node
|
||||
nvm install node
|
||||
# install jasmine
|
||||
cd tests
|
||||
npm install --global jasmine
|
||||
npm install selenium-webdriver
|
||||
# install gecko webdriver for firefox
|
||||
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/88.0.4324.96/chromedriver_linux64.zip --output-document=/tmp/chromedriver.zip
|
||||
unzip /tmp/chromedriver.zip -d $HOME/.bin
|
||||
|
||||
# to run tests
|
||||
# cd tests
|
||||
# Xvfb :1 -screen 1 1024x768x24 & export DISPLAY=:1.1
|
||||
# BROWSER=firefox jasmine spec/tests.js
|
||||
# BROWSER=chrome jasmine spec/tests.js
|
||||
@@ -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,52 @@ 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');
|
||||
module.exports.nanoUtil = {
|
||||
getKeypair: function (index, seed) {
|
||||
const accounts = NanoBase.wallet.accounts(seed, index, index)
|
||||
return {privKey: accounts[0].privateKey, pubKey: accounts[0].publicKey, address: accounts[0].address};
|
||||
},
|
||||
dummyNetwork: {
|
||||
bip32: {public: 0, private: 0},
|
||||
messagePrefix: '',
|
||||
pubKeyHash: 0,
|
||||
scriptHash: 0,
|
||||
wif: 0,
|
||||
},
|
||||
}
|
||||
|
||||
/* unorm */
|
||||
|
||||
module.exports.unorm = require('unorm')
|
||||
|
||||
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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
3647
libs/combined/package-lock.json
generated
3647
libs/combined/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
9
libs/combined/package.json
Executable file → Normal file
9
libs/combined/package.json
Executable file → Normal file
@@ -8,21 +8,24 @@
|
||||
"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",
|
||||
"buffer": "^5.4.3",
|
||||
"create-hash": "^1.2.0",
|
||||
"ed25519-hd-key": "^1.0.0",
|
||||
"elastos-wallet-js": "git://github.com/johnnynanjiang/Elastos.SDK.Keypair.Javascript.git#491dc51b64efaf0a8aae62028b68e2c8e38fde06",
|
||||
"ethereumjs-util": "6.0.0",
|
||||
"handshake-util": "1.2.0",
|
||||
"fast-levenshtein": "2.0.6",
|
||||
"groestlcoinjs-lib": "git://github.com/Groestlcoin/groestlcoinjs-lib.git#3.3.2",
|
||||
"handshake-util": "1.2.0",
|
||||
"javascript-biginteger": "0.9.2",
|
||||
"jsrsasign": "^8.0.15",
|
||||
"jsrsasign": "^8.0.19",
|
||||
"kjua": "0.6.0",
|
||||
"nanocurrency-web": "^1.2.2",
|
||||
"nebulas": "0.5.6",
|
||||
"stellar-base": "^0.10.0",
|
||||
"unorm": "1.6.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Generate libs
|
||||
|
||||
```
|
||||
npm install
|
||||
npm install --no-optional
|
||||
npm run build
|
||||
```
|
||||
|
||||
15
libs/nanocurrency-web/nano-util.js
Executable file
15
libs/nanocurrency-web/nano-util.js
Executable file
@@ -0,0 +1,15 @@
|
||||
const NanoBase = require('nanocurrency-web');
|
||||
|
||||
window.nanoUtil = {
|
||||
getKeypair: function (index, seed) {
|
||||
const accounts = NanoBase.wallet.accounts(seed, index, index)
|
||||
return {privKey: accounts[0].privateKey, pubKey: accounts[0].publicKey, address: accounts[0].address};
|
||||
},
|
||||
dummyNetwork: {
|
||||
bip32: {public: 0, private: 0},
|
||||
messagePrefix: '',
|
||||
pubKeyHash: 0,
|
||||
scriptHash: 0,
|
||||
wif: 0,
|
||||
},
|
||||
}
|
||||
1614
libs/nanocurrency-web/package-lock.json
generated
Executable file
1614
libs/nanocurrency-web/package-lock.json
generated
Executable file
File diff suppressed because it is too large
Load Diff
14
libs/nanocurrency-web/package.json
Executable file
14
libs/nanocurrency-web/package.json
Executable file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "nano-util",
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"build": "browserify nano-util.js > /tmp/nano-util.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"nanocurrency-web": "^1.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "^16.2.3",
|
||||
"uglify-es": "^3.3.9"
|
||||
}
|
||||
}
|
||||
4
libs/nanocurrency-web/readme.md
Executable file
4
libs/nanocurrency-web/readme.md
Executable file
@@ -0,0 +1,4 @@
|
||||
Build (will create a bundle and copy it to /tmp/nano-util.js):
|
||||
|
||||
npm install
|
||||
npm run build
|
||||
24
libs/stellar-util/package-lock.json
generated
24
libs/stellar-util/package-lock.json
generated
@@ -15,9 +15,9 @@
|
||||
}
|
||||
},
|
||||
"acorn": {
|
||||
"version": "6.0.4",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.4.tgz",
|
||||
"integrity": "sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg==",
|
||||
"version": "6.4.1",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz",
|
||||
"integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==",
|
||||
"dev": true
|
||||
},
|
||||
"acorn-dynamic-import": {
|
||||
@@ -90,7 +90,7 @@
|
||||
},
|
||||
"util": {
|
||||
"version": "0.10.3",
|
||||
"resolved": "http://registry.npmjs.org/util/-/util-0.10.3.tgz",
|
||||
"resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz",
|
||||
"integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
@@ -186,7 +186,7 @@
|
||||
"dependencies": {
|
||||
"resolve": {
|
||||
"version": "1.1.7",
|
||||
"resolved": "http://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz",
|
||||
"integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=",
|
||||
"dev": true
|
||||
}
|
||||
@@ -581,9 +581,9 @@
|
||||
}
|
||||
},
|
||||
"elliptic": {
|
||||
"version": "6.4.1",
|
||||
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz",
|
||||
"integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==",
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz",
|
||||
"integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"bn.js": "^4.4.0",
|
||||
@@ -810,9 +810,9 @@
|
||||
}
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.11",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
|
||||
"integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg=="
|
||||
"version": "4.17.19",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
|
||||
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ=="
|
||||
},
|
||||
"lodash.memoize": {
|
||||
"version": "3.0.4",
|
||||
@@ -1085,7 +1085,7 @@
|
||||
"dependencies": {
|
||||
"string_decoder": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
||||
985
src/css/bootstrap-3.3.7.css → src/css/bootstrap.css
vendored
985
src/css/bootstrap-3.3.7.css → src/css/bootstrap.css
vendored
File diff suppressed because it is too large
Load Diff
1
src/css/bootstrap.css.map
Normal file
1
src/css/bootstrap.css.map
Normal file
File diff suppressed because one or more lines are too long
204
src/index.html
204
src/index.html
@@ -3,7 +3,7 @@
|
||||
<head lang="en">
|
||||
<meta charset="utf-8" />
|
||||
<title>BIP39 - Mnemonic Code</title>
|
||||
<link rel="stylesheet" href="css/bootstrap-3.3.7.css">
|
||||
<link rel="stylesheet" href="css/bootstrap.css">
|
||||
<link rel="stylesheet" href="css/app.css">
|
||||
<meta content="Mnemonic code for generating deterministic keys" name="description"/>
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
|
||||
@@ -15,7 +15,7 @@
|
||||
<div class="container">
|
||||
|
||||
<h1 class="text-center">Mnemonic Code Converter</h1>
|
||||
<p class="version">v0.4.3</p>
|
||||
<p class="version">v0.5.6</p>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@@ -29,6 +29,15 @@
|
||||
For more info see the
|
||||
<a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki" target="_blank">BIP39 spec</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<span class="text-danger">
|
||||
If you share the information generated by this page with anyone, they can steal your assets.
|
||||
Anyone asking you to share your your secret recovery phrase or BIP 32 root key is a scammer.
|
||||
Do NOT copy & paste information from this page or send it to anyone offering to help you on Twitter, Discord, Telegram, Etherscan, or Line.
|
||||
<strong>They will steal your coins.</strong>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group generate-container">
|
||||
@@ -86,7 +95,7 @@
|
||||
<div class="row">
|
||||
<label class="col-sm-3 control-label">Entropy Type</label>
|
||||
<div class="type col-sm-3 form-control-static"></div>
|
||||
<label class="col-sm-3 control-label">Bits Per Event</label>
|
||||
<label class="col-sm-3 control-label">Avg Bits Per Event</label>
|
||||
<div class="bits-per-event col-sm-3 form-control-static"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@@ -119,6 +128,18 @@
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<label class="col-sm-3 control-label">PBKDF2 rounds</label>
|
||||
<div class="col-sm-9">
|
||||
<select class="pbkdf2-rounds form-control" style="width: 60%;float: left;">
|
||||
<option value="2048" selected>2048 <span>(compatibility)</span></option>
|
||||
<option value="4096">4096 <span>iterations</span></option>
|
||||
<option value="8192">8192 <span>iterations</span></option>
|
||||
<option value="16384">16384 <span>iterations</span></option>
|
||||
<option value="32768">32768 <span>iterations</span></option>
|
||||
<option value="custom">Custom <span>iterations</span></option>
|
||||
</select>
|
||||
<input type="number" class="form-control hidden" id="pbkdf2-custom-input" value="1" min="1" pattern="[0-9]" style="float: right;width: 40%;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<p>Valid entropy values include:</p>
|
||||
@@ -181,6 +202,15 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-2"></div>
|
||||
<div class="col-sm-10 checkbox">
|
||||
<label>
|
||||
<input type="checkbox" class="autoCompute" checked>
|
||||
<span>Auto compute</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">Mnemonic Language</label>
|
||||
<div class="col-sm-10 languages">
|
||||
@@ -194,9 +224,17 @@
|
||||
<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>
|
||||
<div class="form-group text-danger PBKDF2-infos-danger hidden">
|
||||
<label class="col-sm-2 control-label">Warning</label>
|
||||
<div class="col-sm-10 form-control-static">
|
||||
<span>You are using a custom number of PBKDF2 iterations. Your BIP39 seed may not show same addresses on a different software.</span>
|
||||
<a href="#PBKDF2-notes">Read more</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="phrase" class="col-sm-2 control-label">BIP39 Mnemonic</label>
|
||||
<div class="col-sm-10">
|
||||
@@ -204,12 +242,22 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="phrase" class="col-sm-2 control-label">BIP39 Split Mnemonic</label>
|
||||
<div class="splitMnemonic hidden">
|
||||
<label for="phrase" class="col-sm-2 control-label">BIP39 Split Mnemonic</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea id="phraseSplit" class="phraseSplit private-data form-control" title="Only 2 of 3 cards needed to recover." rows="3"></textarea>
|
||||
<p class="help-block">
|
||||
<span id="phraseSplitWarn" class="phraseSplitWarn"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<textarea id="phraseSplit" class="phraseSplit private-data form-control" title="Only 2 of 3 cards needed to recover." rows="3"></textarea>
|
||||
<p class="help-block">
|
||||
<span id="phraseSplitWarn" class="phraseSplitWarn"></span>
|
||||
</p>
|
||||
<label class="control-label text-weight-normal">
|
||||
<input type="checkbox" class="showSplitMnemonic">
|
||||
Show split mnemonic cards
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -238,6 +286,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">
|
||||
@@ -792,6 +947,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>
|
||||
@@ -828,6 +988,25 @@
|
||||
<p>
|
||||
<a href="https://bitcointalk.org/index.php?topic=311000.msg3345309#msg3345309" target="_blank">You are not a good source of entropy.</a>
|
||||
</p>
|
||||
<p>
|
||||
<span>Card entropy has been implemented assuming cards are replaced, not drawn one after another.</span>
|
||||
<span>A full deck with replacement generates 232 bits of entropy (21 words). A full deck without replacement generates 225 bits of entropy (21 words).</span>
|
||||
<span>Card entropy changed significantly from v0.4.3 to v0.5.0. The old version can be accessed at
|
||||
<a href="https://github.com/iancoleman/bip39/releases/tag/0.4.3">
|
||||
https://github.com/iancoleman/bip39/releases/tag/0.4.3
|
||||
</a>
|
||||
or
|
||||
<a href="https://web.archive.org/web/20201018232020/https://iancoleman.io/bip39/">
|
||||
https://web.archive.org/web/20201018232020/https://iancoleman.io/bip39/
|
||||
</a>
|
||||
</span>
|
||||
</p>
|
||||
<h3 id="PBKDF2-notes">PBKDF2</h3>
|
||||
<p><a href="https://learnmeabitcoin.com/technical/mnemonic#pbkdf2---password-based-key-derivation-function-2 " target="_blank">What is PBKDF2 (Password Based Key Derivation Function 2) ?</a></p>
|
||||
<p><span>Please refer to this <a href="https://en.wikipedia.org/wiki/PBKDF2" target="_blank">wikipedia article</a> for more detail.
|
||||
<span>Mail about PBKDF2 security <a href="https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2016-July/012902.html" target="_blank">here</a>.</p>
|
||||
<p>Wallet software that implement BIP39 only use 2048 iterations as a norm. Increasing this parameter will increase security against brute force attack, but you will need to store this new parameter. However, as long as you back up your BIP39 seed there will not be risk to lost your fund. To access them with custom PBKDF2 iterations, use this file (or <a href="https://stuff.birkenstab.de/pbkdf2/" target="_blank">other</a>) to compute your targeted BIP39 seed.</p>
|
||||
<p>Using less than 2048 PBKDF2 iterations is insecure without strong optional BIP39 Passphrase.</p>
|
||||
<h3>License</h3>
|
||||
<p>
|
||||
<span>Please refer to <a href="https://github.com/iancoleman/bip39/blob/master/LICENSE" target="_blank">the software license</a> for more detail.
|
||||
@@ -871,9 +1050,9 @@
|
||||
on any offline computer.
|
||||
</p>
|
||||
<p>
|
||||
<span>Alternatively, download the file from the repository</span>
|
||||
<span>Alternatively, download the file from the latest GitHub release</span>
|
||||
-
|
||||
<a href="https://github.com/iancoleman/bip39">https://github.com/iancoleman/bip39</a>
|
||||
<a href="https://github.com/iancoleman/bip39/releases/latest/">https://github.com/iancoleman/bip39/releases/latest/</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
@@ -958,15 +1137,17 @@
|
||||
</tr>
|
||||
</script>
|
||||
<script src="js/jquery-3.2.1.js"></script>
|
||||
<script src="js/bootstrap-3.3.7.js"></script>
|
||||
<script src="js/bootstrap.js"></script>
|
||||
<script src="js/bip39-libs.js"></script>
|
||||
<script src="js/bitcoinjs-extensions.js"></script>
|
||||
<script src="js/segwit-parameters.js"></script>
|
||||
<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>
|
||||
@@ -977,6 +1158,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>
|
||||
|
||||
2
src/js/bip39-libs.js
Normal file → Executable file
2
src/js/bip39-libs.js
Normal file → Executable file
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 = {
|
||||
@@ -139,6 +139,17 @@ libs.bitcoin.networks.axe = {
|
||||
wif: 0xcc
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.scribe = {
|
||||
messagePrefix: 'unused',
|
||||
bip32: {
|
||||
public: 0x0488B21E,
|
||||
private: 0x0488ADE4
|
||||
},
|
||||
pubKeyHash: 0x3c,
|
||||
scriptHash: 0x7d,
|
||||
wif: 0x6e
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.slimcoin = {
|
||||
messagePrefix: 'unused',
|
||||
bip32: {
|
||||
@@ -680,6 +691,28 @@ libs.bitcoin.networks.digitalcoin = {
|
||||
wif: 0x9e,
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.divi = {
|
||||
messagePrefix: '\x19Divi Signed Message:\n',
|
||||
bip32: {
|
||||
public: 0x022d2533,
|
||||
private: 0x0221312b,
|
||||
},
|
||||
pubKeyHash: 0x1e,
|
||||
scriptHash: 0x0d,
|
||||
wif: 0xd4,
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.divitestnet = {
|
||||
messagePrefix: '\x19Divi Signed Message:\n',
|
||||
bip32: {
|
||||
public: 0x3a8061a0,
|
||||
private: 0x3a805837,
|
||||
},
|
||||
pubKeyHash: 0x8b,
|
||||
scriptHash: 0x13,
|
||||
wif: 0xef,
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.ecoin = {
|
||||
messagePrefix: '\x18eCoin Signed Message:\n',
|
||||
bip32: {
|
||||
@@ -757,6 +790,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: {
|
||||
@@ -1186,6 +1241,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: {
|
||||
@@ -1454,17 +1520,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: {
|
||||
@@ -1498,6 +1553,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: {
|
||||
@@ -1531,6 +1597,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: {
|
||||
@@ -1820,3 +1898,15 @@ libs.bitcoin.networks.argoneum = {
|
||||
scriptHash: 0x61,
|
||||
wif: 0xbf
|
||||
};
|
||||
|
||||
libs.bitcoin.networks.particl = {
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bech32: 'pw',
|
||||
bip32: {
|
||||
public: 0x696e82d1,
|
||||
private: 0x8f1daeb8,
|
||||
},
|
||||
pubKeyHash: 0x38,
|
||||
scriptHash: 0x3c,
|
||||
wif: 0x6c,
|
||||
};
|
||||
|
||||
397
src/js/bootstrap-3.3.7.js → src/js/bootstrap.js
vendored
397
src/js/bootstrap-3.3.7.js → src/js/bootstrap.js
vendored
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* Bootstrap v3.3.7 (http://getbootstrap.com)
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Bootstrap v3.4.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under the MIT license
|
||||
*/
|
||||
|
||||
@@ -17,10 +17,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: transition.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#transitions
|
||||
* Bootstrap: transition.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#transitions
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -28,7 +28,7 @@ if (typeof jQuery === 'undefined') {
|
||||
+function ($) {
|
||||
'use strict';
|
||||
|
||||
// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
|
||||
// CSS TRANSITION SUPPORT (Shoutout: https://modernizr.com/)
|
||||
// ============================================================
|
||||
|
||||
function transitionEnd() {
|
||||
@@ -50,7 +50,7 @@ if (typeof jQuery === 'undefined') {
|
||||
return false // explicit for ie8 ( ._.)
|
||||
}
|
||||
|
||||
// http://blog.alexmaccaw.com/css-transitions
|
||||
// https://blog.alexmaccaw.com/css-transitions
|
||||
$.fn.emulateTransitionEnd = function (duration) {
|
||||
var called = false
|
||||
var $el = this
|
||||
@@ -77,10 +77,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: alert.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#alerts
|
||||
* Bootstrap: alert.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#alerts
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -96,7 +96,7 @@ if (typeof jQuery === 'undefined') {
|
||||
$(el).on('click', dismiss, this.close)
|
||||
}
|
||||
|
||||
Alert.VERSION = '3.3.7'
|
||||
Alert.VERSION = '3.4.1'
|
||||
|
||||
Alert.TRANSITION_DURATION = 150
|
||||
|
||||
@@ -109,7 +109,8 @@ if (typeof jQuery === 'undefined') {
|
||||
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
||||
}
|
||||
|
||||
var $parent = $(selector === '#' ? [] : selector)
|
||||
selector = selector === '#' ? [] : selector
|
||||
var $parent = $(document).find(selector)
|
||||
|
||||
if (e) e.preventDefault()
|
||||
|
||||
@@ -172,10 +173,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: button.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#buttons
|
||||
* Bootstrap: button.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#buttons
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -192,7 +193,7 @@ if (typeof jQuery === 'undefined') {
|
||||
this.isLoading = false
|
||||
}
|
||||
|
||||
Button.VERSION = '3.3.7'
|
||||
Button.VERSION = '3.4.1'
|
||||
|
||||
Button.DEFAULTS = {
|
||||
loadingText: 'loading...'
|
||||
@@ -298,10 +299,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: carousel.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#carousel
|
||||
* Bootstrap: carousel.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#carousel
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -329,7 +330,7 @@ if (typeof jQuery === 'undefined') {
|
||||
.on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
|
||||
}
|
||||
|
||||
Carousel.VERSION = '3.3.7'
|
||||
Carousel.VERSION = '3.4.1'
|
||||
|
||||
Carousel.TRANSITION_DURATION = 600
|
||||
|
||||
@@ -443,7 +444,9 @@ if (typeof jQuery === 'undefined') {
|
||||
var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
|
||||
if ($.support.transition && this.$element.hasClass('slide')) {
|
||||
$next.addClass(type)
|
||||
$next[0].offsetWidth // force reflow
|
||||
if (typeof $next === 'object' && $next.length) {
|
||||
$next[0].offsetWidth // force reflow
|
||||
}
|
||||
$active.addClass(direction)
|
||||
$next.addClass(direction)
|
||||
$active
|
||||
@@ -505,10 +508,17 @@ if (typeof jQuery === 'undefined') {
|
||||
// =================
|
||||
|
||||
var clickHandler = function (e) {
|
||||
var href
|
||||
var $this = $(this)
|
||||
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
|
||||
var href = $this.attr('href')
|
||||
if (href) {
|
||||
href = href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
|
||||
}
|
||||
|
||||
var target = $this.attr('data-target') || href
|
||||
var $target = $(document).find(target)
|
||||
|
||||
if (!$target.hasClass('carousel')) return
|
||||
|
||||
var options = $.extend({}, $target.data(), $this.data())
|
||||
var slideIndex = $this.attr('data-slide-to')
|
||||
if (slideIndex) options.interval = false
|
||||
@@ -536,10 +546,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: collapse.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#collapse
|
||||
* Bootstrap: collapse.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#collapse
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -567,7 +577,7 @@ if (typeof jQuery === 'undefined') {
|
||||
if (this.options.toggle) this.toggle()
|
||||
}
|
||||
|
||||
Collapse.VERSION = '3.3.7'
|
||||
Collapse.VERSION = '3.4.1'
|
||||
|
||||
Collapse.TRANSITION_DURATION = 350
|
||||
|
||||
@@ -674,7 +684,7 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
|
||||
Collapse.prototype.getParent = function () {
|
||||
return $(this.options.parent)
|
||||
return $(document).find(this.options.parent)
|
||||
.find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
|
||||
.each($.proxy(function (i, element) {
|
||||
var $element = $(element)
|
||||
@@ -697,7 +707,7 @@ if (typeof jQuery === 'undefined') {
|
||||
var target = $trigger.attr('data-target')
|
||||
|| (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
|
||||
|
||||
return $(target)
|
||||
return $(document).find(target)
|
||||
}
|
||||
|
||||
|
||||
@@ -749,10 +759,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: dropdown.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#dropdowns
|
||||
* Bootstrap: dropdown.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#dropdowns
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -769,7 +779,7 @@ if (typeof jQuery === 'undefined') {
|
||||
$(element).on('click.bs.dropdown', this.toggle)
|
||||
}
|
||||
|
||||
Dropdown.VERSION = '3.3.7'
|
||||
Dropdown.VERSION = '3.4.1'
|
||||
|
||||
function getParent($this) {
|
||||
var selector = $this.attr('data-target')
|
||||
@@ -779,7 +789,7 @@ if (typeof jQuery === 'undefined') {
|
||||
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
||||
}
|
||||
|
||||
var $parent = selector && $(selector)
|
||||
var $parent = selector !== '#' ? $(document).find(selector) : null
|
||||
|
||||
return $parent && $parent.length ? $parent : $this.parent()
|
||||
}
|
||||
@@ -915,10 +925,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: modal.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#modals
|
||||
* Bootstrap: modal.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#modals
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -930,15 +940,16 @@ if (typeof jQuery === 'undefined') {
|
||||
// ======================
|
||||
|
||||
var Modal = function (element, options) {
|
||||
this.options = options
|
||||
this.$body = $(document.body)
|
||||
this.$element = $(element)
|
||||
this.$dialog = this.$element.find('.modal-dialog')
|
||||
this.$backdrop = null
|
||||
this.isShown = null
|
||||
this.originalBodyPad = null
|
||||
this.scrollbarWidth = 0
|
||||
this.options = options
|
||||
this.$body = $(document.body)
|
||||
this.$element = $(element)
|
||||
this.$dialog = this.$element.find('.modal-dialog')
|
||||
this.$backdrop = null
|
||||
this.isShown = null
|
||||
this.originalBodyPad = null
|
||||
this.scrollbarWidth = 0
|
||||
this.ignoreBackdropClick = false
|
||||
this.fixedContent = '.navbar-fixed-top, .navbar-fixed-bottom'
|
||||
|
||||
if (this.options.remote) {
|
||||
this.$element
|
||||
@@ -949,7 +960,7 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
}
|
||||
|
||||
Modal.VERSION = '3.3.7'
|
||||
Modal.VERSION = '3.4.1'
|
||||
|
||||
Modal.TRANSITION_DURATION = 300
|
||||
Modal.BACKDROP_TRANSITION_DURATION = 150
|
||||
@@ -966,7 +977,7 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
Modal.prototype.show = function (_relatedTarget) {
|
||||
var that = this
|
||||
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
|
||||
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
@@ -1057,8 +1068,8 @@ if (typeof jQuery === 'undefined') {
|
||||
.off('focusin.bs.modal') // guard against infinite focus loop
|
||||
.on('focusin.bs.modal', $.proxy(function (e) {
|
||||
if (document !== e.target &&
|
||||
this.$element[0] !== e.target &&
|
||||
!this.$element.has(e.target).length) {
|
||||
this.$element[0] !== e.target &&
|
||||
!this.$element.has(e.target).length) {
|
||||
this.$element.trigger('focus')
|
||||
}
|
||||
}, this))
|
||||
@@ -1160,7 +1171,7 @@ if (typeof jQuery === 'undefined') {
|
||||
var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
|
||||
|
||||
this.$element.css({
|
||||
paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
|
||||
paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
|
||||
paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
|
||||
})
|
||||
}
|
||||
@@ -1185,11 +1196,26 @@ if (typeof jQuery === 'undefined') {
|
||||
Modal.prototype.setScrollbar = function () {
|
||||
var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
|
||||
this.originalBodyPad = document.body.style.paddingRight || ''
|
||||
if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
|
||||
var scrollbarWidth = this.scrollbarWidth
|
||||
if (this.bodyIsOverflowing) {
|
||||
this.$body.css('padding-right', bodyPad + scrollbarWidth)
|
||||
$(this.fixedContent).each(function (index, element) {
|
||||
var actualPadding = element.style.paddingRight
|
||||
var calculatedPadding = $(element).css('padding-right')
|
||||
$(element)
|
||||
.data('padding-right', actualPadding)
|
||||
.css('padding-right', parseFloat(calculatedPadding) + scrollbarWidth + 'px')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Modal.prototype.resetScrollbar = function () {
|
||||
this.$body.css('padding-right', this.originalBodyPad)
|
||||
$(this.fixedContent).each(function (index, element) {
|
||||
var padding = $(element).data('padding-right')
|
||||
$(element).removeData('padding-right')
|
||||
element.style.paddingRight = padding ? padding : ''
|
||||
})
|
||||
}
|
||||
|
||||
Modal.prototype.measureScrollbar = function () { // thx walsh
|
||||
@@ -1207,8 +1233,8 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
function Plugin(option, _relatedTarget) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.modal')
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.modal')
|
||||
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
||||
|
||||
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
|
||||
@@ -1219,7 +1245,7 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
var old = $.fn.modal
|
||||
|
||||
$.fn.modal = Plugin
|
||||
$.fn.modal = Plugin
|
||||
$.fn.modal.Constructor = Modal
|
||||
|
||||
|
||||
@@ -1236,10 +1262,13 @@ if (typeof jQuery === 'undefined') {
|
||||
// ==============
|
||||
|
||||
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
|
||||
var $this = $(this)
|
||||
var href = $this.attr('href')
|
||||
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
|
||||
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
||||
var $this = $(this)
|
||||
var href = $this.attr('href')
|
||||
var target = $this.attr('data-target') ||
|
||||
(href && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
|
||||
|
||||
var $target = $(document).find(target)
|
||||
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
||||
|
||||
if ($this.is('a')) e.preventDefault()
|
||||
|
||||
@@ -1255,18 +1284,148 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: tooltip.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#tooltip
|
||||
* Bootstrap: tooltip.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#tooltip
|
||||
* Inspired by the original jQuery.tipsy by Jason Frame
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
|
||||
+function ($) {
|
||||
'use strict';
|
||||
|
||||
var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']
|
||||
|
||||
var uriAttrs = [
|
||||
'background',
|
||||
'cite',
|
||||
'href',
|
||||
'itemtype',
|
||||
'longdesc',
|
||||
'poster',
|
||||
'src',
|
||||
'xlink:href'
|
||||
]
|
||||
|
||||
var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i
|
||||
|
||||
var DefaultWhitelist = {
|
||||
// Global attributes allowed on any supplied element below.
|
||||
'*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
|
||||
a: ['target', 'href', 'title', 'rel'],
|
||||
area: [],
|
||||
b: [],
|
||||
br: [],
|
||||
col: [],
|
||||
code: [],
|
||||
div: [],
|
||||
em: [],
|
||||
hr: [],
|
||||
h1: [],
|
||||
h2: [],
|
||||
h3: [],
|
||||
h4: [],
|
||||
h5: [],
|
||||
h6: [],
|
||||
i: [],
|
||||
img: ['src', 'alt', 'title', 'width', 'height'],
|
||||
li: [],
|
||||
ol: [],
|
||||
p: [],
|
||||
pre: [],
|
||||
s: [],
|
||||
small: [],
|
||||
span: [],
|
||||
sub: [],
|
||||
sup: [],
|
||||
strong: [],
|
||||
u: [],
|
||||
ul: []
|
||||
}
|
||||
|
||||
/**
|
||||
* A pattern that recognizes a commonly useful subset of URLs that are safe.
|
||||
*
|
||||
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
||||
*/
|
||||
var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi
|
||||
|
||||
/**
|
||||
* A pattern that matches safe data URLs. Only matches image, video and audio types.
|
||||
*
|
||||
* Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
|
||||
*/
|
||||
var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i
|
||||
|
||||
function allowedAttribute(attr, allowedAttributeList) {
|
||||
var attrName = attr.nodeName.toLowerCase()
|
||||
|
||||
if ($.inArray(attrName, allowedAttributeList) !== -1) {
|
||||
if ($.inArray(attrName, uriAttrs) !== -1) {
|
||||
return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN))
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
var regExp = $(allowedAttributeList).filter(function (index, value) {
|
||||
return value instanceof RegExp
|
||||
})
|
||||
|
||||
// Check if a regular expression validates the attribute.
|
||||
for (var i = 0, l = regExp.length; i < l; i++) {
|
||||
if (attrName.match(regExp[i])) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
|
||||
if (unsafeHtml.length === 0) {
|
||||
return unsafeHtml
|
||||
}
|
||||
|
||||
if (sanitizeFn && typeof sanitizeFn === 'function') {
|
||||
return sanitizeFn(unsafeHtml)
|
||||
}
|
||||
|
||||
// IE 8 and below don't support createHTMLDocument
|
||||
if (!document.implementation || !document.implementation.createHTMLDocument) {
|
||||
return unsafeHtml
|
||||
}
|
||||
|
||||
var createdDocument = document.implementation.createHTMLDocument('sanitization')
|
||||
createdDocument.body.innerHTML = unsafeHtml
|
||||
|
||||
var whitelistKeys = $.map(whiteList, function (el, i) { return i })
|
||||
var elements = $(createdDocument.body).find('*')
|
||||
|
||||
for (var i = 0, len = elements.length; i < len; i++) {
|
||||
var el = elements[i]
|
||||
var elName = el.nodeName.toLowerCase()
|
||||
|
||||
if ($.inArray(elName, whitelistKeys) === -1) {
|
||||
el.parentNode.removeChild(el)
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
var attributeList = $.map(el.attributes, function (el) { return el })
|
||||
var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || [])
|
||||
|
||||
for (var j = 0, len2 = attributeList.length; j < len2; j++) {
|
||||
if (!allowedAttribute(attributeList[j], whitelistedAttributes)) {
|
||||
el.removeAttribute(attributeList[j].nodeName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return createdDocument.body.innerHTML
|
||||
}
|
||||
|
||||
// TOOLTIP PUBLIC CLASS DEFINITION
|
||||
// ===============================
|
||||
|
||||
@@ -1282,7 +1441,7 @@ if (typeof jQuery === 'undefined') {
|
||||
this.init('tooltip', element, options)
|
||||
}
|
||||
|
||||
Tooltip.VERSION = '3.3.7'
|
||||
Tooltip.VERSION = '3.4.1'
|
||||
|
||||
Tooltip.TRANSITION_DURATION = 150
|
||||
|
||||
@@ -1299,7 +1458,10 @@ if (typeof jQuery === 'undefined') {
|
||||
viewport: {
|
||||
selector: 'body',
|
||||
padding: 0
|
||||
}
|
||||
},
|
||||
sanitize : true,
|
||||
sanitizeFn : null,
|
||||
whiteList : DefaultWhitelist
|
||||
}
|
||||
|
||||
Tooltip.prototype.init = function (type, element, options) {
|
||||
@@ -1307,7 +1469,7 @@ if (typeof jQuery === 'undefined') {
|
||||
this.type = type
|
||||
this.$element = $(element)
|
||||
this.options = this.getOptions(options)
|
||||
this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
|
||||
this.$viewport = this.options.viewport && $(document).find($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
|
||||
this.inState = { click: false, hover: false, focus: false }
|
||||
|
||||
if (this.$element[0] instanceof document.constructor && !this.options.selector) {
|
||||
@@ -1340,7 +1502,15 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
|
||||
Tooltip.prototype.getOptions = function (options) {
|
||||
options = $.extend({}, this.getDefaults(), this.$element.data(), options)
|
||||
var dataAttributes = this.$element.data()
|
||||
|
||||
for (var dataAttr in dataAttributes) {
|
||||
if (dataAttributes.hasOwnProperty(dataAttr) && $.inArray(dataAttr, DISALLOWED_ATTRIBUTES) !== -1) {
|
||||
delete dataAttributes[dataAttr]
|
||||
}
|
||||
}
|
||||
|
||||
options = $.extend({}, this.getDefaults(), dataAttributes, options)
|
||||
|
||||
if (options.delay && typeof options.delay == 'number') {
|
||||
options.delay = {
|
||||
@@ -1349,6 +1519,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}
|
||||
}
|
||||
|
||||
if (options.sanitize) {
|
||||
options.template = sanitizeHtml(options.template, options.whiteList, options.sanitizeFn)
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
|
||||
@@ -1460,7 +1634,7 @@ if (typeof jQuery === 'undefined') {
|
||||
.addClass(placement)
|
||||
.data('bs.' + this.type, this)
|
||||
|
||||
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
||||
this.options.container ? $tip.appendTo($(document).find(this.options.container)) : $tip.insertAfter(this.$element)
|
||||
this.$element.trigger('inserted.bs.' + this.type)
|
||||
|
||||
var pos = this.getPosition()
|
||||
@@ -1562,7 +1736,16 @@ if (typeof jQuery === 'undefined') {
|
||||
var $tip = this.tip()
|
||||
var title = this.getTitle()
|
||||
|
||||
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
|
||||
if (this.options.html) {
|
||||
if (this.options.sanitize) {
|
||||
title = sanitizeHtml(title, this.options.whiteList, this.options.sanitizeFn)
|
||||
}
|
||||
|
||||
$tip.find('.tooltip-inner').html(title)
|
||||
} else {
|
||||
$tip.find('.tooltip-inner').text(title)
|
||||
}
|
||||
|
||||
$tip.removeClass('fade in top bottom left right')
|
||||
}
|
||||
|
||||
@@ -1743,6 +1926,9 @@ if (typeof jQuery === 'undefined') {
|
||||
})
|
||||
}
|
||||
|
||||
Tooltip.prototype.sanitizeHtml = function (unsafeHtml) {
|
||||
return sanitizeHtml(unsafeHtml, this.options.whiteList, this.options.sanitizeFn)
|
||||
}
|
||||
|
||||
// TOOLTIP PLUGIN DEFINITION
|
||||
// =========================
|
||||
@@ -1776,10 +1962,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: popover.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#popovers
|
||||
* Bootstrap: popover.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#popovers
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -1796,7 +1982,7 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
|
||||
|
||||
Popover.VERSION = '3.3.7'
|
||||
Popover.VERSION = '3.4.1'
|
||||
|
||||
Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
|
||||
placement: 'right',
|
||||
@@ -1822,10 +2008,25 @@ if (typeof jQuery === 'undefined') {
|
||||
var title = this.getTitle()
|
||||
var content = this.getContent()
|
||||
|
||||
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
|
||||
$tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
|
||||
this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
|
||||
](content)
|
||||
if (this.options.html) {
|
||||
var typeContent = typeof content
|
||||
|
||||
if (this.options.sanitize) {
|
||||
title = this.sanitizeHtml(title)
|
||||
|
||||
if (typeContent === 'string') {
|
||||
content = this.sanitizeHtml(content)
|
||||
}
|
||||
}
|
||||
|
||||
$tip.find('.popover-title').html(title)
|
||||
$tip.find('.popover-content').children().detach().end()[
|
||||
typeContent === 'string' ? 'html' : 'append'
|
||||
](content)
|
||||
} else {
|
||||
$tip.find('.popover-title').text(title)
|
||||
$tip.find('.popover-content').children().detach().end().text(content)
|
||||
}
|
||||
|
||||
$tip.removeClass('fade top bottom left right in')
|
||||
|
||||
@@ -1844,8 +2045,8 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
return $e.attr('data-content')
|
||||
|| (typeof o.content == 'function' ?
|
||||
o.content.call($e[0]) :
|
||||
o.content)
|
||||
o.content.call($e[0]) :
|
||||
o.content)
|
||||
}
|
||||
|
||||
Popover.prototype.arrow = function () {
|
||||
@@ -1885,10 +2086,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: scrollspy.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#scrollspy
|
||||
* Bootstrap: scrollspy.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#scrollspy
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -1914,7 +2115,7 @@ if (typeof jQuery === 'undefined') {
|
||||
this.process()
|
||||
}
|
||||
|
||||
ScrollSpy.VERSION = '3.3.7'
|
||||
ScrollSpy.VERSION = '3.4.1'
|
||||
|
||||
ScrollSpy.DEFAULTS = {
|
||||
offset: 10
|
||||
@@ -2058,10 +2259,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: tab.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#tabs
|
||||
* Bootstrap: tab.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#tabs
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -2078,7 +2279,7 @@ if (typeof jQuery === 'undefined') {
|
||||
// jscs:enable requireDollarBeforejQueryAssignment
|
||||
}
|
||||
|
||||
Tab.VERSION = '3.3.7'
|
||||
Tab.VERSION = '3.4.1'
|
||||
|
||||
Tab.TRANSITION_DURATION = 150
|
||||
|
||||
@@ -2107,7 +2308,7 @@ if (typeof jQuery === 'undefined') {
|
||||
|
||||
if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
|
||||
|
||||
var $target = $(selector)
|
||||
var $target = $(document).find(selector)
|
||||
|
||||
this.activate($this.closest('li'), $ul)
|
||||
this.activate($target, $target.parent(), function () {
|
||||
@@ -2132,15 +2333,15 @@ if (typeof jQuery === 'undefined') {
|
||||
$active
|
||||
.removeClass('active')
|
||||
.find('> .dropdown-menu > .active')
|
||||
.removeClass('active')
|
||||
.removeClass('active')
|
||||
.end()
|
||||
.find('[data-toggle="tab"]')
|
||||
.attr('aria-expanded', false)
|
||||
.attr('aria-expanded', false)
|
||||
|
||||
element
|
||||
.addClass('active')
|
||||
.find('[data-toggle="tab"]')
|
||||
.attr('aria-expanded', true)
|
||||
.attr('aria-expanded', true)
|
||||
|
||||
if (transition) {
|
||||
element[0].offsetWidth // reflow for transition
|
||||
@@ -2152,10 +2353,10 @@ if (typeof jQuery === 'undefined') {
|
||||
if (element.parent('.dropdown-menu').length) {
|
||||
element
|
||||
.closest('li.dropdown')
|
||||
.addClass('active')
|
||||
.addClass('active')
|
||||
.end()
|
||||
.find('[data-toggle="tab"]')
|
||||
.attr('aria-expanded', true)
|
||||
.attr('aria-expanded', true)
|
||||
}
|
||||
|
||||
callback && callback()
|
||||
@@ -2214,10 +2415,10 @@ if (typeof jQuery === 'undefined') {
|
||||
}(jQuery);
|
||||
|
||||
/* ========================================================================
|
||||
* Bootstrap: affix.js v3.3.7
|
||||
* http://getbootstrap.com/javascript/#affix
|
||||
* Bootstrap: affix.js v3.4.1
|
||||
* https://getbootstrap.com/docs/3.4/javascript/#affix
|
||||
* ========================================================================
|
||||
* Copyright 2011-2016 Twitter, Inc.
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
@@ -2231,7 +2432,9 @@ if (typeof jQuery === 'undefined') {
|
||||
var Affix = function (element, options) {
|
||||
this.options = $.extend({}, Affix.DEFAULTS, options)
|
||||
|
||||
this.$target = $(this.options.target)
|
||||
var target = this.options.target === Affix.DEFAULTS.target ? $(this.options.target) : $(document).find(this.options.target)
|
||||
|
||||
this.$target = target
|
||||
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
|
||||
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
|
||||
|
||||
@@ -2243,7 +2446,7 @@ if (typeof jQuery === 'undefined') {
|
||||
this.checkPosition()
|
||||
}
|
||||
|
||||
Affix.VERSION = '3.3.7'
|
||||
Affix.VERSION = '3.4.1'
|
||||
|
||||
Affix.RESET = 'affix affix-top affix-bottom'
|
||||
|
||||
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));
|
||||
}
|
||||
@@ -16,7 +16,136 @@
|
||||
|
||||
window.Entropy = new (function() {
|
||||
|
||||
var TWO = new libs.BigInteger.BigInteger(2);
|
||||
let eventBits = {
|
||||
|
||||
"binary": {
|
||||
"0": "0",
|
||||
"1": "1",
|
||||
},
|
||||
|
||||
// log2(6) = 2.58496 bits per roll, with bias
|
||||
// 4 rolls give 2 bits each
|
||||
// 2 rolls give 1 bit each
|
||||
// Average (4*2 + 2*1) / 6 = 1.66 bits per roll without bias
|
||||
"base 6": {
|
||||
"0": "00",
|
||||
"1": "01",
|
||||
"2": "10",
|
||||
"3": "11",
|
||||
"4": "0",
|
||||
"5": "1",
|
||||
},
|
||||
|
||||
// log2(6) = 2.58496 bits per roll, with bias
|
||||
// 4 rolls give 2 bits each
|
||||
// 2 rolls give 1 bit each
|
||||
// Average (4*2 + 2*1) / 6 = 1.66 bits per roll without bias
|
||||
"base 6 (dice)": {
|
||||
"0": "00", // equivalent to 0 in base 6
|
||||
"1": "01",
|
||||
"2": "10",
|
||||
"3": "11",
|
||||
"4": "0",
|
||||
"5": "1",
|
||||
},
|
||||
|
||||
// log2(10) = 3.321928 bits per digit, with bias
|
||||
// 8 digits give 3 bits each
|
||||
// 2 digits give 1 bit each
|
||||
// Average (8*3 + 2*1) / 10 = 2.6 bits per digit without bias
|
||||
"base 10": {
|
||||
"0": "000",
|
||||
"1": "001",
|
||||
"2": "010",
|
||||
"3": "011",
|
||||
"4": "100",
|
||||
"5": "101",
|
||||
"6": "110",
|
||||
"7": "111",
|
||||
"8": "0",
|
||||
"9": "1",
|
||||
},
|
||||
|
||||
"hexadecimal": {
|
||||
"0": "0000",
|
||||
"1": "0001",
|
||||
"2": "0010",
|
||||
"3": "0011",
|
||||
"4": "0100",
|
||||
"5": "0101",
|
||||
"6": "0110",
|
||||
"7": "0111",
|
||||
"8": "1000",
|
||||
"9": "1001",
|
||||
"a": "1010",
|
||||
"b": "1011",
|
||||
"c": "1100",
|
||||
"d": "1101",
|
||||
"e": "1110",
|
||||
"f": "1111",
|
||||
},
|
||||
|
||||
// log2(52) = 5.7004 bits per card, with bias
|
||||
// 32 cards give 5 bits each
|
||||
// 16 cards give 4 bits each
|
||||
// 4 cards give 2 bits each
|
||||
// Average (32*5 + 16*4 + 4*2) / 52 = 4.46 bits per card without bias
|
||||
"card": {
|
||||
"ac": "00000",
|
||||
"2c": "00001",
|
||||
"3c": "00010",
|
||||
"4c": "00011",
|
||||
"5c": "00100",
|
||||
"6c": "00101",
|
||||
"7c": "00110",
|
||||
"8c": "00111",
|
||||
"9c": "01000",
|
||||
"tc": "01001",
|
||||
"jc": "01010",
|
||||
"qc": "01011",
|
||||
"kc": "01100",
|
||||
"ad": "01101",
|
||||
"2d": "01110",
|
||||
"3d": "01111",
|
||||
"4d": "10000",
|
||||
"5d": "10001",
|
||||
"6d": "10010",
|
||||
"7d": "10011",
|
||||
"8d": "10100",
|
||||
"9d": "10101",
|
||||
"td": "10110",
|
||||
"jd": "10111",
|
||||
"qd": "11000",
|
||||
"kd": "11001",
|
||||
"ah": "11010",
|
||||
"2h": "11011",
|
||||
"3h": "11100",
|
||||
"4h": "11101",
|
||||
"5h": "11110",
|
||||
"6h": "11111",
|
||||
"7h": "0000",
|
||||
"8h": "0001",
|
||||
"9h": "0010",
|
||||
"th": "0011",
|
||||
"jh": "0100",
|
||||
"qh": "0101",
|
||||
"kh": "0110",
|
||||
"as": "0111",
|
||||
"2s": "1000",
|
||||
"3s": "1001",
|
||||
"4s": "1010",
|
||||
"5s": "1011",
|
||||
"6s": "1100",
|
||||
"7s": "1101",
|
||||
"8s": "1110",
|
||||
"9s": "1111",
|
||||
"ts": "00",
|
||||
"js": "01",
|
||||
"qs": "10",
|
||||
"ks": "11",
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
// matchers returns an array of the matched events for each type of entropy.
|
||||
// eg
|
||||
@@ -51,48 +180,28 @@ window.Entropy = new (function() {
|
||||
}
|
||||
}
|
||||
|
||||
// Convert array of cards from ["ac", "4d", "ks"]
|
||||
// to numbers between 0 and 51 [0, 16, 51]
|
||||
function convertCardsToInts(cards) {
|
||||
var ints = [];
|
||||
var values = "a23456789tjqk";
|
||||
var suits = "cdhs";
|
||||
for (var i=0; i<cards.length; i++) {
|
||||
var card = cards[i].toLowerCase();
|
||||
var value = card[0];
|
||||
var suit = card[1];
|
||||
var asInt = 13 * suits.indexOf(suit) + values.indexOf(value);
|
||||
ints.push(asInt);
|
||||
}
|
||||
return ints;
|
||||
}
|
||||
|
||||
this.fromString = function(rawEntropyStr, baseStr) {
|
||||
// Find type of entropy being used (binary, hex, dice etc)
|
||||
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") {
|
||||
var newParts = [];
|
||||
var newInts = [];
|
||||
for (var i=0; i<base.parts.length; i++) {
|
||||
var c = base.parts[i];
|
||||
var newEvents = [];
|
||||
for (var i=0; i<base.events.length; i++) {
|
||||
var c = base.events[i];
|
||||
if ("12345".indexOf(c) > -1) {
|
||||
newParts[i] = base.parts[i];
|
||||
newInts[i] = base.ints[i];
|
||||
newEvents[i] = base.events[i];
|
||||
}
|
||||
else {
|
||||
newParts[i] = "0";
|
||||
newInts[i] = 0;
|
||||
newEvents[i] = "0";
|
||||
}
|
||||
}
|
||||
base.str = "base 6 (dice)";
|
||||
base.ints = newInts;
|
||||
base.parts = newParts;
|
||||
base.events = newEvents;
|
||||
base.matcher = matchers.base6;
|
||||
}
|
||||
// Detect empty entropy
|
||||
if (base.parts.length == 0) {
|
||||
if (base.events.length == 0) {
|
||||
return {
|
||||
binaryStr: "",
|
||||
cleanStr: "",
|
||||
@@ -100,44 +209,23 @@ window.Entropy = new (function() {
|
||||
base: base,
|
||||
};
|
||||
}
|
||||
// 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 = libs.BigInteger.BigInteger.ZERO;
|
||||
for (var i=base.ints.length-1; i>=0; i--) {
|
||||
var thisInt = libs.BigInteger.BigInteger.parse(base.ints[i]);
|
||||
var power = (base.ints.length - 1) - i;
|
||||
var additionalEntropy = libs.BigInteger.BigInteger.parse(base.asInt).pow(power).multiply(thisInt);
|
||||
entropyInt = entropyInt.add(additionalEntropy);
|
||||
}
|
||||
// Convert entropy to binary
|
||||
var entropyBin = entropyInt.toString(2);
|
||||
// If the first integer is small, it must be padded with zeros.
|
||||
// Otherwise the chance of the first bit being 1 is 100%, which is
|
||||
// obviously incorrect.
|
||||
// This is not perfect for non-2^n bases.
|
||||
var expectedBits = Math.floor(base.parts.length * Math.log2(base.asInt));
|
||||
while (entropyBin.length < expectedBits) {
|
||||
entropyBin = "0" + entropyBin;
|
||||
}
|
||||
// Calculate the number of bits per event
|
||||
var bitsPerEvent = Math.log2(base.asInt);
|
||||
// Cards binary must be handled differently, since they're not replaced
|
||||
if (base.asInt == 52) {
|
||||
var cardEntropy = processCardEntropy(base.parts);
|
||||
entropyBin = cardEntropy.binaryStr;
|
||||
bitsPerEvent = cardEntropy.bitsPerEvent;
|
||||
}
|
||||
// Convert entropy events to binary
|
||||
var entropyBin = base.events.map(function(e) {
|
||||
return eventBits[base.str][e.toLowerCase()];
|
||||
}).join("");
|
||||
// Get average bits per event
|
||||
// which may be adjusted for bias if log2(base) is fractional
|
||||
var bitsPerEvent = base.bitsPerEvent;
|
||||
// Supply a 'filtered' entropy string for display purposes
|
||||
var entropyClean = base.parts.join("");
|
||||
var entropyHtml = base.parts.join("");
|
||||
var entropyClean = base.events.join("");
|
||||
var entropyHtml = base.events.join("");
|
||||
if (base.asInt == 52) {
|
||||
entropyClean = base.parts.join(" ").toUpperCase();
|
||||
entropyClean = base.events.join(" ").toUpperCase();
|
||||
entropyClean = entropyClean.replace(/C/g, "\u2663");
|
||||
entropyClean = entropyClean.replace(/D/g, "\u2666");
|
||||
entropyClean = entropyClean.replace(/H/g, "\u2665");
|
||||
entropyClean = entropyClean.replace(/S/g, "\u2660");
|
||||
entropyHtml = base.parts.join(" ").toUpperCase();
|
||||
entropyHtml = base.events.join(" ").toUpperCase();
|
||||
entropyHtml = entropyHtml.replace(/C/g, "<span class='card-suit club'>\u2663</span>");
|
||||
entropyHtml = entropyHtml.replace(/D/g, "<span class='card-suit diamond'>\u2666</span>");
|
||||
entropyHtml = entropyHtml.replace(/H/g, "<span class='card-suit heart'>\u2665</span>");
|
||||
@@ -154,18 +242,6 @@ window.Entropy = new (function() {
|
||||
return e;
|
||||
}
|
||||
|
||||
function getSortedDeck() {
|
||||
var s = [];
|
||||
var suits = "CDHS";
|
||||
var values = "A23456789TJQK";
|
||||
for (var i=0; i<suits.length; i++) {
|
||||
for (var j=0; j<values.length; j++) {
|
||||
s.push(values[j]+suits[i]);
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
function getBase(str, baseStr) {
|
||||
// Need to get the lowest base for the supplied entropy.
|
||||
// This prevents interpreting, say, dice rolls as hexadecimal.
|
||||
@@ -177,20 +253,21 @@ window.Entropy = new (function() {
|
||||
var ints = binaryMatches.map(function(i) { return parseInt(i, 2) });
|
||||
return {
|
||||
ints: ints,
|
||||
parts: binaryMatches,
|
||||
events: binaryMatches,
|
||||
matcher: matchers.binary,
|
||||
asInt: 2,
|
||||
bitsPerEvent: 1,
|
||||
str: "binary",
|
||||
}
|
||||
}
|
||||
var cardMatches = matchers.card(str);
|
||||
if ((cardMatches.length >= hexMatches.length / 2 && autodetect) || baseStr === "card") {
|
||||
var ints = convertCardsToInts(cardMatches);
|
||||
return {
|
||||
ints: ints,
|
||||
parts: cardMatches,
|
||||
events: cardMatches,
|
||||
matcher: matchers.card,
|
||||
asInt: 52,
|
||||
bitsPerEvent: (32*5 + 16*4 + 4*2) / 52, // see cardBits
|
||||
str: "card",
|
||||
}
|
||||
}
|
||||
@@ -199,9 +276,10 @@ window.Entropy = new (function() {
|
||||
var ints = diceMatches.map(function(i) { return parseInt(i) });
|
||||
return {
|
||||
ints: ints,
|
||||
parts: diceMatches,
|
||||
events: diceMatches,
|
||||
matcher: matchers.dice,
|
||||
asInt: 6,
|
||||
bitsPerEvent: (4*2 + 2*1) / 6, // see diceBits
|
||||
str: "dice",
|
||||
}
|
||||
}
|
||||
@@ -210,9 +288,10 @@ window.Entropy = new (function() {
|
||||
var ints = base6Matches.map(function(i) { return parseInt(i) });
|
||||
return {
|
||||
ints: ints,
|
||||
parts: base6Matches,
|
||||
events: base6Matches,
|
||||
matcher: matchers.base6,
|
||||
asInt: 6,
|
||||
bitsPerEvent: (4*2 + 2*1) / 6, // see diceBits
|
||||
str: "base 6",
|
||||
}
|
||||
}
|
||||
@@ -221,126 +300,22 @@ window.Entropy = new (function() {
|
||||
var ints = base10Matches.map(function(i) { return parseInt(i) });
|
||||
return {
|
||||
ints: ints,
|
||||
parts: base10Matches,
|
||||
events: base10Matches,
|
||||
matcher: matchers.base10,
|
||||
asInt: 10,
|
||||
bitsPerEvent: (8*3 + 2*1) / 10, // see b10Bits
|
||||
str: "base 10",
|
||||
}
|
||||
}
|
||||
var ints = hexMatches.map(function(i) { return parseInt(i, 16) });
|
||||
return {
|
||||
ints: ints,
|
||||
parts: hexMatches,
|
||||
events: hexMatches,
|
||||
matcher: matchers.hex,
|
||||
asInt: 16,
|
||||
bitsPerEvent: 4,
|
||||
str: "hexadecimal",
|
||||
}
|
||||
}
|
||||
|
||||
// Assume cards are NOT replaced.
|
||||
// Additional entropy decreases as more cards are used. This means
|
||||
// total possible entropy is measured using n!, not base^n.
|
||||
// eg the second last card can be only one of two, not one of fifty two
|
||||
// so the added entropy for that card is only one bit at most
|
||||
function processCardEntropy(cards) {
|
||||
// Track how many instances of each card have been used, and thus
|
||||
// how many decks are in use.
|
||||
var cardCounts = {};
|
||||
var numberOfDecks = 0;
|
||||
// Work out number of decks by max(duplicates)
|
||||
for (var i=0; i<cards.length; i++) {
|
||||
// Get the card that was drawn
|
||||
var cardLower = cards[i];
|
||||
var card = cardLower.toUpperCase();
|
||||
// Initialize the count for this card if needed
|
||||
if (!(card in cardCounts)) {
|
||||
cardCounts[card] = 0;
|
||||
}
|
||||
cardCounts[card] += 1;
|
||||
// See if this is max(duplicates)
|
||||
if (cardCounts[card] > numberOfDecks) {
|
||||
numberOfDecks = cardCounts[card];
|
||||
}
|
||||
}
|
||||
// Work out the total number of bits for this many decks
|
||||
// See http://crypto.stackexchange.com/q/41886
|
||||
var gainedBits = 0;
|
||||
// Equivalent of Math.log2(factorial(52*numberOfDecks))
|
||||
// which becomes infinity for numberOfDecks > 4
|
||||
for (var i=1; i<=52*numberOfDecks; i++) {
|
||||
gainedBits = gainedBits + Math.log2(i);
|
||||
}
|
||||
var lostBits = 52 * Math.log2(factorial(numberOfDecks));
|
||||
var maxBits = gainedBits - lostBits;
|
||||
// Convert the drawn cards to a binary representation.
|
||||
// The exact technique for doing this is unclear.
|
||||
// See
|
||||
// http://crypto.stackexchange.com/a/41896
|
||||
// "I even doubt that this is well defined (only the average entropy
|
||||
// is, I believe)."
|
||||
// See
|
||||
// https://github.com/iancoleman/bip39/issues/33#issuecomment-263021856
|
||||
// "The binary representation can be the first log(permutations,2) bits
|
||||
// of the sha-2 hash of the normalized deck string."
|
||||
//
|
||||
// In this specific implementation, the first N bits of the hash of the
|
||||
// normalized cards string is being used. Uppercase, no spaces; eg
|
||||
// sha256("AH8DQSTC2H")
|
||||
var totalCards = numberOfDecks * 52;
|
||||
var percentUsed = cards.length / totalCards;
|
||||
// Calculate the average number of bits of entropy for the number of
|
||||
// cards drawn.
|
||||
var numberOfBits = Math.floor(maxBits * percentUsed);
|
||||
// Create a normalized string of the selected cards
|
||||
var normalizedCards = cards.join("").toUpperCase();
|
||||
// Convert to binary using the SHA256 hash of the normalized cards.
|
||||
// If the number of bits is more than 256, multiple hashes
|
||||
// are used until the required number of bits is reached.
|
||||
var entropyBin = "";
|
||||
var iterations = 0;
|
||||
while (entropyBin.length < numberOfBits) {
|
||||
var hashedCards = sjcl.hash.sha256.hash(normalizedCards + ":" + iterations);
|
||||
var hashHex = sjcl.codec.hex.fromBits(hashedCards);
|
||||
for (var i=0; i<hashHex.length; i++) {
|
||||
var decimal = parseInt(hashHex[i], 16);
|
||||
var binary = decimal.toString(2);
|
||||
while (binary.length < 4) {
|
||||
binary = "0" + binary;
|
||||
}
|
||||
entropyBin = entropyBin + binary;
|
||||
}
|
||||
iterations = iterations + 1;
|
||||
}
|
||||
// Truncate to the appropriate number of bits.
|
||||
entropyBin = entropyBin.substring(0, numberOfBits);
|
||||
// Get the number of bits per event
|
||||
bitsPerEvent = maxBits / totalCards;
|
||||
return {
|
||||
binaryStr: entropyBin,
|
||||
bitsPerEvent: bitsPerEvent,
|
||||
}
|
||||
}
|
||||
|
||||
// Polyfill for Math.log2
|
||||
// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log2#Polyfill
|
||||
Math.log2 = Math.log2 || function(x) {
|
||||
// The polyfill isn't good enough because of the poor accuracy of
|
||||
// Math.LOG2E
|
||||
// log2(8) gave 2.9999999999999996 which when floored causes issues.
|
||||
// So instead use the BigInteger library to get it right.
|
||||
return libs.BigInteger.BigInteger.log(x) / libs.BigInteger.BigInteger.log(2);
|
||||
};
|
||||
|
||||
// Depends on BigInteger
|
||||
function factorial(n) {
|
||||
if (n == 0) {
|
||||
return 1;
|
||||
}
|
||||
f = libs.BigInteger.BigInteger.ONE;
|
||||
for (var i=1; i<=n; i++) {
|
||||
f = f.multiply(new libs.BigInteger.BigInteger(i));
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
7415
src/js/eos-util.js
7415
src/js/eos-util.js
File diff suppressed because it is too large
Load Diff
379
src/js/index.js
379
src/js/index.js
@@ -44,9 +44,15 @@
|
||||
DOM.entropyWordIndexes = DOM.entropyContainer.find(".word-indexes");
|
||||
DOM.entropyChecksum = DOM.entropyContainer.find(".checksum");
|
||||
DOM.entropyMnemonicLength = DOM.entropyContainer.find(".mnemonic-length");
|
||||
DOM.pbkdf2Rounds = DOM.entropyContainer.find(".pbkdf2-rounds");
|
||||
DOM.pbkdf2CustomInput = DOM.entropyContainer.find("#pbkdf2-custom-input");
|
||||
DOM.pbkdf2InfosDanger = $(".PBKDF2-infos-danger");
|
||||
DOM.entropyWeakEntropyOverrideWarning = DOM.entropyContainer.find(".weak-entropy-override-warning");
|
||||
DOM.entropyFilterWarning = DOM.entropyContainer.find(".filter-warning");
|
||||
DOM.phrase = $(".phrase");
|
||||
DOM.autoCompute = $(".autoCompute");
|
||||
DOM.splitMnemonic = $(".splitMnemonic");
|
||||
DOM.showSplitMnemonic = $(".showSplitMnemonic");
|
||||
DOM.phraseSplit = $(".phraseSplit");
|
||||
DOM.phraseSplitWarn = $(".phraseSplitWarn");
|
||||
DOM.passphrase = $(".passphrase");
|
||||
@@ -92,6 +98,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");
|
||||
@@ -129,15 +147,20 @@
|
||||
DOM.network.on("change", networkChanged);
|
||||
DOM.bip32Client.on("change", bip32ClientChanged);
|
||||
DOM.useEntropy.on("change", setEntropyVisibility);
|
||||
DOM.autoCompute.on("change", delayedPhraseChanged);
|
||||
DOM.entropy.on("input", delayedEntropyChanged);
|
||||
DOM.entropyMnemonicLength.on("change", entropyChanged);
|
||||
DOM.pbkdf2Rounds.on("change", pbkdf2RoundsChanged);
|
||||
DOM.pbkdf2CustomInput.on("change", pbkdf2RoundsChanged);
|
||||
DOM.entropyTypeInputs.on("change", entropyTypeChanged);
|
||||
DOM.phrase.on("input", delayedPhraseChanged);
|
||||
DOM.showSplitMnemonic.on("change", toggleSplitMnemonic);
|
||||
DOM.passphrase.on("input", delayedPhraseChanged);
|
||||
DOM.generate.on("click", generateClicked);
|
||||
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);
|
||||
@@ -146,6 +169,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);
|
||||
@@ -189,7 +217,7 @@
|
||||
network.onSelect();
|
||||
adjustNetworkForSegwit();
|
||||
if (seed != null) {
|
||||
phraseChanged();
|
||||
seedChanged()
|
||||
}
|
||||
else {
|
||||
rootKeyChanged();
|
||||
@@ -204,15 +232,14 @@
|
||||
else {
|
||||
DOM.bip32path.prop("readonly", true);
|
||||
clients[clientIndex].onSelect();
|
||||
if (seed != null) {
|
||||
phraseChanged();
|
||||
}
|
||||
else {
|
||||
rootKeyChanged();
|
||||
}
|
||||
rootKeyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
function isUsingAutoCompute() {
|
||||
return DOM.autoCompute.prop("checked");
|
||||
}
|
||||
|
||||
function setEntropyVisibility() {
|
||||
if (isUsingOwnEntropy()) {
|
||||
DOM.entropyContainer.removeClass("hidden");
|
||||
@@ -230,6 +257,8 @@
|
||||
}
|
||||
|
||||
function delayedPhraseChanged() {
|
||||
|
||||
if(isUsingAutoCompute()) {
|
||||
hideValidationError();
|
||||
seed = null;
|
||||
bip32RootKey = null;
|
||||
@@ -249,6 +278,11 @@
|
||||
entropyTypeAutoDetect = false;
|
||||
}
|
||||
}, 400);
|
||||
} else {
|
||||
clearDisplay();
|
||||
clearEntropyFeedback();
|
||||
showValidationError("Auto compute is disabled");
|
||||
}
|
||||
}
|
||||
|
||||
function phraseChanged() {
|
||||
@@ -265,6 +299,7 @@
|
||||
var passphrase = DOM.passphrase.val();
|
||||
calcBip32RootKeyFromSeed(phrase, passphrase);
|
||||
calcForDerivationPath();
|
||||
calcBip85();
|
||||
// Show the word indexes
|
||||
showWordIndexes();
|
||||
writeSplitPhrase(phrase);
|
||||
@@ -274,6 +309,7 @@
|
||||
showPending();
|
||||
adjustNetworkForSegwit();
|
||||
var phrase = DOM.phrase.val();
|
||||
var seed = DOM.seed.val();
|
||||
if (phrase != "") {
|
||||
// Calculate and display for mnemonic
|
||||
var errorText = findPhraseErrors(phrase);
|
||||
@@ -285,6 +321,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();
|
||||
@@ -308,6 +349,24 @@
|
||||
entropyChangeTimeoutEvent = setTimeout(entropyChanged, 400);
|
||||
}
|
||||
|
||||
function pbkdf2RoundsChanged() {
|
||||
if (DOM.pbkdf2Rounds.val() == "custom") {
|
||||
PBKDF2_ROUNDS = DOM.pbkdf2CustomInput.val();
|
||||
DOM.pbkdf2CustomInput.removeClass("hidden");
|
||||
} else {
|
||||
PBKDF2_ROUNDS = DOM.pbkdf2Rounds.val();
|
||||
DOM.pbkdf2CustomInput.addClass("hidden");
|
||||
}
|
||||
ispbkdf2Rounds2048();
|
||||
phraseChanged();
|
||||
}
|
||||
function ispbkdf2Rounds2048() {
|
||||
if (PBKDF2_ROUNDS == 2048) {
|
||||
DOM.pbkdf2InfosDanger.addClass("hidden");
|
||||
} else {
|
||||
DOM.pbkdf2InfosDanger.removeClass("hidden");
|
||||
}
|
||||
}
|
||||
function entropyChanged() {
|
||||
// If blank entropy, clear mnemonic, addresses, errors
|
||||
if (DOM.entropy.val().trim().length == 0) {
|
||||
@@ -401,6 +460,7 @@
|
||||
}
|
||||
// Calculate and display
|
||||
calcForDerivationPath();
|
||||
calcBip85();
|
||||
}
|
||||
|
||||
function rootKeyChanged() {
|
||||
@@ -415,6 +475,7 @@
|
||||
// Calculate and display
|
||||
calcBip32RootKeyFromBase58(rootKeyBase58);
|
||||
calcForDerivationPath();
|
||||
calcBip85();
|
||||
}
|
||||
|
||||
function litecoinUseLtubChanged() {
|
||||
@@ -425,7 +486,90 @@
|
||||
else {
|
||||
network = libs.bitcoin.networks.litecoinXprv;
|
||||
}
|
||||
phraseChanged();
|
||||
// Can't use rootKeyChanged because validation will fail as we changed
|
||||
// the network but the version bytes stayed as previously.
|
||||
seedChanged();
|
||||
}
|
||||
|
||||
function toggleSplitMnemonic() {
|
||||
if (DOM.showSplitMnemonic.prop("checked")) {
|
||||
DOM.splitMnemonic.removeClass("hidden");
|
||||
}
|
||||
else {
|
||||
DOM.splitMnemonic.addClass("hidden");
|
||||
}
|
||||
}
|
||||
|
||||
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() {
|
||||
@@ -463,6 +607,14 @@
|
||||
if (isUsingOwnEntropy()) {
|
||||
return;
|
||||
}
|
||||
// Pressing enter on BIP85 index field triggers generate click event.
|
||||
// See https://github.com/iancoleman/bip39/issues/634
|
||||
// To cancel the incorrect generation process, stop here if generate is
|
||||
// not focused.
|
||||
var buttonIsFocused = DOM.generate[0].contains(document.activeElement);
|
||||
if (!buttonIsFocused) {
|
||||
return;
|
||||
}
|
||||
clearDisplay();
|
||||
showPending();
|
||||
setTimeout(function() {
|
||||
@@ -490,7 +642,7 @@
|
||||
}
|
||||
|
||||
function bitcoinCashAddressTypeChange() {
|
||||
phraseChanged();
|
||||
rootKeyChanged();
|
||||
}
|
||||
|
||||
function toggleIndexes() {
|
||||
@@ -1136,7 +1288,18 @@
|
||||
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
|
||||
if (networks[DOM.network.val()].name == "TRX - Tron") {
|
||||
keyPair = new libs.bitcoin.ECPair(keyPair.d, null, { network: network, compressed: false });
|
||||
var pubkeyBuffer = keyPair.getPublicKeyBuffer();
|
||||
var ethPubkey = libs.ethUtil.importPublic(pubkeyBuffer);
|
||||
var addressBuffer = libs.ethUtil.publicToAddress(ethPubkey);
|
||||
address = libs.bitcoin.address.toBase58Check(addressBuffer, 0x41);
|
||||
if (hasPrivkey) {
|
||||
privkey = keyPair.d.toBuffer().toString('hex');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1186,6 +1349,15 @@
|
||||
privkey = keypair.secret();
|
||||
pubkey = address = keypair.publicKey();
|
||||
}
|
||||
|
||||
// Nano currency
|
||||
if (networks[DOM.network.val()].name == "NANO - Nano") {
|
||||
var nanoKeypair = libs.nanoUtil.getKeypair(index, seed);
|
||||
privkey = nanoKeypair.privKey;
|
||||
pubkey = nanoKeypair.pubKey;
|
||||
address = nanoKeypair.address;
|
||||
}
|
||||
|
||||
if ((networks[DOM.network.val()].name == "NAS - Nebulas")) {
|
||||
var privKeyBuffer = keyPair.d.toBuffer(32);
|
||||
var nebulasAccount = libs.nebulas.Account.NewAccount();
|
||||
@@ -1226,6 +1398,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) {
|
||||
@@ -1266,8 +1459,8 @@
|
||||
|
||||
if (networks[DOM.network.val()].name == "EOS - EOSIO") {
|
||||
address = ""
|
||||
pubkey = eosUtil.bufferToPublic(keyPair.getPublicKeyBuffer());
|
||||
privkey = eosUtil.bufferToPrivate(keyPair.d.toBuffer(32));
|
||||
pubkey = EOSbufferToPublic(keyPair.getPublicKeyBuffer());
|
||||
privkey = EOSbufferToPrivate(keyPair.d.toBuffer(32));
|
||||
}
|
||||
|
||||
if (networks[DOM.network.val()].name == "FIO - Foundation for Interwallet Operability") {
|
||||
@@ -1276,7 +1469,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) {
|
||||
@@ -1726,7 +1953,7 @@
|
||||
var numberOfBits = entropy.binaryStr.length;
|
||||
var timeToCrack = "unknown";
|
||||
try {
|
||||
var z = libs.zxcvbn(entropy.base.parts.join(""));
|
||||
var z = libs.zxcvbn(entropy.base.events.join(""));
|
||||
timeToCrack = z.crack_times_display.offline_fast_hashing_1e10_per_second;
|
||||
if (z.feedback.warning != "") {
|
||||
timeToCrack = timeToCrack + " - " + z.feedback.warning;
|
||||
@@ -1745,7 +1972,7 @@
|
||||
DOM.entropyFiltered.html(entropy.cleanHtml);
|
||||
DOM.entropyType.text(entropyTypeStr);
|
||||
DOM.entropyCrackTime.text(timeToCrack);
|
||||
DOM.entropyEventCount.text(entropy.base.ints.length);
|
||||
DOM.entropyEventCount.text(entropy.base.events.length);
|
||||
DOM.entropyBits.text(numberOfBits);
|
||||
DOM.entropyWordCount.text(wordCount);
|
||||
DOM.entropyBinary.text(spacedBinaryStr);
|
||||
@@ -1770,8 +1997,8 @@
|
||||
// Detect duplicates
|
||||
var dupes = [];
|
||||
var dupeTracker = {};
|
||||
for (var i=0; i<entropy.base.parts.length; i++) {
|
||||
var card = entropy.base.parts[i];
|
||||
for (var i=0; i<entropy.base.events.length; i++) {
|
||||
var card = entropy.base.events[i];
|
||||
var cardUpper = card.toUpperCase();
|
||||
if (cardUpper in dupeTracker) {
|
||||
dupes.push(card);
|
||||
@@ -1887,6 +2114,7 @@
|
||||
|| (name == "ESN - Ethersocial Network")
|
||||
|| (name == "VET - VeChain")
|
||||
|| (name == "ERE - EtherCore")
|
||||
|| (name == "BSC - Binance Smart Chain")
|
||||
}
|
||||
|
||||
function networkIsRsk() {
|
||||
@@ -2090,6 +2318,13 @@
|
||||
setHdCoin(357);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "ATOM - Cosmos Hub",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.bitcoin;
|
||||
setHdCoin(118);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "AUR - Auroracoin",
|
||||
onSelect: function() {
|
||||
@@ -2232,6 +2467,20 @@
|
||||
setHdCoin(183);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "BTCPt - Bitcoin Private Testnet",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.bitcoinprivatetestnet;
|
||||
setHdCoin(1);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "BSC - Binance Smart Chain",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.bitcoin;
|
||||
setHdCoin(60);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "BSV - BitcoinSV",
|
||||
onSelect: function() {
|
||||
@@ -2395,6 +2644,20 @@
|
||||
setHdCoin(18);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "DIVI - DIVI",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.divi;
|
||||
setHdCoin(301);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "DIVI - DIVI Testnet",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.divitestnet;
|
||||
setHdCoin(1);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "DMD - Diamond",
|
||||
onSelect: function() {
|
||||
@@ -2553,7 +2816,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() {
|
||||
@@ -2680,6 +2950,13 @@
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "IOV - Starname",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.bitcoin;
|
||||
setHdCoin(234);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "IXC - Ixcoin",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.ixcoin;
|
||||
@@ -2768,6 +3045,13 @@
|
||||
setHdCoin(221);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "LUNA - Terra",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.bitcoin;
|
||||
setHdCoin(330);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "LYNX - Lynx",
|
||||
onSelect: function() {
|
||||
@@ -2834,6 +3118,13 @@
|
||||
setHdCoin(184);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "NANO - Nano",
|
||||
onSelect: function() {
|
||||
network = network = libs.nanoUtil.dummyNetwork;
|
||||
setHdCoin(165);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "NAV - Navcoin",
|
||||
onSelect: function() {
|
||||
@@ -2946,6 +3237,13 @@
|
||||
setHdCoin(174);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "PART - Particl",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.particl;
|
||||
setHdCoin(44);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "PHR - Phore",
|
||||
onSelect: function() {
|
||||
@@ -3074,6 +3372,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() {
|
||||
@@ -3088,6 +3400,13 @@
|
||||
setHdCoin(19165);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "SCRIBE - Scribe",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.scribe;
|
||||
setHdCoin(545);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "SLS - Salus",
|
||||
onSelect: function() {
|
||||
@@ -3221,6 +3540,12 @@
|
||||
setHdCoin(159);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "TRX - Tron",
|
||||
onSelect: function() {
|
||||
setHdCoin(195);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "TWINS - TWINS",
|
||||
onSelect: function() {
|
||||
@@ -3370,19 +3695,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() {
|
||||
@@ -3404,6 +3736,13 @@
|
||||
setHdCoin(121);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "XWC - Whitecoin",
|
||||
onSelect: function() {
|
||||
network = libs.bitcoin.networks.bitcoin;
|
||||
setHdCoin(559);
|
||||
},
|
||||
}
|
||||
]
|
||||
|
||||
var clients = [
|
||||
|
||||
@@ -28,7 +28,9 @@
|
||||
|
||||
var Mnemonic = function(language) {
|
||||
|
||||
var PBKDF2_ROUNDS = 2048;
|
||||
var DOM = {};
|
||||
DOM.entropyContainer = $(".entropy-container");
|
||||
PBKDF2_ROUNDS = DOM.entropyContainer.find(".pbkdf2-rounds").val();
|
||||
var RADIX = 2048;
|
||||
|
||||
var self = this;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
501
tests/package-lock.json
generated
Normal file
501
tests/package-lock.json
generated
Normal file
@@ -0,0 +1,501 @@
|
||||
{
|
||||
"name": "tests",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "tests",
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"jasmine": "^3.9.0",
|
||||
"selenium-webdriver": "^3.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/balanced-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||
},
|
||||
"node_modules/core-util-is": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
|
||||
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
|
||||
},
|
||||
"node_modules/fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||
},
|
||||
"node_modules/glob": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
|
||||
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
|
||||
"dependencies": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/immediate": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
|
||||
"integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps="
|
||||
},
|
||||
"node_modules/inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"dependencies": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||
},
|
||||
"node_modules/isarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
||||
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
|
||||
},
|
||||
"node_modules/jasmine": {
|
||||
"version": "3.9.0",
|
||||
"resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.9.0.tgz",
|
||||
"integrity": "sha512-JgtzteG7xnqZZ51fg7N2/wiQmXon09szkALcRMTgCMX4u/m17gVJFjObnvw5FXkZOWuweHPaPRVB6DI2uN0wVA==",
|
||||
"dependencies": {
|
||||
"glob": "^7.1.6",
|
||||
"jasmine-core": "~3.9.0"
|
||||
},
|
||||
"bin": {
|
||||
"jasmine": "bin/jasmine.js"
|
||||
}
|
||||
},
|
||||
"node_modules/jasmine-core": {
|
||||
"version": "3.9.0",
|
||||
"resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.9.0.tgz",
|
||||
"integrity": "sha512-Tv3kVbPCGVrjsnHBZ38NsPU3sDOtNa0XmbG2baiyJqdb5/SPpDO6GVwJYtUryl6KB4q1Ssckwg612ES9Z0dreQ=="
|
||||
},
|
||||
"node_modules/jszip": {
|
||||
"version": "3.7.1",
|
||||
"resolved": "https://registry.npmjs.org/jszip/-/jszip-3.7.1.tgz",
|
||||
"integrity": "sha512-ghL0tz1XG9ZEmRMcEN2vt7xabrDdqHHeykgARpmZ0BiIctWxM47Vt63ZO2dnp4QYt/xJVLLy5Zv1l/xRdh2byg==",
|
||||
"dependencies": {
|
||||
"lie": "~3.3.0",
|
||||
"pako": "~1.0.2",
|
||||
"readable-stream": "~2.3.6",
|
||||
"set-immediate-shim": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/lie": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz",
|
||||
"integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
|
||||
"dependencies": {
|
||||
"immediate": "~3.0.5"
|
||||
}
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"dependencies": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/os-tmpdir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
||||
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/pako": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
|
||||
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
|
||||
},
|
||||
"node_modules/path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/process-nextick-args": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
|
||||
},
|
||||
"node_modules/readable-stream": {
|
||||
"version": "2.3.7",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
|
||||
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
|
||||
"dependencies": {
|
||||
"core-util-is": "~1.0.0",
|
||||
"inherits": "~2.0.3",
|
||||
"isarray": "~1.0.0",
|
||||
"process-nextick-args": "~2.0.0",
|
||||
"safe-buffer": "~5.1.1",
|
||||
"string_decoder": "~1.1.1",
|
||||
"util-deprecate": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/rimraf": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
|
||||
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
|
||||
"dependencies": {
|
||||
"glob": "^7.1.3"
|
||||
},
|
||||
"bin": {
|
||||
"rimraf": "bin.js"
|
||||
}
|
||||
},
|
||||
"node_modules/safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
},
|
||||
"node_modules/sax": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
||||
},
|
||||
"node_modules/selenium-webdriver": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-3.6.0.tgz",
|
||||
"integrity": "sha512-WH7Aldse+2P5bbFBO4Gle/nuQOdVwpHMTL6raL3uuBj/vPG07k6uzt3aiahu352ONBr5xXh0hDlM3LhtXPOC4Q==",
|
||||
"dependencies": {
|
||||
"jszip": "^3.1.3",
|
||||
"rimraf": "^2.5.4",
|
||||
"tmp": "0.0.30",
|
||||
"xml2js": "^0.4.17"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/set-immediate-shim": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz",
|
||||
"integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/string_decoder": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
||||
"dependencies": {
|
||||
"safe-buffer": "~5.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/tmp": {
|
||||
"version": "0.0.30",
|
||||
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.30.tgz",
|
||||
"integrity": "sha1-ckGdSovn1s51FI/YsyTlk6cRwu0=",
|
||||
"dependencies": {
|
||||
"os-tmpdir": "~1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
|
||||
},
|
||||
"node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||
},
|
||||
"node_modules/xml2js": {
|
||||
"version": "0.4.23",
|
||||
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
|
||||
"integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==",
|
||||
"dependencies": {
|
||||
"sax": ">=0.6.0",
|
||||
"xmlbuilder": "~11.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/xmlbuilder": {
|
||||
"version": "11.0.1",
|
||||
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
|
||||
"integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"balanced-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||
},
|
||||
"core-util-is": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
|
||||
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
|
||||
},
|
||||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
|
||||
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
|
||||
"requires": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"immediate": {
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
|
||||
"integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps="
|
||||
},
|
||||
"inflight": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||
"requires": {
|
||||
"once": "^1.3.0",
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||
},
|
||||
"isarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
|
||||
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
|
||||
},
|
||||
"jasmine": {
|
||||
"version": "3.9.0",
|
||||
"resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.9.0.tgz",
|
||||
"integrity": "sha512-JgtzteG7xnqZZ51fg7N2/wiQmXon09szkALcRMTgCMX4u/m17gVJFjObnvw5FXkZOWuweHPaPRVB6DI2uN0wVA==",
|
||||
"requires": {
|
||||
"glob": "^7.1.6",
|
||||
"jasmine-core": "~3.9.0"
|
||||
}
|
||||
},
|
||||
"jasmine-core": {
|
||||
"version": "3.9.0",
|
||||
"resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.9.0.tgz",
|
||||
"integrity": "sha512-Tv3kVbPCGVrjsnHBZ38NsPU3sDOtNa0XmbG2baiyJqdb5/SPpDO6GVwJYtUryl6KB4q1Ssckwg612ES9Z0dreQ=="
|
||||
},
|
||||
"jszip": {
|
||||
"version": "3.7.1",
|
||||
"resolved": "https://registry.npmjs.org/jszip/-/jszip-3.7.1.tgz",
|
||||
"integrity": "sha512-ghL0tz1XG9ZEmRMcEN2vt7xabrDdqHHeykgARpmZ0BiIctWxM47Vt63ZO2dnp4QYt/xJVLLy5Zv1l/xRdh2byg==",
|
||||
"requires": {
|
||||
"lie": "~3.3.0",
|
||||
"pako": "~1.0.2",
|
||||
"readable-stream": "~2.3.6",
|
||||
"set-immediate-shim": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"lie": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz",
|
||||
"integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
|
||||
"requires": {
|
||||
"immediate": "~3.0.5"
|
||||
}
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"os-tmpdir": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
||||
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
|
||||
},
|
||||
"pako": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
|
||||
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
|
||||
},
|
||||
"process-nextick-args": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "2.3.7",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
|
||||
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
|
||||
"requires": {
|
||||
"core-util-is": "~1.0.0",
|
||||
"inherits": "~2.0.3",
|
||||
"isarray": "~1.0.0",
|
||||
"process-nextick-args": "~2.0.0",
|
||||
"safe-buffer": "~5.1.1",
|
||||
"string_decoder": "~1.1.1",
|
||||
"util-deprecate": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
|
||||
"integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==",
|
||||
"requires": {
|
||||
"glob": "^7.1.3"
|
||||
}
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
||||
},
|
||||
"sax": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
|
||||
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
|
||||
},
|
||||
"selenium-webdriver": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-3.6.0.tgz",
|
||||
"integrity": "sha512-WH7Aldse+2P5bbFBO4Gle/nuQOdVwpHMTL6raL3uuBj/vPG07k6uzt3aiahu352ONBr5xXh0hDlM3LhtXPOC4Q==",
|
||||
"requires": {
|
||||
"jszip": "^3.1.3",
|
||||
"rimraf": "^2.5.4",
|
||||
"tmp": "0.0.30",
|
||||
"xml2js": "^0.4.17"
|
||||
}
|
||||
},
|
||||
"set-immediate-shim": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz",
|
||||
"integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E="
|
||||
},
|
||||
"string_decoder": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
|
||||
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
|
||||
"requires": {
|
||||
"safe-buffer": "~5.1.0"
|
||||
}
|
||||
},
|
||||
"tmp": {
|
||||
"version": "0.0.30",
|
||||
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.30.tgz",
|
||||
"integrity": "sha1-ckGdSovn1s51FI/YsyTlk6cRwu0=",
|
||||
"requires": {
|
||||
"os-tmpdir": "~1.0.1"
|
||||
}
|
||||
},
|
||||
"util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||
},
|
||||
"xml2js": {
|
||||
"version": "0.4.23",
|
||||
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
|
||||
"integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==",
|
||||
"requires": {
|
||||
"sax": ">=0.6.0",
|
||||
"xmlbuilder": "~11.0.0"
|
||||
}
|
||||
},
|
||||
"xmlbuilder": {
|
||||
"version": "11.0.1",
|
||||
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
|
||||
"integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA=="
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "tests",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"test": "node tests.js"
|
||||
"test": "jasmine spec/tests.js"
|
||||
},
|
||||
"author": "Ian coleman",
|
||||
"description": "Tests for BIP39 tool",
|
||||
@@ -11,6 +11,7 @@
|
||||
"url": "git://github.com/iancoleman/bip39.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"jasmine": "^3.9.0",
|
||||
"selenium-webdriver": "^3.6.0"
|
||||
},
|
||||
"license": "MIT"
|
||||
|
||||
@@ -17,6 +17,9 @@ if (!browser) {
|
||||
console.log("Using default browser: chrome");
|
||||
browser = "chrome";
|
||||
}
|
||||
else if (browser !== 'chrome' && browser !== 'firefox') {
|
||||
throw `Unsupported browser: "${browser}", must be "chrome" or "firefox"`
|
||||
}
|
||||
else {
|
||||
console.log("Using browser: " + browser);
|
||||
}
|
||||
@@ -168,6 +171,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
|
||||
@@ -614,6 +628,26 @@ it('Allows selection of dash testnet', function(done) {
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of divi', function(done) {
|
||||
var params = {
|
||||
selectText: "DIVI - DIVI",
|
||||
phrase: "abandon abandon ability",
|
||||
firstAddress: "DLeGz7jqF1y1cmfEkSeRBkQPK8vTZ8rHt4",
|
||||
firstPubKey: "032ade8a36983a1efcc40d64b2a1a52cc26a908f7dc2fa222f43598812dd10d8bc",
|
||||
firstPrivKey: "YWG1Fht24fMUntuAhVRMPSj2eVN7BxkM7SuuqRhg1ibsTNbr31VF",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of divi testnet', function(done) {
|
||||
var params = {
|
||||
selectText: "DIVI - DIVI Testnet",
|
||||
phrase: "abandon abandon ability",
|
||||
firstAddress: "yB5U384n6dGkVE3by5y9VdvHHPwPg68fQj",
|
||||
firstPubKey: "0382a5450765e2025bdb5f7d109c9254a11ef97a566228bf171d80ecb348763bb0",
|
||||
firstPrivKey: "cV3coiYD2NhHKfhC6Gb8DzpvPzcGYYExYxuNxpUtKq3VUJrkFLZx",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of game', function(done) {
|
||||
var params = {
|
||||
selectText: "GAME - GameCredits",
|
||||
@@ -640,7 +674,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 +940,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 +1020,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 +1278,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 +1398,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 +1698,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 +1718,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 +1938,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 +1948,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 +1968,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",
|
||||
@@ -2155,6 +2269,16 @@ it('Allows selection of Stellar', function(done) {
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Nano', function(done) {
|
||||
var params = {
|
||||
selectText: "NANO - Nano",
|
||||
phrase: "deal wedding panda forum property artist whip total word student sea middle",
|
||||
firstAddress: "nano_15fum9n68681dz73qyu37fuc9tro84gqm86eptdqpm9jutkfnt34agkoqpw5",
|
||||
firstPubKey: "0dbb99e84310c05fca1bfb612b76a3eb15309d79988cb6977b4cf1dea4da6822",
|
||||
firstPrivKey: "30633c8497cc47e0aefd52c7971ffd45e6c5d166274c7978feca3482a859c0af",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Wagerr', function(done) {
|
||||
var params = {
|
||||
selectText: "WGR - Wagerr",
|
||||
@@ -2265,6 +2389,59 @@ it('Allows selection of CranePay', function(done) {
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Scribe', function(done) {
|
||||
var params = {
|
||||
selectText: "SCRIBE - Scribe",
|
||||
phrase: "abandon abandon ability",
|
||||
firstAddress: "RYAnPeBLD8veZ9Tw8xugeTC2f9PeZonLHM",
|
||||
firstPubKey: "02c912bc4759c8a209475502fb5352ff5be8a8f13eb72f1732ee25125cd53edc1e",
|
||||
firstPrivKey: "HLZWvNCEUv4ghygjH9A2EYCa9HNRcxe5CS42kzUTmoxJYp3z96QE",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
it('Allows selection of Binance Smart Chain', function(done) {
|
||||
var params = {
|
||||
selectText: "BSC - Binance Smart Chain",
|
||||
phrase: "abandon abandon ability",
|
||||
firstAddress: "0xe5815d5902Ad612d49283DEdEc02100Bd44C2772",
|
||||
firstPubKey: "0x03e723e5b3aa7d72213f01139aa4783e1b34f74e1a04534e3fd8e29bfe2768af8a",
|
||||
firstPrivKey: "0x8f253078b73d7498302bb78c171b23ce7a8fb511987d2b2702b731638a4a15e7",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
|
||||
it('Allows selection of TRX on Tron', function(done) {
|
||||
var params = {
|
||||
selectText: "TRX - Tron",
|
||||
phrase: "abandon abandon ability",
|
||||
firstAddress: "TA891Fu7vVz595BGQpNX2MCzr7yBcxuoC7",
|
||||
firstPubKey: "0337bbb060e6166066f7f9e59e52f67bc23a6c9d0cbc815b82b6d89112444842e7",
|
||||
firstPrivKey: "3a8fbd0379a815764979de86a3fcda759cb62d49e784e7b2a9a03206c90cfae2",
|
||||
};
|
||||
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);
|
||||
});
|
||||
|
||||
it('Allows selection of Particl', function(done) {
|
||||
var params = {
|
||||
selectText: "PART - Particl",
|
||||
phrase: "abandon abandon ability",
|
||||
firstAddress: "Pjf2jj1E4GLJnyZA6jNN25Ajn4wHDahuL5",
|
||||
firstPubKey: "039d803bfa8bd30c9e74c14a8785cee64b696b56e10d7545ad3fbf954c40cbfda2",
|
||||
firstPrivKey: "H79cmSqW1uYVbi14c8VH5eH9UdpjhuvGmXFV8zhkcfR84TEUWfHp",
|
||||
};
|
||||
testNetwork(done, params);
|
||||
});
|
||||
|
||||
// BIP39 seed is set from phrase
|
||||
it('Sets the bip39 seed from the prhase', function(done) {
|
||||
@@ -2902,6 +3079,25 @@ it('Uses the correct derivation for altcoins with root keys', function(done) {
|
||||
});
|
||||
});
|
||||
|
||||
// Changing the coin when only using a seed (without a mnemonic phrase) should
|
||||
// work the same as the previous test.
|
||||
// See https://github.com/iancoleman/bip39/pull/486
|
||||
it('Uses the correct derivation for altcoins with seed and without mnemonic phrase', function(done) {
|
||||
driver.findElement(By.css('.seed'))
|
||||
.sendKeys("20da140d3dd1df8713cefcc4d54ce0e445b4151027a1ab567b832f6da5fcc5afc1c3a3f199ab78b8e0ab4652efd7f414ac2c9a3b81bceb879a70f377aa0a58f3");
|
||||
driver.sleep(generateDelay).then(function() {
|
||||
// 4) switch from bitcoin to viacoin
|
||||
selectNetwork("VIA - Viacoin");
|
||||
driver.sleep(generateDelay).then(function() {
|
||||
// 5) ensure the derived address is correct
|
||||
getFirstAddress(function(address) {
|
||||
expect(address).toBe("Vq9Eq4N5SQnjqZvxtxzo7hZPW5XnyJsmXT");
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Selecting a language with no existing phrase should generate a phrase in
|
||||
// that language.
|
||||
it('Generate a random phrase when language is selected and no current phrase', function(done) {
|
||||
@@ -3110,7 +3306,7 @@ it("Shows the number of bits of entropy for 4 bits of binary", function(done) {
|
||||
testEntropyBits(done, "0000", "4");
|
||||
});
|
||||
it("Shows the number of bits of entropy for 1 character of base 6 (dice)", function(done) {
|
||||
// 6 in card is 0 in base 6, 0 in base 6 is 2.6 bits (rounded down to 2 bits)
|
||||
// 6 in card is 0 in base 6, 0 is mapped to 00 by entropy.js
|
||||
testEntropyBits(done, "6", "2");
|
||||
});
|
||||
it("Shows the number of bits of entropy for 1 character of base 10 with 3 bits", function(done) {
|
||||
@@ -3118,13 +3314,15 @@ it("Shows the number of bits of entropy for 1 character of base 10 with 3 bits",
|
||||
testEntropyBits(done, "7", "3");
|
||||
});
|
||||
it("Shows the number of bits of entropy for 1 character of base 10 with 4 bis", function(done) {
|
||||
testEntropyBits(done, "8", "4");
|
||||
// 8 in base 10 is mapped to 0 by entropy.js
|
||||
testEntropyBits(done, "8", "1");
|
||||
});
|
||||
it("Shows the number of bits of entropy for 1 character of hex", function(done) {
|
||||
testEntropyBits(done, "F", "4");
|
||||
});
|
||||
it("Shows the number of bits of entropy for 2 characters of base 10", function(done) {
|
||||
testEntropyBits(done, "29", "6");
|
||||
// 2 as base 10 is binary 010, 9 is mapped to binary 1 by entropy.js
|
||||
testEntropyBits(done, "29", "4");
|
||||
});
|
||||
it("Shows the number of bits of entropy for 2 characters of hex", function(done) {
|
||||
testEntropyBits(done, "0A", "8");
|
||||
@@ -3149,17 +3347,17 @@ it("Shows the number of bits of entropy for 4 characters of hex with leading zer
|
||||
testEntropyBits(done, "000A", "16");
|
||||
});
|
||||
it("Shows the number of bits of entropy for 4 characters of base 6", function(done) {
|
||||
testEntropyBits(done, "5555", "11");
|
||||
// 5 in base 6 is mapped to binary 1
|
||||
testEntropyBits(done, "5555", "4");
|
||||
});
|
||||
it("Shows the number of bits of entropy for 4 characters of base 6 dice", function(done) {
|
||||
// uses dice, so entropy is actually 0000 in base 6, which is 4 lots of
|
||||
// 2.58 bits, which is 10.32 bits (rounded down to 10 bits)
|
||||
testEntropyBits(done, "6666", "10");
|
||||
// binary 00
|
||||
testEntropyBits(done, "6666", "8");
|
||||
});
|
||||
it("Shows the number of bits of entropy for 4 charactes of base 10", function(done) {
|
||||
// Uses base 10, which is 4 lots of 3.32 bits, which is 13.3 bits (rounded
|
||||
// down to 13)
|
||||
testEntropyBits(done, "2227", "13");
|
||||
// 2 in base 10 is binary 010 and 7 is binary 111 so is 4 events of 3 bits
|
||||
testEntropyBits(done, "2227", "12");
|
||||
});
|
||||
it("Shows the number of bits of entropy for 4 characters of hex with 2 leading zeros", function(done) {
|
||||
testEntropyBits(done, "222F", "16");
|
||||
@@ -3168,13 +3366,16 @@ it("Shows the number of bits of entropy for 4 characters of hex starting with F"
|
||||
testEntropyBits(done, "FFFF", "16");
|
||||
});
|
||||
it("Shows the number of bits of entropy for 10 characters of base 10", function(done) {
|
||||
// 10 events at 3.32 bits per event
|
||||
testEntropyBits(done, "0000101017", "33");
|
||||
// 10 events with 3 bits for each event
|
||||
testEntropyBits(done, "0000101017", "30");
|
||||
});
|
||||
it("Shows the number of bits of entropy for 10 characters of base 10 account for bias", function(done) {
|
||||
// 9 events with 3 bits per event and 1 event with 1 bit per event
|
||||
testEntropyBits(done, "0000101018", "28");
|
||||
});
|
||||
it("Shows the number of bits of entropy for a full deck of cards", function(done) {
|
||||
// cards are not replaced, so a full deck is not 52^52 entropy which is 296
|
||||
// bits, it's 52!, which is 225 bits
|
||||
testEntropyBits(done, "ac2c3c4c5c6c7c8c9ctcjcqckcad2d3d4d5d6d7d8d9dtdjdqdkdah2h3h4h5h6h7h8h9hthjhqhkhas2s3s4s5s6s7s8s9stsjsqsks", "225");
|
||||
// removing bias is 32*5 + 16*4 + 4*2
|
||||
testEntropyBits(done, "ac2c3c4c5c6c7c8c9ctcjcqckcad2d3d4d5d6d7d8d9dtdjdqdkdah2h3h4h5h6h7h8h9hthjhqhkhas2s3s4s5s6s7s8s9stsjsqsks", "232");
|
||||
});
|
||||
|
||||
it("Shows details about the entered entropy", function(done) {
|
||||
@@ -3300,7 +3501,7 @@ it("Shows details about the entered entropy", function(done) {
|
||||
entropy: "7d",
|
||||
type: "card",
|
||||
events: "1",
|
||||
bits: "4",
|
||||
bits: "5",
|
||||
words: 0,
|
||||
strength: "less than a second",
|
||||
}
|
||||
@@ -3312,7 +3513,7 @@ it("Shows details about the entered entropy", function(done) {
|
||||
entropy: "ac2c3c4c5c6c7c8c9ctcjcqckcad2d3d4d5d6d7d8d9dtdjdqdkdah2h3h4h5h6h7h8h9hthjhqhkhas2s3s4s5s6s7s8s9stsjsqsks",
|
||||
type: "card (full deck)",
|
||||
events: "52",
|
||||
bits: "225",
|
||||
bits: "232",
|
||||
words: 21,
|
||||
strength: "centuries",
|
||||
}
|
||||
@@ -3324,7 +3525,7 @@ it("Shows details about the entered entropy", function(done) {
|
||||
entropy: "ac2c3c4c5c6c7c8c9ctcjcqckcad2d3d4d5d6d7d8d9dtdjdqdkdah2h3h4h5h6h7h8h9hthjhqhkhas2s3s4s5s6s7s8s9stsjsqsks3d",
|
||||
type: "card (full deck, 1 duplicate: 3d)",
|
||||
events: "53",
|
||||
bits: "254",
|
||||
bits: "237",
|
||||
words: 21,
|
||||
strength: "centuries",
|
||||
}
|
||||
@@ -3336,7 +3537,7 @@ it("Shows details about the entered entropy", function(done) {
|
||||
entropy: "ac2c3c4c5c6c7c8c9ctcjcqckcad2d3d4d5d6d7d8d9dtdjdqdkdah2h3h4h5h6h7h8h9hthjhqhkhas2s3s4s5s6s7s8s9stsjsqs3d4d",
|
||||
type: "card (2 duplicates: 3d 4d, 1 missing: KS)",
|
||||
events: "53",
|
||||
bits: "254",
|
||||
bits: "240",
|
||||
words: 21,
|
||||
strength: "centuries",
|
||||
}
|
||||
@@ -3348,8 +3549,8 @@ it("Shows details about the entered entropy", function(done) {
|
||||
entropy: "ac2c3c4c5c6c7c8c9ctcjcqckcad2d3d4d5d6d7d8d9dtdjdqdkdah2h3h4h5h6h7h8h9hthjhqhkhas2s3s4s5s6s7s8s9stsjsqs3d4d5d6d",
|
||||
type: "card (4 duplicates: 3d 4d 5d..., 1 missing: KS)",
|
||||
events: "55",
|
||||
bits: "264",
|
||||
words: 24,
|
||||
bits: "250",
|
||||
words: 21,
|
||||
strength: "centuries",
|
||||
}
|
||||
);
|
||||
@@ -3357,13 +3558,12 @@ it("Shows details about the entered entropy", function(done) {
|
||||
it("Shows details about the entered entropy", function(done) {
|
||||
testEntropyFeedback(done,
|
||||
// Next test was throwing uncaught error in zxcvbn
|
||||
// Also tests 451 bits, ie Math.log2(52!)*2 = 225.58 * 2
|
||||
{
|
||||
entropy: "ac2c3c4c5c6c7c8c9ctcjcqckcad2d3d4d5d6d7d8d9dtdjdqdkdah2h3h4h5h6h7h8h9hthjhqhkhas2s3s4s5s6s7s8s9stsjsqsksac2c3c4c5c6c7c8c9ctcjcqckcad2d3d4d5d6d7d8d9dtdjdqdkdah2h3h4h5h6h7h8h9hthjhqhkhas2s3s4s5s6s7s8s9stsjsqsks",
|
||||
type: "card (full deck, 52 duplicates: ac 2c 3c...)",
|
||||
events: "104",
|
||||
bits: "499",
|
||||
words: 45,
|
||||
bits: "464",
|
||||
words: 42,
|
||||
strength: "centuries",
|
||||
}
|
||||
);
|
||||
@@ -3375,7 +3575,7 @@ it("Shows details about the entered entropy", function(done) {
|
||||
entropy: "asAS",
|
||||
type: "card (1 duplicate: AS)",
|
||||
events: "2",
|
||||
bits: "9",
|
||||
bits: "8",
|
||||
words: 0,
|
||||
strength: "less than a second",
|
||||
}
|
||||
@@ -3387,7 +3587,7 @@ it("Shows details about the entered entropy", function(done) {
|
||||
entropy: "ASas",
|
||||
type: "card (1 duplicate: as)",
|
||||
events: "2",
|
||||
bits: "9",
|
||||
bits: "8",
|
||||
words: 0,
|
||||
strength: "less than a second",
|
||||
}
|
||||
@@ -3400,8 +3600,8 @@ it("Shows details about the entered entropy", function(done) {
|
||||
entropy: "ac2c3c4c5c6c7c8c tcjcqckcad2d3d4d5d6d7d8d9dtdjdqdkdah2h3h4h5h6h7h8h9hthjhqhkhas2s3s4s5s6s7s8s9stsjsqsks",
|
||||
type: "card (1 missing: 9C)",
|
||||
events: "51",
|
||||
bits: "221",
|
||||
words: 18,
|
||||
bits: "227",
|
||||
words: 21,
|
||||
strength: "centuries",
|
||||
}
|
||||
);
|
||||
@@ -3412,7 +3612,7 @@ it("Shows details about the entered entropy", function(done) {
|
||||
entropy: "ac2c3c4c5c6c7c8c tcjcqckcad2d3d4d 6d7d8d9dtdjdqdkdah2h3h4h5h6h7h8h9hthjhqhkhas2s3s4s5s6s7s8s9stsjsqsks",
|
||||
type: "card (2 missing: 9C 5D)",
|
||||
events: "50",
|
||||
bits: "216",
|
||||
bits: "222",
|
||||
words: 18,
|
||||
strength: "centuries",
|
||||
}
|
||||
@@ -3424,7 +3624,7 @@ it("Shows details about the entered entropy", function(done) {
|
||||
entropy: "ac2c3c4c5c6c7c8c tcjcqckcad2d3d4d 6d7d8d9dtdjd kdah2h3h 5h6h7h8h9hthjhqhkhas2s3s4s5s6s7s8s9stsjsqsks",
|
||||
type: "card (4 missing: 9C 5D QD...)",
|
||||
events: "48",
|
||||
bits: "208",
|
||||
bits: "212",
|
||||
words: 18,
|
||||
strength: "centuries",
|
||||
}
|
||||
@@ -3437,20 +3637,21 @@ it("Shows details about the entered entropy", function(done) {
|
||||
entropy: "ac2c3c4c5c6c7c8c tcjcqckcad2d3d4d 6d 8d9d jd kdah2h3h 5h6h7h8h9hthjhqhkh 2s3s4s5s6s7s8s9stsjsqsks",
|
||||
type: "card",
|
||||
events: "45",
|
||||
bits: "195",
|
||||
bits: "198",
|
||||
words: 18,
|
||||
strength: "centuries",
|
||||
}
|
||||
);
|
||||
});
|
||||
it("Shows details about the entered entropy", function(done) {
|
||||
// multiple decks does not affect the bits per event
|
||||
// since the bits are hardcoded in entropy.js
|
||||
testEntropyFeedback(done,
|
||||
// Multiple decks of cards increases bits per event
|
||||
{
|
||||
entropy: "3d",
|
||||
events: "1",
|
||||
bits: "4",
|
||||
bitsPerEvent: "4.34",
|
||||
bits: "5",
|
||||
bitsPerEvent: "4.46",
|
||||
}
|
||||
);
|
||||
});
|
||||
@@ -3459,8 +3660,8 @@ it("Shows details about the entered entropy", function(done) {
|
||||
{
|
||||
entropy: "3d3d",
|
||||
events: "2",
|
||||
bits: "9",
|
||||
bitsPerEvent: "4.80",
|
||||
bits: "10",
|
||||
bitsPerEvent: "4.46",
|
||||
}
|
||||
);
|
||||
});
|
||||
@@ -3470,7 +3671,7 @@ it("Shows details about the entered entropy", function(done) {
|
||||
entropy: "3d3d3d",
|
||||
events: "3",
|
||||
bits: "15",
|
||||
bitsPerEvent: "5.01",
|
||||
bitsPerEvent: "4.46",
|
||||
}
|
||||
);
|
||||
});
|
||||
@@ -3480,7 +3681,7 @@ it("Shows details about the entered entropy", function(done) {
|
||||
entropy: "3d3d3d3d",
|
||||
events: "4",
|
||||
bits: "20",
|
||||
bitsPerEvent: "5.14",
|
||||
bitsPerEvent: "4.46",
|
||||
}
|
||||
);
|
||||
});
|
||||
@@ -3489,8 +3690,8 @@ it("Shows details about the entered entropy", function(done) {
|
||||
{
|
||||
entropy: "3d3d3d3d3d",
|
||||
events: "5",
|
||||
bits: "26",
|
||||
bitsPerEvent: "5.22",
|
||||
bits: "25",
|
||||
bitsPerEvent: "4.46",
|
||||
}
|
||||
);
|
||||
});
|
||||
@@ -3499,8 +3700,8 @@ it("Shows details about the entered entropy", function(done) {
|
||||
{
|
||||
entropy: "3d3d3d3d3d3d",
|
||||
events: "6",
|
||||
bits: "31",
|
||||
bitsPerEvent: "5.28",
|
||||
bits: "30",
|
||||
bitsPerEvent: "4.46",
|
||||
}
|
||||
);
|
||||
});
|
||||
@@ -3509,8 +3710,8 @@ it("Shows details about the entered entropy", function(done) {
|
||||
{
|
||||
entropy: "3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d",
|
||||
events: "33",
|
||||
bits: "184",
|
||||
bitsPerEvent: "5.59",
|
||||
bits: "165",
|
||||
bitsPerEvent: "4.46",
|
||||
strength: 'less than a second - Repeats like "abcabcabc" are only slightly harder to guess than "abc"',
|
||||
}
|
||||
);
|
||||
@@ -3561,10 +3762,11 @@ it('Converts very long entropy to very long mnemonics', function(done) {
|
||||
// https://bip32jp.github.io/english/index.html
|
||||
// NOTES:
|
||||
// Is incompatible with:
|
||||
// base 6
|
||||
// base 20
|
||||
it('Is compatible with bip32jp.github.io', function(done) {
|
||||
var entropy = "543210543210543210543210543210543210543210543210543210543210543210543210543210543210543210543210543";
|
||||
var expectedPhrase = "train then jungle barely whip fiber purpose puppy eagle cloud clump hospital robot brave balcony utility detect estate old green desk skill multiply virus";
|
||||
var entropy = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
|
||||
var expectedPhrase = "primary fetch primary fetch primary fetch primary fetch primary fetch primary fetch primary fetch primary fetch primary fetch primary fetch primary fetch primary foster";
|
||||
driver.findElement(By.css('.use-entropy'))
|
||||
.click();
|
||||
driver.findElement(By.css('.entropy'))
|
||||
@@ -4913,6 +5115,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'))
|
||||
@@ -4986,4 +5225,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