-
Notifications
You must be signed in to change notification settings - Fork 1
/
feathercoin.html
27 lines (25 loc) · 1.39 KB
/
feathercoin.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<script src="js/bitcoinjs-lib.js" integrity="sha384-zGWl15v6CBuUT4k6pkg8+P+rc5xRDr6NKW6Yuh8nbfN5hHeDlz9bu61MrsvohxXL"
crossorigin="anonymous"></script>
<script src="js/qrcode.js" integrity="sha384-+uaAthihb/4g7LTyfTcJu4KOKCIN0f1EeBxAwgcbeu26cV+fCgk/WQTuJ+jiHfhP"
crossorigin="anonymous"></script>
<script>
function generate() {
const feather = bitcoin.networks.bitcoin;
feather.pubKeyHash = 0x0e; feather.wif = 0x8e; feather.scriptHash = 0x16;
const keyPair = bitcoin.ECPair.makeRandom();
const pubKey = keyPair.getAddress();
const privKey = keyPair.toWIF();
document.getElementById("public").textContent = pubKey;
document.getElementById("public_qr").textContent = "";
new QRCode(document.getElementById("public_qr"), { text: pubKey, width: 300, height: 300, correctLevel: QRCode.CorrectLevel.H });
//Start: Set details of crypto
var explorerUrl = 'https://explorer.feathercoin.com/address'; //Ensure there's no "/" at the end
var a = document.getElementById('explorer-url');
a.href = explorerUrl + "/" + pubKey;
document.getElementById('pubKey').value = pubKey;
document.getElementById('privKey').value = privKey;
document.getElementById('cryptoExplorer').value = 'Feathercoin.com';
document.getElementById('cryptoExplorerUrl').value = explorerUrl;
//End
}
</script>