add try/catch and increase polling interval

pull/5370/head
yann300 1 year ago committed by Aniket
parent 2bc2b0190e
commit 358103d70a
  1. 12
      apps/walletconnect/src/services/WalletConnectRemixClient.ts

@ -59,7 +59,9 @@ export class WalletConnectRemixClient extends PluginClient {
] ]
const {publicClient} = configureChains(this.chains, [ const {publicClient} = configureChains(this.chains, [
w3mProvider({projectId: PROJECT_ID}) w3mProvider({projectId: PROJECT_ID})
]) ], {
pollingInterval: 5000
})
this.wagmiConfig = createConfig({ this.wagmiConfig = createConfig({
autoConnect: false, autoConnect: false,
@ -132,8 +134,12 @@ export class WalletConnectRemixClient extends PluginClient {
}) })
}) })
} else { } else {
const message = await provider.request(data) try {
return {jsonrpc: '2.0', result: message, id: data.id} const message = await provider.request(data)
return {jsonrpc: '2.0', result: message, id: data.id}
} catch (e) {
return {jsonrpc: '2.0', error: { message: e.message, code: -32603 }, id: data.id}
}
} }
} }
} else { } else {

Loading…
Cancel
Save