From f86866996c0b03887f1e7c8e83d17beed4f69fad Mon Sep 17 00:00:00 2001 From: adamant-al Date: Mon, 12 Jul 2021 13:44:48 +0300 Subject: [PATCH 01/31] Update bitcoinjs-lib --- package.json | 2 +- src/lib/bitcoin/bitcoin-utils.js | 2 +- src/lib/bitcoin/btc-base-api.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 062cf1ee1..5fcfe3704 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "b64-to-blob": "^1.2.19", "bignumber.js": "^9.0.1", "bip39": "^3.0.3", - "bitcoinjs-lib": "^4.0.2", + "bitcoinjs-lib": "^5.2.0", "bytebuffer": "^5.0.1", "coininfo": "^5.1.0", "core-js": "^3.8.3", diff --git a/src/lib/bitcoin/bitcoin-utils.js b/src/lib/bitcoin/bitcoin-utils.js index 70f73eeb8..2bd329703 100644 --- a/src/lib/bitcoin/bitcoin-utils.js +++ b/src/lib/bitcoin/bitcoin-utils.js @@ -1,4 +1,4 @@ -import bitcoin from 'bitcoinjs-lib' +import * as bitcoin from 'bitcoinjs-lib' /** * Checks if the supplied string is a valid BTC address diff --git a/src/lib/bitcoin/btc-base-api.js b/src/lib/bitcoin/btc-base-api.js index c18404ebc..75f95ce80 100644 --- a/src/lib/bitcoin/btc-base-api.js +++ b/src/lib/bitcoin/btc-base-api.js @@ -1,4 +1,4 @@ -import bitcoin from 'bitcoinjs-lib' +import * as bitcoin from 'bitcoinjs-lib' import axios from 'axios' import networks from './networks' From a3cdf5648fda4e93ee3043d291fcff800a5cabd8 Mon Sep 17 00:00:00 2001 From: adamant-al Date: Tue, 13 Jul 2021 18:24:54 +0300 Subject: [PATCH 02/31] Update deps minor versions --- package.json | 24 ++++++++++++------------ vue.config.js | 1 + 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 5fcfe3704..bc8756c82 100644 --- a/package.json +++ b/package.json @@ -21,39 +21,39 @@ "@liskhq/lisk-cryptography": "2.3.0", "@liskhq/lisk-transactions": "2.3.1", "@mdi/font": "^5.9.55", - "@stablelib/utf8": "^1.0.0", - "@zxing/library": "0.18.3", - "abi-decoder": "^2.3.0", + "@stablelib/utf8": "^1.0.1", + "@zxing/library": "0.18.6", + "abi-decoder": "^2.4.0", "axios": "^0.21.1", "b64-to-blob": "^1.2.19", "bignumber.js": "^9.0.1", - "bip39": "^3.0.3", + "bip39": "^3.0.4", "bitcoinjs-lib": "^5.2.0", "bytebuffer": "^5.0.1", "coininfo": "^5.1.0", - "core-js": "^3.8.3", - "dayjs": "^1.10.3", + "core-js": "^3.15.2", + "dayjs": "^1.10.6", "deepmerge": "^4.2.2", "detect-browser": "^5.2.0", - "dompurify": "^2.2.6", + "dompurify": "^2.3.0", "ed2curve": "^0.3.0", "ethereumjs-tx": "^2.1.2", "ethereumjs-util": "^7.0.7", "file-saver": "^2.0.5", "hdkey": "^2.0.1", "idb": "^3.0.2", - "js-base64": "^3.6.0", + "js-base64": "^3.6.1", "js-md5": "^0.7.3", - "lodash": "^4.17.20", + "lodash": "^4.17.21", "marked": "^1.2.7", "notifyjs": "^3.0.0", - "pbkdf2": "^3.1.1", + "pbkdf2": "^3.1.2", "promise-queue": "^2.2.5", "qrcode": "^1.4.4", - "qs": "^6.9.6", + "qs": "^6.10.1", "register-service-worker": "^1.7.2", "rxjs": "^6.6.3", - "semver": "^7.3.4", + "semver": "^7.3.5", "simple-audio": "^1.0.1", "socket.io-client": "^2.4.0", "sodium-browserify-tweetnacl": "^0.2.6", diff --git a/vue.config.js b/vue.config.js index 648b661ad..1245523b3 100644 --- a/vue.config.js +++ b/vue.config.js @@ -33,6 +33,7 @@ module.exports = { Terminal: false, Type: 'Application' }, + /* eslint-disable no-template-curly-in-string */ artifactName: 'ADAMANT-Messenger-${version}.${ext}', icon: './build/linux/', target: ['AppImage'] From 8a6155026fe08cc7c2e4381cfa1aebacd76304e7 Mon Sep 17 00:00:00 2001 From: adamant-al Date: Tue, 13 Jul 2021 21:07:17 +0300 Subject: [PATCH 03/31] Upgrade marked & idb --- package.json | 5 ++--- src/lib/idb/db.js | 22 ++++++++++++---------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index bc8756c82..cd020ae0a 100644 --- a/package.json +++ b/package.json @@ -41,18 +41,17 @@ "ethereumjs-util": "^7.0.7", "file-saver": "^2.0.5", "hdkey": "^2.0.1", - "idb": "^3.0.2", + "idb": "^6.1.2", "js-base64": "^3.6.1", "js-md5": "^0.7.3", "lodash": "^4.17.21", - "marked": "^1.2.7", + "marked": "^2.1.3", "notifyjs": "^3.0.0", "pbkdf2": "^3.1.2", "promise-queue": "^2.2.5", "qrcode": "^1.4.4", "qs": "^6.10.1", "register-service-worker": "^1.7.2", - "rxjs": "^6.6.3", "semver": "^7.3.5", "simple-audio": "^1.0.1", "socket.io-client": "^2.4.0", diff --git a/src/lib/idb/db.js b/src/lib/idb/db.js index 1dcefd116..360ccdea2 100644 --- a/src/lib/idb/db.js +++ b/src/lib/idb/db.js @@ -1,17 +1,19 @@ -import { openDb } from 'idb' +import { openDB } from 'idb' const DB_NAME = 'adm' const DB_VERSION = 1 -const dbPromise = openDb(DB_NAME, DB_VERSION, upgradeDB => { - if (!upgradeDB.objectStoreNames.contains('security')) { - upgradeDB.createObjectStore('security', { keyPath: 'name', autoIncrement: true }) - } - if (!upgradeDB.objectStoreNames.contains('common')) { - upgradeDB.createObjectStore('common', { keyPath: 'name', autoIncrement: true }) - } - if (!upgradeDB.objectStoreNames.contains('chatList')) { - upgradeDB.createObjectStore('chatList', { keyPath: 'name', autoIncrement: true }) +const dbPromise = openDB(DB_NAME, DB_VERSION, { + upgrade (db, oldVersion, newVersion, transaction) { + if (!db.objectStoreNames.contains('security')) { + db.createObjectStore('security', { keyPath: 'name', autoIncrement: true }) + } + if (!db.objectStoreNames.contains('common')) { + db.createObjectStore('common', { keyPath: 'name', autoIncrement: true }) + } + if (!db.objectStoreNames.contains('chatList')) { + db.createObjectStore('chatList', { keyPath: 'name', autoIncrement: true }) + } } }) From f6f0c46c040ce62a87d3abf1859cfc7dfb461ad2 Mon Sep 17 00:00:00 2001 From: adamant-al Date: Tue, 13 Jul 2021 21:07:43 +0300 Subject: [PATCH 04/31] Pump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cd020ae0a..53985e3cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "adamant-im", - "version": "2.11.0", + "version": "2.12.0", "author": "ADAMANT Foundation ", "license": "GPLv3", "description": "Decentralized Messenger", From f670e75e93b9ff56882dc6df50981d34e7dd3e66 Mon Sep 17 00:00:00 2001 From: adamant-al Date: Mon, 19 Jul 2021 10:05:02 +0300 Subject: [PATCH 05/31] Address field may be different for btc-based Txs --- src/lib/bitcoin/btc-base-api.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/bitcoin/btc-base-api.js b/src/lib/bitcoin/btc-base-api.js index 75f95ce80..59f4ccd75 100644 --- a/src/lib/bitcoin/btc-base-api.js +++ b/src/lib/bitcoin/btc-base-api.js @@ -172,7 +172,8 @@ export default class BtcBaseApi { // Remove курьи txs like "possibleDoubleSpend" and txs without info if (tx.possibleDoubleSpend || (!tx.hash && !tx.time && !tx.valueIn)) return - const senders = getUnique(tx.vin.map(x => x.addr)).filter(sender => sender !== undefined && sender !== 'undefined') + let addressField = tx.vin[0].address ? 'address' : 'addr'; + const senders = getUnique(tx.vin.map(input => input[addressField])).filter(sender => sender !== undefined && sender !== 'undefined') const direction = senders.includes(this._address) ? 'from' : 'to' From 234a577dc61f9f69f5cdc99d319b0ac9f7c99ed3 Mon Sep 17 00:00:00 2001 From: adamant-al Date: Tue, 20 Jul 2021 10:18:57 +0300 Subject: [PATCH 06/31] Minor versions vue update --- package.json | 14 +++++++------- src/lib/bitcoin/btc-base-api.js | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 53985e3cd..ef833a454 100644 --- a/package.json +++ b/package.json @@ -58,13 +58,13 @@ "sodium-browserify-tweetnacl": "^0.2.6", "throttle-promise": "^1.0.4", "visibilityjs": "^2.0.2", - "vue": "^2.5.17", - "vue-i18n": "^8.0.0", - "vue-router": "^3.0.1", - "vue-scrollto": "^2.11.0", - "vuetify": "^1.5.16", - "vuex": "^3.0.1", - "vuex-persist": "^2.0.0", + "vue": "^2.6.14", + "vue-i18n": "^8.24.5", + "vue-router": "^3.5.2", + "vue-scrollto": "^2.20.0", + "vuetify": "^1.5.24", + "vuex": "^3.6.2", + "vuex-persist": "^2.3.0", "web3": "^0.20.6" }, "devDependencies": { diff --git a/src/lib/bitcoin/btc-base-api.js b/src/lib/bitcoin/btc-base-api.js index 59f4ccd75..e406a2325 100644 --- a/src/lib/bitcoin/btc-base-api.js +++ b/src/lib/bitcoin/btc-base-api.js @@ -172,7 +172,7 @@ export default class BtcBaseApi { // Remove курьи txs like "possibleDoubleSpend" and txs without info if (tx.possibleDoubleSpend || (!tx.hash && !tx.time && !tx.valueIn)) return - let addressField = tx.vin[0].address ? 'address' : 'addr'; + let addressField = tx.vin[0].address ? 'address' : 'addr' const senders = getUnique(tx.vin.map(input => input[addressField])).filter(sender => sender !== undefined && sender !== 'undefined') const direction = senders.includes(this._address) ? 'from' : 'to' From ea131b58b6415e0d554ab21485f2bf526acda0b3 Mon Sep 17 00:00:00 2001 From: adamant-al Date: Tue, 20 Jul 2021 21:07:39 +0300 Subject: [PATCH 07/31] Update linter --- package.json | 64 +-- src/App.vue | 31 +- src/background.js | 10 +- src/components/AChat/AChat.vue | 99 ++--- src/components/AChat/AChatForm.vue | 86 ++-- src/components/AChat/AChatMessage.vue | 81 ++-- src/components/AChat/AChatTransaction.vue | 71 +-- src/components/AppNavigation.vue | 65 ++- src/components/AppToolbar.vue | 23 +- src/components/AppToolbarCentered.vue | 75 ++-- src/components/BuyTokensDialog.vue | 56 +-- src/components/Chat/Chat.vue | 170 ++++---- src/components/Chat/ChatAvatar.vue | 47 +- src/components/Chat/ChatDialog.vue | 26 +- src/components/Chat/ChatMenu.vue | 31 +- src/components/Chat/ChatToolbar.vue | 45 +- src/components/ChatPreview.vue | 142 +++--- src/components/ChatSpinner.vue | 12 +- src/components/ChatStartDialog.vue | 121 ++++-- src/components/Container.vue | 14 +- src/components/ExportKeysForm.vue | 43 +- src/components/FreeTokensDialog.vue | 41 +- src/components/InlineSpinner.vue | 21 +- src/components/LanguageSwitcher.vue | 41 +- src/components/LoginForm.vue | 41 +- src/components/LoginPasswordForm.vue | 57 ++- src/components/Pagination.vue | 32 +- src/components/PartnerInfo.vue | 94 ++-- src/components/PassphraseGenerator.vue | 62 +-- src/components/PasswordSetDialog.vue | 38 +- src/components/ProgressIndicator.vue | 14 +- src/components/QrcodeCapture.vue | 20 +- src/components/QrcodeRenderer.vue | 39 +- src/components/QrcodeRendererDialog.vue | 65 +-- src/components/QrcodeScannerDialog.vue | 71 +-- src/components/SendFundsForm.vue | 239 +++++----- src/components/ShareURIDialog.vue | 56 ++- src/components/TransactionListItem.vue | 116 +++-- src/components/TransitionEffect.vue | 7 +- src/components/WalletCard.vue | 65 ++- src/components/WalletCardListActions.vue | 75 ++-- src/components/WarningOnAddressesDialog.vue | 85 ++-- .../WarningOnPartnerAddressDialog.vue | 45 +- src/components/icons/AdmFill.vue | 2 +- src/components/icons/BaseIcon.vue | 35 +- src/components/icons/BnbFill.vue | 4 +- src/components/icons/BnzFill.vue | 2 +- src/components/icons/BtcFill.vue | 5 +- src/components/icons/CdlFill.vue | 6 +- src/components/icons/CryptoIcon.vue | 8 +- src/components/icons/DashFill.vue | 4 +- src/components/icons/DogeFill.vue | 9 +- src/components/icons/EthFill.vue | 20 +- src/components/icons/KcsFill.vue | 6 +- src/components/icons/LskFill.vue | 4 +- src/components/icons/ResFill.vue | 6 +- src/components/icons/UnknownCryptoFill.vue | 6 +- src/components/icons/UsdsFill.vue | 26 +- src/components/icons/common/Atomars.vue | 6 +- src/components/icons/common/Cdl.vue | 6 +- src/components/icons/common/Copy.vue | 12 +- src/components/icons/common/File.vue | 24 +- src/components/icons/common/Logo.vue | 410 +++++++++++++++--- src/components/icons/common/QrCode.vue | 112 ++++- src/components/icons/common/QrCodeScan.vue | 28 +- src/components/icons/common/Save.vue | 9 +- .../transactions/AdmTransaction.vue | 14 +- .../transactions/BtcTransaction.vue | 39 +- .../transactions/Erc20Transaction.vue | 25 +- .../transactions/EthTransaction.vue | 25 +- .../transactions/LskTransaction.vue | 25 +- .../transactions/TransactionTemplate.vue | 119 +++-- src/filters/helpers/index.js | 6 +- src/filters/numberFormat.js | 2 +- src/i18n.js | 2 +- src/layouts/chat.vue | 9 +- src/layouts/default.vue | 9 +- src/layouts/no-container.vue | 14 +- src/layouts/toolbar.vue | 19 +- src/lib/adamant-api.js | 2 +- src/lib/adamant.js | 84 ++-- src/lib/bignumber.js | 33 +- src/lib/bitcoin/btc-base-api.js | 6 +- src/lib/eth-index.js | 2 +- src/lib/eth-utils.js | 2 +- src/lib/formatters.js | 10 +- src/lib/idb/state.js | 8 +- src/lib/identicon.js | 194 +++++---- src/lib/lisk/lisk-api.js | 18 +- src/lib/notifications.js | 18 + src/lib/store-crypto-address.js | 10 +- src/lib/textHelpers.js | 14 +- src/lib/uri.js | 23 +- src/main.js | 2 +- src/middlewares/title.js | 2 +- src/mixins/scrollPosition.js | 2 +- src/plugins/layout.js | 10 +- src/store/modules/adm/adm-mutations.js | 6 +- src/store/modules/btc/btc-actions.js | 6 +- src/store/modules/chat/index.js | 2 +- src/store/modules/delegates/actions.js | 19 +- src/store/modules/delegates/mutations.js | 2 +- .../modules/eth-base/eth-base-actions.js | 26 +- .../modules/eth-base/eth-base-mutations.js | 6 +- .../modules/lsk-base/lsk-base-mutations.js | 6 +- src/store/modules/lsk/lsk-actions.js | 2 +- src/store/modules/partners/partner-actions.js | 2 +- .../modules/partners/partner-mutations.js | 2 +- src/store/modules/partners/partners-state.js | 10 +- src/store/plugins/indexedDb.js | 14 +- src/views/Chat.vue | 48 +- src/views/Chats.vue | 68 +-- src/views/ExportKeys.vue | 11 +- src/views/Home.vue | 46 +- src/views/Login.vue | 133 ++++-- src/views/Nodes.vue | 140 +++--- src/views/Options.vue | 267 +++++++----- src/views/SendFunds.vue | 41 +- src/views/Transactions.vue | 93 ++-- src/views/Votes.vue | 186 +++++--- src/views/transactions/Transaction.vue | 48 +- vue.config.js | 4 +- 122 files changed, 3296 insertions(+), 2026 deletions(-) diff --git a/package.json b/package.json index ef833a454..dba88b48e 100644 --- a/package.json +++ b/package.json @@ -68,31 +68,38 @@ "web3": "^0.20.6" }, "devDependencies": { - "@kazupon/vue-i18n-loader": "^0.3.0", - "@vue/cli-plugin-babel": "^3.0.1", - "@vue/cli-plugin-e2e-cypress": "^3.0.1", - "@vue/cli-plugin-eslint": "^3.0.1", - "@vue/cli-plugin-pwa": "^3.0.1", - "@vue/cli-plugin-unit-jest": "^3.0.1", - "@vue/cli-service": "^3.0.1", - "@vue/eslint-config-standard": "^3.0.3", - "@vue/test-utils": "^1.0.0-beta.25", - "babel-core": "7.0.0-bridge.0", - "babel-jest": "^23.0.1", + "@intlify/vue-i18n-loader": "^1.1.0", + "@babel/core": "7.14.6", + "@babel/eslint-parser": "^7.14.7", + "@vue/cli-plugin-babel": "^4.5.13", + "@vue/cli-plugin-e2e-cypress": "^4.5.13", + "@vue/cli-plugin-eslint": "^4.5.13", + "@vue/cli-plugin-pwa": "^4.5.13", + "@vue/cli-plugin-unit-jest": "^4.5.13", + "@vue/cli-service": "^4.5.13", + "@vue/eslint-config-standard": "^6.0.0", + "@vue/test-utils": "^1.2.1", + "babel-jest": "^27.0.6", "babel-plugin-rewire": "^1.2.0", - "cross-env": "^5.2.0", + "cross-env": "^7.0.3", "electron": "^3.0.0", - "lorem-ipsum": "^1.0.6", - "sinon": "^7.2.2", - "stylus": "^0.54.5", + "eslint": "^7.31.0", + "eslint-config-standard": "^16.0.3", + "eslint-plugin-import": "^2.23.4", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^5.1.0", + "eslint-plugin-vue": "^7.14.0", + "lorem-ipsum": "^2.0.3", + "sinon": "^11.1.1", + "stylus": "^0.54.8", "stylus-loader": "^3.0.2", - "uuid": "^3.3.2", - "vue-cli-plugin-electron-builder": "^1.4.0", - "vue-cli-plugin-i18n": "^0.5.0", - "vue-cli-plugin-vuetify": "^0.4.5", - "vue-cli-plugin-webpack-bundle-analyzer": "^1.2.0", - "vue-template-compiler": "^2.5.17", - "vuetify-loader": "^1.2.2" + "uuid": "^8.3.2", + "vue-cli-plugin-electron-builder": "^2.1.1", + "vue-cli-plugin-i18n": "^2.1.1", + "vue-cli-plugin-vuetify": "^2.4.1", + "vue-cli-plugin-webpack-bundle-analyzer": "^4.0.0", + "vue-template-compiler": "^2.6.14", + "vuetify-loader": "^1.7.2" }, "eslintConfig": { "root": true, @@ -100,12 +107,19 @@ "node": true }, "extends": [ - "plugin:vue/essential", + "plugin:vue/recommended", "@vue/standard" ], - "rules": {}, + "rules": { + "no-useless-catch": "off", + "vue/require-default-prop": "off", + "vue/require-prop-types": "off", + "vue/no-unused-components": "off", + "vue/no-template-shadow": "off", + "vue/no-lone-template": "off" + }, "parserOptions": { - "parser": "babel-eslint" + "parser": "@babel/eslint-parser" } }, "postcss": { diff --git a/src/App.vue b/src/App.vue index daed67fa8..7ec717741 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,5 +1,8 @@