0.0.72
This commit is contained in:
parent
48d4c4ac45
commit
b6bb5cd856
70
index.html
70
index.html
@ -11,7 +11,7 @@
|
|||||||
<link rel="stylesheet" href="css/main.css">
|
<link rel="stylesheet" href="css/main.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body onload="onLoadStartUp()">
|
<body onload="onLoadStartUp()" class="hide-completely">
|
||||||
<audio id="notification_sound">
|
<audio id="notification_sound">
|
||||||
<source src="https://rmservices.duckdns.org/files/notification-sound.mp3" type="audio/mpeg">
|
<source src="https://rmservices.duckdns.org/files/notification-sound.mp3" type="audio/mpeg">
|
||||||
<source src="https://rmservices.duckdns.org/files/notification-sound.ogg" type="audio/ogg">
|
<source src="https://rmservices.duckdns.org/files/notification-sound.ogg" type="audio/ogg">
|
||||||
@ -518,7 +518,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
<h5>requests</h5>
|
<h5>requests</h5>
|
||||||
</div>
|
</div>
|
||||||
<div title="activity page" id="activity_page_btn" class="navbar-item user-option"
|
<div title="activity page" id="activity_page_btn" class="navbar-item"
|
||||||
onclick="showPage('activity_page', this)">
|
onclick="showPage('activity_page', this)">
|
||||||
<svg class="icon" viewBox="0 0 64 64">
|
<svg class="icon" viewBox="0 0 64 64">
|
||||||
<path
|
<path
|
||||||
@ -909,10 +909,10 @@
|
|||||||
<sm-tab-header variant="tab" class="round" target="user_activities">
|
<sm-tab-header variant="tab" class="round" target="user_activities">
|
||||||
<sm-tab>Sent</sm-tab>
|
<sm-tab>Sent</sm-tab>
|
||||||
<sm-tab>Received</sm-tab>
|
<sm-tab>Received</sm-tab>
|
||||||
<sm-tab>Deposits</sm-tab>
|
<sm-tab class="user-option">Deposits</sm-tab>
|
||||||
<sm-tab>Withdrawals</sm-tab>
|
<sm-tab class="user-option">Withdrawals</sm-tab>
|
||||||
<sm-tab>Paid through cashier</sm-tab>
|
<sm-tab class="user-option">Paid through cashier</sm-tab>
|
||||||
<sm-tab>System Notifications</sm-tab>
|
<sm-tab class="user-option">System Notifications</sm-tab>
|
||||||
</sm-tab-header>
|
</sm-tab-header>
|
||||||
<sm-tab-panels id="user_activities">
|
<sm-tab-panels id="user_activities">
|
||||||
<sm-panel>
|
<sm-panel>
|
||||||
@ -992,9 +992,6 @@
|
|||||||
<sm-button variant="no-outline" onclick="showPopup('add_upi_popup')">+ Add UPI address
|
<sm-button variant="no-outline" onclick="showPopup('add_upi_popup')">+ Add UPI address
|
||||||
</sm-button>
|
</sm-button>
|
||||||
</div>
|
</div>
|
||||||
<h4>Sign Out</h4>
|
|
||||||
<p>Signing out will erase all the data stored in local storage and Indexed DB. This will remove
|
|
||||||
saved private key, UPI addresses and contacts.</p>
|
|
||||||
<sm-button variant="primary" onclick="signOut()">Sign out</sm-button>
|
<sm-button variant="primary" onclick="signOut()">Sign out</sm-button>
|
||||||
</section>
|
</section>
|
||||||
<section id="transaction_page" class="page">
|
<section id="transaction_page" class="page">
|
||||||
@ -1279,7 +1276,7 @@
|
|||||||
<h4 class="activity-type">${transaction} ${status}</h4>`
|
<h4 class="activity-type">${transaction} ${status}</h4>`
|
||||||
if (receiver)
|
if (receiver)
|
||||||
composition += `
|
composition += `
|
||||||
<h4 class="activity-receiver breakable">${allContacts[receiver] ? allContacts[receiver].name : receiver}</h4>
|
<h4 class="activity-receiver breakable">${allContacts ? allContacts[receiver] ? allContacts[receiver].name : receiver: receiver}</h4>
|
||||||
`
|
`
|
||||||
composition += `
|
composition += `
|
||||||
<h4 class="activity-amount ${className}">${sign} ₹${amount}</h4>
|
<h4 class="activity-amount ${className}">${sign} ₹${amount}</h4>
|
||||||
@ -1829,6 +1826,7 @@
|
|||||||
|
|
||||||
const loaderPage = document.getElementById('main_loader')
|
const loaderPage = document.getElementById('main_loader')
|
||||||
function showLoader() {
|
function showLoader() {
|
||||||
|
document.body.classList.remove('hide-completely')
|
||||||
loaderPage.classList.remove('hide-completely')
|
loaderPage.classList.remove('hide-completely')
|
||||||
loader.classList.add('animate-loader')
|
loader.classList.add('animate-loader')
|
||||||
document.querySelector('main').classList.add('hide-completely')
|
document.querySelector('main').classList.add('hide-completely')
|
||||||
@ -2295,8 +2293,8 @@
|
|||||||
if (receiver !== 'undefined'){
|
if (receiver !== 'undefined'){
|
||||||
transactionFloId = receiver
|
transactionFloId = receiver
|
||||||
composition += `
|
composition += `
|
||||||
<h5>${transaction}</h5> <strong class="breakable">${allContacts[receiver] ? allContacts[receiver].name : receiver}</strong>`
|
<h5>${transaction}</h5> <strong class="breakable">${allContacts ? allContacts[receiver] ? allContacts[receiver].name : receiver: receiver}</strong>`
|
||||||
if(floCrypto.validateAddr(receiver) && !allContacts[receiver])
|
if(!token_app.master_configurations.cashiers[myFloID] && floCrypto.validateAddr(receiver) && !allContacts[receiver])
|
||||||
composition += `<sm-button onclick="addPersonFromTransaction()">Save this FLO address</sm-button>`
|
composition += `<sm-button onclick="addPersonFromTransaction()">Save this FLO address</sm-button>`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2311,6 +2309,12 @@
|
|||||||
<h5>Sent to cashier UPI ID</h5>
|
<h5>Sent to cashier UPI ID</h5>
|
||||||
<strong>${receiverUPI}</strong>
|
<strong>${receiverUPI}</strong>
|
||||||
`
|
`
|
||||||
|
if(tokenTxId !== 'undefined'){
|
||||||
|
composition += `
|
||||||
|
<h5>FLO transaction ID</h5>
|
||||||
|
<strong><a class="breakable" target="_blank" href="https://ranchimall.github.io/floscout/#${tokenTxId}">${tokenTxId}</a></strong>
|
||||||
|
`
|
||||||
|
}
|
||||||
if(fromCashier !== 'undefined'){
|
if(fromCashier !== 'undefined'){
|
||||||
composition += `
|
composition += `
|
||||||
<p>You have received ₹${amount} from RanchiMall Pay. Your deposit request was completed successfully.</p>
|
<p>You have received ₹${amount} from RanchiMall Pay. Your deposit request was completed successfully.</p>
|
||||||
@ -2321,12 +2325,6 @@
|
|||||||
<p>You sent ₹${amount} to our cashier.</p>
|
<p>You sent ₹${amount} to our cashier.</p>
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
if(tokenTxId !== 'undefined'){
|
|
||||||
composition += `
|
|
||||||
<h5>FLO transaction ID</h5>
|
|
||||||
<strong><a class="breakable" target="_blank" href="https://ranchimall.github.io/floscout/#${tokenTxId}">${tokenTxId}</a></strong>
|
|
||||||
`
|
|
||||||
}
|
|
||||||
composition += `<h5 id="transaction_time">${formatedTime(timeStamp)}</h5>`
|
composition += `<h5 id="transaction_time">${formatedTime(timeStamp)}</h5>`
|
||||||
transactionDetails.innerHTML = composition
|
transactionDetails.innerHTML = composition
|
||||||
transactionType.textContent = type
|
transactionType.textContent = type
|
||||||
@ -2529,15 +2527,9 @@
|
|||||||
document.getElementById('navbar').classList.add('hide-completely')
|
document.getElementById('navbar').classList.add('hide-completely')
|
||||||
document.getElementById('main_header').classList.add('hide-completely')
|
document.getElementById('main_header').classList.add('hide-completely')
|
||||||
floDapps.clearCredentials()
|
floDapps.clearCredentials()
|
||||||
compactIDB.deleteDB().then((message) => {
|
onLoadStartUp()
|
||||||
delete token_app.master_configurations;
|
notifications.clearAll()
|
||||||
localStorage.removeItem(`defaultUPI${myFloID}`)
|
delete token_app.master_configurations;
|
||||||
onLoadStartUp()
|
|
||||||
notifications.clearAll()
|
|
||||||
notify('Logged out')
|
|
||||||
}).catch((error) => {
|
|
||||||
console.log(error)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -12122,6 +12114,9 @@
|
|||||||
showDepositRequests()
|
showDepositRequests()
|
||||||
showWithdrawRequests()
|
showWithdrawRequests()
|
||||||
showPayThruCashierRequests()
|
showPayThruCashierRequests()
|
||||||
|
getSentRupeeList()
|
||||||
|
|
||||||
|
getReceivedRupeeList()
|
||||||
userType.forEach(user => user.textContent = 'Cashier')
|
userType.forEach(user => user.textContent = 'Cashier')
|
||||||
showPage('deposit', 'deposit_page_btn')
|
showPage('deposit', 'deposit_page_btn')
|
||||||
}
|
}
|
||||||
@ -12694,8 +12689,8 @@
|
|||||||
flo_comment)
|
flo_comment)
|
||||||
console.log(flo_txid);
|
console.log(flo_txid);
|
||||||
if (typeof flo_txid !== "string") {
|
if (typeof flo_txid !== "string") {
|
||||||
showTransactionStatus('failure', `Transaction failed.`);
|
|
||||||
hidePopup()
|
hidePopup()
|
||||||
|
showTransactionStatus('failure', `Transaction failed.`);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if (payingRequested) {
|
if (payingRequested) {
|
||||||
@ -12724,7 +12719,7 @@
|
|||||||
}
|
}
|
||||||
hidePopup()
|
hidePopup()
|
||||||
showTransactionStatus('success', 'Rupee Sent', 'It may take upto 48 working hours for transaction to be completed.', flo_txid);
|
showTransactionStatus('success', 'Rupee Sent', 'It may take upto 48 working hours for transaction to be completed.', flo_txid);
|
||||||
sentActivityContainer.prepend(render.activityCard({ type: 'sent', proceesed: false, amount: token_amount, timeStamp: `${Date.now()}_${myFloID}`, token_txid: flo_txid, receiver: token_receiver }))
|
sentActivityContainer.prepend(render.activityCard({ type: 'sent', processed: false, amount: token_amount, timeStamp: `${Date.now()}_${myFloID}`, tokenTxId: flo_txid, receiver: token_receiver }))
|
||||||
refresh_balance()
|
refresh_balance()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -13243,18 +13238,29 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function getReceiver(vout){
|
||||||
|
for(v of vout){
|
||||||
|
for(addr of v.scriptPubKey.addresses){
|
||||||
|
if(addr !== myFloID)
|
||||||
|
return addr
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function getSentRupeeList() {
|
async function getSentRupeeList() {
|
||||||
try {
|
try {
|
||||||
let data = await ajaxGet(`https://ranchimallflo.duckdns.org/api/v1.0/getTokenTransactions?token=rupee&senderFloAddress=${myFloID}`)
|
let data = await ajaxGet(`https://ranchimallflo.duckdns.org/api/v1.0/getTokenTransactions?token=rupee&senderFloAddress=${myFloID}`)
|
||||||
let transactions = data.transactions
|
let transactions = data.transactions
|
||||||
|
console.log(transactions, data)
|
||||||
let sortedTransactions = Object.values(transactions).sort((a, b) => b.transactionDetails.time - a.transactionDetails.time)
|
let sortedTransactions = Object.values(transactions).sort((a, b) => b.transactionDetails.time - a.transactionDetails.time)
|
||||||
for (transaction of sortedTransactions) {
|
for (transaction of sortedTransactions) {
|
||||||
let { tokenAmount, flodata } = transaction.parsedFloData,
|
let { tokenAmount, flodata } = transaction.parsedFloData,
|
||||||
{time, txid} = transaction.transactionDetails,
|
{time, txid, vout} = transaction.transactionDetails,
|
||||||
receiver = flodata.match(/\b\w{34,34}\b/),
|
receiver = flodata.match(/\b\w{34,34}\b/) ? flodata.match(/\b\w{34,34}\b/) : await getReceiver(vout),
|
||||||
timeStamp = time * 1000,
|
timeStamp = time * 1000,
|
||||||
confirmations = await ajaxGet(`https://flosight.duckdns.org/api/tx/${txid}`),
|
confirmations = await ajaxGet(`https://flosight.duckdns.org/api/tx/${txid}`),
|
||||||
processed = confirmations.confirmations > 3 ? true : false
|
processed = confirmations.confirmations > 3 ? true : false
|
||||||
|
|
||||||
if (receiver === '' || typeof receiver === 'undefined' || receiver === null) continue;
|
if (receiver === '' || typeof receiver === 'undefined' || receiver === null) continue;
|
||||||
frag.append(render.activityCard({ type: 'sent', amount: tokenAmount, tokenTxId: txid, receiver, timeStamp, processed, toCashier: token_app.master_configurations.cashiers[receiver] }))
|
frag.append(render.activityCard({ type: 'sent', amount: tokenAmount, tokenTxId: txid, receiver, timeStamp, processed, toCashier: token_app.master_configurations.cashiers[receiver] }))
|
||||||
}
|
}
|
||||||
@ -13271,7 +13277,7 @@
|
|||||||
let transactions = data.transactions
|
let transactions = data.transactions
|
||||||
let sortedTransactions = Object.values(transactions).sort((a, b) => b.transactionDetails.time - a.transactionDetails.time)
|
let sortedTransactions = Object.values(transactions).sort((a, b) => b.transactionDetails.time - a.transactionDetails.time)
|
||||||
for (transaction of sortedTransactions) {
|
for (transaction of sortedTransactions) {
|
||||||
console.log(transaction)
|
|
||||||
let { tokenAmount, flodata } = transaction.parsedFloData,
|
let { tokenAmount, flodata } = transaction.parsedFloData,
|
||||||
{time, txid, vin} = transaction.transactionDetails,
|
{time, txid, vin} = transaction.transactionDetails,
|
||||||
sender = vin[0].addr,
|
sender = vin[0].addr,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user