mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-02-11 17:55:51 +00:00
Inline variables ( reduce redudancy )
This commit is contained in:
parent
42201341c1
commit
5f0c57d8e9
@ -1,12 +1,12 @@
|
||||
import { css, html, LitElement } from 'lit'
|
||||
import { connect } from 'pwa-helpers'
|
||||
import { store } from '../store.js'
|
||||
import { Epml } from '../epml.js'
|
||||
import { addTradeBotRoutes } from '../tradebot/addTradeBotRoutes.js'
|
||||
import { get, translate } from '../../translate'
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {connect} from 'pwa-helpers'
|
||||
import {store} from '../store.js'
|
||||
import {Epml} from '../epml.js'
|
||||
import {addTradeBotRoutes} from '../tradebot/addTradeBotRoutes.js'
|
||||
import {get, translate} from '../../translate'
|
||||
import localForage from 'localforage'
|
||||
import { decryptData, encryptData } from '../lockScreen.js'
|
||||
import { setChatLastSeen } from '../redux/app/app-actions.js'
|
||||
import {decryptData, encryptData} from '../lockScreen.js'
|
||||
import {setChatLastSeen} from '../redux/app/app-actions.js'
|
||||
import isElectron from 'is-electron'
|
||||
import '@material/mwc-button'
|
||||
import '@material/mwc-icon'
|
||||
@ -746,7 +746,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
drawerTog.click()
|
||||
})
|
||||
|
||||
this.getNodeType()
|
||||
await this.getNodeType()
|
||||
|
||||
const myAppNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
|
||||
const nodeAppUrl = myAppNode.protocol + '://' + myAppNode.domain + ':' + myAppNode.port
|
||||
@ -915,7 +915,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
|
||||
await filterOpenOfferBTC()
|
||||
await appDelay(1000)
|
||||
filterMyBotPriceTradesBTC()
|
||||
await filterMyBotPriceTradesBTC()
|
||||
setTimeout(getOpenTradesBTC, 150000)
|
||||
}
|
||||
}
|
||||
@ -923,11 +923,9 @@ class AppView extends connect(store)(LitElement) {
|
||||
const filterMyBotPriceTradesBTC = async () => {
|
||||
const tradeBotBtcUrl = `${nodeAppUrl}/crosschain/tradebot?foreignBlockchain=BITCOIN&apiKey=${this.getApiKey()}`
|
||||
|
||||
const tradeBotBtcAt = await fetch(tradeBotBtcUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
this.tradeBotBtcAt = tradeBotBtcAt
|
||||
this.tradeBotBtcAt = await fetch(tradeBotBtcUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
await appDelay(1000)
|
||||
|
||||
@ -996,7 +994,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
|
||||
await appDelay(1000)
|
||||
|
||||
this.buyBtcAction()
|
||||
await this.buyBtcAction()
|
||||
|
||||
if (this.isEmptyArray(this.tradeBotBtcBook) === true) {
|
||||
return
|
||||
@ -1112,7 +1110,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
|
||||
await filterOpenOfferLTC()
|
||||
await appDelay(1000)
|
||||
filterMyBotPriceTradesLTC()
|
||||
await filterMyBotPriceTradesLTC()
|
||||
setTimeout(getOpenTradesLTC, 150000)
|
||||
}
|
||||
}
|
||||
@ -1120,11 +1118,9 @@ class AppView extends connect(store)(LitElement) {
|
||||
const filterMyBotPriceTradesLTC = async () => {
|
||||
const tradeBotLtcUrl = `${nodeAppUrl}/crosschain/tradebot?foreignBlockchain=LITECOIN&apiKey=${this.getApiKey()}`
|
||||
|
||||
const tradeBotLtcAt = await fetch(tradeBotLtcUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
this.tradeBotLtcAt = tradeBotLtcAt
|
||||
this.tradeBotLtcAt = await fetch(tradeBotLtcUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
await appDelay(1000)
|
||||
|
||||
@ -1193,7 +1189,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
|
||||
await appDelay(1000)
|
||||
|
||||
this.buyLtcAction()
|
||||
await this.buyLtcAction()
|
||||
|
||||
if (this.isEmptyArray(this.tradeBotLtcBook) === true) {
|
||||
return
|
||||
@ -1298,7 +1294,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
|
||||
await filterOpenOfferDOGE()
|
||||
await appDelay(1000)
|
||||
filterMyBotPriceTradesDOGE()
|
||||
await filterMyBotPriceTradesDOGE()
|
||||
setTimeout(getOpenTradesDOGE, 150000)
|
||||
}
|
||||
}
|
||||
@ -1306,11 +1302,9 @@ class AppView extends connect(store)(LitElement) {
|
||||
const filterMyBotPriceTradesDOGE = async () => {
|
||||
const tradeBotDogeUrl = `${nodeAppUrl}/crosschain/tradebot?foreignBlockchain=DOGECOIN&apiKey=${this.getApiKey()}`
|
||||
|
||||
const tradeBotDogeAt = await fetch(tradeBotDogeUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
this.tradeBotDogeAt = tradeBotDogeAt
|
||||
this.tradeBotDogeAt = await fetch(tradeBotDogeUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
await appDelay(1000)
|
||||
|
||||
@ -1379,7 +1373,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
|
||||
await appDelay(1000)
|
||||
|
||||
this.buyDogeAction()
|
||||
await this.buyDogeAction()
|
||||
|
||||
if (this.isEmptyArray(this.tradeBotDogeBook) === true) {
|
||||
return
|
||||
@ -1484,7 +1478,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
|
||||
await filterOpenOfferDGB()
|
||||
await appDelay(1000)
|
||||
filterMyBotPriceTradesDGB()
|
||||
await filterMyBotPriceTradesDGB()
|
||||
setTimeout(getOpenTradesDGB, 150000)
|
||||
}
|
||||
}
|
||||
@ -1492,11 +1486,9 @@ class AppView extends connect(store)(LitElement) {
|
||||
const filterMyBotPriceTradesDGB = async () => {
|
||||
const tradeBotDgbUrl = `${nodeAppUrl}/crosschain/tradebot?foreignBlockchain=DIGIBYTE&apiKey=${this.getApiKey()}`
|
||||
|
||||
const tradeBotDgbAt = await fetch(tradeBotDgbUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
this.tradeBotDgbAt = tradeBotDgbAt
|
||||
this.tradeBotDgbAt = await fetch(tradeBotDgbUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
await appDelay(1000)
|
||||
|
||||
@ -1565,7 +1557,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
|
||||
await appDelay(1000)
|
||||
|
||||
this.buyDgbAction()
|
||||
await this.buyDgbAction()
|
||||
|
||||
if (this.isEmptyArray(this.tradeBotDgbBook) === true) {
|
||||
return
|
||||
@ -1670,7 +1662,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
|
||||
await filterOpenOfferRVN()
|
||||
await appDelay(1000)
|
||||
filterMyBotPriceTradesRVN()
|
||||
await filterMyBotPriceTradesRVN()
|
||||
setTimeout(getOpenTradesRVN, 150000)
|
||||
}
|
||||
}
|
||||
@ -1678,11 +1670,9 @@ class AppView extends connect(store)(LitElement) {
|
||||
const filterMyBotPriceTradesRVN = async () => {
|
||||
const tradeBotRvnUrl = `${nodeAppUrl}/crosschain/tradebot?foreignBlockchain=RAVENCOIN&apiKey=${this.getApiKey()}`
|
||||
|
||||
const tradeBotRvnAt = await fetch(tradeBotRvnUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
this.tradeBotRvnAt = tradeBotRvnAt
|
||||
this.tradeBotRvnAt = await fetch(tradeBotRvnUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
await appDelay(1000)
|
||||
|
||||
@ -1751,7 +1741,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
|
||||
await appDelay(1000)
|
||||
|
||||
this.buyRvnAction()
|
||||
await this.buyRvnAction()
|
||||
|
||||
if (this.isEmptyArray(this.tradeBotRvnBook) === true) {
|
||||
return
|
||||
@ -1856,7 +1846,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
|
||||
await filterOpenOfferARRR()
|
||||
await appDelay(1000)
|
||||
filterMyBotPriceTradesARRR()
|
||||
await filterMyBotPriceTradesARRR()
|
||||
setTimeout(getOpenTradesARRR, 150000)
|
||||
}
|
||||
}
|
||||
@ -1864,11 +1854,9 @@ class AppView extends connect(store)(LitElement) {
|
||||
const filterMyBotPriceTradesARRR = async () => {
|
||||
const tradeBotArrrUrl = `${nodeAppUrl}/crosschain/tradebot?foreignBlockchain=PIRATECHAIN&apiKey=${this.getApiKey()}`
|
||||
|
||||
const tradeBotArrrAt = await fetch(tradeBotArrrUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
this.tradeBotArrrAt = tradeBotArrrAt
|
||||
this.tradeBotArrrAt = await fetch(tradeBotArrrUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
await appDelay(1000)
|
||||
|
||||
@ -1937,7 +1925,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
|
||||
await appDelay(1000)
|
||||
|
||||
this.buyArrrAction()
|
||||
await this.buyArrrAction()
|
||||
|
||||
if (this.isEmptyArray(this.tradeBotArrrBook) === true) {
|
||||
return
|
||||
@ -2451,12 +2439,11 @@ class AppView extends connect(store)(LitElement) {
|
||||
|
||||
async buyBtcAction() {
|
||||
const makeRequest = async () => {
|
||||
const response = await parentEpml.request('tradeBotRespondRequest', {
|
||||
atAddress: this.botBtcBuyAtAddress,
|
||||
foreignKey: store.getState().app.selectedAddress.btcWallet.derivedMasterPrivateKey,
|
||||
receivingAddress: store.getState().app.selectedAddress.address,
|
||||
})
|
||||
return response
|
||||
return await parentEpml.request('tradeBotRespondRequest', {
|
||||
atAddress: this.botBtcBuyAtAddress,
|
||||
foreignKey: store.getState().app.selectedAddress.btcWallet.derivedMasterPrivateKey,
|
||||
receivingAddress: store.getState().app.selectedAddress.address,
|
||||
})
|
||||
}
|
||||
|
||||
const manageResponse = (response) => {
|
||||
@ -2509,12 +2496,11 @@ class AppView extends connect(store)(LitElement) {
|
||||
|
||||
async buyLtcAction() {
|
||||
const makeRequest = async () => {
|
||||
const response = await parentEpml.request('tradeBotRespondRequest', {
|
||||
atAddress: this.botLtcBuyAtAddress,
|
||||
foreignKey: store.getState().app.selectedAddress.ltcWallet.derivedMasterPrivateKey,
|
||||
receivingAddress: store.getState().app.selectedAddress.address,
|
||||
})
|
||||
return response
|
||||
return await parentEpml.request('tradeBotRespondRequest', {
|
||||
atAddress: this.botLtcBuyAtAddress,
|
||||
foreignKey: store.getState().app.selectedAddress.ltcWallet.derivedMasterPrivateKey,
|
||||
receivingAddress: store.getState().app.selectedAddress.address,
|
||||
})
|
||||
}
|
||||
|
||||
const manageResponse = (response) => {
|
||||
@ -2567,12 +2553,11 @@ class AppView extends connect(store)(LitElement) {
|
||||
|
||||
async buyDogeAction() {
|
||||
const makeRequest = async () => {
|
||||
const response = await parentEpml.request('tradeBotRespondRequest', {
|
||||
atAddress: this.botDogeBuyAtAddress,
|
||||
foreignKey: store.getState().app.selectedAddress.dogeWallet.derivedMasterPrivateKey,
|
||||
receivingAddress: store.getState().app.selectedAddress.address,
|
||||
})
|
||||
return response
|
||||
return await parentEpml.request('tradeBotRespondRequest', {
|
||||
atAddress: this.botDogeBuyAtAddress,
|
||||
foreignKey: store.getState().app.selectedAddress.dogeWallet.derivedMasterPrivateKey,
|
||||
receivingAddress: store.getState().app.selectedAddress.address,
|
||||
})
|
||||
}
|
||||
|
||||
const manageResponse = (response) => {
|
||||
@ -2625,12 +2610,11 @@ class AppView extends connect(store)(LitElement) {
|
||||
|
||||
async buyDgbAction() {
|
||||
const makeRequest = async () => {
|
||||
const response = await parentEpml.request('tradeBotRespondRequest', {
|
||||
atAddress: this.botDgbBuyAtAddress,
|
||||
foreignKey: store.getState().app.selectedAddress.dgbWallet.derivedMasterPrivateKey,
|
||||
receivingAddress: store.getState().app.selectedAddress.address,
|
||||
})
|
||||
return response
|
||||
return await parentEpml.request('tradeBotRespondRequest', {
|
||||
atAddress: this.botDgbBuyAtAddress,
|
||||
foreignKey: store.getState().app.selectedAddress.dgbWallet.derivedMasterPrivateKey,
|
||||
receivingAddress: store.getState().app.selectedAddress.address,
|
||||
})
|
||||
}
|
||||
|
||||
const manageResponse = (response) => {
|
||||
@ -2683,12 +2667,11 @@ class AppView extends connect(store)(LitElement) {
|
||||
|
||||
async buyRvnAction() {
|
||||
const makeRequest = async () => {
|
||||
const response = await parentEpml.request('tradeBotRespondRequest', {
|
||||
atAddress: this.botRvnBuyAtAddress,
|
||||
foreignKey: store.getState().app.selectedAddress.rvnWallet.derivedMasterPrivateKey,
|
||||
receivingAddress: store.getState().app.selectedAddress.address,
|
||||
})
|
||||
return response
|
||||
return await parentEpml.request('tradeBotRespondRequest', {
|
||||
atAddress: this.botRvnBuyAtAddress,
|
||||
foreignKey: store.getState().app.selectedAddress.rvnWallet.derivedMasterPrivateKey,
|
||||
receivingAddress: store.getState().app.selectedAddress.address,
|
||||
})
|
||||
}
|
||||
|
||||
const manageResponse = (response) => {
|
||||
@ -2741,12 +2724,11 @@ class AppView extends connect(store)(LitElement) {
|
||||
|
||||
async buyArrrAction() {
|
||||
const makeRequest = async () => {
|
||||
const response = await parentEpml.request('tradeBotRespondRequest', {
|
||||
atAddress: this.botArrrBuyAtAddress,
|
||||
foreignKey: store.getState().app.selectedAddress.arrrWallet.seed58,
|
||||
receivingAddress: store.getState().app.selectedAddress.address,
|
||||
})
|
||||
return response
|
||||
return await parentEpml.request('tradeBotRespondRequest', {
|
||||
atAddress: this.botArrrBuyAtAddress,
|
||||
foreignKey: store.getState().app.selectedAddress.arrrWallet.seed58,
|
||||
receivingAddress: store.getState().app.selectedAddress.address,
|
||||
})
|
||||
}
|
||||
|
||||
const manageResponse = (response) => {
|
||||
@ -3348,8 +3330,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
|
||||
getApiKey() {
|
||||
const apiNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
|
||||
let apiKey = apiNode.apiKey
|
||||
return apiKey
|
||||
return apiNode.apiKey
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
@ -3360,8 +3341,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
}
|
||||
|
||||
round(number) {
|
||||
let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
return result
|
||||
return (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { LitElement, html, css } from 'lit'
|
||||
import { store } from '../../store'
|
||||
import { connect } from 'pwa-helpers'
|
||||
import { translate } from '../../../translate'
|
||||
import { parentEpml } from '../show-plugin'
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {store} from '../../store'
|
||||
import {connect} from 'pwa-helpers'
|
||||
import {translate} from '../../../translate'
|
||||
import {parentEpml} from '../show-plugin'
|
||||
|
||||
import '@material/mwc-icon'
|
||||
|
||||
@ -89,11 +89,9 @@ class SyncIndicator extends connect(store)(LitElement) {
|
||||
async firstUpdated() {
|
||||
this.address = store.getState().app.selectedAddress.address
|
||||
|
||||
const seenWelcomeSync = JSON.parse(
|
||||
this.seenWelcomeSync = JSON.parse(
|
||||
localStorage.getItem(`welcome-sync-${this.address}`) || 'false'
|
||||
)
|
||||
|
||||
this.seenWelcomeSync = seenWelcomeSync
|
||||
}
|
||||
|
||||
getNodeUrl() {
|
||||
@ -102,17 +100,13 @@ class SyncIndicator extends connect(store)(LitElement) {
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
]
|
||||
|
||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
return nodeUrl
|
||||
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
}
|
||||
|
||||
getMyNode() {
|
||||
const myNode =
|
||||
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
return window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
]
|
||||
|
||||
return myNode
|
||||
}
|
||||
|
||||
async getDaySummary() {
|
||||
@ -147,7 +141,7 @@ class SyncIndicator extends connect(store)(LitElement) {
|
||||
|
||||
async checkHowManyBlocksBehind() {
|
||||
try {
|
||||
this.getDaySummary();
|
||||
await this.getDaySummary();
|
||||
this.interval = setInterval(() => {
|
||||
if(this.fetchingSummary) return
|
||||
if (this.isBehind === false) {
|
||||
|
@ -1,16 +1,17 @@
|
||||
import { LitElement, html, css } from 'lit';
|
||||
import { driver } from 'driver.js';
|
||||
import {css, html, LitElement} from 'lit';
|
||||
import {driver} from 'driver.js';
|
||||
import 'driver.js/dist/driver.css';
|
||||
import '@material/mwc-icon';
|
||||
import '@polymer/paper-spinner/paper-spinner-lite.js';
|
||||
import '@vaadin/tooltip';
|
||||
import '@material/mwc-button';
|
||||
import { get, translate } from '../../../translate';
|
||||
import {get, translate} from '../../../translate';
|
||||
import '@polymer/paper-dialog/paper-dialog.js';
|
||||
import { setNewTab } from '../../redux/app/app-actions.js';
|
||||
import { store } from '../../store.js';
|
||||
import { connect } from 'pwa-helpers';
|
||||
import {setNewTab} from '../../redux/app/app-actions.js';
|
||||
import {store} from '../../store.js';
|
||||
import {connect} from 'pwa-helpers';
|
||||
import './tour.css';
|
||||
|
||||
class TourComponent extends connect(store)(LitElement) {
|
||||
static get properties() {
|
||||
return {
|
||||
@ -175,19 +176,14 @@ class TourComponent extends connect(store)(LitElement) {
|
||||
const myNode =
|
||||
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
]
|
||||
|
||||
const nodeUrl =
|
||||
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
||||
return nodeUrl;
|
||||
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
}
|
||||
getMyNode() {
|
||||
const myNode =
|
||||
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
|
||||
return myNode;
|
||||
return window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
]
|
||||
}
|
||||
|
||||
async getName(recipient) {
|
||||
|
@ -27,19 +27,14 @@ class CoinBalancesController extends connect(store)(LitElement) {
|
||||
const myNode =
|
||||
store.getState().app.nodeConfig.knownNodes[
|
||||
store.getState().app.nodeConfig.node
|
||||
];
|
||||
]
|
||||
|
||||
const nodeUrl =
|
||||
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
||||
return nodeUrl;
|
||||
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
}
|
||||
getMyNode() {
|
||||
const myNode =
|
||||
store.getState().app.nodeConfig.knownNodes[
|
||||
store.getState().app.nodeConfig.node
|
||||
];
|
||||
|
||||
return myNode;
|
||||
return store.getState().app.nodeConfig.knownNodes[
|
||||
store.getState().app.nodeConfig.node
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
@ -202,17 +202,12 @@ class AddFriendsModal extends connect(store)(LitElement) {
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
|
||||
const nodeUrl =
|
||||
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
||||
return nodeUrl;
|
||||
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
||||
}
|
||||
getMyNode() {
|
||||
const myNode =
|
||||
store.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
return store.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
|
||||
return myNode;
|
||||
}
|
||||
|
||||
clearFields() {
|
||||
@ -267,7 +262,7 @@ class AddFriendsModal extends connect(store)(LitElement) {
|
||||
changedProperties &&
|
||||
changedProperties.has('isOpen') && this.isOpen
|
||||
) {
|
||||
this.getAvailableFeedSchemas()
|
||||
await this.getAvailableFeedSchemas()
|
||||
}
|
||||
|
||||
}
|
||||
@ -281,11 +276,9 @@ class AddFriendsModal extends connect(store)(LitElement) {
|
||||
if (data.error === 401) {
|
||||
this.availableFeeedSchemas = [];
|
||||
} else {
|
||||
const result = data.filter(
|
||||
this.availableFeeedSchemas = data.filter(
|
||||
(item) => item.identifier === 'ui_schema_feed'
|
||||
);
|
||||
|
||||
this.availableFeeedSchemas = result;
|
||||
}
|
||||
this.userFoundModalOpen = true;
|
||||
} catch (error) {} finally {
|
||||
|
@ -1,13 +1,11 @@
|
||||
import { LitElement, html, css } from 'lit';
|
||||
import { get, translate } from '../../../translate'
|
||||
import {css, html, LitElement} from 'lit';
|
||||
import axios from 'axios';
|
||||
import '@material/mwc-menu';
|
||||
import '@material/mwc-list/mwc-list-item.js';
|
||||
import { RequestQueueWithPromise } from '../../../../plugins/plugins/utils/queue';
|
||||
import {RequestQueueWithPromise} from '../../../../plugins/plugins/utils/queue';
|
||||
import '../../../../plugins/plugins/core/components/TimeAgo';
|
||||
import { connect } from 'pwa-helpers';
|
||||
import { store } from '../../store';
|
||||
import { setNewTab } from '../../redux/app/app-actions';
|
||||
import {connect} from 'pwa-helpers';
|
||||
import {store} from '../../store';
|
||||
import ShortUniqueId from 'short-unique-id';
|
||||
|
||||
const requestQueue = new RequestQueueWithPromise(3);
|
||||
@ -125,17 +123,12 @@ export class AvatarComponent extends connect(store)(LitElement) {
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
|
||||
const nodeUrl =
|
||||
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
||||
return nodeUrl;
|
||||
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
||||
}
|
||||
getMyNode() {
|
||||
const myNode =
|
||||
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
return window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
|
||||
return myNode;
|
||||
}
|
||||
|
||||
getApiKey() {
|
||||
@ -143,8 +136,7 @@ export class AvatarComponent extends connect(store)(LitElement) {
|
||||
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
let apiKey = myNode.apiKey;
|
||||
return apiKey;
|
||||
return myNode.apiKey;
|
||||
}
|
||||
|
||||
async fetchResource() {
|
||||
@ -161,7 +153,7 @@ export class AvatarComponent extends connect(store)(LitElement) {
|
||||
}
|
||||
|
||||
async fetchVideoUrl() {
|
||||
this.fetchResource();
|
||||
await this.fetchResource();
|
||||
}
|
||||
|
||||
async getRawData() {
|
||||
@ -249,7 +241,7 @@ export class AvatarComponent extends connect(store)(LitElement) {
|
||||
|
||||
this.status = res;
|
||||
if (this.status.status === 'DOWNLOADED') {
|
||||
this.fetchResource();
|
||||
await this.fetchResource();
|
||||
}
|
||||
}
|
||||
|
||||
@ -264,8 +256,8 @@ export class AvatarComponent extends connect(store)(LitElement) {
|
||||
|
||||
async _fetchImage() {
|
||||
try {
|
||||
this.fetchVideoUrl();
|
||||
this.fetchStatus();
|
||||
await this.fetchVideoUrl();
|
||||
await this.fetchStatus();
|
||||
} catch (error) {
|
||||
/* empty */
|
||||
}
|
||||
|
@ -1,15 +1,14 @@
|
||||
import { css, html, LitElement } from 'lit';
|
||||
import { connect } from 'pwa-helpers';
|
||||
import {css, html, LitElement} from 'lit';
|
||||
import {connect} from 'pwa-helpers';
|
||||
|
||||
import '@vaadin/item';
|
||||
import '@vaadin/list-box';
|
||||
import '@polymer/paper-icon-button/paper-icon-button.js';
|
||||
import '@polymer/iron-icons/iron-icons.js';
|
||||
import { store } from '../../store.js';
|
||||
import { setNewTab } from '../../redux/app/app-actions.js';
|
||||
import {store} from '../../store.js';
|
||||
import {setNewTab} from '../../redux/app/app-actions.js';
|
||||
import '@material/mwc-icon';
|
||||
import { get, translate } from '../../../translate';
|
||||
import { repeat } from 'lit/directives/repeat.js';
|
||||
import {get} from '../../../translate';
|
||||
import '../../../../plugins/plugins/core/components/TimeAgo.js';
|
||||
import '../notification-view/popover.js';
|
||||
import ShortUniqueId from 'short-unique-id';
|
||||
@ -74,17 +73,12 @@ class BeginnerChecklist extends connect(store)(LitElement) {
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
|
||||
const nodeUrl =
|
||||
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
||||
return nodeUrl;
|
||||
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
||||
}
|
||||
getMyNode() {
|
||||
const myNode =
|
||||
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
return window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
|
||||
return myNode;
|
||||
}
|
||||
|
||||
async getName(recipient) {
|
||||
|
@ -174,13 +174,10 @@ export class FeedItem extends connect(store)(LitElement) {
|
||||
getNodeUrl(){
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
|
||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
return nodeUrl
|
||||
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
}
|
||||
getMyNode(){
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
|
||||
return myNode
|
||||
return window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
}
|
||||
|
||||
getApiKey() {
|
||||
@ -188,8 +185,7 @@ getMyNode(){
|
||||
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
let apiKey = myNode.apiKey;
|
||||
return apiKey;
|
||||
return myNode.apiKey;
|
||||
}
|
||||
|
||||
async fetchResource() {
|
||||
@ -206,7 +202,7 @@ getMyNode(){
|
||||
|
||||
async fetchVideoUrl() {
|
||||
|
||||
this.fetchResource()
|
||||
await this.fetchResource()
|
||||
|
||||
}
|
||||
|
||||
@ -311,7 +307,7 @@ getMyNode(){
|
||||
|
||||
this.status = res
|
||||
if(this.status.status === 'DOWNLOADED'){
|
||||
this.fetchResource()
|
||||
await this.fetchResource()
|
||||
}
|
||||
}
|
||||
|
||||
@ -332,8 +328,8 @@ getMyNode(){
|
||||
|
||||
async _fetchImage() {
|
||||
try {
|
||||
this.fetchVideoUrl()
|
||||
this.fetchStatus()
|
||||
await this.fetchVideoUrl()
|
||||
await this.fetchStatus()
|
||||
} catch (error) { /* empty */ }
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
// popover-component.js
|
||||
import { css, html, LitElement } from 'lit';
|
||||
import { createPopper } from '@popperjs/core';
|
||||
import {css, html, LitElement} from 'lit';
|
||||
import {createPopper} from '@popperjs/core';
|
||||
import '@material/mwc-icon';
|
||||
import { translate } from '../../../translate'
|
||||
import { store } from '../../store';
|
||||
import { connect } from 'pwa-helpers';
|
||||
import { setNewTab, setSideEffectAction } from '../../redux/app/app-actions';
|
||||
import {translate} from '../../../translate'
|
||||
import {store} from '../../store';
|
||||
import {connect} from 'pwa-helpers';
|
||||
import {setNewTab, setSideEffectAction} from '../../redux/app/app-actions';
|
||||
import ShortUniqueId from 'short-unique-id';
|
||||
|
||||
export class FriendItemActions extends connect(store)(LitElement) {
|
||||
@ -79,11 +79,9 @@ export class FriendItemActions extends connect(store)(LitElement) {
|
||||
const myNode =
|
||||
store.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
]
|
||||
|
||||
const nodeUrl =
|
||||
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
||||
return nodeUrl;
|
||||
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
}
|
||||
|
||||
firstUpdated() {
|
||||
|
@ -53,24 +53,18 @@ class FriendsFeed extends connect(store)(LitElement) {
|
||||
const myNode =
|
||||
store.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
]
|
||||
|
||||
const nodeUrl =
|
||||
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
||||
return nodeUrl;
|
||||
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
}
|
||||
getMyNode() {
|
||||
const myNode =
|
||||
store.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
|
||||
return myNode;
|
||||
return store.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
]
|
||||
}
|
||||
|
||||
_updateFeeds(event) {
|
||||
const detail = event.detail
|
||||
this.mySelectedFeeds = detail
|
||||
this.mySelectedFeeds = event.detail
|
||||
this.reFetchFeedData()
|
||||
this.requestUpdate()
|
||||
}
|
||||
@ -170,7 +164,7 @@ class FriendsFeed extends connect(store)(LitElement) {
|
||||
if(this.mySelectedFeeds.length === 0){
|
||||
await this.getEndpoints()
|
||||
|
||||
this.loadAndMergeData();
|
||||
await this.loadAndMergeData();
|
||||
}
|
||||
|
||||
this.getFeedOnInterval()
|
||||
@ -190,7 +184,7 @@ this.getFeedOnInterval()
|
||||
async refresh(){
|
||||
try {
|
||||
await this.getEndpoints()
|
||||
this.reFetchFeedData()
|
||||
await this.reFetchFeedData()
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
@ -326,8 +320,7 @@ this.getFeedOnInterval()
|
||||
|
||||
let clickValue1 = newItem.schema.click;
|
||||
|
||||
const resolvedClickValue1 = replacePlaceholders(clickValue1, resource, newItem.schema.customParams);
|
||||
newItem.link = resolvedClickValue1
|
||||
newItem.link = replacePlaceholders(clickValue1, resource, newItem.schema.customParams)
|
||||
newData.push(newItem)
|
||||
}
|
||||
}
|
||||
|
@ -74,19 +74,14 @@ class FriendsView extends connect(store)(LitElement) {
|
||||
const myNode =
|
||||
store.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
]
|
||||
|
||||
const nodeUrl =
|
||||
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
||||
return nodeUrl;
|
||||
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
}
|
||||
getMyNode() {
|
||||
const myNode =
|
||||
store.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
|
||||
return myNode;
|
||||
return store.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
]
|
||||
}
|
||||
|
||||
getMoreFriends() {}
|
||||
@ -105,12 +100,10 @@ class FriendsView extends connect(store)(LitElement) {
|
||||
}
|
||||
|
||||
_updateFriends(event) {
|
||||
const detail = event.detail
|
||||
this.friendList = detail
|
||||
this.friendList = event.detail
|
||||
}
|
||||
_updateFeed(event) {
|
||||
const detail = event.detail
|
||||
this.mySelectedFeeds = detail
|
||||
this.mySelectedFeeds = event.detail
|
||||
this.requestUpdate()
|
||||
}
|
||||
_addFriend(event){
|
||||
@ -201,8 +194,7 @@ class FriendsView extends connect(store)(LitElement) {
|
||||
|
||||
getApiKey() {
|
||||
const apiNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = apiNode.apiKey
|
||||
return apiKey
|
||||
return apiNode.apiKey
|
||||
}
|
||||
|
||||
async myFollowName(name) {
|
||||
@ -211,7 +203,7 @@ class FriendsView extends connect(store)(LitElement) {
|
||||
]
|
||||
let namesJsonString = JSON.stringify({ "items": items })
|
||||
|
||||
let ret = await parentEpml.request('apiCall', {
|
||||
return await parentEpml.request('apiCall', {
|
||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`,
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@ -219,9 +211,6 @@ class FriendsView extends connect(store)(LitElement) {
|
||||
},
|
||||
body: `${namesJsonString}`
|
||||
})
|
||||
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
async unFollowName(name) {
|
||||
@ -230,7 +219,7 @@ class FriendsView extends connect(store)(LitElement) {
|
||||
]
|
||||
let namesJsonString = JSON.stringify({ "items": items })
|
||||
|
||||
let ret = await parentEpml.request('apiCall', {
|
||||
return await parentEpml.request('apiCall', {
|
||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`,
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
@ -238,9 +227,6 @@ class FriendsView extends connect(store)(LitElement) {
|
||||
},
|
||||
body: `${namesJsonString}`
|
||||
})
|
||||
|
||||
|
||||
return ret
|
||||
}
|
||||
async addToFriendList(val, isRemove){
|
||||
const copyVal = {...val}
|
||||
@ -260,9 +246,9 @@ class FriendsView extends connect(store)(LitElement) {
|
||||
this.friendList = [...this.friendList, copyVal]
|
||||
}
|
||||
if(!copyVal.willFollow || isRemove) {
|
||||
this.unFollowName(copyVal.name)
|
||||
await this.unFollowName(copyVal.name)
|
||||
} else if(copyVal.willFollow){
|
||||
this.myFollowName(copyVal.name)
|
||||
await this.myFollowName(copyVal.name)
|
||||
}
|
||||
this.setMySelectedFeeds(val.mySelectedFeeds)
|
||||
await new Promise((res)=> {
|
||||
|
@ -1,15 +1,14 @@
|
||||
import { LitElement, html, css } from 'lit';
|
||||
import { render } from 'lit/html.js';
|
||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from '../../../translate'
|
||||
import {css, html, LitElement} from 'lit';
|
||||
import {get, translate} from '../../../translate'
|
||||
import '@material/mwc-button';
|
||||
import '@material/mwc-icon';
|
||||
import '@vaadin/tooltip';
|
||||
import '@material/mwc-dialog';
|
||||
import '@material/mwc-checkbox';
|
||||
import { connect } from 'pwa-helpers';
|
||||
import { store } from '../../store';
|
||||
import {connect} from 'pwa-helpers';
|
||||
import {store} from '../../store';
|
||||
import '@polymer/paper-spinner/paper-spinner-lite.js';
|
||||
import { parentEpml } from '../show-plugin';
|
||||
import {parentEpml} from '../show-plugin';
|
||||
|
||||
class ProfileModalUpdate extends connect(store)(LitElement) {
|
||||
static get properties() {
|
||||
@ -335,19 +334,14 @@ class ProfileModalUpdate extends connect(store)(LitElement) {
|
||||
const myNode =
|
||||
store.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
]
|
||||
|
||||
const nodeUrl =
|
||||
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
||||
return nodeUrl;
|
||||
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
}
|
||||
getMyNode() {
|
||||
const myNode =
|
||||
store.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
|
||||
return myNode;
|
||||
return store.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
]
|
||||
}
|
||||
|
||||
clearFields() {
|
||||
|
@ -1,12 +1,12 @@
|
||||
import { LitElement, html, css } from 'lit';
|
||||
import {css, html, LitElement} from 'lit';
|
||||
import '@material/mwc-icon';
|
||||
import './friends-side-panel.js';
|
||||
import { connect } from 'pwa-helpers';
|
||||
import { store } from '../../store.js';
|
||||
import {connect} from 'pwa-helpers';
|
||||
import {store} from '../../store.js';
|
||||
import WebWorker2 from '../WebWorkerFile.js';
|
||||
import '@polymer/paper-spinner/paper-spinner-lite.js';
|
||||
import '@vaadin/tooltip';
|
||||
import { get, translate } from '../../../translate'
|
||||
import {get, translate} from '../../../translate'
|
||||
import ShortUniqueId from 'short-unique-id';
|
||||
import '@polymer/paper-dialog/paper-dialog.js';
|
||||
|
||||
@ -14,20 +14,15 @@ import {
|
||||
decryptGroupData,
|
||||
encryptDataGroup,
|
||||
objectToBase64,
|
||||
uint8ArrayToBase64,
|
||||
uint8ArrayToObject,
|
||||
} from '../../../../plugins/plugins/core/components/qdn-action-encryption.js';
|
||||
import { publishData } from '../../../../plugins/plugins/utils/publish-image.js';
|
||||
import { parentEpml } from '../show-plugin.js';
|
||||
import {publishData} from '../../../../plugins/plugins/utils/publish-image.js';
|
||||
import {parentEpml} from '../show-plugin.js';
|
||||
import '../notification-view/popover.js';
|
||||
import './avatar.js';
|
||||
import {
|
||||
setNewTab,
|
||||
setProfileData,
|
||||
setSideEffectAction,
|
||||
} from '../../redux/app/app-actions.js';
|
||||
import {setNewTab, setProfileData, setSideEffectAction,} from '../../redux/app/app-actions.js';
|
||||
import './profile-modal-update.js';
|
||||
import { modalHelper } from '../../../../plugins/plugins/utils/publish-modal.js';
|
||||
import {modalHelper} from '../../../../plugins/plugins/utils/publish-modal.js';
|
||||
|
||||
class ProfileQdn extends connect(store)(LitElement) {
|
||||
static get properties() {
|
||||
@ -288,19 +283,14 @@ class ProfileQdn extends connect(store)(LitElement) {
|
||||
const myNode =
|
||||
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
]
|
||||
|
||||
const nodeUrl =
|
||||
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
||||
return nodeUrl;
|
||||
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
}
|
||||
getMyNode() {
|
||||
const myNode =
|
||||
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
|
||||
return myNode;
|
||||
return window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
]
|
||||
}
|
||||
|
||||
async getRawData(dataItem) {
|
||||
@ -323,10 +313,9 @@ class ProfileQdn extends connect(store)(LitElement) {
|
||||
}
|
||||
|
||||
async followNames(names) {
|
||||
let items = names;
|
||||
let namesJsonString = JSON.stringify({ items: items });
|
||||
let namesJsonString = JSON.stringify({ items: names });
|
||||
|
||||
let ret = await parentEpml.request('apiCall', {
|
||||
return await parentEpml.request('apiCall', {
|
||||
url: `/lists/followedNames?apiKey=${this.myNode.apiKey}`,
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@ -334,8 +323,6 @@ class ProfileQdn extends connect(store)(LitElement) {
|
||||
},
|
||||
body: `${namesJsonString}`,
|
||||
});
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
async setValues(response, resource) {
|
||||
@ -426,8 +413,7 @@ class ProfileQdn extends connect(store)(LitElement) {
|
||||
async getProfile() {
|
||||
try {
|
||||
this.error = '';
|
||||
const arbFee = await this.getArbitraryFee();
|
||||
this.fee = arbFee;
|
||||
this.fee = await this.getArbitraryFee();
|
||||
this.hasAttemptedToFetchResource = true;
|
||||
let resource;
|
||||
|
||||
@ -459,7 +445,7 @@ class ProfileQdn extends connect(store)(LitElement) {
|
||||
try {
|
||||
const response = await this.getRawData(dataItem);
|
||||
if (response.wallets) {
|
||||
this.setValues(response, dataItem);
|
||||
await this.setValues(response, dataItem);
|
||||
} else {
|
||||
this.error = 'Cannot get saved user settings';
|
||||
}
|
||||
@ -574,11 +560,10 @@ class ProfileQdn extends connect(store)(LitElement) {
|
||||
const toBase64 = await objectToBase64(
|
||||
newObject.customData[key]
|
||||
);
|
||||
const encryptedData = encryptDataGroup({
|
||||
newObject['customData'][key] = encryptDataGroup({
|
||||
data64: toBase64,
|
||||
publicKeys: [],
|
||||
});
|
||||
newObject['customData'][key] = encryptedData;
|
||||
}
|
||||
} else {
|
||||
newObject['customData'][key] = newObject.customData[key];
|
||||
|
@ -1,17 +1,16 @@
|
||||
import {css, html, LitElement} from 'lit';
|
||||
import '@material/mwc-icon';
|
||||
import './friends-side-panel.js';
|
||||
import { connect } from 'pwa-helpers';
|
||||
import { store } from '../../store.js';
|
||||
import {connect} from 'pwa-helpers';
|
||||
import {store} from '../../store.js';
|
||||
import WebWorker from '../WebWorkerFile.js';
|
||||
import '@polymer/paper-spinner/paper-spinner-lite.js';
|
||||
import '@vaadin/tooltip';
|
||||
import { get, translate } from '../../../translate'
|
||||
import {translate} from '../../../translate'
|
||||
import ShortUniqueId from 'short-unique-id';
|
||||
|
||||
import {
|
||||
decryptGroupData,
|
||||
|
||||
encryptDataGroup,
|
||||
objectToBase64,
|
||||
uint8ArrayToObject,
|
||||
@ -19,7 +18,7 @@ import {
|
||||
import {publishData} from '../../../../plugins/plugins/utils/publish-image.js';
|
||||
import {parentEpml} from '../show-plugin.js';
|
||||
import '../notification-view/popover.js';
|
||||
import { setNewTab } from '../../redux/app/app-actions.js';
|
||||
import {setNewTab} from '../../redux/app/app-actions.js';
|
||||
|
||||
class SaveSettingsQdn extends connect(store)(LitElement) {
|
||||
static get properties() {
|
||||
@ -144,19 +143,14 @@ class SaveSettingsQdn extends connect(store)(LitElement) {
|
||||
const myNode =
|
||||
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
]
|
||||
|
||||
const nodeUrl =
|
||||
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
||||
return nodeUrl;
|
||||
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
}
|
||||
getMyNode() {
|
||||
const myNode =
|
||||
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
|
||||
return myNode;
|
||||
return window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
]
|
||||
}
|
||||
|
||||
async getRawData(dataItem) {
|
||||
@ -165,8 +159,7 @@ class SaveSettingsQdn extends connect(store)(LitElement) {
|
||||
const data = await res.text();
|
||||
if (data.error) throw new Error('Cannot retrieve your data from qdn');
|
||||
const decryptedData = decryptGroupData(data);
|
||||
const decryptedDataToBase64 = uint8ArrayToObject(decryptedData);
|
||||
return decryptedDataToBase64;
|
||||
return uint8ArrayToObject(decryptedData);
|
||||
}
|
||||
|
||||
async getMyFollowedNames() {
|
||||
@ -184,10 +177,9 @@ class SaveSettingsQdn extends connect(store)(LitElement) {
|
||||
}
|
||||
|
||||
async followNames(names) {
|
||||
let items = names
|
||||
let namesJsonString = JSON.stringify({ "items": items })
|
||||
let namesJsonString = JSON.stringify({ "items": names })
|
||||
|
||||
let ret = await parentEpml.request('apiCall', {
|
||||
return await parentEpml.request('apiCall', {
|
||||
url: `/lists/followedNames?apiKey=${this.myNode.apiKey}`,
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@ -195,9 +187,6 @@ class SaveSettingsQdn extends connect(store)(LitElement) {
|
||||
},
|
||||
body: `${namesJsonString}`
|
||||
})
|
||||
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
async setValues(response, resource) {
|
||||
@ -322,8 +311,7 @@ class SaveSettingsQdn extends connect(store)(LitElement) {
|
||||
async getGeneralSettingsQdn() {
|
||||
try {
|
||||
this.error = ""
|
||||
const arbFee = await this.getArbitraryFee();
|
||||
this.fee = arbFee;
|
||||
this.fee = await this.getArbitraryFee();
|
||||
this.hasAttemptedToFetchResource = true;
|
||||
let resource;
|
||||
let nameObject
|
||||
@ -358,7 +346,7 @@ class SaveSettingsQdn extends connect(store)(LitElement) {
|
||||
try {
|
||||
const response = await this.getRawData(dataItem);
|
||||
if (response.version) {
|
||||
this.setValues(response, dataItem);
|
||||
await this.setValues(response, dataItem);
|
||||
} else {
|
||||
this.error = 'Cannot get saved user settings';
|
||||
}
|
||||
@ -514,9 +502,9 @@ class SaveSettingsQdn extends connect(store)(LitElement) {
|
||||
});
|
||||
|
||||
this.resourceExists = true;
|
||||
this.setValues(newObject, {
|
||||
updated: Date.now(),
|
||||
});
|
||||
await this.setValues(newObject, {
|
||||
updated: Date.now(),
|
||||
});
|
||||
localStorage.setItem('temp-settings-data', JSON.stringify({}));
|
||||
this.valuesToBeSavedOnQdn = {};
|
||||
worker.terminate();
|
||||
|
@ -593,7 +593,7 @@ class CreateAccountSection extends connect(store)(LitElement) {
|
||||
const dataString = JSON.stringify(data)
|
||||
const blob = new Blob([dataString], { type: 'text/plain;charset=utf-8' })
|
||||
backupname = "qortal_backup_" + wallet.addresses[0].address + ".json"
|
||||
this.saveFileToDisk(blob, backupname)
|
||||
await this.saveFileToDisk(blob, backupname)
|
||||
}
|
||||
|
||||
async downloadSeedphrase() {
|
||||
@ -601,7 +601,7 @@ class CreateAccountSection extends connect(store)(LitElement) {
|
||||
const seed = this.shadowRoot.getElementById('randSentence').parsedString
|
||||
const blob = new Blob([seed], { type: 'text/plain;charset=utf-8' })
|
||||
seedname = "qortal_seedphrase.txt"
|
||||
this.saveFileToDisk(blob, seedname)
|
||||
await this.saveFileToDisk(blob, seedname)
|
||||
}
|
||||
|
||||
async saveFileToDisk(blob, fileName) {
|
||||
|
@ -346,8 +346,7 @@ var pJS = function (tag_id, params) {
|
||||
var shape_type = pJS.particles.shape.type
|
||||
if (typeof (shape_type) === 'object') {
|
||||
if (shape_type instanceof Array) {
|
||||
var shape_selected = shape_type[Math.floor(Math.random() * shape_type.length)]
|
||||
this.shape = shape_selected
|
||||
this.shape = shape_type[Math.floor(Math.random() * shape_type.length)]
|
||||
}
|
||||
} else {
|
||||
this.shape = shape_type
|
||||
|
@ -293,19 +293,14 @@ class NotificationItemTx extends connect(store)(LitElement) {
|
||||
const myNode =
|
||||
store.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
]
|
||||
|
||||
const nodeUrl =
|
||||
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
||||
return nodeUrl;
|
||||
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
}
|
||||
getMyNode() {
|
||||
const myNode =
|
||||
store.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
|
||||
return myNode;
|
||||
return store.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
]
|
||||
}
|
||||
|
||||
async getStatus() {
|
||||
@ -313,11 +308,10 @@ class NotificationItemTx extends connect(store)(LitElement) {
|
||||
let stop = false;
|
||||
const getAnswer = async () => {
|
||||
const getTx = async (minterAddr) => {
|
||||
const url = `${this.nodeUrl}/transactions/signature/${this.signature}`;
|
||||
const res = await fetch(url);
|
||||
const data = await res.json();
|
||||
return data;
|
||||
};
|
||||
const url = `${this.nodeUrl}/transactions/signature/${this.signature}`
|
||||
const res = await fetch(url)
|
||||
return await res.json()
|
||||
}
|
||||
|
||||
if (!stop) {
|
||||
stop = true;
|
||||
|
@ -43,8 +43,7 @@ class NotificationBell extends connect(store)(LitElement) {
|
||||
|
||||
getApiKey() {
|
||||
const apiNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = apiNode.apiKey
|
||||
return apiKey
|
||||
return apiNode.apiKey
|
||||
}
|
||||
|
||||
async getNotifications() {
|
||||
@ -69,8 +68,7 @@ class NotificationBell extends connect(store)(LitElement) {
|
||||
}
|
||||
})
|
||||
|
||||
const data = await response.json()
|
||||
return data;
|
||||
return await response.json()
|
||||
}
|
||||
|
||||
if (!stop && !this.showNotifications) {
|
||||
@ -97,15 +95,35 @@ class NotificationBell extends connect(store)(LitElement) {
|
||||
if (!this.initialFetch && notificationsToShow.length > 0) {
|
||||
const mail = notificationsToShow[0]
|
||||
const urlPic = `${nodeUrl}/arbitrary/THUMBNAIL/${mail.name}/qortal_avatar?async=true&apiKey=${this.getApiKey()}`
|
||||
routes.showNotification({
|
||||
data: { title: "New Q-Mail", type: "qapp", sound: config.messageAlert, url: "", options: { body: `You have an unread mail from ${mail.name}`, icon: urlPic, badge: urlPic } }
|
||||
await routes.showNotification({
|
||||
data: {
|
||||
title: "New Q-Mail",
|
||||
type: "qapp",
|
||||
sound: config.messageAlert,
|
||||
url: "",
|
||||
options: {
|
||||
body: `You have an unread mail from ${mail.name}`,
|
||||
icon: urlPic,
|
||||
badge: urlPic
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (notificationsToShow.length > 0) {
|
||||
if (notificationsToShow[0].created > (this.notifications[0]?.created || 0)) {
|
||||
const mail = notificationsToShow[0]
|
||||
const urlPic = `${nodeUrl}/arbitrary/THUMBNAIL/${mail.name}/qortal_avatar?async=true&apiKey=${this.getApiKey()}`
|
||||
routes.showNotification({
|
||||
data: { title: "New Q-Mail", type: "qapp", sound: config.messageAlert, url: "", options: { body: `You have an unread mail from ${mail.name}`, icon: urlPic, badge: urlPic } }
|
||||
await routes.showNotification({
|
||||
data: {
|
||||
title: "New Q-Mail",
|
||||
type: "qapp",
|
||||
sound: config.messageAlert,
|
||||
url: "",
|
||||
options: {
|
||||
body: `You have an unread mail from ${mail.name}`,
|
||||
icon: urlPic,
|
||||
badge: urlPic
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { LitElement, html, css } from 'lit'
|
||||
import { connect } from 'pwa-helpers'
|
||||
import { store } from '../../store.js'
|
||||
import { get, translate } from '../../../translate'
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {connect} from 'pwa-helpers'
|
||||
import {store} from '../../store.js'
|
||||
import {get, translate} from '../../../translate'
|
||||
|
||||
class AccountView extends connect(store)(LitElement) {
|
||||
static get properties() {
|
||||
@ -127,8 +127,7 @@ class AccountView extends connect(store)(LitElement) {
|
||||
|
||||
getApiKey() {
|
||||
const apiNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
|
||||
let apiKey = apiNode.apiKey
|
||||
return apiKey
|
||||
return apiNode.apiKey
|
||||
}
|
||||
|
||||
stateChanged(state) {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {connect} from 'pwa-helpers'
|
||||
import {store} from '../../store.js'
|
||||
import { Epml } from '../../epml.js'
|
||||
import { addTradeBotRoutes } from '../../tradebot/addTradeBotRoutes.js'
|
||||
import {Epml} from '../../epml.js'
|
||||
import {addTradeBotRoutes} from '../../tradebot/addTradeBotRoutes.js'
|
||||
import {get, translate} from '../../../translate'
|
||||
import snackbar from '../../functional-components/snackbar.js'
|
||||
import FileSaver from 'file-saver'
|
||||
@ -427,7 +427,7 @@ class ExportKeys extends connect(store)(LitElement) {
|
||||
addTradeBotRoutes(parentEpml)
|
||||
parentEpml.imReady()
|
||||
await this.fetchArrrWalletAddress()
|
||||
this.checkArrrWalletPrivateKey()
|
||||
await this.checkArrrWalletPrivateKey()
|
||||
}
|
||||
|
||||
async fetchArrrWalletAddress() {
|
||||
@ -518,10 +518,10 @@ class ExportKeys extends connect(store)(LitElement) {
|
||||
|
||||
if (resRepair != null && resRepair.error != 128) {
|
||||
this.shadowRoot.querySelector('#pleaseWaitDialog').close()
|
||||
this.openOkDialog()
|
||||
await this.openOkDialog()
|
||||
} else {
|
||||
this.shadowRoot.querySelector('#pleaseWaitDialog').close()
|
||||
this.openErrorDialog()
|
||||
await this.openErrorDialog()
|
||||
}
|
||||
}
|
||||
|
||||
@ -558,7 +558,7 @@ class ExportKeys extends connect(store)(LitElement) {
|
||||
const myCoinAddress = cAddress
|
||||
const blob = new Blob([`${myPrivateMasterKey}`], { type: 'text/plain;charset=utf-8' })
|
||||
exportname = "Private_Master_Key_" + myCoinName + "_" + myCoinAddress + ".txt"
|
||||
this.saveFileToDisk(blob, exportname)
|
||||
await this.saveFileToDisk(blob, exportname)
|
||||
}
|
||||
|
||||
async saveFileToDisk(blob, fileName) {
|
||||
@ -590,8 +590,7 @@ class ExportKeys extends connect(store)(LitElement) {
|
||||
|
||||
getApiKey() {
|
||||
const apiNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
|
||||
let apiKey = apiNode.apiKey
|
||||
return apiKey
|
||||
return apiNode.apiKey
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -232,7 +232,7 @@ class SecurityView extends connect(store)(LitElement) {
|
||||
const dataString = JSON.stringify(data)
|
||||
const blob = new Blob([dataString], { type: 'text/plain;charset=utf-8' })
|
||||
backupname = "qortal_backup_" + state.app.selectedAddress.address + ".json"
|
||||
this.saveFileToDisk(blob, backupname)
|
||||
await this.saveFileToDisk(blob, backupname)
|
||||
}
|
||||
|
||||
async saveFileToDisk(blob, fileName) {
|
||||
|
@ -19,7 +19,7 @@ import '@polymer/paper-dialog/paper-dialog.js'
|
||||
import '@vaadin/grid'
|
||||
import '@vaadin/text-field'
|
||||
import '../custom-elements/frag-file-input.js'
|
||||
import { defaultQappsTabs } from '../data/defaultQapps.js'
|
||||
import {defaultQappsTabs} from '../data/defaultQapps.js'
|
||||
|
||||
registerTranslateConfig({
|
||||
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
|
||||
@ -842,7 +842,7 @@ class ShowPlugin extends connect(store)(LitElement) {
|
||||
|
||||
store.dispatch(setNewTab(null))
|
||||
} else if (!this.tabs.find((tab) => tab.id === newTab.id)) {
|
||||
this.addTab(newTab)
|
||||
await this.addTab(newTab)
|
||||
this.currentTab = this.tabs.length - 1
|
||||
store.dispatch(setNewTab(null))
|
||||
//clear newTab
|
||||
@ -1473,8 +1473,7 @@ class NavBar extends connect(store)(LitElement) {
|
||||
res()
|
||||
}, 1000);
|
||||
})
|
||||
const detail = event.detail
|
||||
this.myMenuPlugins = detail
|
||||
this.myMenuPlugins = event.detail
|
||||
const addressInfo = this.addressInfo
|
||||
const isMinter = addressInfo?.error !== 124 && +addressInfo?.level > 0
|
||||
const isSponsor = +addressInfo?.level >= 5
|
||||
@ -1588,11 +1587,9 @@ class NavBar extends connect(store)(LitElement) {
|
||||
}
|
||||
|
||||
async getMyFollowedNames() {
|
||||
let myFollowedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
|
||||
this.myFollowedNames = myFollowedNames
|
||||
this.myFollowedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
}
|
||||
|
||||
searchNameKeyListener(e) {
|
||||
@ -1692,7 +1689,7 @@ class NavBar extends connect(store)(LitElement) {
|
||||
let err3string = get("appspage.schange22")
|
||||
parentEpml.request('showSnackBar', `${err3string}`)
|
||||
}
|
||||
this.getMyFollowedNamesList()
|
||||
await this.getMyFollowedNamesList()
|
||||
return ret
|
||||
}
|
||||
|
||||
@ -1718,7 +1715,7 @@ class NavBar extends connect(store)(LitElement) {
|
||||
let err4string = get("appspage.schange23")
|
||||
parentEpml.request('showSnackBar', `${err4string}`)
|
||||
}
|
||||
this.getMyFollowedNamesList()
|
||||
await this.getMyFollowedNamesList()
|
||||
return ret
|
||||
}
|
||||
|
||||
@ -2398,7 +2395,7 @@ class NavBar extends connect(store)(LitElement) {
|
||||
async handlePasteLink(e) {
|
||||
try {
|
||||
const value = this.shadowRoot.getElementById('linkInput').value
|
||||
this.getQuery(value)
|
||||
await this.getQuery(value)
|
||||
} catch (error) {
|
||||
}
|
||||
}
|
||||
@ -2407,7 +2404,7 @@ class NavBar extends connect(store)(LitElement) {
|
||||
if (e.key === 'Enter') {
|
||||
try {
|
||||
const value = this.shadowRoot.getElementById('linkInput').value
|
||||
this.getQuery(value)
|
||||
await this.getQuery(value)
|
||||
} catch (error) {
|
||||
}
|
||||
}
|
||||
@ -2415,8 +2412,7 @@ class NavBar extends connect(store)(LitElement) {
|
||||
|
||||
getApiKey() {
|
||||
const apiNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = apiNode.apiKey
|
||||
return apiKey
|
||||
return apiNode.apiKey
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
|
@ -235,9 +235,7 @@ const nonce = selectedAddress && selectedAddress.nonce;
|
||||
const url = `${nodeUrl}/admin/mintingaccounts`;
|
||||
try {
|
||||
const res = await fetch(url);
|
||||
const mintingAccountData = await res.json();
|
||||
|
||||
this.mintingAccountData = mintingAccountData;
|
||||
this.mintingAccountData = await res.json();
|
||||
} catch (error) {
|
||||
this.errorMsg = this.renderErrorMsg1();
|
||||
}
|
||||
@ -286,11 +284,11 @@ const nonce = selectedAddress && selectedAddress.nonce;
|
||||
|
||||
try {
|
||||
await addMintingAccount(this.privateRewardShareKey);
|
||||
routes.showSnackBar({
|
||||
await routes.showSnackBar({
|
||||
data: translate('becomeMinterPage.bchange19'),
|
||||
});
|
||||
this.status = 5;
|
||||
this.getMintingAcccounts();
|
||||
await this.getMintingAcccounts();
|
||||
} catch (error) {
|
||||
this.errorMsg = this.renderErrorMsg3();
|
||||
|
||||
@ -311,8 +309,7 @@ const nonce = selectedAddress && selectedAddress.nonce;
|
||||
const rewardShares = async (minterAddr) => {
|
||||
const url = `${nodeUrl}/addresses/rewardshares?minters=${minterAddr}&recipients=${minterAddr}`;
|
||||
const res = await fetch(url);
|
||||
const data = await res.json();
|
||||
return data;
|
||||
return await res.json();
|
||||
};
|
||||
|
||||
if (!stop) {
|
||||
@ -352,7 +349,7 @@ const nonce = selectedAddress && selectedAddress.nonce;
|
||||
let rewarddialog3 = get('transactions.rewarddialog3');
|
||||
let rewarddialog4 = get('transactions.rewarddialog4');
|
||||
|
||||
let myTxnrequest = await routes.transaction({
|
||||
return await routes.transaction({
|
||||
data: {
|
||||
type: 38,
|
||||
nonce: nonce,
|
||||
@ -368,7 +365,6 @@ const nonce = selectedAddress && selectedAddress.nonce;
|
||||
},
|
||||
disableModal: true,
|
||||
});
|
||||
return myTxnrequest;
|
||||
};
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -404,8 +400,7 @@ const nonce = selectedAddress && selectedAddress.nonce;
|
||||
const getLastRef = async () => {
|
||||
const url = `${nodeUrl}/addresses/lastreference/${address}`;
|
||||
const res = await fetch(url);
|
||||
const data = await res.text();
|
||||
return data;
|
||||
return await res.text();
|
||||
};
|
||||
|
||||
const startMinting = async () => {
|
||||
@ -422,7 +417,7 @@ const nonce = selectedAddress && selectedAddress.nonce;
|
||||
|
||||
try {
|
||||
this.privateRewardShareKey = await createSponsorshipKey();
|
||||
this.confirmRelationship(publicAddress)
|
||||
await this.confirmRelationship(publicAddress)
|
||||
} catch (error) {
|
||||
console.log({ error })
|
||||
this.errorMsg = (error && error.data && error.data.message) ? error.data.message : this.renderErrorMsg4();
|
||||
@ -438,7 +433,7 @@ const nonce = selectedAddress && selectedAddress.nonce;
|
||||
.onClick=${async () => {
|
||||
await startMinting();
|
||||
if (this.errorMsg) {
|
||||
routes.showSnackBar({
|
||||
await routes.showSnackBar({
|
||||
data: this.errorMsg,
|
||||
});
|
||||
}
|
||||
|
@ -1374,13 +1374,11 @@ class UserInfoView extends connect(store)(LitElement) {
|
||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
const fromNameUrl = `${nodeUrl}/names/${fromName}`
|
||||
|
||||
const qortalNameInfo = await fetch(fromNameUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
this.nameAddressResult = qortalNameInfo
|
||||
this.nameAddressResult = await fetch(fromNameUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
const nameAddress = this.nameAddressResult.owner
|
||||
this.getAllWithAddress(nameAddress)
|
||||
await this.getAllWithAddress(nameAddress)
|
||||
}
|
||||
|
||||
async getAllWithAddress(myAddress) {
|
||||
@ -1401,11 +1399,9 @@ class UserInfoView extends connect(store)(LitElement) {
|
||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
const infoAddressUrl = `${nodeUrl}/addresses/${infoAddress}`
|
||||
|
||||
const qortalAddressInfo = await fetch(infoAddressUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
this.addressResult = qortalAddressInfo
|
||||
this.addressResult = await fetch(infoAddressUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
}
|
||||
|
||||
async getAddressUserAvatar(avatarAddress) {
|
||||
@ -1427,8 +1423,7 @@ class UserInfoView extends connect(store)(LitElement) {
|
||||
}
|
||||
})
|
||||
|
||||
const myImageUrl = `${nodeUrl}/arbitrary/THUMBNAIL/${this.imageName}/qortal_avatar?async=true&apiKey=${this.getApiKey()}`
|
||||
this.imageUrl = myImageUrl
|
||||
this.imageUrl = `${nodeUrl}/arbitrary/THUMBNAIL/${this.imageName}/qortal_avatar?async=true&apiKey=${this.getApiKey()}`
|
||||
}
|
||||
|
||||
async getAddressUserBalance(balanceAddress) {
|
||||
@ -1451,19 +1446,15 @@ class UserInfoView extends connect(store)(LitElement) {
|
||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
|
||||
if (checkBlocks === 0) {
|
||||
let noMinterString = get("explorerpage.exp16")
|
||||
this.startMintTime = noMinterString
|
||||
this.startMintTime = get("explorerpage.exp16")
|
||||
} else {
|
||||
const rewardshareUrl = `${nodeUrl}/transactions/search?txType=REWARD_SHARE&address=${mintAddress}&confirmationStatus=CONFIRMED&limit=1&reverse=false`
|
||||
|
||||
const startMinting = await fetch(rewardshareUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
this.startMinting = await fetch(rewardshareUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
this.startMinting = startMinting
|
||||
|
||||
const mintString = new Date(this.startMinting[0].timestamp).toLocaleDateString()
|
||||
this.startMintTime = mintString
|
||||
this.startMintTime = new Date(this.startMinting[0].timestamp).toLocaleDateString()
|
||||
}
|
||||
}
|
||||
|
||||
@ -1928,9 +1919,8 @@ class UserInfoView extends connect(store)(LitElement) {
|
||||
}
|
||||
|
||||
getApiKey() {
|
||||
const apiNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node];
|
||||
let apiKey = apiNode.apiKey;
|
||||
return apiKey;
|
||||
const apiNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
|
||||
return apiNode.apiKey
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
@ -1941,8 +1931,7 @@ class UserInfoView extends connect(store)(LitElement) {
|
||||
}
|
||||
|
||||
round(number) {
|
||||
let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
return result
|
||||
return (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -111,8 +111,7 @@ class WalletProfile extends connect(store)(LitElement) {
|
||||
|
||||
getApiKey() {
|
||||
const apiNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
|
||||
let apiKey = apiNode.apiKey
|
||||
return apiKey
|
||||
return apiNode.apiKey
|
||||
}
|
||||
|
||||
stateChanged(state) {
|
||||
|
@ -211,8 +211,7 @@ class SettingsPage extends connect(store)(LitElement) {
|
||||
|
||||
// Set the selected value for mwc-select
|
||||
const protocolList = dialog.querySelector('#protocolList')
|
||||
const desiredProtocol = currentValues.protocol
|
||||
protocolList.value = desiredProtocol
|
||||
protocolList.value = currentValues.protocol
|
||||
this.isBeingEdited = true
|
||||
this.isBeingEditedIndex = index
|
||||
this.shadowRoot.querySelector('#addNodeDialog').show()
|
||||
|
@ -171,9 +171,7 @@ export const newMessageNotificationQappLocal = (data) => {
|
||||
}
|
||||
|
||||
notify.onclick = async(e) => {
|
||||
const url = data?.url
|
||||
const value = url
|
||||
let newQuery = value;
|
||||
let newQuery = data?.url;
|
||||
if (newQuery.endsWith('/')) {
|
||||
newQuery = newQuery.slice(0, -1);
|
||||
}
|
||||
@ -217,9 +215,7 @@ export const newMessageNotificationQappLocal = (data) => {
|
||||
const notify = new Notification(data.title, data.options)
|
||||
|
||||
notify.onclick = async(e) => {
|
||||
const url = data?.url
|
||||
const value = url
|
||||
let newQuery = value;
|
||||
let newQuery = data?.url;
|
||||
if (newQuery.endsWith('/')) {
|
||||
newQuery = newQuery.slice(0, -1);
|
||||
}
|
||||
|
@ -198,11 +198,8 @@ export const routes = {
|
||||
|
||||
username: async (req) => {
|
||||
const state = store.getState()
|
||||
const username =
|
||||
state.user.storedWallets[state.app.wallet.addresses[0].address]
|
||||
.name
|
||||
|
||||
return username
|
||||
return state.user.storedWallets[state.app.wallet.addresses[0].address]
|
||||
.name
|
||||
},
|
||||
|
||||
chat: async (req) => {
|
||||
@ -343,9 +340,7 @@ export const routes = {
|
||||
tradeBotRespondRequest: async (req) => {
|
||||
let response
|
||||
try {
|
||||
const res = await tradeBotRespondRequest(req.data)
|
||||
|
||||
response = res
|
||||
response = await tradeBotRespondRequest(req.data)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.error(e.message)
|
||||
@ -385,10 +380,9 @@ export const routes = {
|
||||
cancelAllOffers: async (req) => {
|
||||
let response
|
||||
try {
|
||||
const res = await cancelAllOffers(
|
||||
response = await cancelAllOffers(
|
||||
store.getState().app.selectedAddress
|
||||
)
|
||||
response = res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.error(e.message)
|
||||
@ -400,8 +394,7 @@ export const routes = {
|
||||
sendBtc: async (req) => {
|
||||
let response
|
||||
try {
|
||||
const res = await sendBtc(req.data)
|
||||
response = res
|
||||
response = await sendBtc(req.data)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.error(e.message)
|
||||
@ -413,8 +406,7 @@ export const routes = {
|
||||
sendLtc: async (req) => {
|
||||
let response
|
||||
try {
|
||||
const res = await sendLtc(req.data)
|
||||
response = res
|
||||
response = await sendLtc(req.data)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.error(e.message)
|
||||
@ -426,8 +418,7 @@ export const routes = {
|
||||
sendDoge: async (req) => {
|
||||
let response
|
||||
try {
|
||||
const res = await sendDoge(req.data)
|
||||
response = res
|
||||
response = await sendDoge(req.data)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.error(e.message)
|
||||
@ -439,8 +430,7 @@ export const routes = {
|
||||
sendDgb: async (req) => {
|
||||
let response
|
||||
try {
|
||||
const res = await sendDgb(req.data)
|
||||
response = res
|
||||
response = await sendDgb(req.data)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.error(e.message)
|
||||
@ -452,8 +442,7 @@ export const routes = {
|
||||
sendRvn: async (req) => {
|
||||
let response
|
||||
try {
|
||||
const res = await sendRvn(req.data)
|
||||
response = res
|
||||
response = await sendRvn(req.data)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.error(e.message)
|
||||
@ -465,8 +454,7 @@ export const routes = {
|
||||
sendArrr: async (req) => {
|
||||
let response
|
||||
try {
|
||||
const res = await sendArrr(req.data)
|
||||
response = res
|
||||
response = await sendArrr(req.data)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.error(e.message)
|
||||
|
@ -114,8 +114,7 @@ export const routes = {
|
||||
store.getState().app.selectedAddress.keyPair
|
||||
)
|
||||
|
||||
const res = await processTransaction(signedTxnBytes)
|
||||
response = res
|
||||
response = await processTransaction(signedTxnBytes)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.error(e.message)
|
||||
@ -127,8 +126,7 @@ export const routes = {
|
||||
tradeBotRespondRequest: async (req) => {
|
||||
let response
|
||||
try {
|
||||
const res = await tradeBotRespondRequest(req.data)
|
||||
response = res
|
||||
response = await tradeBotRespondRequest(req.data)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.error(e.message)
|
||||
@ -147,9 +145,7 @@ export const routes = {
|
||||
store.getState().app.selectedAddress.keyPair
|
||||
)
|
||||
|
||||
const res = await processTransaction(signedTxnBytes)
|
||||
|
||||
response = res
|
||||
response = await processTransaction(signedTxnBytes)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.error(e.message)
|
||||
@ -161,10 +157,9 @@ export const routes = {
|
||||
cancelAllOffers: async (req) => {
|
||||
let response
|
||||
try {
|
||||
const res = await cancelAllOffers(
|
||||
response = await cancelAllOffers(
|
||||
store.getState().app.selectedAddress
|
||||
)
|
||||
response = res
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.error(e.message)
|
||||
@ -176,8 +171,7 @@ export const routes = {
|
||||
sendBtc: async (req) => {
|
||||
let response
|
||||
try {
|
||||
const res = await sendBtc(req.data)
|
||||
response = res
|
||||
response = await sendBtc(req.data)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.error(e.message)
|
||||
@ -189,8 +183,7 @@ export const routes = {
|
||||
sendLtc: async (req) => {
|
||||
let response
|
||||
try {
|
||||
const res = await sendLtc(req.data)
|
||||
response = res
|
||||
response = await sendLtc(req.data)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.error(e.message)
|
||||
@ -202,8 +195,7 @@ export const routes = {
|
||||
sendDoge: async (req) => {
|
||||
let response
|
||||
try {
|
||||
const res = await sendDoge(req.data)
|
||||
response = res
|
||||
response = await sendDoge(req.data)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.error(e.message)
|
||||
@ -215,8 +207,7 @@ export const routes = {
|
||||
sendDgb: async (req) => {
|
||||
let response
|
||||
try {
|
||||
const res = await sendDgb(req.data)
|
||||
response = res
|
||||
response = await sendDgb(req.data)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.error(e.message)
|
||||
@ -228,8 +219,7 @@ export const routes = {
|
||||
sendRvn: async (req) => {
|
||||
let response
|
||||
try {
|
||||
const res = await sendRvn(req.data)
|
||||
response = res
|
||||
response = await sendRvn(req.data)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.error(e.message)
|
||||
@ -241,8 +231,7 @@ export const routes = {
|
||||
sendArrr: async (req) => {
|
||||
let response
|
||||
try {
|
||||
const res = await sendArrr(req.data)
|
||||
response = res
|
||||
response = await sendArrr(req.data)
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
console.error(e.message)
|
||||
|
@ -17,20 +17,15 @@ const uiCoreController = (type) => {
|
||||
const { createServer } = require('./server/server.js')
|
||||
return createServer
|
||||
case BUILD:
|
||||
const build = require('./tooling/build.js')
|
||||
return build
|
||||
return require('./tooling/build.js')
|
||||
case WATCH:
|
||||
const watch = require('./tooling/watch.js')
|
||||
return watch
|
||||
return require('./tooling/watch.js')
|
||||
case WATCH_INLINE:
|
||||
const watchInlines = require('./tooling/watch-inlines.js')
|
||||
return watchInlines
|
||||
return require('./tooling/watch-inlines.js')
|
||||
case DEFAULT_CONFIG:
|
||||
const defaultConfig = require('./config/config.js')
|
||||
return defaultConfig
|
||||
return require('./config/config.js')
|
||||
case GENERATE_BUILD_CONFIG:
|
||||
const generateBuildConfig = require('./tooling/generateBuildConfig.js')
|
||||
return generateBuildConfig
|
||||
return require('./tooling/generateBuildConfig.js')
|
||||
default:
|
||||
return
|
||||
}
|
||||
|
@ -309,8 +309,7 @@ export default class AltcoinHDWallet {
|
||||
|
||||
// PublicKey Hash
|
||||
const publicKeySHA256 = new Sha256().process(new Uint8Array(this.publicKey)).finish().result
|
||||
const _publicKeyHash = new RIPEMD160().update(Buffer.from(publicKeySHA256)).digest('hex')
|
||||
this.publicKeyHash = _publicKeyHash
|
||||
this.publicKeyHash = new RIPEMD160().update(Buffer.from(publicKeySHA256)).digest('hex')
|
||||
}
|
||||
|
||||
generateMainnetMasterPrivateKey() {
|
||||
@ -505,8 +504,7 @@ export default class AltcoinHDWallet {
|
||||
|
||||
// PublicKey Hash
|
||||
const childPublicKeySHA256 = new Sha256().process(new Uint8Array(this.childPublicKey)).finish().result
|
||||
const _childPublicKeyHash = new RIPEMD160().update(Buffer.from(childPublicKeySHA256)).digest('hex')
|
||||
this.childPublicKeyHash = _childPublicKeyHash
|
||||
this.childPublicKeyHash = new RIPEMD160().update(Buffer.from(childPublicKeySHA256)).digest('hex')
|
||||
|
||||
|
||||
// Call deriveExtendedPublicChildKey // WIll be hardcoding the values...
|
||||
@ -658,8 +656,7 @@ export default class AltcoinHDWallet {
|
||||
|
||||
// PublicKey Hash
|
||||
const grandChildPublicKeySHA256 = new Sha256().process(new Uint8Array(this.grandChildPublicKey)).finish().result
|
||||
const _grandChildPublicKeyHash = new RIPEMD160().update(Buffer.from(grandChildPublicKeySHA256)).digest('hex')
|
||||
this.grandChildPublicKeyHash = _grandChildPublicKeyHash
|
||||
this.grandChildPublicKeyHash = new RIPEMD160().update(Buffer.from(grandChildPublicKeySHA256)).digest('hex')
|
||||
|
||||
|
||||
// Call deriveExtendedPublicChildKey // WIll be hardcoding the values...
|
||||
|
@ -24,6 +24,5 @@ export const createWallet = async (sourceType, source, statusUpdateFn) => {
|
||||
throw 'sourceType ' + sourceType + ' not recognized'
|
||||
}
|
||||
|
||||
const wallet = new PhraseWallet(seed, version)
|
||||
return wallet
|
||||
return new PhraseWallet(seed, version)
|
||||
}
|
||||
|
@ -27,6 +27,5 @@ export const decryptStoredWallet = async (password, wallet, statusFn = () => { }
|
||||
}
|
||||
const sfn5 = get("login.lp16")
|
||||
statusFn(sfn5)
|
||||
const decryptedBytes = AES_CBC.decrypt(encryptedSeedBytes, encryptionKey, false, iv)
|
||||
return decryptedBytes
|
||||
return AES_CBC.decrypt(encryptedSeedBytes, encryptionKey, false, iv)
|
||||
}
|
||||
|
@ -14,8 +14,7 @@ Base64.decode = function (string) {
|
||||
}
|
||||
|
||||
const decoder = new TextDecoder();
|
||||
const decodedString = decoder.decode(bytes);
|
||||
return decodedString;
|
||||
return decoder.decode(bytes);
|
||||
};
|
||||
|
||||
|
||||
|
@ -593,7 +593,7 @@
|
||||
}
|
||||
dst(c1);
|
||||
}
|
||||
if (c2 !== null) dst(c2);
|
||||
if (false) dst(c2);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -2378,7 +2378,7 @@ nacl.verify = function(x, y) {
|
||||
// Zero length arguments are considered not equal.
|
||||
if (x.length === 0 || y.length === 0) return false;
|
||||
if (x.length !== y.length) return false;
|
||||
return (vn(x, 0, y, 0, x.length) === 0) ? true : false;
|
||||
return (vn(x, 0, y, 0, x.length) === 0);
|
||||
};
|
||||
|
||||
nacl.setPRNG = function(fn) {
|
||||
|
@ -21,8 +21,7 @@ export async function request(url, options) {
|
||||
body,
|
||||
}).then(async (response) => {
|
||||
try {
|
||||
const json = await response.clone().json()
|
||||
return json
|
||||
return await response.clone().json()
|
||||
} catch (e) {
|
||||
return await response.text()
|
||||
}
|
||||
|
@ -30,9 +30,7 @@ const signArbitrary = (arbitraryBytesBase58, arbitraryBytesForSigningBase58, non
|
||||
|
||||
const signature = nacl.sign.detached(arbitraryBytesForSigningBuffer, keyPair.privateKey)
|
||||
|
||||
const signedBytes = utils.appendBuffer(arbitraryBytesBuffer, signature)
|
||||
|
||||
return signedBytes
|
||||
return utils.appendBuffer(arbitraryBytesBuffer, signature)
|
||||
}
|
||||
|
||||
export default signArbitrary
|
||||
|
@ -25,9 +25,7 @@ const signArbitraryWithFee = (arbitraryBytesBase58, arbitraryBytesForSigningBase
|
||||
|
||||
const signature = nacl.sign.detached(arbitraryBytesForSigningBuffer, keyPair.privateKey)
|
||||
|
||||
const signedBytes = utils.appendBuffer(arbitraryBytesBuffer, signature)
|
||||
|
||||
return signedBytes
|
||||
return utils.appendBuffer(arbitraryBytesBuffer, signature)
|
||||
}
|
||||
|
||||
export default signArbitraryWithFee
|
||||
|
@ -25,18 +25,14 @@ const signChat = (chatBytes, nonce, keyPair) => {
|
||||
|
||||
const signature = nacl.sign.detached(chatBytesBuffer, keyPair.privateKey)
|
||||
|
||||
const signedBytes = utils.appendBuffer(chatBytesBuffer, signature)
|
||||
|
||||
return signedBytes
|
||||
return utils.appendBuffer(chatBytesBuffer, signature)
|
||||
} else {
|
||||
const chatBytesBuffer = new Uint8Array(chatBytes)
|
||||
chatBytesBuffer.set(_nonce, 112)
|
||||
|
||||
const signature = nacl.sign.detached(chatBytesBuffer, keyPair.privateKey)
|
||||
|
||||
const signedBytes = utils.appendBuffer(chatBytesBuffer, signature)
|
||||
|
||||
return signedBytes
|
||||
return utils.appendBuffer(chatBytesBuffer, signature)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,14 +17,10 @@ const signTradeBotTransaction = (unsignedTxn, keyPair) => {
|
||||
const _privateKey = Object.keys(keyPair.privateKey).map(function (key) { return keyPair.privateKey[key]; })
|
||||
const privateKey = new Uint8Array(_privateKey)
|
||||
const signature = nacl.sign.detached(txnBuffer, privateKey)
|
||||
const signedBytes = utils.appendBuffer(txnBuffer, signature)
|
||||
|
||||
return signedBytes
|
||||
return utils.appendBuffer(txnBuffer, signature)
|
||||
} else {
|
||||
const signature = nacl.sign.detached(txnBuffer, keyPair.privateKey)
|
||||
const signedBytes = utils.appendBuffer(txnBuffer, signature)
|
||||
|
||||
return signedBytes
|
||||
return utils.appendBuffer(txnBuffer, signature)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,8 +9,7 @@ export const cancelAllOffers = async (requestObject) => {
|
||||
|
||||
const getMyOpenOffers = async () => {
|
||||
const res = await request('/crosschain/tradeoffers')
|
||||
const myOpenTradeOrders = await res.filter(order => order.mode === "OFFERING" && order.qortalCreator === address)
|
||||
return myOpenTradeOrders
|
||||
return await res.filter(order => order.mode === "OFFERING" && order.qortalCreator === address)
|
||||
}
|
||||
|
||||
const myOpenOffers = await getMyOpenOffers()
|
||||
|
@ -3,6 +3,5 @@ import Base58 from '../deps/Base58.js'
|
||||
|
||||
export const base58PublicKeyToAddress = (base58pubkey, qora = false) => {
|
||||
const decodePubKey = Base58.decode(base58pubkey)
|
||||
const address = publicKeyToAddress(decodePubKey, qora)
|
||||
return address
|
||||
return publicKeyToAddress(decodePubKey, qora)
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ const generateRollupConfig = (inputFile, outputFile) => {
|
||||
};
|
||||
|
||||
const generateForPlugins = () => {
|
||||
const configs = [
|
||||
return [
|
||||
{
|
||||
in: 'plugins/core/main.src.js',
|
||||
out: 'plugins/core/main.js',
|
||||
@ -162,7 +162,6 @@ const generateForPlugins = () => {
|
||||
path.join(__dirname, file.out)
|
||||
);
|
||||
});
|
||||
return configs;
|
||||
};
|
||||
|
||||
module.exports = generateForPlugins;
|
||||
|
@ -12,19 +12,16 @@ const pluginsController = (type) => {
|
||||
switch (type) {
|
||||
case PLUGINS:
|
||||
const path = require('path')
|
||||
const plugins = [
|
||||
{
|
||||
folder: path.join(__dirname, 'plugins/core'),
|
||||
name: 'core'
|
||||
}
|
||||
]
|
||||
return plugins
|
||||
return [
|
||||
{
|
||||
folder: path.join(__dirname, 'plugins/core'),
|
||||
name: 'core'
|
||||
}
|
||||
]
|
||||
case BUILD:
|
||||
const build = require('./build.js')
|
||||
return build
|
||||
return require('./build.js')
|
||||
case WATCH:
|
||||
const watch = require('./watch.js')
|
||||
return watch
|
||||
return require('./watch.js')
|
||||
default:
|
||||
return
|
||||
}
|
||||
|
@ -80,18 +80,15 @@ class BecomeMinter extends LitElement {
|
||||
}
|
||||
|
||||
async getNodeInfo() {
|
||||
const nodeInfo = await parentEpml.request('apiCall', {
|
||||
return await parentEpml.request('apiCall', {
|
||||
url: `/admin/status`,
|
||||
})
|
||||
|
||||
return nodeInfo
|
||||
}
|
||||
|
||||
async getMintingAcccounts() {
|
||||
const mintingAccountData = await parentEpml.request('apiCall', {
|
||||
return await parentEpml.request('apiCall', {
|
||||
url: `/admin/mintingaccounts`,
|
||||
})
|
||||
return mintingAccountData
|
||||
}
|
||||
|
||||
async atMount() {
|
||||
@ -148,21 +145,18 @@ class BecomeMinter extends LitElement {
|
||||
}
|
||||
|
||||
async getRewardShareRelationship(recipientAddress) {
|
||||
const myRewardShareArray = await parentEpml.request('apiCall', {
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/rewardshares?recipients=${recipientAddress}`,
|
||||
})
|
||||
|
||||
return myRewardShareArray
|
||||
}
|
||||
|
||||
_levelUpBlocks() {
|
||||
let countBlocksString = (
|
||||
return (
|
||||
blocksNeed(0) -
|
||||
(this.addressInfo?.blocksMinted +
|
||||
this.addressInfo?.blocksMintedAdjustment)
|
||||
).toString()
|
||||
return countBlocksString
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -41,9 +41,8 @@ class NotSponsored extends LitElement {
|
||||
const myNode =
|
||||
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
let apiKey = myNode.apiKey
|
||||
return apiKey
|
||||
]
|
||||
return myNode.apiKey
|
||||
}
|
||||
|
||||
addMintingAccount(e) {
|
||||
|
@ -28,12 +28,11 @@ class YesSponsored extends LitElement {
|
||||
static styles = [pageStyles]
|
||||
|
||||
_levelUpBlocks() {
|
||||
let countBlocksString = (
|
||||
return (
|
||||
blocksNeed(0) -
|
||||
(this.addressInfo?.blocksMinted +
|
||||
this.addressInfo?.blocksMintedAdjustment)
|
||||
).toString();
|
||||
return countBlocksString
|
||||
).toString()
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -207,8 +207,7 @@ setOpenGifModal: { attribute: false }
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node];
|
||||
let apiKey = myNode.apiKey;
|
||||
return apiKey;
|
||||
return myNode.apiKey;
|
||||
}
|
||||
|
||||
async getMoreExploreGifs() {
|
||||
@ -281,17 +280,14 @@ setOpenGifModal: { attribute: false }
|
||||
}
|
||||
|
||||
async getMyGifCollections() {
|
||||
const userName = await this.getName(this.selectedAddress.address);
|
||||
this.myAccountName = userName;
|
||||
this.myAccountName = await this.getName(this.selectedAddress.address);
|
||||
if (this.myAccountName) {
|
||||
const getMyGifCollections = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/resources/search?service=GIF_REPOSITORY&query=${this.myAccountName}&apiKey=${this.getApiKey()}`,
|
||||
});
|
||||
const gifCollectionWithMetaData = await this.structureCollections(
|
||||
getMyGifCollections
|
||||
);
|
||||
|
||||
return gifCollectionWithMetaData;
|
||||
return await this.structureCollections(
|
||||
getMyGifCollections
|
||||
);
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
@ -339,10 +335,9 @@ setOpenGifModal: { attribute: false }
|
||||
}
|
||||
);
|
||||
await Promise.all(getSavedGifRepos);
|
||||
const savedCollectionsWithMetaData = await this.structureCollections(
|
||||
savedCollections
|
||||
);
|
||||
return savedCollectionsWithMetaData;
|
||||
return await this.structureCollections(
|
||||
savedCollections
|
||||
);
|
||||
}
|
||||
|
||||
async getName(recipient) {
|
||||
@ -579,8 +574,7 @@ setOpenGifModal: { attribute: false }
|
||||
);
|
||||
parentEpml.request('showSnackBar', get('gifs.gchange20'));
|
||||
this.isSubscribed = true;
|
||||
const savedCollections = await this.getSavedCollections();
|
||||
this.mySubscribedCollections = savedCollections;
|
||||
this.mySubscribedCollections = await this.getSavedCollections();
|
||||
}
|
||||
|
||||
async unsubscribeToCollection() {
|
||||
@ -589,8 +583,7 @@ setOpenGifModal: { attribute: false }
|
||||
);
|
||||
parentEpml.request('showSnackBar', get('gifs.gchange21'));
|
||||
this.isSubscribed = false;
|
||||
const savedCollections = await this.getSavedCollections();
|
||||
this.mySubscribedCollections = savedCollections;
|
||||
this.mySubscribedCollections = await this.getSavedCollections();
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -70,8 +70,7 @@ class ChatGifsExplore extends LitElement {
|
||||
}
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = myNode.apiKey
|
||||
return apiKey
|
||||
return myNode.apiKey
|
||||
}
|
||||
|
||||
async searchCollections() {
|
||||
@ -120,8 +119,7 @@ class ChatGifsExplore extends LitElement {
|
||||
class='clear-search-icon'
|
||||
@click=${async () => {
|
||||
if (this.isLoading) return;
|
||||
const latestCollections = await this.getAllCollections();
|
||||
this.exploreCollections = latestCollections;
|
||||
this.exploreCollections = await this.getAllCollections();
|
||||
this.searchCollectionName = '';
|
||||
this.isSearched = false;
|
||||
}}
|
||||
|
@ -105,11 +105,10 @@ class ChatGroupInvites extends LitElement {
|
||||
}
|
||||
|
||||
async getLastRef() {
|
||||
let myRef = await parentEpml.request("apiCall", {
|
||||
return await parentEpml.request("apiCall", {
|
||||
type: "api",
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`,
|
||||
})
|
||||
return myRef
|
||||
}
|
||||
|
||||
getTxnRequestResponse(txnResponse, reference) {
|
||||
@ -125,13 +124,12 @@ class ChatGroupInvites extends LitElement {
|
||||
}
|
||||
|
||||
async convertBytesForSigning(transactionBytesBase58) {
|
||||
let convertedBytes = await parentEpml.request("apiCall", {
|
||||
return await parentEpml.request("apiCall", {
|
||||
type: "api",
|
||||
method: "POST",
|
||||
url: `/transactions/convert`,
|
||||
body: `${transactionBytesBase58}`,
|
||||
})
|
||||
return convertedBytes
|
||||
}
|
||||
|
||||
async signTx(body){
|
||||
@ -204,11 +202,10 @@ class ChatGroupInvites extends LitElement {
|
||||
}
|
||||
const bodyToString2 = JSON.stringify(body2)
|
||||
let signTransaction = await this.signTx(bodyToString2)
|
||||
let processTransaction = await this.process(signTransaction)
|
||||
return processTransaction
|
||||
return await this.process(signTransaction)
|
||||
}
|
||||
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
}
|
||||
|
||||
async _removeAdmin(groupId) {
|
||||
@ -261,11 +258,10 @@ class ChatGroupInvites extends LitElement {
|
||||
}
|
||||
const bodyToString2 = JSON.stringify(body2)
|
||||
let signTransaction = await this.signTx(bodyToString2)
|
||||
let processTransaction = await this.process(signTransaction)
|
||||
return processTransaction
|
||||
return await this.process(signTransaction)
|
||||
}
|
||||
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -242,14 +242,10 @@ class ChatGroupsManager extends LitElement {
|
||||
let endpoint = `/groups`
|
||||
|
||||
|
||||
const groups = await parentEpml.request('apiCall', {
|
||||
this.groups = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: endpoint,
|
||||
});
|
||||
|
||||
let list = groups
|
||||
|
||||
this.groups = list
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
@ -115,11 +115,10 @@ class ChatGroupSettings extends LitElement {
|
||||
|
||||
// Get Last Ref
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
};
|
||||
|
||||
const validateReceiver = async () => {
|
||||
@ -129,13 +128,12 @@ class ChatGroupSettings extends LitElement {
|
||||
|
||||
}
|
||||
const convertBytesForSigning = async (transactionBytesBase58) => {
|
||||
let convertedBytes = await parentEpml.request("apiCall", {
|
||||
type: "api",
|
||||
method: "POST",
|
||||
url: `/transactions/convert`,
|
||||
body: `${transactionBytesBase58}`,
|
||||
})
|
||||
return convertedBytes
|
||||
return await parentEpml.request("apiCall", {
|
||||
type: "api",
|
||||
method: "POST",
|
||||
url: `/transactions/convert`,
|
||||
body: `${transactionBytesBase58}`,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -193,22 +191,21 @@ class ChatGroupSettings extends LitElement {
|
||||
// })
|
||||
// return processTransaction
|
||||
console.log('this.selectedAddress.nonce', this.selectedAddress.nonce)
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 23,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
_groupId: groupId,
|
||||
lastReference: lastRef,
|
||||
fee: leaveFeeInput,
|
||||
"newOwner": "QdR4bQ1fJFnSZgswtW27eE8ToXwHqUQyaU",
|
||||
"newIsOpen": false,
|
||||
"newDescription": "my group for accounts I like",
|
||||
"newApprovalThreshold": "NONE",
|
||||
"newMinimumBlockDelay": 5,
|
||||
"newMaximumBlockDelay": 60
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 23,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
_groupId: groupId,
|
||||
lastReference: lastRef,
|
||||
fee: leaveFeeInput,
|
||||
"newOwner": "QdR4bQ1fJFnSZgswtW27eE8ToXwHqUQyaU",
|
||||
"newIsOpen": false,
|
||||
"newDescription": "my group for accounts I like",
|
||||
"newApprovalThreshold": "NONE",
|
||||
"newMinimumBlockDelay": 5,
|
||||
"newMaximumBlockDelay": 60
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -223,7 +220,7 @@ class ChatGroupSettings extends LitElement {
|
||||
throw new Error(txnResponse)
|
||||
}
|
||||
}
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -68,17 +68,15 @@ class ChatGroupsManagement extends LitElement {
|
||||
}
|
||||
|
||||
async getJoinedGroups(){
|
||||
let joinedG = await parentEpml.request('apiCall', {
|
||||
url: `/groups/member/${this.selectedAddress.address}`
|
||||
})
|
||||
return joinedG
|
||||
return await parentEpml.request('apiCall', {
|
||||
url: `/groups/member/${this.selectedAddress.address}`
|
||||
})
|
||||
}
|
||||
|
||||
async firstUpdated() {
|
||||
|
||||
try {
|
||||
let _joinedGroups = await this.getJoinedGroups()
|
||||
this.joinedGroups = _joinedGroups
|
||||
this.joinedGroups = await this.getJoinedGroups()
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
@ -161,11 +159,10 @@ class ChatGroupsManagement extends LitElement {
|
||||
|
||||
// Get Last Ref
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
};
|
||||
|
||||
const validateReceiver = async () => {
|
||||
@ -179,20 +176,19 @@ class ChatGroupsManagement extends LitElement {
|
||||
const makeTransactionRequest = async (lastRef) => {
|
||||
let groupdialog3 = get("transactions.groupdialog3")
|
||||
let groupdialog4 = get("transactions.groupdialog4")
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 32,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: leaveFeeInput,
|
||||
registrantAddress: this.selectedAddress.address,
|
||||
rGroupName: groupName,
|
||||
rGroupId: groupId,
|
||||
lastReference: lastRef,
|
||||
groupdialog3: groupdialog3,
|
||||
groupdialog4: groupdialog4,
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 32,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: leaveFeeInput,
|
||||
registrantAddress: this.selectedAddress.address,
|
||||
rGroupName: groupName,
|
||||
rGroupId: groupId,
|
||||
lastReference: lastRef,
|
||||
groupdialog3: groupdialog3,
|
||||
groupdialog4: groupdialog4,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -211,7 +207,7 @@ class ChatGroupsManagement extends LitElement {
|
||||
throw new Error(txnResponse)
|
||||
}
|
||||
}
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
}
|
||||
|
||||
nameRenderer(person){
|
||||
|
@ -116,13 +116,10 @@ export class ChatImage extends LitElement {
|
||||
getNodeUrl(){
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
|
||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
return nodeUrl
|
||||
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
}
|
||||
getMyNode(){
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
|
||||
return myNode
|
||||
return window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
}
|
||||
|
||||
getApiKey() {
|
||||
@ -130,8 +127,7 @@ getMyNode(){
|
||||
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
let apiKey = myNode.apiKey;
|
||||
return apiKey;
|
||||
return myNode.apiKey;
|
||||
}
|
||||
|
||||
async fetchResource() {
|
||||
@ -148,7 +144,7 @@ getMyNode(){
|
||||
|
||||
async fetchVideoUrl() {
|
||||
|
||||
this.fetchResource()
|
||||
await this.fetchResource()
|
||||
this.url = `${this.nodeUrl}/arbitrary/${this.resource.service}/${this.resource.name}/${this.resource.identifier}?async=true&apiKey=${this.myNode.apiKey}`
|
||||
|
||||
}
|
||||
@ -201,7 +197,7 @@ getMyNode(){
|
||||
|
||||
this.status = res
|
||||
if(this.status.status === 'DOWNLOADED'){
|
||||
this.fetchResource()
|
||||
await this.fetchResource()
|
||||
}
|
||||
}
|
||||
|
||||
@ -216,12 +212,12 @@ getMyNode(){
|
||||
|
||||
async _fetchImage() {
|
||||
try {
|
||||
this.fetchVideoUrl({
|
||||
name: this.resource.name,
|
||||
service: this.resource.service,
|
||||
identifier: this.resource.identifier
|
||||
})
|
||||
this.fetchStatus()
|
||||
await this.fetchVideoUrl({
|
||||
name: this.resource.name,
|
||||
service: this.resource.service,
|
||||
identifier: this.resource.identifier
|
||||
})
|
||||
await this.fetchStatus()
|
||||
} catch (error) { /* empty */ }
|
||||
}
|
||||
|
||||
|
@ -134,11 +134,10 @@ class ChatLeaveGroup extends LitElement {
|
||||
|
||||
// Get Last Ref
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
};
|
||||
|
||||
const validateReceiver = async () => {
|
||||
@ -152,20 +151,19 @@ class ChatLeaveGroup extends LitElement {
|
||||
const makeTransactionRequest = async (lastRef) => {
|
||||
let groupdialog3 = get("transactions.groupdialog3")
|
||||
let groupdialog4 = get("transactions.groupdialog4")
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 32,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: leaveFeeInput,
|
||||
registrantAddress: this.selectedAddress.address,
|
||||
rGroupName: groupName,
|
||||
rGroupId: groupId,
|
||||
lastReference: lastRef,
|
||||
groupdialog3: groupdialog3,
|
||||
groupdialog4: groupdialog4,
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 32,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: leaveFeeInput,
|
||||
registrantAddress: this.selectedAddress.address,
|
||||
rGroupName: groupName,
|
||||
rGroupId: groupId,
|
||||
lastReference: lastRef,
|
||||
groupdialog3: groupdialog3,
|
||||
groupdialog4: groupdialog4,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -184,7 +182,7 @@ class ChatLeaveGroup extends LitElement {
|
||||
throw new Error(txnResponse)
|
||||
}
|
||||
}
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -159,11 +159,11 @@ class ChatModals extends LitElement {
|
||||
} else if (addressPublicKey !== false) {
|
||||
isEncrypted = 1
|
||||
_publicKey = addressPublicKey
|
||||
sendMessageRequest(isEncrypted, _publicKey)
|
||||
await sendMessageRequest(isEncrypted, _publicKey)
|
||||
} else {
|
||||
isEncrypted = 0
|
||||
_publicKey = this.selectedAddress.address
|
||||
sendMessageRequest(isEncrypted, _publicKey)
|
||||
await sendMessageRequest(isEncrypted, _publicKey)
|
||||
}
|
||||
};
|
||||
|
||||
@ -190,7 +190,7 @@ class ChatModals extends LitElement {
|
||||
isText: 1
|
||||
}
|
||||
})
|
||||
_computePow(chatResponse)
|
||||
await _computePow(chatResponse)
|
||||
}
|
||||
|
||||
const _computePow = async (chatBytes) => {
|
||||
@ -237,7 +237,7 @@ class ChatModals extends LitElement {
|
||||
}
|
||||
|
||||
}
|
||||
getAddressPublicKey()
|
||||
await getAddressPublicKey()
|
||||
}
|
||||
|
||||
_textArea(e) {
|
||||
@ -246,8 +246,7 @@ class ChatModals extends LitElement {
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = myNode.apiKey
|
||||
return apiKey
|
||||
return myNode.apiKey
|
||||
}
|
||||
|
||||
getChatBlockedList() {
|
||||
@ -291,10 +290,9 @@ class ChatModals extends LitElement {
|
||||
}
|
||||
|
||||
async getChatBlockedAdresses() {
|
||||
const chatBlockedAdresses = await parentEpml.request('apiCall', {
|
||||
url: `/lists/blockedAddresses?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
this.chatBlockedAdresses = chatBlockedAdresses
|
||||
this.chatBlockedAdresses = await parentEpml.request('apiCall', {
|
||||
url: `/lists/blockedAddresses?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
@ -245,17 +245,12 @@ class ChatPage extends LitElement {
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
|
||||
const nodeUrl =
|
||||
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
||||
return nodeUrl;
|
||||
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
||||
}
|
||||
getMyNode() {
|
||||
const myNode =
|
||||
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
return window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
|
||||
return myNode;
|
||||
}
|
||||
|
||||
setOpenGifModal(value) {
|
||||
@ -362,7 +357,7 @@ class ChatPage extends LitElement {
|
||||
})
|
||||
|
||||
}
|
||||
this.processMessages(getInitialMessages, true, false)
|
||||
await this.processMessages(getInitialMessages, true, false)
|
||||
} catch (error) { /* empty */ }
|
||||
}
|
||||
|
||||
@ -1105,8 +1100,7 @@ class ChatPage extends LitElement {
|
||||
const handleTransferIntoURL = (dataTransfer) => {
|
||||
try {
|
||||
const [firstItem] = dataTransfer.items
|
||||
const blob = firstItem.getAsFile()
|
||||
return blob
|
||||
return firstItem.getAsFile()
|
||||
} catch (error) { /* empty */ }
|
||||
}
|
||||
if (event.clipboardData) {
|
||||
@ -1267,7 +1261,7 @@ class ChatPage extends LitElement {
|
||||
}
|
||||
delete message.reactions
|
||||
const stringifyMessageObject = JSON.stringify(message)
|
||||
this.sendMessage({messageText: stringifyMessageObject, chatReference: undefined, isForward: true})
|
||||
await this.sendMessage({messageText: stringifyMessageObject, chatReference: undefined, isForward: true})
|
||||
} catch (error) { /* empty */ }
|
||||
}
|
||||
|
||||
@ -1343,13 +1337,12 @@ class ChatPage extends LitElement {
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
const isRecipient = this.chatId.includes('direct') === true ? true : false
|
||||
const isRecipient = this.chatId.includes('direct') === true
|
||||
this.chatId.includes('direct') === true ? this.isReceipient = true : this.isReceipient = false
|
||||
this._chatId = this.chatId.split('/')[1]
|
||||
|
||||
const mstring = get("chatpage.cchange8")
|
||||
const placeholder = isRecipient === true ? `Message ${this._chatId}` : `${mstring}`
|
||||
this.chatEditorPlaceholder = placeholder
|
||||
this.chatEditorPlaceholder = isRecipient === true ? `Message ${this._chatId}` : `${mstring}`
|
||||
|
||||
isRecipient ? getAddressPublicKey() : this.fetchChatMessages(this._chatId)
|
||||
|
||||
@ -1358,7 +1351,7 @@ class ChatPage extends LitElement {
|
||||
}, 100)
|
||||
|
||||
|
||||
const isRecipient = this.chatId.includes('direct') === true ? true : false
|
||||
const isRecipient = this.chatId.includes('direct') === true
|
||||
const groupId = this.chatId.split('/')[1]
|
||||
if (!isRecipient && groupId.toString() !== '0') {
|
||||
|
||||
@ -1438,7 +1431,7 @@ class ChatPage extends LitElement {
|
||||
const isEnabledChatEnter = localStorage.getItem('isEnabledChatEnter')
|
||||
|
||||
if (isEnabledChatEnter) {
|
||||
this.isEnabledChatEnter = isEnabledChatEnter === 'false' ? false : true
|
||||
this.isEnabledChatEnter = isEnabledChatEnter !== 'false'
|
||||
}
|
||||
|
||||
}
|
||||
@ -1474,7 +1467,7 @@ class ChatPage extends LitElement {
|
||||
const previousChatId = changedProperties.get('chatId');
|
||||
|
||||
this.isLoadingMessages = true
|
||||
this.initUpdate()
|
||||
await this.initUpdate()
|
||||
|
||||
|
||||
if (previousChatId) {
|
||||
@ -1541,8 +1534,7 @@ class ChatPage extends LitElement {
|
||||
userName = await getName(this._chatId)
|
||||
}
|
||||
const mstring = get("chatpage.cchange8")
|
||||
const placeholder = this.isReceipient === true ? `Message ${userName ? userName : this._chatId}` : `${mstring}`
|
||||
return placeholder
|
||||
return this.isReceipient === true ? `Message ${userName ? userName : this._chatId}` : `${mstring}`
|
||||
}
|
||||
|
||||
renderChatScroller() {
|
||||
@ -1649,14 +1641,14 @@ class ChatPage extends LitElement {
|
||||
})
|
||||
|
||||
|
||||
queue.push(() => replaceMessagesEdited({
|
||||
decodedMessages: decodeMsgs,
|
||||
parentEpml,
|
||||
isReceipient: this.isReceipient,
|
||||
decodeMessageFunc: this.decodeMessage,
|
||||
_publicKey: this._publicKey,
|
||||
addToUpdateMessageHashmap: this.addToUpdateMessageHashmap
|
||||
}));
|
||||
await queue.push(() => replaceMessagesEdited({
|
||||
decodedMessages: decodeMsgs,
|
||||
parentEpml,
|
||||
isReceipient: this.isReceipient,
|
||||
decodeMessageFunc: this.decodeMessage,
|
||||
_publicKey: this._publicKey,
|
||||
addToUpdateMessageHashmap: this.addToUpdateMessageHashmap
|
||||
}));
|
||||
|
||||
|
||||
let list = [...decodeMsgs]
|
||||
@ -1715,14 +1707,14 @@ class ChatPage extends LitElement {
|
||||
}
|
||||
})
|
||||
|
||||
queue.push(() => replaceMessagesEdited({
|
||||
decodedMessages: decodeMsgs,
|
||||
parentEpml,
|
||||
isReceipient: this.isReceipient,
|
||||
decodeMessageFunc: this.decodeMessage,
|
||||
_publicKey: this._publicKey,
|
||||
addToUpdateMessageHashmap: this.addToUpdateMessageHashmap
|
||||
}));
|
||||
await queue.push(() => replaceMessagesEdited({
|
||||
decodedMessages: decodeMsgs,
|
||||
parentEpml,
|
||||
isReceipient: this.isReceipient,
|
||||
decodeMessageFunc: this.decodeMessage,
|
||||
_publicKey: this._publicKey,
|
||||
addToUpdateMessageHashmap: this.addToUpdateMessageHashmap
|
||||
}));
|
||||
|
||||
|
||||
let list = [...decodeMsgs]
|
||||
@ -1789,14 +1781,14 @@ class ChatPage extends LitElement {
|
||||
}
|
||||
})
|
||||
|
||||
queue.push(() => replaceMessagesEdited({
|
||||
decodedMessages: decodeMsgs,
|
||||
parentEpml,
|
||||
isReceipient: this.isReceipient,
|
||||
decodeMessageFunc: this.decodeMessage,
|
||||
_publicKey: this._publicKey,
|
||||
addToUpdateMessageHashmap: this.addToUpdateMessageHashmap
|
||||
}));
|
||||
await queue.push(() => replaceMessagesEdited({
|
||||
decodedMessages: decodeMsgs,
|
||||
parentEpml,
|
||||
isReceipient: this.isReceipient,
|
||||
decodeMessageFunc: this.decodeMessage,
|
||||
_publicKey: this._publicKey,
|
||||
addToUpdateMessageHashmap: this.addToUpdateMessageHashmap
|
||||
}));
|
||||
|
||||
let list = [...decodeMsgs]
|
||||
|
||||
@ -1841,14 +1833,14 @@ class ChatPage extends LitElement {
|
||||
})
|
||||
|
||||
|
||||
queue.push(() => replaceMessagesEdited({
|
||||
decodedMessages: decodeMsgs,
|
||||
parentEpml,
|
||||
isReceipient: this.isReceipient,
|
||||
decodeMessageFunc: this.decodeMessage,
|
||||
_publicKey: this._publicKey,
|
||||
addToUpdateMessageHashmap: this.addToUpdateMessageHashmap
|
||||
}));
|
||||
await queue.push(() => replaceMessagesEdited({
|
||||
decodedMessages: decodeMsgs,
|
||||
parentEpml,
|
||||
isReceipient: this.isReceipient,
|
||||
decodeMessageFunc: this.decodeMessage,
|
||||
_publicKey: this._publicKey,
|
||||
addToUpdateMessageHashmap: this.addToUpdateMessageHashmap
|
||||
}));
|
||||
let list = [...decodeMsgs]
|
||||
|
||||
|
||||
@ -1900,14 +1892,14 @@ class ChatPage extends LitElement {
|
||||
})
|
||||
|
||||
|
||||
queue.push(() => replaceMessagesEdited({
|
||||
decodedMessages: decodeMsgs,
|
||||
parentEpml,
|
||||
isReceipient: this.isReceipient,
|
||||
decodeMessageFunc: this.decodeMessage,
|
||||
_publicKey: this._publicKey,
|
||||
addToUpdateMessageHashmap: this.addToUpdateMessageHashmap
|
||||
}));
|
||||
await queue.push(() => replaceMessagesEdited({
|
||||
decodedMessages: decodeMsgs,
|
||||
parentEpml,
|
||||
isReceipient: this.isReceipient,
|
||||
decodeMessageFunc: this.decodeMessage,
|
||||
_publicKey: this._publicKey,
|
||||
addToUpdateMessageHashmap: this.addToUpdateMessageHashmap
|
||||
}));
|
||||
|
||||
let list = [ ...decodeMsgs]
|
||||
|
||||
@ -1959,14 +1951,14 @@ class ChatPage extends LitElement {
|
||||
})
|
||||
|
||||
|
||||
queue.push(() => replaceMessagesEdited({
|
||||
decodedMessages: decodeMsgs,
|
||||
parentEpml,
|
||||
isReceipient: this.isReceipient,
|
||||
decodeMessageFunc: this.decodeMessage,
|
||||
_publicKey: this._publicKey,
|
||||
addToUpdateMessageHashmap: this.addToUpdateMessageHashmap
|
||||
}));
|
||||
await queue.push(() => replaceMessagesEdited({
|
||||
decodedMessages: decodeMsgs,
|
||||
parentEpml,
|
||||
isReceipient: this.isReceipient,
|
||||
decodeMessageFunc: this.decodeMessage,
|
||||
_publicKey: this._publicKey,
|
||||
addToUpdateMessageHashmap: this.addToUpdateMessageHashmap
|
||||
}));
|
||||
|
||||
|
||||
|
||||
@ -2072,14 +2064,14 @@ class ChatPage extends LitElement {
|
||||
|
||||
|
||||
try {
|
||||
queue.push(() => replaceMessagesEdited({
|
||||
decodedMessages: decodedMessages,
|
||||
parentEpml,
|
||||
isReceipient: isReceipient,
|
||||
decodeMessageFunc: this.decodeMessage,
|
||||
_publicKey: this._publicKey,
|
||||
addToUpdateMessageHashmap: this.addToUpdateMessageHashmap
|
||||
}));
|
||||
await queue.push(() => replaceMessagesEdited({
|
||||
decodedMessages: decodedMessages,
|
||||
parentEpml,
|
||||
isReceipient: isReceipient,
|
||||
decodeMessageFunc: this.decodeMessage,
|
||||
_publicKey: this._publicKey,
|
||||
addToUpdateMessageHashmap: this.addToUpdateMessageHashmap
|
||||
}));
|
||||
} catch (error) {
|
||||
console.log({error})
|
||||
}
|
||||
@ -2133,15 +2125,15 @@ class ChatPage extends LitElement {
|
||||
setTimeout(() => this.downElementObserver(), 500)
|
||||
} else {
|
||||
|
||||
queue.push(() => replaceMessagesEdited({
|
||||
decodedMessages: decodedMessages,
|
||||
parentEpml,
|
||||
isReceipient: isReceipient,
|
||||
decodeMessageFunc: this.decodeMessage,
|
||||
_publicKey: this._publicKey,
|
||||
isNotInitial: true,
|
||||
addToUpdateMessageHashmap: this.addToUpdateMessageHashmap
|
||||
}));
|
||||
await queue.push(() => replaceMessagesEdited({
|
||||
decodedMessages: decodedMessages,
|
||||
parentEpml,
|
||||
isReceipient: isReceipient,
|
||||
decodeMessageFunc: this.decodeMessage,
|
||||
_publicKey: this._publicKey,
|
||||
isNotInitial: true,
|
||||
addToUpdateMessageHashmap: this.addToUpdateMessageHashmap
|
||||
}));
|
||||
|
||||
const renderEachMessage = decodedMessages.map(async (msg) => {
|
||||
await this.renderNewMessage(msg)
|
||||
@ -2364,14 +2356,14 @@ class ChatPage extends LitElement {
|
||||
|
||||
|
||||
|
||||
this.processMessages(getInitialMessages, true, isUnread, count)
|
||||
await this.processMessages(getInitialMessages, true, isUnread, count)
|
||||
|
||||
initial = initial + 1
|
||||
|
||||
} else {
|
||||
try {
|
||||
if (e.data) {
|
||||
this.processMessages(JSON.parse(e.data), false)
|
||||
await this.processMessages(JSON.parse(e.data), false)
|
||||
}
|
||||
} catch (error) { /* empty */ }
|
||||
}
|
||||
@ -2492,13 +2484,13 @@ class ChatPage extends LitElement {
|
||||
|
||||
|
||||
|
||||
this.processMessages(getInitialMessages, true, isUnread, count)
|
||||
await this.processMessages(getInitialMessages, true, isUnread, count)
|
||||
|
||||
initial = initial + 1
|
||||
} else {
|
||||
try {
|
||||
if (e.data) {
|
||||
this.processMessages(JSON.parse(e.data), false)
|
||||
await this.processMessages(JSON.parse(e.data), false)
|
||||
}
|
||||
} catch (error) { /* empty */ }
|
||||
}
|
||||
@ -2528,7 +2520,7 @@ class ChatPage extends LitElement {
|
||||
|
||||
if (chatId !== undefined) {
|
||||
if (this.isReceipient) {
|
||||
initDirect(chatId)
|
||||
await initDirect(chatId)
|
||||
} else {
|
||||
let groupChatId = Number(chatId)
|
||||
initGroup(groupChatId)
|
||||
@ -2646,8 +2638,7 @@ class ChatPage extends LitElement {
|
||||
byteArrays.push(byteArray)
|
||||
}
|
||||
|
||||
const blob = new Blob(byteArrays, { type: contentType })
|
||||
return blob
|
||||
return new Blob(byteArrays, {type: contentType})
|
||||
}
|
||||
const blob = b64toBlob(str, 'image/png')
|
||||
await new Promise(resolve => {
|
||||
@ -2655,11 +2646,9 @@ class ChatPage extends LitElement {
|
||||
quality: 0.6,
|
||||
maxWidth: 500,
|
||||
success(result) {
|
||||
const file = new File([result], "name", {
|
||||
type: 'image/png'
|
||||
})
|
||||
|
||||
compressedFile = file
|
||||
compressedFile = new File([result], "name", {
|
||||
type: 'image/png'
|
||||
})
|
||||
resolve()
|
||||
},
|
||||
error() {
|
||||
@ -2701,8 +2690,7 @@ class ChatPage extends LitElement {
|
||||
|
||||
let message = ""
|
||||
try {
|
||||
const parsedMessageObj = JSON.parse(outSideMsg.editedMessageObj.decodedMessage)
|
||||
message = parsedMessageObj
|
||||
message = JSON.parse(outSideMsg.editedMessageObj.decodedMessage)
|
||||
} catch (error) {
|
||||
message = outSideMsg.editedMessageObj.decodedMessage
|
||||
}
|
||||
@ -2742,8 +2730,7 @@ class ChatPage extends LitElement {
|
||||
byteArrays.push(byteArray)
|
||||
}
|
||||
|
||||
const blob = new Blob(byteArrays, { type: contentType })
|
||||
return blob
|
||||
return new Blob(byteArrays, {type: contentType})
|
||||
}
|
||||
|
||||
const blob = b64toBlob(str, 'image/png')
|
||||
@ -2752,11 +2739,9 @@ class ChatPage extends LitElement {
|
||||
quality: 0.6,
|
||||
maxWidth: 500,
|
||||
success(result) {
|
||||
const file = new File([result], "name", {
|
||||
type: 'image/png'
|
||||
})
|
||||
|
||||
compressedFile = file
|
||||
compressedFile = new File([result], "name", {
|
||||
type: 'image/png'
|
||||
})
|
||||
resolve()
|
||||
},
|
||||
error() {
|
||||
@ -2798,8 +2783,7 @@ class ChatPage extends LitElement {
|
||||
|
||||
let message = ""
|
||||
try {
|
||||
const parsedMessageObj = JSON.parse(outSideMsg.editedMessageObj.decodedMessage)
|
||||
message = parsedMessageObj
|
||||
message = JSON.parse(outSideMsg.editedMessageObj.decodedMessage)
|
||||
|
||||
} catch (error) {
|
||||
message = outSideMsg.editedMessageObj.decodedMessage
|
||||
@ -2862,10 +2846,9 @@ class ChatPage extends LitElement {
|
||||
maxWidth: 1200,
|
||||
mimeType: 'image/webp',
|
||||
success(result) {
|
||||
const file = new File([result], "name", {
|
||||
type: 'image/webp'
|
||||
})
|
||||
compressedFile = file
|
||||
compressedFile = new File([result], "name", {
|
||||
type: 'image/webp'
|
||||
})
|
||||
resolve()
|
||||
},
|
||||
error() {
|
||||
@ -3021,8 +3004,7 @@ class ChatPage extends LitElement {
|
||||
let message = ""
|
||||
|
||||
try {
|
||||
const parsedMessageObj = JSON.parse(outSideMsg.editedMessageObj.decodedMessage)
|
||||
message = parsedMessageObj
|
||||
message = JSON.parse(outSideMsg.editedMessageObj.decodedMessage)
|
||||
} catch (error) {
|
||||
message = outSideMsg.editedMessageObj.decodedMessage
|
||||
}
|
||||
@ -3090,8 +3072,7 @@ class ChatPage extends LitElement {
|
||||
|
||||
let message = ""
|
||||
try {
|
||||
const parsedMessageObj = JSON.parse(this.editedMessageObj.decodedMessage)
|
||||
message = parsedMessageObj
|
||||
message = JSON.parse(this.editedMessageObj.decodedMessage)
|
||||
|
||||
} catch (error) {
|
||||
message = this.editedMessageObj.decodedMessage
|
||||
@ -3286,7 +3267,7 @@ class ChatPage extends LitElement {
|
||||
} catch (error) { /* empty */ }
|
||||
}
|
||||
|
||||
const isRecipient = this.forwardActiveChatHeadUrl.url.includes('direct') === true ? true : false
|
||||
const isRecipient = this.forwardActiveChatHeadUrl.url.includes('direct') === true
|
||||
|
||||
const recipientAddress = this.forwardActiveChatHeadUrl.url.split('/')[1]
|
||||
this.openForwardOpen = false
|
||||
@ -3313,7 +3294,7 @@ class ChatPage extends LitElement {
|
||||
isText: 1
|
||||
}
|
||||
})
|
||||
_computePow(chatResponse, true)
|
||||
await _computePow(chatResponse, true)
|
||||
} else {
|
||||
let groupResponse = await parentEpml.request('chat', {
|
||||
type: 181,
|
||||
@ -3331,7 +3312,7 @@ class ChatPage extends LitElement {
|
||||
isText: 1
|
||||
}
|
||||
})
|
||||
_computePow(groupResponse, true)
|
||||
await _computePow(groupResponse, true)
|
||||
}
|
||||
}
|
||||
|
||||
@ -3411,7 +3392,7 @@ class ChatPage extends LitElement {
|
||||
}
|
||||
|
||||
if (isForward) {
|
||||
sendForwardRequest()
|
||||
await sendForwardRequest()
|
||||
return
|
||||
}
|
||||
return sendMessageRequest()
|
||||
|
@ -194,8 +194,7 @@ class ChatRightPanel extends LitElement {
|
||||
async updated(changedProperties) {
|
||||
if (changedProperties && changedProperties.has('selectedHead')) {
|
||||
if (this.selectedHead !== {}) {
|
||||
const userName = await getUserNameFromAddress(this.selectedHead.address);
|
||||
this.userName = userName;
|
||||
this.userName = await getUserNameFromAddress(this.selectedHead.address);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -279,11 +279,11 @@ class ChatRightPanelResources extends LitElement {
|
||||
async updated(changedProperties) {
|
||||
if (changedProperties && changedProperties.has('_chatId')) {
|
||||
this.images = [];
|
||||
this.getMoreImages(true);
|
||||
await this.getMoreImages(true);
|
||||
}
|
||||
|
||||
if (changedProperties && changedProperties.has('onlyMyImages')) {
|
||||
this.getMoreImages(true)
|
||||
await this.getMoreImages(true)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,8 +40,7 @@ const getApiKey = () => {
|
||||
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
let apiKey = myNode.apiKey;
|
||||
return apiKey;
|
||||
return myNode.apiKey;
|
||||
};
|
||||
|
||||
const extractComponents = async (url) => {
|
||||
@ -559,11 +558,11 @@ class ChatScroller extends LitElement {
|
||||
|
||||
|
||||
// Using map to return a new array, rather than mutating the old one
|
||||
const newMessagesToRender = this.messagesToRender.map((group) => {
|
||||
this.messagesToRender = this.messagesToRender.map((group) => {
|
||||
// For each message, return the updated message if it exists, otherwise return the original message
|
||||
const updatedGroupMessages = group.messages.map((message) => {
|
||||
return updatedMessages[message.signature]
|
||||
? { ...message, ...updatedMessages[message.signature] }
|
||||
? {...message, ...updatedMessages[message.signature]}
|
||||
: message;
|
||||
});
|
||||
|
||||
@ -573,8 +572,6 @@ class ChatScroller extends LitElement {
|
||||
messages: updatedGroupMessages,
|
||||
};
|
||||
});
|
||||
|
||||
this.messagesToRender = newMessagesToRender;
|
||||
this.requestUpdate();
|
||||
await this.updateComplete;
|
||||
|
||||
@ -627,34 +624,34 @@ class ChatScroller extends LitElement {
|
||||
async updated(changedProperties) {
|
||||
if (changedProperties && changedProperties.has('messages')) {
|
||||
if (this.messages.type === 'initial') {
|
||||
this.addNewMessages(this.messages.messages, 'initial');
|
||||
await this.addNewMessages(this.messages.messages, 'initial');
|
||||
} else if (this.messages.type === 'initialLastSeen') {
|
||||
this.newListMessagesUnreadMessages(
|
||||
await this.newListMessagesUnreadMessages(
|
||||
this.messages.messages,
|
||||
'initialLastSeen',
|
||||
this.messages.lastReadMessageTimestamp,
|
||||
this.messages.count
|
||||
);
|
||||
} else if (this.messages.type === 'new')
|
||||
this.addNewMessages(this.messages.messages);
|
||||
await this.addNewMessages(this.messages.messages);
|
||||
else if (this.messages.type === 'newComingInAuto')
|
||||
this.addNewMessages(this.messages.messages, 'newComingInAuto');
|
||||
await this.addNewMessages(this.messages.messages, 'newComingInAuto');
|
||||
else if (this.messages.type === 'old')
|
||||
this.prependOldMessages(this.messages.messages);
|
||||
await this.prependOldMessages(this.messages.messages);
|
||||
else if (this.messages.type === 'inBetween')
|
||||
this.newListMessages(
|
||||
await this.newListMessages(
|
||||
this.messages.messages,
|
||||
this.messages.count
|
||||
);
|
||||
else if (this.messages.type === 'update')
|
||||
this.replaceMessagesWithUpdateByArray(this.messages.messages);
|
||||
await this.replaceMessagesWithUpdateByArray(this.messages.messages);
|
||||
}
|
||||
if (
|
||||
changedProperties &&
|
||||
changedProperties.has('updateMessageHash') &&
|
||||
Object.keys(this.updateMessageHash).length > 0
|
||||
) {
|
||||
this.replaceMessagesWithUpdate(this.updateMessageHash);
|
||||
await this.replaceMessagesWithUpdate(this.updateMessageHash);
|
||||
}
|
||||
if (
|
||||
changedProperties &&
|
||||
@ -1401,8 +1398,7 @@ class MessageTemplate extends LitElement {
|
||||
|
||||
if (repliedToData) {
|
||||
try {
|
||||
const parsedMsg = JSON.parse(repliedToData.decodedMessage);
|
||||
repliedToData.decodedMessage = parsedMsg;
|
||||
repliedToData.decodedMessage = JSON.parse(repliedToData.decodedMessage);
|
||||
} catch (error) { /* empty */ }
|
||||
}
|
||||
|
||||
|
@ -376,9 +376,8 @@ class ChatTextEditor extends LitElement {
|
||||
|
||||
getMessageSize(message){
|
||||
try {
|
||||
const messageText = message;
|
||||
// Format and Sanitize Message
|
||||
const sanitizedMessage = messageText.replace(/ /gi, ' ').replace(/<br\s*[\/]?>/gi, '\n');
|
||||
// Format and Sanitize Message
|
||||
const sanitizedMessage = message.replace(/ /gi, ' ').replace(/<br\s*[\/]?>/gi, '\n');
|
||||
const trimmedMessage = sanitizedMessage.trim();
|
||||
let messageObject = {};
|
||||
|
||||
@ -396,8 +395,7 @@ class ChatTextEditor extends LitElement {
|
||||
} else if (this.editedMessageObj) {
|
||||
let message = "";
|
||||
try {
|
||||
const parsedMessageObj = JSON.parse(this.editedMessageObj.decodedMessage);
|
||||
message = parsedMessageObj;
|
||||
message = JSON.parse(this.editedMessageObj.decodedMessage);
|
||||
} catch (error) {
|
||||
message = this.messageObj.decodedMessage
|
||||
}
|
||||
@ -426,8 +424,7 @@ class ChatTextEditor extends LitElement {
|
||||
}
|
||||
|
||||
const stringified = JSON.stringify(messageObject);
|
||||
const size = new Blob([stringified]).size;
|
||||
this.chatMessageSize = size;
|
||||
this.chatMessageSize = new Blob([stringified]).size;
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
@ -626,8 +623,7 @@ class ChatTextEditor extends LitElement {
|
||||
const chatInputValue = editor.getValue();
|
||||
const filteredValue = chatInputValue.replace(/<img.*?alt=".*?/g, '').replace(/".?src=.*?>/g, '');
|
||||
|
||||
let unescapedValue = editorConfig.unescape(filteredValue);
|
||||
editor.mirror.value = unescapedValue;
|
||||
editor.mirror.value = editorConfig.unescape(filteredValue);
|
||||
};
|
||||
|
||||
ChatEditor.prototype.listenChanges = function () {
|
||||
|
@ -699,8 +699,7 @@ mwc-checkbox::shadow, mdc-checkbox::after, mwc-checkbox::shadow, mdc-checkbox::b
|
||||
} else if (this.editedMessageObj) {
|
||||
let message = "";
|
||||
try {
|
||||
const parsedMessageObj = JSON.parse(this.editedMessageObj.decodedMessage);
|
||||
message = parsedMessageObj;
|
||||
message = JSON.parse(this.editedMessageObj.decodedMessage);
|
||||
} catch (error) {
|
||||
message = this.messageObj.decodedMessage
|
||||
}
|
||||
@ -742,8 +741,7 @@ mwc-checkbox::shadow, mdc-checkbox::after, mwc-checkbox::shadow, mdc-checkbox::b
|
||||
}
|
||||
|
||||
const stringified = JSON.stringify(messageObject);
|
||||
const size = new Blob([stringified]).size;
|
||||
this.chatMessageSize = size;
|
||||
this.chatMessageSize = new Blob([stringified]).size;
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
|
@ -406,11 +406,11 @@ class ChatWelcomePage extends LitElement {
|
||||
} else if (addressPublicKey !== false) {
|
||||
isEncrypted = 1;
|
||||
_publicKey = addressPublicKey;
|
||||
sendMessageRequest(isEncrypted, _publicKey);
|
||||
await sendMessageRequest(isEncrypted, _publicKey);
|
||||
} else {
|
||||
isEncrypted = 0;
|
||||
_publicKey = this.selectedAddress.address;
|
||||
sendMessageRequest(isEncrypted, _publicKey);
|
||||
await sendMessageRequest(isEncrypted, _publicKey);
|
||||
}
|
||||
};
|
||||
|
||||
@ -437,7 +437,7 @@ class ChatWelcomePage extends LitElement {
|
||||
isText: 1
|
||||
}
|
||||
})
|
||||
_computePow(chatResponse)
|
||||
await _computePow(chatResponse)
|
||||
}
|
||||
|
||||
const _computePow = async (chatBytes) => {
|
||||
@ -482,7 +482,7 @@ class ChatWelcomePage extends LitElement {
|
||||
}
|
||||
|
||||
}
|
||||
getAddressPublicKey()
|
||||
await getAddressPublicKey()
|
||||
}
|
||||
|
||||
_textArea(e) {
|
||||
@ -495,9 +495,8 @@ class ChatWelcomePage extends LitElement {
|
||||
}
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node];
|
||||
let apiKey = myNode.apiKey;
|
||||
return apiKey;
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
return myNode.apiKey
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,9 +55,8 @@ export class ImageComponent extends LitElement {
|
||||
const myNode =
|
||||
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
let apiKey = myNode.apiKey;
|
||||
return apiKey;
|
||||
]
|
||||
return myNode.apiKey
|
||||
}
|
||||
|
||||
async _fetchImage() {
|
||||
@ -82,7 +81,7 @@ export class ImageComponent extends LitElement {
|
||||
} catch (error) {
|
||||
this.error = true;
|
||||
console.error(error);
|
||||
this._fetchImage();
|
||||
await this._fetchImage();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -107,10 +107,9 @@ class LevelFounder extends LitElement {
|
||||
async checkAddressInfo() {
|
||||
try {
|
||||
let toCheck = this.checkleveladdress
|
||||
const memberInfo = await parentEpml.request('apiCall', {
|
||||
url: `/addresses/${toCheck}`
|
||||
})
|
||||
this.memberInfo = memberInfo
|
||||
this.memberInfo = await parentEpml.request('apiCall', {
|
||||
url: `/addresses/${toCheck}`
|
||||
})
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
@ -146,8 +145,7 @@ class LevelFounder extends LitElement {
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = myNode.apiKey
|
||||
return apiKey
|
||||
return myNode.apiKey
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -333,10 +333,9 @@ class NameMenu extends LitElement {
|
||||
}
|
||||
|
||||
async getChatBlockedAdresses() {
|
||||
const chatBlockedAdresses = await parentEpml.request('apiCall', {
|
||||
url: `/lists/blockedAddresses?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
this.chatBlockedAdresses = chatBlockedAdresses
|
||||
this.chatBlockedAdresses = await parentEpml.request('apiCall', {
|
||||
url: `/lists/blockedAddresses?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
}
|
||||
|
||||
async chatBlockAddress() {
|
||||
@ -490,11 +489,11 @@ class NameMenu extends LitElement {
|
||||
} else if (addressPublicKey !== false) {
|
||||
isEncrypted = 1
|
||||
_publicKey = addressPublicKey
|
||||
sendMessageRequest(isEncrypted, _publicKey)
|
||||
await sendMessageRequest(isEncrypted, _publicKey)
|
||||
} else {
|
||||
isEncrypted = 0
|
||||
_publicKey = this.selectedAddress.address
|
||||
sendMessageRequest(isEncrypted, _publicKey)
|
||||
await sendMessageRequest(isEncrypted, _publicKey)
|
||||
}
|
||||
};
|
||||
|
||||
@ -521,7 +520,7 @@ class NameMenu extends LitElement {
|
||||
isText: 1
|
||||
}
|
||||
})
|
||||
_computePow(chatResponse)
|
||||
await _computePow(chatResponse)
|
||||
}
|
||||
|
||||
const _computePow = async (chatBytes) => {
|
||||
@ -568,7 +567,7 @@ class NameMenu extends LitElement {
|
||||
}
|
||||
|
||||
}
|
||||
getAddressPublicKey()
|
||||
await getAddressPublicKey()
|
||||
}
|
||||
|
||||
_textMenu(event) {
|
||||
@ -603,9 +602,8 @@ class NameMenu extends LitElement {
|
||||
}
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node];
|
||||
let apiKey = myNode.apiKey;
|
||||
return apiKey;
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
return myNode.apiKey
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -121,26 +121,20 @@ export class ResuableImage extends LitElement {
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
]
|
||||
|
||||
const nodeUrl =
|
||||
myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
return nodeUrl
|
||||
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
}
|
||||
getMyNode() {
|
||||
const myNode =
|
||||
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
return window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
]
|
||||
|
||||
return myNode
|
||||
}
|
||||
|
||||
getApiKey() {
|
||||
const myNode =
|
||||
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||
];
|
||||
let apiKey = myNode.apiKey
|
||||
return apiKey
|
||||
]
|
||||
return myNode.apiKey
|
||||
}
|
||||
|
||||
async fetchResource() {
|
||||
@ -160,7 +154,7 @@ export class ResuableImage extends LitElement {
|
||||
}
|
||||
|
||||
async fetchVideoUrl() {
|
||||
this.fetchResource();
|
||||
await this.fetchResource();
|
||||
this.url = `${this.nodeUrl}/arbitrary/${this.resource.service}/${this.resource.name}/${this.resource.identifier}?async=true&apiKey=${this.myNode.apiKey}`
|
||||
}
|
||||
|
||||
@ -217,7 +211,7 @@ export class ResuableImage extends LitElement {
|
||||
|
||||
this.status = res
|
||||
if (this.status.status === 'DOWNLOADED') {
|
||||
this.fetchResource()
|
||||
await this.fetchResource()
|
||||
}
|
||||
}
|
||||
|
||||
@ -239,12 +233,12 @@ export class ResuableImage extends LitElement {
|
||||
|
||||
async _fetchImage() {
|
||||
try {
|
||||
this.fetchVideoUrl({
|
||||
await this.fetchVideoUrl({
|
||||
name: this.resource.name,
|
||||
service: this.resource.service,
|
||||
identifier: this.resource.identifier,
|
||||
});
|
||||
this.fetchStatus()
|
||||
await this.fetchStatus()
|
||||
} catch (error) { /* empty */ }
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ export class TipUser extends LitElement {
|
||||
|
||||
async firstUpdated() {
|
||||
await this.fetchWalletDetails()
|
||||
this.paymentFee()
|
||||
await this.paymentFee()
|
||||
}
|
||||
|
||||
updated(changedProperties) {
|
||||
@ -50,11 +50,10 @@ export class TipUser extends LitElement {
|
||||
}
|
||||
|
||||
async getLastRef() {
|
||||
let myRef = await parentEpml.request("apiCall", {
|
||||
type: "api",
|
||||
url: `/addresses/lastreference/${this.myAddress.address}`,
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request("apiCall", {
|
||||
type: "api",
|
||||
url: `/addresses/lastreference/${this.myAddress.address}`,
|
||||
})
|
||||
}
|
||||
|
||||
async getSendQortFee() {
|
||||
@ -89,8 +88,7 @@ export class TipUser extends LitElement {
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = myNode.apiKey
|
||||
return apiKey
|
||||
return myNode.apiKey
|
||||
}
|
||||
|
||||
async fetchWalletDetails() {
|
||||
|
@ -1,5 +1,4 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {render} from 'lit/html.js'
|
||||
import {html, LitElement} from 'lit'
|
||||
import {Epml} from '../../../epml.js'
|
||||
import {get, translate} from '../../../../core/translate'
|
||||
import {tradeInfoViewStyle} from './TradeInfoView-css.js'
|
||||
@ -161,11 +160,9 @@ class TradeInfoView extends LitElement {
|
||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
const infoSellerAddressUrl = `${nodeUrl}/addresses/${seller}`
|
||||
|
||||
const qortalSellerAddressInfo = await fetch(infoSellerAddressUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
this.addressSellerResult = qortalSellerAddressInfo
|
||||
this.addressSellerResult = await fetch(infoSellerAddressUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
}
|
||||
|
||||
async getAddressBuyerInfo(buyer) {
|
||||
@ -174,11 +171,9 @@ class TradeInfoView extends LitElement {
|
||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
const infoBuyerAddressUrl = `${nodeUrl}/addresses/${buyer}`
|
||||
|
||||
const qortalBuyerAddressInfo = await fetch(infoBuyerAddressUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
this.addressBuyerResult = qortalBuyerAddressInfo
|
||||
this.addressBuyerResult = await fetch(infoBuyerAddressUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
}
|
||||
|
||||
async getAddressSellerAvatar(seller) {
|
||||
@ -202,8 +197,7 @@ class TradeInfoView extends LitElement {
|
||||
}
|
||||
})
|
||||
|
||||
const sellerImageUrl = `${nodeUrl}/arbitrary/THUMBNAIL/${this.sellerImageName}/qortal_avatar?async=true&apiKey=${this.getApiKey()}`
|
||||
this.sellerImage = sellerImageUrl
|
||||
this.sellerImage = `${nodeUrl}/arbitrary/THUMBNAIL/${this.sellerImageName}/qortal_avatar?async=true&apiKey=${this.getApiKey()}`
|
||||
}
|
||||
|
||||
async getAddressBuyerAvatar(buyer) {
|
||||
@ -227,8 +221,7 @@ class TradeInfoView extends LitElement {
|
||||
}
|
||||
})
|
||||
|
||||
const buyerImageUrl = `${nodeUrl}/arbitrary/THUMBNAIL/${this.buyerImageName}/qortal_avatar?async=true&apiKey=${this.getApiKey()}`
|
||||
this.buyerImage = buyerImageUrl
|
||||
this.buyerImage = `${nodeUrl}/arbitrary/THUMBNAIL/${this.buyerImageName}/qortal_avatar?async=true&apiKey=${this.getApiKey()}`
|
||||
}
|
||||
|
||||
avatarSellerImage() {
|
||||
@ -257,8 +250,7 @@ class TradeInfoView extends LitElement {
|
||||
|
||||
getApiKey() {
|
||||
const apiNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = apiNode.apiKey;
|
||||
return apiKey;
|
||||
return apiNode.apiKey;
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
@ -269,8 +261,7 @@ class TradeInfoView extends LitElement {
|
||||
}
|
||||
|
||||
round(number) {
|
||||
let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
return result
|
||||
return (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1375,13 +1375,11 @@ class TraderInfoView extends LitElement {
|
||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
const fromNameUrl = `${nodeUrl}/names/${fromName}`
|
||||
|
||||
const qortalNameInfo = await fetch(fromNameUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
this.nameAddressResult = qortalNameInfo
|
||||
this.nameAddressResult = await fetch(fromNameUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
const nameAddress = this.nameAddressResult.owner
|
||||
this.getAllWithAddress(nameAddress)
|
||||
await this.getAllWithAddress(nameAddress)
|
||||
}
|
||||
|
||||
async getAllWithAddress(myAddress) {
|
||||
@ -1402,11 +1400,9 @@ class TraderInfoView extends LitElement {
|
||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
const infoAddressUrl = `${nodeUrl}/addresses/${infoAddress}`
|
||||
|
||||
const qortalAddressInfo = await fetch(infoAddressUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
this.addressResult = qortalAddressInfo
|
||||
this.addressResult = await fetch(infoAddressUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
}
|
||||
|
||||
async getAddressUserAvatar(avatarAddress) {
|
||||
@ -1428,8 +1424,7 @@ class TraderInfoView extends LitElement {
|
||||
}
|
||||
})
|
||||
|
||||
const myImageUrl = `${nodeUrl}/arbitrary/THUMBNAIL/${this.imageName}/qortal_avatar?async=true&apiKey=${this.getApiKey()}`
|
||||
this.imageUrl = myImageUrl
|
||||
this.imageUrl = `${nodeUrl}/arbitrary/THUMBNAIL/${this.imageName}/qortal_avatar?async=true&apiKey=${this.getApiKey()}`
|
||||
}
|
||||
|
||||
async getAddressUserBalance(balanceAddress) {
|
||||
@ -1452,19 +1447,15 @@ class TraderInfoView extends LitElement {
|
||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
|
||||
if (checkBlocks === 0) {
|
||||
let noMinterString = get("explorerpage.exp16")
|
||||
this.startMintTime = noMinterString
|
||||
this.startMintTime = get("explorerpage.exp16")
|
||||
} else {
|
||||
const rewardshareUrl = `${nodeUrl}/transactions/search?txType=REWARD_SHARE&address=${mintAddress}&confirmationStatus=CONFIRMED&limit=1&reverse=false`
|
||||
|
||||
const startMinting = await fetch(rewardshareUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
this.startMinting = await fetch(rewardshareUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
this.startMinting = startMinting
|
||||
|
||||
const mintString = new Date(this.startMinting[0].timestamp).toLocaleDateString()
|
||||
this.startMintTime = mintString
|
||||
this.startMintTime = new Date(this.startMinting[0].timestamp).toLocaleDateString()
|
||||
}
|
||||
}
|
||||
|
||||
@ -1930,8 +1921,7 @@ class TraderInfoView extends LitElement {
|
||||
|
||||
getApiKey() {
|
||||
const apiNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = apiNode.apiKey;
|
||||
return apiKey;
|
||||
return apiNode.apiKey
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
@ -1942,8 +1932,7 @@ class TraderInfoView extends LitElement {
|
||||
}
|
||||
|
||||
round(number) {
|
||||
let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
return result
|
||||
return (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -91,9 +91,7 @@ export function uint8ArrayToObject(uint8Array) {
|
||||
const jsonString = decoder.decode(uint8Array)
|
||||
|
||||
// Convert the JSON string back into an object
|
||||
const obj = JSON.parse(jsonString)
|
||||
|
||||
return obj
|
||||
return JSON.parse(jsonString)
|
||||
}
|
||||
|
||||
export function objectToBase64(obj) {
|
||||
@ -128,8 +126,7 @@ export function uint8ArrayToObject(uint8Array) {
|
||||
export const encryptData = ({ data64, recipientPublicKey }) => {
|
||||
|
||||
|
||||
const Uint8ArrayData = base64ToUint8Array(data64)
|
||||
const uint8Array = Uint8ArrayData
|
||||
const uint8Array = base64ToUint8Array(data64)
|
||||
|
||||
if (!(uint8Array instanceof Uint8Array)) {
|
||||
|
||||
@ -264,8 +261,7 @@ export const encryptDataGroup = ({ data64, publicKeys }) => {
|
||||
});
|
||||
const countArray = new Uint8Array(new Uint32Array([publicKeysDuplicateFree.length]).buffer);
|
||||
combinedData.set(countArray, combinedData.length - 4);
|
||||
const uint8arrayToData64 = uint8ArrayToBase64(combinedData)
|
||||
return uint8arrayToData64;
|
||||
return uint8ArrayToBase64(combinedData);
|
||||
|
||||
} catch (error) {
|
||||
throw new Error("Error in encrypting data")
|
||||
@ -317,8 +313,7 @@ export function decryptDeprecatedSingle(uint8Array, publicKey) {
|
||||
if (!_decryptedData) {
|
||||
throw new Error("Unable to decrypt")
|
||||
}
|
||||
const decryptedDataToBase64 = uint8ArrayToBase64(_decryptedData)
|
||||
return decryptedDataToBase64
|
||||
return uint8ArrayToBase64(_decryptedData)
|
||||
}
|
||||
|
||||
export function decryptGroupData(data64EncryptedData) {
|
||||
|
@ -1298,13 +1298,11 @@ class QortalInfoView extends LitElement {
|
||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
const fromNameUrl = `${nodeUrl}/names/${fromName}`
|
||||
|
||||
const qortalNameInfo = await fetch(fromNameUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
this.nameAddressResult = qortalNameInfo
|
||||
this.nameAddressResult = await fetch(fromNameUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
const nameAddress = this.nameAddressResult.owner
|
||||
this.getAllWithAddress(nameAddress)
|
||||
await this.getAllWithAddress(nameAddress)
|
||||
}
|
||||
|
||||
async getAllWithAddress(myAddress) {
|
||||
@ -1325,11 +1323,9 @@ class QortalInfoView extends LitElement {
|
||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
const infoAddressUrl = `${nodeUrl}/addresses/${infoAddress}`
|
||||
|
||||
const qortalAddressInfo = await fetch(infoAddressUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
this.addressResult = qortalAddressInfo
|
||||
this.addressResult = await fetch(infoAddressUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
}
|
||||
|
||||
async getAddressUserAvatar(avatarAddress) {
|
||||
@ -1351,8 +1347,7 @@ class QortalInfoView extends LitElement {
|
||||
}
|
||||
})
|
||||
|
||||
const myImageUrl = `${nodeUrl}/arbitrary/THUMBNAIL/${this.imageName}/qortal_avatar?async=true&apiKey=${this.getApiKey()}`
|
||||
this.imageUrl = myImageUrl
|
||||
this.imageUrl = `${nodeUrl}/arbitrary/THUMBNAIL/${this.imageName}/qortal_avatar?async=true&apiKey=${this.getApiKey()}`
|
||||
}
|
||||
|
||||
async getAddressUserBalance(balanceAddress) {
|
||||
@ -1378,28 +1373,22 @@ class QortalInfoView extends LitElement {
|
||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
|
||||
if (checkBlocks === 0) {
|
||||
let noMinterString = get("explorerpage.exp16")
|
||||
this.startMintTime = noMinterString
|
||||
this.startMintTime = get("explorerpage.exp16")
|
||||
} else {
|
||||
const blockheightUrl = `${nodeUrl}/blocks/height`
|
||||
|
||||
const currentBlockheight = await fetch(blockheightUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
this.actualBlockheight = currentBlockheight
|
||||
this.actualBlockheight = await fetch(blockheightUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
this.reduceBlockheight = this.addressResult.blocksMinted + this.addressResult.blocksMintedAdjustment
|
||||
this.startMintBlockheight = (this.actualBlockheight - this.reduceBlockheight)
|
||||
const startMintUrl = `${nodeUrl}/blocks/byheight/${this.startMintBlockheight}?includeOnlineSignatures=false`
|
||||
|
||||
const startMintBlock = await fetch(startMintUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
this.startMintBlock = await fetch(startMintUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
this.startMintBlock = startMintBlock
|
||||
|
||||
const mintString = new Date(this.startMintBlock.timestamp).toLocaleDateString()
|
||||
this.startMintTime = mintString
|
||||
this.startMintTime = new Date(this.startMintBlock.timestamp).toLocaleDateString()
|
||||
}
|
||||
}
|
||||
|
||||
@ -1854,8 +1843,7 @@ class QortalInfoView extends LitElement {
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = myNode.apiKey
|
||||
return apiKey
|
||||
return myNode.apiKey
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
@ -1866,8 +1854,7 @@ class QortalInfoView extends LitElement {
|
||||
}
|
||||
|
||||
round(number) {
|
||||
let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
return result
|
||||
return (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2379,7 +2379,7 @@ nacl.verify = function(x, y) {
|
||||
// Zero length arguments are considered not equal.
|
||||
if (x.length === 0 || y.length === 0) return false;
|
||||
if (x.length !== y.length) return false;
|
||||
return (vn(x, 0, y, 0, x.length) === 0) ? true : false;
|
||||
return (vn(x, 0, y, 0, x.length) === 0);
|
||||
};
|
||||
|
||||
nacl.setPRNG = function(fn) {
|
||||
|
@ -1374,8 +1374,7 @@ class GroupManagement extends LitElement {
|
||||
this.filteredItems = []
|
||||
const searchTerm = (e.target.value || '').trim()
|
||||
const keys = ['groupName', 'description', 'owner']
|
||||
const filtered = this.publicGroups.filter((search) => keys.some((key) => search[key].toLowerCase().includes(searchTerm.toLowerCase())))
|
||||
this.filteredItems = filtered
|
||||
this.filteredItems = this.publicGroups.filter((search) => keys.some((key) => search[key].toLowerCase().includes(searchTerm.toLowerCase())))
|
||||
}}"
|
||||
>
|
||||
<vaadin-icon slot="prefix" icon="vaadin:search"></vaadin-icon>
|
||||
@ -1724,29 +1723,25 @@ class GroupManagement extends LitElement {
|
||||
let openG = await parentEpml.request('apiCall', {
|
||||
url: `/groups?limit=0&reverse=true`
|
||||
})
|
||||
let myGs = openG.filter(myG => myG.isOpen === true)
|
||||
return myGs
|
||||
return openG.filter(myG => myG.isOpen === true)
|
||||
}
|
||||
|
||||
const getPrivateGroups = async () => {
|
||||
let privateG = await parentEpml.request('apiCall', {
|
||||
url: `/groups?limit=0&reverse=true`
|
||||
})
|
||||
let myPgs = privateG.filter(myP => myP.isOpen === false)
|
||||
return myPgs
|
||||
return privateG.filter(myP => myP.isOpen === false)
|
||||
}
|
||||
|
||||
const getJoinedGroups = async () => {
|
||||
let joinedG = await parentEpml.request('apiCall', {
|
||||
url: `/groups/member/${this.selectedAddress.address}`
|
||||
})
|
||||
return joinedG
|
||||
return await parentEpml.request('apiCall', {
|
||||
url: `/groups/member/${this.selectedAddress.address}`
|
||||
})
|
||||
}
|
||||
const getGroupInfo = async (groupId) => {
|
||||
let joinedG = await parentEpml.request('apiCall', {
|
||||
url: `/groups/${groupId}`
|
||||
})
|
||||
return joinedG
|
||||
return await parentEpml.request('apiCall', {
|
||||
url: `/groups/${groupId}`
|
||||
})
|
||||
}
|
||||
|
||||
const getGroupInvites = async () => {
|
||||
@ -1805,11 +1800,10 @@ class GroupManagement extends LitElement {
|
||||
let _joinedGroups = await getJoinedGroups()
|
||||
let _publicGroups = await getOpenPublicGroups()
|
||||
let _privateGroups = await getPrivateGroups()
|
||||
let results = _publicGroups.filter(myOpenGroup => {
|
||||
let value = _joinedGroups.some(myJoinedGroup => myOpenGroup.groupId === myJoinedGroup.groupId)
|
||||
return !value
|
||||
});
|
||||
this.publicGroups = results
|
||||
this.publicGroups = _publicGroups.filter(myOpenGroup => {
|
||||
let value = _joinedGroups.some(myJoinedGroup => myOpenGroup.groupId === myJoinedGroup.groupId)
|
||||
return !value
|
||||
})
|
||||
this.privateGroups = _privateGroups
|
||||
this.joinedGroups = _joinedGroups
|
||||
this.filteredItems = this.publicGroups
|
||||
@ -2248,13 +2242,11 @@ class GroupManagement extends LitElement {
|
||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
const fromNameUrl = `${nodeUrl}/names/${_inviteMemberInfo}`
|
||||
|
||||
const qortalNameInfo = await fetch(fromNameUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
|
||||
this.nameAddressResult = qortalNameInfo
|
||||
this.nameAddressResult = await fetch(fromNameUrl).then(response => {
|
||||
return response.json()
|
||||
})
|
||||
const _inviteMemberNameInfo = this.nameAddressResult.owner
|
||||
this.createInviteGroupMember(_inviteMemberNameInfo, _nviteMemberTime, _inviteGroupId)
|
||||
await this.createInviteGroupMember(_inviteMemberNameInfo, _nviteMemberTime, _inviteGroupId)
|
||||
}
|
||||
|
||||
closeErrorDialog() {
|
||||
@ -2417,8 +2409,7 @@ class GroupManagement extends LitElement {
|
||||
await fetch(callMembersUrl).then(res => {
|
||||
return res.json()
|
||||
}).then(data => {
|
||||
let groupMemberToParse = data
|
||||
groupMemberToParse.members.map(a => {
|
||||
data.members.map(a => {
|
||||
if (a.isAdmin === undefined) {
|
||||
let callTheNewMember = a.member
|
||||
let callSingleMemberUrl = `${nodeUrl}/names/address/${callTheNewMember}`
|
||||
@ -2698,14 +2689,11 @@ class GroupManagement extends LitElement {
|
||||
|
||||
renderRole(groupObj) {
|
||||
if (groupObj.owner === this.selectedAddress.address) {
|
||||
let ownerstring = get("grouppage.gchange10")
|
||||
return ownerstring
|
||||
return get("grouppage.gchange10")
|
||||
} else if (groupObj.isAdmin === true) {
|
||||
let adminstring = get("grouppage.gchange52")
|
||||
return adminstring
|
||||
return get("grouppage.gchange52")
|
||||
} else {
|
||||
let memberstring = get("grouppage.gchange53")
|
||||
return memberstring
|
||||
return get("grouppage.gchange53")
|
||||
}
|
||||
}
|
||||
|
||||
@ -2782,11 +2770,10 @@ class GroupManagement extends LitElement {
|
||||
this.isLoading = true
|
||||
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
};
|
||||
|
||||
const validateReceiver = async () => {
|
||||
@ -2808,27 +2795,26 @@ class GroupManagement extends LitElement {
|
||||
let groupdialog7 = get("grouppage.gchange4")
|
||||
let groupdialog8 = get("grouppage.gchange5")
|
||||
let groupdialog9 = get("grouppage.gchange13")
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 22,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: createFeeInput,
|
||||
registrantAddress: this.selectedAddress.address,
|
||||
rGroupName: groupNameInput,
|
||||
rGroupDesc: groupDescInput,
|
||||
rGroupType: _groupTypeInput,
|
||||
rGroupApprovalThreshold: _groupApprovalInput,
|
||||
rGroupMinimumBlockDelay: _groupMinDelayInput,
|
||||
rGroupMaximumBlockDelay: _groupMaxDelayInput,
|
||||
lastReference: lastRef,
|
||||
groupdialog5: groupdialog5,
|
||||
groupdialog6: groupdialog6,
|
||||
groupdialog7: groupdialog7,
|
||||
groupdialog8: groupdialog8,
|
||||
groupdialog9: groupdialog9,
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 22,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: createFeeInput,
|
||||
registrantAddress: this.selectedAddress.address,
|
||||
rGroupName: groupNameInput,
|
||||
rGroupDesc: groupDescInput,
|
||||
rGroupType: _groupTypeInput,
|
||||
rGroupApprovalThreshold: _groupApprovalInput,
|
||||
rGroupMinimumBlockDelay: _groupMinDelayInput,
|
||||
rGroupMaximumBlockDelay: _groupMaxDelayInput,
|
||||
lastReference: lastRef,
|
||||
groupdialog5: groupdialog5,
|
||||
groupdialog6: groupdialog6,
|
||||
groupdialog7: groupdialog7,
|
||||
groupdialog8: groupdialog8,
|
||||
groupdialog9: groupdialog9,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -2872,7 +2858,7 @@ class GroupManagement extends LitElement {
|
||||
this.isLoading = false
|
||||
} else {
|
||||
this.error = false
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
}
|
||||
}
|
||||
|
||||
@ -2894,11 +2880,10 @@ class GroupManagement extends LitElement {
|
||||
this.isLoading = true
|
||||
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
};
|
||||
|
||||
const validateReceiver = async () => {
|
||||
@ -2912,21 +2897,20 @@ class GroupManagement extends LitElement {
|
||||
const makeTransactionRequest = async (lastRef) => {
|
||||
let groupdialog1 = get("transactions.groupdialog1")
|
||||
let groupdialog2 = get("transactions.groupdialog2")
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 31,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: joinFeeInput,
|
||||
registrantAddress: this.selectedAddress.address,
|
||||
rGroupName: groupName,
|
||||
rGroupId: groupId,
|
||||
lastReference: lastRef,
|
||||
groupdialog1: groupdialog1,
|
||||
groupdialog2: groupdialog2
|
||||
},
|
||||
apiVersion: 2
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 31,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: joinFeeInput,
|
||||
registrantAddress: this.selectedAddress.address,
|
||||
rGroupName: groupName,
|
||||
rGroupId: groupId,
|
||||
lastReference: lastRef,
|
||||
groupdialog1: groupdialog1,
|
||||
groupdialog2: groupdialog2
|
||||
},
|
||||
apiVersion: 2
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -2949,7 +2933,7 @@ class GroupManagement extends LitElement {
|
||||
throw new Error(txnResponse)
|
||||
}
|
||||
}
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
this.resetDefaultSettings()
|
||||
}
|
||||
|
||||
@ -2960,11 +2944,10 @@ class GroupManagement extends LitElement {
|
||||
this.isLoading = true
|
||||
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
};
|
||||
|
||||
const validateReceiver = async () => {
|
||||
@ -2978,20 +2961,19 @@ class GroupManagement extends LitElement {
|
||||
const makeTransactionRequest = async (lastRef) => {
|
||||
let groupdialog3 = get("transactions.groupdialog3")
|
||||
let groupdialog4 = get("transactions.groupdialog4")
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 32,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: leaveFeeInput,
|
||||
registrantAddress: this.selectedAddress.address,
|
||||
rGroupName: groupName,
|
||||
rGroupId: groupId,
|
||||
lastReference: lastRef,
|
||||
groupdialog3: groupdialog3,
|
||||
groupdialog4: groupdialog4
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 32,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: leaveFeeInput,
|
||||
registrantAddress: this.selectedAddress.address,
|
||||
rGroupName: groupName,
|
||||
rGroupId: groupId,
|
||||
lastReference: lastRef,
|
||||
groupdialog3: groupdialog3,
|
||||
groupdialog4: groupdialog4
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -3009,7 +2991,7 @@ class GroupManagement extends LitElement {
|
||||
throw new Error(txnResponse)
|
||||
}
|
||||
}
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
this.resetDefaultSettings()
|
||||
}
|
||||
|
||||
@ -3023,11 +3005,10 @@ class GroupManagement extends LitElement {
|
||||
this.btnDisable = true
|
||||
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
}
|
||||
|
||||
const validateReceiver = async () => {
|
||||
@ -3048,21 +3029,20 @@ class GroupManagement extends LitElement {
|
||||
const myBanMemberDialog1 = get("managegroup.mg22")
|
||||
const myBanMemberDialog2 = get("managegroup.mg23")
|
||||
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 26,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
recipient: myMember,
|
||||
rGroupId: myGroupId,
|
||||
rBanReason: myReason,
|
||||
rBanTime: myBanTime,
|
||||
lastReference: myLastRef,
|
||||
banMemberDialog1: myBanMemberDialog1,
|
||||
banMemberDialog2: myBanMemberDialog2
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 26,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
recipient: myMember,
|
||||
rGroupId: myGroupId,
|
||||
rBanReason: myReason,
|
||||
rBanTime: myBanTime,
|
||||
lastReference: myLastRef,
|
||||
banMemberDialog1: myBanMemberDialog1,
|
||||
banMemberDialog2: myBanMemberDialog2
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -3102,7 +3082,7 @@ class GroupManagement extends LitElement {
|
||||
this.isLoading = false
|
||||
} else {
|
||||
this.error = false
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
}
|
||||
}
|
||||
|
||||
@ -3114,11 +3094,10 @@ class GroupManagement extends LitElement {
|
||||
this.btnDisable = true
|
||||
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
}
|
||||
|
||||
const validateReceiver = async () => {
|
||||
@ -3136,19 +3115,18 @@ class GroupManagement extends LitElement {
|
||||
const myCancelBanMemberDialog1 = get("managegroup.mg29")
|
||||
const myCancelBanMemberDialog2 = get("managegroup.mg30")
|
||||
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 27,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
recipient: myMember,
|
||||
rGroupId: myGroupId,
|
||||
lastReference: myLastRef,
|
||||
cancelBanMemberDialog1: myCancelBanMemberDialog1,
|
||||
cancelBanMemberDialog2: myCancelBanMemberDialog2
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 27,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
recipient: myMember,
|
||||
rGroupId: myGroupId,
|
||||
lastReference: myLastRef,
|
||||
cancelBanMemberDialog1: myCancelBanMemberDialog1,
|
||||
cancelBanMemberDialog2: myCancelBanMemberDialog2
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -3171,7 +3149,7 @@ class GroupManagement extends LitElement {
|
||||
throw new Error(txnResponse)
|
||||
}
|
||||
}
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
}
|
||||
|
||||
async createInviteGroupMember(_inviteMemberNameInfo, _nviteMemberTime, _inviteGroupId) {
|
||||
@ -3183,11 +3161,10 @@ class GroupManagement extends LitElement {
|
||||
this.btnDisable = true
|
||||
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
}
|
||||
|
||||
const validateReceiver = async () => {
|
||||
@ -3205,20 +3182,19 @@ class GroupManagement extends LitElement {
|
||||
const myInviteMemberDialog1 = get("managegroup.mg40")
|
||||
const myInviteMemberDialog2 = get("managegroup.mg41")
|
||||
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 29,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
recipient: myMember,
|
||||
rGroupId: myGroupId,
|
||||
rInviteTime: myInviteTime,
|
||||
lastReference: myLastRef,
|
||||
inviteMemberDialog1: myInviteMemberDialog1,
|
||||
inviteMemberDialog2: myInviteMemberDialog2
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 29,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
recipient: myMember,
|
||||
rGroupId: myGroupId,
|
||||
rInviteTime: myInviteTime,
|
||||
lastReference: myLastRef,
|
||||
inviteMemberDialog1: myInviteMemberDialog1,
|
||||
inviteMemberDialog2: myInviteMemberDialog2
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -3243,7 +3219,7 @@ class GroupManagement extends LitElement {
|
||||
throw new Error(txnResponse)
|
||||
}
|
||||
}
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
}
|
||||
|
||||
async cancelInviteGroupMember(groupId) {
|
||||
@ -3255,11 +3231,10 @@ class GroupManagement extends LitElement {
|
||||
this.btnDisable = true
|
||||
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
}
|
||||
|
||||
const validateReceiver = async () => {
|
||||
@ -3277,20 +3252,19 @@ class GroupManagement extends LitElement {
|
||||
const myCancelInviteDialog1 = get("managegroup.mg48")
|
||||
const myCancelInviteDialog2 = get("managegroup.mg49")
|
||||
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 30,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
memberName: myName,
|
||||
recipient: myMember,
|
||||
rGroupId: myGroupId,
|
||||
lastReference: myLastRef,
|
||||
cancelInviteDialog1: myCancelInviteDialog1,
|
||||
cancelInviteDialog2: myCancelInviteDialog2
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 30,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
memberName: myName,
|
||||
recipient: myMember,
|
||||
rGroupId: myGroupId,
|
||||
lastReference: myLastRef,
|
||||
cancelInviteDialog1: myCancelInviteDialog1,
|
||||
cancelInviteDialog2: myCancelInviteDialog2
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -3315,7 +3289,7 @@ class GroupManagement extends LitElement {
|
||||
throw new Error(txnResponse)
|
||||
}
|
||||
}
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
}
|
||||
|
||||
async createAcceptJoinGroupMember(joinObj) {
|
||||
@ -3327,11 +3301,10 @@ class GroupManagement extends LitElement {
|
||||
this.btnDisable = true
|
||||
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
}
|
||||
|
||||
const validateReceiver = async () => {
|
||||
@ -3349,20 +3322,19 @@ class GroupManagement extends LitElement {
|
||||
const myInviteMemberDialog1 = get("managegroup.mg55")
|
||||
const myInviteMemberDialog2 = get("managegroup.mg56")
|
||||
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 29,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
recipient: myMember,
|
||||
rGroupId: myGroupId,
|
||||
rInviteTime: myInviteTime,
|
||||
lastReference: myLastRef,
|
||||
inviteMemberDialog1: myInviteMemberDialog1,
|
||||
inviteMemberDialog2: myInviteMemberDialog2
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 29,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
recipient: myMember,
|
||||
rGroupId: myGroupId,
|
||||
rInviteTime: myInviteTime,
|
||||
lastReference: myLastRef,
|
||||
inviteMemberDialog1: myInviteMemberDialog1,
|
||||
inviteMemberDialog2: myInviteMemberDialog2
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -3386,7 +3358,7 @@ class GroupManagement extends LitElement {
|
||||
throw new Error(txnResponse)
|
||||
}
|
||||
}
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
}
|
||||
|
||||
async kickJoinGroupMember(joinObj) {
|
||||
@ -3398,11 +3370,10 @@ class GroupManagement extends LitElement {
|
||||
this.btnDisable = true
|
||||
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
}
|
||||
|
||||
const validateReceiver = async () => {
|
||||
@ -3420,20 +3391,19 @@ class GroupManagement extends LitElement {
|
||||
const myKickMemberDialog1 = get("managegroup.mg60")
|
||||
const myKickMemberDialog2 = get("managegroup.mg61")
|
||||
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 28,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
recipient: myMember,
|
||||
rGroupId: myGroupId,
|
||||
rBanReason: myReason,
|
||||
lastReference: myLastRef,
|
||||
kickMemberDialog1: myKickMemberDialog1,
|
||||
kickMemberDialog2: myKickMemberDialog2
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 28,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
recipient: myMember,
|
||||
rGroupId: myGroupId,
|
||||
rBanReason: myReason,
|
||||
lastReference: myLastRef,
|
||||
kickMemberDialog1: myKickMemberDialog1,
|
||||
kickMemberDialog2: myKickMemberDialog2
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -3457,7 +3427,7 @@ class GroupManagement extends LitElement {
|
||||
throw new Error(txnResponse)
|
||||
}
|
||||
}
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
}
|
||||
|
||||
async addGroupAdmin(groupId) {
|
||||
@ -3468,11 +3438,10 @@ class GroupManagement extends LitElement {
|
||||
this.btnDisable = true
|
||||
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
}
|
||||
|
||||
const validateReceiver = async () => {
|
||||
@ -3489,19 +3458,18 @@ class GroupManagement extends LitElement {
|
||||
const myAddAdminDialog1 = get("managegroup.mg11")
|
||||
const myAddAdminDialog2 = get("managegroup.mg12")
|
||||
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 24,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
recipient: myMember,
|
||||
rGroupId: myGroupId,
|
||||
lastReference: myLastRef,
|
||||
addAdminDialog1: myAddAdminDialog1,
|
||||
addAdminDialog2: myAddAdminDialog2
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 24,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
recipient: myMember,
|
||||
rGroupId: myGroupId,
|
||||
lastReference: myLastRef,
|
||||
addAdminDialog1: myAddAdminDialog1,
|
||||
addAdminDialog2: myAddAdminDialog2
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -3524,7 +3492,7 @@ class GroupManagement extends LitElement {
|
||||
throw new Error(txnResponse)
|
||||
}
|
||||
}
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
}
|
||||
|
||||
async kickGroupMember(groupId) {
|
||||
@ -3536,11 +3504,10 @@ class GroupManagement extends LitElement {
|
||||
this.btnDisable = true
|
||||
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
}
|
||||
|
||||
const validateReceiver = async () => {
|
||||
@ -3558,20 +3525,19 @@ class GroupManagement extends LitElement {
|
||||
const myKickMemberDialog1 = get("managegroup.mg33")
|
||||
const myKickMemberDialog2 = get("managegroup.mg34")
|
||||
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 28,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
recipient: myMember,
|
||||
rGroupId: myGroupId,
|
||||
rBanReason: myReason,
|
||||
lastReference: myLastRef,
|
||||
kickMemberDialog1: myKickMemberDialog1,
|
||||
kickMemberDialog2: myKickMemberDialog2
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 28,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
recipient: myMember,
|
||||
rGroupId: myGroupId,
|
||||
rBanReason: myReason,
|
||||
lastReference: myLastRef,
|
||||
kickMemberDialog1: myKickMemberDialog1,
|
||||
kickMemberDialog2: myKickMemberDialog2
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -3605,7 +3571,7 @@ class GroupManagement extends LitElement {
|
||||
this.isLoading = false
|
||||
} else {
|
||||
this.error = false
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
}
|
||||
}
|
||||
|
||||
@ -3617,11 +3583,10 @@ class GroupManagement extends LitElement {
|
||||
this.btnDisable = true
|
||||
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
}
|
||||
|
||||
const validateReceiver = async () => {
|
||||
@ -3639,19 +3604,18 @@ class GroupManagement extends LitElement {
|
||||
const myKickAdminDialog1 = get("managegroup.mg15")
|
||||
const myKickAdminDialog2 = get("managegroup.mg16")
|
||||
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 25,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
recipient: myKickAdmin,
|
||||
rGroupId: myGroupId,
|
||||
lastReference: myLastRef,
|
||||
kickAdminDialog1: myKickAdminDialog1,
|
||||
kickAdminDialog2: myKickAdminDialog2
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 25,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
recipient: myKickAdmin,
|
||||
rGroupId: myGroupId,
|
||||
lastReference: myLastRef,
|
||||
kickAdminDialog1: myKickAdminDialog1,
|
||||
kickAdminDialog2: myKickAdminDialog2
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -3674,13 +3638,12 @@ class GroupManagement extends LitElement {
|
||||
throw new Error(txnResponse)
|
||||
}
|
||||
}
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
}
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = myNode.apiKey
|
||||
return apiKey
|
||||
return myNode.apiKey
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
|
@ -134,8 +134,7 @@ class GroupTransaction extends LitElement {
|
||||
let tempUrl = document.location.href
|
||||
let decodeTempUrl = decodeURI(tempUrl)
|
||||
let splitedUrl = decodeTempUrl.split('?')
|
||||
let myGroupId = splitedUrl[1]
|
||||
this.addMintingAccountMessage = myGroupId
|
||||
this.addMintingAccountMessage = splitedUrl[1]
|
||||
}
|
||||
|
||||
getGroupIdFromURL()
|
||||
|
@ -425,10 +425,9 @@ class Chat extends LitElement {
|
||||
this.getLocalBlockedList()
|
||||
|
||||
const getBlockedUsers = async () => {
|
||||
let blockedUsers = await parentEpml.request('apiCall', {
|
||||
this.blockedUsers = await parentEpml.request('apiCall', {
|
||||
url: `/lists/blockedAddresses?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
this.blockedUsers = blockedUsers
|
||||
setTimeout(getBlockedUsers, 60000)
|
||||
}
|
||||
|
||||
@ -516,7 +515,7 @@ class Chat extends LitElement {
|
||||
const name = sideEffectAction.data.name
|
||||
const address = sideEffectAction.data.address
|
||||
if(this.chatHeadsObj.direct && this.chatHeadsObj.direct.find(item=> item.address === address)){
|
||||
this.setActiveChatHeadUrl(`direct/${address}`)
|
||||
await this.setActiveChatHeadUrl(`direct/${address}`)
|
||||
window.parent.reduxStore.dispatch(
|
||||
window.parent.reduxAction.setSideEffectAction(null))
|
||||
} else {
|
||||
@ -601,7 +600,7 @@ class Chat extends LitElement {
|
||||
version: 3
|
||||
}
|
||||
const stringifyMessageObject = JSON.stringify(messageObject)
|
||||
this.sendMessage(stringifyMessageObject)
|
||||
await this.sendMessage(stringifyMessageObject)
|
||||
}
|
||||
}
|
||||
|
||||
@ -654,7 +653,7 @@ class Chat extends LitElement {
|
||||
} else if (addressPublicKey !== false) {
|
||||
isEncrypted = 1
|
||||
_publicKey = addressPublicKey
|
||||
sendMessageRequest(isEncrypted, _publicKey)
|
||||
await sendMessageRequest(isEncrypted, _publicKey)
|
||||
} else {
|
||||
let err4string = get("chatpage.cchange39")
|
||||
parentEpml.request('showSnackBar', `${err4string}`)
|
||||
@ -680,7 +679,7 @@ class Chat extends LitElement {
|
||||
isText: 1
|
||||
}
|
||||
})
|
||||
_computePow(chatResponse)
|
||||
await _computePow(chatResponse)
|
||||
}
|
||||
|
||||
const _computePow = async (chatBytes) => {
|
||||
@ -723,7 +722,7 @@ class Chat extends LitElement {
|
||||
this.isLoading = false
|
||||
}
|
||||
// Exec..
|
||||
getAddressPublicKey()
|
||||
await getAddressPublicKey()
|
||||
}
|
||||
|
||||
insertImage(file) {
|
||||
@ -807,10 +806,9 @@ class Chat extends LitElement {
|
||||
async getPendingGroupInvites() {
|
||||
const myAddress = window.parent.reduxStore.getState().app.selectedAddress.address
|
||||
try {
|
||||
let pendingGroupInvites = await parentEpml.request('apiCall', {
|
||||
this.groupInvites = await parentEpml.request('apiCall', {
|
||||
url: `/groups/invites/${myAddress}`
|
||||
})
|
||||
this.groupInvites = pendingGroupInvites;
|
||||
});
|
||||
} catch (error) {
|
||||
let err4string = get("chatpage.cchange61");
|
||||
parentEpml.request('showSnackBar', `${err4string}`)
|
||||
@ -960,8 +958,7 @@ class Chat extends LitElement {
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = myNode.apiKey
|
||||
return apiKey
|
||||
return myNode.apiKey
|
||||
}
|
||||
|
||||
scrollToBottom() {
|
||||
|
@ -441,10 +441,9 @@ class MintingInfo extends LitElement {
|
||||
}
|
||||
|
||||
async getAddressLevel() {
|
||||
const callLevels = await parentEpml.request('apiCall', {
|
||||
url: `/addresses/online/levels`
|
||||
})
|
||||
this.addressLevel = callLevels
|
||||
this.addressLevel = await parentEpml.request('apiCall', {
|
||||
url: `/addresses/online/levels`
|
||||
})
|
||||
this.tier4Online = parseFloat(this.addressLevel[7].count) + parseFloat(this.addressLevel[8].count)
|
||||
}
|
||||
|
||||
|
@ -898,8 +898,7 @@ class NameRegistration extends LitElement {
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = myNode.apiKey
|
||||
return apiKey
|
||||
return myNode.apiKey
|
||||
}
|
||||
|
||||
async registerName(e) {
|
||||
@ -914,20 +913,18 @@ class NameRegistration extends LitElement {
|
||||
|
||||
// Get Last Ref
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
};
|
||||
|
||||
// Get Account Details
|
||||
const validateName = async () => {
|
||||
let isValid = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/names/${nameInput}`
|
||||
})
|
||||
return isValid
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/names/${nameInput}`
|
||||
})
|
||||
};
|
||||
|
||||
const validateReceiver = async () => {
|
||||
@ -949,19 +946,18 @@ class NameRegistration extends LitElement {
|
||||
const makeTransactionRequest = async (lastRef) => {
|
||||
let dialogyou = get("transactions.namedialog1")
|
||||
let dialogonpress = get("transactions.namedialog2")
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 3,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: feeInput,
|
||||
name: nameInput,
|
||||
value: descInput,
|
||||
lastReference: lastRef,
|
||||
dialogyou: dialogyou,
|
||||
dialogonpress: dialogonpress,
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 3,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: feeInput,
|
||||
name: nameInput,
|
||||
value: descInput,
|
||||
lastReference: lastRef,
|
||||
dialogyou: dialogyou,
|
||||
dialogonpress: dialogonpress,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -979,7 +975,7 @@ class NameRegistration extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
|
||||
this.registerNameLoading = false
|
||||
}
|
||||
@ -994,20 +990,18 @@ class NameRegistration extends LitElement {
|
||||
|
||||
// Get Last Ref
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
}
|
||||
|
||||
// Get Account Details
|
||||
const validateName = async () => {
|
||||
let isValid = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/names/${newNameInput}`
|
||||
})
|
||||
return isValid
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/names/${newNameInput}`
|
||||
})
|
||||
}
|
||||
|
||||
const validateReceiver = async () => {
|
||||
@ -1035,21 +1029,20 @@ class NameRegistration extends LitElement {
|
||||
let dialogUpdateName1 = get("registernamepage.nchange43")
|
||||
let dialogUpdateName2 = get("registernamepage.nchange44")
|
||||
let dialogUpdateName3 = get("registernamepage.nchange45")
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 4,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
name: myOldName,
|
||||
newName: myNewName,
|
||||
newData: myNewDesc,
|
||||
lastReference: myLastRef,
|
||||
dialogUpdateName1: dialogUpdateName1,
|
||||
dialogUpdateName2: dialogUpdateName2,
|
||||
dialogUpdateName3: dialogUpdateName3
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 4,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
name: myOldName,
|
||||
newName: myNewName,
|
||||
newData: myNewDesc,
|
||||
lastReference: myLastRef,
|
||||
dialogUpdateName1: dialogUpdateName1,
|
||||
dialogUpdateName2: dialogUpdateName2,
|
||||
dialogUpdateName3: dialogUpdateName3
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -1067,7 +1060,7 @@ class NameRegistration extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
}
|
||||
|
||||
async createSellName() {
|
||||
@ -1078,11 +1071,10 @@ class NameRegistration extends LitElement {
|
||||
this.btnDisable = true
|
||||
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
}
|
||||
|
||||
const validateReceiver = async () => {
|
||||
@ -1100,20 +1092,19 @@ class NameRegistration extends LitElement {
|
||||
const mySellNameDialog2 = get("registernamepage.nchange27")
|
||||
const mySellNameDialog3 = get("registernamepage.nchange28")
|
||||
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 5,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
name: myName,
|
||||
sellPrice: myPrice,
|
||||
lastReference: myLastRef,
|
||||
sellNameDialog1: mySellNameDialog1,
|
||||
sellNameDialog2: mySellNameDialog2,
|
||||
sellNameDialog3: mySellNameDialog3
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 5,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
name: myName,
|
||||
sellPrice: myPrice,
|
||||
lastReference: myLastRef,
|
||||
sellNameDialog1: mySellNameDialog1,
|
||||
sellNameDialog2: mySellNameDialog2,
|
||||
sellNameDialog3: mySellNameDialog3
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -1138,7 +1129,7 @@ class NameRegistration extends LitElement {
|
||||
throw new Error(txnResponse)
|
||||
}
|
||||
}
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
}
|
||||
|
||||
async createCancelSellName() {
|
||||
@ -1148,11 +1139,10 @@ class NameRegistration extends LitElement {
|
||||
this.btnDisable = true
|
||||
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
}
|
||||
|
||||
const validateReceiver = async () => {
|
||||
@ -1168,18 +1158,17 @@ class NameRegistration extends LitElement {
|
||||
const myCancelSellNameDialog1 = get("registernamepage.nchange30")
|
||||
const myCancelSellNameDialog2 = get("registernamepage.nchange31")
|
||||
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 6,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
name: myName,
|
||||
lastReference: myLastRef,
|
||||
cancelSellNameDialog1: myCancelSellNameDialog1,
|
||||
cancelSellNameDialog2: myCancelSellNameDialog2
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 6,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
name: myName,
|
||||
lastReference: myLastRef,
|
||||
cancelSellNameDialog1: myCancelSellNameDialog1,
|
||||
cancelSellNameDialog2: myCancelSellNameDialog2
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -1202,12 +1191,11 @@ class NameRegistration extends LitElement {
|
||||
throw new Error(txnResponse)
|
||||
}
|
||||
}
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
}
|
||||
|
||||
round(number) {
|
||||
let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
return result
|
||||
return (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
|
@ -580,7 +580,7 @@ class NamesMarket extends LitElement {
|
||||
}).then(res => {
|
||||
this.marketSellNames = res
|
||||
})
|
||||
this.updatePageSize()
|
||||
await this.updatePageSize()
|
||||
this.isLoading = false
|
||||
setTimeout(fetchMarketSellNames, 180000)
|
||||
}
|
||||
@ -592,7 +592,7 @@ class NamesMarket extends LitElement {
|
||||
}).then(res => {
|
||||
this.marketSoldNames = res
|
||||
})
|
||||
this.updatePageSoldSize()
|
||||
await this.updatePageSoldSize()
|
||||
this.isLoading = false
|
||||
setTimeout(fetchMarketSoldNames, 300000)
|
||||
}
|
||||
@ -1053,8 +1053,7 @@ class NamesMarket extends LitElement {
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = myNode.apiKey
|
||||
return apiKey
|
||||
return myNode.apiKey
|
||||
}
|
||||
|
||||
async createCancelSellName() {
|
||||
@ -1064,11 +1063,10 @@ class NamesMarket extends LitElement {
|
||||
this.btnDisable = true
|
||||
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
}
|
||||
|
||||
const validateReceiver = async () => {
|
||||
@ -1084,18 +1082,17 @@ class NamesMarket extends LitElement {
|
||||
const myCancelSellNameDialog1 = get("registernamepage.nchange30")
|
||||
const myCancelSellNameDialog2 = get("registernamepage.nchange31")
|
||||
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 6,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
name: myName,
|
||||
lastReference: myLastRef,
|
||||
cancelSellNameDialog1: myCancelSellNameDialog1,
|
||||
cancelSellNameDialog2: myCancelSellNameDialog2
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 6,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
name: myName,
|
||||
lastReference: myLastRef,
|
||||
cancelSellNameDialog1: myCancelSellNameDialog1,
|
||||
cancelSellNameDialog2: myCancelSellNameDialog2
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -1118,7 +1115,7 @@ class NamesMarket extends LitElement {
|
||||
throw new Error(txnResponse)
|
||||
}
|
||||
}
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
}
|
||||
|
||||
createBuyName() {
|
||||
@ -1130,11 +1127,10 @@ class NamesMarket extends LitElement {
|
||||
this.btnDisable = true
|
||||
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
}
|
||||
|
||||
const validateReceiver = async () => {
|
||||
@ -1153,21 +1149,20 @@ class NamesMarket extends LitElement {
|
||||
const myBuyNameDialog2 = get("registernamepage.nchange27")
|
||||
const myBuyNameDialog3 = get("registernamepage.nchange40")
|
||||
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 7,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
name: myName,
|
||||
sellPrice: myPrice,
|
||||
recipient: mySeller,
|
||||
lastReference: myLastRef,
|
||||
buyNameDialog1: myBuyNameDialog1,
|
||||
buyNameDialog2: myBuyNameDialog2,
|
||||
buyNameDialog3: myBuyNameDialog3
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 7,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
fee: myFee,
|
||||
name: myName,
|
||||
sellPrice: myPrice,
|
||||
recipient: mySeller,
|
||||
lastReference: myLastRef,
|
||||
buyNameDialog1: myBuyNameDialog1,
|
||||
buyNameDialog2: myBuyNameDialog2,
|
||||
buyNameDialog3: myBuyNameDialog3
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -1198,8 +1193,7 @@ class NamesMarket extends LitElement {
|
||||
}
|
||||
|
||||
round(number) {
|
||||
let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
return result
|
||||
return (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
|
@ -581,8 +581,7 @@ class NodeManagement extends LitElement {
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = myNode.apiKey
|
||||
return apiKey
|
||||
return myNode.apiKey
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
|
@ -522,7 +522,7 @@ button.bg-default:focus {
|
||||
page-break-after: avoid;
|
||||
}
|
||||
|
||||
@ page {
|
||||
@page {
|
||||
size: a3;
|
||||
}
|
||||
}
|
||||
@ -664,7 +664,7 @@ button.bg-default:focus {
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
@ keyframes show-navbar-dropdown {
|
||||
@keyframes show-navbar-dropdown {
|
||||
0% {
|
||||
transition: visibility .25s, opacity .25s, transform .25s;
|
||||
transform: translate(0, 10px) perspective(200px) rotateX(-2deg);
|
||||
|
@ -146,9 +146,9 @@ class OverviewPage extends LitElement {
|
||||
this.nodeConfig = window.parent.reduxStore.getState().app.nodeConfig
|
||||
this.accountInfo = window.parent.reduxStore.getState().app.accountInfo
|
||||
|
||||
this.getNodeInfo()
|
||||
this.getCoreInfo()
|
||||
this.getBalanceInfo()
|
||||
await this.getNodeInfo()
|
||||
await this.getCoreInfo()
|
||||
await this.getBalanceInfo()
|
||||
await this.getMintingKeysList()
|
||||
|
||||
window.addEventListener('storage', () => {
|
||||
@ -223,9 +223,9 @@ class OverviewPage extends LitElement {
|
||||
async refreshItems() {
|
||||
this.nodeConfig = window.parent.reduxStore.getState().app.nodeConfig
|
||||
this.accountInfo = window.parent.reduxStore.getState().app.accountInfo
|
||||
this.getNodeInfo()
|
||||
this.getCoreInfo()
|
||||
this.getBalanceInfo()
|
||||
await this.getNodeInfo()
|
||||
await this.getCoreInfo()
|
||||
await this.getBalanceInfo()
|
||||
await this.getMintingKeysList()
|
||||
}
|
||||
|
||||
@ -238,8 +238,7 @@ class OverviewPage extends LitElement {
|
||||
|
||||
try {
|
||||
const res = await fetch(statusUrl)
|
||||
const listAccounts = await res.json()
|
||||
this.listAccounts = listAccounts
|
||||
this.listAccounts = await res.json()
|
||||
|
||||
const addressInfo = window.parent.reduxStore.getState().app.accountInfo.addressInfo
|
||||
const address = window.parent.reduxStore.getState().app.selectedAddress.address
|
||||
@ -359,8 +358,7 @@ class OverviewPage extends LitElement {
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = myNode.apiKey
|
||||
return apiKey
|
||||
return myNode.apiKey
|
||||
}
|
||||
}
|
||||
window.customElements.define('overview-page', OverviewPage)
|
||||
@ -550,8 +548,7 @@ class StartMintingNow extends LitElement {
|
||||
const url = `${nodeUrl}/admin/mintingaccounts`
|
||||
try {
|
||||
const res = await fetch(url)
|
||||
const mintingAccountData = await res.json()
|
||||
this.mintingAccountData = mintingAccountData
|
||||
this.mintingAccountData = await res.json()
|
||||
} catch (error) {
|
||||
this.errorMsg = this.renderErrorMsg1()
|
||||
}
|
||||
@ -600,7 +597,7 @@ class StartMintingNow extends LitElement {
|
||||
let snack1 = get('becomeMinterPage.bchange19')
|
||||
parentEpml.request('showSnackBar', `${snack1}`)
|
||||
this.status = 5
|
||||
this.getMintingAcccounts()
|
||||
await this.getMintingAcccounts()
|
||||
} catch (error) {
|
||||
this.errorMsg = this.renderErrorMsg3()
|
||||
|
||||
@ -618,8 +615,7 @@ class StartMintingNow extends LitElement {
|
||||
const rewardShares = async (minterAddr) => {
|
||||
const url = `${nodeUrl}/addresses/rewardshares?minters=${minterAddr}&recipients=${minterAddr}`
|
||||
const res = await fetch(url)
|
||||
const data = await res.json()
|
||||
return data
|
||||
return await res.json()
|
||||
}
|
||||
|
||||
if (!stop) {
|
||||
@ -659,7 +655,7 @@ class StartMintingNow extends LitElement {
|
||||
let rewarddialog3 = get('transactions.rewarddialog3')
|
||||
let rewarddialog4 = get('transactions.rewarddialog4')
|
||||
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 38,
|
||||
nonce: nonce,
|
||||
params: {
|
||||
@ -673,7 +669,6 @@ class StartMintingNow extends LitElement {
|
||||
},
|
||||
disableModal: true
|
||||
})
|
||||
return myTxnrequest
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -701,11 +696,10 @@ class StartMintingNow extends LitElement {
|
||||
}
|
||||
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${address}`
|
||||
})
|
||||
return myRef
|
||||
}
|
||||
|
||||
const startMinting = async () => {
|
||||
@ -721,7 +715,7 @@ class StartMintingNow extends LitElement {
|
||||
|
||||
try {
|
||||
this.privateRewardShareKey = await createSponsorshipKey()
|
||||
this.confirmRelationship(publicAddress)
|
||||
await this.confirmRelationship(publicAddress)
|
||||
} catch (error) {
|
||||
this.errorMsg = error.data.message || this.renderErrorMsg4()
|
||||
|
||||
|
@ -426,10 +426,9 @@ class Puzzles extends LitElement {
|
||||
|
||||
// Get Last Ref
|
||||
const getLastRef = async (address) => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
url: `/addresses/lastreference/${address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
url: `/addresses/lastreference/${address}`
|
||||
})
|
||||
}
|
||||
|
||||
let lastRef = await getLastRef(_guessAddress)
|
||||
|
@ -1,5 +1,4 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {render} from 'lit/html.js'
|
||||
import {Epml} from '../../../epml.js'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate'
|
||||
import isElectron from 'is-electron'
|
||||
@ -726,28 +725,23 @@ class QApps extends LitElement {
|
||||
}, 0)
|
||||
|
||||
const getFollowedNames = async () => {
|
||||
const followedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
|
||||
this.followedNames = followedNames
|
||||
this.followedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
setTimeout(getFollowedNames, 60000)
|
||||
}
|
||||
|
||||
const getBlockedNames = async () => {
|
||||
const blockedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
this.blockedNames = blockedNames
|
||||
this.blockedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
setTimeout(getBlockedNames, 60000)
|
||||
}
|
||||
|
||||
const getRelayMode = async () => {
|
||||
const relayMode = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/relaymode?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
|
||||
this.relayMode = relayMode
|
||||
this.relayMode = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/relaymode?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
setTimeout(getRelayMode, 600000)
|
||||
}
|
||||
|
||||
@ -858,10 +852,9 @@ class QApps extends LitElement {
|
||||
getAppsArrayData = async () => {
|
||||
this.isLoading = true
|
||||
this.appsArray = []
|
||||
const appsArrayRes = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/resources?service=APP&default=true&limit=0&reverse=false&includestatus=true&includemetadata=true&excludeblocked=true`
|
||||
})
|
||||
this.appsArray = appsArrayRes
|
||||
this.appsArray = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/resources?service=APP&default=true&limit=0&reverse=false&includestatus=true&includemetadata=true&excludeblocked=true`
|
||||
})
|
||||
this.isLoading = false
|
||||
this.renderAppGrid()
|
||||
}
|
||||
@ -950,19 +943,17 @@ class QApps extends LitElement {
|
||||
|
||||
getFollowedNamesRefresh = async () => {
|
||||
this.isLoading = true
|
||||
const followedNamesRes = await parentEpml.request('apiCall', {
|
||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
this.followedNames = followedNamesRes
|
||||
this.followedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
this.isLoading = false
|
||||
}
|
||||
|
||||
getFollowedNamesResource = async () => {
|
||||
this.isLoading = true
|
||||
const followedResourcesRes = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/resources?service=${this.service}&default=true&limit=0&reverse=false&includestatus=true&includemetadata=true&namefilter=followedNames`
|
||||
})
|
||||
this.followedResources = followedResourcesRes
|
||||
this.followedResources = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/resources?service=${this.service}&default=true&limit=0&reverse=false&includestatus=true&includemetadata=true&namefilter=followedNames`
|
||||
})
|
||||
this.isLoading = false
|
||||
this.renderFollowedAppsGrid()
|
||||
}
|
||||
@ -1051,20 +1042,18 @@ class QApps extends LitElement {
|
||||
|
||||
getBlockedNamesRefresh = async () => {
|
||||
this.isLoading = true
|
||||
const blockedNamesRes = await parentEpml.request('apiCall', {
|
||||
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
this.blockedNames = blockedNamesRes
|
||||
this.blockedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
this.isLoading = false
|
||||
}
|
||||
|
||||
getBlockedNamesResource = async () => {
|
||||
this.isLoading = true
|
||||
this.blockedResources = []
|
||||
const blockedResourcesRes = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/resources?service=${this.service}&default=true&limit=0&reverse=false&includestatus=true&includemetadata=true&namefilter=blockedNames`
|
||||
})
|
||||
this.blockedResources = blockedResourcesRes
|
||||
this.blockedResources = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/resources?service=${this.service}&default=true&limit=0&reverse=false&includestatus=true&includemetadata=true&namefilter=blockedNames`
|
||||
})
|
||||
this.isLoading = false
|
||||
this.renderBlockedAppsGrid()
|
||||
}
|
||||
@ -1410,9 +1399,9 @@ class QApps extends LitElement {
|
||||
this.textProgress = ''
|
||||
this.shadowRoot.getElementById('downloadProgressDialog').close()
|
||||
this.closeAppInfoDialog()
|
||||
this.getAppsArrayData()
|
||||
this.getFollowedNamesRefresh()
|
||||
this.getFollowedNamesResource()
|
||||
await this.getAppsArrayData()
|
||||
await this.getFollowedNamesRefresh()
|
||||
await this.getFollowedNamesResource()
|
||||
this.updateComplete.then(() => this.requestUpdate())
|
||||
} else if (status.id === "BUILDING") {
|
||||
this.textProgress = ''
|
||||
@ -1478,8 +1467,8 @@ class QApps extends LitElement {
|
||||
this.followedNames = this.followedNames.filter(item => item != name)
|
||||
this.followedNames.push(name)
|
||||
this.closeAppInfoDialog()
|
||||
this.getFollowedNamesRefresh()
|
||||
this.getFollowedNamesResource()
|
||||
await this.getFollowedNamesRefresh()
|
||||
await this.getFollowedNamesResource()
|
||||
} else {
|
||||
let err3string = get("appspage.schange22")
|
||||
parentEpml.request('showSnackBar', `${err3string}`)
|
||||
@ -1506,8 +1495,8 @@ class QApps extends LitElement {
|
||||
if (ret === true) {
|
||||
this.followedNames = this.followedNames.filter(item => item != name)
|
||||
this.closeAppInfoDialog()
|
||||
this.getFollowedNamesRefresh()
|
||||
this.getFollowedNamesResource()
|
||||
await this.getFollowedNamesRefresh()
|
||||
await this.getFollowedNamesResource()
|
||||
} else {
|
||||
let err4string = get("appspage.schange23")
|
||||
parentEpml.request('showSnackBar', `${err4string}`)
|
||||
@ -1535,9 +1524,9 @@ class QApps extends LitElement {
|
||||
this.blockedNames = this.blockedNames.filter(item => item != name)
|
||||
this.blockedNames.push(name)
|
||||
this.closeAppInfoDialog()
|
||||
this.getAppsArrayData()
|
||||
this.getBlockedNamesRefresh()
|
||||
this.getBlockedNamesResource()
|
||||
await this.getAppsArrayData()
|
||||
await this.getBlockedNamesRefresh()
|
||||
await this.getBlockedNamesResource()
|
||||
} else {
|
||||
let err5string = get("appspage.schange24")
|
||||
parentEpml.request('showSnackBar', `${err5string}`)
|
||||
@ -1564,8 +1553,8 @@ class QApps extends LitElement {
|
||||
if (ret === true) {
|
||||
this.blockedNames = this.blockedNames.filter(item => item != name)
|
||||
this.closeBlockedInfoDialog()
|
||||
this.getBlockedNamesRefresh()
|
||||
this.getBlockedNamesResource()
|
||||
await this.getBlockedNamesRefresh()
|
||||
await this.getBlockedNamesResource()
|
||||
} else {
|
||||
let err6string = get("appspage.schange25")
|
||||
parentEpml.request('showSnackBar', `${err6string}`)
|
||||
@ -1590,8 +1579,7 @@ class QApps extends LitElement {
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = myNode.apiKey
|
||||
return apiKey
|
||||
return myNode.apiKey
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -663,8 +663,7 @@ class DataManagement extends LitElement {
|
||||
let filepath = gifViewObj.filepath
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
const gifUrl = `${nodeUrl}/arbitrary/${service}/${name}/${identifier}?filepath=${filepath}&rebuild=true&async=true&apiKey=${this.getApiKey()}`
|
||||
this.dataImageUrl = gifUrl
|
||||
this.dataImageUrl = `${nodeUrl}/arbitrary/${service}/${name}/${identifier}?filepath=${filepath}&rebuild=true&async=true&apiKey=${this.getApiKey()}`
|
||||
this.shadowRoot.querySelector('#showGifImage').show()
|
||||
}
|
||||
|
||||
@ -984,10 +983,9 @@ class DataManagement extends LitElement {
|
||||
}
|
||||
|
||||
getManagementDetails = async () => {
|
||||
const myDat = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/hosted/resources?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
this.datres = myDat;
|
||||
this.datres = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/hosted/resources?apiKey=${this.getApiKey()}`
|
||||
});
|
||||
}
|
||||
|
||||
async updateItemsFromPage(page) {
|
||||
@ -1064,37 +1062,32 @@ class DataManagement extends LitElement {
|
||||
}
|
||||
|
||||
getSearchBlockedNames = async () => {
|
||||
let searchBlockedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
this.searchBlockedNames = searchBlockedNames
|
||||
this.searchBlockedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
}
|
||||
|
||||
getSearchFollowedNames = async () => {
|
||||
let searchFollowedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
this.searchFollowedNames = searchFollowedNames
|
||||
this.searchFollowedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
}
|
||||
|
||||
getBlockedNames = async () => {
|
||||
let blockedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
this.blockedNames = blockedNames
|
||||
this.blockedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
}
|
||||
|
||||
getFollowedNames = async () => {
|
||||
let followedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
this.followedNames = followedNames
|
||||
this.followedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
}
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node];
|
||||
let apiKey = myNode.apiKey;
|
||||
return apiKey;
|
||||
return myNode.apiKey;
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
|
@ -478,7 +478,7 @@ class PublishData extends LitElement {
|
||||
if (res.action !== 'accept') throw new Error('User declined publish')
|
||||
}
|
||||
|
||||
this.publishData(registeredName, path, file, service, identifier, preview, fee)
|
||||
await this.publishData(registeredName, path, file, service, identifier, preview, fee)
|
||||
} catch (error) {
|
||||
this.shadowRoot.querySelector('#publishWithFeeDialog').close()
|
||||
}
|
||||
@ -491,12 +491,10 @@ class PublishData extends LitElement {
|
||||
this.btnDisable = true
|
||||
|
||||
const validateName = async (receiverName) => {
|
||||
let nameRes = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/names/${receiverName}`,
|
||||
})
|
||||
|
||||
return nameRes
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/names/${receiverName}`,
|
||||
})
|
||||
}
|
||||
|
||||
const showError = async (errorMessage) => {
|
||||
@ -522,7 +520,7 @@ class PublishData extends LitElement {
|
||||
let validNameRes = await validateName(registeredName)
|
||||
if (validNameRes.error) {
|
||||
this.errorMessage = "Error: " + validNameRes.message
|
||||
showError(this.errorMessage)
|
||||
await showError(this.errorMessage)
|
||||
throw new Error(this.errorMessage)
|
||||
}
|
||||
|
||||
@ -545,13 +543,13 @@ class PublishData extends LitElement {
|
||||
if (uploadDataRes.error) {
|
||||
let err7string = get("publishpage.pchange20")
|
||||
this.errorMessage = `${err7string}` + uploadDataRes.message
|
||||
showError(this.errorMessage)
|
||||
await showError(this.errorMessage)
|
||||
throw new Error(this.errorMessage)
|
||||
}
|
||||
else if (uploadDataRes.includes("Error 500 Internal Server Error")) {
|
||||
let err8string = get("publishpage.pchange21")
|
||||
this.errorMessage = `${err8string}`
|
||||
showError(this.errorMessage)
|
||||
await showError(this.errorMessage)
|
||||
throw new Error(this.errorMessage)
|
||||
}
|
||||
|
||||
@ -580,7 +578,7 @@ class PublishData extends LitElement {
|
||||
if (signAndProcessRes.error) {
|
||||
let err10string = get("publishpage.pchange20")
|
||||
this.errorMessage = `${err10string}` + signAndProcessRes.message
|
||||
showError(this.errorMessage)
|
||||
await showError(this.errorMessage)
|
||||
throw new Error(this.errorMessage)
|
||||
}
|
||||
|
||||
@ -644,23 +642,21 @@ class PublishData extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
let uploadDataRes = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
method: 'POST',
|
||||
url: `${uploadDataUrl}`,
|
||||
body: `${postBody}`,
|
||||
})
|
||||
return uploadDataRes
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
method: 'POST',
|
||||
url: `${uploadDataUrl}`,
|
||||
body: `${postBody}`,
|
||||
})
|
||||
}
|
||||
|
||||
const convertBytesForSigning = async (transactionBytesBase58) => {
|
||||
let convertedBytes = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
method: 'POST',
|
||||
url: `/transactions/convert`,
|
||||
body: `${transactionBytesBase58}`,
|
||||
})
|
||||
return convertedBytes
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
method: 'POST',
|
||||
url: `/transactions/convert`,
|
||||
body: `${transactionBytesBase58}`,
|
||||
})
|
||||
}
|
||||
|
||||
const signAndProcess = async (transactionBytesBase58, fee) => {
|
||||
@ -668,7 +664,7 @@ class PublishData extends LitElement {
|
||||
if (convertedBytesBase58.error) {
|
||||
let err12string = get("publishpage.pchange20")
|
||||
this.errorMessage = `${err12string}` + convertedBytesBase58.message
|
||||
showError(this.errorMessage)
|
||||
await showError(this.errorMessage)
|
||||
throw new Error(this.errorMessage)
|
||||
}
|
||||
|
||||
@ -716,7 +712,7 @@ class PublishData extends LitElement {
|
||||
}
|
||||
return myResponse
|
||||
}
|
||||
validate()
|
||||
await validate()
|
||||
}
|
||||
|
||||
fetchResourceMetadata() {
|
||||
@ -750,8 +746,7 @@ class PublishData extends LitElement {
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = myNode.apiKey
|
||||
return apiKey
|
||||
return myNode.apiKey
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -406,28 +406,23 @@ class Websites extends LitElement {
|
||||
}, 0)
|
||||
|
||||
const getFollowedNames = async () => {
|
||||
let followedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
|
||||
this.followedNames = followedNames
|
||||
this.followedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
setTimeout(getFollowedNames, 60000)
|
||||
}
|
||||
|
||||
const getBlockedNames = async () => {
|
||||
let blockedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
this.blockedNames = blockedNames
|
||||
this.blockedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
setTimeout(getBlockedNames, 60000)
|
||||
}
|
||||
|
||||
const getRelayMode = async () => {
|
||||
let relayMode = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/relaymode?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
|
||||
this.relayMode = relayMode
|
||||
this.relayMode = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/relaymode?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
setTimeout(getRelayMode, 600000)
|
||||
}
|
||||
|
||||
@ -553,38 +548,33 @@ class Websites extends LitElement {
|
||||
}
|
||||
|
||||
getArbitraryResources = async () => {
|
||||
const resources = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/resources?service=${this.service}&default=true&limit=0&reverse=false&includestatus=false&includemetadata=false&excludeblocked=true`
|
||||
})
|
||||
this.resources = resources
|
||||
this.resources = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/resources?service=${this.service}&default=true&limit=0&reverse=false&includestatus=false&includemetadata=false&excludeblocked=true`
|
||||
})
|
||||
}
|
||||
|
||||
getFollowedNamesResource = async () => {
|
||||
const followedRes = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/resources?service=${this.service}&default=true&limit=0&reverse=false&includestatus=true&includemetadata=true&namefilter=followedNames`
|
||||
})
|
||||
this.followedResources = followedRes
|
||||
this.followedResources = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/resources?service=${this.service}&default=true&limit=0&reverse=false&includestatus=true&includemetadata=true&namefilter=followedNames`
|
||||
})
|
||||
}
|
||||
|
||||
getFollowedNamesRefresh = async () => {
|
||||
let followedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
this.followedNames = followedNames
|
||||
this.followedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
}
|
||||
|
||||
getBlockedNamesResource = async () => {
|
||||
const blockedRes = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/resources?service=${this.service}&default=true&limit=0&reverse=false&includestatus=true&includemetadata=true&namefilter=blockedNames`
|
||||
})
|
||||
this.blockedResources = blockedRes
|
||||
this.blockedResources = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/resources?service=${this.service}&default=true&limit=0&reverse=false&includestatus=true&includemetadata=true&namefilter=blockedNames`
|
||||
})
|
||||
}
|
||||
|
||||
getBlockedNamesRefresh = async () => {
|
||||
let blockedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
this.blockedNames = blockedNames
|
||||
this.blockedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`
|
||||
})
|
||||
}
|
||||
|
||||
async getData(offset) {
|
||||
@ -593,9 +583,7 @@ class Websites extends LitElement {
|
||||
let jsonOffsetUrl = `${nodeUrl}/arbitrary/resources?service=WEBSITE&default=true&limit=20&offset=${offset}&reverse=false&includestatus=true&includemetadata=true&excludeblocked=true`
|
||||
|
||||
const jsonOffsetRes = await fetch(jsonOffsetUrl)
|
||||
const jsonOffsetData = await jsonOffsetRes.json()
|
||||
|
||||
this.pageRes = jsonOffsetData
|
||||
this.pageRes = await jsonOffsetRes.json()
|
||||
}
|
||||
|
||||
async updateItemsFromPage(page) {
|
||||
@ -809,8 +797,8 @@ class Websites extends LitElement {
|
||||
// immediately, as apposed to only adding if it doesn't already exist
|
||||
this.followedNames = this.followedNames.filter(item => item != name)
|
||||
this.followedNames.push(name)
|
||||
this.getFollowedNamesRefresh()
|
||||
this.getFollowedNamesResource()
|
||||
await this.getFollowedNamesRefresh()
|
||||
await this.getFollowedNamesResource()
|
||||
} else {
|
||||
let err3string = get("websitespage.schange22")
|
||||
parentEpml.request('showSnackBar', `${err3string}`)
|
||||
@ -863,8 +851,8 @@ class Websites extends LitElement {
|
||||
if (ret === true) {
|
||||
// Successfully unfollowed - remove from local list
|
||||
this.followedNames = this.followedNames.filter(item => item != name)
|
||||
this.getFollowedNamesRefresh()
|
||||
this.getFollowedNamesResource()
|
||||
await this.getFollowedNamesRefresh()
|
||||
await this.getFollowedNamesResource()
|
||||
} else {
|
||||
let err4string = get("websitespage.schange23")
|
||||
parentEpml.request('showSnackBar', `${err4string}`)
|
||||
@ -923,8 +911,8 @@ class Websites extends LitElement {
|
||||
// immediately, as apposed to only adding if it doesn't already exist
|
||||
this.blockedNames = this.blockedNames.filter(item => item != name)
|
||||
this.blockedNames.push(name)
|
||||
this.getBlockedNamesRefresh()
|
||||
this.getBlockedNamesResource()
|
||||
await this.getBlockedNamesRefresh()
|
||||
await this.getBlockedNamesResource()
|
||||
} else {
|
||||
let err5string = get("websitespage.schange24")
|
||||
parentEpml.request('showSnackBar', `${err5string}`)
|
||||
@ -977,8 +965,8 @@ class Websites extends LitElement {
|
||||
if (ret === true) {
|
||||
// Successfully unblocked - remove from local list
|
||||
this.blockedNames = this.blockedNames.filter(item => item != name)
|
||||
this.getBlockedNamesRefresh()
|
||||
this.getBlockedNamesResource()
|
||||
await this.getBlockedNamesRefresh()
|
||||
await this.getBlockedNamesResource()
|
||||
} else {
|
||||
let err6string = get("websitespage.schange25")
|
||||
parentEpml.request('showSnackBar', `${err6string}`)
|
||||
@ -1116,8 +1104,7 @@ class Websites extends LitElement {
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = myNode.apiKey
|
||||
return apiKey
|
||||
return myNode.apiKey
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
|
@ -577,12 +577,11 @@ class QortalLottery extends LitElement {
|
||||
}
|
||||
prepareClosedLotteriesArray.push(obj)
|
||||
} else {
|
||||
const winName = twinner
|
||||
const obj = {
|
||||
description: tdescription,
|
||||
startblock: tstartblock,
|
||||
endblock: tendblock,
|
||||
winner: winName,
|
||||
winner: twinner,
|
||||
jackpot: tjackpot
|
||||
}
|
||||
prepareClosedLotteriesArray.push(obj)
|
||||
@ -844,11 +843,10 @@ class QortalLottery extends LitElement {
|
||||
}
|
||||
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${window.parent.reduxStore.getState().app.selectedAddress.address}`,
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${window.parent.reduxStore.getState().app.selectedAddress.address}`,
|
||||
})
|
||||
}
|
||||
|
||||
const validateName = async (receiverName) => {
|
||||
@ -867,8 +865,7 @@ class QortalLottery extends LitElement {
|
||||
}
|
||||
|
||||
const validateAddress = async (receiverAddress) => {
|
||||
let myAddress = await window.parent.validateAddress(receiverAddress)
|
||||
return myAddress
|
||||
return await window.parent.validateAddress(receiverAddress)
|
||||
}
|
||||
|
||||
const validateReceiver = async (recipient) => {
|
||||
@ -923,22 +920,21 @@ class QortalLottery extends LitElement {
|
||||
let dialogName = get("login.name")
|
||||
let dialogto = get("transactions.to")
|
||||
let recipientName = await getName(myReceiver)
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 2,
|
||||
nonce: window.parent.reduxStore.getState().app.selectedAddress.nonce,
|
||||
params: {
|
||||
recipient: myReceiver,
|
||||
recipientName: recipientName,
|
||||
amount: amount,
|
||||
lastReference: mylastRef,
|
||||
fee: sendFee,
|
||||
dialogamount: dialogamount,
|
||||
dialogto: dialogto,
|
||||
dialogAddress,
|
||||
dialogName
|
||||
},
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 2,
|
||||
nonce: window.parent.reduxStore.getState().app.selectedAddress.nonce,
|
||||
params: {
|
||||
recipient: myReceiver,
|
||||
recipientName: recipientName,
|
||||
amount: amount,
|
||||
lastReference: mylastRef,
|
||||
fee: sendFee,
|
||||
dialogamount: dialogamount,
|
||||
dialogto: dialogto,
|
||||
dialogAddress,
|
||||
dialogName
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -963,7 +959,7 @@ class QortalLottery extends LitElement {
|
||||
throw new Error(txnResponse)
|
||||
}
|
||||
}
|
||||
validateReceiver(recipient)
|
||||
await validateReceiver(recipient)
|
||||
}
|
||||
|
||||
clearConsole() {
|
||||
@ -982,13 +978,11 @@ class QortalLottery extends LitElement {
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = myNode.apiKey
|
||||
return apiKey
|
||||
return myNode.apiKey
|
||||
}
|
||||
|
||||
round(number) {
|
||||
let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
return result
|
||||
return (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
|
@ -346,20 +346,18 @@ class RewardShare extends LitElement {
|
||||
|
||||
// Get Last Ref
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
};
|
||||
|
||||
// Get Account Details
|
||||
const getAccountDetails = async () => {
|
||||
let myAccountDetails = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/${this.selectedAddress.address}`
|
||||
})
|
||||
return myAccountDetails
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/${this.selectedAddress.address}`
|
||||
})
|
||||
};
|
||||
|
||||
// Get Reward Relationship if it already exists
|
||||
@ -369,7 +367,7 @@ class RewardShare extends LitElement {
|
||||
type: 'api',
|
||||
url: `/addresses/rewardshares?minters=${minterAddr}&recipients=${recipientAddress}`
|
||||
})
|
||||
isRewardShareExisting = myRewardShareArray.length !== 0 ? true : false
|
||||
isRewardShareExisting = myRewardShareArray.length !== 0
|
||||
return isRewardShareExisting
|
||||
}
|
||||
|
||||
@ -459,20 +457,19 @@ class RewardShare extends LitElement {
|
||||
let rewarddialog2 = get("transactions.rewarddialog2")
|
||||
let rewarddialog3 = get("transactions.rewarddialog3")
|
||||
let rewarddialog4 = get("transactions.rewarddialog4")
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 38,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
recipientPublicKey,
|
||||
percentageShare,
|
||||
lastReference: mylastRef,
|
||||
rewarddialog1: rewarddialog1,
|
||||
rewarddialog2: rewarddialog2,
|
||||
rewarddialog3: rewarddialog3,
|
||||
rewarddialog4: rewarddialog4,
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 38,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
recipientPublicKey,
|
||||
percentageShare,
|
||||
lastReference: mylastRef,
|
||||
rewarddialog1: rewarddialog1,
|
||||
rewarddialog2: rewarddialog2,
|
||||
rewarddialog3: rewarddialog3,
|
||||
rewarddialog4: rewarddialog4,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -481,8 +478,7 @@ class RewardShare extends LitElement {
|
||||
this.message = txnResponse.message
|
||||
throw new Error(txnResponse)
|
||||
} else if (txnResponse.success === true && !txnResponse.data.error) {
|
||||
let err6string = get("rewardsharepage.rchange21")
|
||||
this.message = err6string
|
||||
this.message = get("rewardsharepage.rchange21")
|
||||
this.error = false
|
||||
} else {
|
||||
this.error = true
|
||||
@ -490,7 +486,7 @@ class RewardShare extends LitElement {
|
||||
throw new Error(txnResponse)
|
||||
}
|
||||
}
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
this.createRewardShareLoading = false
|
||||
}
|
||||
|
||||
@ -507,20 +503,18 @@ class RewardShare extends LitElement {
|
||||
|
||||
// Get Last Ref
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
};
|
||||
|
||||
// Get Account Details
|
||||
const getAccountDetails = async () => {
|
||||
let myAccountDetails = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/${this.selectedAddress.address}`
|
||||
})
|
||||
return myAccountDetails
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/${this.selectedAddress.address}`
|
||||
})
|
||||
};
|
||||
|
||||
// Get Reward Relationship if it already exists
|
||||
@ -530,7 +524,7 @@ class RewardShare extends LitElement {
|
||||
type: 'api',
|
||||
url: `/addresses/rewardshares?minters=${minterAddr}&recipients=${recipientAddress}`
|
||||
})
|
||||
isRewardShareExisting = myRewardShareArray.length !== 0 ? true : false
|
||||
isRewardShareExisting = myRewardShareArray.length !== 0
|
||||
return isRewardShareExisting
|
||||
}
|
||||
|
||||
@ -620,20 +614,19 @@ class RewardShare extends LitElement {
|
||||
let rewarddialog2 = get("transactions.rewarddialog2")
|
||||
let rewarddialog3 = get("transactions.rewarddialog3")
|
||||
let rewarddialog4 = get("transactions.rewarddialog4")
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 38,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
recipientPublicKey,
|
||||
percentageShare,
|
||||
lastReference: mylastRef,
|
||||
rewarddialog1: rewarddialog1,
|
||||
rewarddialog2: rewarddialog2,
|
||||
rewarddialog3: rewarddialog3,
|
||||
rewarddialog4: rewarddialog4,
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 38,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
recipientPublicKey,
|
||||
percentageShare,
|
||||
lastReference: mylastRef,
|
||||
rewarddialog1: rewarddialog1,
|
||||
rewarddialog2: rewarddialog2,
|
||||
rewarddialog3: rewarddialog3,
|
||||
rewarddialog4: rewarddialog4,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -642,8 +635,7 @@ class RewardShare extends LitElement {
|
||||
this.message = txnResponse.message
|
||||
throw new Error(txnResponse)
|
||||
} else if (txnResponse.success === true && !txnResponse.data.error) {
|
||||
let err6string = get("rewardsharepage.rchange21")
|
||||
this.message = err6string
|
||||
this.message = get("rewardsharepage.rchange21")
|
||||
this.error = false
|
||||
} else {
|
||||
this.error = true
|
||||
@ -651,7 +643,7 @@ class RewardShare extends LitElement {
|
||||
throw new Error(txnResponse)
|
||||
}
|
||||
}
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
this.createRewardShareLoading = false
|
||||
}
|
||||
|
||||
@ -664,11 +656,10 @@ class RewardShare extends LitElement {
|
||||
// Get Last Ref
|
||||
const getLastRef = async () => {
|
||||
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${this.selectedAddress.address}`
|
||||
})
|
||||
};
|
||||
|
||||
// Remove Reward Share
|
||||
@ -686,19 +677,18 @@ class RewardShare extends LitElement {
|
||||
let mylastRef = lastRef
|
||||
let rewarddialog5 = get("transactions.rewarddialog5")
|
||||
let rewarddialog6 = get("transactions.rewarddialog6")
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
type: 381,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
rewardShareKeyPairPublicKey: rewardShareObject.rewardSharePublicKey,
|
||||
recipient: rewardShareObject.recipient,
|
||||
percentageShare: myPercentageShare,
|
||||
lastReference: mylastRef,
|
||||
rewarddialog5: rewarddialog5,
|
||||
rewarddialog6: rewarddialog6,
|
||||
}
|
||||
})
|
||||
return myTxnrequest
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 381,
|
||||
nonce: this.selectedAddress.nonce,
|
||||
params: {
|
||||
rewardShareKeyPairPublicKey: rewardShareObject.rewardSharePublicKey,
|
||||
recipient: rewardShareObject.recipient,
|
||||
percentageShare: myPercentageShare,
|
||||
lastReference: mylastRef,
|
||||
rewarddialog5: rewarddialog5,
|
||||
rewarddialog6: rewarddialog6,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -716,7 +706,7 @@ class RewardShare extends LitElement {
|
||||
throw new Error(txnResponse)
|
||||
}
|
||||
}
|
||||
removeReceiver()
|
||||
await removeReceiver()
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
|
@ -240,7 +240,7 @@ class SponsorshipList extends LitElement {
|
||||
</mwc-button>
|
||||
</mwc-dialog>
|
||||
|
||||
<mwc-dialog escapeKeyAction='' scrimClickAction='' id='showDialogRewardShareCreationStatus' ?hideActions=${this.errorMessage ? false : this.status < 4 ? true : false} ?open=${this.openDialogRewardShare}>
|
||||
<mwc-dialog escapeKeyAction='' scrimClickAction='' id='showDialogRewardShareCreationStatus' ?hideActions=${this.errorMessage ? false : this.status < 4} ?open=${this.openDialogRewardShare}>
|
||||
<div class='dialog-header' >
|
||||
<div class='row'>
|
||||
<h1>${translate('sponsorshipspage.schange14')}</h1>
|
||||
@ -461,10 +461,9 @@ class SponsorshipList extends LitElement {
|
||||
}
|
||||
|
||||
async getNodeInfo() {
|
||||
const nodeInfo = await parentEpml.request('apiCall', {
|
||||
return await parentEpml.request('apiCall', {
|
||||
url: `/admin/status`
|
||||
})
|
||||
return nodeInfo
|
||||
}
|
||||
|
||||
async saveToClipboard(toBeCopied, text) {
|
||||
@ -483,8 +482,7 @@ class SponsorshipList extends LitElement {
|
||||
|
||||
getApiKey() {
|
||||
const apiNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = apiNode.apiKey
|
||||
return apiKey
|
||||
return apiNode.apiKey
|
||||
}
|
||||
|
||||
async atMount() {
|
||||
@ -511,8 +509,7 @@ class SponsorshipList extends LitElement {
|
||||
if(getNames.length > 0 ) {
|
||||
const avatarNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
const avatarUrl = avatarNode.protocol + '://' + avatarNode.domain + ':' + avatarNode.port
|
||||
const urlPic = `${avatarUrl}/arbitrary/THUMBNAIL/${getNames[0].name}/qortal_avatar?async=true&apiKey=${this.getApiKey()}`
|
||||
url = urlPic
|
||||
url = `${avatarUrl}/arbitrary/THUMBNAIL/${getNames[0].name}/qortal_avatar?async=true&apiKey=${this.getApiKey()}`
|
||||
}
|
||||
|
||||
let blocksRemaining = this._levelUpBlocks(addressInfo)
|
||||
@ -554,16 +551,14 @@ class SponsorshipList extends LitElement {
|
||||
}
|
||||
|
||||
async getRewardShareRelationship(recipientAddress) {
|
||||
const myRewardShareArray = await parentEpml.request('apiCall', {
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/rewardshares?minters=${recipientAddress}`
|
||||
})
|
||||
return myRewardShareArray
|
||||
}
|
||||
|
||||
_levelUpBlocks(accountInfo) {
|
||||
let countBlocksString = (blocksNeed(0) - (accountInfo.blocksMinted + accountInfo.blocksMintedAdjustment)).toString()
|
||||
return countBlocksString
|
||||
return (blocksNeed(0) - (accountInfo.blocksMinted + accountInfo.blocksMintedAdjustment)).toString()
|
||||
}
|
||||
|
||||
async removeRewardShare(rewardShareObject) {
|
||||
@ -577,11 +572,10 @@ class SponsorshipList extends LitElement {
|
||||
|
||||
// Get Last Ref
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${selectedAddress?.address}`
|
||||
})
|
||||
return myRef
|
||||
}
|
||||
|
||||
// Remove Reward Share
|
||||
@ -597,7 +591,7 @@ class SponsorshipList extends LitElement {
|
||||
let mylastRef = lastRef
|
||||
let rewarddialog5 = get('transactions.rewarddialog5')
|
||||
let rewarddialog6 = get('transactions.rewarddialog6')
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 381,
|
||||
nonce: selectedAddress.nonce,
|
||||
params: {
|
||||
@ -610,7 +604,6 @@ class SponsorshipList extends LitElement {
|
||||
rewarddialog6: rewarddialog6,
|
||||
},
|
||||
})
|
||||
return myTxnrequest
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -632,7 +625,7 @@ class SponsorshipList extends LitElement {
|
||||
throw new Error(txnResponse)
|
||||
}
|
||||
}
|
||||
removeReceiver()
|
||||
await removeReceiver()
|
||||
}
|
||||
|
||||
async createRewardShare(publicKeyValue, isCopy) {
|
||||
@ -652,20 +645,18 @@ class SponsorshipList extends LitElement {
|
||||
|
||||
// Get Last Ref
|
||||
const getLastRef = async () => {
|
||||
let myRef = await parentEpml.request('apiCall', {
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/lastreference/${selectedAddress.address}`
|
||||
})
|
||||
return myRef
|
||||
}
|
||||
|
||||
// Get Account Details
|
||||
const getAccountDetails = async () => {
|
||||
let myAccountDetails = await parentEpml.request('apiCall', {
|
||||
return await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/${selectedAddress.address}`
|
||||
})
|
||||
return myAccountDetails
|
||||
}
|
||||
|
||||
// Validate Reward Share by Level
|
||||
@ -703,7 +694,7 @@ class SponsorshipList extends LitElement {
|
||||
let rewarddialog2 = get('transactions.rewarddialog2')
|
||||
let rewarddialog3 = get('transactions.rewarddialog3')
|
||||
let rewarddialog4 = get('transactions.rewarddialog4')
|
||||
let myTxnrequest = await parentEpml.request('transaction', {
|
||||
return await parentEpml.request('transaction', {
|
||||
type: 38,
|
||||
nonce: selectedAddress.nonce,
|
||||
params: {
|
||||
@ -717,7 +708,6 @@ class SponsorshipList extends LitElement {
|
||||
},
|
||||
disableModal: true
|
||||
})
|
||||
return myTxnrequest
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
@ -746,7 +736,7 @@ class SponsorshipList extends LitElement {
|
||||
throw new Error(dataMessage || txnResponse.message || defaultErrorMessage);
|
||||
}
|
||||
}
|
||||
validateReceiver()
|
||||
await validateReceiver()
|
||||
}
|
||||
|
||||
async confirmRelationship(recipientPublicKey, isCopy) {
|
||||
|
@ -26,9 +26,7 @@ const objectToArray = (object) => {
|
||||
let directList = object.direct.map(dc => {
|
||||
return { ...dc, url: `direct/${dc.address}` }
|
||||
})
|
||||
let chatHeadMasterList = [...groupList, ...directList]
|
||||
|
||||
return chatHeadMasterList
|
||||
return [...groupList, ...directList]
|
||||
}
|
||||
|
||||
const sortActiveChat = (activeChatObject, localChatHeads) => {
|
||||
@ -213,7 +211,7 @@ parentEpml.subscribe('logged_in', async isLoggedIn => {
|
||||
if (isLoggedIn === 'true') {
|
||||
|
||||
// Call Set Account Info...
|
||||
setAccountInfo(window.parent.reduxStore.getState().app.selectedAddress.address)
|
||||
await setAccountInfo(window.parent.reduxStore.getState().app.selectedAddress.address)
|
||||
|
||||
// Start Chat Watcher Socket
|
||||
pingActiveChatSocket()
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {html, LitElement} from 'lit'
|
||||
import {render} from 'lit/html.js'
|
||||
import {Epml} from '../../../epml.js'
|
||||
import isElectron from 'is-electron'
|
||||
@ -1515,7 +1515,7 @@ class TradeBotPortal extends LitElement {
|
||||
|
||||
this.changeTheme()
|
||||
this.changeLanguage()
|
||||
this.tradeFee()
|
||||
await this.tradeFee()
|
||||
await this.getNewBlockedTrades()
|
||||
|
||||
this.autoHelperMessage = this.renderAutoHelperPass()
|
||||
@ -1556,8 +1556,8 @@ class TradeBotPortal extends LitElement {
|
||||
this.shadowRoot.getElementById('autoLockScreenActive').open()
|
||||
}
|
||||
|
||||
this.updateWalletBalance()
|
||||
this.fetchWalletAddress(this.selectedCoin)
|
||||
await this.updateWalletBalance()
|
||||
await this.fetchWalletAddress(this.selectedCoin)
|
||||
this.blockedTradesList = JSON.parse(localStorage.getItem('failedTrades') || '[]')
|
||||
this._openOrdersGrid = this.shadowRoot.getElementById('openOrdersGrid')
|
||||
|
||||
@ -2408,7 +2408,7 @@ class TradeBotPortal extends LitElement {
|
||||
await this.getDoneTrades()
|
||||
this.updateDoneTradesTimeout = setTimeout(() => this.getDoneTrades(), 180000)
|
||||
await this.updateWalletBalance()
|
||||
this.fetchWalletAddress(coin)
|
||||
await this.fetchWalletAddress(coin)
|
||||
|
||||
}
|
||||
|
||||
@ -3168,9 +3168,8 @@ class TradeBotPortal extends LitElement {
|
||||
}
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node];
|
||||
let apiKey = myNode.apiKey;
|
||||
return apiKey;
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
return myNode.apiKey
|
||||
}
|
||||
|
||||
clearTradeBotForm() {
|
||||
@ -3188,8 +3187,7 @@ class TradeBotPortal extends LitElement {
|
||||
}
|
||||
|
||||
round(number) {
|
||||
let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
return result
|
||||
return (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
}
|
||||
|
||||
inlineWorker(passedFunction, modifiers) {
|
||||
|
@ -200,8 +200,7 @@ class ArrrCharts extends LitElement {
|
||||
}
|
||||
|
||||
round(number) {
|
||||
let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
return result
|
||||
return (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -201,8 +201,7 @@ class BtcCharts extends LitElement {
|
||||
}
|
||||
|
||||
round(number) {
|
||||
let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
return result
|
||||
return (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -200,8 +200,7 @@ class DgbCharts extends LitElement {
|
||||
}
|
||||
|
||||
round(number) {
|
||||
let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
return result
|
||||
return (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -200,8 +200,7 @@ class DogeCharts extends LitElement {
|
||||
}
|
||||
|
||||
round(number) {
|
||||
let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
return result
|
||||
return (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -200,8 +200,7 @@ class LtcCharts extends LitElement {
|
||||
}
|
||||
|
||||
round(number) {
|
||||
let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
return result
|
||||
return (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -200,8 +200,7 @@ class RvnCharts extends LitElement {
|
||||
}
|
||||
|
||||
round(number) {
|
||||
let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
return result
|
||||
return (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
}
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user