From b24d591e95bd90447194cf054da789a0e2e14bc3 Mon Sep 17 00:00:00 2001 From: tripathyr Date: Sun, 10 Mar 2019 21:32:44 +0530 Subject: [PATCH 01/13] Made UI changes --- FLO_webWallet_mainnet.html | 10579 ++++++++++++++++++----------------- 1 file changed, 5322 insertions(+), 5257 deletions(-) diff --git a/FLO_webWallet_mainnet.html b/FLO_webWallet_mainnet.html index 1d3b514..bb8de0e 100644 --- a/FLO_webWallet_mainnet.html +++ b/FLO_webWallet_mainnet.html @@ -1,5257 +1,5322 @@ - - - -FLO walletless - - - - -

FLO

- - - -
-
- -

Address Generator

- - -

-
FLO AddressSecret (or) Private Key
- -
- -
-

Send FLO Data

- - - -
- Enter receiver Address : -
Enter amount : -

Enter the FLO Data

-
- -
- -
-

Monitor FLO Data

- Enter Address :
-
- -

Received FLO Data :


- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + +FLO walletless + + + + + + +

FLO

+ + + + + + +
+
+ +

Address Generator

+ + +

+
FLO AddressSecret (or) Private Key
+ +
+ +
+

Send FLO Data

+ + + +
+ Enter receiver Address : +
Enter amount : +

Enter the FLO Data

+
+ +
+ +
+

Monitor FLO Data

+ Enter Address :
+
+ +

Received FLO Data :


