Skip to content

Commit 526f2af

Browse files
ioedeveloperyann300
authored andcommitted
Add more chains and fix disconnect bug
1 parent e529572 commit 526f2af

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

apps/remix-ide/src/app/plugins/walletconnect/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Plugin } from '@remixproject/engine'
22
import { createAppKit, Provider } from '@reown/appkit'
33
import { Ethers5Adapter } from '@reown/appkit-adapter-ethers5'
4-
import { mainnet, arbitrum } from "@reown/appkit/networks"
4+
import { mainnet, sepolia, arbitrum, arbitrumSepolia, optimism, optimismSepolia, solana, solanaTestnet, bitcoin, bitcoinTestnet, bsc, bscTestnet, polygon } from "@reown/appkit/networks"
55
import { constants } from './utils/constants'
66
import { Chain, RequestArguments } from './types'
77

@@ -33,7 +33,7 @@ export class WalletConnect extends Plugin {
3333
adapters: [new Ethers5Adapter()],
3434
projectId: constants.PROJECT_ID,
3535
metadata: constants.METADATA,
36-
networks: [mainnet, arbitrum]
36+
networks: [mainnet, sepolia, arbitrum, arbitrumSepolia, optimism, optimismSepolia, solana, solanaTestnet, bitcoin, bitcoinTestnet, bsc, bscTestnet, polygon]
3737
})
3838
this.chains = constants.chains
3939
}

apps/remix-ide/src/blockchain/execution-context.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export class ExecutionContext {
148148
if (!infoCb) infoCb = () => { /* Do nothing. */ }
149149
if (this.customNetWorks[context]) {
150150
var network = this.customNetWorks[context]
151-
await network.init()
151+
if (context !== 'walletconnect') await network.init()
152152
this.currentFork = network.config.fork
153153
this.executionContext = context
154154
// injected

libs/remix-ui/run-tab/src/lib/actions/account.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,16 +337,14 @@ const setWalletConnectExecutionContext = (plugin: RunTab, dispatch: React.Dispat
337337
plugin.on('walletconnect', 'connectionDisconnected', (msg) => {
338338
plugin.call('notification', 'toast', msg)
339339
// reset to default provider if connection fails
340-
plugin.blockchain.executionContext.init(null)
341-
setFinalContext(plugin, dispatch)
340+
setExecutionContext(plugin, dispatch, { context: plugin.blockchain.defaultPinnedProviders[0], fork: null })
342341
})
343342
})
344343
}
345344
plugin.on('walletconnect', 'connectionDisconnected', (msg) => {
346345
plugin.call('notification', 'toast', msg)
347346
// reset to default provider if connection fails
348-
plugin.blockchain.executionContext.init(null)
349-
setFinalContext(plugin, dispatch)
347+
setExecutionContext(plugin, dispatch, { context: plugin.blockchain.defaultPinnedProviders[0], fork: null })
350348
})
351349
})
352350
}

0 commit comments

Comments
 (0)