0

I am using walletconnect_dart package to connect with metamask/trustwallet and send transaction

for metamask it's working but for TrustWallet when user close app and come back after few minutes session is still connected but it doesn't show transaction confirm popup when user send transaction, it only work for first few minutes until user close app

final session = await UserDataUtils.sessionStorage.getSession();

    // Create a connector
    _twConnector = WalletConnect(
      bridge: 'https://bridge.walletconnect.org',
      session: session,
      sessionStorage: sessionStorage,
      clientMeta: const PeerMeta(
      name: 'WalletConnect',
      description: 'WalletConnect Developer App',
      url: 'https://walletconnect.org',
      icons: [
      'https://gblobscdn.gitbook.com/spaces%2F-LJJeCjcLrr53DcT1Ml7%2Favatar.png?alt=media'
    ],
  ),
);

code for sending transaction with trustwallet

await launchUrl(Uri.parse(uri), mode: LaunchMode.externalApplication);
return await _twConnector.sendCustomRequest(
    method: 'eth_sendTransaction',
    params: [trxParams],
);
TylerH
  • 20,799
  • 66
  • 75
  • 101
Amjad Khan
  • 63
  • 1
  • 6

0 Answers0