Skip to content

Commit

Permalink
Merge pull request #50 from WalletConnect/v3.0.0-beta11
Browse files Browse the repository at this point in the history
v3.0.0-beta11
  • Loading branch information
quetool authored Oct 27, 2023
2 parents bd1aa67 + b810db5 commit 7e55eb4
Show file tree
Hide file tree
Showing 38 changed files with 738 additions and 447 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.0.0-beta11

- Improvements during chain switchng by properly catching errors and rejections and highlighting non-approved chains by the connected wallet.

## 3.0.0-beta10

- Fix a bug where QR Code wasn't readable anymore after user rejects connection from within the chosen wallet app
Expand Down
8 changes: 5 additions & 3 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,18 @@ linter:
rules:
non_constant_identifier_names: false
constant_identifier_names: false
# avoid_print: false # Uncomment to disable the `avoid_print` rule
prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
avoid_print: true
prefer_single_quotes: true
sort_pub_dependencies: true
avoid_unnecessary_containers: true

cancel_subscriptions: true

analyzer:
exclude:
- "**/*.g.dart"
- "**/*.freezed.dart"
- "*.freezed.dart"
- "*.g.dart"
errors:
invalid_annotation_target: ignore
# Additional information about this file can be found at
Expand Down
3 changes: 3 additions & 0 deletions assets/icons/extension.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/mobile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ PODS:
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- package_info_plus (0.4.5):
- Flutter
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
Expand All @@ -20,6 +22,7 @@ PODS:
DEPENDENCIES:
- appcheck (from `.symlinks/plugins/appcheck/ios`)
- Flutter (from `Flutter`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
Expand All @@ -34,6 +37,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/appcheck/ios"
Flutter:
:path: Flutter
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
shared_preferences_foundation:
Expand All @@ -47,6 +52,7 @@ SPEC CHECKSUMS:
appcheck: e1ab9d4e03736f03e0401554a134d1ed502d7629
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
Expand Down
27 changes: 6 additions & 21 deletions example/lib/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import 'package:walletconnect_flutter_dapp/utils/crypto/chain_data_wrapper.dart'
import 'package:walletconnect_flutter_dapp/utils/crypto/helpers.dart';
import 'package:walletconnect_flutter_dapp/utils/dart_defines.dart';
import 'package:walletconnect_flutter_dapp/utils/string_constants.dart';
import 'package:walletconnect_flutter_dapp/widgets/event_widget.dart';

class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.swapTheme});
Expand Down Expand Up @@ -101,27 +100,13 @@ class _MyHomePageState extends State<MyHomePage> {
);
}

void _onSessionPing(SessionPing? args) => showDialog(
context: context,
builder: (BuildContext context) {
return EventWidget(
title: StringConstants.receivedPing,
content: 'Topic: ${args!.topic}',
);
},
);
void _onSessionPing(SessionPing? args) {
debugPrint('[$runtimeType] ${StringConstants.receivedPing}: $args');
}

void _onSessionEvent(SessionEvent? args) => showDialog(
context: context,
builder: (BuildContext context) {
return EventWidget(
title: StringConstants.receivedEvent,
content: 'Topic: ${args!.topic}\n'
'Event Name: ${args.name}\n'
'Event Data: ${args.data}',
);
},
);
void _onSessionEvent(SessionEvent? args) {
debugPrint('[$runtimeType] ${StringConstants.receivedEvent}: $args');
}
}

class _W3MPage extends StatefulWidget {
Expand Down
2 changes: 2 additions & 0 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import FlutterMacOS
import Foundation

import package_info_plus
import path_provider_foundation
import shared_preferences_foundation
import sqflite
import url_launcher_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
Expand Down
30 changes: 27 additions & 3 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.6"
custom_sliding_segmented_control:
dependency: transitive
description:
name: custom_sliding_segmented_control
sha256: "05b73fa48d57218bfdf806bad68a859812b216cd81fe81c6cbefde89f39eb257"
url: "https://pub.dev"
source: hosted
version: "1.8.1"
dart_style:
dependency: transitive
description:
Expand Down Expand Up @@ -600,6 +608,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.0"
package_info_plus:
dependency: transitive
description:
name: package_info_plus
sha256: "7e76fad405b3e4016cd39d08f455a4eb5199723cf594cd1b8916d47140d93017"
url: "https://pub.dev"
source: hosted
version: "4.2.0"
package_info_plus_platform_interface:
dependency: transitive
description:
name: package_info_plus_platform_interface
sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -1089,10 +1113,10 @@ packages:
dependency: "direct main"
description:
name: walletconnect_flutter_v2
sha256: "7619022ecea01adc771aaaefb4cace48bc3e8645d5e5962d4859347c6a0ea777"
sha256: "55315779dd94b5b38754c8abcccba6e8f159083e799945dc49441a20dc73cffd"
url: "https://pub.dev"
source: hosted
version: "2.1.5"
version: "2.1.8"
watcher:
dependency: transitive
description:
Expand Down Expand Up @@ -1123,7 +1147,7 @@ packages:
path: ".."
relative: true
source: path
version: "3.0.0-beta10"
version: "3.0.0-beta11"
web_socket_channel:
dependency: transitive
description:
Expand Down
1 change: 0 additions & 1 deletion lib/constants/namespaces.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart';

// TODO this is not used on package side, check if it's needed.
class NamespaceConstants {
static const Map<String, RequiredNamespace> ethereum = {
'eip155': RequiredNamespace(
Expand Down
4 changes: 2 additions & 2 deletions lib/constants/string_constants.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class StringConstants {
// Request Headers
static const X_SDK_TYPE = 'w3m';
static const X_SDK_VERSION = '3.0.0-beta10';
static const X_CORE_SDK_VERSION = 'flutter_v2.1.5';
static const X_SDK_VERSION = '3.0.0-beta11';
static const X_CORE_SDK_VERSION = 'flutter_v2.1.8';

// UI
static const String selectNetwork = 'Select Network';
Expand Down
5 changes: 4 additions & 1 deletion lib/models/grid_item.dart
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
// TODO this class shouldn't be needed
class GridItem<T> {
final String image;
final String id;
final String title;
final bool disabled;
final T data;

GridItem({
required this.image,
required this.id,
required this.title,
required this.data,
this.disabled = false,
});

GridItem<T> copyWith({
String? image,
String? id,
String? title,
bool? disabled,
T? data,
}) {
return GridItem<T>(
image: image ?? this.image,
id: id ?? this.id,
title: title ?? this.title,
disabled: disabled ?? this.disabled,
data: data ?? this.data,
);
}
Expand Down
Loading

0 comments on commit 7e55eb4

Please sign in to comment.