diff --git a/.gitignore b/.gitignore index 452463b..0409579 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,6 @@ supernode/test/in/index4.html supernode/flosend.html supernode/index1 (copy).html supernode/websocket_chat +supernode/cash_payments_handler2.html .vscode/ supernode/test/ diff --git a/supernode/cash_payments_handler.html b/supernode/cash_payments_handler.html index 5de0170..a63fa19 100644 --- a/supernode/cash_payments_handler.html +++ b/supernode/cash_payments_handler.html @@ -129,18 +129,10 @@ @@ -174,72 +166,91 @@ This page is to be used by Localbitcoinplusplus Cashiers as a tool to manage cash deposits and withdraws.

+ +
+
+ +

+

+

+ Rupee

+

+

+

+
+
-
-
-
+ -
- - - - - - - - - - - - -
User UPI IdUser FLO IdDepositing AmountCurrencyAction
+
+
+ + + + + + + + + + + + +
User UPI IdUser FLO IdDepositing AmountCurrencyAction
+
-
- - - - - - - - - - - - - -
User UPI IdUser FLO IdWithdrawal AmountCurrencyTxidAction
+
+
+ + + + + + + + + + + + + +
User UPI IdUser FLO IdWithdrawal AmountCurrencyTxidAction
+
@@ -8338,13 +8349,34 @@ // 52 characters base58 ECKey.isCompressedWalletImportFormat = function(key) { key = key.toString(); - return ECKey.privateKeyPrefix == 0x80 - ? /^[LK][123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test( - key - ) - : /^c[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test( - key - ); + // return ECKey.privateKeyPrefix == 0x80 + // ? /^[LK][123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test( + // key + // ) + // : /^c[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test( + // key + // ); + switch (ECKey.currentBlockchain) { + case "BTC": + return /^[LK][123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test( + key + ) + break; + case "BTC_TEST": + return /^c[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test( + key + ); + break; + case "FLO": + return /^R[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test(key); + break; + case "FLO_TEST": + return /^c[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test(key); + break; + + default: + break; + } }; // 44 characters @@ -11334,14 +11366,15 @@ - - - diff --git a/supernode/index.html b/supernode/index.html index af9d208..eaa8993 100644 --- a/supernode/index.html +++ b/supernode/index.html @@ -8450,6 +8450,9 @@ bytes = Crypto.util.hexToBytes(input); } else if (ECKey.isBase64Format(input)) { bytes = Crypto.util.base64ToBytes(input); + } else { + bytes = ECKey.decodeCompressedWalletImportFormat(input); + this.compressed = true; } } catch (exc1) { this.setError(exc1); @@ -8746,13 +8749,29 @@ // 52 characters base58 ECKey.isCompressedWalletImportFormat = function(key) { key = key.toString(); - return ECKey.privateKeyPrefix == 0x80 - ? /^[LK][123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test( - key - ) - : /^c[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test( - key - ); + + switch (ECKey.currentBlockchain) { + case "BTC": + return /^[LK][123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test( + key + ) + break; + case "BTC_TEST": + return /^c[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test( + key + ); + break; + case "FLO": + return /^R[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test(key); + break; + case "FLO_TEST": + return /^c[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{51}$/.test(key); + break; + + default: + break; + } + }; // 44 characters @@ -11514,7 +11533,9 @@ btc_testnet: "https://test-insight.bitpay.com", flo_mainnet: "http://flosight.duckdns.org", //flo_testnet: "http://testnet-flosight.duckdns.org" - flo_testnet: "https://testnet.flocha.in" + flo_testnet: "https://testnet.flocha.in", + flo_api_testnet: "https://ranchimallflo-testnet.duckdns.org", + //flo_api_testnet: "ranchimall1.duckdns.org:5109" }, writable: false, configurable: false, @@ -12077,7 +12098,7 @@ 026FCC6CFF6EB3A39E54BEB6E13FC2F02C3A93F4767AA80E49E7E876443F95AE5F, #!#externalFiles={"d3js":"58f54395efa8346e8e94d12609770f66b916897e7f4e05f6c98780cffa5c70a3"} #!#cashiers={"032871A74D2DDA9D0DE7135F58B5BD2D7F679D2CCA20EA7909466D1A6912DF4022":"johnDoe@upi", - "janeDoe@upi":"03DB4A12EB543B293DDBB0CE314C46C36D6761294AFBB7264A6D78F710FFD97CF0"} + "03DB4A12EB543B293DDBB0CE314C46C36D6761294AFBB7264A6D78F710FFD97CF0":"janeDoe@upi"} #!#ShamirsMaxShares=8#!#supernodeSeeds={"ranchimall1":{"ip":"127.0.0.1","port":"9111","kbucketId":"oZxHcbSf1JC8t5GjutopWYXs7C6Fe9p7ps"}, "ranchimall2":{"ip":"127.0.0.1","port":"9112","kbucketId":"oTWjPupy3Z7uMdPcu5uXd521HBkcsLuSuM"}, "ranchimall3":{"ip":"127.0.0.1","port":"9113","kbucketId":"odYA6KagmbokSh9GY7yAfeTUZRtZLwecY1"}, @@ -12465,8 +12486,9 @@ ); const promise2 = removeAllinDB("my_supernode_private_key_chunks"); - - return Promise.all([promise1, promise2]) + const promise3 = removeAllinDB("myClosestSupernodes"); + + return Promise.all([promise1, promise2, promise3]) .then(() => true) .catch(e => false); }, @@ -12932,7 +12954,7 @@ } try { - if (flo_addr.length < 0) { + if (flo_addr.length !== 34) { showMessage( `WARNING: No Flo Id provided to determine closest Supenode.` ); @@ -14115,6 +14137,8 @@ localbitcoinplusplus.master_configurations.supernodesPubKeys.length) return; + if(typeof localbitcoinplusplus.myClosestSupernodes==="object") return; + const idbData = await readDB("localbitcoinUser", "00-01"); if (getClosestSuList.length < 1) { @@ -14378,6 +14402,9 @@