forked from Qortal/qortal-ui
Merge remote-tracking branch 'main/master' into feature/new-editor-file-import
This commit is contained in:
commit
2cea94b720
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "qortal-ui",
|
||||
"version": "3.0.1",
|
||||
"version": "3.1.0",
|
||||
"description": "Qortal Project - decentralize the world - Data storage, communications, web hosting, decentralized trading, complete infrastructure for the future blockchain-based Internet",
|
||||
"keywords": [
|
||||
"QORT",
|
||||
@ -37,7 +37,7 @@
|
||||
"os-locale": "3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"electron": "22.2.0",
|
||||
"electron": "22.2.1",
|
||||
"electron-builder": "23.6.0",
|
||||
"electron-packager": "17.1.1",
|
||||
"shelljs": "0.8.5"
|
||||
|
@ -283,7 +283,8 @@
|
||||
"wchange54": "Adressbuch exportieren",
|
||||
"wchange55": "Ihr bestehendes Adressbuch wird gelöscht und aus einem Backup neu erstellt.",
|
||||
"wchange56": "WARNUNG!",
|
||||
"wchange57": "Memo"
|
||||
"wchange57": "Memo",
|
||||
"wchange58": "Neue Adresse"
|
||||
},
|
||||
"tradepage": {
|
||||
"tchange1": "Handelsportal",
|
||||
|
@ -283,7 +283,8 @@
|
||||
"wchange54": "Exportar libreta de direcciones",
|
||||
"wchange55": "Su libreta de direcciones existente se eliminará y se creará una nueva copia de seguridad.",
|
||||
"wchange56": "ADVERTENCIA!",
|
||||
"wchange57": "Memorándum"
|
||||
"wchange57": "Memorándum",
|
||||
"wchange58": "Nueva Dirección"
|
||||
},
|
||||
"tradepage": {
|
||||
"tchange1": "Portal de Comercio",
|
||||
|
@ -283,7 +283,8 @@
|
||||
"wchange54": "Exporter le carnet d'adresses",
|
||||
"wchange55": "Votre carnet d'adresses existant sera supprimé et une nouvelle sauvegarde sera créée.",
|
||||
"wchange56": "ATTENTION!",
|
||||
"wchange57": "Mémo"
|
||||
"wchange57": "Mémo",
|
||||
"wchange58": "Nouvelle Adresse"
|
||||
},
|
||||
"tradepage": {
|
||||
"tchange1": "Portail de commerce",
|
||||
|
@ -284,7 +284,8 @@
|
||||
"wchange54": "निर्यात पता पुस्तिका",
|
||||
"wchange55": "आपकी मौजूदा पता पुस्तिका हटा दी जाएगी और बैकअप से नया बनाया जाएगा।",
|
||||
"wchange56": "चेतावनी!",
|
||||
"wchange57": "ज्ञापन"
|
||||
"wchange57": "ज्ञापन",
|
||||
"wchange58": "नया पता"
|
||||
},
|
||||
"tradepage": {
|
||||
"tchange1": "व्यापार पोर्टल",
|
||||
|
@ -283,7 +283,8 @@
|
||||
"wchange54": "Izvezi adresar",
|
||||
"wchange55": "Vaš postojeći adresar bit će izbrisan i novi će se stvoriti iz sigurnosne kopije.",
|
||||
"wchange56": "UPOZORENJE!",
|
||||
"wchange57": "Dopis"
|
||||
"wchange57": "Dopis",
|
||||
"wchange58": "Nova Adresa"
|
||||
},
|
||||
"tradepage": {
|
||||
"tchange1": "Portal razmjene",
|
||||
|
@ -283,7 +283,8 @@
|
||||
"wchange54": "Címjegyzék exportálása",
|
||||
"wchange55": "Meglévő címjegyzéke törlésre kerül, és a biztonsági másolatból új jön létre.",
|
||||
"wchange56": "FIGYELEM!",
|
||||
"wchange57": "Memo"
|
||||
"wchange57": "Memo",
|
||||
"wchange58": "Új Cím"
|
||||
},
|
||||
"tradepage": {
|
||||
"tchange1": "Kereskedelmi Portál",
|
||||
|
@ -283,7 +283,8 @@
|
||||
"wchange54": "Esporta rubrica",
|
||||
"wchange55": "La tua rubrica esistente verrà eliminata e dal backup verrà creata una nuova.",
|
||||
"wchange56": "AVVERTIMENTO!",
|
||||
"wchange57": "Memo"
|
||||
"wchange57": "Memo",
|
||||
"wchange58": "Nuovo Indirizzo"
|
||||
},
|
||||
"tradepage": {
|
||||
"tchange1": "Portale commerciale",
|
||||
|
@ -283,7 +283,8 @@
|
||||
"wchange54": "주소록 내보내기",
|
||||
"wchange55": "기존 주소록이 삭제되고 백업에서 새로 생성됩니다.",
|
||||
"wchange56": "경고!",
|
||||
"wchange57": "메모"
|
||||
"wchange57": "메모",
|
||||
"wchange58": "새 주소"
|
||||
},
|
||||
"tradepage": {
|
||||
"tchange1": "무역 포털",
|
||||
|
@ -283,7 +283,8 @@
|
||||
"wchange54": "Eksporter adressebok",
|
||||
"wchange55": "Din eksisterende adressebok vil bli slettet og ny opprettet fra sikkerhetskopi.",
|
||||
"wchange56": "ADVARSEL!",
|
||||
"wchange57": "Memo"
|
||||
"wchange57": "Memo",
|
||||
"wchange58": "Ny Adresse"
|
||||
},
|
||||
"tradepage": {
|
||||
"tchange1": "Handelsportal",
|
||||
|
@ -283,7 +283,8 @@
|
||||
"wchange54": "Eksportuj książkę adresową",
|
||||
"wchange55": "Twoja istniejąca książka adresowa zostanie usunięta, az kopii zapasowej utworzona nowa.",
|
||||
"wchange56": "OSTRZEŻENIE!",
|
||||
"wchange57": "Memo"
|
||||
"wchange57": "Memo",
|
||||
"wchange58": "Nowy Adres"
|
||||
},
|
||||
"tradepage": {
|
||||
"tchange1": "Portal Handlowy",
|
||||
|
@ -283,7 +283,8 @@
|
||||
"wchange54": "Exportar catálogo de endereços",
|
||||
"wchange55": "Seu catálogo de endereços existente será excluído e o backup será criado novamente.",
|
||||
"wchange56": "AVISO!",
|
||||
"wchange57": "Memorando"
|
||||
"wchange57": "Memorando",
|
||||
"wchange58": "Novo Endereço"
|
||||
},
|
||||
"tradepage": {
|
||||
"tchange1": "Portal do Comércio",
|
||||
|
@ -283,7 +283,8 @@
|
||||
"wchange54": "Exportati agenda de adrese",
|
||||
"wchange55": "Agenda dvs. existenta va fi stearsa si din backup va fi creata o noua.",
|
||||
"wchange56": "AVERTIZARE!",
|
||||
"wchange57": "Nota"
|
||||
"wchange57": "Nota",
|
||||
"wchange58": "Adresa noua"
|
||||
},
|
||||
"tradepage": {
|
||||
"tchange1": "Portal de Tranzactionare",
|
||||
|
@ -283,7 +283,8 @@
|
||||
"wchange54": "Izvezi adresar",
|
||||
"wchange55": "Vaš postojeći adresar će biti obrisan, a iz rezervne kopije biće kreiran novi.",
|
||||
"wchange56": "UPOZORENJE!",
|
||||
"wchange57": "Beleška"
|
||||
"wchange57": "Beleška",
|
||||
"wchange58": "Nova Adresa"
|
||||
},
|
||||
"tradepage": {
|
||||
"tchange1": "Trgovinski prozor",
|
||||
|
@ -283,7 +283,8 @@
|
||||
"wchange54": "Экспорт адресной книги",
|
||||
"wchange55": "Ваша существующая адресная книга будет удалена, а из резервной копии создана новая.",
|
||||
"wchange56": "ПРЕДУПРЕЖДЕНИЕ!",
|
||||
"wchange57": "Памятка"
|
||||
"wchange57": "Памятка",
|
||||
"wchange58": "Новый Адрес"
|
||||
},
|
||||
"tradepage": {
|
||||
"tchange1": "Торговый портал",
|
||||
|
@ -283,7 +283,8 @@
|
||||
"wchange54": "Export Address Book",
|
||||
"wchange55": "Your existing address book will be deleted and from backup new created.",
|
||||
"wchange56": "WARNING!",
|
||||
"wchange57": "Memo"
|
||||
"wchange57": "Memo",
|
||||
"wchange58": "New Address"
|
||||
},
|
||||
"tradepage": {
|
||||
"tchange1": "Trade Portal",
|
||||
|
@ -283,7 +283,8 @@
|
||||
"wchange54": "导出通讯录",
|
||||
"wchange55": "您现有的通讯簿将被删除并从新创建的备份中。",
|
||||
"wchange56": "警告!",
|
||||
"wchange57": "备忘录"
|
||||
"wchange57": "备忘录",
|
||||
"wchange58": "新的钱包地址"
|
||||
},
|
||||
"tradepage": {
|
||||
"tchange1": "交易门户",
|
||||
|
@ -283,7 +283,8 @@
|
||||
"wchange54": "導出通訊錄",
|
||||
"wchange55": "您現有的通訊簿將被刪除並從新創建的備份中。",
|
||||
"wchange56": "警告!",
|
||||
"wchange57": "備忘錄"
|
||||
"wchange57": "備忘錄",
|
||||
"wchange58": "新的錢包地址"
|
||||
},
|
||||
"tradepage": {
|
||||
"tchange1": "交易門戶",
|
||||
|
@ -74,7 +74,7 @@
|
||||
"pwa-helpers": "0.9.1",
|
||||
"redux": "4.2.1",
|
||||
"redux-thunk": "2.4.2",
|
||||
"rollup": "3.14.0",
|
||||
"rollup": "3.15.0",
|
||||
"rollup-plugin-node-globals": "1.4.0",
|
||||
"rollup-plugin-progress": "1.1.2",
|
||||
"rollup-plugin-scss": "3.0.0",
|
||||
|
@ -18,6 +18,7 @@ class AppInfo extends connect(store)(LitElement) {
|
||||
coreInfo: { type: Array },
|
||||
nodeConfig: { type: Object },
|
||||
pageUrl: { type: String },
|
||||
publicizeAddress: { type: String },
|
||||
theme: { type: String, reflect: true }
|
||||
}
|
||||
}
|
||||
@ -95,6 +96,7 @@ class AppInfo extends connect(store)(LitElement) {
|
||||
this.coreInfo = []
|
||||
this.nodeStatus = {}
|
||||
this.pageUrl = ''
|
||||
this.publicizeAddress = ''
|
||||
this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light'
|
||||
this.publicKeyisOnChainConfirmation = false
|
||||
this.interval
|
||||
@ -112,24 +114,46 @@ class AppInfo extends connect(store)(LitElement) {
|
||||
`
|
||||
}
|
||||
|
||||
firstUpdated() {
|
||||
this.publicizeAddress = store.getState().app.selectedAddress.address + '_publicize'
|
||||
this.setStorage()
|
||||
this.getNodeInfo()
|
||||
this.getCoreInfo()
|
||||
try {
|
||||
this.confirmPublicKeyOnChain(store.getState().app.selectedAddress.address)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
|
||||
setInterval(() => {
|
||||
this.getNodeInfo()
|
||||
this.getCoreInfo()
|
||||
}, 30000)
|
||||
}
|
||||
|
||||
setStorage() {
|
||||
if (localStorage.getItem(this.publicizeAddress) === null) {
|
||||
localStorage.setItem(this.publicizeAddress, 'false')
|
||||
}
|
||||
}
|
||||
|
||||
async confirmPublicKeyOnChain(address) {
|
||||
const _computePow2 = async (chatBytes) => {
|
||||
const difficulty = 14;
|
||||
const difficulty = 14
|
||||
const path = window.parent.location.origin + '/memory-pow/memory-pow.wasm.full'
|
||||
const worker = new WebWorker();
|
||||
let nonce = null
|
||||
let chatBytesArray = null
|
||||
await new Promise((res, rej) => {
|
||||
worker.postMessage({chatBytes, path, difficulty});
|
||||
await new Promise((res, rej) => {
|
||||
worker.postMessage({chatBytes, path, difficulty})
|
||||
|
||||
worker.onmessage = e => {
|
||||
worker.terminate()
|
||||
chatBytesArray = e.data.chatBytesArray
|
||||
worker.terminate()
|
||||
chatBytesArray = e.data.chatBytesArray
|
||||
nonce = e.data.nonce
|
||||
res()
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
let _response = await routes.sign_chat({
|
||||
data: {
|
||||
@ -137,93 +161,74 @@ class AppInfo extends connect(store)(LitElement) {
|
||||
chatBytesArray: chatBytesArray,
|
||||
chatNonce: nonce
|
||||
},
|
||||
})
|
||||
return _response
|
||||
}
|
||||
|
||||
});
|
||||
return _response
|
||||
};
|
||||
|
||||
|
||||
let stop = false
|
||||
const checkPublicKey = async () => {
|
||||
if (!stop) {
|
||||
stop = true;
|
||||
try {
|
||||
if(this.publicKeyisOnChainConfirmation){
|
||||
clearInterval(this.interval)
|
||||
return
|
||||
}
|
||||
const myNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node];
|
||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
|
||||
const url = `${nodeUrl}/addresses/publickey/${address}`;
|
||||
const res = await fetch(url)
|
||||
let data = ''
|
||||
let stop = false
|
||||
const checkPublicKey = async () => {
|
||||
if (!stop) {
|
||||
stop = true
|
||||
try {
|
||||
data = await res.text();
|
||||
} catch (error) {
|
||||
data = {
|
||||
error: 'error'
|
||||
if(localStorage.getItem(this.publicizeAddress) === 'true') {
|
||||
clearInterval(this.interval)
|
||||
return
|
||||
}
|
||||
}
|
||||
if(data === 'false' && this.nodeInfo.isSynchronizing !== true){
|
||||
let _reference = new Uint8Array(64);
|
||||
window.crypto.getRandomValues(_reference);
|
||||
let reference = window.parent.Base58.encode(_reference);
|
||||
const chatRes = await routes.chat({
|
||||
data: {
|
||||
type: 19,
|
||||
nonce: store.getState().app.selectedAddress.nonce,
|
||||
params: {
|
||||
lastReference: reference,
|
||||
proofOfWorkNonce: 0,
|
||||
fee: 0,
|
||||
timestamp: Date.now(),
|
||||
|
||||
const myNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
|
||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
const url = `${nodeUrl}/addresses/publickey/${address}`
|
||||
const res = await fetch(url)
|
||||
let data = ''
|
||||
try {
|
||||
data = await res.text()
|
||||
} catch (error) {
|
||||
data = {
|
||||
error: 'error'
|
||||
}
|
||||
}
|
||||
if(data === 'false' && this.nodeInfo.isSynchronizing !== true) {
|
||||
let _reference = new Uint8Array(64)
|
||||
window.crypto.getRandomValues(_reference)
|
||||
let reference = window.parent.Base58.encode(_reference)
|
||||
const chatRes = await routes.chat({
|
||||
data: {
|
||||
type: 19,
|
||||
nonce: store.getState().app.selectedAddress.nonce,
|
||||
params: {
|
||||
lastReference: reference,
|
||||
proofOfWorkNonce: 0,
|
||||
fee: 0,
|
||||
timestamp: Date.now(),
|
||||
},
|
||||
disableModal: true
|
||||
},
|
||||
disableModal: true
|
||||
},
|
||||
disableModal: true,
|
||||
});
|
||||
disableModal: true,
|
||||
});
|
||||
|
||||
try {
|
||||
const powRes = await _computePow2(chatRes)
|
||||
if(powRes === true){
|
||||
const powRes = await _computePow2(chatRes)
|
||||
if(powRes === true) {
|
||||
clearInterval(this.interval)
|
||||
|
||||
this.publicKeyisOnChainConfirmation = true
|
||||
localStorage.removeItem(this.publicizeAddress)
|
||||
localStorage.setItem(this.publicizeAddress, 'true')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
|
||||
if (!data.error && data !== 'false' && data) {
|
||||
clearInterval(this.interval)
|
||||
if (!data.error && data !== 'false' && data) {
|
||||
clearInterval(this.interval)
|
||||
localStorage.removeItem(this.publicizeAddress)
|
||||
localStorage.setItem(this.publicizeAddress, 'true')
|
||||
}
|
||||
|
||||
this.publicKeyisOnChainConfirmation = true
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
}
|
||||
stop = false
|
||||
}
|
||||
};
|
||||
this.interval = setInterval(checkPublicKey, 5000);
|
||||
}
|
||||
|
||||
firstUpdated() {
|
||||
this.getNodeInfo()
|
||||
this.getCoreInfo()
|
||||
try {
|
||||
this.confirmPublicKeyOnChain(store.getState().app.selectedAddress.address)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
|
||||
|
||||
setInterval(() => {
|
||||
this.getNodeInfo()
|
||||
this.getCoreInfo()
|
||||
}, 30000)
|
||||
} catch (error) {
|
||||
}
|
||||
stop = false
|
||||
}
|
||||
}
|
||||
this.interval = setInterval(checkPublicKey, 5000);
|
||||
}
|
||||
|
||||
async getNodeInfo() {
|
||||
|
@ -95,12 +95,12 @@ class AccountView extends connect(store)(LitElement) {
|
||||
getAvatar() {
|
||||
let numberBlocks = (this.accountInfo.addressInfo.blocksMinted + this.accountInfo.addressInfo.blocksMintedAdjustment);
|
||||
if (Number.isNaN(numberBlocks) || numberBlocks == "" || numberBlocks === null) {
|
||||
return html`<img src="/img/noavatar.png" style="width:150px; height:150px;">`
|
||||
return html`<img src="/img/noavatar.png" style="width:150px; height:150px; border-radius: 50%;">`
|
||||
} else {
|
||||
const avatarNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
|
||||
const avatarUrl = avatarNode.protocol + '://' + avatarNode.domain + ':' + avatarNode.port
|
||||
const url = `${avatarUrl}/arbitrary/THUMBNAIL/${this.accountInfo.names[0].name}/qortal_avatar?async=true&apiKey=${this.getApiKey()}`
|
||||
return html`<img src="${url}" style="width:150px; height:150px;" onerror="this.src='/img/noavatar.png';">`
|
||||
return html`<img src="${url}" style="width:150px; height:150px; border-radius: 50%;" onerror="this.src='/img/noavatar.png';">`
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,28 +20,28 @@
|
||||
"@lit-labs/motion": "1.0.3",
|
||||
"@material/mwc-list": "0.27.0",
|
||||
"@material/mwc-select": "0.27.0",
|
||||
"@tiptap/pm": "2.0.0-beta.212",
|
||||
"@tiptap/core": "2.0.0-beta.212",
|
||||
"@tiptap/extension-highlight": "2.0.0-beta.212",
|
||||
"@tiptap/extension-image": "2.0.0-beta.212",
|
||||
"@tiptap/extension-placeholder": "2.0.0-beta.212",
|
||||
"@tiptap/extension-underline": "2.0.0-beta.212",
|
||||
"@tiptap/html": "2.0.0-beta.212",
|
||||
"@tiptap/starter-kit": "2.0.0-beta.212",
|
||||
"@tiptap/pm": "2.0.0-beta.217",
|
||||
"@tiptap/core": "2.0.0-beta.217",
|
||||
"@tiptap/extension-highlight": "2.0.0-beta.217",
|
||||
"@tiptap/extension-image": "2.0.0-beta.217",
|
||||
"@tiptap/extension-placeholder": "2.0.0-beta.217",
|
||||
"@tiptap/extension-underline": "2.0.0-beta.217",
|
||||
"@tiptap/html": "2.0.0-beta.217",
|
||||
"@tiptap/starter-kit": "2.0.0-beta.217",
|
||||
"asmcrypto.js": "2.3.2",
|
||||
"compressorjs": "1.1.1",
|
||||
"emoji-picker-js": "https://github.com/Qortal/emoji-picker-js",
|
||||
"localforage": "1.10.0",
|
||||
"prosemirror-commands": "1.5.0",
|
||||
"prosemirror-dropcursor": "1.6.1",
|
||||
"prosemirror-dropcursor": "1.7.0",
|
||||
"prosemirror-gapcursor": "1.3.1",
|
||||
"prosemirror-history": "1.3.0",
|
||||
"prosemirror-keymap": "1.2.0",
|
||||
"prosemirror-model": "1.18.3",
|
||||
"prosemirror-model": "1.19.0",
|
||||
"prosemirror-schema-list": "1.2.2",
|
||||
"prosemirror-state": "1.4.2",
|
||||
"prosemirror-transform": "1.7.0",
|
||||
"prosemirror-view": "1.29.1",
|
||||
"prosemirror-transform": "1.7.1",
|
||||
"prosemirror-view": "1.30.1",
|
||||
"short-unique-id": "4.4.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -82,12 +82,13 @@
|
||||
"html-escaper": "3.0.3",
|
||||
"lit": "2.6.1",
|
||||
"lit-translate": "2.0.1",
|
||||
"rollup": "3.14.0",
|
||||
"passive-events-support": "1.0.33",
|
||||
"rollup": "3.15.0",
|
||||
"rollup-plugin-node-globals": "1.4.0",
|
||||
"rollup-plugin-progress": "1.1.2",
|
||||
"rollup-plugin-web-worker-loader": "1.6.1",
|
||||
"passive-events-support": "1.0.33",
|
||||
"axios": "1.3.2"
|
||||
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.17.1"
|
||||
|
@ -2918,7 +2918,7 @@ class ChatPage extends LitElement {
|
||||
await new Promise(resolve => {
|
||||
new Compressor( image, {
|
||||
quality: .6,
|
||||
maxWidth: 500,
|
||||
maxWidth: 1200,
|
||||
success(result){
|
||||
const file = new File([result], "name", {
|
||||
type: image.type
|
||||
|
@ -62,6 +62,7 @@ class MultiWallet extends LitElement {
|
||||
arrrMemo: { type: String },
|
||||
errorMessage: { type: String },
|
||||
arrrWalletAddress: { type: String },
|
||||
unusedWalletAddress: { type: String },
|
||||
successMessage: { type: String },
|
||||
sendMoneyLoading: { type: Boolean },
|
||||
btnDisable: { type: Boolean },
|
||||
@ -505,6 +506,13 @@ class MultiWallet extends LitElement {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.unused-address-dialog {
|
||||
min-height: 150px;
|
||||
min-width: 550px;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.btn-clear-success {
|
||||
--mdc-icon-button-size: 32px;
|
||||
color: red;
|
||||
@ -561,6 +569,12 @@ class MultiWallet extends LitElement {
|
||||
width: 185px;
|
||||
}
|
||||
|
||||
.unused-pos {
|
||||
margin-top: -44px;
|
||||
margin-left: 410px;
|
||||
width: 185px;
|
||||
}
|
||||
|
||||
@media (max-width: 863px) {
|
||||
.wallet {
|
||||
width: 100%;
|
||||
@ -673,6 +687,7 @@ class MultiWallet extends LitElement {
|
||||
this.arrrRecipient = ''
|
||||
this.arrrMemo = ''
|
||||
this.arrrWalletAddress = ''
|
||||
this.unusedWalletAddress = ''
|
||||
this.errorMessage = ''
|
||||
this.successMessage = ''
|
||||
this.myElementId = ''
|
||||
@ -822,6 +837,9 @@ class MultiWallet extends LitElement {
|
||||
<div class="book-pos" ?hidden="${this.getSelectedWalletAddress().length < 1}">
|
||||
${this.renderAddressbookButton()}
|
||||
</div>
|
||||
<div class="unused-pos" ?hidden="${this.getSelectedWalletAddress().length < 1}">
|
||||
${this.renderUnusedAddressButton()}
|
||||
</div>
|
||||
<div class="qrcode-pos" ?hidden="${this.getSelectedWalletAddress().length < 1}">
|
||||
<qortal-qrcode-generator data="${this.getSelectedWalletAddress()}" mode="octet" format="html" auto></qortal-qrcode-generator>
|
||||
</div>
|
||||
@ -1968,6 +1986,171 @@ class MultiWallet extends LitElement {
|
||||
</mwc-button>
|
||||
</mwc-dialog>
|
||||
|
||||
<mwc-dialog id="btcUnusedAddressDialog" scrimClickAction="" escapeKeyAction="">
|
||||
<div class="unused-address-dialog">
|
||||
<div style="text-align: center;">
|
||||
<img src="/img/btc.png" width="32" height="32">
|
||||
<h2>BTC</h2>
|
||||
<hr />
|
||||
</div>
|
||||
<p>
|
||||
<span style="font-weight: bold;">${this.wallets.get(this._selectedWallet).unusedWalletAddress}</span>
|
||||
<button-icon-copy
|
||||
title="${translate("walletpage.wchange3")}"
|
||||
onSuccessMessage="${translate("walletpage.wchange4")}"
|
||||
onErrorMessage="${translate("walletpage.wchange39")}"
|
||||
textToCopy=${this.wallets.get(this._selectedWallet).unusedWalletAddress}
|
||||
buttonSize="24px"
|
||||
iconSize="16px"
|
||||
color="var(--copybutton)"
|
||||
offsetLeft="4px"
|
||||
>
|
||||
</button-icon-copy>
|
||||
<br />
|
||||
<span>${translate("walletpage.wchange38")}</span>
|
||||
</p>
|
||||
</div>
|
||||
<mwc-button
|
||||
slot="primaryAction"
|
||||
dialogAction="cancel"
|
||||
class="red"
|
||||
>
|
||||
${translate("general.close")}
|
||||
</mwc-button>
|
||||
</mwc-dialog>
|
||||
|
||||
<mwc-dialog id="ltcUnusedAddressDialog" scrimClickAction="" escapeKeyAction="">
|
||||
<div class="unused-address-dialog">
|
||||
<div style="text-align: center;">
|
||||
<img src="/img/ltc.png" width="32" height="32">
|
||||
<h2>LTC</h2>
|
||||
<hr />
|
||||
</div>
|
||||
<p>
|
||||
<span style="font-weight: bold;">${this.wallets.get(this._selectedWallet).unusedWalletAddress}</span>
|
||||
<button-icon-copy
|
||||
title="${translate("walletpage.wchange3")}"
|
||||
onSuccessMessage="${translate("walletpage.wchange4")}"
|
||||
onErrorMessage="${translate("walletpage.wchange39")}"
|
||||
textToCopy=${this.wallets.get(this._selectedWallet).unusedWalletAddress}
|
||||
buttonSize="24px"
|
||||
iconSize="16px"
|
||||
color="var(--copybutton)"
|
||||
offsetLeft="4px"
|
||||
>
|
||||
</button-icon-copy>
|
||||
<br />
|
||||
<span>${translate("walletpage.wchange38")}</span>
|
||||
</p>
|
||||
</div>
|
||||
<mwc-button
|
||||
slot="primaryAction"
|
||||
dialogAction="cancel"
|
||||
class="red"
|
||||
>
|
||||
${translate("general.close")}
|
||||
</mwc-button>
|
||||
</mwc-dialog>
|
||||
|
||||
<mwc-dialog id="dogeUnusedAddressDialog" scrimClickAction="" escapeKeyAction="">
|
||||
<div class="unused-address-dialog">
|
||||
<div style="text-align: center;">
|
||||
<img src="/img/doge.png" width="32" height="32">
|
||||
<h2>DOGE</h2>
|
||||
<hr />
|
||||
</div>
|
||||
<p>
|
||||
<span style="font-weight: bold;">${this.wallets.get(this._selectedWallet).unusedWalletAddress}</span>
|
||||
<button-icon-copy
|
||||
title="${translate("walletpage.wchange3")}"
|
||||
onSuccessMessage="${translate("walletpage.wchange4")}"
|
||||
onErrorMessage="${translate("walletpage.wchange39")}"
|
||||
textToCopy=${this.wallets.get(this._selectedWallet).unusedWalletAddress}
|
||||
buttonSize="24px"
|
||||
iconSize="16px"
|
||||
color="var(--copybutton)"
|
||||
offsetLeft="4px"
|
||||
>
|
||||
</button-icon-copy>
|
||||
<br />
|
||||
<span>${translate("walletpage.wchange38")}</span>
|
||||
</p>
|
||||
</div>
|
||||
<mwc-button
|
||||
slot="primaryAction"
|
||||
dialogAction="cancel"
|
||||
class="red"
|
||||
>
|
||||
${translate("general.close")}
|
||||
</mwc-button>
|
||||
</mwc-dialog>
|
||||
|
||||
<mwc-dialog id="dgbUnusedAddressDialog" scrimClickAction="" escapeKeyAction="">
|
||||
<div class="unused-address-dialog">
|
||||
<div style="text-align: center;">
|
||||
<img src="/img/dgb.png" width="32" height="32">
|
||||
<h2>DGB</h2>
|
||||
<hr />
|
||||
</div>
|
||||
<p>
|
||||
<span style="font-weight: bold;">${this.wallets.get(this._selectedWallet).unusedWalletAddress}</span>
|
||||
<button-icon-copy
|
||||
title="${translate("walletpage.wchange3")}"
|
||||
onSuccessMessage="${translate("walletpage.wchange4")}"
|
||||
onErrorMessage="${translate("walletpage.wchange39")}"
|
||||
textToCopy=${this.wallets.get(this._selectedWallet).unusedWalletAddress}
|
||||
buttonSize="24px"
|
||||
iconSize="16px"
|
||||
color="var(--copybutton)"
|
||||
offsetLeft="4px"
|
||||
>
|
||||
</button-icon-copy>
|
||||
<br />
|
||||
<span>${translate("walletpage.wchange38")}</span>
|
||||
</p>
|
||||
</div>
|
||||
<mwc-button
|
||||
slot="primaryAction"
|
||||
dialogAction="cancel"
|
||||
class="red"
|
||||
>
|
||||
${translate("general.close")}
|
||||
</mwc-button>
|
||||
</mwc-dialog>
|
||||
|
||||
<mwc-dialog id="rvnUnusedAddressDialog" scrimClickAction="" escapeKeyAction="">
|
||||
<div class="unused-address-dialog">
|
||||
<div style="text-align: center;">
|
||||
<img src="/img/rvn.png" width="32" height="32">
|
||||
<h2>RVN</h2>
|
||||
<hr />
|
||||
</div>
|
||||
<p>
|
||||
<span style="font-weight: bold;">${this.wallets.get(this._selectedWallet).unusedWalletAddress}</span>
|
||||
<button-icon-copy
|
||||
title="${translate("walletpage.wchange3")}"
|
||||
onSuccessMessage="${translate("walletpage.wchange4")}"
|
||||
onErrorMessage="${translate("walletpage.wchange39")}"
|
||||
textToCopy=${this.wallets.get(this._selectedWallet).unusedWalletAddress}
|
||||
buttonSize="24px"
|
||||
iconSize="16px"
|
||||
color="var(--copybutton)"
|
||||
offsetLeft="4px"
|
||||
>
|
||||
</button-icon-copy>
|
||||
<br />
|
||||
<span>${translate("walletpage.wchange38")}</span>
|
||||
</p>
|
||||
</div>
|
||||
<mwc-button
|
||||
slot="primaryAction"
|
||||
dialogAction="cancel"
|
||||
class="red"
|
||||
>
|
||||
${translate("general.close")}
|
||||
</mwc-button>
|
||||
</mwc-dialog>
|
||||
|
||||
<mwc-dialog id="addQortAddressDialog" scrimClickAction="" escapeKeyAction="">
|
||||
<div style="text-align:center">
|
||||
<img src="/img/qort.png" width="32" height="32">
|
||||
@ -4503,10 +4686,10 @@ class MultiWallet extends LitElement {
|
||||
}
|
||||
})
|
||||
const txsQort = await parentEpml.request('apiCall', {
|
||||
url: `/transactions/search?address=${this.wallets.get('qort').wallet.address}&confirmationStatus=CONFIRMED&reverse=true&txType=PAYMENT&txType=REGISTER_NAME&txType=UPDATE_NAME&txType=SELL_NAME&txType=CANCEL_SELL_NAME&txType=BUY_NAME&txType=CREATE_POLL&txType=VOTE_ON_POLL&txType=ISSUE_ASSET&txType=TRANSFER_ASSET&txType=CREATE_ASSET_ORDER&txType=CANCEL_ASSET_ORDER&txType=MULTI_PAYMENT&txType=DEPLOY_AT&txType=MESSAGE&txType=PUBLICIZE&txType=AIRDROP&txType=AT&txType=CREATE_GROUP&txType=UPDATE_GROUP&txType=ADD_GROUP_ADMIN&txType=REMOVE_GROUP_ADMIN&txType=GROUP_BAN&txType=CANCEL_GROUP_BAN&txType=GROUP_KICK&txType=GROUP_INVITE&txType=CANCEL_GROUP_INVITE&txType=JOIN_GROUP&txType=LEAVE_GROUP&txType=GROUP_APPROVAL&txType=SET_GROUP&txType=UPDATE_ASSET&txType=ACCOUNT_FLAGS&txType=ENABLE_FORGING&txType=REWARD_SHARE&txType=ACCOUNT_LEVEL&txType=TRANSFER_PRIVS&txType=PRESENCE`,
|
||||
url: `/transactions/search?address=${this.wallets.get('qort').wallet.address}&confirmationStatus=CONFIRMED&reverse=true&txType=PAYMENT&txType=REGISTER_NAME&txType=UPDATE_NAME&txType=SELL_NAME&txType=CANCEL_SELL_NAME&txType=BUY_NAME&txType=CREATE_POLL&txType=VOTE_ON_POLL&txType=ISSUE_ASSET&txType=TRANSFER_ASSET&txType=CREATE_ASSET_ORDER&txType=CANCEL_ASSET_ORDER&txType=MULTI_PAYMENT&txType=DEPLOY_AT&txType=MESSAGE&txType=AIRDROP&txType=AT&txType=CREATE_GROUP&txType=UPDATE_GROUP&txType=ADD_GROUP_ADMIN&txType=REMOVE_GROUP_ADMIN&txType=GROUP_BAN&txType=CANCEL_GROUP_BAN&txType=GROUP_KICK&txType=GROUP_INVITE&txType=CANCEL_GROUP_INVITE&txType=JOIN_GROUP&txType=LEAVE_GROUP&txType=GROUP_APPROVAL&txType=SET_GROUP&txType=UPDATE_ASSET&txType=ACCOUNT_FLAGS&txType=ENABLE_FORGING&txType=REWARD_SHARE&txType=ACCOUNT_LEVEL&txType=TRANSFER_PRIVS&txType=PRESENCE`,
|
||||
})
|
||||
const pendingTxsQort = await parentEpml.request('apiCall', {
|
||||
url: `/transactions/unconfirmed?creator=${this.wallets.get('qort').wallet.base58PublicKey}&reverse=true&txType=PAYMENT&txType=REGISTER_NAME&txType=UPDATE_NAME&txType=SELL_NAME&txType=CANCEL_SELL_NAME&txType=BUY_NAME&txType=CREATE_POLL&txType=VOTE_ON_POLL&txType=ISSUE_ASSET&txType=TRANSFER_ASSET&txType=CREATE_ASSET_ORDER&txType=CANCEL_ASSET_ORDER&txType=MULTI_PAYMENT&txType=DEPLOY_AT&txType=MESSAGE&txType=PUBLICIZE&txType=AIRDROP&txType=AT&txType=CREATE_GROUP&txType=UPDATE_GROUP&txType=ADD_GROUP_ADMIN&txType=REMOVE_GROUP_ADMIN&txType=GROUP_BAN&txType=CANCEL_GROUP_BAN&txType=GROUP_KICK&txType=GROUP_INVITE&txType=CANCEL_GROUP_INVITE&txType=JOIN_GROUP&txType=LEAVE_GROUP&txType=GROUP_APPROVAL&txType=SET_GROUP&txType=UPDATE_ASSET&txType=ACCOUNT_FLAGS&txType=ENABLE_FORGING&txType=REWARD_SHARE&txType=ACCOUNT_LEVEL&txType=TRANSFER_PRIVS&txType=PRESENCE`,
|
||||
url: `/transactions/unconfirmed?creator=${this.wallets.get('qort').wallet.base58PublicKey}&reverse=true&txType=PAYMENT&txType=REGISTER_NAME&txType=UPDATE_NAME&txType=SELL_NAME&txType=CANCEL_SELL_NAME&txType=BUY_NAME&txType=CREATE_POLL&txType=VOTE_ON_POLL&txType=ISSUE_ASSET&txType=TRANSFER_ASSET&txType=CREATE_ASSET_ORDER&txType=CANCEL_ASSET_ORDER&txType=MULTI_PAYMENT&txType=DEPLOY_AT&txType=MESSAGE&txType=AIRDROP&txType=AT&txType=CREATE_GROUP&txType=UPDATE_GROUP&txType=ADD_GROUP_ADMIN&txType=REMOVE_GROUP_ADMIN&txType=GROUP_BAN&txType=CANCEL_GROUP_BAN&txType=GROUP_KICK&txType=GROUP_INVITE&txType=CANCEL_GROUP_INVITE&txType=JOIN_GROUP&txType=LEAVE_GROUP&txType=GROUP_APPROVAL&txType=SET_GROUP&txType=UPDATE_ASSET&txType=ACCOUNT_FLAGS&txType=ENABLE_FORGING&txType=REWARD_SHARE&txType=ACCOUNT_LEVEL&txType=TRANSFER_PRIVS&txType=PRESENCE`,
|
||||
})
|
||||
if (this._selectedWallet == coin) {
|
||||
this.wallets.get(coin).transactions = pendingTxsQort.concat(txsQort)
|
||||
@ -4638,6 +4821,70 @@ class MultiWallet extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
async getUnusedAddress(coin) {
|
||||
this.wallets.get(this._selectedWallet).unusedWalletAddress = ''
|
||||
let _url = ``
|
||||
let _body = null
|
||||
|
||||
switch (coin) {
|
||||
case 'qort':
|
||||
case 'arrr':
|
||||
_url = ``
|
||||
_body = null
|
||||
break
|
||||
case 'btc':
|
||||
case 'ltc':
|
||||
case 'doge':
|
||||
case 'dgb':
|
||||
case 'rvn':
|
||||
const walletName = `${coin}Wallet`
|
||||
_url = `/crosschain/${coin}/unusedaddress?apiKey=${this.getApiKey()}`
|
||||
_body = `${window.parent.reduxStore.getState().app.selectedAddress[walletName].derivedMasterPublicKey}`
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
||||
if (_body === null) {
|
||||
this.unusedAddressString = ""
|
||||
} else {
|
||||
await parentEpml.request('apiCall', {
|
||||
url: _url,
|
||||
method: 'POST',
|
||||
body: _body,
|
||||
}).then((res) => {
|
||||
this.wallets.get(this._selectedWallet).unusedWalletAddress = res
|
||||
this.unusedAddressString = this.wallets.get(this._selectedWallet).unusedWalletAddress
|
||||
this.openUnusedAddressDialog(coin)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
openUnusedAddressDialog(coin) {
|
||||
switch (coin) {
|
||||
case 'qort':
|
||||
case 'arrr':
|
||||
break
|
||||
case 'btc':
|
||||
this.shadowRoot.querySelector("#btcUnusedAddressDialog").show();
|
||||
break
|
||||
case 'ltc':
|
||||
this.shadowRoot.querySelector("#ltcUnusedAddressDialog").show();
|
||||
break
|
||||
case 'doge':
|
||||
this.shadowRoot.querySelector("#dogeUnusedAddressDialog").show();
|
||||
break
|
||||
case 'dgb':
|
||||
this.shadowRoot.querySelector("#dgbUnusedAddressDialog").show();
|
||||
break
|
||||
case 'rvn':
|
||||
this.shadowRoot.querySelector("#rvnUnusedAddressDialog").show();
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
renderSendButton() {
|
||||
if ( this._selectedWallet === "qort" ) {
|
||||
return html`<vaadin-button theme="primary medium" style="width: 100%;" @click=${() => this.openSendQort()}><vaadin-icon icon="vaadin:coin-piles" slot="prefix"></vaadin-icon> ${translate("walletpage.wchange17")} QORT</vaadin-button>`
|
||||
@ -4678,6 +4925,22 @@ class MultiWallet extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
renderUnusedAddressButton() {
|
||||
switch (this._selectedWallet) {
|
||||
case "qort":
|
||||
case "arrr":
|
||||
return html`<vaadin-button disabled theme="primary medium" style="width: 100%;" @click=${() => this.getUnusedAddress(this._selectedWallet)}><vaadin-icon icon="vaadin:magic" slot="prefix"></vaadin-icon> ${translate("walletpage.wchange58")}</vaadin-button>`
|
||||
case "btc":
|
||||
case "ltc":
|
||||
case "doge":
|
||||
case "dgb":
|
||||
case "rvn":
|
||||
return html`<vaadin-button theme="primary medium" style="width: 100%;" @click=${() => this.getUnusedAddress(this._selectedWallet)}><vaadin-icon icon="vaadin:magic" slot="prefix"></vaadin-icon> ${translate("walletpage.wchange58")}</vaadin-button>`
|
||||
default:
|
||||
return html``
|
||||
}
|
||||
}
|
||||
|
||||
renderExportAddressbookButton() {
|
||||
if ( this._selectedWallet === "qort" ) {
|
||||
return html`<vaadin-button theme="primary small" style="width: 100%;" @click=${() => this.exportQortAddressbook()}><vaadin-icon icon="vaadin:cloud-download" slot="prefix"></vaadin-icon> ${translate("walletpage.wchange54")}</vaadin-button>`
|
||||
|
Loading…
x
Reference in New Issue
Block a user