Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RelayClient, onSubscribe error. #132

Open
makinghappen opened this issue Jul 7, 2023 · 8 comments
Open

RelayClient, onSubscribe error. #132

makinghappen opened this issue Jul 7, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@makinghappen
Copy link

When trying to connect using example provided:

https://github.com/WalletConnect/WalletConnectFlutterV2#dapp-flow
https://docs.walletconnect.com/2.0/flutter/dapps/dapp-sign-usage

I am getting the following error, and after scanning the connection URI with metamask it does not connect.

flutter: ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: │ #0 RelayClient._onSubscribe (package:walletconnect_flutter_v2/apis/core/relay_client/relay_client.dart:418:19)
flutter: │ #1
flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
flutter: │ ⚠️ RelayClient, onSubscribe error. Topic: d76177fb912ebd9bead4633152c10b7b2af2e927b398014edd22afcb899036d4, Error: Null check operator used on a null value
flutter: └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

@bobwith2bees
Copy link

Another code path where Metamask is sending nulls?

Related to #118 since that mentions pairing as well?

@makinghappen
Copy link
Author

@bobwith2bees this happens before the actual connection with Metamask

@makinghappen
Copy link
Author

I call initSession and get mentioned error

`class EthereumWallectConnectTransactionV2 {
late final Web3App wcClient;

Future initSession() async {
wcClient = await initWalletConnect();
}

Future initWalletConnect() async {
Web3App wcClient = await Web3App.createInstance(
relayUrl: 'wss://relay.walletconnect.com', // The relay websocket URL, leave blank to use the default
projectId: '123',
metadata: PairingMetadata(
name: 'dApp (Requester)',
description: 'A dapp that can request that transactions be signed',
url: 'https://walletconnect.com',
icons: ['https://avatars.githubusercontent.com/u/37784886'],
),
);
return wcClient;
}

Future connect() async {
// Create a new session
ConnectResponse resp = await wcClient.connect(requiredNamespaces: {
'eip155': RequiredNamespace(
chains: ['eip155:1'], // Ethereum chain
methods: ['eth_signTransaction'], // Requestable Methods
events: ['']),
});
// Uri? uri = resp.uri;

// final SessionData session = await resp.session.future;
return resp;

}
}`

@Luzzotica
Copy link
Contributor

Just released 2.0.13 which might resolve this.

Please test and let me know!

@rkovrigin
Copy link

There is a problem with v2.0.13.
It requires http v1.1.3, and many other libraries depend on lower versions of http, so, that breaks many dependencies =(

@rkovrigin
Copy link

Tried to fix dependencies and use 2.0.13, have this error now:
#0 _$$_JsonRpcErrorFromJson (package:walletconnect_flutter_v2/apis/models/json_rpc_error.g.dart:11:26)
#1 new _$_JsonRpcError.fromJson (package:walletconnect_flutter_v2/apis/models/json_rpc_error.freezed.dart:115:7)
#2 _$JsonRpcErrorFromJson (package:walletconnect_flutter_v2/apis/models/json_rpc_error.freezed.dart:18:24)
#3 new JsonRpcError.fromJson (package:walletconnect_flutter_v2/apis/models/json_rpc_error.dart:26:7)
#4 _$$_JsonRpcResponseFromJson (package:walletconnect_flutter_v2/apis/models/json_rpc_response.g.dart:18:26)
#5 new _$_JsonRpcResponse.fromJson (package:walletconnect_flutter_v2/apis/models/json_rpc_response.freezed.dart:157:7)
#6 _$JsonRpcResponseFromJson (package:walletconnect_flutter_v2/apis/models/json_rpc_response.freezed.dart:19:10)
#7 new JsonRpcResponse.fromJson (package:walletconnect_flutter_v2/apis/models/json_rpc_response.dart:18:7)
#8 Pairing._onMessageEvent (package:walletconnect_flutter_v2/apis/core/pairing/pairing.dart:656:40)

@Luzzotica
Copy link
Contributor

@rkovrigin Please make a separate issue for this http information.

I completely lost it in here, and this issue has nothing to do with an http error.

@Luzzotica Luzzotica added the bug Something isn't working label Jul 14, 2023
@YannMarti
Copy link

I get the same error.
It apppears really inconsistently, so i cant really say how to reproduce, but restarting the app always fixes it temporarily (or the emulator, tried it both in debug mode and as an actuall build on my phone)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants