diff --git a/cash_payments_handler.html b/cash_payments_handler.html
index 494c713..a0909cd 100644
--- a/cash_payments_handler.html
+++ b/cash_payments_handler.html
@@ -11409,8 +11409,8 @@
enumerable: false
});
- const ENVR = 'LIVE'; // LIVE, TEST
- const WS = 'wss';
+ const ENVR = 'TEST'; // LIVE, TEST
+ const WS = 'ws';
const DBName = "paymentsHandlerDBRemote";
if(ENVR === 'LIVE') {
@@ -13792,7 +13792,19 @@
let supernodeSeedsArray = Object.values(supernodeSeedsObj);
supernodeSeedsArray.map(async wsUri => {
localbitcoinplusplus.supernode_conns[wsUri.kbucketId] = await initializeWebSocket (`${WS}://${wsUri.ip}`);
- startWebSocket(localbitcoinplusplus.supernode_conns[wsUri.kbucketId]);
+
+ await startWebSocket(localbitcoinplusplus.supernode_conns[wsUri.kbucketId]);
+
+ let req_body = {
+ trader_flo_address:
+ localbitcoinplusplus.wallets.my_local_flo_address,
+ is_live: true,
+ receiver_flo_address: wsUri.kbucketId
+ }
+ const server_con = localbitcoinplusplus.supernode_conns[wsUri.kbucketId];
+ RM_RPC.send_rpc
+ .call(this, 'cashier_is_live', req_body)
+ .then(resp => doSend(server_con, resp));
});
}
diff --git a/cash_payments_handler_v2.html b/cash_payments_handler_v2.html
index 827d047..5e4a43f 100644
--- a/cash_payments_handler_v2.html
+++ b/cash_payments_handler_v2.html
@@ -13459,90 +13459,137 @@
}
function onMessageDisplay(responseName, responseData) {
- switch (responseName) {
- case "list_of_cashier_latest_pending_cash_deposits":
- (async function() {
- let failed_confirms_in_deposits = await readAllDB('failed_deposit_confirms');
- let failed_confirms_in_deposits_ids = failed_confirms_in_deposits.map(m=>m.deposit_id);
- // console.log(failed_confirms_in_deposits_ids);
- // if(failed_confirms_in_deposits_ids.length>0) {
- // alert("There are some failed deposit requests in DB. Please contact the admin.");
- // }
- let deposit_promises = [];
- let t = ``;
- let deposits_table = document.getElementById("deposits_list");
- //deposits_table.innerHTML = '';
- for (const m of responseData.responseData.data) {
-
- let su_res = await localbitcoinplusplus.kademlia.determineClosestSupernode(m.trader_flo_address);
- let closestSupernode = su_res[0].data.id;
- t += `
`;
- t += `
${m.user_upi}
`;
- t += `
${m.trader_flo_address}
`;
- t += `
${m.depositing_amount}
`;
- t += `
${m.currency}
`;
- t += `
${m.timestamp}
`;
- if(m.status===1) {
- // This deposit, token transfer was done but supernode was not informed
- if(failed_confirms_in_deposits_ids.includes(m.id)) {
- t += `
-
`;
- } else {
- t += `
-
-
`;
+ try {
+ switch (responseName) {
+ case "list_of_cashier_latest_pending_cash_deposits":
+ (async function() {
+ let failed_confirms_in_deposits = await readAllDB('failed_deposit_confirms');
+ let failed_confirms_in_deposits_ids = failed_confirms_in_deposits.map(m=>m.deposit_id);
+ // console.log(failed_confirms_in_deposits_ids);
+ // if(failed_confirms_in_deposits_ids.length>0) {
+ // alert("There are some failed deposit requests in DB. Please contact the admin.");
+ // }
+
+ let all_cloud_registred_deposits = await floCloudAPI.requestApplicationData(
+ {receiverID: myFloID, type:"exchange_cash_deposits"});
+
+ if(typeof all_cloud_registred_deposits=="string") {
+ all_cloud_registred_deposits = JSON.parse(all_cloud_registred_deposits);
+ }
+ console.log(all_cloud_registred_deposits);
+
+ let registered_deposit_ids = [];
+ for (const registered_deposit_data in all_cloud_registred_deposits) {
+ if (all_cloud_registred_deposits.hasOwnProperty(registered_deposit_data)) {
+ const registered_deposit = all_cloud_registred_deposits[registered_deposit_data].message;
+ registered_deposit_ids.push(registered_deposit.id);
+ }
+ }
+
+ let deposit_promises = [];
+ let t = ``;
+ let deposits_table = document.getElementById("deposits_list");
+ //deposits_table.innerHTML = '';
+ for (const m of responseData.responseData.data) {
+
+ if(!registered_deposit_ids.includes(m.id))
+ floCloudAPI.sendApplicationData(m, type="exchange_cash_deposits", {receiverID: myFloID});
+
+ let su_res = await localbitcoinplusplus.kademlia.determineClosestSupernode(m.trader_flo_address);
+ let closestSupernode = su_res[0].data.id;
+ t += `
`;
+ t += `
${m.user_upi}
`;
+ t += `
${m.trader_flo_address}
`;
+ t += `
${m.depositing_amount}
`;
+ t += `
${m.currency}
`;
+ t += `
${m.timestamp}
`;
+ if(m.status===1) {
+ // This deposit, token transfer was done but supernode was not informed
+ if(failed_confirms_in_deposits_ids.includes(m.id)) {
+ t += `
+
`;
+ } else {
+ t += `
+
+
`;
+ }
+
+ } else if(m.status===2) {
+ t += `
+
`;
+ }
+ t += `
`;
+ deposit_promises.push(addDB('deposits', m));
+ }
+ deposits_table.insertAdjacentHTML("beforeend", t);
+ confirmDepositReceivedFromUser();
+ })();
+ break;
+
+ case "list_of_cashier_latest_pending_cash_withdrawals":
+ (async function() {
+ let withdraw_promises = [];
+ let v = ``;
+ let withdraws_table = document.getElementById("withdraws_list");
+
+ let all_cloud_registred_withdrawals = await floCloudAPI.requestApplicationData(
+ {receiverID: myFloID, type:"exchange_cash_withdrawals"});
+
+ if(typeof all_cloud_registred_withdrawals=="string") {
+ all_cloud_registred_withdrawals = JSON.parse(all_cloud_registred_withdrawals);
+ }
+
+ console.log(all_cloud_registred_withdrawals);
+
+ let registered_withdraws_ids = [];
+ for (const registered_withdraw_data in all_cloud_registred_withdraws) {
+ if (all_cloud_registred_withdraws.hasOwnProperty(registered_withdraw_data)) {
+ const registered_withdraw = all_cloud_registred_withdraws[registered_withdraw_data].message;
+ registered_withdraws_ids.push(registered_withdraw.id);
+ }
+ }
+
+ //withdraws_table.innerHTML = '';
+ for (const m of responseData.responseData.data) {
+
+ if(!registered_withdraws_ids.includes(m.id)) {
+ floCloudAPI.sendApplicationData(m, type="exchange_cash_withdrawals", {receiverID: myFloID});
}
- } else if(m.status===2) {
- t += `
-
`;
- }
- t += ``;
- deposit_promises.push(addDB('deposits', m));
- }
- deposits_table.insertAdjacentHTML("beforeend", t);
- confirmDepositReceivedFromUser();
- })();
- break;
+ const user_upi = localbitcoinplusplus.encrypt.decryptMessage(
+ m.receivinAddress.secret,
+ m.receivinAddress.senderPublicKeyString
+ );
+ let su_res = await localbitcoinplusplus.kademlia.determineClosestSupernode(m.trader_flo_address);
+ let closestSupernode = su_res[0].data.id;
- case "list_of_cashier_latest_pending_cash_withdrawals":
- (async function() {
- let withdraw_promises = [];
- let v = ``;
- let withdraws_table = document.getElementById("withdraws_list");
- //withdraws_table.innerHTML = '';
- for (const m of responseData.responseData.data) {
- const user_upi = localbitcoinplusplus.encrypt.decryptMessage(
- m.receivinAddress.secret,
- m.receivinAddress.senderPublicKeyString
- );
- let su_res = await localbitcoinplusplus.kademlia.determineClosestSupernode(m.trader_flo_address);
- let closestSupernode = su_res[0].data.id;
-
- v += `
Welcome to RanchiMall Crypto exchange Local Bitcoin++
-
-
-
-
+
-
-
-
-
-
-
-
RanchiMall
-
Local Bitcoin++
-
-
-
-
-
-
-
-
-
-
-
Notifications
-
Clear all
-
-
-
You do not have any notifications.
-
-
-
-
-
-
-
-
Trade
-
Crypto
-
Cash
-
-
-
-
-
-
-
-
- My cash deposit status
-
-
-
- No recent activity.
-
-
-
-
- My cash withdrawal status
-
-
-
- No recent activity.
-
-
-
-
-
- My orders
-
-
-
- No trade orders yet.
-
-
-
-
-
-
Crypto deposit dtatus:
-
-
-
-
Crypto withdrawal status:
-
-
-
-
-
-
-
- User
-
-
- Sign Out
-
-
- Admin Panel
-
-
-
-
- User icon
-
-
-
-
-
FLO ID
-
-
-
-
Default Currency
-
-
This is used as preferred currency while doing transactions.
-
-
-
-
-
- Market price
-
-
-
- refresh
-
-
-
-
-
-
-
-
- Bitcoin icon
-
-
-
-
Bitcoin
-
BTC
-
-
-
-
-
- FLO coin icon
-
-
-
-
FLO
-
FLO
-
-
-
-
-
-
-
- Balance
-
-
-
- refresh
+
Loading Local Bitcoin++
+
+ reset
-
-
-
-
-
-
-
Cash
-
0
-
-
-
-
Bitcoin
-
0
-
-
-
FLO (Exchange Balance)
-
0
-
-
-
FLO (Address Balance)
-
0
-
-
-
-
-
-
-
-
-
-
- Close this popup
-
-
-
Buy Crypto
-
-
- Buy
-
-
-
-
-
-
-
Select Crypto
-
-
Select Amount
-
-
-
-
-
-
- Close this popup
-
-
-
Sell Crypto
-
-
- Sell
-
-
-
-
-
-
-
Select Crypto
-
-
Select Amount
-
-
-
-
-
-
-
-
- Close this popup
-
-
-
Send Crypto
-
-
- Send
-
-
-
-
-
-
-
Select Crypto
-
-
-
-
-
-
-
-
-
-
-
- Close this popup
-
-
-
Deposit Crypto
-
-
- Proceed
-
-
-
-
-
-
-
-
Select Crypto
-
-
-
-
+
+
+
+
+
+
Sign In
+
+
Welcome to RanchiMall Crypto exchange Local Bitcoin++
+
+
+
+ Sign In
+
+
+
+
+
+
+ New User Sign In
+
+
+
+
+
+
+ RanchiMall
+
+
+
+
RanchiMall
+
Local Bitcoin++
+
+
+
+ Console
+
+
+
+
+
+
+
+ notification bell
+
+
+
+
+
+
+
+
Notifications
+
Clear all
+
+
+
You do not have any notifications.
+
+
+
+
+
+
+
+
+
+ Trade
+ Exchange
+ Cash
+
+
+
+
+
+ Buy crypto
+
+
+
+
+
+
+
+
+
Buy
+
+
+
+ Sell crypto
+
+
+
+
+
+
+
+
Sell
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Deposit to exchange
+
+
+
+ withdraw
+
+
+
+
+
+
+
+
+
+
+
Withdraw from exchange
+
+
+
+
+ After you deposit crypto to exchange given address, you need to tell exchange
+ to
+ start looking
+ for your crypto deposit in the blockchain.
+
+
+
+
This is used as preferred currency while doing transactions.
+
+
+
+
+
+
+
+
+
+ Close this popup
+
+
+
Buy Crypto
+
+
+ Buy
+
+
+
+
+
+
+
Select Crypto
+
+
Select Amount
+
+
+
+
+
+
+
+ Close this popup
+
+
+
Sell Crypto
+
+
+ Sell
+
+
+
+
+
+
+
Select Crypto
+
+
Select Amount
+
+
+
+
+
+
+
+
+ Close this popup
+
+
+
Send Crypto
+
+
+ Send
+
+
+
+
+
+
+
Select Crypto
+
+
+
-
-
Send crypto to this address:
-
-
Waiting for Server's response...
-
- Copy
-
+
+
+
+
+
+ Close this popup
+
+
Deposit Crypto
+
+
+ Proceed
+
+
+
+
+
-
-
Copy crypto address above.
-
Send amount of crypto you wish to deposit from your preferred crypto app.
-
Click on 'CONFIRM DEPOSIT' button below to confirm your deposit to the exchange, or just press CONFIRM DEPOSIT in the Crypto section.
-
It may take upto 10 mins to reflect deposited amount.
-
-
- Confirm deposit
-
-
OR
-
Click on 'SEND FROM HERE' to send crypto from this exchange.
+
+
Select Crypto
+
+
+
+
+
+
+
+
+
Send crypto to this address:
+
+
Waiting for Server's response...
+
+ Copy
+
+
+
+
+
+ How this works?
+
+
+
Copy crypto address above.
+
Send amount of crypto you wish to deposit from your preferred crypto app.
+
If you are sending from external wallet then after sending you must click on
+ 'CONFIRM
+ DEPOSIT'
+ button below to confirm your deposit to the exchange, or just press CONFIRM DEPOSIT
+ in
+ the Crypto
+ section.
+
Alternatively, you can also send crypto from here using SEND FROM HERE option above.
+
+
Ensure you have sufficient balance.
+
It may take upto 10 mins to reflect deposited amount.
+
+
+
+ Confirm deposit
+
+
OR
+
Click on 'SEND FROM HERE' to send crypto from this exchange.