mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-06 19:03:49 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b3cc3930d0 | ||
|
|
c18511dd0d | ||
|
|
7ebdf61c99 | ||
|
|
daab55dc61 | ||
|
|
7b742f87d3 | ||
|
|
4d9c184a84 | ||
|
|
d5e01cc6e2 | ||
|
|
adedbf9169 | ||
|
|
f36d10080a | ||
|
|
8335cf17bc |
@@ -118,7 +118,7 @@
|
||||
<div class="container">
|
||||
|
||||
<h1 class="text-center">Mnemonic Code Converter</h1>
|
||||
<p class="version">v0.2.0</p>
|
||||
<p class="version">v0.2.1</p>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@@ -22291,6 +22291,17 @@ bitcoinjs.bitcoin.networks.zetacoin = {
|
||||
scriptHash: 0x09,
|
||||
wif: 0xe0,
|
||||
}
|
||||
|
||||
bitcoinjs.bitcoin.networks.myriadcoin = {
|
||||
messagePrefix: "unused",
|
||||
bip32: {
|
||||
public: 0x0488b21e,
|
||||
private: 0x0488ade4
|
||||
},
|
||||
pubKeyHash: 0x32,
|
||||
scriptHash: 0x00, // TODO set this correctly
|
||||
wif: 0xb2,
|
||||
};
|
||||
</script>
|
||||
<script>(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ethUtil = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
||||
(function (global){
|
||||
@@ -46871,6 +46882,9 @@ window.Entropy = new (function() {
|
||||
var option = $("<option>");
|
||||
option.attr("value", i);
|
||||
option.text(network.name);
|
||||
if (network.name == "BTC - Bitcoin") {
|
||||
option.prop("selected", true);
|
||||
}
|
||||
DOM.phraseNetwork.append(option);
|
||||
}
|
||||
}
|
||||
@@ -47216,6 +47230,14 @@ window.Entropy = new (function() {
|
||||
}
|
||||
|
||||
var networks = [
|
||||
{
|
||||
name: "BCH - Bitcoin Cash",
|
||||
bip49available: false,
|
||||
onSelect: function() {
|
||||
network = bitcoinjs.bitcoin.networks.bitcoin;
|
||||
setHdCoin(145);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "BTC - Bitcoin",
|
||||
bip49available: true,
|
||||
@@ -47368,6 +47390,14 @@ window.Entropy = new (function() {
|
||||
setHdCoin(1);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "XMY - Myriadcoin",
|
||||
bip49available: false,
|
||||
onSelect: function() {
|
||||
network = bitcoinjs.bitcoin.networks.myriadcoin;
|
||||
setHdCoin(90);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "XRP - Ripple",
|
||||
bip49available: false,
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
# 0.2.1
|
||||
|
||||
* BTC is the default coin
|
||||
* Add myriadcoin
|
||||
* Add Bitcon Cash
|
||||
|
||||
# 0.2.0
|
||||
|
||||
* BitcoinJS library upgrded to v3.1.1
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
Once all code changes for this version have been committed, a release can be
|
||||
created with the following steps:
|
||||
|
||||
1. Run tests and ensure all tests pass
|
||||
1. Set the version in index.html
|
||||
1. Update changelog
|
||||
1. Run `python compile.py`
|
||||
@@ -15,3 +16,4 @@ created with the following steps:
|
||||
1. include the signed release notes as text for the release
|
||||
1. attach the bip39-standalone.html file
|
||||
1. Add a new post to twitter from @bip39tool with the version, link and hash
|
||||
1. Publish to any hosted locations (eg iancoleman.github.io/bip39)
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
<div class="container">
|
||||
|
||||
<h1 class="text-center">Mnemonic Code Converter</h1>
|
||||
<p class="version">v0.2.0</p>
|
||||
<p class="version">v0.2.1</p>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
@@ -184,3 +184,14 @@ bitcoinjs.bitcoin.networks.zetacoin = {
|
||||
scriptHash: 0x09,
|
||||
wif: 0xe0,
|
||||
}
|
||||
|
||||
bitcoinjs.bitcoin.networks.myriadcoin = {
|
||||
messagePrefix: "unused",
|
||||
bip32: {
|
||||
public: 0x0488b21e,
|
||||
private: 0x0488ade4
|
||||
},
|
||||
pubKeyHash: 0x32,
|
||||
scriptHash: 0x00, // TODO set this correctly
|
||||
wif: 0xb2,
|
||||
};
|
||||
|
||||
@@ -818,6 +818,9 @@
|
||||
var option = $("<option>");
|
||||
option.attr("value", i);
|
||||
option.text(network.name);
|
||||
if (network.name == "BTC - Bitcoin") {
|
||||
option.prop("selected", true);
|
||||
}
|
||||
DOM.phraseNetwork.append(option);
|
||||
}
|
||||
}
|
||||
@@ -1163,6 +1166,14 @@
|
||||
}
|
||||
|
||||
var networks = [
|
||||
{
|
||||
name: "BCH - Bitcoin Cash",
|
||||
bip49available: false,
|
||||
onSelect: function() {
|
||||
network = bitcoinjs.bitcoin.networks.bitcoin;
|
||||
setHdCoin(145);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "BTC - Bitcoin",
|
||||
bip49available: true,
|
||||
@@ -1315,6 +1326,14 @@
|
||||
setHdCoin(1);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "XMY - Myriadcoin",
|
||||
bip49available: false,
|
||||
onSelect: function() {
|
||||
network = bitcoinjs.bitcoin.networks.myriadcoin;
|
||||
setHdCoin(90);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "XRP - Ripple",
|
||||
bip49available: false,
|
||||
|
||||
60
tests.js
60
tests.js
@@ -872,6 +872,66 @@ page.open(url, function(status) {
|
||||
});
|
||||
},
|
||||
|
||||
// Network can be set to bitcoin cash
|
||||
function() {
|
||||
page.open(url, function(status) {
|
||||
// set the phrase and coin
|
||||
var expected = "1JKvb6wKtsjNoCRxpZ4DGrbniML7z5U16A";
|
||||
page.evaluate(function() {
|
||||
$(".phrase").val("abandon abandon ability");
|
||||
$(".phrase").trigger("input");
|
||||
$(".network option[selected]").removeAttr("selected");
|
||||
$(".network option").filter(function() {
|
||||
return $(this).html() == "BCH - Bitcoin Cash";
|
||||
}).prop("selected", true);
|
||||
$(".network").trigger("change");
|
||||
});
|
||||
// check the address is generated correctly
|
||||
waitForGenerate(function() {
|
||||
var actual = page.evaluate(function() {
|
||||
return $(".address:first").text();
|
||||
});
|
||||
if (actual != expected) {
|
||||
console.log("Bitcoin Cash address is incorrect");
|
||||
console.log("Expected: " + expected);
|
||||
console.log("Actual: " + actual);
|
||||
fail();
|
||||
}
|
||||
next();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// Network can be set to myriadcoin
|
||||
function() {
|
||||
page.open(url, function(status) {
|
||||
// set the phrase and coin
|
||||
var expected = "MJEswvRR46wh9BoiVj9DzKYMBkCramhoBV";
|
||||
page.evaluate(function() {
|
||||
$(".phrase").val("abandon abandon ability");
|
||||
$(".phrase").trigger("input");
|
||||
$(".network option[selected]").removeAttr("selected");
|
||||
$(".network option").filter(function() {
|
||||
return $(this).html() == "XMY - Myriadcoin";
|
||||
}).prop("selected", true);
|
||||
$(".network").trigger("change");
|
||||
});
|
||||
// check the address is generated correctly
|
||||
waitForGenerate(function() {
|
||||
var actual = page.evaluate(function() {
|
||||
return $(".address:first").text();
|
||||
});
|
||||
if (actual != expected) {
|
||||
console.log("Myriadcoin address is incorrect");
|
||||
console.log("Expected: " + expected);
|
||||
console.log("Actual: " + actual);
|
||||
fail();
|
||||
}
|
||||
next();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// BIP39 seed is set from phrase
|
||||
function() {
|
||||
page.open(url, function(status) {
|
||||
|
||||
Reference in New Issue
Block a user