Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stage #1873

Merged
merged 3 commits into from
Jan 23, 2023
Merged

Stage #1873

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 29 additions & 16 deletions src/components/admin/marketPlaceSlider/marketPlaceSlide.vue
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ allButtons {
<label for="placeHolder" class="col-form-label">Total:</label>
</div>
<div class="col-lg-6 col-md-6 px-0">
<span v-if="feeStructure.fyrePlatformCommision!==''" style="float:right">{{ (getFriendlyValue(feeStructure.totalAmountToDistribute) - getFriendlyValue(feeStructure.fyrePlatformCommision)).toFixed(4)}}
<span v-if="feeStructure.fyrePlatformCommision!==''" style="float:right">{{ total}}
{{feeStructure.symbol}} Tokens</span>
</div>
</div>
Expand All @@ -234,7 +234,7 @@ allButtons {
<label for="placeHolder" class="col-form-label">Platform Fee:</label>
</div>
<div class="col-lg-6 col-md-6 px-0">
<span v-if="feeStructure.fyrePlatformCommision!==''" style="float:right">{{getFriendlyValue(feeStructure.fyrePlatformCommision)}}
<span v-if="feeStructure.fyrePlatformCommision!==''" style="float:right">{{getPlatformFee}}
{{feeStructure.symbol}} Tokens</span>
</div>
</div>
Expand All @@ -244,7 +244,7 @@ allButtons {
<label for="placeHolder" class="col-form-label">Total Payable:</label>
</div>
<div class="col-lg-6 col-md-6 px-0">
<span v-if="feeStructure.totalAmountToDistribute!==''" style="float:right">{{getFriendlyValue(feeStructure.totalAmountToDistribute)}}
<span v-if="feeStructure.totalAmountToDistribute!==''" style="float:right">{{totalPayable(feeStructure.totalAmountToDistribute)}}
{{feeStructure.symbol}} Tokens</span>
</div>
</div>
Expand Down Expand Up @@ -366,7 +366,31 @@ export default {
'--header-bg-color': config.app.headerBGColor,
'--header-text-color':config.app.headerTextColor
}
}
},
getPlatformFee() {
const convertToDecimal = Number(this.feeStructure.fyrePlatformCommision)/Number(10 ** this.feeStructure.decimals)
const roundedFyreCommisson = Number(convertToDecimal).toFixed(4)
return roundedFyreCommisson
},
totalPayable() {
return friendlyValue => {
const convertToDecimal = Number(friendlyValue)/Number(10 ** this.feeStructure.decimals)
const rounded = Number(convertToDecimal).toFixed(4)
return rounded
}
},
total(){
let amountWithCommisson = Number(this.feeStructure.totalAmountToDistribute)/Number(10 **this.feeStructure.decimals)
let onlyAmountCommission = Number(this.feeStructure.fyrePlatformCommision)/Number(10 **this.feeStructure.decimals)
return (amountWithCommisson-onlyAmountCommission).toFixed(4)
},
getRoundOffValue(){
return roudOff => {
const inwei = (10 ** this.feeStructure.decimal)
const inNumber = roudOff/inwei
return inNumber
}
}
},
data() {
return {
Expand Down Expand Up @@ -480,18 +504,7 @@ export default {
this.files = null
this.showDismissibleAlert.status = false
this.simpleData=""
},
getFriendlyValue(str) {
const convertToDecimal = Number(str)/Number(10 ** this.feeStructure.decimals)
const rounded = Number(convertToDecimal).toFixed(4)
return rounded
},
getRoundOffValue(num) {
const inwei = (10 ** this.feeStructure.decimal)
const inNumber = num/inwei
return inNumber

},
},
async onSelectChain(e) {
if(e===null) {
return this.notifyErr('Select Chain')
Expand Down
3 changes: 1 addition & 2 deletions src/mixins/fieldValidationMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ export function shortenName(first,last) {
}
const eachLen = 3
const firstPart = first.substr(0, eachLen);
const lastPart = last.slice(-eachLen);
console.log(firstPart+lastPart)
const lastPart = last.slice(-eachLen);
return firstPart + lastPart;
}

Expand Down