Skip to content

Commit

Permalink
Merge pull request #160 from WalletConnect/bugfix/bugfixes_and_improv…
Browse files Browse the repository at this point in the history
…ements

Bug fixes and improvements
  • Loading branch information
quetool authored Jul 25, 2024
2 parents 630950f + a7cf86e commit a58895d
Show file tree
Hide file tree
Showing 28 changed files with 574 additions and 313 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Publish to pub.dev

on:
workflow_dispatch:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
Expand All @@ -12,7 +11,6 @@ jobs:
permissions:
id-token: write
runs-on: ubuntu-latest

steps:
# Checkout the repo
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## 3.3.0-beta06
## 3.3.0

- One-Click Auth + SIWE implementation
- Coinbase Wallet dependency update
- Bug fixes
- Bug fixes and improvements

## 3.2.2

Expand Down
1 change: 1 addition & 0 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<package android:name="kh.com.sabay.sabaywallet"/>
<package android:name="com.tokoin.wallet"/>
<package android:name="com.walletconnect.flutterwallet"/>
<package android:name="com.walletconnect.flutterwallet.internal"/>
<package android:name="com.walletconnect.web3wallet.rnsample"/>
<package android:name="com.walletconnect.sample.wallet"/>
<package android:name="com.walletconnect.sample.wallet.internal"/>
Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
versionName=3.3.0
versionCode=67
versionCode=71
2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: a57f30d18f102dd3ce366b1d62a55ecbef2158e5

COCOAPODS: 1.13.0
COCOAPODS: 1.15.2
12 changes: 6 additions & 6 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 67;
CURRENT_PROJECT_VERSION = 70;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = W5R8AG9K22;
ENABLE_BITCODE = NO;
Expand All @@ -496,7 +496,7 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 67;
CURRENT_PROJECT_VERSION = 70;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.web3modal.flutterExample.RunnerTests;
Expand All @@ -514,7 +514,7 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 67;
CURRENT_PROJECT_VERSION = 70;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.web3modal.flutterExample.RunnerTests;
Expand All @@ -530,7 +530,7 @@
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 67;
CURRENT_PROJECT_VERSION = 70;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.web3modal.flutterExample.RunnerTests;
Expand Down Expand Up @@ -655,7 +655,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 67;
CURRENT_PROJECT_VERSION = 70;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = W5R8AG9K22;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -686,7 +686,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 67;
CURRENT_PROJECT_VERSION = 70;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = W5R8AG9K22;
ENABLE_BITCODE = NO;
Expand Down
7 changes: 3 additions & 4 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>67</string>
<string>70</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down Expand Up @@ -82,14 +82,13 @@
<string>trust</string>
<string>thorwallet</string>
<string>krakenwallet</string>
<string>cosmostation</string>
<string>coinwallet</string>
<string>mewwallet</string>
<string>metamask</string>
<string>avacus</string>
<string>argent</string>
<string>walletapp</string>
<string>wcflutterwallet</string>
<string>wcflutterwallet-production</string>
<string>wcflutterwallet-internal</string>
<string>rn-web3wallet</string>
</array>
<key>LSRequiresIPhoneOS</key>
Expand Down
21 changes: 14 additions & 7 deletions example/lib/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class _MyHomePageState extends State<MyHomePage> {
],
redirect: Redirect(
native: 'web3modalflutter://',
universal: 'https://walletconnect.com/appkit',
// universal: 'https://walletconnect.com/appkit',
),
);

