fixed ui issues
This commit is contained in:
parent
1c1e3dcd7e
commit
1e6dcd1904
193
index.html
193
index.html
@ -1349,7 +1349,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
<div>
|
<div>
|
||||||
<h5 class="light-text">FLO ID</h5>
|
<h5 class="light-text">FLO ID</h5>
|
||||||
<h4 class="breakable">FFS5hFXG7DBtdgzrLwixZLpenAmsCKRddm</h4>
|
<h4 class="breakable" id="localbitcoinuserdiv"></h4>
|
||||||
<button onclick="signOut()" class="top-margin">Sign Out</button>
|
<button onclick="signOut()" class="top-margin">Sign Out</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -1383,7 +1383,7 @@
|
|||||||
<h4 class="expand">Bitcoin</h4>
|
<h4 class="expand">Bitcoin</h4>
|
||||||
<h5>BTC</h5>
|
<h5>BTC</h5>
|
||||||
</span>
|
</span>
|
||||||
<h3 id="btc_market_price">₹480,600</h3>
|
<h3 id="btc_market_price"></h3>
|
||||||
</span>
|
</span>
|
||||||
<span class="crypto-price grid">
|
<span class="crypto-price grid">
|
||||||
<svg class="icon flo" viewBox="0 0 45.6 47.07">
|
<svg class="icon flo" viewBox="0 0 45.6 47.07">
|
||||||
@ -1402,7 +1402,7 @@
|
|||||||
<h4 class="expand">FLO</h4>
|
<h4 class="expand">FLO</h4>
|
||||||
<h5>FLO</h5>
|
<h5>FLO</h5>
|
||||||
</span>
|
</span>
|
||||||
<h3 id="flo_market_price">₹1.30</h3>
|
<h3 id="flo_market_price"></h3>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div id="balance_panel" class="top-padding card">
|
<div id="balance_panel" class="top-padding card">
|
||||||
@ -1411,9 +1411,7 @@
|
|||||||
</h3>
|
</h3>
|
||||||
<div class="balance-display">
|
<div class="balance-display">
|
||||||
<h5 class="light-text">Cash</h5>
|
<h5 class="light-text">Cash</h5>
|
||||||
<h2 id="user_cash_bal">
|
<h2 id="user_cash_bal"> </h2>
|
||||||
₹50000
|
|
||||||
</h2>
|
|
||||||
<div id="refresh_cash_bal" class="action refresh">
|
<div id="refresh_cash_bal" class="action refresh">
|
||||||
<button type="submit">
|
<button type="submit">
|
||||||
refresh
|
refresh
|
||||||
@ -1426,9 +1424,7 @@
|
|||||||
<div class="grid grid-2 top-margin">
|
<div class="grid grid-2 top-margin">
|
||||||
<div class="balance-display">
|
<div class="balance-display">
|
||||||
<h5 class="light-text">Bitcoin</h5>
|
<h5 class="light-text">Bitcoin</h5>
|
||||||
<h2 id="user_btc_bal">
|
<h2 id="user_btc_bal"> </h2>
|
||||||
600
|
|
||||||
</h2>
|
|
||||||
<div id="refresh_btc_bal" class="action refresh">
|
<div id="refresh_btc_bal" class="action refresh">
|
||||||
<button type="submit">
|
<button type="submit">
|
||||||
refresh
|
refresh
|
||||||
@ -1440,9 +1436,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="balance-display">
|
<div class="balance-display">
|
||||||
<h5 class="light-text">FLO</h5>
|
<h5 class="light-text">FLO</h5>
|
||||||
<h2 id="user_flo_bal">
|
<h2 id="user_flo_bal"> </h2>
|
||||||
1200
|
|
||||||
</h2>
|
|
||||||
<div id="refresh_flo_bal" class="action refresh">
|
<div id="refresh_flo_bal" class="action refresh">
|
||||||
<button type="submit">
|
<button type="submit">
|
||||||
refresh
|
refresh
|
||||||
@ -1562,7 +1556,7 @@
|
|||||||
<polyline points="29.83,1.41 2.83,28.41 29.83,55.41 "/>
|
<polyline points="29.83,1.41 2.83,28.41 29.83,55.41 "/>
|
||||||
</svg>
|
</svg>
|
||||||
<h3>Deposit Crypto</h3>
|
<h3>Deposit Crypto</h3>
|
||||||
<div class="action" id="depositAssetButton">
|
<div class="action" id="depositCryptoButton">
|
||||||
<button class="btn" type="submit" disabled>
|
<button class="btn" type="submit" disabled>
|
||||||
Deposit
|
Deposit
|
||||||
</button>
|
</button>
|
||||||
@ -1593,7 +1587,7 @@
|
|||||||
<polyline points="29.83,1.41 2.83,28.41 29.83,55.41 "/>
|
<polyline points="29.83,1.41 2.83,28.41 29.83,55.41 "/>
|
||||||
</svg>
|
</svg>
|
||||||
<h3>Withdraw Crypto</h3>
|
<h3>Withdraw Crypto</h3>
|
||||||
<div class="action" id="withdrawAssetButton">
|
<div class="action" id="withdrawCryptoButton">
|
||||||
<button class="btn" type="submit" disabled>
|
<button class="btn" type="submit" disabled>
|
||||||
withdraw
|
withdraw
|
||||||
</button>
|
</button>
|
||||||
@ -1623,7 +1617,7 @@
|
|||||||
<polyline points="29.83,1.41 2.83,28.41 29.83,55.41 "/>
|
<polyline points="29.83,1.41 2.83,28.41 29.83,55.41 "/>
|
||||||
</svg>
|
</svg>
|
||||||
<h3>Deposit Cash</h3>
|
<h3>Deposit Cash</h3>
|
||||||
<div class="action" id="depositAssetButton">
|
<div class="action" id="depositCashButton">
|
||||||
<button class="btn" type="submit" disabled>
|
<button class="btn" type="submit" disabled>
|
||||||
Deposit
|
Deposit
|
||||||
</button>
|
</button>
|
||||||
@ -1651,7 +1645,7 @@
|
|||||||
<polyline points="29.83,1.41 2.83,28.41 29.83,55.41 "/>
|
<polyline points="29.83,1.41 2.83,28.41 29.83,55.41 "/>
|
||||||
</svg>
|
</svg>
|
||||||
<h3>Withdraw Cash</h3>
|
<h3>Withdraw Cash</h3>
|
||||||
<div class="action" id="withdrawAssetButton">
|
<div class="action" id="withdrawCashButton">
|
||||||
<button class="btn" type="submit" disabled>
|
<button class="btn" type="submit" disabled>
|
||||||
withdraw
|
withdraw
|
||||||
</button>
|
</button>
|
||||||
@ -1696,12 +1690,12 @@
|
|||||||
|
|
||||||
//Checks for internet connection status
|
//Checks for internet connection status
|
||||||
if(!navigator.onLine)
|
if(!navigator.onLine)
|
||||||
notify('error', 'There seems to be a problem connecting to the internet.', 'fixed')
|
notify('There seems to be a problem connecting to the internet.','error', 'fixed')
|
||||||
window.addEventListener('offline', () =>{
|
window.addEventListener('offline', () =>{
|
||||||
notify('error', 'There seems to be a problem connecting to the internet.', 'fixed')
|
notify('There seems to be a problem connecting to the internet.','error', 'fixed')
|
||||||
})
|
})
|
||||||
window.addEventListener('online', () =>{
|
window.addEventListener('online', () =>{
|
||||||
notify('', 'We are back online.')
|
notify('We are back online.')
|
||||||
})
|
})
|
||||||
// function required for popups or modals to appear
|
// function required for popups or modals to appear
|
||||||
function showPopup(popup, permission){
|
function showPopup(popup, permission){
|
||||||
@ -1758,7 +1752,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Function for displaying toast notifications. pass in error for mode param if you want to show an error.
|
//Function for displaying toast notifications. pass in error for mode param if you want to show an error.
|
||||||
function notify(mode, message, behavior){
|
function notify(message, mode, behavior){
|
||||||
let banner = document.getElementById('show_message'),
|
let banner = document.getElementById('show_message'),
|
||||||
back;
|
back;
|
||||||
if(mode === 'error'){
|
if(mode === 'error'){
|
||||||
@ -1849,7 +1843,7 @@
|
|||||||
if(radio.checked)
|
if(radio.checked)
|
||||||
counter++;
|
counter++;
|
||||||
})
|
})
|
||||||
if(counter == allRadios.length/2)
|
if(counter === 1)
|
||||||
radioStatus = true;
|
radioStatus = true;
|
||||||
if(inputStatus && radioStatus)
|
if(inputStatus && radioStatus)
|
||||||
return true
|
return true
|
||||||
@ -2012,7 +2006,7 @@
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
btnLoading(btn, 'stop')
|
btnLoading(btn, 'stop')
|
||||||
hidePopup(parentPopup)
|
hidePopup(parentPopup)
|
||||||
notify('', 'Crypto sent')
|
notify('Crypto sent')
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2024,7 +2018,7 @@
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
btnLoading(btn, 'stop')
|
btnLoading(btn, 'stop')
|
||||||
hidePopup(parentPopup)
|
hidePopup(parentPopup)
|
||||||
notify('', 'Signed In')
|
notify('Signed In')
|
||||||
document.querySelector('main').classList.remove('hide-completely')
|
document.querySelector('main').classList.remove('hide-completely')
|
||||||
}, 1000)
|
}, 1000)
|
||||||
//}
|
//}
|
||||||
@ -2040,7 +2034,7 @@
|
|||||||
btnLoading(btn, 'stop')
|
btnLoading(btn, 'stop')
|
||||||
newBalance = 600000;
|
newBalance = 600000;
|
||||||
document.getElementById('user_cash_bal').textContent = '₹'+newBalance;
|
document.getElementById('user_cash_bal').textContent = '₹'+newBalance;
|
||||||
notify('', 'Cash balance updated')
|
notify('Cash balance updated')
|
||||||
},1000)
|
},1000)
|
||||||
break;
|
break;
|
||||||
case 'cryptoBtc':
|
case 'cryptoBtc':
|
||||||
@ -2050,7 +2044,7 @@
|
|||||||
btnLoading(btn, 'stop')
|
btnLoading(btn, 'stop')
|
||||||
newBalance = 700;
|
newBalance = 700;
|
||||||
document.getElementById('user_btc_bal').textContent = newBalance;
|
document.getElementById('user_btc_bal').textContent = newBalance;
|
||||||
notify('', 'Bitcoin balance updated')
|
notify('Bitcoin balance updated')
|
||||||
},1000)
|
},1000)
|
||||||
break;
|
break;
|
||||||
case 'cryptoFlo':
|
case 'cryptoFlo':
|
||||||
@ -2060,7 +2054,7 @@
|
|||||||
btnLoading(btn, 'stop')
|
btnLoading(btn, 'stop')
|
||||||
newBalance = 1500;
|
newBalance = 1500;
|
||||||
document.getElementById('user_flo_bal').textContent = newBalance;
|
document.getElementById('user_flo_bal').textContent = newBalance;
|
||||||
notify('', 'FLO balance updated')
|
notify('FLO balance updated')
|
||||||
},1000)
|
},1000)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2069,7 +2063,7 @@
|
|||||||
function signOut(){
|
function signOut(){
|
||||||
askConfirmation('Do you want to sign out?').then((result) => {
|
askConfirmation('Do you want to sign out?').then((result) => {
|
||||||
if(result){
|
if(result){
|
||||||
notify('', 'Signed out')
|
notify('Signed out')
|
||||||
document.querySelector('main').classList.add('hide-completely')
|
document.querySelector('main').classList.add('hide-completely')
|
||||||
showPopup('sign_in_popup')
|
showPopup('sign_in_popup')
|
||||||
}
|
}
|
||||||
@ -13609,14 +13603,19 @@
|
|||||||
#!#validTradingAmount=10,50,100,#!#btcTradeMargin=5000
|
#!#validTradingAmount=10,50,100,#!#btcTradeMargin=5000
|
||||||
#!#MaxBackups=1
|
#!#MaxBackups=1
|
||||||
#!#miners_fee={"btc":0.0003, "flo":0.0003}
|
#!#miners_fee={"btc":0.0003, "flo":0.0003}
|
||||||
#!#supernodesPubKeys=026FCC6CFF6EB3A39E54BEB6E13FC2F02C3A93F4767AA80E49E7E876443F95AE5F,
|
#!#supernodesPubKeys=0315C3A20FE7096CC2E0F81A80D5F1A687B8F9EFA65242A0B0881E1BA3EE7D7D53,
|
||||||
0315C3A20FE7096CC2E0F81A80D5F1A687B8F9EFA65242A0B0881E1BA3EE7D7D53,
|
03F7493F11B8E44B9798CD434D20FBE7FA34B9779D144984889D11A17C56A18742,039B4AA00DBFC0A6631DE6DA83526611A0E6B857D3579DF840BBDEAE8B6898E3B6,
|
||||||
|
03C8E3836C9A77E2AF03D4265D034BA85732738919708EAF6A16382195AE796EDF,0349B08AA1ABDCFFB6D78CD7C949665AD2FF065EA02B3C6C47A5E9592C9A1C6BCB,
|
||||||
|
026FCC6CFF6EB3A39E54BEB6E13FC2F02C3A93F4767AA80E49E7E876443F95AE5F,
|
||||||
|
#!#externalFiles={"d3js":"58f54395efa8346e8e94d12609770f66b916897e7f4e05f6c98780cffa5c70a3"}
|
||||||
#!#cashiers={"032871A74D2DDA9D0DE7135F58B5BD2D7F679D2CCA20EA7909466D1A6912DF4022":"johnDoe@upi",
|
#!#cashiers={"032871A74D2DDA9D0DE7135F58B5BD2D7F679D2CCA20EA7909466D1A6912DF4022":"johnDoe@upi",
|
||||||
"03DB4A12EB543B293DDBB0CE314C46C36D6761294AFBB7264A6D78F710FFD97CF0":"janeDoe@upi"}
|
"03DB4A12EB543B293DDBB0CE314C46C36D6761294AFBB7264A6D78F710FFD97CF0":"janeDoe@upi"}
|
||||||
#!#ShamirsMaxShares=8#!#supernodeSeeds={
|
#!#ShamirsMaxShares=8#!#supernodeSeeds={"ranchimall1":{"ip":"127.0.0.1:9111","kbucketId":"oZxHcbSf1JC8t5GjutopWYXs7C6Fe9p7ps"},
|
||||||
"ranchimall1":{"ip":"127.0.0.1:9111","kbucketId":"oZxHcbSf1JC8t5GjutopWYXs7C6Fe9p7ps"},
|
"ranchimall2":{"ip":"127.0.0.1:9112","kbucketId":"oTWjPupy3Z7uMdPcu5uXd521HBkcsLuSuM"},
|
||||||
"ranchimall6":{"ip":"127.0.0.1:9116","kbucketId":"oV1wCeWca3VawbBTfUGKA7Vd368PATnKAx"}
|
"ranchimall3":{"ip":"127.0.0.1:9113","kbucketId":"odYA6KagmbokSh9GY7yAfeTUZRtZLwecY1"},
|
||||||
}`;
|
"ranchimall4":{"ip":"127.0.0.1:9114","kbucketId":"oJosrve9dBv2Hj2bfncxv2oEpTysg3Wejv"},
|
||||||
|
"ranchimall5":{"ip":"127.0.0.1:9115","kbucketId":"oMhv5sAzqg77sYHxmUGZWKRrVo4P4JQduS"},
|
||||||
|
"ranchimall6":{"ip":"127.0.0.1:9116","kbucketId":"oV1wCeWca3VawbBTfUGKA7Vd368PATnKAx"}}`;
|
||||||
return callback(text);
|
return callback(text);
|
||||||
|
|
||||||
let master_data = '';
|
let master_data = '';
|
||||||
@ -23718,16 +23717,9 @@
|
|||||||
typeof user == "object" &&
|
typeof user == "object" &&
|
||||||
user.myLocalFLOAddress == resp.data.trader_flo_address
|
user.myLocalFLOAddress == resp.data.trader_flo_address
|
||||||
) {
|
) {
|
||||||
let counterTraderAccountAddress = `Please pay the amount to following address:
|
let counterTraderAccountAddress = resp.msg;
|
||||||
${resp.msg}`;
|
|
||||||
showMessage(counterTraderAccountAddress);
|
showMessage(counterTraderAccountAddress);
|
||||||
const withdrawCashButton = document.getElementById('withdrawAssetButton')
|
notify(counterTraderAccountAddress);
|
||||||
let messageShow = withdrawCashButton.querySelector('#upiToAddress')
|
|
||||||
messageShow.textContent = counterTraderAccountAddress;
|
|
||||||
messageShow.classList.remove('hide-completely')
|
|
||||||
withdrawCashButton.querySelectorAll('.input').forEach((input) => {
|
|
||||||
input.classList.add('hide-completely')
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -23762,14 +23754,8 @@
|
|||||||
) {
|
) {
|
||||||
let counterTraderAccountAddress = `Please pay ${resp.data.currency} ${resp.data.depositing_amount} to following UPI ID:
|
let counterTraderAccountAddress = `Please pay ${resp.data.currency} ${resp.data.depositing_amount} to following UPI ID:
|
||||||
${resp.msg}`;
|
${resp.msg}`;
|
||||||
//showMessage(counterTraderAccountAddress);
|
showMessage(counterTraderAccountAddress);
|
||||||
const depositAssetButton = document.getElementById('depositAssetButton')
|
notify(counterTraderAccountAddress);
|
||||||
let messageShow = depositAssetButton.querySelector('#upiToAddress')
|
|
||||||
messageShow.textContent = counterTraderAccountAddress;
|
|
||||||
messageShow.classList.remove('hide-completely')
|
|
||||||
depositAssetButton.querySelectorAll('.input').forEach((input) => {
|
|
||||||
input.classList.add('hide-completely')
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -24861,9 +24847,9 @@
|
|||||||
console.log(server_live_trading_prices);
|
console.log(server_live_trading_prices);
|
||||||
for(commodity of Object.values(server_live_trading_prices.live_trading_prices)) {
|
for(commodity of Object.values(server_live_trading_prices.live_trading_prices)) {
|
||||||
if(commodity.crypto_code==="BTC") {
|
if(commodity.crypto_code==="BTC") {
|
||||||
document.getElementById('btc_market_price').innerText = `${commodity.currency_code} ${commodity.rate}  `;
|
document.getElementById('btc_market_price').innerText = `${commodity.currency_code} ${commodity.rate}`;
|
||||||
} else if(commodity.crypto_code==="FLO") {
|
} else if(commodity.crypto_code==="FLO") {
|
||||||
document.getElementById('flo_market_price').innerText = `${commodity.currency_code} ${commodity.rate}  `;
|
document.getElementById('flo_market_price').innerText = `${commodity.currency_code} ${commodity.rate}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -25320,16 +25306,9 @@
|
|||||||
typeof user == "object" &&
|
typeof user == "object" &&
|
||||||
user.myLocalFLOAddress == resp.data.trader_flo_address
|
user.myLocalFLOAddress == resp.data.trader_flo_address
|
||||||
) {
|
) {
|
||||||
let counterTraderAccountAddress = `<p><strong>Please pay the amount to following address:</strong></p>
|
let counterTraderAccountAddress = resp.msg;
|
||||||
<p>${resp.msg}</p>`;
|
|
||||||
showMessage(counterTraderAccountAddress);
|
showMessage(counterTraderAccountAddress);
|
||||||
const withdrawCashButton = document.getElementById('withdrawAssetButton')
|
notify(counterTraderAccountAddress);
|
||||||
let messageShow = withdrawCashButton.querySelector('#upiToAddress')
|
|
||||||
messageShow.textContent = counterTraderAccountAddress;
|
|
||||||
messageShow.classList.remove('hide-completely')
|
|
||||||
withdrawCashButton.querySelectorAll('.input').forEach((input) => {
|
|
||||||
input.classList.add('hide-completely')
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -25366,13 +25345,8 @@
|
|||||||
) {
|
) {
|
||||||
let counterTraderAccountAddress = `Please pay ${resp.data.currency} ${resp.data.depositing_amount} to following UPI ID:
|
let counterTraderAccountAddress = `Please pay ${resp.data.currency} ${resp.data.depositing_amount} to following UPI ID:
|
||||||
${resp.msg}`;
|
${resp.msg}`;
|
||||||
const depositAssetButton = document.getElementById('depositAssetButton');
|
showMessage(counterTraderAccountAddress);
|
||||||
let messageShow = depositAssetButton.querySelector('#upiToAddress');
|
notify(counterTraderAccountAddress);
|
||||||
messageShow.textContent = counterTraderAccountAddress;
|
|
||||||
messageShow.classList.remove('hide-completely')
|
|
||||||
depositAssetButton.querySelectorAll('.input').forEach((input) => {
|
|
||||||
input.classList.add('hide-completely')
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -25509,10 +25483,10 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
Promise.all([pr1,pr2,pr3,pr4]).then(()=>{
|
Promise.all([pr1,pr2,pr3,pr4]).then(()=>{
|
||||||
// Update balances
|
// Update balances
|
||||||
displayBalances(
|
displayBalances(
|
||||||
localbitcoinplusplus.wallets.my_local_flo_address
|
localbitcoinplusplus.wallets.my_local_flo_address
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.catch(e => {throw new Error(e)});
|
.catch(e => {throw new Error(e)});
|
||||||
|
|
||||||
@ -30282,9 +30256,7 @@
|
|||||||
: `No FLO Id found`;
|
: `No FLO Id found`;
|
||||||
|
|
||||||
showMessage(`Your FLO Id: ${my_flo_id}`);
|
showMessage(`Your FLO Id: ${my_flo_id}`);
|
||||||
const localbitcoinuserdiv = document.getElementById(
|
const localbitcoinuserdiv = document.getElementById("localbitcoinuserdiv");
|
||||||
"localbitcoinuserdiv"
|
|
||||||
);
|
|
||||||
localbitcoinuserdiv.innerHTML = `${my_flo_id}`;
|
localbitcoinuserdiv.innerHTML = `${my_flo_id}`;
|
||||||
|
|
||||||
// showMessage ->updating your balances
|
// showMessage ->updating your balances
|
||||||
@ -30594,7 +30566,7 @@
|
|||||||
|
|
||||||
let tradeId = e.target.closest('.cancel-order').id;
|
let tradeId = e.target.closest('.cancel-order').id;
|
||||||
e.target.closest('.order').remove();
|
e.target.closest('.order').remove();
|
||||||
notify('', `Order id: ${tradeId} cancelled.`)
|
notify(`Order id: ${tradeId} cancelled.`)
|
||||||
if(container.children.length === 0)
|
if(container.children.length === 0)
|
||||||
container.innerHTML = '<h4>No trade orders yet.</h4>'
|
container.innerHTML = '<h4>No trade orders yet.</h4>'
|
||||||
}
|
}
|
||||||
@ -30612,7 +30584,6 @@
|
|||||||
const displayBalances = flo_id => {
|
const displayBalances = flo_id => {
|
||||||
if (typeof flo_id !== "string") return;
|
if (typeof flo_id !== "string") return;
|
||||||
showMessage(`Loading your balances.`);
|
showMessage(`Loading your balances.`);
|
||||||
const balances_div = document.getElementById("balances_div");
|
|
||||||
const user_crypto_balances = readDBbyIndex(
|
const user_crypto_balances = readDBbyIndex(
|
||||||
"crypto_balances",
|
"crypto_balances",
|
||||||
"trader_flo_address",
|
"trader_flo_address",
|
||||||
@ -30632,13 +30603,40 @@
|
|||||||
asset from DEPOSIT dection below.`);
|
asset from DEPOSIT dection below.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
all_balances.map(user_balance_data => {
|
for (const user_balance_data of all_balances) {
|
||||||
let code =
|
let code = user_balance_data.crypto_currency || user_balance_data.currency;
|
||||||
user_balance_data.crypto_currency || user_balance_data.currency;
|
let value = user_balance_data.crypto_balance || user_balance_data.cash_balance;
|
||||||
let value = user_balance_data.crypto_balance || user_balance_data.cash_balance;
|
|
||||||
t += `<span>${code}:${helper_functions.truncateDecimals(value)}</span> `;
|
switch (code) {
|
||||||
});
|
case "BTC":
|
||||||
balances_div.innerHTML = t;
|
document.getElementById('user_btc_bal').innerText = helper_functions.truncateDecimals(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "BTC_TEST":
|
||||||
|
document.getElementById('user_btc_bal').innerText = helper_functions.truncateDecimals(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "FLO":
|
||||||
|
document.getElementById('user_flo_bal').innerText = helper_functions.truncateDecimals(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "FLO_TEST":
|
||||||
|
document.getElementById('user_flo_bal').innerText = helper_functions.truncateDecimals(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "INR":
|
||||||
|
document.getElementById('user_cash_bal').innerText = 'INR '+helper_functions.truncateDecimals(value,2);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "USD":
|
||||||
|
document.getElementById('user_cash_bal').innerText = 'USD ' +helper_functions.truncateDecimals(value,2);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
showMessage(t);
|
showMessage(t);
|
||||||
@ -30727,21 +30725,20 @@
|
|||||||
<script>
|
<script>
|
||||||
const depositWithdrawAsset = function(userFLOaddress="") {
|
const depositWithdrawAsset = function(userFLOaddress="") {
|
||||||
|
|
||||||
let parentPopup = this.closest('.popup')
|
|
||||||
|
|
||||||
const RM_TRADE = new localbitcoinplusplus.trade();
|
const RM_TRADE = new localbitcoinplusplus.trade();
|
||||||
const RM_RPC = new localbitcoinplusplus.rpc();
|
const RM_RPC = new localbitcoinplusplus.rpc();
|
||||||
|
|
||||||
let deposit_crypto_div = document.getElementById("deposit_crypto_div");
|
let deposit_crypto_div = document.getElementById("deposit_crypto_div");
|
||||||
let withdraw_crypto_div = document.getElementById("withdraw_crypto_div");
|
let withdraw_crypto_div = document.getElementById("withdraw_crypto_div");
|
||||||
let depositAssetButton = document.getElementById("depositAssetButton");
|
let depositCryptoButton = document.getElementById("depositCryptoButton");
|
||||||
let withdrawAssetButton = document.getElementById("withdrawAssetButton");
|
let withdrawCryptoButton = document.getElementById("withdrawCryptoButton");
|
||||||
let err_msg = "";
|
let err_msg = "";
|
||||||
|
|
||||||
get_crypto_svg_selection_html('deposit_assets_type', deposit_crypto_div);
|
get_crypto_svg_selection_html('deposit_assets_type', deposit_crypto_div);
|
||||||
get_crypto_svg_selection_html('withdraw_assets_type', withdraw_crypto_div);
|
get_crypto_svg_selection_html('withdraw_assets_type', withdraw_crypto_div);
|
||||||
|
|
||||||
depositAssetButton.addEventListener("click", function() {
|
depositCryptoButton.addEventListener("click", function() {
|
||||||
|
let parentPopup = this.closest('.popup')
|
||||||
let asset_type = document.querySelector("input[name='crypto']:checked").value;
|
let asset_type = document.querySelector("input[name='crypto']:checked").value;
|
||||||
tradeAmountSelect = document.getElementById('trade_amount_select');
|
tradeAmountSelect = document.getElementById('trade_amount_select');
|
||||||
let tradeAmount = helper_functions.truncateDecimals(tradeAmountSelect.value);
|
let tradeAmount = helper_functions.truncateDecimals(tradeAmountSelect.value);
|
||||||
@ -30776,7 +30773,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
withdrawAssetButton.addEventListener("click", function(params) {
|
withdrawCryptoButton.addEventListener("click", function(params) {
|
||||||
let parentPopup = this.closest('.popup');
|
let parentPopup = this.closest('.popup');
|
||||||
let asset_type = document.querySelector("input[name='crypto']:checked").value;
|
let asset_type = document.querySelector("input[name='crypto']:checked").value;
|
||||||
let receivinAddress = document.getElementById('withdraw_recving_addr')
|
let receivinAddress = document.getElementById('withdraw_recving_addr')
|
||||||
@ -30842,10 +30839,11 @@
|
|||||||
const RM_TRADE = new localbitcoinplusplus.trade();
|
const RM_TRADE = new localbitcoinplusplus.trade();
|
||||||
const RM_RPC = new localbitcoinplusplus.rpc();
|
const RM_RPC = new localbitcoinplusplus.rpc();
|
||||||
|
|
||||||
const depositAssetButton = document.getElementById('depositAssetButton')
|
const depositCashButton = document.getElementById('depositCashButton')
|
||||||
|
const withdrawCashButton = document.getElementById('withdrawCashButton')
|
||||||
let user_deposited_cash = 0; // false
|
let user_deposited_cash = 0; // false
|
||||||
|
|
||||||
depositAssetButton.addEventListener("click", function() {
|
depositCashButton.addEventListener("click", function() {
|
||||||
user_deposited_cash === 0 ? user_deposited_cash = 1: user_deposited_cash = 0;
|
user_deposited_cash === 0 ? user_deposited_cash = 1: user_deposited_cash = 0;
|
||||||
if(user_deposited_cash == 1){
|
if(user_deposited_cash == 1){
|
||||||
this.firstElementChild.textContent = 'done';
|
this.firstElementChild.textContent = 'done';
|
||||||
@ -30897,7 +30895,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Withdraw Cash function
|
// Withdraw Cash function
|
||||||
withdrawAssetButton.addEventListener("click", function(params) {
|
withdrawCashButton.addEventListener("click", function(params) {
|
||||||
let parentPopup = this.closest('.popup')
|
let parentPopup = this.closest('.popup')
|
||||||
let receivinAddress = parentPopup.querySelector("input[name='upiAddr']").value;
|
let receivinAddress = parentPopup.querySelector("input[name='upiAddr']").value;
|
||||||
if (receivinAddress == null || receivinAddress.trim == "") {
|
if (receivinAddress == null || receivinAddress.trim == "") {
|
||||||
@ -30966,8 +30964,8 @@
|
|||||||
localbitcoinplusplus.master_configurations.tradableAsset1
|
localbitcoinplusplus.master_configurations.tradableAsset1
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
let selectCryptoHtml = ``;
|
|
||||||
for (var i = 0; i < sendCryptoArray.length; i++) {
|
for (var i = 0; i < sendCryptoArray.length; i++) {
|
||||||
|
let selectCryptoHtml = ``;
|
||||||
selectCryptoHtml += `<label class="select-crypto">`;
|
selectCryptoHtml += `<label class="select-crypto">`;
|
||||||
selectCryptoHtml += `<input name="crypto" value="${sendCryptoArray[i]}"
|
selectCryptoHtml += `<input name="crypto" value="${sendCryptoArray[i]}"
|
||||||
type="radio" id="${radio_id}_${sendCryptoArray[i]}">`;
|
type="radio" id="${radio_id}_${sendCryptoArray[i]}">`;
|
||||||
@ -31009,8 +31007,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_fiat_svg_selection_html(radio_id='', parenthtml='') {
|
function get_fiat_svg_selection_html(radio_id='', parenthtml='') {
|
||||||
let selectFiatHtml = ``;
|
|
||||||
for (const currency of localbitcoinplusplus.master_configurations.tradableAsset2) {
|
for (const currency of localbitcoinplusplus.master_configurations.tradableAsset2) {
|
||||||
|
let selectFiatHtml = ``;
|
||||||
selectFiatHtml += `<label class="select-crypto">`;
|
selectFiatHtml += `<label class="select-crypto">`;
|
||||||
selectFiatHtml += `<input name="currency" value="${currency}" type="radio">`;
|
selectFiatHtml += `<input name="currency" value="${currency}" type="radio">`;
|
||||||
if(currency=="INR") {
|
if(currency=="INR") {
|
||||||
@ -31036,11 +31034,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_trading_amount_html(radio_id='', parenthtml='') {
|
function get_trading_amount_html(radio_id='', parenthtml='') {
|
||||||
let selectTradingAmountHtml = ``;
|
|
||||||
for (const amount of localbitcoinplusplus.master_configurations.validTradingAmount) {
|
for (const amount of localbitcoinplusplus.master_configurations.validTradingAmount) {
|
||||||
|
let selectTradingAmountHtml = ``;
|
||||||
selectTradingAmountHtml += `<label class="select-crypto">`;
|
selectTradingAmountHtml += `<label class="select-crypto">`;
|
||||||
selectTradingAmountHtml += `<input name="trading_amount" value="${amount}" type="radio">`;
|
selectTradingAmountHtml += `<input name="trading_amount" value="${amount}" type="radio">`;
|
||||||
selectTradingAmountHtml += `<h4>${amount}</h4>`;
|
selectTradingAmountHtml += `<h2>${amount}</h2>`;
|
||||||
selectTradingAmountHtml += `<svg class="selected" viewBox="0 0 73 73">
|
selectTradingAmountHtml += `<svg class="selected" viewBox="0 0 73 73">
|
||||||
<circle cx="36.5" cy="36.5" r="36"/>
|
<circle cx="36.5" cy="36.5" r="36"/>
|
||||||
<polyline points="18.23,37.39 29.73,48.9 54.77,25.21 "/>
|
<polyline points="18.23,37.39 29.73,48.9 54.77,25.21 "/>
|
||||||
@ -31050,7 +31048,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Broadcast Tx UI -->
|
<!-- Broadcast Tx UI -->
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user