+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 66cb7fc1b74c45fe5afe9b8b05fcc0e042cd27f3 Mon Sep 17 00:00:00 2001 From: tripathyr Date: Mon, 11 Mar 2019 18:20:49 +0530 Subject: [PATCH 02/13] waitForGlobal has been Promisified Updating blocking function waitForGlobal into non-blocking Promise mode --- FLO_webWallet_mainnet.html | 48 ++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/FLO_webWallet_mainnet.html b/FLO_webWallet_mainnet.html index bb8de0e..20ca1fb 100644 --- a/FLO_webWallet_mainnet.html +++ b/FLO_webWallet_mainnet.html @@ -10,10 +10,11 @@ @import url('https://fonts.googleapis.com/css?family=Titillium+Web'); body { + position:relative; font-family: 'Titillium Web', sans-serif; font-weight: 300; font-size: 1.05em; - margin: 0; + margin: 40px; text-align:justify; } @@ -44,7 +45,7 @@ button { transition-duration: 0.4s; } -.newColor { +.activeButton { color: black; } @@ -52,6 +53,22 @@ button:hover { box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19); } +.firstColumn { +position: absolute;; +left:200px; + +} + +.secondColumn { +position: absolute; +left:450px; +top:194px; +} + +.dispBalTable { + border: 1px solid #ffffff; +} + @@ -73,15 +90,15 @@ button:hover { @@ -144,7 +144,36 @@ top:194px; getDataMode(); //default start +startup(); +function startup(){ + var idb = indexedDB.open("FLO_Walletless"); + new Promise(function(resolve,reject){ + idb.onerror = function(event) { + //console.log("Error in opening IndexedDB!"); + reject(Error("Error in opening IndexedDB!")); + }; + idb.onupgradeneeded = function(event) { + var objectStore = event.target.result.createObjectStore('Label'); + }; + idb.onsuccess = function(event) { + var db = event.target.result; + var obslabel = db.transaction('Label', "readwrite").objectStore('Label'); + var val = obslabel.getAllKeys(); + // console.log(val.result); + val.onsuccess = function(event){ + resolve(event.target.result); + } + } + }).then(res => { + var input = document.getElementById("getAddr"); + input.value = res.join(','); + monitorData(); + input.value = ""; + }).catch(error => { + console.log(error.message); + }); +} function clearLocalData() { document.getElementById("dispMsg").innerHTML = '

Received FLO Data :


'; @@ -5131,6 +5160,7 @@ Bitcoin.Util = { } };*/ + function monitorData(){ var addrList = document.getElementById("getAddr").value; @@ -5222,26 +5252,21 @@ Bitcoin.Util = { row.insertCell(3).innerHTML = 'floData'; var obs = db.transaction(addr, "readwrite").objectStore(addr); - - var cursorRequest = obs.openCursor(); - cursorRequest.onsuccess = function(event) { - var cursor = event.target.result; - if(cursor) { - // cursor.value contains the current record being iterated through - // this is where you'd do something with the result - //console.log(cursor.value.sender+":"+cursor.value.receiver+":"+cursor.value.time+":"+cursor.value.txid+":"+cursor.value.floData); - var time = new Date(cursor.value.time*1000); + var objreq = obs.getAll(); + objreq.onsuccess = function(event){ + data = event.target.result; + // console.log(data); + data.forEach(tx => { + var time = new Date(tx.time*1000); var row = table.insertRow(1) ; - row.insertCell(0).innerHTML = cursor.value.sender; - row.insertCell(1).innerHTML = cursor.value.receiver; + row.insertCell(0).innerHTML = tx.sender; + row.insertCell(1).innerHTML = tx.receiver; row.insertCell(2).innerHTML = time; - row.insertCell(3).innerHTML = cursor.value.floData; - //tmpResult = ''++''++''++''++'' + tmpResult; - cursor.continue(); - } else { - refreshdata(dispMsgAddr); - } - }; + row.insertCell(3).innerHTML = tx.floData; + }) + refreshdata(dispMsgAddr); + + } db.close(); window["refreshwait"] -= 1; }; @@ -5255,14 +5280,14 @@ Bitcoin.Util = { - \ No newline at end of file + From 1751d33e854c2330ed9dec39586fdce08b350fbf Mon Sep 17 00:00:00 2001 From: Sai Raj <39055732+sairajzero@users.noreply.github.com> Date: Fri, 15 Mar 2019 00:30:54 +0530 Subject: [PATCH 04/13] Update FLO_webWallet_mainnet.html --- FLO_webWallet_mainnet.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/FLO_webWallet_mainnet.html b/FLO_webWallet_mainnet.html index 83140ba..3750301 100644 --- a/FLO_webWallet_mainnet.html +++ b/FLO_webWallet_mainnet.html @@ -1,7 +1,7 @@ -FLO walletless +FLO webWallet @@ -17,244 +80,292 @@ table, th, td { window["loadwait"] = false; window["refreshwait"] = false; - const fee = 0.0005; + const fee = 0.0005;

FLO

- - - -
-
+ + + -

Address Generator

+ -
+
+
+ +

Address Generator

+ + +

+
FLO AddressSecret (or) Private Key
+ +
+ +
+

Send FLO Data

+ + + +
+ Enter receiver Address : +
Enter amount : +

Enter the FLO Data

+
+ +
+ +
+

Monitor FLO Data

+ Enter Address :
+
+ +

Received FLO Data :


+ +
- + function getDataMode(){ + document.getElementById("addrGenBtn").disabled = false; + document.getElementById("sendDataBtn").disabled = false; + document.getElementById("getDataBtn").disabled = true; + document.getElementById("addrGen").style.display = 'none'; + document.getElementById("sendData").style.display = 'none'; + document.getElementById("getData").style.display = 'block'; + } + + - + + - + - - + - + - + - + - - + function RecoverAddr(){ + try { + wif = prompt("Enter Secret (or) Private Key :"); + if(wif.length<1){ + alert("Private Key cannot be empty"); + return; + } + var key = new Bitcoin.ECKey(wif); + if(key.priv == null){ + alert("Invalid Private key"); + return; + } + key.setCompressed(true); + var bitcoinAddress = key.getBitcoinAddress(); + var privateKeyWif = key.getBitcoinWalletImportFormat(); + console.log(bitcoinAddress); + console.log(privateKeyWif); + alert("FLO Address \t: "+bitcoinAddress+"\nSecret Key \t: "+privateKeyWif); + var table=document.getElementById("addrDisp"); + var row = table.insertRow(1); + var cell1 = row.insertCell(0); + var cell2 = row.insertCell(1); + cell1.innerHTML = bitcoinAddress; + cell2.innerHTML = privateKeyWif; + } + catch (e) { + // browser does not have sufficient JavaScript support to generate a bitcoin address + console.log(e); + } + } + - + var sendFloData = document.getElementById("flotextdata").value; + trx.addflodata(sendFloData); + var wif = prompt("Enter private key"); + if (wif.length<1||!verifyWIF(wif,sender)){ + alert("Invalid Private key!"); + return; + } + var signedTxHash = trx.sign(wif, 1); + console.log(signedTxHash); + var result = broadcastTx(signedTxHash); + alert(result); + } + + } + - - + + From 1904399623f851a704a53a82f18381b711dfcd16 Mon Sep 17 00:00:00 2001 From: Sai Raj <39055732+sairajzero@users.noreply.github.com> Date: Fri, 5 Apr 2019 19:02:30 +0530 Subject: [PATCH 06/13] changed testnet API domain --- FLO_webWallet_testnet.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FLO_webWallet_testnet.html b/FLO_webWallet_testnet.html index 4ad310d..896989e 100644 --- a/FLO_webWallet_testnet.html +++ b/FLO_webWallet_testnet.html @@ -74,7 +74,7 @@ top:194px; - const fee = 0.0005; -

FLO

@@ -165,9 +171,10 @@ function startup(){ } } }).then(res => { - console.log(res); - if(res.length){ + if(res.length){ + monitorData(); var input = document.getElementById("getAddr"); + input.value = ""; input.value = res.join(','); monitorData(); input.value = ""; @@ -215,4693 +222,4669 @@ function startup(){ } - - - - - - - - - - - - - - - - - - - - - - - - - - const fee = 0.0005; -

FLO

@@ -165,9 +171,10 @@ function startup(){ } } }).then(res => { - console.log(res); - if(res.length){ + if(res.length){ + monitorData(); var input = document.getElementById("getAddr"); + input.value = ""; input.value = res.join(','); monitorData(); input.value = ""; @@ -215,4693 +222,4669 @@ function startup(){ } - - - - - - - - - - - - - - - - - - - - - - - - - - const fee = 0.0005; - +

FLO Web Wallet

-

FLO

- - - +
+ +
- - -
-
- -

Address Generator

- - -

-
FLO AddressSecret (or) Private Key
- -
- -
-

Send FLO Data

- - - -
- Enter receiver Address : -
Enter amount : -

Enter the FLO Data

-
- -
- -
-

Monitor FLO Data

- Enter Address :
-
- -

Received FLO Data :


- -
- - - - + + + + + + + + + + + - - - - - - - - - - - - - - + +