Skip to content

Unable to sign a message with a Rainbow wallet #33

Description

@bselwe

Describe the bug

It is not possible to sign a message or transaction when connected to a Rainbow wallet. The Rainbow wallet is launched but it doesn't show a pop-up to sign a message or transaction. It might be that the WalletConnect session is stale as it usually happens a few hours (or a day) after connecting the wallet.

To Reproduce

Initialize the WalletConnect session
service = WalletConnectModalService(
  projectId: AppDotEnv.walletConnectProjectId,
  metadata: const PairingMetadata(
    name: 'orb',
    description: 'Everyday app for web3 social',
    url: 'https://orb.ac/',
    icons: ['https://i.ibb.co/w6sNHRC/launcher.png'],
    redirect: Redirect(
      native: 'orbapp://',
      universal: 'https://orb.ac/',
    ),
  ),
  recommendedWalletIds: {
    WalletUtils.metaMaskWalletId,
    WalletUtils.zerionWalletId,
    WalletUtils.trustWalletId,
    WalletUtils.rainbowWalletId,
    WalletUtils.bitgetWalletId,
    WalletUtils.imTokenWalletId,
    WalletUtils.omniWalletId,
    ...
  },
  requiredNamespaces: {
    'eip155': RequiredNamespace(
      methods: [
        'eth_sendTransaction',
        'personal_sign',
        'eth_sign',
        'eth_signTypedData',
      ],
      chains: ['eip155:137'],
      events: [
        'chainChanged',
        'accountsChanged',
      ],
    ),
  },
  excludedWalletState: ExcludedWalletState.list,
);

service!.addListener(_onWalletUpdated);

await service!.init();
Sign a message
Future<String?> signMessage({required String message}) async {
    final web3App = service?.web3App;
    final address = service?.address?.toLowerCase() ?? '';
    final sessionData = web3App?.sessions.getAll().first;

    if (sessionData != null) {
      service?.launchCurrentWallet();
      await web3App!.request(
        topic: service!.session!.topic,
        chainId: 'eip155:137', // Polygon
        request: SessionRequestParams(
          method: 'personal_sign',
          params: [message, address],
        ),
      );
    }
  }

Expected behavior

A pop-up to sign a message should appear in the Rainbow wallet, after launching a wallet.

Videos

IMG_8150.MP4

Note: We use the above signMessage method when calling "Verify with Lens". Notice that the wallet is launched but there's no popup to sign a message.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions