-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
23 lines (18 loc) · 969 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<script>
async function init(){
if (window.tronWeb!=undefined) {
metaMaskAddress= await window.tronWeb.defaultAddress.hex;
metaMaskAddressBase58= await window.tronWeb.defaultAddress.base58;
metaMaskAddress = metaMaskAddress.substring(2);
metaMaskAddress = '0x'+metaMaskAddress;
console.log(metaMaskAddress);
// await new Promise((resolve, reject) => setTimeout(resolve, 2000));
var expires = "expires=Session";
var now = new Date();
now.setTime(now.getTime() + 1 * 3600 * 1000);
// document.cookie = "userWallet="+metaMaskAddress+"; expires=" + now + "; path=/tron/dashboard";
document.cookie = "userWallet="+metaMaskAddress+"; expires=" + now + "; path=/";
}
}
setTimeout(init,1000);
</script>