-
Notifications
You must be signed in to change notification settings - Fork 68
Description
Use cases.
Connection from a uniswap or pancakeswap type dapp, the connection will work every other time.
Sometimes it returns an error which is caught by wcClient.onSessionProposalError.subscribe() in the format:
"SessionProposalErrorEvent(id: 1701782571459814, requiredNamespaces: {eip155: RequiredNamespace(chains: [eip155:137], methods: [eth_sendTransaction, personal_sign], events: [chainChanged, accountsChanged])}, namespaces: {eip155: Namespace(accounts: [ eip155:137:0xfc4124d107ac29e3b1638c335d768d54a8cf5700], methods: [personal_sign, eth_sendTransaction], events: [chainChanged])}, error: WalletConnectError(code: 5102, message: Unsupported events. onSessionProposeRequest namespaces events don't satisfy requiredNamespaces events for eip155.Requested: [chainChanged, accountsChanged], Supported: [chainChanged], data: null))"
While the app namespace is configured like this :
await wcClient.approveSession(
id: id,
namespaces: {
'eip155': Namespace(
accounts: [
"eip155:1:$_currentAddress",
"eip155:137:$_currentAddress",
"eip155:56:$_currentAddress",
"eip155:43114:$_currentAddress",
"eip155:42161:$_currentAddress",
"eip155:250:$_currentAddress",
"eip155:${this._currentNetworkId}:$_currentAddress"],
methods: [
"eth_sendTransaction",
"eth_signTransaction",
"eth_sign",
"personal_sign",
"eth_signTypedData",
"eth_signTypedData_v4"
],
events: ["chainChanged", "accountsChanged", "message", "disconnect", "connect"],
),
}
);
Which should logically take into account all cases.
Is there a way to avoid all of this?
Thanks