reown-com/reown_flutter

ReownSignError(code: 1, message: Not initialized., data: null)

Closed this issue · 4 comments

Describe the bug

I am encountering an error while attempting to pair with wcClient using the Reown WalletKit SDK. The error message is:

js Error pairing with wcClient : ReownSignError(code: 1, message: Not initialized., data: null)

This issue occurs during the pairing process, even though the SDK initialization seems to be correctly set up. I have tried pairing on multiple dApps but the same error persists.

To Reproduce

Steps to reproduce the behavior:

  1. Initialize the Reown WalletKit as follows:
ReownWalletKit wcClient = ReownWalletKit(
  core: ReownCore(
    projectId: 'xxxxxxxx',
  ),
  metadata: PairingMetadata(
    name: 'xxxxx',
    description: 'xxxxxx',
    url: 'https://xxxxxxxx.com/',
    icons: ['https://example.com/logo.png'],
    redirect: Redirect(
      native: 'examplewallet://',
      universal: 'https://examplewallet.com/examplewallet',
    ),
  ),
);
  1. Attempt to pair using the code below:
try {
  await wcClient.pair(uri: Uri.parse(widget.scanResult));
} catch (e) {
  print("Error pairing with wcClient : $e");
}
  1. Run the app and scan the URI of a dApp.
    Observe the error in the console log:
    Error pairing with wcClient : ReownSignError(code: 1, message: Not initialized., data: null)

Expected behavior

The pairing process should successfully establish a connection between the app and the dApp.

Device: [Redmi Note 9 Pro - MIUI version : 12.5.8

Additional context

I am using Flutter 3.24.4 with reown_walletkit: ^1.0.3.

It would be great to have guidance on whether this error is due to a missing initialization step or an issue in the library itself. Thank you for your continued efforts on this SDK!

Ps : Glad to see you there again Alfreedom ;)

Hello @Fabrice-Fabio, are you calling wcClient.init() after instantiating ReownWalletKit()? Can you post the stack trace if possible?

rommex commented

Hi @quetool , I'd like to point out that I had the same error as the topic starter. Of course your suggestion of calling wcClient.init() helped and my code worked.

The problem is that your docs don't mention this but only specify that one has to create an object injecting metadata: https://docs.reown.com/walletkit/flutter/usage#initialization

Flawed docs ((

Hello @rommex, thanks for the feedback! You are totally correct! This is specified in AppKit but not on WalletKit. I will improve docs ASAP!

@Fabrice-Fabio if the suggested init() solves your problem please close this issue!

Sure I’ve juste test it and it works thanks Man
I’ll let you if I’m facing new ones.
Please let them know they should update the doc, it wasn’t there!;)