WalletConnect / WalletConnectFlutterV2

WalletConnect v2 client made in Dart for Flutter.
https://pub.dev/packages/walletconnect_flutter_v2
Apache License 2.0
114 stars 60 forks source link

Error: The method 'connect' isn't defined for the class 'Web3Wallet'. #245

Closed maxttor closed 8 months ago

maxttor commented 8 months ago
Web3Wallet web3Wallet = await Web3Wallet.createInstance(
        relayUrl: 'wss://relay.walletconnect.com',
        projectId: '123',
        metadata: PairingMetadata(
          name: 'Wallet (Responder)',
          description: 'A wallet that can be requested to sign transactions',
          url: 'https://walletconnect.com',
          icons: ['https://avatars.githubusercontent.com/u/37784886'],
        ),
      );

ConnectResponse resp = await web3Wallet.connect(
        requiredNamespaces: {
          'eip155': RequiredNamespace(
            chains: ['eip155:1'], // Ethereum chain
            methods: ['personal_sign'], // Requestable Methods, see MethodsConstants for reference
            events: ['chainChanged'], // Requestable Events, see EventsConstants for reference
          ),
        },
        optionalNamespaces: {
          'eip155': RequiredNamespace(
            chains: ['eip155:1', 'eip155:5'], // Any other optional Ethereum chain
            methods: ['eth_signTransaction'], // Optional requestable Methods, see MethodsConstants for reference
            events: ['accountsChanged'], // Optional requestable events, see EventsConstants for reference
          ),
        },
      );

Get error: The method 'connect' isn't defined for the class 'Web3Wallet'.

quetool commented 8 months ago

Hello @maxttor! The error is correct, there's no connect() method on web3wallet https://docs.walletconnect.com/web3wallet/wallet-usage

Are you perhaps looking for web3app? Are you developing a wallet or a dapp?

maxttor commented 8 months ago

Hello @maxttor! The error is correct, there's no connect() method on web3wallet https://docs.walletconnect.com/web3wallet/wallet-usage

Are you perhaps looking for web3app? Are you developing a wallet or a dapp?

I understood my mistake, thanks.