패키지, 저장소 및 앱 카테고리 검색

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 구축 중
  • 암호화 지갑 통합
  • 웹3 애플리케이션 창작자
  • 블록체인 프로젝트 팀
  • 모바일 중심의 암호화폐 플랫폼
  • 탈중앙화 금융(DeFi) 앱

고려 사항

  • 호환되는 모바일 지갑이 필요합니다
  • 연결 실패에 대한 적절한 오류 처리가 필요합니다
  • 외부 지갑의 가용성에 따라 다릅니다
  • QR 스캔을 위한 추가적인 사용자 인터페이스가 필요할 수 있습니다
  • 블록체인 외 사용 사례에는 적합하지 않습니다
  • 세션 관리는 신중하게 다뤄야 합니다

원본 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 개

소스 저장소

이 패키지를 사용하는 프로젝트