mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-04-24 03:47:53 +00:00
Fix reward for tiers
This commit is contained in:
parent
55780750f3
commit
f5b85aaf44
@ -348,6 +348,8 @@ class MintingInfo extends LitElement {
|
|||||||
this.changeTheme()
|
this.changeTheme()
|
||||||
this.changeLanguage()
|
this.changeLanguage()
|
||||||
|
|
||||||
|
this.levelsCount()
|
||||||
|
|
||||||
const getAdminInfo = () => {
|
const getAdminInfo = () => {
|
||||||
parentEpml.request("apiCall", { url: `/admin/info` }).then((res) => {
|
parentEpml.request("apiCall", { url: `/admin/info` }).then((res) => {
|
||||||
setTimeout(() => { this.adminInfo = res; }, 1)
|
setTimeout(() => { this.adminInfo = res; }, 1)
|
||||||
@ -360,7 +362,7 @@ class MintingInfo extends LitElement {
|
|||||||
this.nodeInfo = res
|
this.nodeInfo = res
|
||||||
// Now look up the sample block
|
// Now look up the sample block
|
||||||
getSampleBlock()
|
getSampleBlock()
|
||||||
});
|
})
|
||||||
setTimeout(getNodeInfo, 30000)
|
setTimeout(getNodeInfo, 30000)
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -374,17 +376,10 @@ class MintingInfo extends LitElement {
|
|||||||
const getAddressInfo = () => {
|
const getAddressInfo = () => {
|
||||||
parentEpml.request('apiCall', { url: `/addresses/${window.parent.reduxStore.getState().app.selectedAddress.address}` }).then((res) => {
|
parentEpml.request('apiCall', { url: `/addresses/${window.parent.reduxStore.getState().app.selectedAddress.address}` }).then((res) => {
|
||||||
setTimeout(() => { this.addressInfo = res }, 1)
|
setTimeout(() => { this.addressInfo = res }, 1)
|
||||||
});
|
})
|
||||||
setTimeout(getAddressInfo, 30000)
|
setTimeout(getAddressInfo, 30000)
|
||||||
}
|
}
|
||||||
|
|
||||||
const getAddressLevel = () => {
|
|
||||||
parentEpml.request('apiCall', { url: `/addresses/online/levels` }).then((res) => {
|
|
||||||
setTimeout(() => { this.addressLevel = res }, 1)
|
|
||||||
});
|
|
||||||
setTimeout(getAddressLevel, 30000)
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener('storage', () => {
|
window.addEventListener('storage', () => {
|
||||||
const checkLanguage = localStorage.getItem('qortalLanguage')
|
const checkLanguage = localStorage.getItem('qortalLanguage')
|
||||||
const checkTheme = localStorage.getItem('qortalTheme')
|
const checkTheme = localStorage.getItem('qortalTheme')
|
||||||
@ -416,7 +411,7 @@ class MintingInfo extends LitElement {
|
|||||||
setTimeout(getAdminInfo, 1)
|
setTimeout(getAdminInfo, 1)
|
||||||
setTimeout(getNodeInfo, 1)
|
setTimeout(getNodeInfo, 1)
|
||||||
setTimeout(getAddressInfo, 1)
|
setTimeout(getAddressInfo, 1)
|
||||||
setTimeout(getAddressLevel, 1)
|
setInterval(this.getAddressLevel, 30000)
|
||||||
configLoaded = true
|
configLoaded = true
|
||||||
}
|
}
|
||||||
this.config = JSON.parse(c)
|
this.config = JSON.parse(c)
|
||||||
@ -428,6 +423,26 @@ class MintingInfo extends LitElement {
|
|||||||
parentEpml.imReady()
|
parentEpml.imReady()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async levelsCount() {
|
||||||
|
await this.getAddressLevel()
|
||||||
|
this.countForTier4()
|
||||||
|
}
|
||||||
|
|
||||||
|
getAddressLevel = async () => {
|
||||||
|
const callLevels = await parentEpml.request('apiCall', {
|
||||||
|
url: `/addresses/online/levels`
|
||||||
|
})
|
||||||
|
this.addressLevel = callLevels
|
||||||
|
}
|
||||||
|
|
||||||
|
countForTier4() {
|
||||||
|
const minterOnline = (this.addressLevel[7].count + this.addressLevel[8].count)
|
||||||
|
if (minterOnline < 30) {
|
||||||
|
return "false"
|
||||||
|
} else {
|
||||||
|
return "true"
|
||||||
|
}
|
||||||
|
}
|
||||||
changeTheme() {
|
changeTheme() {
|
||||||
const checkTheme = localStorage.getItem('qortalTheme')
|
const checkTheme = localStorage.getItem('qortalTheme')
|
||||||
if (checkTheme === 'dark') {
|
if (checkTheme === 'dark') {
|
||||||
@ -601,13 +616,29 @@ class MintingInfo extends LitElement {
|
|||||||
} else if (this.addressInfo.level === 4) {
|
} else if (this.addressInfo.level === 4) {
|
||||||
return "13"
|
return "13"
|
||||||
} else if (this.addressInfo.level === 5) {
|
} else if (this.addressInfo.level === 5) {
|
||||||
return "19"
|
if (this.countForTier4() === "false") {
|
||||||
|
return "45"
|
||||||
|
} else {
|
||||||
|
return "19"
|
||||||
|
}
|
||||||
} else if (this.addressInfo.level === 6) {
|
} else if (this.addressInfo.level === 6) {
|
||||||
return "19"
|
if (this.countForTier4() === "false") {
|
||||||
|
return "45"
|
||||||
|
} else {
|
||||||
|
return "19"
|
||||||
|
}
|
||||||
} else if (this.addressInfo.level === 7) {
|
} else if (this.addressInfo.level === 7) {
|
||||||
return "26"
|
if (this.countForTier4() === "false") {
|
||||||
|
return "45"
|
||||||
|
} else {
|
||||||
|
return "26"
|
||||||
|
}
|
||||||
} else if (this.addressInfo.level === 8) {
|
} else if (this.addressInfo.level === 8) {
|
||||||
return "26"
|
if (this.countForTier4() === "false") {
|
||||||
|
return "45"
|
||||||
|
} else {
|
||||||
|
return "26"
|
||||||
|
}
|
||||||
} else if (this.addressInfo.level === 9) {
|
} else if (this.addressInfo.level === 9) {
|
||||||
return "32"
|
return "32"
|
||||||
} else if (this.addressInfo.level === 10) {
|
} else if (this.addressInfo.level === 10) {
|
||||||
@ -662,17 +693,37 @@ class MintingInfo extends LitElement {
|
|||||||
let countTier21 = (this.addressLevel[3].count + this.addressLevel[4].count).toString()
|
let countTier21 = (this.addressLevel[3].count + this.addressLevel[4].count).toString()
|
||||||
return "" + countTier21
|
return "" + countTier21
|
||||||
} else if (this.addressInfo.level === 5) {
|
} else if (this.addressInfo.level === 5) {
|
||||||
let countTier30 = (this.addressLevel[5].count + this.addressLevel[6].count).toString()
|
if (this.countForTier4() === "false") {
|
||||||
return "" + countTier30
|
let countTier30 = (this.addressLevel[5].count + this.addressLevel[6].count + this.addressLevel[7].count + this.addressLevel[8].count).toString()
|
||||||
|
return "" + countTier30
|
||||||
|
} else {
|
||||||
|
let countTier30 = (this.addressLevel[5].count + this.addressLevel[6].count).toString()
|
||||||
|
return "" + countTier30
|
||||||
|
}
|
||||||
} else if (this.addressInfo.level === 6) {
|
} else if (this.addressInfo.level === 6) {
|
||||||
let countTier31 = (this.addressLevel[5].count + this.addressLevel[6].count).toString()
|
if (this.countForTier4() === "false") {
|
||||||
return "" + countTier31
|
let countTier31 = (this.addressLevel[5].count + this.addressLevel[6].count + this.addressLevel[7].count + this.addressLevel[8].count).toString()
|
||||||
|
return "" + countTier31
|
||||||
|
} else {
|
||||||
|
let countTier31 = (this.addressLevel[5].count + this.addressLevel[6].count).toString()
|
||||||
|
return "" + countTier31
|
||||||
|
}
|
||||||
} else if (this.addressInfo.level === 7) {
|
} else if (this.addressInfo.level === 7) {
|
||||||
let countTier40 = (this.addressLevel[7].count + this.addressLevel[8].count).toString()
|
if (this.countForTier4() === "false") {
|
||||||
return "" + countTier40
|
let countTier40 = (this.addressLevel[5].count + this.addressLevel[6].count + this.addressLevel[7].count + this.addressLevel[8].count).toString()
|
||||||
|
return "" + countTier40
|
||||||
|
} else {
|
||||||
|
let countTier40 = (this.addressLevel[7].count + this.addressLevel[8].count).toString()
|
||||||
|
return "" + countTier40
|
||||||
|
}
|
||||||
} else if (this.addressInfo.level === 8) {
|
} else if (this.addressInfo.level === 8) {
|
||||||
let countTier41 = (this.addressLevel[7].count + this.addressLevel[8].count).toString()
|
if (this.countForTier4() === "false") {
|
||||||
return "" + countTier41
|
let countTier40 = (this.addressLevel[5].count + this.addressLevel[6].count + this.addressLevel[7].count + this.addressLevel[8].count).toString()
|
||||||
|
return "" + countTier40
|
||||||
|
} else {
|
||||||
|
let countTier41 = (this.addressLevel[7].count + this.addressLevel[8].count).toString()
|
||||||
|
return "" + countTier41
|
||||||
|
}
|
||||||
} else if (this.addressInfo.level === 9) {
|
} else if (this.addressInfo.level === 9) {
|
||||||
let countTier50 = (this.addressLevel[9].count + this.addressLevel[10].count).toString()
|
let countTier50 = (this.addressLevel[9].count + this.addressLevel[10].count).toString()
|
||||||
return "" + countTier50
|
return "" + countTier50
|
||||||
@ -702,21 +753,45 @@ class MintingInfo extends LitElement {
|
|||||||
let countReward41 = (countReward40).toString();
|
let countReward41 = (countReward40).toString();
|
||||||
return "" + countReward41;
|
return "" + countReward41;
|
||||||
} else if (this.addressInfo.level === 5) {
|
} else if (this.addressInfo.level === 5) {
|
||||||
let countReward50 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[5].count + this.addressLevel[6].count)).toFixed(8)
|
if (this.countForTier4() === "false") {
|
||||||
let countReward51 = (countReward50).toString();
|
let countReward50 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[5].count + this.addressLevel[6].count + this.addressLevel[7].count + this.addressLevel[8].count)).toFixed(8)
|
||||||
return "" + countReward51;
|
let countReward51 = (countReward50).toString();
|
||||||
|
return "" + countReward51;
|
||||||
|
} else {
|
||||||
|
let countReward50 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[5].count + this.addressLevel[6].count)).toFixed(8)
|
||||||
|
let countReward51 = (countReward50).toString();
|
||||||
|
return "" + countReward51;
|
||||||
|
}
|
||||||
} else if (this.addressInfo.level === 6) {
|
} else if (this.addressInfo.level === 6) {
|
||||||
let countReward60 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[5].count + this.addressLevel[6].count)).toFixed(8)
|
if (this.countForTier4() === "false") {
|
||||||
let countReward61 = (countReward60).toString()
|
let countReward60 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[5].count + this.addressLevel[6].count + this.addressLevel[7].count + this.addressLevel[8].count)).toFixed(8)
|
||||||
return "" + countReward61
|
let countReward61 = (countReward60).toString()
|
||||||
|
return "" + countReward61
|
||||||
|
} else {
|
||||||
|
let countReward60 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[5].count + this.addressLevel[6].count)).toFixed(8)
|
||||||
|
let countReward61 = (countReward60).toString()
|
||||||
|
return "" + countReward61
|
||||||
|
}
|
||||||
} else if (this.addressInfo.level === 7) {
|
} else if (this.addressInfo.level === 7) {
|
||||||
let countReward70 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[7].count + this.addressLevel[8].count)).toFixed(8)
|
if (this.countForTier4() === "false") {
|
||||||
let countReward71 = (countReward70).toString()
|
let countReward70 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[5].count + this.addressLevel[6].count + this.addressLevel[7].count + this.addressLevel[8].count)).toFixed(8)
|
||||||
return "" + countReward71
|
let countReward71 = (countReward70).toString()
|
||||||
|
return "" + countReward71
|
||||||
|
} else {
|
||||||
|
let countReward70 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[7].count + this.addressLevel[8].count)).toFixed(8)
|
||||||
|
let countReward71 = (countReward70).toString()
|
||||||
|
return "" + countReward71
|
||||||
|
}
|
||||||
} else if (this.addressInfo.level === 8) {
|
} else if (this.addressInfo.level === 8) {
|
||||||
let countReward80 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[7].count + this.addressLevel[8].count)).toFixed(8)
|
if (this.countForTier4() === "false") {
|
||||||
let countReward81 = (countReward80).toString()
|
let countReward80 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[5].count + this.addressLevel[6].count + this.addressLevel[7].count + this.addressLevel[8].count)).toFixed(8)
|
||||||
return "" + countReward81
|
let countReward81 = (countReward80).toString()
|
||||||
|
return "" + countReward81
|
||||||
|
} else {
|
||||||
|
let countReward80 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[7].count + this.addressLevel[8].count)).toFixed(8)
|
||||||
|
let countReward81 = (countReward80).toString()
|
||||||
|
return "" + countReward81
|
||||||
|
}
|
||||||
} else if (this.addressInfo.level === 9) {
|
} else if (this.addressInfo.level === 9) {
|
||||||
let countReward90 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[9].count + this.addressLevel[10].count)).toFixed(8)
|
let countReward90 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[9].count + this.addressLevel[10].count)).toFixed(8)
|
||||||
let countReward91 = (countReward90).toString()
|
let countReward91 = (countReward90).toString()
|
||||||
@ -748,21 +823,45 @@ class MintingInfo extends LitElement {
|
|||||||
let countRewardDay41 = (countRewardDay40).toString()
|
let countRewardDay41 = (countRewardDay40).toString()
|
||||||
return "" + countRewardDay41
|
return "" + countRewardDay41
|
||||||
} else if (this.addressInfo.level === 5) {
|
} else if (this.addressInfo.level === 5) {
|
||||||
let countRewardDay50 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[5].count + this.addressLevel[6].count) * this._timeCalc()).toFixed(8)
|
if (this.countForTier4() === "false") {
|
||||||
let countRewardDay51 = (countRewardDay50).toString()
|
let countRewardDay50 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[5].count + this.addressLevel[6].count + this.addressLevel[7].count + this.addressLevel[8].count) * this._timeCalc()).toFixed(8)
|
||||||
return "" + countRewardDay51
|
let countRewardDay51 = (countRewardDay50).toString()
|
||||||
|
return "" + countRewardDay51
|
||||||
|
} else {
|
||||||
|
let countRewardDay50 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[5].count + this.addressLevel[6].count) * this._timeCalc()).toFixed(8)
|
||||||
|
let countRewardDay51 = (countRewardDay50).toString()
|
||||||
|
return "" + countRewardDay51
|
||||||
|
}
|
||||||
} else if (this.addressInfo.level === 6) {
|
} else if (this.addressInfo.level === 6) {
|
||||||
let countRewardDay60 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[5].count + this.addressLevel[6].count) * this._timeCalc()).toFixed(8)
|
if (this.countForTier4() === "false") {
|
||||||
let countRewardDay61 = (countRewardDay60).toString()
|
let countRewardDay60 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[5].count + this.addressLevel[6].count + this.addressLevel[7].count + this.addressLevel[8].count) * this._timeCalc()).toFixed(8)
|
||||||
return "" + countRewardDay61
|
let countRewardDay61 = (countRewardDay60).toString()
|
||||||
|
return "" + countRewardDay61
|
||||||
|
} else {
|
||||||
|
let countRewardDay60 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[5].count + this.addressLevel[6].count) * this._timeCalc()).toFixed(8)
|
||||||
|
let countRewardDay61 = (countRewardDay60).toString()
|
||||||
|
return "" + countRewardDay61
|
||||||
|
}
|
||||||
} else if (this.addressInfo.level === 7) {
|
} else if (this.addressInfo.level === 7) {
|
||||||
let countRewardDay70 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[7].count + this.addressLevel[8].count) * this._timeCalc()).toFixed(8)
|
if (this.countForTier4() === "false") {
|
||||||
let countRewardDay71 = (countRewardDay70).toString()
|
let countRewardDay70 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[5].count + this.addressLevel[6].count + this.addressLevel[7].count + this.addressLevel[8].count) * this._timeCalc()).toFixed(8)
|
||||||
return "" + countRewardDay71
|
let countRewardDay71 = (countRewardDay70).toString()
|
||||||
|
return "" + countRewardDay71
|
||||||
|
} else {
|
||||||
|
let countRewardDay70 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[7].count + this.addressLevel[8].count) * this._timeCalc()).toFixed(8)
|
||||||
|
let countRewardDay71 = (countRewardDay70).toString()
|
||||||
|
return "" + countRewardDay71
|
||||||
|
}
|
||||||
} else if (this.addressInfo.level === 8) {
|
} else if (this.addressInfo.level === 8) {
|
||||||
let countRewardDay80 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[7].count + this.addressLevel[8].count) * this._timeCalc()).toFixed(8)
|
if (this.countForTier4() === "false") {
|
||||||
let countRewardDay81 = (countRewardDay80).toString()
|
let countRewardDay80 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[5].count + this.addressLevel[6].count + this.addressLevel[7].count + this.addressLevel[8].count) * this._timeCalc()).toFixed(8)
|
||||||
return "" + countRewardDay81
|
let countRewardDay81 = (countRewardDay80).toString()
|
||||||
|
return "" + countRewardDay81
|
||||||
|
} else {
|
||||||
|
let countRewardDay80 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[7].count + this.addressLevel[8].count) * this._timeCalc()).toFixed(8)
|
||||||
|
let countRewardDay81 = (countRewardDay80).toString()
|
||||||
|
return "" + countRewardDay81
|
||||||
|
}
|
||||||
} else if (this.addressInfo.level === 9) {
|
} else if (this.addressInfo.level === 9) {
|
||||||
let countRewardDay90 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[9].count + this.addressLevel[10].count) * this._timeCalc()).toFixed(8)
|
let countRewardDay90 = ((this._blockReward() / 100 * this._tierPercent()) / (this.addressLevel[9].count + this.addressLevel[10].count) * this._timeCalc()).toFixed(8)
|
||||||
let countRewardDay91 = (countRewardDay90).toString()
|
let countRewardDay91 = (countRewardDay90).toString()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user