Pakete, Repositories und App-Kategorien suchen

Cover von walletconnect_dart
Paketdetailsv0.0.11

walletconnect_dart

Offenes Protokoll zur Verbindung dezentraler Anwendungen mit mobilen Wallets über QR-Code-Scannen oder Deep Linking.

AndroidiOSWebmacOSWindowsLinux
30-Tage-Downloads
773
Likes
115
Pub-Punkte
130

Paket installieren

flutter pub add walletconnect_dart

Paketübersicht

Aus öffentlichen Paketdaten erstellte Orientierung.

WalletConnect Dart ist ein leichtgewichtiges SDK, das dezentrale Anwendungen ermöglicht, sicher über QR-Code-Scannen oder Deep Linking mit mobilen Wallets zu verbinden. Es unterstützt die plattformübergreifende Integration für Android, iOS, Web, macOS, Windows und Linux und erleichtert nahtlose Blockchain-Interaktionen. Auf dem offenen WalletConnect-Protokoll aufgebaut, gewährleistet es verschlüsselte Kommunikation zwischen dApps und Wallets, ohne private Schlüssel preiszugeben. Das Paket vereinfacht die Wallet-Paarung, Sitzungsverwaltung und Transaktionsunterzeichnung in Flutter-Anwendungen. Ideal für Entwickler, die kryptonative Anwendungen mit sicherer, benutzerfreundlicher Wallet-Konnektivität erstellen möchten.

Anwendungsfälle

  • dApps mit mobilen Wallets verbinden
  • Blockchain-Transaktionen aktivieren
  • Unterstützung von Multi-Plattform-Kryptowährungsanwendungen
  • Sichere Wallet-Paarung erleichtern
  • Implementierung der QR-Code-basierten Authentifizierung
  • Integration mit Ethereum und anderen Blockchains

Hauptmerkmale

  • Plattformübergreifende Unterstützung
  • QR-Code- und Deep-Link-Paarung
  • Verschlüsselte Sitzungskommunikation
  • sichere Transaktionssignierung
  • Einfache Integration mit Flutter
  • Leichtgewichtiges und modulares Design

Geeignet für

  • Flutter-Entwickler, die dApps erstellen
  • Krypto-Wallet-Integrationen
  • Web3-Anwendungsersteller
  • Blockchain-Projektteams
  • Mobile-first Kryptoplattformen
  • dezentrale Finanzanwendungen (DeFi)

Hinweise

  • Kompatible mobile Wallets erforderlich
  • Erforderliche ordnungsgemäße Fehlerbehandlung bei Verbindungsfehlern
  • Abhängig von der Verfügbarkeit einer externen Wallet
  • Kann zusätzliche Benutzeroberfläche für die QR-Scanning erfordern
  • Nicht geeignet für nicht-Blockchain-Anwendungsfälle
  • Die Sitzungsverwaltung muss sorgfältig behandelt werden

Original-README

Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.

pub.dev Effective Dart Stars Issues MIT License

WalletConnect is an open source protocol for connecting decentralised applications to mobile wallets with QR code scanning or deep linking. A user can interact securely with any Dapp from their mobile phone, making WalletConnect wallets a safer choice compared to desktop or browser extension wallets.

Introduction

WalletConnect connects mobile & web applications to supported mobile wallets. The WalletConnect session is started by scanning a QR code (desktop) or by clicking an application deep link (mobile).

WalletConnect-Dart-SDK is a community SDK and port of the official WalletConnect-monorepo.

WalletConnect-Dart currently supports:

  • Algorand
  • Ethereum

You can easily add your own network by extending from WalletConnectProvider and implementing the required methods using sendCustomRequest. An example from Binance Smart Chain can be found here. For more information regarding the implementation, check out EthereumWalletConnectProvider and AlgorandWalletConnectProvider.

WalletConnect lets you build:

  • Decentralized web applications and display QR codes with qr_flutter
  • Mobile dApps with deep linking using url_launcher
  • Cross-platform wallets

Once installed, you can simply connect your application to a wallet.

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

Usage

Dapps

Initiate connection

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

// Subscribe to events
connector.on('connect', (session) => print(session));
connector.on('session_update', (payload) => print(payload));
connector.on('disconnect', (session) => print(session));

// Create a new session
if (!connector.connected) {
    final session = await connector.createSession(
        chainId: 4160,
        onDisplayUri: (uri) => print(uri),
    );
}

Sign transaction

final sender = Address.fromAlgorandAddress(address: session.accounts[0]);

// Fetch the suggested transaction params
final params = await algorand.getSuggestedTransactionParams();

// Build the transaction
final tx = await (PaymentTransactionBuilder()
  ..sender = sender
  ..noteText = 'Signed with WalletConnect'
  ..amount = Algo.toMicroAlgos(0.0001)
  ..receiver = sender
  ..suggestedParams = params)
    .build();

// Sign the transaction
final signedBytes = await provider.signTransaction(
    tx.toBytes(),
    params: {
    'message': 'Optional description message',
    },
);

// Broadcast the transaction
final txId = await algorand.sendRawTransactions(
    signedBytes,
    waitForConfirmation: true,
);

// Kill the session
connector.killSession();
Wallets

Initiate connection

// Create a connector
final connector = WalletConnect(
    uri: 'wc:8a5e5bdc-a0e4-47...TJRNmhWJmoxdFo6UDk2WlhaOyQ5N0U=',
    clientMeta: PeerMeta(
      name: 'WalletConnect',
      description: 'WalletConnect Developer App',
      url: 'https://walletconnect.org',
      icons: [
        'https://gblobscdn.gitbook.com/spaces%2F-LJJeCjcLrr53DcT1Ml7%2Favatar.png?alt=media'
      ],
    ),
);

// Subscribe to events
connector.on('connect', (session) => print(session));
connector.on('session_request', (payload) => print(payload));
connector.on('disconnect', (session) => print(session));

Manage connection

// Approve session
await connector.approveSession(chainId: 4160, accounts: ['0x4292...931B3']);

// Reject session
await connector.rejectSession(message: 'Optional error message');

// Update session
await connector.updateSession(SessionStatus(chainId: 4000, accounts: ['0x4292...931B3']));

Kill session

await connector.killSession();

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing & Pull Requests

Feel free to send pull requests.

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

Kategorien

Abhängigkeiten

Abhängigkeiten 6 Einträge

Quell-Repository

Projekte, die dieses Paket verwenden