• Stars
    star
    101
  • Rank 331,387 (Top 7 %)
  • Language
    Dart
  • License
    MIT License
  • Created over 2 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Open protocol for connecting dApps to mobile wallets with QR code scanning or deep linking.

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.

More Repositories

1

Database-Naming-Convention

Database Naming Conventions & Best Practices
177
star
2

ONVIF-Java

A Java client library to discover, control and manage ONVIF-supported devices.
Java
126
star
3

API-Naming-Convention

API Naming Conventions & Best Practices
45
star
4

algorand-php

Unofficial community SDK to interact with the Algorand network, in PHP & Laravel
PHP
41
star
5

algorand-dart

Unofficial community SDK to interact with the Algorand network, for Dart & Flutter
Dart
36
star
6

Create-a-custom-Cordova-plugin

How to create a custom cordova plugin and bridge it between your native code and a new or existing Cordova project
31
star
7

laravel-ipfs

A Laravel package to communicate with IPFS
PHP
29
star
8

flutter-algorand-wallet

A cross-platform wallet that connects to the Algorand blockchain
Dart
25
star
9

algoland

Build and deploy Non-Fungible Algorand Tokens with Laravel & IPFS
PHP
24
star
10

Oculus-Quest-Setup

Setting up Unity for Oculus Quest Development
15
star
11

algorand-node-companion-app

A Flutter application to easily manage and control your Algorand nodes.
Dart
14
star
12

Object-Recognition-Using-ORB-OpenCV

This native Android application uses the Open Computer Vision framework for Object Recognition using ORB Feature Detection and Homography.
Java
5
star
13

ledger-flutter

A flutter plugin to connect with a Ledger Nano X using BLE
Dart
5
star
14

flutter-algosigner

A Flutter web plugin to approve or deny Algorand transactions using AlgoSigner.
Dart
4
star
15

walletconnect-secure-storage

Securely store WalletConnect sessions in your Flutter applications using walletconnect_dart.
Dart
3
star
16

ProgressDataView

A view to easily switch between loading, empty, data and error states in your app.
Java
2
star
17

ledger-algorand

A Flutter Ledger App Plugin for the Algorand blockchain
Dart
2
star
18

algorand-node-web-app

Web version of Algorand Node Companion App
JavaScript
2
star
19

web3_walletconnect

Flutter example on how to use WalletConnect dApp <> Wallet
Dart
2
star
20

Taters

Public GIT for the Taters cryptocurrency project.
Java
2
star
21

algorand-json

A collection of JSON related operations for the Algorand blockchain
Dart
1
star
22

ledger-usb

A Flutter plugin to operate a Ledger Nano device over USB
Dart
1
star
23

flutter-myalgo-connect

A Flutter web plugin to approve or deny Algorand transactions using MyAlgo Connect.
Dart
1
star
24

reach-dart-sdk

Frontend client for building decentralized applications using Reach
Dart
1
star