Search packages, repositories and app categories

wallet_connect cover
Package detailsv1.0.4

wallet_connect

Wallet Connect client made in love with dart.

AndroidiOSmacOSWindowsLinux
30-day downloads
116
Likes
68
Pub points
110

Install package

flutter pub add wallet_connect

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Wallet Connect is a Dart-based client for integrating blockchain wallet connectivity into Flutter applications. Built with care, it enables secure, peer-to-peer communication between dApps and crypto wallets across multiple platforms. The package supports seamless wallet pairing, session management, and transaction signing, making it ideal for Web3 app development. It's designed to work natively on Android, iOS, macOS, Windows, and Linux, ensuring broad compatibility. With its clean API and active open-source community, Wallet Connect simplifies the integration of decentralized identity and payment workflows.

Use cases

  • Connecting users to crypto wallets
  • Enabling blockchain transactions in apps
  • Supporting dApp authentication
  • Facilitating cross-platform wallet interactions
  • Building Web3-enabled mobile and desktop apps

Key features

  • Cross-platform support (Android, iOS, macOS, Windows, Linux)
  • Secure peer-to-peer connection
  • Session management and recovery
  • Transaction signing via wallet
  • Open-source and actively maintained

Suitable for

  • Flutter developers building dApps
  • Web3 application creators
  • Crypto wallet integrators
  • Mobile and desktop blockchain apps
  • Projects requiring secure wallet pairing

Considerations

  • Requires understanding of Web3 concepts
  • Depends on external wallet providers
  • May need additional UI for pairing flow
  • Not suitable for non-blockchain use cases
  • Limited documentation beyond basic examples

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Wallet Connect Logo

Wallet Connect

Wallet Connect client in dart highly inspired from wallet-connect-kotlin by Trust Wallet.

Usage

    import 'package:wallet_connect/wallet_connect.dart';
  1. Create instance of Wallet connect client and define callbacks.
    final wcClient = WCClient(
      onConnect: () {
        // Respond to connect callback
      },
      onDisconnect: (code, reason) {
        // Respond to disconnect callback
      },
      onFailure: (error) {
        // Respond to connection failure callback
      },
      onSessionRequest: (id, peerMeta) {
        // Respond to connection request callback
      },
      onEthSign: (id, message) {
        // Respond to personal_sign or eth_sign or eth_signTypedData request callback
      },
      onEthSendTransaction: (id, tx) {
        // Respond to eth_sendTransaction request callback
      },
      onEthSignTransaction: (id, tx) {
        // Respond to eth_signTransaction request callback
      },
    );
  1. Create WCSession object from wc: uri.
    final session = WCSession.from(wcUri);
  1. Create WCPeerMeta object containing metadata for your app.
    final peerMeta = WCPeerMeta(
        name: 'Example Wallet',
        url: 'https://example.wallet',
        description: 'Example Wallet',
        icons: [],
    );
  1. Connect to a new session.
    wcClient.connectNewSession(session: session, peerMeta: peerMeta);
  1. Or connect to a saved session (from step 8).
    wcClient.connectFromSessionStore(sessionStore);
  1. Approve a session connection request.
    wcClient.approveSession(
        accounts: [], // account addresses
        chainId: 1, // chain id
    );
  1. Or reject a session connection request.
    wcClient.rejectSession();
  1. Get active session from sessionStore getter to save for later use.
    final sessionStore = wcClient.sessionStore;
  1. Approve a sign transaction request by signing the transaction and sending the signed hex data.
    wcClient.approveRequest<String>(
        id: id,
        result: signedDataAsHex,
    );
  1. Approve a send transaction request by sending the transaction hash generated from sending the transaction.
    wcClient.approveRequest<String>(
        id: id,
        result: transactionHash,
    );
  1. Approve a sign request by sending the signed data hex generated.
    wcClient.approveRequest<String>(
        id: id,
        result: signedDataAsHex,
    );
  1. Or reject any of the requests above by specifying request id.
    wcClient.rejectRequest(id: id);
  1. Disconnect from a connected session locally.
    wcClient.disconnect();
  1. Permanently close a connected session.
    wcClient.killSession();

Categories

Dependencies

Dependency list 8 items

Source repository

Projects using this package

No data available yet.