From 71f4d9d6b1d6e6aaeafdc9f35fb26d1d23f48dc1 Mon Sep 17 00:00:00 2001 From: CounterFire2023 <136581895+CounterFire2023@users.noreply.github.com> Date: Mon, 22 Jul 2024 10:55:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84network=E7=9A=84=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/chain/BlockChain.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/chain/BlockChain.js b/src/components/chain/BlockChain.js index 4fbd12f..fa7ddbf 100644 --- a/src/components/chain/BlockChain.js +++ b/src/components/chain/BlockChain.js @@ -229,6 +229,7 @@ export class BlockChain { */ async checkAndChangeChain(targetChainId, provider) { targetChainId = targetChainId || cfgChainId; + // passport只支持imtbl链, 不需要切换 if (!provider && this.store.walletType == 3) { return } @@ -238,6 +239,16 @@ export class BlockChain { console.log(`current chain: ${chainId}, want: ${targetChainId}`) chainId = await switchEthereumChain(provider.provider, targetChainId); } + + if (this.store.walletType == 3) { + const { provider, accounts } = await this.eoaWallet.web3Provider(); + this.eoaProvider = provider; + } else { + const { provider, accounts } = await this.wallet.web3Provider(); + this.web3Provider = provider; + this.eoaProvider = provider; + } + } async checkPassportLogin() {