From dcec5f7108c2151b9409e8740a4e68b2f93017a1 Mon Sep 17 00:00:00 2001 From: PDTnhah Date: Tue, 31 Dec 2024 16:18:07 +0700 Subject: [PATCH 1/5] [Issue-3897] Update chainlist --- package.json | 2 +- packages/extension-base/package.json | 2 +- packages/extension-koni-ui/package.json | 2 +- packages/extension-web-ui/package.json | 2 +- yarn.lock | 14 +++++++------- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 062aeef27c..94358dd6d6 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ "@polkadot/types-support": "^15.0.1", "@polkadot/util": "^13.2.3", "@polkadot/util-crypto": "^13.2.3", - "@subwallet/chain-list": "0.2.96", + "@subwallet/chain-list": "0.2.97-beta.6", "@subwallet/keyring": "^0.1.8-beta.0", "@subwallet/react-ui": "5.1.2-b79", "@subwallet/ui-keyring": "0.1.8-beta.0", diff --git a/packages/extension-base/package.json b/packages/extension-base/package.json index 6e1d0724c0..b8cc84abef 100644 --- a/packages/extension-base/package.json +++ b/packages/extension-base/package.json @@ -55,7 +55,7 @@ "@reduxjs/toolkit": "^1.9.1", "@sora-substrate/type-definitions": "^1.17.7", "@substrate/connect": "^0.8.9", - "@subwallet/chain-list": "0.2.96", + "@subwallet/chain-list": "0.2.97-beta.6", "@subwallet/extension-base": "^1.3.11-0", "@subwallet/extension-chains": "^1.3.11-0", "@subwallet/extension-dapp": "^1.3.11-0", diff --git a/packages/extension-koni-ui/package.json b/packages/extension-koni-ui/package.json index 923a5f5a75..f4ef4739dc 100644 --- a/packages/extension-koni-ui/package.json +++ b/packages/extension-koni-ui/package.json @@ -34,7 +34,7 @@ "@polkadot/util-crypto": "^12.6.2", "@ramonak/react-progress-bar": "^5.0.3", "@reduxjs/toolkit": "^1.9.1", - "@subwallet/chain-list": "0.2.96", + "@subwallet/chain-list": "0.2.97-beta.6", "@subwallet/extension-base": "^1.3.11-0", "@subwallet/extension-chains": "^1.3.11-0", "@subwallet/extension-dapp": "^1.3.11-0", diff --git a/packages/extension-web-ui/package.json b/packages/extension-web-ui/package.json index d090aff69d..5daa76b554 100644 --- a/packages/extension-web-ui/package.json +++ b/packages/extension-web-ui/package.json @@ -35,7 +35,7 @@ "@polkadot/util-crypto": "^12.6.2", "@ramonak/react-progress-bar": "^5.0.3", "@reduxjs/toolkit": "^1.9.1", - "@subwallet/chain-list": "0.2.96", + "@subwallet/chain-list": "0.2.97-beta.6", "@subwallet/extension-base": "^1.3.11-0", "@subwallet/extension-chains": "^1.3.11-0", "@subwallet/extension-dapp": "^1.3.11-0", diff --git a/yarn.lock b/yarn.lock index 959639d302..a850a784a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6439,15 +6439,15 @@ __metadata: languageName: node linkType: hard -"@subwallet/chain-list@npm:0.2.96": - version: 0.2.96 - resolution: "@subwallet/chain-list@npm:0.2.96" +"@subwallet/chain-list@npm:0.2.97-beta.6": + version: 0.2.97-beta.6 + resolution: "@subwallet/chain-list@npm:0.2.97-beta.6" dependencies: "@polkadot/dev": 0.67.167 "@polkadot/util": ^12.5.1 eventemitter3: ^5.0.1 ts-md5: ^1.3.1 - checksum: a7d9436d2e799f3ad0e976fea33ff2319a3a69fc45dda7915ebead94007c4de81069411bf30be27136ea6eb8a11aa77750e230c62747885d19d8f06cf2924f47 + checksum: 33bdf56641e0ab41a8a861ef58698150c9560442f4051f1a8a357e44deb157f34d0912a811c0538aa69063bd67896545ba7a793a64984e50833659a8ca9b5b0f languageName: node linkType: hard @@ -6490,7 +6490,7 @@ __metadata: "@reduxjs/toolkit": ^1.9.1 "@sora-substrate/type-definitions": ^1.17.7 "@substrate/connect": ^0.8.9 - "@subwallet/chain-list": 0.2.96 + "@subwallet/chain-list": 0.2.97-beta.6 "@subwallet/extension-base": ^1.3.11-0 "@subwallet/extension-chains": ^1.3.11-0 "@subwallet/extension-dapp": ^1.3.11-0 @@ -6629,7 +6629,7 @@ __metadata: "@polkadot/util-crypto": ^12.6.2 "@ramonak/react-progress-bar": ^5.0.3 "@reduxjs/toolkit": ^1.9.1 - "@subwallet/chain-list": 0.2.96 + "@subwallet/chain-list": 0.2.97-beta.6 "@subwallet/extension-base": ^1.3.11-0 "@subwallet/extension-chains": ^1.3.11-0 "@subwallet/extension-dapp": ^1.3.11-0 @@ -6769,7 +6769,7 @@ __metadata: "@polkadot/util-crypto": ^12.6.2 "@ramonak/react-progress-bar": ^5.0.3 "@reduxjs/toolkit": ^1.9.1 - "@subwallet/chain-list": 0.2.96 + "@subwallet/chain-list": 0.2.97-beta.6 "@subwallet/extension-base": ^1.3.11-0 "@subwallet/extension-chains": ^1.3.11-0 "@subwallet/extension-dapp": ^1.3.11-0 From 581f6a8792ef72db28367b4d45aab327994bc9d7 Mon Sep 17 00:00:00 2001 From: PDTnhah Date: Thu, 2 Jan 2025 15:38:10 +0700 Subject: [PATCH 2/5] [Issue-3897] Update chainlist --- package.json | 2 +- packages/extension-base/package.json | 2 +- .../src/services/transaction-service/utils.ts | 4 ++++ packages/extension-koni-ui/package.json | 2 +- packages/extension-web-ui/package.json | 2 +- yarn.lock | 14 +++++++------- 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 94358dd6d6..a53116dcbb 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ "@polkadot/types-support": "^15.0.1", "@polkadot/util": "^13.2.3", "@polkadot/util-crypto": "^13.2.3", - "@subwallet/chain-list": "0.2.97-beta.6", + "@subwallet/chain-list": "0.2.97-beta.7", "@subwallet/keyring": "^0.1.8-beta.0", "@subwallet/react-ui": "5.1.2-b79", "@subwallet/ui-keyring": "0.1.8-beta.0", diff --git a/packages/extension-base/package.json b/packages/extension-base/package.json index b8cc84abef..172f57640d 100644 --- a/packages/extension-base/package.json +++ b/packages/extension-base/package.json @@ -55,7 +55,7 @@ "@reduxjs/toolkit": "^1.9.1", "@sora-substrate/type-definitions": "^1.17.7", "@substrate/connect": "^0.8.9", - "@subwallet/chain-list": "0.2.97-beta.6", + "@subwallet/chain-list": "0.2.97-beta.7", "@subwallet/extension-base": "^1.3.11-0", "@subwallet/extension-chains": "^1.3.11-0", "@subwallet/extension-dapp": "^1.3.11-0", diff --git a/packages/extension-base/src/services/transaction-service/utils.ts b/packages/extension-base/src/services/transaction-service/utils.ts index 87247d9c02..a491b3a664 100644 --- a/packages/extension-base/src/services/transaction-service/utils.ts +++ b/packages/extension-base/src/services/transaction-service/utils.ts @@ -43,6 +43,10 @@ function getBlockExplorerAccountRoute (explorerLink: string) { return '#/accounts'; } + if (explorerLink.includes('laos.statescan.io')) { + return '#/accounts'; + } + if (explorerLink.includes('explorer.zkverify.io')) { return 'account'; } diff --git a/packages/extension-koni-ui/package.json b/packages/extension-koni-ui/package.json index f4ef4739dc..cd72e526d2 100644 --- a/packages/extension-koni-ui/package.json +++ b/packages/extension-koni-ui/package.json @@ -34,7 +34,7 @@ "@polkadot/util-crypto": "^12.6.2", "@ramonak/react-progress-bar": "^5.0.3", "@reduxjs/toolkit": "^1.9.1", - "@subwallet/chain-list": "0.2.97-beta.6", + "@subwallet/chain-list": "0.2.97-beta.7", "@subwallet/extension-base": "^1.3.11-0", "@subwallet/extension-chains": "^1.3.11-0", "@subwallet/extension-dapp": "^1.3.11-0", diff --git a/packages/extension-web-ui/package.json b/packages/extension-web-ui/package.json index 5daa76b554..9836431f8c 100644 --- a/packages/extension-web-ui/package.json +++ b/packages/extension-web-ui/package.json @@ -35,7 +35,7 @@ "@polkadot/util-crypto": "^12.6.2", "@ramonak/react-progress-bar": "^5.0.3", "@reduxjs/toolkit": "^1.9.1", - "@subwallet/chain-list": "0.2.97-beta.6", + "@subwallet/chain-list": "0.2.97-beta.7", "@subwallet/extension-base": "^1.3.11-0", "@subwallet/extension-chains": "^1.3.11-0", "@subwallet/extension-dapp": "^1.3.11-0", diff --git a/yarn.lock b/yarn.lock index a850a784a2..935c3d611d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6439,15 +6439,15 @@ __metadata: languageName: node linkType: hard -"@subwallet/chain-list@npm:0.2.97-beta.6": - version: 0.2.97-beta.6 - resolution: "@subwallet/chain-list@npm:0.2.97-beta.6" +"@subwallet/chain-list@npm:0.2.97-beta.7": + version: 0.2.97-beta.7 + resolution: "@subwallet/chain-list@npm:0.2.97-beta.7" dependencies: "@polkadot/dev": 0.67.167 "@polkadot/util": ^12.5.1 eventemitter3: ^5.0.1 ts-md5: ^1.3.1 - checksum: 33bdf56641e0ab41a8a861ef58698150c9560442f4051f1a8a357e44deb157f34d0912a811c0538aa69063bd67896545ba7a793a64984e50833659a8ca9b5b0f + checksum: 075f4a948f6700f4b800a8471ffb0010a4df84787db668ba2f2b155682f997698e02367e81a07ca754457fbb40bd7145b75c9a9325ff3b048eb9ce3997aa5e3b languageName: node linkType: hard @@ -6490,7 +6490,7 @@ __metadata: "@reduxjs/toolkit": ^1.9.1 "@sora-substrate/type-definitions": ^1.17.7 "@substrate/connect": ^0.8.9 - "@subwallet/chain-list": 0.2.97-beta.6 + "@subwallet/chain-list": 0.2.97-beta.7 "@subwallet/extension-base": ^1.3.11-0 "@subwallet/extension-chains": ^1.3.11-0 "@subwallet/extension-dapp": ^1.3.11-0 @@ -6629,7 +6629,7 @@ __metadata: "@polkadot/util-crypto": ^12.6.2 "@ramonak/react-progress-bar": ^5.0.3 "@reduxjs/toolkit": ^1.9.1 - "@subwallet/chain-list": 0.2.97-beta.6 + "@subwallet/chain-list": 0.2.97-beta.7 "@subwallet/extension-base": ^1.3.11-0 "@subwallet/extension-chains": ^1.3.11-0 "@subwallet/extension-dapp": ^1.3.11-0 @@ -6769,7 +6769,7 @@ __metadata: "@polkadot/util-crypto": ^12.6.2 "@ramonak/react-progress-bar": ^5.0.3 "@reduxjs/toolkit": ^1.9.1 - "@subwallet/chain-list": 0.2.97-beta.6 + "@subwallet/chain-list": 0.2.97-beta.7 "@subwallet/extension-base": ^1.3.11-0 "@subwallet/extension-chains": ^1.3.11-0 "@subwallet/extension-dapp": ^1.3.11-0 From a08ec2eb3a6d662153c6d416c2abaa915d8f687c Mon Sep 17 00:00:00 2001 From: S2kael Date: Thu, 2 Jan 2025 18:53:21 +0700 Subject: [PATCH 3/5] [Issue-3897] Update stable version for chain-list --- package.json | 2 +- packages/extension-base/package.json | 2 +- .../src/services/chain-service/utils/patch.ts | 2 +- packages/extension-koni-ui/package.json | 2 +- packages/extension-web-ui/package.json | 2 +- yarn.lock | 14 +++++++------- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index a53116dcbb..3dbbcdeaa0 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ "@polkadot/types-support": "^15.0.1", "@polkadot/util": "^13.2.3", "@polkadot/util-crypto": "^13.2.3", - "@subwallet/chain-list": "0.2.97-beta.7", + "@subwallet/chain-list": "0.2.97", "@subwallet/keyring": "^0.1.8-beta.0", "@subwallet/react-ui": "5.1.2-b79", "@subwallet/ui-keyring": "0.1.8-beta.0", diff --git a/packages/extension-base/package.json b/packages/extension-base/package.json index 172f57640d..a8168ff5aa 100644 --- a/packages/extension-base/package.json +++ b/packages/extension-base/package.json @@ -55,7 +55,7 @@ "@reduxjs/toolkit": "^1.9.1", "@sora-substrate/type-definitions": "^1.17.7", "@substrate/connect": "^0.8.9", - "@subwallet/chain-list": "0.2.97-beta.7", + "@subwallet/chain-list": "0.2.97", "@subwallet/extension-base": "^1.3.11-0", "@subwallet/extension-chains": "^1.3.11-0", "@subwallet/extension-dapp": "^1.3.11-0", diff --git a/packages/extension-base/src/services/chain-service/utils/patch.ts b/packages/extension-base/src/services/chain-service/utils/patch.ts index 2dc53844a5..9e8b6c3382 100644 --- a/packages/extension-base/src/services/chain-service/utils/patch.ts +++ b/packages/extension-base/src/services/chain-service/utils/patch.ts @@ -8,7 +8,7 @@ const branchName = process.env.BRANCH_NAME || 'subwallet-dev'; const fetchDomain = PRODUCTION_BRANCHES.indexOf(branchName) > -1 ? 'https://chain-list-assets.subwallet.app' : 'https://dev.sw-chain-list-assets.pages.dev'; const fetchFile = PRODUCTION_BRANCHES.indexOf(branchName) > -1 ? 'list.json' : 'preview.json'; -const ChainListVersion = '0.2.96'; // update this when build chainlist +const ChainListVersion = '0.2.97'; // update this when build chainlist // todo: move this interface to chainlist export interface PatchInfo { diff --git a/packages/extension-koni-ui/package.json b/packages/extension-koni-ui/package.json index cd72e526d2..b184dd268b 100644 --- a/packages/extension-koni-ui/package.json +++ b/packages/extension-koni-ui/package.json @@ -34,7 +34,7 @@ "@polkadot/util-crypto": "^12.6.2", "@ramonak/react-progress-bar": "^5.0.3", "@reduxjs/toolkit": "^1.9.1", - "@subwallet/chain-list": "0.2.97-beta.7", + "@subwallet/chain-list": "0.2.97", "@subwallet/extension-base": "^1.3.11-0", "@subwallet/extension-chains": "^1.3.11-0", "@subwallet/extension-dapp": "^1.3.11-0", diff --git a/packages/extension-web-ui/package.json b/packages/extension-web-ui/package.json index 9836431f8c..a6e3fec431 100644 --- a/packages/extension-web-ui/package.json +++ b/packages/extension-web-ui/package.json @@ -35,7 +35,7 @@ "@polkadot/util-crypto": "^12.6.2", "@ramonak/react-progress-bar": "^5.0.3", "@reduxjs/toolkit": "^1.9.1", - "@subwallet/chain-list": "0.2.97-beta.7", + "@subwallet/chain-list": "0.2.97", "@subwallet/extension-base": "^1.3.11-0", "@subwallet/extension-chains": "^1.3.11-0", "@subwallet/extension-dapp": "^1.3.11-0", diff --git a/yarn.lock b/yarn.lock index 935c3d611d..539ffbe983 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6439,15 +6439,15 @@ __metadata: languageName: node linkType: hard -"@subwallet/chain-list@npm:0.2.97-beta.7": - version: 0.2.97-beta.7 - resolution: "@subwallet/chain-list@npm:0.2.97-beta.7" +"@subwallet/chain-list@npm:0.2.97": + version: 0.2.97 + resolution: "@subwallet/chain-list@npm:0.2.97" dependencies: "@polkadot/dev": 0.67.167 "@polkadot/util": ^12.5.1 eventemitter3: ^5.0.1 ts-md5: ^1.3.1 - checksum: 075f4a948f6700f4b800a8471ffb0010a4df84787db668ba2f2b155682f997698e02367e81a07ca754457fbb40bd7145b75c9a9325ff3b048eb9ce3997aa5e3b + checksum: 3271231e2c5b435dd2f4c502da5af8b547a5ac8aafe7089d09c9966fd74b233eb4077d04e0c960857d5b5e2fbd29f178f08aec473e6ec23d19bd07b6642af432 languageName: node linkType: hard @@ -6490,7 +6490,7 @@ __metadata: "@reduxjs/toolkit": ^1.9.1 "@sora-substrate/type-definitions": ^1.17.7 "@substrate/connect": ^0.8.9 - "@subwallet/chain-list": 0.2.97-beta.7 + "@subwallet/chain-list": 0.2.97 "@subwallet/extension-base": ^1.3.11-0 "@subwallet/extension-chains": ^1.3.11-0 "@subwallet/extension-dapp": ^1.3.11-0 @@ -6629,7 +6629,7 @@ __metadata: "@polkadot/util-crypto": ^12.6.2 "@ramonak/react-progress-bar": ^5.0.3 "@reduxjs/toolkit": ^1.9.1 - "@subwallet/chain-list": 0.2.97-beta.7 + "@subwallet/chain-list": 0.2.97 "@subwallet/extension-base": ^1.3.11-0 "@subwallet/extension-chains": ^1.3.11-0 "@subwallet/extension-dapp": ^1.3.11-0 @@ -6769,7 +6769,7 @@ __metadata: "@polkadot/util-crypto": ^12.6.2 "@ramonak/react-progress-bar": ^5.0.3 "@reduxjs/toolkit": ^1.9.1 - "@subwallet/chain-list": 0.2.97-beta.7 + "@subwallet/chain-list": 0.2.97 "@subwallet/extension-base": ^1.3.11-0 "@subwallet/extension-chains": ^1.3.11-0 "@subwallet/extension-dapp": ^1.3.11-0 From 3dc8701693adad6284c97c861d952d2e659654c2 Mon Sep 17 00:00:00 2001 From: S2kael Date: Fri, 3 Jan 2025 11:20:17 +0700 Subject: [PATCH 4/5] [Issue-3897] [Hotfix] Catch error when create erc20 tx --- .../src/services/balance-service/transfer/smart-contract.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/extension-base/src/services/balance-service/transfer/smart-contract.ts b/packages/extension-base/src/services/balance-service/transfer/smart-contract.ts index d0ea926e1b..4cccf98c7f 100644 --- a/packages/extension-base/src/services/balance-service/transfer/smart-contract.ts +++ b/packages/extension-base/src/services/balance-service/transfer/smart-contract.ts @@ -90,7 +90,10 @@ export async function getERC20TransactionObject ( const transferData = generateTransferData(to, transferValue); const [gasLimit, priority] = await Promise.all([ // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access - erc20Contract.methods.transfer(to, transferValue).estimateGas({ from }) as number, + erc20Contract.methods.transfer(to, transferValue).estimateGas({ from }) + .catch(() => { + throw Error('Cannot estimate gas'); + }) as number, calculateGasFeeParams(evmApi, networkKey) ]); From 7c77edfeef27dfbb16ef8273252985468a3e4e13 Mon Sep 17 00:00:00 2001 From: S2kael Date: Fri, 3 Jan 2025 11:58:34 +0700 Subject: [PATCH 5/5] [Issue-3897] Update error message --- .../src/services/balance-service/transfer/smart-contract.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/extension-base/src/services/balance-service/transfer/smart-contract.ts b/packages/extension-base/src/services/balance-service/transfer/smart-contract.ts index 4cccf98c7f..c53d389292 100644 --- a/packages/extension-base/src/services/balance-service/transfer/smart-contract.ts +++ b/packages/extension-base/src/services/balance-service/transfer/smart-contract.ts @@ -92,7 +92,7 @@ export async function getERC20TransactionObject ( // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access erc20Contract.methods.transfer(to, transferValue).estimateGas({ from }) .catch(() => { - throw Error('Cannot estimate gas'); + throw Error('Unable to estimate fee for this transaction. Try again or contact support at agent@subwallet.app'); }) as number, calculateGasFeeParams(evmApi, networkKey) ]);