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