diff --git a/qortal-ui-plugins/plugins/core/wallet/wallet-app.src.js b/qortal-ui-plugins/plugins/core/wallet/wallet-app.src.js index 5f1228c7..6064cc83 100644 --- a/qortal-ui-plugins/plugins/core/wallet/wallet-app.src.js +++ b/qortal-ui-plugins/plugins/core/wallet/wallet-app.src.js @@ -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 }, @@ -357,8 +358,8 @@ class MultiWallet extends LitElement { .wallet-address { display: flex; align-items: center; - font-size: 18px; - color: var(--black); + font-size: 18px; + color: var(--black); margin: 4px 0 20px; } @@ -366,7 +367,7 @@ class MultiWallet extends LitElement { display: inline-block; font-weight: 600; font-size: 32px; - color: var(--black); + color: var(--black); } #transactions { @@ -505,6 +506,13 @@ class MultiWallet extends LitElement { position: relative; } + .unused-address-dialog { + min-height: 300px; + min-width: 300px; + 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: 250px; + } + @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 = '' @@ -799,7 +814,7 @@ class MultiWallet extends LitElement { ${translate("walletpage.wchange2")}
${this.getSelectedWalletAddress()} - ${this.renderAddressbookButton()}
+
+ ${this.renderUnusedAddressButton()} +
@@ -1968,6 +1986,106 @@ class MultiWallet extends LitElement { + +
+
+ +

Unused BTC Address

+
+
+

+ ${this.wallets.get(this._selectedWallet).unusedWalletAddress} +

+
+ + ${translate("general.close")} + +
+ + +
+
+ +

Unused LTC Address

+
+
+

+ ${this.wallets.get(this._selectedWallet).unusedWalletAddress} +

+
+ + ${translate("general.close")} + +
+ + +
+
+ +

Unused DOGE Address

+
+
+

+ ${this.wallets.get(this._selectedWallet).unusedWalletAddress} +

+
+ + ${translate("general.close")} + +
+ + +
+
+ +

Unused DGB Address

+
+
+

+ ${this.wallets.get(this._selectedWallet).unusedWalletAddress} +

+
+ + ${translate("general.close")} + +
+ + +
+
+ +

Unused RVN Address

+
+
+

+ ${this.wallets.get(this._selectedWallet).unusedWalletAddress} +

+
+ + ${translate("general.close")} + +
+
@@ -3846,7 +3964,7 @@ class MultiWallet extends LitElement { renderCAB() { return html` ${this.selectedTransaction.aTAddress} - { try { - + const getNames = await parentEpml.request("apiCall", { type: "api", url: `/names/address/${recipient}`, @@ -4501,10 +4619,10 @@ class MultiWallet extends LitElement { this.balance = this.wallets.get(this._selectedWallet).balance } } - }) + }) 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`, - }) + }) 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`, }) @@ -4638,6 +4756,70 @@ class MultiWallet extends LitElement { } } + async getUnusedAddress(coin) { + this.wallets.get(this._selectedWallet).unusedWalletAddress = 'Loading...' + 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` this.openSendQort()}> ${translate("walletpage.wchange17")} QORT` @@ -4678,6 +4860,22 @@ class MultiWallet extends LitElement { } } + renderUnusedAddressButton() { + switch (this._selectedWallet) { + case "qort": + case "arrr": + return html` this.getUnusedAddress(this._selectedWallet)}>Get Unused Address` + case "btc": + case "ltc": + case "doge": + case "dgb": + case "rvn": + return html` this.getUnusedAddress(this._selectedWallet)}>Get Unused Address` + default: + return html`` + } + } + renderExportAddressbookButton() { if ( this._selectedWallet === "qort" ) { return html` this.exportQortAddressbook()}> ${translate("walletpage.wchange54")}` @@ -5556,4 +5754,4 @@ class MultiWallet extends LitElement { } } -window.customElements.define('multi-wallet', MultiWallet) \ No newline at end of file +window.customElements.define('multi-wallet', MultiWallet)