-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0xgen.js
More file actions
43 lines (40 loc) · 1.24 KB
/
0xgen.js
File metadata and controls
43 lines (40 loc) · 1.24 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* 0xgen code by Tanishq */
var ethers;
function generate(){
const wallet = ethers.Wallet.createRandom();
var address = wallet.address;
var mnemonic = wallet.mnemonic.phrase;
var private_key = wallet.privateKey;
document.getElementById("address").value=address;
document.getElementById("private_key").value=private_key;
document.getElementById("mnemonic").value=mnemonic;
}
/* end of 0x gen */
/* some extra: $ETH ticker code by spellsmith */
var date = new Date();
function startTime() {
const today = new Date();
let calendar = today.toLocaleString('pt-BR'); document.getElementById('clock').innerHTML = calendar;
setTimeout(startTime, 1000);
}
function checkTime(i) {
if (i < 10) {i = "0" + i};
return i;
}
var ws = new WebSocket("wss://api.bitfinex.com/ws");
ws.onopen = function(){
ws.send(JSON.stringify({"event":"subscribe", "channel":"ticker", "pair":"ETHUSD"}))
};
ws.onmessage = function(msg){
var response = JSON.parse(msg.data);
var hb = response[1];
if(hb != "hb"){
document.getElementById("eth").innerHTML = response[1];
}
};
function reload(){
var container = document.getElementById("eth");
var content = container.innerHTML;
container.innerHTML= content;
}
/* end of $ETH ticker */