wallet_connect_v2 0.1.0 copy "wallet_connect_v2: ^0.1.0" to clipboard
wallet_connect_v2: ^0.1.0 copied to clipboard

outdated

Wallet Connect V2 for Flutter

wallet_connect_v2 #

WalletConnect V2 for Flutter

This lib came from the demand of our project Avacus

We used to try to make in pure Dart but it cost much time to build and test so we decide to make an wrapper to consume SDKs from WalletConnect team!

Getting Started #

We make very detail in example so you can follow it.

Import and create instance

import 'package:wallet_connect_v2/wallet_connect_v2.dart';

final _client = WalletConnectV2();

Initiate WalletConnect SDK

_client.init(projectId: projectId, appMetadata: walletMetadata);

Listen needed events from our export

typedef OnConnectionStatus = Function(bool isConnected);
typedef OnSessionProposal = Function(SessionProposal proposal);
typedef OnSessionSettle = Function(Session session);
typedef OnSessionUpdate = Function(String topic);
typedef OnSessionDelete = Function(String topic);
typedef OnSessionRequest = Function(SessionRequest request);
typedef OnEventError = Function(String code, String message);

// example of listen to session proposal
_client.onSessionProposal = (proposal) {
  // do approve and reject session here
}

Connect to listen event

_client.connect();

Disconnect

_client.disconnect();

Pair with DApps

_client.pair(uri: uri);

Approve session

_client.approveSession(approval: approval);

Reject session

_client.rejectSession(proposalId: proposal.id);

Disconnect session

_client.disconnectSession(topic: topic);

Update session

_client.updateSession(approval: updateApproval);

Approve request

_client.approveRequest(topic: topic, requestId: requestId, result: result);

Reject request

_client.rejectRequest(topic: topic, requestId: requestId);
18
likes
0
points
127
downloads

Publisher

unverified uploader

Weekly Downloads

Wallet Connect V2 for Flutter

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, json_annotation, plugin_platform_interface

More

Packages that depend on wallet_connect_v2