Expand All @@ -74,7 +74,7 @@ class _MyHomePageState extends State<MyHomePage> {
getMessageParams: () async {
// Provide everything that is needed to construct the SIWE message
debugPrint('[SIWEConfig] getMessageParams()');
final uri = Uri.parse(_pairingMetadata.redirect!.universal!);
final uri = Uri.parse(_pairingMetadata.redirect!.native!);
return SIWEMessageArgs(
domain: uri.authority,
uri: 'https://walletconnect.com/login',
Expand All @@ -93,7 +93,7 @@ class _MyHomePageState extends State<MyHomePage> {
try {
debugPrint('[SIWEConfig] verifyMessage()');
final payload = args.toJson();
final uri = Uri.parse(_pairingMetadata.redirect!.universal!);
final uri = Uri.parse(_pairingMetadata.redirect!.native!);
final result = await _siweTestService.verifyMessage(
payload,
domain: uri.authority,
Expand Down Expand Up @@ -253,9 +253,9 @@ class _MyHomePageState extends State<MyHomePage> {
super.dispose();
}

void _onModalConnect(ModalConnect? event) {
debugPrint('[ExampleApp] _onModalConnect ${event?.toString()}');
void _onModalConnect(ModalConnect? event) async {
setState(() {});
debugPrint('[ExampleApp] _onModalConnect ${event?.session.toJson()}');
}

void _onModalUpdate(ModalConnect? event) {
Expand Down Expand Up @@ -304,8 +304,8 @@ class _MyHomePageState extends State<MyHomePage> {
}

void _onRelayClientError(EventArgs? event) {
debugPrint('[ExampleApp] _onRelayClientError ${event?.toString()}');
setState(() {});
showTextToast(text: 'Relay disconnected', context: context);
}

void _onRelayClientDisconnect(EventArgs? event) {
Expand Down Expand Up @@ -364,13 +364,20 @@ class _MyHomePageState extends State<MyHomePage> {
},
);
},
floatingActionButton: CircleAvatar(
radius: 6.0,
backgroundColor: _initialized &&
_w3mService.web3App?.core.relayClient.isConnected == true
? Colors.green
: Colors.red,
),
);
}

Future<void> _refreshData() async {
await _w3mService.reconnectRelay();
await _w3mService.loadAccountData();
setState(() {});
return;
}
}

Expand Down
1 change: 0 additions & 1 deletion example/lib/widgets/debug_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ class _DebugDrawerState extends State<DebugDrawer> with WidgetsBindingObserver {
),
onTap: () {
if (_hasUpdates) {
// TODO warn and crash!
showDialog(
context: context,
builder: (BuildContext context) {
Expand Down
2 changes: 1 addition & 1 deletion example/lib/widgets/session_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ class SessionWidgetState extends State<SessionWidget> {
[
const SizedBox(height: StyleConstants.linear8),
Text(
'Supported chains:',
'Session chains:',
style: Web3ModalTheme.getDataOf(context).textStyles.small600.copyWith(
color: Web3ModalTheme.colorsOf(context).foreground100,
),
Expand Down
10 changes: 5 additions & 5 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ packages:
dependency: transitive
description:
name: appcheck
sha256: a9e5852e8c9d14342cfa3569fc464a1d49a49eac41e3d006f5825ce54663678f
sha256: "0214f27148610690a14c0d85b414274a740955a8c352a4c719ba01d9b0f50bde"
url: "https://pub.dev"
source: hosted
version: "1.0.6"
version: "1.5.1"
archive:
dependency: transitive
description:
Expand Down Expand Up @@ -1097,10 +1097,10 @@ packages:
dependency: transitive
description:
name: walletconnect_flutter_v2
sha256: "67582d34a3ceaf8253870d624112562e6e0af730bedc7954bd4df0099c277ee4"
sha256: "4a77de8d33f5d1f6b6ae07d4d2f7bf591ddb6c4cd671bf7493100798d92fa4d3"
url: "https://pub.dev"
source: hosted
version: "2.3.0-beta04"
version: "2.3.0"
watcher:
dependency: transitive
description:
Expand Down Expand Up @@ -1131,7 +1131,7 @@ packages:
path: ".."
relative: true
source: path
version: "3.3.0-beta06"
version: "3.3.0"
web_socket_channel:
dependency: transitive
description:
Expand Down
23 changes: 9 additions & 14 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ PODS:
- CoinbaseWalletSDK/CrossPlatform (1.0.4):
- CoinbaseWalletSDK/Client
- Flutter (1.0.0)
- 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):
Expand All @@ -21,7 +18,7 @@ PODS:
- FlutterMacOS
- sqflite (0.0.3):
- Flutter
- FMDB (>= 2.7.5)
- FlutterMacOS
- url_launcher_ios (0.0.1):
- Flutter
- webview_flutter_wkwebview (0.0.1):
Expand All @@ -34,14 +31,13 @@ DEPENDENCIES:
- 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`)
- sqflite (from `.symlinks/plugins/sqflite/darwin`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)

SPEC REPOS:
trunk:
- CoinbaseWalletSDK
- FMDB

EXTERNAL SOURCES:
appcheck:
Expand All @@ -57,7 +53,7 @@ EXTERNAL SOURCES:
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
sqflite:
:path: ".symlinks/plugins/sqflite/ios"
:path: ".symlinks/plugins/sqflite/darwin"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
webview_flutter_wkwebview:
Expand All @@ -68,14 +64,13 @@ SPEC CHECKSUMS:
coinbase_wallet_sdk: 7ccd4e1a7940deba6ba9bd81beece999a2268c15
CoinbaseWalletSDK: ea1f37512bbc69ebe07416e3b29bf840f5cc3152
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
url_launcher_ios: bf5ce03e0e2088bad9cc378ea97fa0ed5b49673b
webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
webview_flutter_wkwebview: 2a23822e9039b7b1bc52e5add778e5d89ad488d1

PODFILE CHECKSUM: a57f30d18f102dd3ce366b1d62a55ecbef2158e5

COCOAPODS: 1.13.0
COCOAPODS: 1.15.2
2 changes: 1 addition & 1 deletion lib/pages/account_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class _SelectNetworkButton extends StatelessWidget {
assetColor: themeColors.background100,
),
),
title: service.selectedChain?.chainName ?? '',
title: service.selectedChain?.chainName ?? 'Unsupported network',
titleStyle: themeData.textStyles.paragraph500.copyWith(
color: themeColors.foreground100,
),
Expand Down
8 changes: 6 additions & 2 deletions lib/services/blockchain_service/blockchain_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ class BlockChainService implements IBlockChainService {
rethrow;
}
} else {
throw Exception('Failed to get request $method');
final result = jsonDecode(response.body) as Map<String, dynamic>;
final reasons = result['reasons'] as List;
final reason = reasons.first as Map<String, dynamic>;
loggerService.instance.i(
'[$runtimeType] Failed to get request $method. ${reason['description']}',
);
}
}

Expand All @@ -104,7 +109,6 @@ class BlockChainService implements IBlockChainService {
throw jsonResponse.error!;
}

// TODO to be implemented
// @override
// Future<double?> getBalance(
// String address,
Expand Down
Loading

0 comments on commit a58895d

Please sign in to comment.