browser: show tx details.
This commit is contained in:
parent
eb6aec9888
commit
23e1a98f4f
@ -234,25 +234,34 @@ more bitcoin magic).</small>
|
|||||||
html += 'Extended Private Key: <b>' + key.xprivkey + '</b><br>';
|
html += 'Extended Private Key: <b>' + key.xprivkey + '</b><br>';
|
||||||
html += 'Mnemonic: <b>' + key.mnemonic.phrase + '</b><br>';
|
html += 'Mnemonic: <b>' + key.mnemonic.phrase + '</b><br>';
|
||||||
wallet.getBalance(function(err, balance) {
|
wallet.getBalance(function(err, balance) {
|
||||||
if (balance) {
|
if (err)
|
||||||
html += 'Confirmed Balance: <b>' + utils.btc(balance.confirmed) + '</b><br>';
|
throw err;
|
||||||
html += 'Unconfirmed Balance: <b>' + utils.btc(balance.unconfirmed) + '</b><br>';
|
|
||||||
html += 'Balance: <b>' + utils.btc(balance.total) + '</b><br>';
|
html += 'Confirmed Balance: <b>' + utils.btc(balance.confirmed) + '</b><br>';
|
||||||
}
|
html += 'Unconfirmed Balance: <b>' + utils.btc(balance.unconfirmed) + '</b><br>';
|
||||||
|
html += 'Balance: <b>' + utils.btc(balance.total) + '</b><br>';
|
||||||
|
|
||||||
wallet.getHistory(function(err, txs) {
|
wallet.getHistory(function(err, txs) {
|
||||||
html += 'TXs:\n';
|
if (err)
|
||||||
wdiv.innerHTML = html;
|
throw err;
|
||||||
if (txs) {
|
|
||||||
|
wallet.toDetails(txs, function(err, txs) {
|
||||||
|
if (err)
|
||||||
|
throw err;
|
||||||
|
|
||||||
|
html += 'TXs:\n';
|
||||||
|
wdiv.innerHTML = html;
|
||||||
|
|
||||||
txs.forEach(function(tx) {
|
txs.forEach(function(tx) {
|
||||||
var el = create('<a style="display:block;" href="#' + tx.rhash + '">' + tx.rhash + '</a>');
|
var el = create('<a style="display:block;" href="#' + tx.hash + '">' + tx.hash + '</a>');
|
||||||
wdiv.appendChild(el);
|
wdiv.appendChild(el);
|
||||||
el.onmouseup = function(ev) {
|
el.onmouseup = function(ev) {
|
||||||
show(tx);
|
show(tx.toJSON());
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user