パッケージ、リポジトリ、アプリカテゴリを検索

walletconnect_dart のカバー
パッケージ詳細v0.0.11

walletconnect_dart

QRコードスキャンまたはディープリンクを介して、分散型アプリケーションをモバイルウォレットに接続するためのオープンプロトコル。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
773
いいね数
115
Pub ポイント
130

パッケージをインストール

flutter pub add walletconnect_dart

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

WalletConnect Dart は、QR コードのスキャンまたはディープリンクを通じて、分散型アプリケーションがモバイルウォレットに安全に接続できる軽量な SDK です。Android、iOS、Web、macOS、Windows、Linux でのクロスプラットフォーム統合をサポートし、ブロックチェーンとのシームレスな相互作用を実現します。オープンな WalletConnect プロトコルに基づいており、プライベートキーを公開せずに dApp とウォレット間の暗号化された通信を保証します。このパッケージは、Flutter アプリにおけるウォレットペアリング、セッション管理、取引署名を簡素化します。安全で使いやすいウォレット接続を必要とする暗号資産ネイティブアプリを開発する開発者に最適です。

用途

  • dApps をモバイルウォレットに接続する
  • ブロックチェーン取引の有効化
  • マルチプラットフォーム暗号アプリのサポート
  • 安全なウォレットのペアリングを促進する
  • QRコードベースの認証の実装
  • イーサリアムおよびその他のブロックチェーンとの統合

主な機能

  • クロスプラットフォーム対応
  • QRコードとディープリンクのペアリング
  • 暗号化セッション通信
  • セキュアなトランザクション署名
  • Flutter との簡単な統合
  • 軽量でモジュール構造のデザイン

適している対象

  • Flutter開発者がdAppsを構築しています
  • 暗号通貨ウォレットの統合
  • Web3アプリケーション作成者
  • ブロックチェーンプロジェクトチーム
  • モバイルファーストの暗号資産プラットフォーム
  • 分散型金融(DeFi)アプリ

注意事項

  • 互換性のあるモバイルウォレットが必要です
  • 接続エラーに対する適切なエラーハンドリングが必要です
  • 外部ウォレットの利用可能性に依存します
  • QRコードスキャン用の追加UIが必要になる場合があります
  • ブロックチェーン以外の用途には適していません
  • セッション管理は慎重に扱わなければならない

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

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.

カテゴリー

依存関係

依存関係一覧 6 件

ソースリポジトリ

このパッケージを使用しているプロジェクト