From 4702ff93d590ef89a56e784b0a0b80751bb6b372 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 28 Jul 2021 17:03:50 +0200 Subject: [PATCH] Governance more votes --- Projects/Governance/UI/Globals/Reports.js | 2 +- Projects/Governance/UI/Utilities/CommonTables.js | 11 ++++++++++- Projects/Governance/UI/Utilities/Conversions.js | 14 ++++++++++++++ Projects/ProjectsSchema.json | 5 +++++ 4 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 Projects/Governance/UI/Utilities/Conversions.js diff --git a/Projects/Governance/UI/Globals/Reports.js b/Projects/Governance/UI/Globals/Reports.js index 93a611302..709e9dd57 100644 --- a/Projects/Governance/UI/Globals/Reports.js +++ b/Projects/Governance/UI/Globals/Reports.js @@ -1,6 +1,6 @@ function newGovernanceGlobalsReports() { let thisObject = { - REPORTS_SPACE_WIDTH: 1250 + REPORTS_SPACE_WIDTH: 1350 } return thisObject } \ No newline at end of file diff --git a/Projects/Governance/UI/Utilities/CommonTables.js b/Projects/Governance/UI/Utilities/CommonTables.js index 6b2e45f7a..bccca9cc4 100644 --- a/Projects/Governance/UI/Utilities/CommonTables.js +++ b/Projects/Governance/UI/Utilities/CommonTables.js @@ -37,7 +37,15 @@ function newGovernanceUtilitiesCommonTables() { "type": "number", "order": "descending", "textAlign": "center", - "format": "2 decimals" + "format": "integer" + }, + { + "name": "rewardInBTC", + "label": "Reward In BTC", + "type": "number", + "order": "descending", + "textAlign": "center", + "format": "8 decimals" }, { "name": "weight", @@ -84,6 +92,7 @@ function newGovernanceUtilitiesCommonTables() { let tableRecord = { "name": name, "tokensReward": node.payload.tokens | 0, + "rewardInBTC": UI.projects.governance.utilities.conversions.estimateSATokensInBTC(node.payload.tokens | 0), "weight": node.payload.weight, "weightPower": node.payload.votingProgram.votes } diff --git a/Projects/Governance/UI/Utilities/Conversions.js b/Projects/Governance/UI/Utilities/Conversions.js new file mode 100644 index 000000000..0637e4ce1 --- /dev/null +++ b/Projects/Governance/UI/Utilities/Conversions.js @@ -0,0 +1,14 @@ +function newGovernanceUtilitiesConversions () { + let thisObject = { + estimateSATokensInBTC: estimateSATokensInBTC + } + + return thisObject + + function estimateSATokensInBTC(SATokens) { + const SA_BTC_BASELINE_EXCHANGE_RATE = 1.5 / 1000000 + const BTC = SATokens * SA_BTC_BASELINE_EXCHANGE_RATE + + return SATokens + ' SA ≃ ' + BTC.toFixed(8) + ' BTC' + } +} \ No newline at end of file diff --git a/Projects/ProjectsSchema.json b/Projects/ProjectsSchema.json index c774e951c..be4ea0755 100644 --- a/Projects/ProjectsSchema.json +++ b/Projects/ProjectsSchema.json @@ -1098,6 +1098,11 @@ "name": "Filters", "propertyName": "filters", "functionName": "newGovernanceUtilitiesFilters" + }, + { + "name": "Conversions", + "propertyName": "conversions", + "functionName": "newGovernanceUtilitiesConversions" } ], "spaces": [