@@ -1504,8 +1504,8 @@ class TradePortal extends LitElement {
case 'DIGIBYTE':
_url = `/crosschain/dgb/walletbalance?apiKey=${this.getApiKey()}`
_body = window.parent.reduxStore.getState().app.selectedAddress.dgbWallet.derivedMasterPublicKey
- break
- case 'RAVENCOIN':
+ break
+ case 'RAVENCOIN':
_url = `/crosschain/rvn/walletbalance?apiKey=${this.getApiKey()}`
_body = window.parent.reduxStore.getState().app.selectedAddress.rvnWallet.derivedMasterPublicKey
break
@@ -2945,4 +2945,4 @@ class TradePortal extends LitElement {
}
}
-window.customElements.define('trade-portal', TradePortal)
\ No newline at end of file
+window.customElements.define('trade-portal', TradePortal)
From 5bb1570a35778c3a41f763709805091631841b27 Mon Sep 17 00:00:00 2001
From: AlphaX-Projects <77661270+AlphaX-Projects@users.noreply.github.com>
Date: Mon, 9 Jan 2023 14:05:13 +0100
Subject: [PATCH 12/14] last child full visible
---
qortal-ui-plugins/plugins/core/messaging/q-chat/q-chat.src.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qortal-ui-plugins/plugins/core/messaging/q-chat/q-chat.src.js b/qortal-ui-plugins/plugins/core/messaging/q-chat/q-chat.src.js
index 193883ee..dc59b97f 100644
--- a/qortal-ui-plugins/plugins/core/messaging/q-chat/q-chat.src.js
+++ b/qortal-ui-plugins/plugins/core/messaging/q-chat/q-chat.src.js
@@ -122,7 +122,7 @@ class Chat extends LitElement {
box-shadow: 0 3px 5px rgba(0, 0, 0, .2);
}
.people-list ul {
- padding: 0;
+ padding: 0px 0px 60px 0px;
height: 85vh;
overflow-y: auto;
overflow-x: hidden;
From f8ceaa56c51eb376b539b29d6e7c15e9bae53558 Mon Sep 17 00:00:00 2001
From: AlphaX-Projects <77661270+AlphaX-Projects@users.noreply.github.com>
Date: Mon, 9 Jan 2023 15:03:59 +0100
Subject: [PATCH 13/14] Add chart js files
---
.../core/trade-portal/charts/arrr-charts.js | 214 +++++++++++++++++
.../core/trade-portal/charts/btc-charts.js | 215 ++++++++++++++++++
.../core/trade-portal/charts/dgb-charts.js | 214 +++++++++++++++++
.../core/trade-portal/charts/doge-charts.js | 214 +++++++++++++++++
.../core/trade-portal/charts/ltc-charts.js | 214 +++++++++++++++++
.../core/trade-portal/charts/rvn-charts.js | 214 +++++++++++++++++
6 files changed, 1285 insertions(+)
create mode 100644 qortal-ui-plugins/plugins/core/trade-portal/charts/arrr-charts.js
create mode 100644 qortal-ui-plugins/plugins/core/trade-portal/charts/btc-charts.js
create mode 100644 qortal-ui-plugins/plugins/core/trade-portal/charts/dgb-charts.js
create mode 100644 qortal-ui-plugins/plugins/core/trade-portal/charts/doge-charts.js
create mode 100644 qortal-ui-plugins/plugins/core/trade-portal/charts/ltc-charts.js
create mode 100644 qortal-ui-plugins/plugins/core/trade-portal/charts/rvn-charts.js
diff --git a/qortal-ui-plugins/plugins/core/trade-portal/charts/arrr-charts.js b/qortal-ui-plugins/plugins/core/trade-portal/charts/arrr-charts.js
new file mode 100644
index 00000000..561cd9df
--- /dev/null
+++ b/qortal-ui-plugins/plugins/core/trade-portal/charts/arrr-charts.js
@@ -0,0 +1,214 @@
+import { LitElement, html, css } from 'lit'
+import { render } from 'lit/html.js'
+import { Epml } from '../../../../epml.js'
+import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
+
+registerTranslateConfig({
+ loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
+})
+
+import '@polymer/paper-dialog/paper-dialog.js'
+import * as Highcharts from 'highcharts'
+import Exporting from 'highcharts/modules/exporting'
+Exporting(Highcharts)
+import StockChart from 'highcharts/modules/stock'
+StockChart(Highcharts)
+import 'highcharts/highcharts-more.js'
+import 'highcharts/modules/accessibility.js'
+import 'highcharts/modules/boost.js'
+import 'highcharts/modules/data.js'
+import 'highcharts/modules/export-data.js'
+import 'highcharts/modules/offline-exporting.js'
+
+let arrrChartDialog
+
+const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
+
+class ArrrCharts extends LitElement {
+ static get properties() {
+ return {
+ isLoadingTradesChart: { type: Boolean },
+ arrrTrades: { type: Array },
+ arrrPrice: { type: Array }
+ }
+ }
+
+ static get styles() {
+ return css`
+ .loadingContainer {
+ height: 100%;
+ width: 100%;
+ }
+
+ .trades-chart {
+ color: var(--black);
+ background: var(--white);
+ border: 1px solid var(--black);
+ border-radius: 25px;
+ padding: 15px;
+ }
+
+ .chart-container {
+ margin: auto;
+ color: var(--black);
+ text-align: center;
+ padding: 15px;
+ height: 30vh;
+ width: 80vw;
+ }
+
+ .chart-info-wrapper {
+ background: transparent;
+ height: 38vh;
+ width: 83vw;
+ overflow: auto;
+ }
+
+ .chart-loading-wrapper {
+ color: var(--black);
+ background: var(--white);
+ border: 1px solid var(--black);
+ border-radius: 15px;
+ }
+ `
+ }
+
+ constructor() {
+ super()
+ this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light'
+ this.isLoadingTradesChart = false
+ this.arrrTrades = []
+ this.arrrPrice = []
+ }
+
+ render() {
+ return html`
+
+
+ ${translate("login.loading")}
+
+
+
+
+
+ `
+ }
+
+ async firstUpdated() {
+ this.changeTheme()
+ this.changeLanguage()
+
+ window.addEventListener('storage', () => {
+ const checkLanguage = localStorage.getItem('qortalLanguage')
+ const checkTheme = localStorage.getItem('qortalTheme')
+
+ use(checkLanguage)
+
+ this.theme = (checkTheme === 'dark') ? 'dark' : 'light'
+ document.querySelector('html').setAttribute('theme', this.theme)
+ })
+ }
+
+ async loadTradesChart() {
+ this.isLoadingTradesChart = true
+ this.shadowRoot.getElementById('loadChartDialog').open()
+ await this.getArrrTrades()
+ this.isLoadingTradesChart = false
+ this.shadowRoot.getElementById('loadChartDialog').close()
+ this.enableArrrStockPriceChart()
+ }
+
+ async getArrrTrades() {
+ let currentArrrTimestamp = Date.now()
+ const monthBackArrr = currentArrrTimestamp - 31556952000
+ await parentEpml.request("apiCall", { url: `/crosschain/trades?foreignBlockchain=PIRATECHAIN&minimumTimestamp=${monthBackArrr}&limit=0&reverse=false` }).then((res) => {
+ this.arrrTrades = res
+ })
+ this.arrrPrice = this.arrrTrades.map(item => {
+ const arrrSellPrice = this.round(parseFloat(item.foreignAmount) / parseFloat(item.qortAmount))
+ return [item.tradeTimestamp, parseFloat(arrrSellPrice)]
+ }).filter(item => !!item)
+ }
+
+ enableArrrStockPriceChart() {
+ const arrrStockPriceData = this.arrrPrice
+ const header = 'QORT / ARRR ' + get("tradepage.tchange49")
+ Highcharts.stockChart(this.shadowRoot.querySelector('#arrrStockPriceContainer'), {
+ accessibility: {
+ enabled: false
+ },
+ credits: {
+ enabled: false
+ },
+ rangeSelector: {
+ selected: 1,
+ labelStyle: {color: 'var(--black)'},
+ inputStyle: {color: '#03a9f4'}
+ },
+ chart: {
+ backgroundColor: 'transparent'
+ },
+ title: {
+ text: header,
+ style: {color: 'var(--black)'}
+ },
+ xAxis: {
+ labels: {
+ style: {
+ color: '#03a9f4'
+ }
+ }
+ },
+ yAxis: {
+ labels: {
+ style: {
+ color: '#03a9f4'
+ }
+ }
+ },
+ series: [{
+ name: 'QORT / ARRR',
+ data: arrrStockPriceData,
+ tooltip: {
+ valueDecimals: 8
+ }
+ }]
+ })
+ }
+
+ async open() {
+ await this.loadTradesChart()
+ this.shadowRoot.getElementById('arrrChartDialog').open()
+ }
+
+ changeTheme() {
+ const checkTheme = localStorage.getItem('qortalTheme')
+ this.theme = (checkTheme === 'dark') ? 'dark' : 'light'
+ document.querySelector('html').setAttribute('theme', this.theme);
+ }
+
+ changeLanguage() {
+ const checkLanguage = localStorage.getItem('qortalLanguage')
+
+ if (checkLanguage === null || checkLanguage.length === 0) {
+ localStorage.setItem('qortalLanguage', 'us')
+ use('us')
+ } else {
+ use(checkLanguage)
+ }
+ }
+
+ round(number) {
+ let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
+ return result
+ }
+}
+
+window.customElements.define('arrr-charts', ArrrCharts)
+
+const chartsarrr = document.createElement('arrr-charts')
+arrrChartDialog = document.body.appendChild(chartsarrr)
+
+export default arrrChartDialog
\ No newline at end of file
diff --git a/qortal-ui-plugins/plugins/core/trade-portal/charts/btc-charts.js b/qortal-ui-plugins/plugins/core/trade-portal/charts/btc-charts.js
new file mode 100644
index 00000000..c31d272b
--- /dev/null
+++ b/qortal-ui-plugins/plugins/core/trade-portal/charts/btc-charts.js
@@ -0,0 +1,215 @@
+import { LitElement, html, css } from 'lit'
+import { render } from 'lit/html.js'
+import { Epml } from '../../../../epml.js'
+import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
+
+registerTranslateConfig({
+ loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
+})
+
+import '@polymer/paper-dialog/paper-dialog.js'
+import * as Highcharts from 'highcharts'
+import Exporting from 'highcharts/modules/exporting'
+Exporting(Highcharts)
+import StockChart from 'highcharts/modules/stock'
+StockChart(Highcharts)
+import 'highcharts/highcharts-more.js'
+import 'highcharts/modules/accessibility.js'
+import 'highcharts/modules/boost.js'
+import 'highcharts/modules/data.js'
+import 'highcharts/modules/export-data.js'
+import 'highcharts/modules/offline-exporting.js'
+
+let btcChartDialog
+
+const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
+
+class BtcCharts extends LitElement {
+ static get properties() {
+ return {
+ isLoadingTradesChart: { type: Boolean },
+ btcTrades: { type: Array },
+ btcPrice: { type: Array }
+ }
+ }
+
+ static get styles() {
+ return css`
+ .loadingContainer {
+ height: 100%;
+ width: 100%;
+ }
+
+ .trades-chart {
+ color: var(--black);
+ background: var(--white);
+ border: 1px solid var(--black);
+ border-radius: 25px;
+ padding: 15px;
+ }
+
+ .chart-container {
+ margin: auto;
+ color: var(--black);
+ text-align: center;
+ padding: 15px;
+ height: 30vh;
+ width: 80vw;
+ }
+
+ .chart-info-wrapper {
+ background: transparent;
+ height: 38vh;
+ width: 83vw;
+ overflow: auto;
+ }
+
+ .chart-loading-wrapper {
+ color: var(--black);
+ background: var(--white);
+ border: 1px solid var(--black);
+ border-radius: 15px;
+ }
+ `
+ }
+
+ constructor() {
+ super()
+ this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light'
+ this.isLoadingTradesChart = false
+ this.btcTrades = []
+ this.btcPrice = []
+ }
+
+ render() {
+ return html`
+
+
+ ${translate("login.loading")}
+
+
+
+
+
+ `
+ }
+
+ async firstUpdated() {
+ this.changeTheme()
+ this.changeLanguage()
+
+ window.addEventListener('storage', () => {
+ const checkLanguage = localStorage.getItem('qortalLanguage')
+ const checkTheme = localStorage.getItem('qortalTheme')
+
+ use(checkLanguage)
+
+ this.theme = (checkTheme === 'dark') ? 'dark' : 'light'
+ document.querySelector('html').setAttribute('theme', this.theme)
+ })
+ }
+
+ async loadTradesChart() {
+ this.isLoadingTradesChart = true
+ this.shadowRoot.getElementById('loadChartDialog').open()
+ await this.getBtcTrades()
+ this.isLoadingTradesChart = false
+ this.shadowRoot.getElementById('loadChartDialog').close()
+ this.enableBtcStockPriceChart()
+ }
+
+ async getBtcTrades() {
+ let currentBtcTimestamp = Date.now()
+ const monthBackBtc = currentBtcTimestamp - 31556952000
+ await parentEpml.request("apiCall", { url: `/crosschain/trades?foreignBlockchain=BITCOIN&minimumTimestamp=${monthBackBtc}&limit=0&reverse=false` }).then((res) => {
+ this.btcTrades = res
+ })
+
+ this.btcPrice = this.btcTrades.map(item => {
+ const btcSellPrice = this.round(parseFloat(item.foreignAmount) / parseFloat(item.qortAmount))
+ return [item.tradeTimestamp, parseFloat(btcSellPrice)]
+ }).filter(item => !!item)
+ }
+
+ enableBtcStockPriceChart() {
+ const btcStockPriceData = this.btcPrice
+ const header = 'QORT / BTC ' + get("tradepage.tchange49")
+ Highcharts.stockChart(this.shadowRoot.querySelector('#btcStockPriceContainer'), {
+ accessibility: {
+ enabled: false
+ },
+ credits: {
+ enabled: false
+ },
+ rangeSelector: {
+ selected: 1,
+ labelStyle: {color: 'var(--black)'},
+ inputStyle: {color: '#03a9f4'}
+ },
+ chart: {
+ backgroundColor: 'transparent'
+ },
+ title: {
+ text: header,
+ style: {color: 'var(--black)'}
+ },
+ xAxis: {
+ labels: {
+ style: {
+ color: '#03a9f4'
+ }
+ }
+ },
+ yAxis: {
+ labels: {
+ style: {
+ color: '#03a9f4'
+ }
+ }
+ },
+ series: [{
+ name: 'QORT / BTC',
+ data: btcStockPriceData,
+ tooltip: {
+ valueDecimals: 8
+ }
+ }]
+ })
+ }
+
+ async open() {
+ await this.loadTradesChart()
+ this.shadowRoot.getElementById('btcChartDialog').open()
+ }
+
+ changeTheme() {
+ const checkTheme = localStorage.getItem('qortalTheme')
+ this.theme = (checkTheme === 'dark') ? 'dark' : 'light'
+ document.querySelector('html').setAttribute('theme', this.theme);
+ }
+
+ changeLanguage() {
+ const checkLanguage = localStorage.getItem('qortalLanguage')
+
+ if (checkLanguage === null || checkLanguage.length === 0) {
+ localStorage.setItem('qortalLanguage', 'us')
+ use('us')
+ } else {
+ use(checkLanguage)
+ }
+ }
+
+ round(number) {
+ let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
+ return result
+ }
+}
+
+window.customElements.define('btc-charts', BtcCharts)
+
+const chartsbtc = document.createElement('btc-charts')
+btcChartDialog = document.body.appendChild(chartsbtc)
+
+export default btcChartDialog
\ No newline at end of file
diff --git a/qortal-ui-plugins/plugins/core/trade-portal/charts/dgb-charts.js b/qortal-ui-plugins/plugins/core/trade-portal/charts/dgb-charts.js
new file mode 100644
index 00000000..5e57aad7
--- /dev/null
+++ b/qortal-ui-plugins/plugins/core/trade-portal/charts/dgb-charts.js
@@ -0,0 +1,214 @@
+import { LitElement, html, css } from 'lit'
+import { render } from 'lit/html.js'
+import { Epml } from '../../../../epml.js'
+import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
+
+registerTranslateConfig({
+ loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
+})
+
+import '@polymer/paper-dialog/paper-dialog.js'
+import * as Highcharts from 'highcharts'
+import Exporting from 'highcharts/modules/exporting'
+Exporting(Highcharts)
+import StockChart from 'highcharts/modules/stock'
+StockChart(Highcharts)
+import 'highcharts/highcharts-more.js'
+import 'highcharts/modules/accessibility.js'
+import 'highcharts/modules/boost.js'
+import 'highcharts/modules/data.js'
+import 'highcharts/modules/export-data.js'
+import 'highcharts/modules/offline-exporting.js'
+
+let dgbChartDialog
+
+const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
+
+class DgbCharts extends LitElement {
+ static get properties() {
+ return {
+ isLoadingTradesChart: { type: Boolean },
+ dgbTrades: { type: Array },
+ dgbPrice: { type: Array }
+ }
+ }
+
+ static get styles() {
+ return css`
+ .loadingContainer {
+ height: 100%;
+ width: 100%;
+ }
+
+ .trades-chart {
+ color: var(--black);
+ background: var(--white);
+ border: 1px solid var(--black);
+ border-radius: 25px;
+ padding: 15px;
+ }
+
+ .chart-container {
+ margin: auto;
+ color: var(--black);
+ text-align: center;
+ padding: 15px;
+ height: 30vh;
+ width: 80vw;
+ }
+
+ .chart-info-wrapper {
+ background: transparent;
+ height: 38vh;
+ width: 83vw;
+ overflow: auto;
+ }
+
+ .chart-loading-wrapper {
+ color: var(--black);
+ background: var(--white);
+ border: 1px solid var(--black);
+ border-radius: 15px;
+ }
+ `
+ }
+
+ constructor() {
+ super()
+ this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light'
+ this.isLoadingTradesChart = false
+ this.dgbTrades = []
+ this.dgbPrice = []
+ }
+
+ render() {
+ return html`
+
+
+ ${translate("login.loading")}
+
+
+
+
+
+ `
+ }
+
+ async firstUpdated() {
+ this.changeTheme()
+ this.changeLanguage()
+
+ window.addEventListener('storage', () => {
+ const checkLanguage = localStorage.getItem('qortalLanguage')
+ const checkTheme = localStorage.getItem('qortalTheme')
+
+ use(checkLanguage)
+
+ this.theme = (checkTheme === 'dark') ? 'dark' : 'light'
+ document.querySelector('html').setAttribute('theme', this.theme)
+ })
+ }
+
+ async loadTradesChart() {
+ this.isLoadingTradesChart = true
+ this.shadowRoot.getElementById('loadChartDialog').open()
+ await this.getDgbTrades()
+ this.isLoadingTradesChart = false
+ this.shadowRoot.getElementById('loadChartDialog').close()
+ this.enableDgbStockPriceChart()
+ }
+
+ async getDgbTrades() {
+ let currentDgbTimestamp = Date.now()
+ const monthBackDgb = currentDgbTimestamp - 31556952000
+ await parentEpml.request("apiCall", { url: `/crosschain/trades?foreignBlockchain=DIGIBYTE&minimumTimestamp=${monthBackDgb}&limit=0&reverse=false` }).then((res) => {
+ this.dgbTrades = res
+ })
+ this.dgbPrice = this.dgbTrades.map(item => {
+ const dgbSellPrice = this.round(parseFloat(item.foreignAmount) / parseFloat(item.qortAmount))
+ return [item.tradeTimestamp, parseFloat(dgbSellPrice)]
+ }).filter(item => !!item)
+ }
+
+ enableDgbStockPriceChart() {
+ const dgbStockPriceData = this.dgbPrice
+ const header = 'QORT / DGB ' + get("tradepage.tchange49")
+ Highcharts.stockChart(this.shadowRoot.querySelector('#dgbStockPriceContainer'), {
+ accessibility: {
+ enabled: false
+ },
+ credits: {
+ enabled: false
+ },
+ rangeSelector: {
+ selected: 1,
+ labelStyle: {color: 'var(--black)'},
+ inputStyle: {color: '#03a9f4'}
+ },
+ chart: {
+ backgroundColor: 'transparent'
+ },
+ title: {
+ text: header,
+ style: {color: 'var(--black)'}
+ },
+ xAxis: {
+ labels: {
+ style: {
+ color: '#03a9f4'
+ }
+ }
+ },
+ yAxis: {
+ labels: {
+ style: {
+ color: '#03a9f4'
+ }
+ }
+ },
+ series: [{
+ name: 'QORT / DGB',
+ data: dgbStockPriceData,
+ tooltip: {
+ valueDecimals: 8
+ }
+ }]
+ })
+ }
+
+ async open() {
+ await this.loadTradesChart()
+ this.shadowRoot.getElementById('dgbChartDialog').open()
+ }
+
+ changeTheme() {
+ const checkTheme = localStorage.getItem('qortalTheme')
+ this.theme = (checkTheme === 'dark') ? 'dark' : 'light'
+ document.querySelector('html').setAttribute('theme', this.theme);
+ }
+
+ changeLanguage() {
+ const checkLanguage = localStorage.getItem('qortalLanguage')
+
+ if (checkLanguage === null || checkLanguage.length === 0) {
+ localStorage.setItem('qortalLanguage', 'us')
+ use('us')
+ } else {
+ use(checkLanguage)
+ }
+ }
+
+ round(number) {
+ let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
+ return result
+ }
+}
+
+window.customElements.define('dgb-charts', DgbCharts)
+
+const chartsdgb = document.createElement('dgb-charts')
+dgbChartDialog = document.body.appendChild(chartsdgb)
+
+export default dgbChartDialog
\ No newline at end of file
diff --git a/qortal-ui-plugins/plugins/core/trade-portal/charts/doge-charts.js b/qortal-ui-plugins/plugins/core/trade-portal/charts/doge-charts.js
new file mode 100644
index 00000000..a4267361
--- /dev/null
+++ b/qortal-ui-plugins/plugins/core/trade-portal/charts/doge-charts.js
@@ -0,0 +1,214 @@
+import { LitElement, html, css } from 'lit'
+import { render } from 'lit/html.js'
+import { Epml } from '../../../../epml.js'
+import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
+
+registerTranslateConfig({
+ loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
+})
+
+import '@polymer/paper-dialog/paper-dialog.js'
+import * as Highcharts from 'highcharts'
+import Exporting from 'highcharts/modules/exporting'
+Exporting(Highcharts)
+import StockChart from 'highcharts/modules/stock'
+StockChart(Highcharts)
+import 'highcharts/highcharts-more.js'
+import 'highcharts/modules/accessibility.js'
+import 'highcharts/modules/boost.js'
+import 'highcharts/modules/data.js'
+import 'highcharts/modules/export-data.js'
+import 'highcharts/modules/offline-exporting.js'
+
+let dogeChartDialog
+
+const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
+
+class DogeCharts extends LitElement {
+ static get properties() {
+ return {
+ isLoadingTradesChart: { type: Boolean },
+ dogeTrades: { type: Array },
+ dogePrice: { type: Array }
+ }
+ }
+
+ static get styles() {
+ return css`
+ .loadingContainer {
+ height: 100%;
+ width: 100%;
+ }
+
+ .trades-chart {
+ color: var(--black);
+ background: var(--white);
+ border: 1px solid var(--black);
+ border-radius: 25px;
+ padding: 15px;
+ }
+
+ .chart-container {
+ margin: auto;
+ color: var(--black);
+ text-align: center;
+ padding: 15px;
+ height: 30vh;
+ width: 80vw;
+ }
+
+ .chart-info-wrapper {
+ background: transparent;
+ height: 38vh;
+ width: 83vw;
+ overflow: auto;
+ }
+
+ .chart-loading-wrapper {
+ color: var(--black);
+ background: var(--white);
+ border: 1px solid var(--black);
+ border-radius: 15px;
+ }
+ `
+ }
+
+ constructor() {
+ super()
+ this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light'
+ this.isLoadingTradesChart = false
+ this.dogeTrades = []
+ this.dogePrice = []
+ }
+
+ render() {
+ return html`
+
+
+ ${translate("login.loading")}
+
+
+
+
+
+ `
+ }
+
+ async firstUpdated() {
+ this.changeTheme()
+ this.changeLanguage()
+
+ window.addEventListener('storage', () => {
+ const checkLanguage = localStorage.getItem('qortalLanguage')
+ const checkTheme = localStorage.getItem('qortalTheme')
+
+ use(checkLanguage)
+
+ this.theme = (checkTheme === 'dark') ? 'dark' : 'light'
+ document.querySelector('html').setAttribute('theme', this.theme)
+ })
+ }
+
+ async loadTradesChart() {
+ this.isLoadingTradesChart = true
+ this.shadowRoot.getElementById('loadChartDialog').open()
+ await this.getDogeTrades()
+ this.isLoadingTradesChart = false
+ this.shadowRoot.getElementById('loadChartDialog').close()
+ this.enableDogeStockPriceChart()
+ }
+
+ async getDogeTrades() {
+ let currentDogeTimestamp = Date.now()
+ const monthBackDoge = currentDogeTimestamp - 31556952000
+ await parentEpml.request("apiCall", { url: `/crosschain/trades?foreignBlockchain=DOGECOIN&minimumTimestamp=${monthBackDoge}&limit=0&reverse=false` }).then((res) => {
+ this.dogeTrades = res
+ })
+ this.dogePrice = this.dogeTrades.map(item => {
+ const dogeSellPrice = this.round(parseFloat(item.foreignAmount) / parseFloat(item.qortAmount))
+ return [item.tradeTimestamp, parseFloat(dogeSellPrice)]
+ }).filter(item => !!item)
+ }
+
+ enableDogeStockPriceChart() {
+ const dogeStockPriceData = this.dogePrice
+ const header = 'QORT / DOGE ' + get("tradepage.tchange49")
+ Highcharts.stockChart(this.shadowRoot.querySelector('#dogeStockPriceContainer'), {
+ accessibility: {
+ enabled: false
+ },
+ credits: {
+ enabled: false
+ },
+ rangeSelector: {
+ selected: 1,
+ labelStyle: {color: 'var(--black)'},
+ inputStyle: {color: '#03a9f4'}
+ },
+ chart: {
+ backgroundColor: 'transparent'
+ },
+ title: {
+ text: header,
+ style: {color: 'var(--black)'}
+ },
+ xAxis: {
+ labels: {
+ style: {
+ color: '#03a9f4'
+ }
+ }
+ },
+ yAxis: {
+ labels: {
+ style: {
+ color: '#03a9f4'
+ }
+ }
+ },
+ series: [{
+ name: 'QORT / DOGE',
+ data: dogeStockPriceData,
+ tooltip: {
+ valueDecimals: 8
+ }
+ }]
+ })
+ }
+
+ async open() {
+ await this.loadTradesChart()
+ this.shadowRoot.getElementById('dogeChartDialog').open()
+ }
+
+ changeTheme() {
+ const checkTheme = localStorage.getItem('qortalTheme')
+ this.theme = (checkTheme === 'dark') ? 'dark' : 'light'
+ document.querySelector('html').setAttribute('theme', this.theme);
+ }
+
+ changeLanguage() {
+ const checkLanguage = localStorage.getItem('qortalLanguage')
+
+ if (checkLanguage === null || checkLanguage.length === 0) {
+ localStorage.setItem('qortalLanguage', 'us')
+ use('us')
+ } else {
+ use(checkLanguage)
+ }
+ }
+
+ round(number) {
+ let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
+ return result
+ }
+}
+
+window.customElements.define('doge-charts', DogeCharts)
+
+const chartsdoge = document.createElement('doge-charts')
+dogeChartDialog = document.body.appendChild(chartsdoge)
+
+export default dogeChartDialog
\ No newline at end of file
diff --git a/qortal-ui-plugins/plugins/core/trade-portal/charts/ltc-charts.js b/qortal-ui-plugins/plugins/core/trade-portal/charts/ltc-charts.js
new file mode 100644
index 00000000..08ffd339
--- /dev/null
+++ b/qortal-ui-plugins/plugins/core/trade-portal/charts/ltc-charts.js
@@ -0,0 +1,214 @@
+import { LitElement, html, css } from 'lit'
+import { render } from 'lit/html.js'
+import { Epml } from '../../../../epml.js'
+import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
+
+registerTranslateConfig({
+ loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
+})
+
+import '@polymer/paper-dialog/paper-dialog.js'
+import * as Highcharts from 'highcharts'
+import Exporting from 'highcharts/modules/exporting'
+Exporting(Highcharts)
+import StockChart from 'highcharts/modules/stock'
+StockChart(Highcharts)
+import 'highcharts/highcharts-more.js'
+import 'highcharts/modules/accessibility.js'
+import 'highcharts/modules/boost.js'
+import 'highcharts/modules/data.js'
+import 'highcharts/modules/export-data.js'
+import 'highcharts/modules/offline-exporting.js'
+
+let ltcChartDialog
+
+const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
+
+class LtcCharts extends LitElement {
+ static get properties() {
+ return {
+ isLoadingTradesChart: { type: Boolean },
+ ltcTrades: { type: Array },
+ ltcPrice: { type: Array }
+ }
+ }
+
+ static get styles() {
+ return css`
+ .loadingContainer {
+ height: 100%;
+ width: 100%;
+ }
+
+ .trades-chart {
+ color: var(--black);
+ background: var(--white);
+ border: 1px solid var(--black);
+ border-radius: 25px;
+ padding: 15px;
+ }
+
+ .chart-container {
+ margin: auto;
+ color: var(--black);
+ text-align: center;
+ padding: 15px;
+ height: 30vh;
+ width: 80vw;
+ }
+
+ .chart-info-wrapper {
+ background: transparent;
+ height: 38vh;
+ width: 83vw;
+ overflow: auto;
+ }
+
+ .chart-loading-wrapper {
+ color: var(--black);
+ background: var(--white);
+ border: 1px solid var(--black);
+ border-radius: 15px;
+ }
+ `
+ }
+
+ constructor() {
+ super()
+ this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light'
+ this.isLoadingTradesChart = false
+ this.ltcTrades = []
+ this.ltcPrice = []
+ }
+
+ render() {
+ return html`
+
+
+ ${translate("login.loading")}
+
+
+
+
+
+ `
+ }
+
+ async firstUpdated() {
+ this.changeTheme()
+ this.changeLanguage()
+
+ window.addEventListener('storage', () => {
+ const checkLanguage = localStorage.getItem('qortalLanguage')
+ const checkTheme = localStorage.getItem('qortalTheme')
+
+ use(checkLanguage)
+
+ this.theme = (checkTheme === 'dark') ? 'dark' : 'light'
+ document.querySelector('html').setAttribute('theme', this.theme)
+ })
+ }
+
+ async loadTradesChart() {
+ this.isLoadingTradesChart = true
+ this.shadowRoot.getElementById('loadChartDialog').open()
+ await this.getLtcTrades()
+ this.isLoadingTradesChart = false
+ this.shadowRoot.getElementById('loadChartDialog').close()
+ this.enableLtcStockPriceChart()
+ }
+
+ async getLtcTrades() {
+ let currentLtcTimestamp = Date.now()
+ const monthBackLtc = currentLtcTimestamp - 31556952000
+ await parentEpml.request("apiCall", { url: `/crosschain/trades?foreignBlockchain=LITECOIN&minimumTimestamp=${monthBackLtc}&limit=0&reverse=false` }).then((res) => {
+ this.ltcTrades = res
+ })
+ this.ltcPrice = this.ltcTrades.map(item => {
+ const ltcSellPrice = this.round(parseFloat(item.foreignAmount) / parseFloat(item.qortAmount))
+ return [item.tradeTimestamp, parseFloat(ltcSellPrice)]
+ }).filter(item => !!item)
+ }
+
+ enableLtcStockPriceChart() {
+ const ltcStockPriceData = this.ltcPrice
+ const header = 'QORT / LTC ' + get("tradepage.tchange49")
+ Highcharts.stockChart(this.shadowRoot.querySelector('#ltcStockPriceContainer'), {
+ accessibility: {
+ enabled: false
+ },
+ credits: {
+ enabled: false
+ },
+ rangeSelector: {
+ selected: 1,
+ labelStyle: {color: 'var(--black)'},
+ inputStyle: {color: '#03a9f4'}
+ },
+ chart: {
+ backgroundColor: 'transparent'
+ },
+ title: {
+ text: header,
+ style: {color: 'var(--black)'}
+ },
+ xAxis: {
+ labels: {
+ style: {
+ color: '#03a9f4'
+ }
+ }
+ },
+ yAxis: {
+ labels: {
+ style: {
+ color: '#03a9f4'
+ }
+ }
+ },
+ series: [{
+ name: 'QORT / LTC',
+ data: ltcStockPriceData,
+ tooltip: {
+ valueDecimals: 8
+ }
+ }]
+ })
+ }
+
+ async open() {
+ await this.loadTradesChart()
+ this.shadowRoot.getElementById('ltcChartDialog').open()
+ }
+
+ changeTheme() {
+ const checkTheme = localStorage.getItem('qortalTheme')
+ this.theme = (checkTheme === 'dark') ? 'dark' : 'light'
+ document.querySelector('html').setAttribute('theme', this.theme);
+ }
+
+ changeLanguage() {
+ const checkLanguage = localStorage.getItem('qortalLanguage')
+
+ if (checkLanguage === null || checkLanguage.length === 0) {
+ localStorage.setItem('qortalLanguage', 'us')
+ use('us')
+ } else {
+ use(checkLanguage)
+ }
+ }
+
+ round(number) {
+ let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
+ return result
+ }
+}
+
+window.customElements.define('ltc-charts', LtcCharts)
+
+const chartsltc = document.createElement('ltc-charts')
+ltcChartDialog = document.body.appendChild(chartsltc)
+
+export default ltcChartDialog
\ No newline at end of file
diff --git a/qortal-ui-plugins/plugins/core/trade-portal/charts/rvn-charts.js b/qortal-ui-plugins/plugins/core/trade-portal/charts/rvn-charts.js
new file mode 100644
index 00000000..1110bdfc
--- /dev/null
+++ b/qortal-ui-plugins/plugins/core/trade-portal/charts/rvn-charts.js
@@ -0,0 +1,214 @@
+import { LitElement, html, css } from 'lit'
+import { render } from 'lit/html.js'
+import { Epml } from '../../../../epml.js'
+import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
+
+registerTranslateConfig({
+ loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
+})
+
+import '@polymer/paper-dialog/paper-dialog.js'
+import * as Highcharts from 'highcharts'
+import Exporting from 'highcharts/modules/exporting'
+Exporting(Highcharts)
+import StockChart from 'highcharts/modules/stock'
+StockChart(Highcharts)
+import 'highcharts/highcharts-more.js'
+import 'highcharts/modules/accessibility.js'
+import 'highcharts/modules/boost.js'
+import 'highcharts/modules/data.js'
+import 'highcharts/modules/export-data.js'
+import 'highcharts/modules/offline-exporting.js'
+
+let rvnChartDialog
+
+const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
+
+class RvnCharts extends LitElement {
+ static get properties() {
+ return {
+ isLoadingTradesChart: { type: Boolean },
+ rvnTrades: { type: Array },
+ rvnPrice: { type: Array }
+ }
+ }
+
+ static get styles() {
+ return css`
+ .loadingContainer {
+ height: 100%;
+ width: 100%;
+ }
+
+ .trades-chart {
+ color: var(--black);
+ background: var(--white);
+ border: 1px solid var(--black);
+ border-radius: 25px;
+ padding: 15px;
+ }
+
+ .chart-container {
+ margin: auto;
+ color: var(--black);
+ text-align: center;
+ padding: 15px;
+ height: 30vh;
+ width: 80vw;
+ }
+
+ .chart-info-wrapper {
+ background: transparent;
+ height: 38vh;
+ width: 83vw;
+ overflow: auto;
+ }
+
+ .chart-loading-wrapper {
+ color: var(--black);
+ background: var(--white);
+ border: 1px solid var(--black);
+ border-radius: 15px;
+ }
+ `
+ }
+
+ constructor() {
+ super()
+ this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light'
+ this.isLoadingTradesChart = false
+ this.rvnTrades = []
+ this.rvnPrice = []
+ }
+
+ render() {
+ return html`
+
+
+ ${translate("login.loading")}
+
+
+
+
+
+ `
+ }
+
+ async firstUpdated() {
+ this.changeTheme()
+ this.changeLanguage()
+
+ window.addEventListener('storage', () => {
+ const checkLanguage = localStorage.getItem('qortalLanguage')
+ const checkTheme = localStorage.getItem('qortalTheme')
+
+ use(checkLanguage)
+
+ this.theme = (checkTheme === 'dark') ? 'dark' : 'light'
+ document.querySelector('html').setAttribute('theme', this.theme)
+ })
+ }
+
+ async loadTradesChart() {
+ this.isLoadingTradesChart = true
+ this.shadowRoot.getElementById('loadChartDialog').open()
+ await this.getRvnTrades()
+ this.isLoadingTradesChart = false
+ this.shadowRoot.getElementById('loadChartDialog').close()
+ this.enableRvnStockPriceChart()
+ }
+
+ async getRvnTrades() {
+ let currentRvnTimestamp = Date.now()
+ const monthBackRvn = currentRvnTimestamp - 31556952000
+ await parentEpml.request("apiCall", { url: `/crosschain/trades?foreignBlockchain=RAVENCOIN&minimumTimestamp=${monthBackRvn}&limit=0&reverse=false` }).then((res) => {
+ this.rvnTrades = res
+ })
+ this.rvnPrice = this.rvnTrades.map(item => {
+ const rvnSellPrice = this.round(parseFloat(item.foreignAmount) / parseFloat(item.qortAmount))
+ return [item.tradeTimestamp, parseFloat(rvnSellPrice)]
+ }).filter(item => !!item)
+ }
+
+ enableRvnStockPriceChart() {
+ const rvnStockPriceData = this.rvnPrice
+ const header = 'QORT / RVN ' + get("tradepage.tchange49")
+ Highcharts.stockChart(this.shadowRoot.querySelector('#rvnStockPriceContainer'), {
+ accessibility: {
+ enabled: false
+ },
+ credits: {
+ enabled: false
+ },
+ rangeSelector: {
+ selected: 1,
+ labelStyle: {color: 'var(--black)'},
+ inputStyle: {color: '#03a9f4'}
+ },
+ chart: {
+ backgroundColor: 'transparent'
+ },
+ title: {
+ text: header,
+ style: {color: 'var(--black)'}
+ },
+ xAxis: {
+ labels: {
+ style: {
+ color: '#03a9f4'
+ }
+ }
+ },
+ yAxis: {
+ labels: {
+ style: {
+ color: '#03a9f4'
+ }
+ }
+ },
+ series: [{
+ name: 'QORT / RVN',
+ data: rvnStockPriceData,
+ tooltip: {
+ valueDecimals: 8
+ }
+ }]
+ })
+ }
+
+ async open() {
+ await this.loadTradesChart()
+ this.shadowRoot.getElementById('rvnChartDialog').open()
+ }
+
+ changeTheme() {
+ const checkTheme = localStorage.getItem('qortalTheme')
+ this.theme = (checkTheme === 'dark') ? 'dark' : 'light'
+ document.querySelector('html').setAttribute('theme', this.theme);
+ }
+
+ changeLanguage() {
+ const checkLanguage = localStorage.getItem('qortalLanguage')
+
+ if (checkLanguage === null || checkLanguage.length === 0) {
+ localStorage.setItem('qortalLanguage', 'us')
+ use('us')
+ } else {
+ use(checkLanguage)
+ }
+ }
+
+ round(number) {
+ let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
+ return result
+ }
+}
+
+window.customElements.define('rvn-charts', RvnCharts)
+
+const chartsrvn = document.createElement('rvn-charts')
+rvnChartDialog = document.body.appendChild(chartsrvn)
+
+export default rvnChartDialog
\ No newline at end of file
From df9dcd20f942ed106dc5b2669f7648cd12fbf76c Mon Sep 17 00:00:00 2001
From: AlphaX-Projects <77661270+AlphaX-Projects@users.noreply.github.com>
Date: Mon, 9 Jan 2023 15:09:00 +0100
Subject: [PATCH 14/14] Added charts
---
qortal-ui-core/language/de.json | 3 +-
qortal-ui-core/language/es.json | 3 +-
qortal-ui-core/language/fr.json | 3 +-
qortal-ui-core/language/hindi.json | 3 +-
qortal-ui-core/language/hr.json | 3 +-
qortal-ui-core/language/hu.json | 3 +-
qortal-ui-core/language/it.json | 3 +-
qortal-ui-core/language/ko.json | 3 +-
qortal-ui-core/language/no.json | 3 +-
qortal-ui-core/language/pl.json | 3 +-
qortal-ui-core/language/pt.json | 3 +-
qortal-ui-core/language/ro.json | 3 +-
qortal-ui-core/language/rs.json | 3 +-
qortal-ui-core/language/ru.json | 3 +-
qortal-ui-core/language/us.json | 3 +-
qortal-ui-core/language/zhc.json | 3 +-
qortal-ui-core/language/zht.json | 3 +-
.../core/trade-portal/trade-portal.src.js | 48 ++++++++++++++++---
18 files changed, 75 insertions(+), 24 deletions(-)
diff --git a/qortal-ui-core/language/de.json b/qortal-ui-core/language/de.json
index cedb6452..518cab5c 100644
--- a/qortal-ui-core/language/de.json
+++ b/qortal-ui-core/language/de.json
@@ -333,7 +333,8 @@
"tchange45":"AUTO KAUFEN MIT",
"tchange46":"AUTOKAUF",
"tchange47":"Verkaufe für diesen Preis",
- "tchange48":"NICHT GENUG"
+ "tchange48":"NICHT GENUG",
+ "tchange49":"Preisdiagramm"
},
"rewardsharepage":{
"rchange1":"Belohnungsanteile",
diff --git a/qortal-ui-core/language/es.json b/qortal-ui-core/language/es.json
index adf6d85c..eab3f6d0 100644
--- a/qortal-ui-core/language/es.json
+++ b/qortal-ui-core/language/es.json
@@ -333,7 +333,8 @@
"tchange45":"AUTO COMPRAR CON",
"tchange46":"COMPRA AUTOMÁTICA",
"tchange47":"Vender por este precio",
- "tchange48":"NO ES SUFICIENTE"
+ "tchange48":"NO ES SUFICIENTE",
+ "tchange49":"Gráfico de precios"
},
"rewardsharepage":{
"rchange1":"Rewardshares",
diff --git a/qortal-ui-core/language/fr.json b/qortal-ui-core/language/fr.json
index 86b02d49..f22be6c5 100644
--- a/qortal-ui-core/language/fr.json
+++ b/qortal-ui-core/language/fr.json
@@ -333,7 +333,8 @@
"tchange45":"ACHAT AUTO AVEC",
"tchange46":"ACHAT AUTOMATIQUE",
"tchange47":"Vendre à ce prix",
- "tchange48":"PAS ASSEZ"
+ "tchange48":"PAS ASSEZ",
+ "tchange49":"Tableau des prix"
},
"rewardsharepage":{
"rchange1":"Récompenses",
diff --git a/qortal-ui-core/language/hindi.json b/qortal-ui-core/language/hindi.json
index e82ab1b0..617a2b64 100644
--- a/qortal-ui-core/language/hindi.json
+++ b/qortal-ui-core/language/hindi.json
@@ -334,7 +334,8 @@
"tchange45":"ऑटो के साथ खरीदें",
"tchange46":"ऑटो खरीदें",
"tchange47":"इस कीमत पर बेचें",
- "tchange48":"पर्याप्त नहीं"
+ "tchange48":"पर्याप्त नहीं",
+ "tchange49":"मूल्य चार्ट"
},
"rewardsharepage":{
"rchange1":"रिवॉर्डशेयर",
diff --git a/qortal-ui-core/language/hr.json b/qortal-ui-core/language/hr.json
index 40689c8f..3b369348 100644
--- a/qortal-ui-core/language/hr.json
+++ b/qortal-ui-core/language/hr.json
@@ -333,7 +333,8 @@
"tchange45":"AUTO KUPITE SA",
"tchange46":"AUTO OTKUP",
"tchange47":"Prodaj za ovu cijenu",
- "tchange48":"NEDOVOLJNO"
+ "tchange48":"NEDOVOLJNO",
+ "tchange49":"Grafikon cijena"
},
"rewardsharepage":{
"rchange1":"Nagradni udio (Rewardshares)",
diff --git a/qortal-ui-core/language/hu.json b/qortal-ui-core/language/hu.json
index 7b57ad70..c30d020d 100644
--- a/qortal-ui-core/language/hu.json
+++ b/qortal-ui-core/language/hu.json
@@ -333,7 +333,8 @@
"tchange45":"AUTOMATIKUS VÁSÁRLÁS",
"tchange46":"AUTOMATIKUS VÁSÁRLÁS",
"tchange47":"Eladni ezen az áron",
- "tchange48":"NEM ELÉG"
+ "tchange48":"NEM ELÉG",
+ "tchange49":"Árdiagram"
},
"rewardsharepage":{
"rchange1":"Jutalommegosztások",
diff --git a/qortal-ui-core/language/it.json b/qortal-ui-core/language/it.json
index e669f6de..6efe10d4 100644
--- a/qortal-ui-core/language/it.json
+++ b/qortal-ui-core/language/it.json
@@ -333,7 +333,8 @@
"tchange45":"ACQUISTA AUTO CON",
"tchange46":"ACQUISTO AUTO",
"tchange47":"Vendi a questo prezzo",
- "tchange48":"NON ABBASTANZA"
+ "tchange48":"NON ABBASTANZA",
+ "tchange49":"Tabella dei prezzi"
},
"rewardsharepage":{
"rchange1":"Quote di ricompensa",
diff --git a/qortal-ui-core/language/ko.json b/qortal-ui-core/language/ko.json
index 4eed1cbc..2dc9b4d6 100644
--- a/qortal-ui-core/language/ko.json
+++ b/qortal-ui-core/language/ko.json
@@ -333,7 +333,8 @@
"tchange45":"자동 구매",
"tchange46":"자동 구매",
"tchange47":"이 가격에 팔아요",
- "tchange48":"부족한"
+ "tchange48":"부족한",
+ "tchange49":"가격 차트"
},
"rewardsharepage":{
"rchange1":"보상 공유",
diff --git a/qortal-ui-core/language/no.json b/qortal-ui-core/language/no.json
index 7795fa96..85054308 100644
--- a/qortal-ui-core/language/no.json
+++ b/qortal-ui-core/language/no.json
@@ -333,7 +333,8 @@
"tchange45":"AUTOKJØP MED",
"tchange46":"AUTOKJØP",
"tchange47":"Selges for denne prisen",
- "tchange48":"IKKE NOK"
+ "tchange48":"IKKE NOK",
+ "tchange49":"Prisdiagram"
},
"rewardsharepage":{
"rchange1":"Belønningsdel",
diff --git a/qortal-ui-core/language/pl.json b/qortal-ui-core/language/pl.json
index 5fbd3224..0b3ef019 100644
--- a/qortal-ui-core/language/pl.json
+++ b/qortal-ui-core/language/pl.json
@@ -333,7 +333,8 @@
"tchange45":"AUTO KUP Z",
"tchange46":"AUTO KUP",
"tchange47":"Sprzedaj za tę cenę",
- "tchange48":"NIEWYSTARCZAJĄCO"
+ "tchange48":"NIEWYSTARCZAJĄCO",
+ "tchange49":"Tabela cen"
},
"rewardsharepage":{
"rchange1":"Podział nagród",
diff --git a/qortal-ui-core/language/pt.json b/qortal-ui-core/language/pt.json
index c731226f..41e55557 100644
--- a/qortal-ui-core/language/pt.json
+++ b/qortal-ui-core/language/pt.json
@@ -333,7 +333,8 @@
"tchange45":"COMPRA AUTOMÁTICA COM",
"tchange46":"COMPRA AUTOMÁTICA",
"tchange47":"Vendo por este preço",
- "tchange48":"INSUFICIENTE"
+ "tchange48":"INSUFICIENTE",
+ "tchange49":"Tabela de preços"
},
"rewardsharepage":{
"rchange1":"Ações de recompensa",
diff --git a/qortal-ui-core/language/ro.json b/qortal-ui-core/language/ro.json
index 60bce846..29efe5b0 100644
--- a/qortal-ui-core/language/ro.json
+++ b/qortal-ui-core/language/ro.json
@@ -333,7 +333,8 @@
"tchange45":"CUMPARA AUTOMATA CU",
"tchange46":"CUMPARARE AUTOMATA",
"tchange47":"Vinde la acest pret",
- "tchange48":"INSUFICIENT"
+ "tchange48":"INSUFICIENT",
+ "tchange49":"Diagrama prețurilor"
},
"rewardsharepage":{
"rchange1":"Cote de recompensa",
diff --git a/qortal-ui-core/language/rs.json b/qortal-ui-core/language/rs.json
index c7ad6d88..ccd07326 100644
--- a/qortal-ui-core/language/rs.json
+++ b/qortal-ui-core/language/rs.json
@@ -333,7 +333,8 @@
"tchange45":"AUTO KUPI SA",
"tchange46":"AUTO BUI",
"tchange47":"Prodaj za ovu cenu",
- "tchange48":"NEDOVOLJNO"
+ "tchange48":"NEDOVOLJNO",
+ "tchange49":"Grafik cena"
},
"rewardsharepage":{
"rchange1":"Udeo nagrade",
diff --git a/qortal-ui-core/language/ru.json b/qortal-ui-core/language/ru.json
index abad841f..b7539374 100644
--- a/qortal-ui-core/language/ru.json
+++ b/qortal-ui-core/language/ru.json
@@ -333,7 +333,8 @@
"tchange45":"АВТО КУПИТЬ С",
"tchange46":"АВТО КУПИТЬ",
"tchange47":"Продать по этой цене",
- "tchange48":"НЕДОСТАТОЧНО"
+ "tchange48":"НЕДОСТАТОЧНО",
+ "tchange49":"График цен"
},
"rewardsharepage":{
"rchange1":"Вознаграждения",
diff --git a/qortal-ui-core/language/us.json b/qortal-ui-core/language/us.json
index 580d0549..e0444893 100644
--- a/qortal-ui-core/language/us.json
+++ b/qortal-ui-core/language/us.json
@@ -333,7 +333,8 @@
"tchange45":"AUTO BUY WITH",
"tchange46":"AUTO BUY",
"tchange47":"Sell for this price",
- "tchange48":"NOT ENOUGH"
+ "tchange48":"NOT ENOUGH",
+ "tchange49":"Price Chart"
},
"rewardsharepage":{
"rchange1":"Rewardshares",
diff --git a/qortal-ui-core/language/zhc.json b/qortal-ui-core/language/zhc.json
index b41114a8..b2b1a6b4 100644
--- a/qortal-ui-core/language/zhc.json
+++ b/qortal-ui-core/language/zhc.json
@@ -333,7 +333,8 @@
"tchange45":"自动购买",
"tchange46":"自动购买",
"tchange47":"以这个价格出售",
- "tchange48":"不够"
+ "tchange48":"不够",
+ "tchange49":"价格图表"
},
"rewardsharepage":{
"rchange1":"铸币密钥",
diff --git a/qortal-ui-core/language/zht.json b/qortal-ui-core/language/zht.json
index 52fa5400..2c5c86f3 100644
--- a/qortal-ui-core/language/zht.json
+++ b/qortal-ui-core/language/zht.json
@@ -333,7 +333,8 @@
"tchange45":"自動購買",
"tchange46":"自動購買",
"tchange47":"以這個價格出售",
- "tchange48":"不夠"
+ "tchange48":"不夠",
+ "tchange49":"價格圖表"
},
"rewardsharepage":{
"rchange1":"鑄幣密鑰",
diff --git a/qortal-ui-plugins/plugins/core/trade-portal/trade-portal.src.js b/qortal-ui-plugins/plugins/core/trade-portal/trade-portal.src.js
index 47910961..bcfd5130 100644
--- a/qortal-ui-plugins/plugins/core/trade-portal/trade-portal.src.js
+++ b/qortal-ui-plugins/plugins/core/trade-portal/trade-portal.src.js
@@ -21,6 +21,12 @@ import '@polymer/paper-icon-button/paper-icon-button.js'
import '@polymer/paper-spinner/paper-spinner-lite.js'
import '@vaadin/grid'
import '@vaadin/grid/vaadin-grid-sorter'
+import chartsbtc from './charts/btc-charts.js'
+import chartsltc from './charts/ltc-charts.js'
+import chartsdoge from './charts/doge-charts.js'
+import chartsdgb from './charts/dgb-charts.js'
+import chartsrvn from './charts/rvn-charts.js'
+import chartsarrr from './charts/arrr-charts.js'
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
@@ -74,7 +80,7 @@ class TradePortal extends LitElement {
displayTradeAddress: { type: String },
displayTradeLevel: { type: String },
displayTradeBalance: { type: String },
- qortRatio: {type: Number}
+ qortRatio: {type: Number}
}
}
@@ -494,7 +500,7 @@ class TradePortal extends LitElement {
.rvn.coinName:before {
background-image: url('/img/qortrvn.png');
}
- .arrr.coinName:before {
+ .arrr.coinName:before {
background-image: url('/img/qortarrr.png');
}
.coinName {
@@ -655,7 +661,7 @@ class TradePortal extends LitElement {
tradeFee: "~0.0005"
}
- let ravencoin = {
+ let ravencoin = {
name: "RAVENCOIN",
balance: "0",
coinCode: "RVN",
@@ -721,7 +727,7 @@ class TradePortal extends LitElement {
handleStuckTradesConnectedWorker: null
})
- workers.set("RAVENCOIN", {
+ workers.set("RAVENCOIN", {
tradesConnectedWorker: null,
handleStuckTradesConnectedWorker: null
})
@@ -1162,6 +1168,9 @@ class TradePortal extends LitElement {
QORT / RVN
QORT / ARRR
+
+ ${this.chartShowCoin()}
+