mirror of
https://github.com/OneKeyHQ/bip39.git
synced 2026-04-05 18:43:47 +00:00
@@ -253,6 +253,14 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="client-phrase" class="col-sm-2 control-label" data-translate>Client</label>
|
||||
<div class="col-sm-10">
|
||||
<select id="client-phrase" class="client form-control">
|
||||
<!-- populated by javascript -->
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="root-key" class="col-sm-2 control-label" data-translate>BIP32 Root Key</label>
|
||||
<div class="col-sm-10">
|
||||
@@ -393,7 +401,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" data-translate>Block Explorers</label>
|
||||
<label class="col-sm-2 control-label" data-translate>Block Explorers and other clients</label>
|
||||
<div class="col-sm-10">
|
||||
<p class="form-control no-border">
|
||||
<span data-translate-html>Use path <code>m/44'/0'/0'</code>.</span>
|
||||
@@ -403,6 +411,13 @@
|
||||
<span data-translate>Can be used with</span>:
|
||||
<a href="https://blockchain.info/" target="_blank">blockchain.info</a>
|
||||
</p>
|
||||
<p class="form-control no-border">
|
||||
<span data-translate-html>Use path <code>m/0'/0</code>.</span>
|
||||
</p>
|
||||
<p class="form-control no-border">
|
||||
<span data-translate>Can be used with</span>:
|
||||
<a href="https://multibit.org/" target="_blank">MultiBit HD</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -23,7 +23,9 @@
|
||||
|
||||
var DOM = {};
|
||||
DOM.network = $(".network");
|
||||
DOM.client = $(".client");
|
||||
DOM.phraseNetwork = $("#network-phrase");
|
||||
DOM.phraseClient = $("#client-phrase");
|
||||
DOM.useEntropy = $(".use-entropy");
|
||||
DOM.entropyContainer = $(".entropy-container");
|
||||
DOM.entropy = $(".entropy");
|
||||
@@ -77,6 +79,7 @@
|
||||
function init() {
|
||||
// Events
|
||||
DOM.network.on("change", networkChanged);
|
||||
DOM.client.on("change", clientChanged);
|
||||
DOM.useEntropy.on("change", setEntropyVisibility);
|
||||
DOM.entropy.on("input", delayedEntropyChanged);
|
||||
DOM.entropyMnemonicLength.on("change", entropyChanged);
|
||||
@@ -102,6 +105,7 @@
|
||||
hidePending();
|
||||
hideValidationError();
|
||||
populateNetworkSelect();
|
||||
populateClientSelect();
|
||||
}
|
||||
|
||||
// Event handlers
|
||||
@@ -116,6 +120,17 @@
|
||||
rootKeyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
function clientChanged(e) {
|
||||
var clientIndex = e.target.value;
|
||||
clients[clientIndex].onSelect();
|
||||
if (seed != null) {
|
||||
phraseChanged();
|
||||
}
|
||||
else {
|
||||
rootKeyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
function setEntropyVisibility() {
|
||||
if (isUsingOwnEntropy()) {
|
||||
@@ -710,6 +725,16 @@
|
||||
DOM.phraseNetwork.append(option);
|
||||
}
|
||||
}
|
||||
|
||||
function populateClientSelect() {
|
||||
for (var i=0; i<clients.length; i++) {
|
||||
var client = clients[i];
|
||||
var option = $("<option>");
|
||||
option.attr("value", i);
|
||||
option.text(client.name);
|
||||
DOM.phraseClient.append(option);
|
||||
}
|
||||
}
|
||||
|
||||
function getLanguage() {
|
||||
var defaultLanguage = "english";
|
||||
@@ -1140,6 +1165,30 @@
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
var clients = [
|
||||
{
|
||||
name: "Bitcoin Core",
|
||||
onSelect: function() {
|
||||
DOM.bip32path.val("m/0'/0'");
|
||||
DOM.hardenedAddresses.prop('checked', true);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "blockchain.info",
|
||||
onSelect: function() {
|
||||
DOM.bip32path.val("m/44'/0'/0'");
|
||||
DOM.hardenedAddresses.prop('checked', false);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "MultiBit HD",
|
||||
onSelect: function() {
|
||||
DOM.bip32path.val("m/0'/0");
|
||||
DOM.hardenedAddresses.prop('checked', false);
|
||||
},
|
||||
}
|
||||
]
|
||||
|
||||
init();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user