mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-10 12:32:17 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
924727ed26 | ||
|
|
9183f9f658 | ||
|
|
f487fea9b8 | ||
|
|
5a10834a36 | ||
|
|
1f354b0390 | ||
|
|
0460b53f3a | ||
|
|
e8ee368f18 | ||
|
|
107edb3454 | ||
|
|
3960807353 | ||
|
|
214c584c40 | ||
|
|
c1396e87ed | ||
|
|
b57b721e2c |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
node_modules
|
||||
@@ -118,7 +118,7 @@
|
||||
<div class="container">
|
||||
|
||||
<h1 class="text-center">Mnemonic Code Converter</h1>
|
||||
<p class="version">v0.2.8</p>
|
||||
<p class="version">v0.2.9</p>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@@ -626,9 +626,12 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<span>Show more rows</span>:
|
||||
<span>Show</span>
|
||||
<input type="number" class="rows-to-add" value="20">
|
||||
<button class="more">Show</button>
|
||||
<button class="more">more rows</button>
|
||||
<span>starting from index</span>
|
||||
<input type="number" class="more-rows-start-index">
|
||||
<span>(leave blank to generate from next index)</span>
|
||||
|
||||
<hr>
|
||||
|
||||
@@ -22422,6 +22425,17 @@ bitcoinjs.bitcoin.networks.nubits = {
|
||||
wif: 0x96,
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.bgold = {
|
||||
messagePrefix: 'unused',
|
||||
bip32: {
|
||||
public: 0x0488b21e,
|
||||
private: 0x0488ade4
|
||||
},
|
||||
pubKeyHash: 38,
|
||||
scriptHash: 23,
|
||||
wif: 128
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.bitcoinCashBitbpay = {
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bip32: {
|
||||
@@ -22433,6 +22447,17 @@ bitcoinjs.bitcoin.networks.bitcoinCashBitbpay = {
|
||||
wif: 0x80
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.monacoin = {
|
||||
messagePrefix: '\x18Monacoin Signed Message:\n',
|
||||
bip32: {
|
||||
public: 0x0488b21e,
|
||||
private: 0x0488ade4
|
||||
},
|
||||
pubKeyHash: 0x32,
|
||||
scriptHash: 0x37,
|
||||
wif: 0xb0
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.bitcoinBip49 = {
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bip32: {
|
||||
@@ -46058,6 +46083,7 @@ window.Entropy = new (function() {
|
||||
DOM.addresses = $(".addresses");
|
||||
DOM.rowsToAdd = $(".rows-to-add");
|
||||
DOM.more = $(".more");
|
||||
DOM.moreRowsStartIndex = $(".more-rows-start-index");
|
||||
DOM.feedback = $(".feedback");
|
||||
DOM.tab = $(".derivation-type a");
|
||||
DOM.indexToggle = $(".index-toggle");
|
||||
@@ -46728,12 +46754,19 @@ window.Entropy = new (function() {
|
||||
}
|
||||
|
||||
function showMore() {
|
||||
var start = DOM.addresses.children().length;
|
||||
var rowsToAdd = parseInt(DOM.rowsToAdd.val());
|
||||
if (isNaN(rowsToAdd)) {
|
||||
rowsToAdd = 20;
|
||||
DOM.rowsToAdd.val("20");
|
||||
}
|
||||
var start = parseInt(DOM.moreRowsStartIndex.val())
|
||||
if (isNaN(start)) {
|
||||
start = lastIndexInTable() + 1;
|
||||
}
|
||||
else {
|
||||
var newStart = start + rowsToAdd;
|
||||
DOM.moreRowsStartIndex.val(newStart);
|
||||
}
|
||||
if (rowsToAdd > 200) {
|
||||
var msg = "Generating " + rowsToAdd + " rows could take a while. ";
|
||||
msg += "Do you want to continue?";
|
||||
@@ -47269,6 +47302,14 @@ window.Entropy = new (function() {
|
||||
}
|
||||
}
|
||||
|
||||
function lastIndexInTable() {
|
||||
var pathText = DOM.addresses.find(".index").last().text();
|
||||
var pathBits = pathText.split("/");
|
||||
var lastBit = pathBits[pathBits.length-1];
|
||||
var lastBitClean = lastBit.replace("'", "");
|
||||
return parseInt(lastBitClean);
|
||||
}
|
||||
|
||||
var networks = [
|
||||
{
|
||||
name: "BCH - Bitcoin Cash",
|
||||
@@ -47295,6 +47336,14 @@ window.Entropy = new (function() {
|
||||
setHdCoin(1);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "BTG - Bitcoin Gold",
|
||||
p2wpkhNestedInP2shAvailable: true,
|
||||
onSelect: function() {
|
||||
network = bitcoinjs.bitcoin.networks.bgold;
|
||||
setHdCoin(0);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "CLAM - Clams",
|
||||
p2wpkhNestedInP2shAvailable: false,
|
||||
@@ -47384,7 +47433,14 @@ window.Entropy = new (function() {
|
||||
setHdCoin(13);
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: "MONA - Monacoin",
|
||||
p2wpkhNestedInP2shAvailable: true,
|
||||
onSelect: function() {
|
||||
network = bitcoinjs.bitcoin.networks.monacoin,
|
||||
setHdCoin(22);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "NMC - Namecoin",
|
||||
p2wpkhNestedInP2shAvailable: false,
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
# 0.2.9
|
||||
|
||||
* Update links from old site to new site
|
||||
* Add Monacoin
|
||||
* Add Bitcoin Gold
|
||||
* Port test suite to selenium
|
||||
* Allow more rows to be generated starting from a custom index
|
||||
|
||||
# 0.2.8
|
||||
|
||||
* Enable segwit for Litecoin
|
||||
|
||||
19
readme.md
19
readme.md
@@ -4,7 +4,7 @@ A tool for converting BIP39 mnemonic phrases to addresses and private keys.
|
||||
|
||||
## Online Version
|
||||
|
||||
https://iancoleman.github.io/bip39/
|
||||
https://iancoleman.io/bip39/
|
||||
|
||||
## Standalone offline version
|
||||
|
||||
@@ -62,12 +62,25 @@ please do not commit changes to `bip39-standalone.html`
|
||||
|
||||
# Tests
|
||||
|
||||
Tests depend on [phantomjs](http://phantomjs.org/).
|
||||
Tests depend on
|
||||
|
||||
* nodejs
|
||||
* selenium webdriver - cd /path/to/bip39/tests; npm install
|
||||
* selenium driver for firefox ([geckodriver](https://github.com/mozilla/geckodriver/releases)) and / or chrome ([chromedriver](https://sites.google.com/a/chromium.org/chromedriver/downloads))
|
||||
* jasmine - npm install --global jasmine
|
||||
|
||||
Before running tests, the site must be served at http://localhost:8000.
|
||||
|
||||
```
|
||||
$ cd /path/to/bip39/src
|
||||
$ python -m http.server
|
||||
```
|
||||
|
||||
Run tests from the command-line
|
||||
|
||||
```
|
||||
$ phantomjs tests.js
|
||||
$ cd /path/to/bip39/tests
|
||||
$ jasmine spec/tests.js
|
||||
```
|
||||
|
||||
# License
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
<div class="container">
|
||||
|
||||
<h1 class="text-center">Mnemonic Code Converter</h1>
|
||||
<p class="version">v0.2.8</p>
|
||||
<p class="version">v0.2.9</p>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@@ -622,9 +622,12 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<span>Show more rows</span>:
|
||||
<span>Show</span>
|
||||
<input type="number" class="rows-to-add" value="20">
|
||||
<button class="more">Show</button>
|
||||
<button class="more">more rows</button>
|
||||
<span>starting from index</span>
|
||||
<input type="number" class="more-rows-start-index">
|
||||
<span>(leave blank to generate from next index)</span>
|
||||
|
||||
<hr>
|
||||
|
||||
|
||||
@@ -251,6 +251,17 @@ bitcoinjs.bitcoin.networks.nubits = {
|
||||
wif: 0x96,
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.bgold = {
|
||||
messagePrefix: 'unused',
|
||||
bip32: {
|
||||
public: 0x0488b21e,
|
||||
private: 0x0488ade4
|
||||
},
|
||||
pubKeyHash: 38,
|
||||
scriptHash: 23,
|
||||
wif: 128
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.bitcoinCashBitbpay = {
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bip32: {
|
||||
@@ -262,6 +273,17 @@ bitcoinjs.bitcoin.networks.bitcoinCashBitbpay = {
|
||||
wif: 0x80
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.monacoin = {
|
||||
messagePrefix: '\x18Monacoin Signed Message:\n',
|
||||
bip32: {
|
||||
public: 0x0488b21e,
|
||||
private: 0x0488ade4
|
||||
},
|
||||
pubKeyHash: 0x32,
|
||||
scriptHash: 0x37,
|
||||
wif: 0xb0
|
||||
};
|
||||
|
||||
bitcoinjs.bitcoin.networks.bitcoinBip49 = {
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bip32: {
|
||||
|
||||
@@ -80,6 +80,7 @@
|
||||
DOM.addresses = $(".addresses");
|
||||
DOM.rowsToAdd = $(".rows-to-add");
|
||||
DOM.more = $(".more");
|
||||
DOM.moreRowsStartIndex = $(".more-rows-start-index");
|
||||
DOM.feedback = $(".feedback");
|
||||
DOM.tab = $(".derivation-type a");
|
||||
DOM.indexToggle = $(".index-toggle");
|
||||
@@ -750,12 +751,19 @@
|
||||
}
|
||||
|
||||
function showMore() {
|
||||
var start = DOM.addresses.children().length;
|
||||
var rowsToAdd = parseInt(DOM.rowsToAdd.val());
|
||||
if (isNaN(rowsToAdd)) {
|
||||
rowsToAdd = 20;
|
||||
DOM.rowsToAdd.val("20");
|
||||
}
|
||||
var start = parseInt(DOM.moreRowsStartIndex.val())
|
||||
if (isNaN(start)) {
|
||||
start = lastIndexInTable() + 1;
|
||||
}
|
||||
else {
|
||||
var newStart = start + rowsToAdd;
|
||||
DOM.moreRowsStartIndex.val(newStart);
|
||||
}
|
||||
if (rowsToAdd > 200) {
|
||||
var msg = "Generating " + rowsToAdd + " rows could take a while. ";
|
||||
msg += "Do you want to continue?";
|
||||
@@ -1291,6 +1299,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
function lastIndexInTable() {
|
||||
var pathText = DOM.addresses.find(".index").last().text();
|
||||
var pathBits = pathText.split("/");
|
||||
var lastBit = pathBits[pathBits.length-1];
|
||||
var lastBitClean = lastBit.replace("'", "");
|
||||
return parseInt(lastBitClean);
|
||||
}
|
||||
|
||||
var networks = [
|
||||
{
|
||||
name: "BCH - Bitcoin Cash",
|
||||
@@ -1317,6 +1333,14 @@
|
||||
setHdCoin(1);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "BTG - Bitcoin Gold",
|
||||
p2wpkhNestedInP2shAvailable: true,
|
||||
onSelect: function() {
|
||||
network = bitcoinjs.bitcoin.networks.bgold;
|
||||
setHdCoin(0);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "CLAM - Clams",
|
||||
p2wpkhNestedInP2shAvailable: false,
|
||||
@@ -1406,7 +1430,14 @@
|
||||
setHdCoin(13);
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: "MONA - Monacoin",
|
||||
p2wpkhNestedInP2shAvailable: true,
|
||||
onSelect: function() {
|
||||
network = bitcoinjs.bitcoin.networks.monacoin,
|
||||
setHdCoin(22);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "NMC - Namecoin",
|
||||
p2wpkhNestedInP2shAvailable: false,
|
||||
|
||||
17
tests/package.json
Normal file
17
tests/package.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "tests",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"test": "node tests.js"
|
||||
},
|
||||
"author": "Ian coleman",
|
||||
"description": "Tests for BIP39 tool",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/iancoleman/bip39.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"selenium-webdriver": "^3.6.0"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
11
tests/spec/support/jasmine.json
Normal file
11
tests/spec/support/jasmine.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"spec_dir": "spec",
|
||||
"spec_files": [
|
||||
"**/*[sS]pec.js"
|
||||
],
|
||||
"helpers": [
|
||||
"helpers/**/*.js"
|
||||
],
|
||||
"stopSpecOnExpectationFailure": false,
|
||||
"random": false
|
||||
}
|
||||
2624
tests/spec/tests.js
Normal file
2624
tests/spec/tests.js
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user