From a4bb468f92bca8ed33b9b74dbffbd04a2ee17cd8 Mon Sep 17 00:00:00 2001 From: Alfreedom <00tango.bromine@icloud.com> Date: Thu, 25 Jul 2024 14:15:16 +0200 Subject: [PATCH 1/3] Fixes on sample wallet --- .../lib/dependencies/chains/common.dart | 15 ++++- .../lib/dependencies/chains/evm_service.dart | 62 +++++++++++++----- example/wallet/lib/pages/apps_page.dart | 65 ++++++++++++------- example/wallet/lib/utils/eth_utils.dart | 65 ++++++++++++------- lib/apis/core/pairing/pairing.dart | 30 +++++---- lib/apis/utils/walletconnect_utils.dart | 4 +- 6 files changed, 163 insertions(+), 78 deletions(-) diff --git a/example/wallet/lib/dependencies/chains/common.dart b/example/wallet/lib/dependencies/chains/common.dart index 1b5be74c..aad3eb46 100644 --- a/example/wallet/lib/dependencies/chains/common.dart +++ b/example/wallet/lib/dependencies/chains/common.dart @@ -28,15 +28,24 @@ class CommonMethods { } } - static Future requestApproval(String text, {String? title}) async { + static Future requestApproval( + String text, { + String? title, + String? method, + String? chainId, + String? address, + }) async { final bottomSheetService = GetIt.I(); final WCBottomSheetResult rs = (await bottomSheetService.queueBottomSheet( widget: WCRequestWidget( child: WCConnectionWidget( - title: 'Approve Request', + title: title ?? 'Approve Request', info: [ WCConnectionModel( - title: title, + title: 'Method: $method\n' + 'Chain ID: $chainId\n' + 'Address: $address\n\n' + 'Message:', elements: [ text, ], diff --git a/example/wallet/lib/dependencies/chains/evm_service.dart b/example/wallet/lib/dependencies/chains/evm_service.dart index 38ecad84..f53934e5 100644 --- a/example/wallet/lib/dependencies/chains/evm_service.dart +++ b/example/wallet/lib/dependencies/chains/evm_service.dart @@ -97,15 +97,21 @@ class EVMService { // personal_sign is handled using onSessionRequest event for demo purposes Future personalSign(String topic, dynamic parameters) async { debugPrint('[WALLET] personalSign request: $parameters'); - final pRequest = _web3Wallet.pendingRequests.getAll().last; - final data = EthUtils.getDataFromParamsList(parameters); + final SessionRequest pRequest = _web3Wallet.pendingRequests.getAll().last; + final address = EthUtils.getAddressFromSessionRequest(pRequest); + final data = EthUtils.getDataFromSessionRequest(pRequest); final message = EthUtils.getUtf8Message(data.toString()); var response = JsonRpcResponse( id: pRequest.id, jsonrpc: '2.0', ); - if (await CommonMethods.requestApproval(message)) { + if (await CommonMethods.requestApproval( + message, + method: pRequest.method, + chainId: pRequest.chainId, + address: address, + )) { try { // Load the private key final keys = GetIt.I().getKeysForChain( @@ -145,7 +151,7 @@ class EVMService { Future ethSign(String topic, dynamic parameters) async { debugPrint('[WALLET] ethSign request: $parameters'); final pRequest = _web3Wallet.pendingRequests.getAll().last; - final data = EthUtils.getDataFromParamsList(parameters); + final data = EthUtils.getDataFromSessionRequest(pRequest); final message = EthUtils.getUtf8Message(data.toString()); var response = JsonRpcResponse( id: pRequest.id, @@ -192,7 +198,7 @@ class EVMService { Future ethSignTypedData(String topic, dynamic parameters) async { debugPrint('[WALLET] ethSignTypedData request: $parameters'); final pRequest = _web3Wallet.pendingRequests.getAll().last; - final data = EthUtils.getDataFromParamsList(parameters); + final data = EthUtils.getDataFromSessionRequest(pRequest); var response = JsonRpcResponse( id: pRequest.id, jsonrpc: '2.0', @@ -234,7 +240,7 @@ class EVMService { Future ethSignTypedDataV4(String topic, dynamic parameters) async { debugPrint('[WALLET] ethSignTypedDataV4 request: $parameters'); final pRequest = _web3Wallet.pendingRequests.getAll().last; - final data = EthUtils.getDataFromParamsList(parameters); + final data = EthUtils.getDataFromSessionRequest(pRequest); var response = JsonRpcResponse( id: pRequest.id, jsonrpc: '2.0', @@ -275,15 +281,21 @@ class EVMService { Future ethSignTransaction(String topic, dynamic parameters) async { debugPrint('[WALLET] ethSignTransaction request: $parameters'); - final pRequest = _web3Wallet.pendingRequests.getAll().last; - final data = EthUtils.getTransactionFromParams(parameters); + final SessionRequest pRequest = _web3Wallet.pendingRequests.getAll().last; + + final data = EthUtils.getTransactionFromSessionRequest(pRequest); if (data == null) return; + var response = JsonRpcResponse( id: pRequest.id, jsonrpc: '2.0', ); - final transaction = await _approveTransaction(data); + final transaction = await _approveTransaction( + data, + method: pRequest.method, + chainId: pRequest.chainId, + ); if (transaction is Transaction) { try { // Load the private key @@ -329,15 +341,21 @@ class EVMService { Future ethSendTransaction(String topic, dynamic parameters) async { debugPrint('[WALLET] ethSendTransaction request: $parameters'); - final pRequest = _web3Wallet.pendingRequests.getAll().last; - final data = EthUtils.getTransactionFromParams(parameters); + final SessionRequest pRequest = _web3Wallet.pendingRequests.getAll().last; + + final data = EthUtils.getTransactionFromSessionRequest(pRequest); if (data == null) return; + var response = JsonRpcResponse( id: pRequest.id, jsonrpc: '2.0', ); - final transaction = await _approveTransaction(data); + final transaction = await _approveTransaction( + data, + method: pRequest.method, + chainId: pRequest.chainId, + ); if (transaction is Transaction) { try { // Load the private key @@ -430,7 +448,12 @@ class EVMService { // CommonMethods.goBackToDapp(topic, true); // } - Future _approveTransaction(Map tJson) async { + Future _approveTransaction( + Map tJson, { + String? title, + String? method, + String? chainId, + }) async { Transaction transaction = tJson.toTransaction(); final gasPrice = await ethClient.getGasPrice(); @@ -480,12 +503,21 @@ class EVMService { final gweiGasPrice = (transaction.gasPrice?.getInWei ?? BigInt.zero) / BigInt.from(1000000000); + const encoder = JsonEncoder.withIndent(' '); + final trx = encoder.convert(tJson); final WCBottomSheetResult rs = (await _bottomSheetService.queueBottomSheet( widget: WCRequestWidget( child: WCConnectionWidget( - title: 'Approve Transaction', + title: title ?? 'Approve Transaction', info: [ - WCConnectionModel(elements: [jsonEncode(tJson)]), + WCConnectionModel( + title: 'Method: $method\n' + 'Chain ID: $chainId\n\n' + 'Transaction:', + elements: [ + trx, + ], + ), WCConnectionModel( title: 'Gas price', elements: ['${gweiGasPrice.toStringAsFixed(2)} GWEI'], diff --git a/example/wallet/lib/pages/apps_page.dart b/example/wallet/lib/pages/apps_page.dart index d46770cf..813f1841 100644 --- a/example/wallet/lib/pages/apps_page.dart +++ b/example/wallet/lib/pages/apps_page.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:fl_toast/fl_toast.dart'; import 'package:flutter/material.dart'; import 'package:get_it/get_it.dart'; @@ -215,31 +217,50 @@ class AppsPageState extends State with GetItStateMixin { DeepLinkHandler.waiting.value = true; final Uri uriData = Uri.parse(uri!); await _web3Wallet.pair(uri: uriData); - } catch (e) { - DeepLinkHandler.waiting.value = false; - showPlatformToast( - child: Container( - padding: const EdgeInsets.all(StyleConstants.linear8), - margin: const EdgeInsets.only( - bottom: StyleConstants.magic40, - ), - decoration: BoxDecoration( - color: StyleConstants.errorColor, - borderRadius: BorderRadius.circular( - StyleConstants.linear16, - ), - ), - child: const Text( - StringConstants.invalidUri, - style: StyleConstants.bodyTextBold, - ), - ), - // ignore: use_build_context_synchronously - context: context, - ); + } on WalletConnectError catch (e) { + _showErrorDialog('${e.code}: ${e.message}'); + } on TimeoutException catch (_) { + _showErrorDialog('Time out error. Check your connection.'); } } + void _showErrorDialog(String message) { + DeepLinkHandler.waiting.value = false; + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: const Text( + 'Error', + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + ), + ), + content: Text( + message, + style: const TextStyle( + color: Colors.black, + ), + ), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: const Text( + 'Close', + style: TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + ), + ), + ) + ], + ); + }); + } + void _onListItemTap(PairingInfo pairing) { Navigator.push( context, diff --git a/example/wallet/lib/utils/eth_utils.dart b/example/wallet/lib/utils/eth_utils.dart index 1f394a0d..244c4b3a 100644 --- a/example/wallet/lib/utils/eth_utils.dart +++ b/example/wallet/lib/utils/eth_utils.dart @@ -1,6 +1,7 @@ import 'dart:convert'; import 'package:convert/convert.dart'; +import 'package:flutter/foundation.dart'; import 'package:get_it/get_it.dart'; import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart'; import 'package:walletconnect_flutter_v2_wallet/dependencies/i_web3wallet_service.dart'; @@ -22,36 +23,54 @@ class EthUtils { return maybeHex; } - static dynamic getAddressFromParamsList(dynamic params) { - return (params as List).firstWhere((p) { - try { - if (addressRegEx.hasMatch(p)) { + static String? getAddressFromSessionRequest(SessionRequest request) { + try { + final paramsList = List.from((request.params as List)); + if (request.method == 'personal_sign') { + // for `personal_sign` first value in params has to be always the message + paramsList.removeAt(0); + } + + return paramsList.firstWhere((p) { + try { EthereumAddress.fromHex(p); return true; + } catch (e) { + return false; } - return false; - } catch (e) { - return false; - } - }, orElse: () => null); + }); + } catch (e) { + debugPrint(e.toString()); + return null; + } } - static dynamic getDataFromParamsList(dynamic params) { - final address = getAddressFromParamsList(params); - final param = (params as List).firstWhere( - (p) => p != address, - orElse: () => null, - ); - return param; + static dynamic getDataFromSessionRequest(SessionRequest request) { + try { + final paramsList = List.from((request.params as List)); + if (request.method == 'personal_sign') { + return paramsList.first; + } + return paramsList.firstWhere((p) { + final address = getAddressFromSessionRequest(request); + return p != address; + }); + } catch (e) { + debugPrint(e.toString()); + return null; + } } - static Map? getTransactionFromParams(dynamic params) { - final address = getAddressFromParamsList(params); - final param = params.firstWhere( - (p) => p != address, - orElse: () => null, - ); - return param as Map?; + static Map? getTransactionFromSessionRequest( + SessionRequest request, + ) { + try { + final param = (request.params as List).first; + return param as Map; + } catch (e) { + debugPrint(e.toString()); + return null; + } } static Future decodeMessageEvent(MessageEvent event) async { diff --git a/lib/apis/core/pairing/pairing.dart b/lib/apis/core/pairing/pairing.dart index 4ea2e633..ce34b7c0 100644 --- a/lib/apis/core/pairing/pairing.dart +++ b/lib/apis/core/pairing/pairing.dart @@ -194,19 +194,25 @@ class Pairing implements IPairing { rethrow; } - await pairings.set(topic, pairing); - await core.crypto.setSymKey(symKey, overrideTopic: topic); - await core.relayClient.subscribe(topic: topic); - await core.expirer.set(topic, expiry); - - onPairingCreate.broadcast( - PairingEvent( - topic: topic, - ), - ); + try { + await pairings.set(topic, pairing); + await core.crypto.setSymKey(symKey, overrideTopic: topic); + await core.relayClient.subscribe(topic: topic).timeout( + const Duration(seconds: 15), + ); + await core.expirer.set(topic, expiry); + + onPairingCreate.broadcast( + PairingEvent( + topic: topic, + ), + ); - if (activatePairing) { - await activate(topic: topic); + if (activatePairing) { + await activate(topic: topic); + } + } catch (e) { + rethrow; } return pairing; diff --git a/lib/apis/utils/walletconnect_utils.dart b/lib/apis/utils/walletconnect_utils.dart index 06e231cf..875b2e8a 100644 --- a/lib/apis/utils/walletconnect_utils.dart +++ b/lib/apis/utils/walletconnect_utils.dart @@ -3,9 +3,7 @@ import 'dart:io'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:flutter/foundation.dart' show kIsWeb; -import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client_models.dart'; -import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart'; -import 'package:walletconnect_flutter_v2/apis/models/uri_parse_result.dart'; +import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart'; class WalletConnectUtils { static bool isExpired(int expiry) { From 8d291a90143815c9679cbc49a34930919b21c78a Mon Sep 17 00:00:00 2001 From: Alfreedom <00tango.bromine@icloud.com> Date: Thu, 25 Jul 2024 14:54:52 +0200 Subject: [PATCH 2/3] Code coverage report --- coverage/html/amber.png | Bin 0 -> 141 bytes .../auth_api/auth_client.dart.func-c.html | 75 + .../html/auth_api/auth_client.dart.func.html | 75 + .../html/auth_api/auth_client.dart.gcov.html | 270 + .../auth_api/auth_engine.dart.func-c.html | 75 + .../html/auth_api/auth_engine.dart.func.html | 75 + .../html/auth_api/auth_engine.dart.gcov.html | 513 ++ coverage/html/auth_api/index-sort-f.html | 117 + coverage/html/auth_api/index-sort-l.html | 100 + coverage/html/auth_api/index.html | 100 + coverage/html/cmd_line | 1 + coverage/html/core/core.dart.func-c.html | 75 + coverage/html/core/core.dart.func.html | 75 + coverage/html/core/core.dart.gcov.html | 255 + .../html/core/crypto/crypto.dart.func-c.html | 75 + .../html/core/crypto/crypto.dart.func.html | 75 + .../html/core/crypto/crypto.dart.gcov.html | 330 ++ .../crypto/crypto_models.dart.func-c.html | 75 + .../core/crypto/crypto_models.dart.func.html | 75 + .../core/crypto/crypto_models.dart.gcov.html | 157 + .../core/crypto/crypto_utils.dart.func-c.html | 75 + .../core/crypto/crypto_utils.dart.func.html | 75 + .../core/crypto/crypto_utils.dart.gcov.html | 323 ++ coverage/html/core/crypto/index-sort-f.html | 129 + coverage/html/core/crypto/index-sort-l.html | 109 + coverage/html/core/crypto/index.html | 109 + coverage/html/core/echo/echo.dart.func-c.html | 75 + coverage/html/core/echo/echo.dart.func.html | 75 + coverage/html/core/echo/echo.dart.gcov.html | 120 + .../core/echo/echo_client.dart.func-c.html | 75 + .../html/core/echo/echo_client.dart.func.html | 75 + .../html/core/echo/echo_client.dart.gcov.html | 119 + coverage/html/core/echo/index-sort-f.html | 117 + coverage/html/core/echo/index-sort-l.html | 100 + coverage/html/core/echo/index.html | 100 + .../echo/models/echo_body.dart.func-c.html | 75 + .../core/echo/models/echo_body.dart.func.html | 75 + .../core/echo/models/echo_body.dart.gcov.html | 93 + .../models/echo_response.dart.func-c.html | 75 + .../echo/models/echo_response.dart.func.html | 75 + .../echo/models/echo_response.dart.gcov.html | 123 + .../html/core/echo/models/index-sort-f.html | 117 + .../html/core/echo/models/index-sort-l.html | 100 + coverage/html/core/echo/models/index.html | 100 + .../core/heartbit/heartbeat.dart.func-c.html | 75 + .../core/heartbit/heartbeat.dart.func.html | 75 + .../core/heartbit/heartbeat.dart.gcov.html | 103 + coverage/html/core/heartbit/index-sort-f.html | 105 + coverage/html/core/heartbit/index-sort-l.html | 91 + coverage/html/core/heartbit/index.html | 91 + coverage/html/core/index-sort-f.html | 105 + coverage/html/core/index-sort-l.html | 91 + coverage/html/core/index.html | 91 + .../core/pairing/expirer.dart.func-c.html | 75 + .../html/core/pairing/expirer.dart.func.html | 75 + .../html/core/pairing/expirer.dart.gcov.html | 136 + coverage/html/core/pairing/index-sort-f.html | 141 + coverage/html/core/pairing/index-sort-l.html | 118 + coverage/html/core/pairing/index.html | 118 + .../pairing/json_rpc_history.dart.func-c.html | 75 + .../pairing/json_rpc_history.dart.func.html | 75 + .../pairing/json_rpc_history.dart.gcov.html | 110 + .../core/pairing/pairing.dart.func-c.html | 75 + .../html/core/pairing/pairing.dart.func.html | 75 + .../html/core/pairing/pairing.dart.gcov.html | 909 ++++ .../pairing/pairing_store.dart.func-c.html | 75 + .../core/pairing/pairing_store.dart.func.html | 75 + .../core/pairing/pairing_store.dart.gcov.html | 111 + .../html/core/pairing/utils/index-sort-f.html | 117 + .../html/core/pairing/utils/index-sort-l.html | 100 + coverage/html/core/pairing/utils/index.html | 100 + .../utils/json_rpc_utils.dart.func-c.html | 75 + .../utils/json_rpc_utils.dart.func.html | 75 + .../utils/json_rpc_utils.dart.gcov.html | 146 + .../utils/pairing_models.dart.func-c.html | 75 + .../utils/pairing_models.dart.func.html | 75 + .../utils/pairing_models.dart.gcov.html | 272 + .../html/core/relay_auth/index-sort-f.html | 117 + .../html/core/relay_auth/index-sort-l.html | 100 + coverage/html/core/relay_auth/index.html | 100 + .../relay_auth/relay_auth.dart.func-c.html | 75 + .../core/relay_auth/relay_auth.dart.func.html | 75 + .../core/relay_auth/relay_auth.dart.gcov.html | 308 ++ .../relay_auth_models.dart.func-c.html | 75 + .../relay_auth_models.dart.func.html | 75 + .../relay_auth_models.dart.gcov.html | 186 + .../i_relay_client.dart.func-c.html | 75 + .../i_relay_client.dart.func.html | 75 + .../i_relay_client.dart.gcov.html | 120 + .../html/core/relay_client/index-sort-f.html | 141 + .../html/core/relay_client/index-sort-l.html | 118 + coverage/html/core/relay_client/index.html | 118 + .../json_rpc_2/error_code.dart.func-c.html | 75 + .../json_rpc_2/error_code.dart.func.html | 75 + .../json_rpc_2/error_code.dart.gcov.html | 129 + .../relay_client/json_rpc_2/index-sort-f.html | 105 + .../relay_client/json_rpc_2/index-sort-l.html | 91 + .../core/relay_client/json_rpc_2/index.html | 91 + .../json_rpc_2/src/client.dart.func-c.html | 75 + .../json_rpc_2/src/client.dart.func.html | 75 + .../json_rpc_2/src/client.dart.gcov.html | 316 ++ .../json_rpc_2/src/exception.dart.func-c.html | 75 + .../json_rpc_2/src/exception.dart.func.html | 75 + .../json_rpc_2/src/exception.dart.gcov.html | 145 + .../json_rpc_2/src/index-sort-f.html | 165 + .../json_rpc_2/src/index-sort-l.html | 136 + .../relay_client/json_rpc_2/src/index.html | 136 + .../src/parameters.dart.func-c.html | 75 + .../json_rpc_2/src/parameters.dart.func.html | 75 + .../json_rpc_2/src/parameters.dart.gcov.html | 420 ++ .../json_rpc_2/src/peer.dart.func-c.html | 75 + .../json_rpc_2/src/peer.dart.func.html | 75 + .../json_rpc_2/src/peer.dart.gcov.html | 228 + .../json_rpc_2/src/server.dart.func-c.html | 75 + .../json_rpc_2/src/server.dart.func.html | 75 + .../json_rpc_2/src/server.dart.gcov.html | 391 ++ .../json_rpc_2/src/utils.dart.func-c.html | 75 + .../json_rpc_2/src/utils.dart.func.html | 75 + .../json_rpc_2/src/utils.dart.gcov.html | 142 + .../message_tracker.dart.func-c.html | 75 + .../message_tracker.dart.func.html | 75 + .../message_tracker.dart.gcov.html | 124 + .../relay_client.dart.func-c.html | 75 + .../relay_client/relay_client.dart.func.html | 75 + .../relay_client/relay_client.dart.gcov.html | 542 ++ .../relay_client_models.dart.func-c.html | 75 + .../relay_client_models.dart.func.html | 75 + .../relay_client_models.dart.gcov.html | 129 + .../websocket/http_client.dart.func-c.html | 75 + .../websocket/http_client.dart.func.html | 75 + .../websocket/http_client.dart.gcov.html | 100 + .../websocket/i_http_client.dart.func-c.html | 75 + .../websocket/i_http_client.dart.func.html | 75 + .../websocket/i_http_client.dart.gcov.html | 93 + .../relay_client/websocket/index-sort-f.html | 129 + .../relay_client/websocket/index-sort-l.html | 109 + .../core/relay_client/websocket/index.html | 109 + .../websocket_handler.dart.func-c.html | 75 + .../websocket_handler.dart.func.html | 75 + .../websocket_handler.dart.gcov.html | 162 + .../core/store/generic_store.dart.func-c.html | 75 + .../core/store/generic_store.dart.func.html | 75 + .../core/store/generic_store.dart.gcov.html | 243 + coverage/html/core/store/index-sort-f.html | 129 + coverage/html/core/store/index-sort-l.html | 109 + coverage/html/core/store/index.html | 109 + .../store/shared_prefs_store.dart.func-c.html | 75 + .../store/shared_prefs_store.dart.func.html | 75 + .../store/shared_prefs_store.dart.gcov.html | 232 + .../core/store/store_models.dart.func-c.html | 75 + .../core/store/store_models.dart.func.html | 75 + .../core/store/store_models.dart.gcov.html | 107 + coverage/html/core/verify/index-sort-f.html | 105 + coverage/html/core/verify/index-sort-l.html | 91 + coverage/html/core/verify/index.html | 91 + .../html/core/verify/models/index-sort-f.html | 105 + .../html/core/verify/models/index-sort-l.html | 91 + coverage/html/core/verify/models/index.html | 91 + .../models/verify_context.dart.func-c.html | 75 + .../models/verify_context.dart.func.html | 75 + .../models/verify_context.dart.gcov.html | 122 + .../html/core/verify/verify.dart.func-c.html | 75 + .../html/core/verify/verify.dart.func.html | 75 + .../html/core/verify/verify.dart.gcov.html | 132 + coverage/html/emerald.png | Bin 0 -> 141 bytes coverage/html/gcov.css | 1101 ++++ coverage/html/glass.png | Bin 0 -> 167 bytes coverage/html/index-sort-f.html | 393 ++ coverage/html/index-sort-l.html | 307 ++ coverage/html/index.html | 307 ++ .../html/models/basic_models.dart.func-c.html | 75 + .../html/models/basic_models.dart.func.html | 75 + .../html/models/basic_models.dart.gcov.html | 116 + coverage/html/models/index-sort-f.html | 153 + coverage/html/models/index-sort-l.html | 127 + coverage/html/models/index.html | 127 + .../models/json_rpc_error.dart.func-c.html | 75 + .../html/models/json_rpc_error.dart.func.html | 75 + .../html/models/json_rpc_error.dart.gcov.html | 99 + .../models/json_rpc_request.dart.func-c.html | 75 + .../models/json_rpc_request.dart.func.html | 75 + .../models/json_rpc_request.dart.gcov.html | 90 + .../models/json_rpc_response.dart.func-c.html | 75 + .../models/json_rpc_response.dart.func.html | 75 + .../models/json_rpc_response.dart.gcov.html | 91 + .../models/uri_parse_result.dart.func-c.html | 75 + .../models/uri_parse_result.dart.func.html | 75 + .../models/uri_parse_result.dart.gcov.html | 116 + coverage/html/ruby.png | Bin 0 -> 141 bytes coverage/html/sign_api/index-sort-f.html | 129 + coverage/html/sign_api/index-sort-l.html | 109 + coverage/html/sign_api/index.html | 109 + .../auth/auth_client_events.dart.func-c.html | 75 + .../auth/auth_client_events.dart.func.html | 75 + .../auth/auth_client_events.dart.gcov.html | 127 + .../auth/auth_client_models.dart.func-c.html | 75 + .../auth/auth_client_models.dart.func.html | 75 + .../auth/auth_client_models.dart.gcov.html | 238 + .../auth/common_auth_models.dart.func-c.html | 75 + .../auth/common_auth_models.dart.func.html | 75 + .../auth/common_auth_models.dart.gcov.html | 268 + .../sign_api/models/auth/index-sort-f.html | 153 + .../sign_api/models/auth/index-sort-l.html | 127 + coverage/html/sign_api/models/auth/index.html | 127 + .../auth/session_auth_events.dart.func-c.html | 75 + .../auth/session_auth_events.dart.func.html | 75 + .../auth/session_auth_events.dart.gcov.html | 143 + .../auth/session_auth_models.dart.func-c.html | 75 + .../auth/session_auth_models.dart.func.html | 75 + .../auth/session_auth_models.dart.gcov.html | 189 + .../html/sign_api/models/index-sort-f.html | 153 + .../html/sign_api/models/index-sort-l.html | 127 + coverage/html/sign_api/models/index.html | 127 + .../models/json_rpc_models.dart.func-c.html | 75 + .../models/json_rpc_models.dart.func.html | 75 + .../models/json_rpc_models.dart.gcov.html | 294 + .../models/proposal_models.dart.func-c.html | 75 + .../models/proposal_models.dart.func.html | 75 + .../models/proposal_models.dart.gcov.html | 123 + .../models/session_models.dart.func-c.html | 75 + .../models/session_models.dart.func.html | 75 + .../models/session_models.dart.gcov.html | 159 + .../sign_client_events.dart.func-c.html | 75 + .../models/sign_client_events.dart.func.html | 75 + .../models/sign_client_events.dart.gcov.html | 266 + .../sign_client_models.dart.func-c.html | 75 + .../models/sign_client_models.dart.func.html | 75 + .../models/sign_client_models.dart.gcov.html | 107 + .../html/sign_api/sessions.dart.func-c.html | 75 + .../html/sign_api/sessions.dart.func.html | 75 + .../html/sign_api/sessions.dart.gcov.html | 108 + .../sign_api/sign_client.dart.func-c.html | 75 + .../html/sign_api/sign_client.dart.func.html | 75 + .../html/sign_api/sign_client.dart.gcov.html | 748 +++ .../sign_api/sign_engine.dart.func-c.html | 75 + .../html/sign_api/sign_engine.dart.func.html | 75 + .../html/sign_api/sign_engine.dart.gcov.html | 2861 ++++++++++ .../utils/auth/address_utils.dart.func-c.html | 75 + .../utils/auth/address_utils.dart.func.html | 75 + .../utils/auth/address_utils.dart.gcov.html | 85 + .../auth/auth_api_validators.dart.func-c.html | 75 + .../auth/auth_api_validators.dart.func.html | 75 + .../auth/auth_api_validators.dart.gcov.html | 218 + .../auth/auth_signature.dart.func-c.html | 75 + .../utils/auth/auth_signature.dart.func.html | 75 + .../utils/auth/auth_signature.dart.gcov.html | 375 ++ .../utils/auth/auth_utils.dart.func-c.html | 75 + .../utils/auth/auth_utils.dart.func.html | 75 + .../utils/auth/auth_utils.dart.gcov.html | 77 + .../sign_api/utils/auth/index-sort-f.html | 153 + .../sign_api/utils/auth/index-sort-l.html | 127 + coverage/html/sign_api/utils/auth/index.html | 127 + .../utils/auth/recaps_utils.dart.func-c.html | 75 + .../utils/auth/recaps_utils.dart.func.html | 75 + .../utils/auth/recaps_utils.dart.gcov.html | 420 ++ .../utils/custom_credentials.dart.func-c.html | 75 + .../utils/custom_credentials.dart.func.html | 75 + .../utils/custom_credentials.dart.gcov.html | 152 + .../html/sign_api/utils/index-sort-f.html | 117 + .../html/sign_api/utils/index-sort-l.html | 100 + coverage/html/sign_api/utils/index.html | 100 + .../sign_api_validator_utils.dart.func-c.html | 75 + .../sign_api_validator_utils.dart.func.html | 75 + .../sign_api_validator_utils.dart.gcov.html | 396 ++ coverage/html/snow.png | Bin 0 -> 141 bytes coverage/html/updown.png | Bin 0 -> 117 bytes coverage/html/utils/errors.dart.func-c.html | 75 + coverage/html/utils/errors.dart.func.html | 75 + coverage/html/utils/errors.dart.gcov.html | 349 ++ .../html/utils/extensions.dart.func-c.html | 75 + coverage/html/utils/extensions.dart.func.html | 75 + coverage/html/utils/extensions.dart.gcov.html | 152 + coverage/html/utils/index-sort-f.html | 153 + coverage/html/utils/index-sort-l.html | 127 + coverage/html/utils/index.html | 127 + .../html/utils/log_level.dart.func-c.html | 75 + coverage/html/utils/log_level.dart.func.html | 75 + coverage/html/utils/log_level.dart.gcov.html | 102 + .../utils/namespace_utils.dart.func-c.html | 75 + .../html/utils/namespace_utils.dart.func.html | 75 + .../html/utils/namespace_utils.dart.gcov.html | 515 ++ .../walletconnect_utils.dart.func-c.html | 75 + .../utils/walletconnect_utils.dart.func.html | 75 + .../utils/walletconnect_utils.dart.gcov.html | 302 ++ coverage/html/web3app/index-sort-f.html | 105 + coverage/html/web3app/index-sort-l.html | 91 + coverage/html/web3app/index.html | 91 + .../html/web3app/web3app.dart.func-c.html | 75 + coverage/html/web3app/web3app.dart.func.html | 75 + coverage/html/web3app/web3app.dart.gcov.html | 526 ++ coverage/html/web3wallet/index-sort-f.html | 105 + coverage/html/web3wallet/index-sort-l.html | 91 + coverage/html/web3wallet/index.html | 91 + .../web3wallet/web3wallet.dart.func-c.html | 75 + .../html/web3wallet/web3wallet.dart.func.html | 75 + .../html/web3wallet/web3wallet.dart.gcov.html | 612 +++ coverage/lcov.info | 4705 +++++++++++++++++ 297 files changed, 44724 insertions(+) create mode 100644 coverage/html/amber.png create mode 100644 coverage/html/auth_api/auth_client.dart.func-c.html create mode 100644 coverage/html/auth_api/auth_client.dart.func.html create mode 100644 coverage/html/auth_api/auth_client.dart.gcov.html create mode 100644 coverage/html/auth_api/auth_engine.dart.func-c.html create mode 100644 coverage/html/auth_api/auth_engine.dart.func.html create mode 100644 coverage/html/auth_api/auth_engine.dart.gcov.html create mode 100644 coverage/html/auth_api/index-sort-f.html create mode 100644 coverage/html/auth_api/index-sort-l.html create mode 100644 coverage/html/auth_api/index.html create mode 100644 coverage/html/cmd_line create mode 100644 coverage/html/core/core.dart.func-c.html create mode 100644 coverage/html/core/core.dart.func.html create mode 100644 coverage/html/core/core.dart.gcov.html create mode 100644 coverage/html/core/crypto/crypto.dart.func-c.html create mode 100644 coverage/html/core/crypto/crypto.dart.func.html create mode 100644 coverage/html/core/crypto/crypto.dart.gcov.html create mode 100644 coverage/html/core/crypto/crypto_models.dart.func-c.html create mode 100644 coverage/html/core/crypto/crypto_models.dart.func.html create mode 100644 coverage/html/core/crypto/crypto_models.dart.gcov.html create mode 100644 coverage/html/core/crypto/crypto_utils.dart.func-c.html create mode 100644 coverage/html/core/crypto/crypto_utils.dart.func.html create mode 100644 coverage/html/core/crypto/crypto_utils.dart.gcov.html create mode 100644 coverage/html/core/crypto/index-sort-f.html create mode 100644 coverage/html/core/crypto/index-sort-l.html create mode 100644 coverage/html/core/crypto/index.html create mode 100644 coverage/html/core/echo/echo.dart.func-c.html create mode 100644 coverage/html/core/echo/echo.dart.func.html create mode 100644 coverage/html/core/echo/echo.dart.gcov.html create mode 100644 coverage/html/core/echo/echo_client.dart.func-c.html create mode 100644 coverage/html/core/echo/echo_client.dart.func.html create mode 100644 coverage/html/core/echo/echo_client.dart.gcov.html create mode 100644 coverage/html/core/echo/index-sort-f.html create mode 100644 coverage/html/core/echo/index-sort-l.html create mode 100644 coverage/html/core/echo/index.html create mode 100644 coverage/html/core/echo/models/echo_body.dart.func-c.html create mode 100644 coverage/html/core/echo/models/echo_body.dart.func.html create mode 100644 coverage/html/core/echo/models/echo_body.dart.gcov.html create mode 100644 coverage/html/core/echo/models/echo_response.dart.func-c.html create mode 100644 coverage/html/core/echo/models/echo_response.dart.func.html create mode 100644 coverage/html/core/echo/models/echo_response.dart.gcov.html create mode 100644 coverage/html/core/echo/models/index-sort-f.html create mode 100644 coverage/html/core/echo/models/index-sort-l.html create mode 100644 coverage/html/core/echo/models/index.html create mode 100644 coverage/html/core/heartbit/heartbeat.dart.func-c.html create mode 100644 coverage/html/core/heartbit/heartbeat.dart.func.html create mode 100644 coverage/html/core/heartbit/heartbeat.dart.gcov.html create mode 100644 coverage/html/core/heartbit/index-sort-f.html create mode 100644 coverage/html/core/heartbit/index-sort-l.html create mode 100644 coverage/html/core/heartbit/index.html create mode 100644 coverage/html/core/index-sort-f.html create mode 100644 coverage/html/core/index-sort-l.html create mode 100644 coverage/html/core/index.html create mode 100644 coverage/html/core/pairing/expirer.dart.func-c.html create mode 100644 coverage/html/core/pairing/expirer.dart.func.html create mode 100644 coverage/html/core/pairing/expirer.dart.gcov.html create mode 100644 coverage/html/core/pairing/index-sort-f.html create mode 100644 coverage/html/core/pairing/index-sort-l.html create mode 100644 coverage/html/core/pairing/index.html create mode 100644 coverage/html/core/pairing/json_rpc_history.dart.func-c.html create mode 100644 coverage/html/core/pairing/json_rpc_history.dart.func.html create mode 100644 coverage/html/core/pairing/json_rpc_history.dart.gcov.html create mode 100644 coverage/html/core/pairing/pairing.dart.func-c.html create mode 100644 coverage/html/core/pairing/pairing.dart.func.html create mode 100644 coverage/html/core/pairing/pairing.dart.gcov.html create mode 100644 coverage/html/core/pairing/pairing_store.dart.func-c.html create mode 100644 coverage/html/core/pairing/pairing_store.dart.func.html create mode 100644 coverage/html/core/pairing/pairing_store.dart.gcov.html create mode 100644 coverage/html/core/pairing/utils/index-sort-f.html create mode 100644 coverage/html/core/pairing/utils/index-sort-l.html create mode 100644 coverage/html/core/pairing/utils/index.html create mode 100644 coverage/html/core/pairing/utils/json_rpc_utils.dart.func-c.html create mode 100644 coverage/html/core/pairing/utils/json_rpc_utils.dart.func.html create mode 100644 coverage/html/core/pairing/utils/json_rpc_utils.dart.gcov.html create mode 100644 coverage/html/core/pairing/utils/pairing_models.dart.func-c.html create mode 100644 coverage/html/core/pairing/utils/pairing_models.dart.func.html create mode 100644 coverage/html/core/pairing/utils/pairing_models.dart.gcov.html create mode 100644 coverage/html/core/relay_auth/index-sort-f.html create mode 100644 coverage/html/core/relay_auth/index-sort-l.html create mode 100644 coverage/html/core/relay_auth/index.html create mode 100644 coverage/html/core/relay_auth/relay_auth.dart.func-c.html create mode 100644 coverage/html/core/relay_auth/relay_auth.dart.func.html create mode 100644 coverage/html/core/relay_auth/relay_auth.dart.gcov.html create mode 100644 coverage/html/core/relay_auth/relay_auth_models.dart.func-c.html create mode 100644 coverage/html/core/relay_auth/relay_auth_models.dart.func.html create mode 100644 coverage/html/core/relay_auth/relay_auth_models.dart.gcov.html create mode 100644 coverage/html/core/relay_client/i_relay_client.dart.func-c.html create mode 100644 coverage/html/core/relay_client/i_relay_client.dart.func.html create mode 100644 coverage/html/core/relay_client/i_relay_client.dart.gcov.html create mode 100644 coverage/html/core/relay_client/index-sort-f.html create mode 100644 coverage/html/core/relay_client/index-sort-l.html create mode 100644 coverage/html/core/relay_client/index.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/error_code.dart.func-c.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/error_code.dart.func.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/error_code.dart.gcov.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/index-sort-f.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/index-sort-l.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/index.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/src/client.dart.func-c.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/src/client.dart.func.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/src/client.dart.gcov.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/src/exception.dart.func-c.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/src/exception.dart.func.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/src/exception.dart.gcov.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/src/index-sort-f.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/src/index-sort-l.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/src/index.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.func-c.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.func.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.gcov.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/src/peer.dart.func-c.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/src/peer.dart.func.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/src/peer.dart.gcov.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/src/server.dart.func-c.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/src/server.dart.func.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/src/server.dart.gcov.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/src/utils.dart.func-c.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/src/utils.dart.func.html create mode 100644 coverage/html/core/relay_client/json_rpc_2/src/utils.dart.gcov.html create mode 100644 coverage/html/core/relay_client/message_tracker.dart.func-c.html create mode 100644 coverage/html/core/relay_client/message_tracker.dart.func.html create mode 100644 coverage/html/core/relay_client/message_tracker.dart.gcov.html create mode 100644 coverage/html/core/relay_client/relay_client.dart.func-c.html create mode 100644 coverage/html/core/relay_client/relay_client.dart.func.html create mode 100644 coverage/html/core/relay_client/relay_client.dart.gcov.html create mode 100644 coverage/html/core/relay_client/relay_client_models.dart.func-c.html create mode 100644 coverage/html/core/relay_client/relay_client_models.dart.func.html create mode 100644 coverage/html/core/relay_client/relay_client_models.dart.gcov.html create mode 100644 coverage/html/core/relay_client/websocket/http_client.dart.func-c.html create mode 100644 coverage/html/core/relay_client/websocket/http_client.dart.func.html create mode 100644 coverage/html/core/relay_client/websocket/http_client.dart.gcov.html create mode 100644 coverage/html/core/relay_client/websocket/i_http_client.dart.func-c.html create mode 100644 coverage/html/core/relay_client/websocket/i_http_client.dart.func.html create mode 100644 coverage/html/core/relay_client/websocket/i_http_client.dart.gcov.html create mode 100644 coverage/html/core/relay_client/websocket/index-sort-f.html create mode 100644 coverage/html/core/relay_client/websocket/index-sort-l.html create mode 100644 coverage/html/core/relay_client/websocket/index.html create mode 100644 coverage/html/core/relay_client/websocket/websocket_handler.dart.func-c.html create mode 100644 coverage/html/core/relay_client/websocket/websocket_handler.dart.func.html create mode 100644 coverage/html/core/relay_client/websocket/websocket_handler.dart.gcov.html create mode 100644 coverage/html/core/store/generic_store.dart.func-c.html create mode 100644 coverage/html/core/store/generic_store.dart.func.html create mode 100644 coverage/html/core/store/generic_store.dart.gcov.html create mode 100644 coverage/html/core/store/index-sort-f.html create mode 100644 coverage/html/core/store/index-sort-l.html create mode 100644 coverage/html/core/store/index.html create mode 100644 coverage/html/core/store/shared_prefs_store.dart.func-c.html create mode 100644 coverage/html/core/store/shared_prefs_store.dart.func.html create mode 100644 coverage/html/core/store/shared_prefs_store.dart.gcov.html create mode 100644 coverage/html/core/store/store_models.dart.func-c.html create mode 100644 coverage/html/core/store/store_models.dart.func.html create mode 100644 coverage/html/core/store/store_models.dart.gcov.html create mode 100644 coverage/html/core/verify/index-sort-f.html create mode 100644 coverage/html/core/verify/index-sort-l.html create mode 100644 coverage/html/core/verify/index.html create mode 100644 coverage/html/core/verify/models/index-sort-f.html create mode 100644 coverage/html/core/verify/models/index-sort-l.html create mode 100644 coverage/html/core/verify/models/index.html create mode 100644 coverage/html/core/verify/models/verify_context.dart.func-c.html create mode 100644 coverage/html/core/verify/models/verify_context.dart.func.html create mode 100644 coverage/html/core/verify/models/verify_context.dart.gcov.html create mode 100644 coverage/html/core/verify/verify.dart.func-c.html create mode 100644 coverage/html/core/verify/verify.dart.func.html create mode 100644 coverage/html/core/verify/verify.dart.gcov.html create mode 100644 coverage/html/emerald.png create mode 100644 coverage/html/gcov.css create mode 100644 coverage/html/glass.png create mode 100644 coverage/html/index-sort-f.html create mode 100644 coverage/html/index-sort-l.html create mode 100644 coverage/html/index.html create mode 100644 coverage/html/models/basic_models.dart.func-c.html create mode 100644 coverage/html/models/basic_models.dart.func.html create mode 100644 coverage/html/models/basic_models.dart.gcov.html create mode 100644 coverage/html/models/index-sort-f.html create mode 100644 coverage/html/models/index-sort-l.html create mode 100644 coverage/html/models/index.html create mode 100644 coverage/html/models/json_rpc_error.dart.func-c.html create mode 100644 coverage/html/models/json_rpc_error.dart.func.html create mode 100644 coverage/html/models/json_rpc_error.dart.gcov.html create mode 100644 coverage/html/models/json_rpc_request.dart.func-c.html create mode 100644 coverage/html/models/json_rpc_request.dart.func.html create mode 100644 coverage/html/models/json_rpc_request.dart.gcov.html create mode 100644 coverage/html/models/json_rpc_response.dart.func-c.html create mode 100644 coverage/html/models/json_rpc_response.dart.func.html create mode 100644 coverage/html/models/json_rpc_response.dart.gcov.html create mode 100644 coverage/html/models/uri_parse_result.dart.func-c.html create mode 100644 coverage/html/models/uri_parse_result.dart.func.html create mode 100644 coverage/html/models/uri_parse_result.dart.gcov.html create mode 100644 coverage/html/ruby.png create mode 100644 coverage/html/sign_api/index-sort-f.html create mode 100644 coverage/html/sign_api/index-sort-l.html create mode 100644 coverage/html/sign_api/index.html create mode 100644 coverage/html/sign_api/models/auth/auth_client_events.dart.func-c.html create mode 100644 coverage/html/sign_api/models/auth/auth_client_events.dart.func.html create mode 100644 coverage/html/sign_api/models/auth/auth_client_events.dart.gcov.html create mode 100644 coverage/html/sign_api/models/auth/auth_client_models.dart.func-c.html create mode 100644 coverage/html/sign_api/models/auth/auth_client_models.dart.func.html create mode 100644 coverage/html/sign_api/models/auth/auth_client_models.dart.gcov.html create mode 100644 coverage/html/sign_api/models/auth/common_auth_models.dart.func-c.html create mode 100644 coverage/html/sign_api/models/auth/common_auth_models.dart.func.html create mode 100644 coverage/html/sign_api/models/auth/common_auth_models.dart.gcov.html create mode 100644 coverage/html/sign_api/models/auth/index-sort-f.html create mode 100644 coverage/html/sign_api/models/auth/index-sort-l.html create mode 100644 coverage/html/sign_api/models/auth/index.html create mode 100644 coverage/html/sign_api/models/auth/session_auth_events.dart.func-c.html create mode 100644 coverage/html/sign_api/models/auth/session_auth_events.dart.func.html create mode 100644 coverage/html/sign_api/models/auth/session_auth_events.dart.gcov.html create mode 100644 coverage/html/sign_api/models/auth/session_auth_models.dart.func-c.html create mode 100644 coverage/html/sign_api/models/auth/session_auth_models.dart.func.html create mode 100644 coverage/html/sign_api/models/auth/session_auth_models.dart.gcov.html create mode 100644 coverage/html/sign_api/models/index-sort-f.html create mode 100644 coverage/html/sign_api/models/index-sort-l.html create mode 100644 coverage/html/sign_api/models/index.html create mode 100644 coverage/html/sign_api/models/json_rpc_models.dart.func-c.html create mode 100644 coverage/html/sign_api/models/json_rpc_models.dart.func.html create mode 100644 coverage/html/sign_api/models/json_rpc_models.dart.gcov.html create mode 100644 coverage/html/sign_api/models/proposal_models.dart.func-c.html create mode 100644 coverage/html/sign_api/models/proposal_models.dart.func.html create mode 100644 coverage/html/sign_api/models/proposal_models.dart.gcov.html create mode 100644 coverage/html/sign_api/models/session_models.dart.func-c.html create mode 100644 coverage/html/sign_api/models/session_models.dart.func.html create mode 100644 coverage/html/sign_api/models/session_models.dart.gcov.html create mode 100644 coverage/html/sign_api/models/sign_client_events.dart.func-c.html create mode 100644 coverage/html/sign_api/models/sign_client_events.dart.func.html create mode 100644 coverage/html/sign_api/models/sign_client_events.dart.gcov.html create mode 100644 coverage/html/sign_api/models/sign_client_models.dart.func-c.html create mode 100644 coverage/html/sign_api/models/sign_client_models.dart.func.html create mode 100644 coverage/html/sign_api/models/sign_client_models.dart.gcov.html create mode 100644 coverage/html/sign_api/sessions.dart.func-c.html create mode 100644 coverage/html/sign_api/sessions.dart.func.html create mode 100644 coverage/html/sign_api/sessions.dart.gcov.html create mode 100644 coverage/html/sign_api/sign_client.dart.func-c.html create mode 100644 coverage/html/sign_api/sign_client.dart.func.html create mode 100644 coverage/html/sign_api/sign_client.dart.gcov.html create mode 100644 coverage/html/sign_api/sign_engine.dart.func-c.html create mode 100644 coverage/html/sign_api/sign_engine.dart.func.html create mode 100644 coverage/html/sign_api/sign_engine.dart.gcov.html create mode 100644 coverage/html/sign_api/utils/auth/address_utils.dart.func-c.html create mode 100644 coverage/html/sign_api/utils/auth/address_utils.dart.func.html create mode 100644 coverage/html/sign_api/utils/auth/address_utils.dart.gcov.html create mode 100644 coverage/html/sign_api/utils/auth/auth_api_validators.dart.func-c.html create mode 100644 coverage/html/sign_api/utils/auth/auth_api_validators.dart.func.html create mode 100644 coverage/html/sign_api/utils/auth/auth_api_validators.dart.gcov.html create mode 100644 coverage/html/sign_api/utils/auth/auth_signature.dart.func-c.html create mode 100644 coverage/html/sign_api/utils/auth/auth_signature.dart.func.html create mode 100644 coverage/html/sign_api/utils/auth/auth_signature.dart.gcov.html create mode 100644 coverage/html/sign_api/utils/auth/auth_utils.dart.func-c.html create mode 100644 coverage/html/sign_api/utils/auth/auth_utils.dart.func.html create mode 100644 coverage/html/sign_api/utils/auth/auth_utils.dart.gcov.html create mode 100644 coverage/html/sign_api/utils/auth/index-sort-f.html create mode 100644 coverage/html/sign_api/utils/auth/index-sort-l.html create mode 100644 coverage/html/sign_api/utils/auth/index.html create mode 100644 coverage/html/sign_api/utils/auth/recaps_utils.dart.func-c.html create mode 100644 coverage/html/sign_api/utils/auth/recaps_utils.dart.func.html create mode 100644 coverage/html/sign_api/utils/auth/recaps_utils.dart.gcov.html create mode 100644 coverage/html/sign_api/utils/custom_credentials.dart.func-c.html create mode 100644 coverage/html/sign_api/utils/custom_credentials.dart.func.html create mode 100644 coverage/html/sign_api/utils/custom_credentials.dart.gcov.html create mode 100644 coverage/html/sign_api/utils/index-sort-f.html create mode 100644 coverage/html/sign_api/utils/index-sort-l.html create mode 100644 coverage/html/sign_api/utils/index.html create mode 100644 coverage/html/sign_api/utils/sign_api_validator_utils.dart.func-c.html create mode 100644 coverage/html/sign_api/utils/sign_api_validator_utils.dart.func.html create mode 100644 coverage/html/sign_api/utils/sign_api_validator_utils.dart.gcov.html create mode 100644 coverage/html/snow.png create mode 100644 coverage/html/updown.png create mode 100644 coverage/html/utils/errors.dart.func-c.html create mode 100644 coverage/html/utils/errors.dart.func.html create mode 100644 coverage/html/utils/errors.dart.gcov.html create mode 100644 coverage/html/utils/extensions.dart.func-c.html create mode 100644 coverage/html/utils/extensions.dart.func.html create mode 100644 coverage/html/utils/extensions.dart.gcov.html create mode 100644 coverage/html/utils/index-sort-f.html create mode 100644 coverage/html/utils/index-sort-l.html create mode 100644 coverage/html/utils/index.html create mode 100644 coverage/html/utils/log_level.dart.func-c.html create mode 100644 coverage/html/utils/log_level.dart.func.html create mode 100644 coverage/html/utils/log_level.dart.gcov.html create mode 100644 coverage/html/utils/namespace_utils.dart.func-c.html create mode 100644 coverage/html/utils/namespace_utils.dart.func.html create mode 100644 coverage/html/utils/namespace_utils.dart.gcov.html create mode 100644 coverage/html/utils/walletconnect_utils.dart.func-c.html create mode 100644 coverage/html/utils/walletconnect_utils.dart.func.html create mode 100644 coverage/html/utils/walletconnect_utils.dart.gcov.html create mode 100644 coverage/html/web3app/index-sort-f.html create mode 100644 coverage/html/web3app/index-sort-l.html create mode 100644 coverage/html/web3app/index.html create mode 100644 coverage/html/web3app/web3app.dart.func-c.html create mode 100644 coverage/html/web3app/web3app.dart.func.html create mode 100644 coverage/html/web3app/web3app.dart.gcov.html create mode 100644 coverage/html/web3wallet/index-sort-f.html create mode 100644 coverage/html/web3wallet/index-sort-l.html create mode 100644 coverage/html/web3wallet/index.html create mode 100644 coverage/html/web3wallet/web3wallet.dart.func-c.html create mode 100644 coverage/html/web3wallet/web3wallet.dart.func.html create mode 100644 coverage/html/web3wallet/web3wallet.dart.gcov.html create mode 100644 coverage/lcov.info diff --git a/coverage/html/amber.png b/coverage/html/amber.png new file mode 100644 index 0000000000000000000000000000000000000000..2cab170d8359081983a4e343848dfe06bc490f12 GIT binary patch literal 141 zcmeAS@N?(olHy`uVBq!ia0vp^j3CU&3?x-=hn)ga>?NMQuI!iC1^G2tW}LqE04T&+ z;1OBOz`!j8!i<;h*8KqrvZOouIx;Y9?C1WI$O`1M1^9%x{(levWG + + + + + + LCOV - lcov.info - auth_api/auth_client.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - auth_api - auth_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:46.3 %5425
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/auth_api/auth_client.dart.func.html b/coverage/html/auth_api/auth_client.dart.func.html new file mode 100644 index 00000000..5e7a70a6 --- /dev/null +++ b/coverage/html/auth_api/auth_client.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - auth_api/auth_client.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - auth_api - auth_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:46.3 %5425
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/auth_api/auth_client.dart.gcov.html b/coverage/html/auth_api/auth_client.dart.gcov.html new file mode 100644 index 00000000..6bb4fd81 --- /dev/null +++ b/coverage/html/auth_api/auth_client.dart.gcov.html @@ -0,0 +1,270 @@ + + + + + + + LCOV - lcov.info - auth_api/auth_client.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - auth_api - auth_client.dartCoverageTotalHit
Test:lcov.infoLines:46.3 %5425
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:event/event.dart';
+       2              : import 'package:walletconnect_flutter_v2/apis/auth_api/auth_engine.dart';
+       3              : import 'package:walletconnect_flutter_v2/apis/auth_api/i_auth_client.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/auth_api/i_auth_engine.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/auth_client_events.dart';
+       6              : import 'package:walletconnect_flutter_v2/apis/core/core.dart';
+       7              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/http_client.dart';
+       8              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/i_http_client.dart';
+       9              : import 'package:walletconnect_flutter_v2/apis/core/store/generic_store.dart';
+      10              : import 'package:walletconnect_flutter_v2/apis/core/store/i_generic_store.dart';
+      11              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/auth_client_models.dart';
+      12              : import 'package:walletconnect_flutter_v2/apis/core/i_core.dart';
+      13              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
+      14              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/pairing_models.dart';
+      15              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/common_auth_models.dart';
+      16              : import 'package:walletconnect_flutter_v2/apis/utils/constants.dart';
+      17              : import 'package:walletconnect_flutter_v2/apis/utils/log_level.dart';
+      18              : 
+      19              : class AuthClient implements IAuthClient {
+      20              :   bool _initialized = false;
+      21              : 
+      22            0 :   @override
+      23              :   String get protocol => 'wc';
+      24              : 
+      25            0 :   @override
+      26              :   int get version => 2;
+      27              : 
+      28            0 :   @override
+      29            0 :   Event<AuthRequest> get onAuthRequest => engine.onAuthRequest;
+      30            1 :   @override
+      31            2 :   Event<AuthResponse> get onAuthResponse => engine.onAuthResponse;
+      32              : 
+      33            1 :   @override
+      34            2 :   ICore get core => engine.core;
+      35            0 :   @override
+      36            0 :   PairingMetadata get metadata => engine.metadata;
+      37            0 :   @override
+      38            0 :   IGenericStore<AuthPublicKey> get authKeys => engine.authKeys;
+      39            0 :   @override
+      40            0 :   IGenericStore<String> get pairingTopics => engine.pairingTopics;
+      41            0 :   @override
+      42            0 :   IGenericStore<PendingAuthRequest> get authRequests => engine.authRequests;
+      43            0 :   @override
+      44            0 :   IGenericStore<StoredCacao> get completeRequests => engine.completeRequests;
+      45              : 
+      46              :   @override
+      47              :   late IAuthEngine engine;
+      48              : 
+      49            0 :   static Future<AuthClient> createInstance({
+      50              :     required String projectId,
+      51              :     String relayUrl = WalletConnectConstants.DEFAULT_RELAY_URL,
+      52              :     required PairingMetadata metadata,
+      53              :     bool memoryStore = false,
+      54              :     IHttpClient httpClient = const HttpWrapper(),
+      55              :     LogLevel logLevel = LogLevel.nothing,
+      56              :   }) async {
+      57            0 :     final client = AuthClient(
+      58            0 :       core: Core(
+      59              :         projectId: projectId,
+      60              :         relayUrl: relayUrl,
+      61              :         memoryStore: memoryStore,
+      62              :         httpClient: httpClient,
+      63              :         logLevel: logLevel,
+      64              :       ),
+      65              :       metadata: metadata,
+      66              :     );
+      67            0 :     await client.init();
+      68              : 
+      69              :     return client;
+      70              :   }
+      71              : 
+      72            1 :   AuthClient({
+      73              :     required ICore core,
+      74              :     required PairingMetadata metadata,
+      75              :   }) {
+      76            2 :     engine = AuthEngine(
+      77              :       core: core,
+      78              :       metadata: metadata,
+      79            1 :       authKeys: GenericStore(
+      80            1 :         storage: core.storage,
+      81              :         context: StoreVersions.CONTEXT_AUTH_KEYS,
+      82              :         version: StoreVersions.VERSION_AUTH_KEYS,
+      83            0 :         fromJson: (dynamic value) {
+      84            0 :           return AuthPublicKey.fromJson(value);
+      85              :         },
+      86              :       ),
+      87            1 :       pairingTopics: GenericStore(
+      88            1 :         storage: core.storage,
+      89              :         context: StoreVersions.CONTEXT_PAIRING_TOPICS,
+      90              :         version: StoreVersions.VERSION_PAIRING_TOPICS,
+      91            0 :         fromJson: (dynamic value) {
+      92              :           return value as String;
+      93              :         },
+      94              :       ),
+      95            1 :       authRequests: GenericStore(
+      96            1 :         storage: core.storage,
+      97              :         context: StoreVersions.CONTEXT_AUTH_REQUESTS,
+      98              :         version: StoreVersions.VERSION_AUTH_REQUESTS,
+      99            0 :         fromJson: (dynamic value) {
+     100            0 :           return PendingAuthRequest.fromJson(value);
+     101              :         },
+     102              :       ),
+     103            1 :       completeRequests: GenericStore(
+     104            1 :         storage: core.storage,
+     105              :         context: StoreVersions.CONTEXT_COMPLETE_REQUESTS,
+     106              :         version: StoreVersions.VERSION_COMPLETE_REQUESTS,
+     107            0 :         fromJson: (dynamic value) {
+     108            0 :           return StoredCacao.fromJson(value);
+     109              :         },
+     110              :       ),
+     111              :     );
+     112              :   }
+     113              : 
+     114            1 :   @override
+     115              :   Future<void> init() async {
+     116            1 :     if (_initialized) {
+     117              :       return;
+     118              :     }
+     119              : 
+     120            2 :     await core.start();
+     121            2 :     await engine.init();
+     122              : 
+     123            1 :     _initialized = true;
+     124              :   }
+     125              : 
+     126            1 :   @override
+     127              :   Future<AuthRequestResponse> request({
+     128              :     required AuthRequestParams params,
+     129              :     String? pairingTopic,
+     130              :     List<List<String>>? methods = AuthEngine.DEFAULT_METHODS,
+     131              :   }) async {
+     132              :     try {
+     133            2 :       return engine.requestAuth(
+     134              :         params: params,
+     135              :         pairingTopic: pairingTopic,
+     136              :         methods: methods,
+     137              :       );
+     138              :     } catch (e) {
+     139              :       rethrow;
+     140              :     }
+     141              :   }
+     142              : 
+     143            0 :   @override
+     144              :   Future<void> respond({
+     145              :     required int id,
+     146              :     required String iss,
+     147              :     CacaoSignature? signature,
+     148              :     WalletConnectError? error,
+     149              :   }) async {
+     150              :     try {
+     151            0 :       return engine.respondAuthRequest(
+     152              :         id: id,
+     153              :         iss: iss,
+     154              :         signature: signature,
+     155              :         error: error,
+     156              :       );
+     157              :     } catch (e) {
+     158              :       rethrow;
+     159              :     }
+     160              :   }
+     161              : 
+     162            0 :   @override
+     163              :   Map<int, PendingAuthRequest> getPendingRequests() {
+     164              :     try {
+     165            0 :       return engine.getPendingAuthRequests();
+     166              :     } catch (e) {
+     167              :       rethrow;
+     168              :     }
+     169              :   }
+     170              : 
+     171            1 :   @override
+     172              :   Map<int, StoredCacao> getCompletedRequestsForPairing({
+     173              :     required String pairingTopic,
+     174              :   }) {
+     175              :     try {
+     176            2 :       return engine.getCompletedRequestsForPairing(
+     177              :         pairingTopic: pairingTopic,
+     178              :       );
+     179              :     } catch (e) {
+     180              :       rethrow;
+     181              :     }
+     182              :   }
+     183              : 
+     184            1 :   @override
+     185              :   String formatMessage({
+     186              :     required String iss,
+     187              :     required CacaoRequestPayload cacaoPayload,
+     188              :   }) {
+     189              :     try {
+     190            2 :       return engine.formatAuthMessage(
+     191              :         iss: iss,
+     192              :         cacaoPayload: cacaoPayload,
+     193              :       );
+     194              :     } catch (e) {
+     195              :       rethrow;
+     196              :     }
+     197              :   }
+     198              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/auth_api/auth_engine.dart.func-c.html b/coverage/html/auth_api/auth_engine.dart.func-c.html new file mode 100644 index 00000000..05177775 --- /dev/null +++ b/coverage/html/auth_api/auth_engine.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - auth_api/auth_engine.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - auth_api - auth_engine.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:87.0 %138120
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/auth_api/auth_engine.dart.func.html b/coverage/html/auth_api/auth_engine.dart.func.html new file mode 100644 index 00000000..6fb8d3f6 --- /dev/null +++ b/coverage/html/auth_api/auth_engine.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - auth_api/auth_engine.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - auth_api - auth_engine.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:87.0 %138120
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/auth_api/auth_engine.dart.gcov.html b/coverage/html/auth_api/auth_engine.dart.gcov.html new file mode 100644 index 00000000..84453b82 --- /dev/null +++ b/coverage/html/auth_api/auth_engine.dart.gcov.html @@ -0,0 +1,513 @@ + + + + + + + LCOV - lcov.info - auth_api/auth_engine.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - auth_api - auth_engine.dartCoverageTotalHit
Test:lcov.infoLines:87.0 %138120
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:async';
+       2              : 
+       3              : import 'package:event/event.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/auth_api/i_auth_engine.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/auth_client_events.dart';
+       6              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/auth_client_models.dart';
+       7              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/common_auth_models.dart';
+       8              : import 'package:walletconnect_flutter_v2/apis/core/store/i_generic_store.dart';
+       9              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/json_rpc_models.dart';
+      10              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/auth/address_utils.dart';
+      11              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/auth/auth_api_validators.dart';
+      12              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/auth/auth_constants.dart';
+      13              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/auth/auth_signature.dart';
+      14              : import 'package:walletconnect_flutter_v2/apis/core/crypto/crypto_models.dart';
+      15              : import 'package:walletconnect_flutter_v2/apis/core/i_core.dart';
+      16              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/pairing_models.dart';
+      17              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/json_rpc_utils.dart';
+      18              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
+      19              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_error.dart';
+      20              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_request.dart';
+      21              : import 'package:walletconnect_flutter_v2/apis/utils/constants.dart';
+      22              : import 'package:walletconnect_flutter_v2/apis/utils/errors.dart';
+      23              : import 'package:walletconnect_flutter_v2/apis/utils/method_constants.dart';
+      24              : 
+      25              : class AuthEngine implements IAuthEngine {
+      26              :   static const List<List<String>> DEFAULT_METHODS = [
+      27              :     [
+      28              :       MethodConstants.WC_AUTH_REQUEST,
+      29              :     ]
+      30              :   ];
+      31              : 
+      32              :   bool _initialized = false;
+      33              : 
+      34              :   @override
+      35              :   final Event<AuthRequest> onAuthRequest = Event();
+      36              :   @override
+      37              :   final Event<AuthResponse> onAuthResponse = Event();
+      38              : 
+      39              :   @override
+      40              :   final ICore core;
+      41              :   @override
+      42              :   final PairingMetadata metadata;
+      43              :   @override
+      44              :   late IGenericStore<AuthPublicKey> authKeys;
+      45              :   @override
+      46              :   late IGenericStore<String> pairingTopics;
+      47              :   @override
+      48              :   late IGenericStore<PendingAuthRequest> authRequests;
+      49              :   @override
+      50              :   late IGenericStore<StoredCacao> completeRequests;
+      51              : 
+      52              :   List<AuthRequestCompleter> pendingAuthRequests = [];
+      53              : 
+      54            3 :   AuthEngine({
+      55              :     required this.core,
+      56              :     required this.metadata,
+      57              :     required this.authKeys,
+      58              :     required this.pairingTopics,
+      59              :     required this.authRequests,
+      60              :     required this.completeRequests,
+      61              :   });
+      62              : 
+      63            3 :   @override
+      64              :   Future<void> init() async {
+      65            3 :     if (_initialized) {
+      66              :       return;
+      67              :     }
+      68              : 
+      69            9 :     await core.pairing.init();
+      70            6 :     await authKeys.init();
+      71            6 :     await pairingTopics.init();
+      72            6 :     await authRequests.init();
+      73            6 :     await completeRequests.init();
+      74              : 
+      75            3 :     _registerRelayClientFunctions();
+      76              : 
+      77            3 :     _initialized = true;
+      78              :   }
+      79              : 
+      80            2 :   @override
+      81              :   Future<AuthRequestResponse> requestAuth({
+      82              :     required AuthRequestParams params,
+      83              :     String? pairingTopic,
+      84              :     List<List<String>>? methods = DEFAULT_METHODS,
+      85              :   }) async {
+      86            2 :     _checkInitialized();
+      87              : 
+      88            2 :     AuthApiValidators.isValidRequest(params);
+      89              :     String? pTopic = pairingTopic;
+      90              :     Uri? uri;
+      91              : 
+      92              :     if (pTopic == null) {
+      93            3 :       final CreateResponse newTopicAndUri = await core.pairing.create(
+      94              :         methods: methods,
+      95              :       );
+      96            1 :       pTopic = newTopicAndUri.topic;
+      97            1 :       uri = newTopicAndUri.uri;
+      98              :     } else {
+      99            6 :       core.pairing.isValidPairingTopic(topic: pTopic);
+     100              :     }
+     101              : 
+     102            6 :     final publicKey = await core.crypto.generateKeyPair();
+     103              :     // print('requestAuth, publicKey: $publicKey');
+     104            8 :     final String responseTopic = core.crypto.getUtils().hashKey(publicKey);
+     105            2 :     final int id = JsonRpcUtils.payloadId();
+     106              : 
+     107            2 :     WcAuthRequestRequest request = WcAuthRequestRequest(
+     108            2 :       payloadParams: AuthPayloadParams.fromRequestParams(
+     109              :         params,
+     110              :       ),
+     111            2 :       requester: ConnectionMetadata(
+     112              :         publicKey: publicKey,
+     113            2 :         metadata: metadata,
+     114              :       ),
+     115              :     );
+     116              : 
+     117            2 :     final int expiry = params.expiry ?? WalletConnectConstants.FIVE_MINUTES;
+     118              : 
+     119            4 :     await authKeys.set(
+     120              :       AuthConstants.AUTH_CLIENT_PUBLIC_KEY_NAME,
+     121            2 :       AuthPublicKey(publicKey: publicKey),
+     122              :     );
+     123              : 
+     124            4 :     await pairingTopics.set(
+     125              :       responseTopic,
+     126              :       pTopic,
+     127              :     );
+     128              : 
+     129              :     // Set the one time use receiver public key for decoding the Type 1 envelope
+     130            6 :     await core.pairing.setReceiverPublicKey(
+     131              :       topic: responseTopic,
+     132              :       publicKey: publicKey,
+     133              :       expiry: expiry,
+     134              :     );
+     135              : 
+     136            2 :     Completer<AuthResponse> completer = Completer();
+     137              : 
+     138            2 :     _requestAuthResponseHandler(
+     139              :       pairingTopic: pTopic,
+     140              :       responseTopic: responseTopic,
+     141              :       request: request,
+     142              :       id: id,
+     143              :       expiry: expiry,
+     144              :       completer: completer,
+     145              :     );
+     146              : 
+     147            2 :     return AuthRequestResponse(
+     148              :       id: id,
+     149              :       pairingTopic: pTopic,
+     150              :       completer: completer,
+     151              :       uri: uri,
+     152              :     );
+     153              :   }
+     154              : 
+     155            2 :   Future<void> _requestAuthResponseHandler({
+     156              :     required String pairingTopic,
+     157              :     required String responseTopic,
+     158              :     required WcAuthRequestRequest request,
+     159              :     required int id,
+     160              :     required int expiry,
+     161              :     required Completer<AuthResponse> completer,
+     162              :   }) async {
+     163              :     Map<String, dynamic>? resp;
+     164              : 
+     165              :     // Subscribe to the responseTopic because we expect the response to use this topic
+     166              :     // print('got here');
+     167            6 :     await core.relayClient.subscribe(topic: responseTopic);
+     168              : 
+     169              :     try {
+     170            6 :       resp = await core.pairing.sendRequest(
+     171              :         pairingTopic,
+     172              :         MethodConstants.WC_AUTH_REQUEST,
+     173            2 :         request.toJson(),
+     174              :         id: id,
+     175              :         ttl: expiry,
+     176              :       );
+     177            0 :     } on JsonRpcError catch (e) {
+     178            0 :       final resp = AuthResponse(
+     179              :         id: id,
+     180              :         topic: responseTopic,
+     181              :         jsonRpcError: e,
+     182              :       );
+     183            0 :       onAuthResponse.broadcast(resp);
+     184            0 :       completer.complete(resp);
+     185              :       return;
+     186              :     }
+     187              : 
+     188            6 :     await core.pairing.activate(topic: pairingTopic);
+     189              : 
+     190            2 :     final Cacao cacao = Cacao.fromJson(resp!);
+     191            2 :     final CacaoSignature sig = cacao.s;
+     192            2 :     final CacaoPayload payload = cacao.p;
+     193            4 :     await completeRequests.set(
+     194            2 :       id.toString(),
+     195            2 :       StoredCacao.fromCacao(
+     196              :         id: id,
+     197              :         pairingTopic: pairingTopic,
+     198              :         cacao: cacao,
+     199              :       ),
+     200              :     );
+     201              : 
+     202            2 :     final String reconstructed = formatAuthMessage(
+     203            2 :       iss: payload.iss,
+     204            2 :       cacaoPayload: CacaoRequestPayload.fromCacaoPayload(payload),
+     205              :     );
+     206              : 
+     207            4 :     final String walletAddress = AddressUtils.getDidAddress(payload.iss);
+     208            4 :     final String chainId = AddressUtils.getDidChainId(payload.iss);
+     209              : 
+     210            2 :     if (walletAddress.isEmpty) {
+     211            0 :       throw Errors.getSdkError(
+     212              :         Errors.MISSING_OR_INVALID,
+     213              :         context: 'authResponse walletAddress is empty',
+     214              :       );
+     215              :     }
+     216            2 :     if (chainId.isEmpty) {
+     217            0 :       throw Errors.getSdkError(
+     218              :         Errors.MISSING_OR_INVALID,
+     219              :         context: 'authResponse chainId is empty',
+     220              :       );
+     221              :     }
+     222              : 
+     223            2 :     final bool isValid = await AuthSignature.verifySignature(
+     224              :       walletAddress,
+     225              :       reconstructed,
+     226              :       sig,
+     227              :       chainId,
+     228            4 :       core.projectId,
+     229              :     );
+     230              : 
+     231              :     if (!isValid) {
+     232            0 :       final resp = AuthResponse(
+     233              :         id: id,
+     234              :         topic: responseTopic,
+     235              :         error: const WalletConnectError(
+     236              :           code: -1,
+     237              :           message: 'Invalid signature',
+     238              :         ),
+     239              :       );
+     240            0 :       onAuthResponse.broadcast(resp);
+     241            0 :       completer.complete(resp);
+     242              :     } else {
+     243            2 :       final resp = AuthResponse(
+     244              :         id: id,
+     245              :         topic: responseTopic,
+     246              :         result: cacao,
+     247              :       );
+     248            4 :       onAuthResponse.broadcast(resp);
+     249            2 :       completer.complete(resp);
+     250              :     }
+     251              :   }
+     252              : 
+     253            2 :   @override
+     254              :   Future<void> respondAuthRequest({
+     255              :     required int id,
+     256              :     required String iss,
+     257              :     CacaoSignature? signature,
+     258              :     WalletConnectError? error,
+     259              :   }) async {
+     260            2 :     _checkInitialized();
+     261              : 
+     262            2 :     Map<int, PendingAuthRequest> pendingRequests = getPendingAuthRequests();
+     263            2 :     AuthApiValidators.isValidRespond(
+     264              :       id: id,
+     265              :       pendingRequests: pendingRequests,
+     266              :       signature: signature,
+     267              :       error: error,
+     268              :     );
+     269              : 
+     270            2 :     final PendingAuthRequest pendingRequest = pendingRequests[id]!;
+     271            4 :     final String receiverPublicKey = pendingRequest.metadata.publicKey;
+     272            6 :     final String senderPublicKey = await core.crypto.generateKeyPair();
+     273            8 :     final String responseTopic = core.crypto.getUtils().hashKey(
+     274              :           receiverPublicKey,
+     275              :         );
+     276            2 :     final EncodeOptions encodeOpts = EncodeOptions(
+     277              :       type: EncodeOptions.TYPE_1,
+     278              :       receiverPublicKey: receiverPublicKey,
+     279              :       senderPublicKey: senderPublicKey,
+     280              :     );
+     281              : 
+     282              :     if (error != null) {
+     283            0 :       await core.pairing.sendError(
+     284              :         id,
+     285              :         responseTopic,
+     286              :         MethodConstants.WC_AUTH_REQUEST,
+     287            0 :         JsonRpcError.serverError(error.message),
+     288              :         encodeOptions: encodeOpts,
+     289              :       );
+     290              :     } else {
+     291            2 :       final Cacao cacao = Cacao(
+     292              :         h: const CacaoHeader(),
+     293            2 :         p: CacaoPayload.fromRequestPayload(
+     294              :           issuer: iss,
+     295            2 :           payload: pendingRequest.cacaoPayload,
+     296              :         ),
+     297              :         s: signature!,
+     298              :       );
+     299              : 
+     300              :       // print('auth res id: $id');
+     301            6 :       await core.pairing.sendResult(
+     302              :         id,
+     303              :         responseTopic,
+     304              :         MethodConstants.WC_AUTH_REQUEST,
+     305            2 :         cacao.toJson(),
+     306              :         encodeOptions: encodeOpts,
+     307              :       );
+     308              : 
+     309            6 :       await authRequests.delete(id.toString());
+     310              : 
+     311            4 :       await completeRequests.set(
+     312            2 :         id.toString(),
+     313            2 :         StoredCacao.fromCacao(
+     314              :           id: id,
+     315            2 :           pairingTopic: pendingRequest.pairingTopic,
+     316              :           cacao: cacao,
+     317              :         ),
+     318              :       );
+     319              :     }
+     320              :   }
+     321              : 
+     322            2 :   @override
+     323              :   Map<int, PendingAuthRequest> getPendingAuthRequests() {
+     324            2 :     Map<int, PendingAuthRequest> pendingRequests = {};
+     325            8 :     authRequests.getAll().forEach((key) {
+     326            4 :       pendingRequests[key.id] = key;
+     327              :     });
+     328              :     return pendingRequests;
+     329              :   }
+     330              : 
+     331            1 :   @override
+     332              :   Map<int, StoredCacao> getCompletedRequestsForPairing({
+     333              :     required String pairingTopic,
+     334              :   }) {
+     335            1 :     Map<int, StoredCacao> completedRequests = {};
+     336            1 :     completeRequests
+     337            1 :         .getAll()
+     338            1 :         .where(
+     339            3 :           (e) => e.pairingTopic == pairingTopic,
+     340              :         )
+     341            2 :         .forEach((key) {
+     342            2 :       completedRequests[key.id] = key;
+     343              :     });
+     344              :     return completedRequests;
+     345              :   }
+     346              : 
+     347            2 :   @override
+     348              :   String formatAuthMessage({
+     349              :     required String iss,
+     350              :     required CacaoRequestPayload cacaoPayload,
+     351              :   }) {
+     352              :     final header =
+     353            4 :         '${cacaoPayload.domain} wants you to sign in with your Ethereum account:';
+     354            2 :     final walletAddress = AddressUtils.getDidAddress(iss);
+     355            4 :     final uri = 'URI: ${cacaoPayload.aud}';
+     356            4 :     final version = 'Version: ${cacaoPayload.version}';
+     357            4 :     final chainId = 'Chain ID: ${AddressUtils.getDidChainId(iss)}';
+     358            4 :     final nonce = 'Nonce: ${cacaoPayload.nonce}';
+     359            4 :     final issuedAt = 'Issued At: ${cacaoPayload.iat}';
+     360            2 :     final resources = cacaoPayload.resources != null &&
+     361            2 :             cacaoPayload.resources!.isNotEmpty
+     362            5 :         ? 'Resources:\n${cacaoPayload.resources!.map((resource) => '- $resource').join('\n')}'
+     363            1 :         : null;
+     364              : 
+     365            2 :     final message = [
+     366              :       header,
+     367              :       walletAddress,
+     368              :       '',
+     369            2 :       cacaoPayload.statement,
+     370              :       '',
+     371              :       uri,
+     372              :       version,
+     373              :       chainId,
+     374              :       nonce,
+     375              :       issuedAt,
+     376              :       resources,
+     377            6 :     ].where((element) => element != null).join('\n');
+     378              : 
+     379              :     return message;
+     380              :   }
+     381              : 
+     382              :   /// ---- PRIVATE HELPERS ---- ///
+     383              : 
+     384            2 :   void _checkInitialized() {
+     385            2 :     if (!_initialized) {
+     386            0 :       throw Errors.getInternalError(Errors.NOT_INITIALIZED);
+     387              :     }
+     388              :   }
+     389              : 
+     390              :   /// ---- Relay Events ---- ///
+     391              : 
+     392            3 :   void _registerRelayClientFunctions() {
+     393            9 :     core.pairing.register(
+     394              :       method: MethodConstants.WC_AUTH_REQUEST,
+     395            3 :       function: _onAuthRequest,
+     396              :       type: ProtocolType.auth,
+     397              :     );
+     398              :   }
+     399              : 
+     400            2 :   void _onAuthRequest(
+     401              :     String topic,
+     402              :     JsonRpcRequest payload,
+     403              :   ) async {
+     404              :     try {
+     405            4 :       final request = WcAuthRequestRequest.fromJson(payload.params);
+     406              : 
+     407              :       final CacaoRequestPayload cacaoPayload =
+     408            2 :           CacaoRequestPayload.fromPayloadParams(
+     409            2 :         request.payloadParams,
+     410              :       );
+     411              : 
+     412            4 :       authRequests.set(
+     413            4 :         payload.id.toString(),
+     414            2 :         PendingAuthRequest(
+     415            2 :           id: payload.id,
+     416              :           pairingTopic: topic,
+     417            2 :           metadata: request.requester,
+     418              :           cacaoPayload: cacaoPayload,
+     419              :         ),
+     420              :       );
+     421              : 
+     422            4 :       onAuthRequest.broadcast(
+     423            2 :         AuthRequest(
+     424            2 :           id: payload.id,
+     425              :           topic: topic,
+     426            2 :           requester: request.requester,
+     427            2 :           payloadParams: request.payloadParams,
+     428              :         ),
+     429              :       );
+     430            0 :     } on WalletConnectError catch (err) {
+     431            0 :       await core.pairing.sendError(
+     432            0 :         payload.id,
+     433              :         topic,
+     434            0 :         payload.method,
+     435            0 :         JsonRpcError.invalidParams(
+     436            0 :           err.message,
+     437              :         ),
+     438              :       );
+     439              :     }
+     440              :   }
+     441              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/auth_api/index-sort-f.html b/coverage/html/auth_api/index-sort-f.html new file mode 100644 index 00000000..283b5b22 --- /dev/null +++ b/coverage/html/auth_api/index-sort-f.html @@ -0,0 +1,117 @@ + + + + + + + LCOV - lcov.info - auth_api + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - auth_apiCoverageTotalHit
Test:lcov.infoLines:75.5 %192145
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
auth_client.dart +
46.3%46.3%
+
46.3 %5425-
auth_engine.dart +
87.0%87.0%
+
87.0 %138120-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/auth_api/index-sort-l.html b/coverage/html/auth_api/index-sort-l.html new file mode 100644 index 00000000..49efc2e8 --- /dev/null +++ b/coverage/html/auth_api/index-sort-l.html @@ -0,0 +1,100 @@ + + + + + + + LCOV - lcov.info - auth_api + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - auth_apiCoverageTotalHit
Test:lcov.infoLines:75.5 %192145
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
auth_client.dart +
46.3%46.3%
+
46.3 %5425
auth_engine.dart +
87.0%87.0%
+
87.0 %138120
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/auth_api/index.html b/coverage/html/auth_api/index.html new file mode 100644 index 00000000..279fd510 --- /dev/null +++ b/coverage/html/auth_api/index.html @@ -0,0 +1,100 @@ + + + + + + + LCOV - lcov.info - auth_api + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - auth_apiCoverageTotalHit
Test:lcov.infoLines:75.5 %192145
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
auth_client.dart +
46.3%46.3%
+
46.3 %5425
auth_engine.dart +
87.0%87.0%
+
87.0 %138120
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/cmd_line b/coverage/html/cmd_line new file mode 100644 index 00000000..fff562af --- /dev/null +++ b/coverage/html/cmd_line @@ -0,0 +1 @@ +genhtml --rc genhtml_hi_limit=75 --rc genhtml_med_limit=50 -o coverage/html coverage/lcov.info --no-function-coverage diff --git a/coverage/html/core/core.dart.func-c.html b/coverage/html/core/core.dart.func-c.html new file mode 100644 index 00000000..cb2e0536 --- /dev/null +++ b/coverage/html/core/core.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/core.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core - core.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:74.5 %5138
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/core.dart.func.html b/coverage/html/core/core.dart.func.html new file mode 100644 index 00000000..77fdda59 --- /dev/null +++ b/coverage/html/core/core.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/core.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core - core.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:74.5 %5138
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/core.dart.gcov.html b/coverage/html/core/core.dart.gcov.html new file mode 100644 index 00000000..ecd9d828 --- /dev/null +++ b/coverage/html/core/core.dart.gcov.html @@ -0,0 +1,255 @@ + + + + + + + LCOV - lcov.info - core/core.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core - core.dartCoverageTotalHit
Test:lcov.infoLines:74.5 %5138
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:logger/logger.dart';
+       2              : import 'package:walletconnect_flutter_v2/apis/core/crypto/crypto.dart';
+       3              : import 'package:walletconnect_flutter_v2/apis/core/crypto/i_crypto.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/core/echo/echo.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/core/echo/echo_client.dart';
+       6              : import 'package:walletconnect_flutter_v2/apis/core/echo/i_echo.dart';
+       7              : import 'package:walletconnect_flutter_v2/apis/core/heartbit/heartbeat.dart';
+       8              : import 'package:walletconnect_flutter_v2/apis/core/heartbit/i_heartbeat.dart';
+       9              : import 'package:walletconnect_flutter_v2/apis/core/i_core.dart';
+      10              : import 'package:walletconnect_flutter_v2/apis/core/pairing/expirer.dart';
+      11              : import 'package:walletconnect_flutter_v2/apis/core/pairing/i_expirer.dart';
+      12              : import 'package:walletconnect_flutter_v2/apis/core/pairing/json_rpc_history.dart';
+      13              : import 'package:walletconnect_flutter_v2/apis/core/pairing/pairing.dart';
+      14              : import 'package:walletconnect_flutter_v2/apis/core/pairing/pairing_store.dart';
+      15              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/pairing_models.dart';
+      16              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/message_tracker.dart';
+      17              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client.dart';
+      18              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/http_client.dart';
+      19              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/i_http_client.dart';
+      20              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/i_websocket_handler.dart';
+      21              : import 'package:walletconnect_flutter_v2/apis/core/store/generic_store.dart';
+      22              : import 'package:walletconnect_flutter_v2/apis/core/store/i_store.dart';
+      23              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/i_relay_client.dart';
+      24              : import 'package:walletconnect_flutter_v2/apis/core/pairing/i_pairing.dart';
+      25              : import 'package:walletconnect_flutter_v2/apis/core/store/shared_prefs_store.dart';
+      26              : import 'package:walletconnect_flutter_v2/apis/core/verify/i_verify.dart';
+      27              : import 'package:walletconnect_flutter_v2/apis/core/verify/verify.dart';
+      28              : import 'package:walletconnect_flutter_v2/apis/utils/constants.dart';
+      29              : import 'package:walletconnect_flutter_v2/apis/utils/log_level.dart';
+      30              : import 'package:walletconnect_flutter_v2/apis/utils/walletconnect_utils.dart';
+      31              : 
+      32              : class Core implements ICore {
+      33            7 :   @override
+      34              :   String get protocol => 'wc';
+      35            7 :   @override
+      36              :   String get version => '2';
+      37              : 
+      38              :   @override
+      39              :   final String projectId;
+      40              : 
+      41              :   @override
+      42              :   String relayUrl = WalletConnectConstants.DEFAULT_RELAY_URL;
+      43              : 
+      44              :   @override
+      45              :   String pushUrl = WalletConnectConstants.DEFAULT_PUSH_URL;
+      46              : 
+      47              :   @override
+      48              :   late ICrypto crypto;
+      49              : 
+      50              :   @override
+      51              :   late IRelayClient relayClient;
+      52              : 
+      53              :   @override
+      54              :   late IExpirer expirer;
+      55              : 
+      56              :   @override
+      57              :   late IPairing pairing;
+      58              : 
+      59              :   @override
+      60              :   late IEcho echo;
+      61              : 
+      62              :   @override
+      63              :   late IHeartBeat heartbeat;
+      64              : 
+      65              :   @override
+      66              :   late IVerify verify;
+      67              : 
+      68              :   Logger _logger = Logger(
+      69              :     level: Level.off,
+      70              :     printer: PrettyPrinter(),
+      71              :   );
+      72            9 :   @override
+      73            9 :   Logger get logger => _logger;
+      74              : 
+      75            0 :   @override
+      76              :   void addLogListener(LogCallback callback) {
+      77            0 :     Logger.addLogListener(callback);
+      78              :   }
+      79              : 
+      80            0 :   @override
+      81              :   bool removeLogListener(LogCallback callback) {
+      82            0 :     return Logger.removeLogListener(callback);
+      83              :   }
+      84              : 
+      85              :   @override
+      86              :   late IStore<Map<String, dynamic>> storage;
+      87              : 
+      88           10 :   Core({
+      89              :     required this.projectId,
+      90              :     this.relayUrl = WalletConnectConstants.DEFAULT_RELAY_URL,
+      91              :     this.pushUrl = WalletConnectConstants.DEFAULT_PUSH_URL,
+      92              :     bool memoryStore = false,
+      93              :     LogLevel logLevel = LogLevel.nothing,
+      94              :     IHttpClient httpClient = const HttpWrapper(),
+      95              :     IWebSocketHandler? webSocketHandler,
+      96              :   }) {
+      97           20 :     _logger = Logger(
+      98           10 :       level: logLevel.toLevel(),
+      99           10 :       printer: PrettyPrinter(methodCount: null),
+     100              :     );
+     101           20 :     heartbeat = HeartBeat();
+     102           20 :     storage = SharedPrefsStores(
+     103              :       memoryStore: memoryStore,
+     104              :     );
+     105           20 :     crypto = Crypto(
+     106              :       core: this,
+     107           10 :       keyChain: GenericStore<String>(
+     108           10 :         storage: storage,
+     109              :         context: StoreVersions.CONTEXT_KEYCHAIN,
+     110              :         version: StoreVersions.VERSION_KEYCHAIN,
+     111            0 :         fromJson: (dynamic value) => value as String,
+     112              :       ),
+     113              :     );
+     114           20 :     relayClient = RelayClient(
+     115              :       core: this,
+     116           10 :       messageTracker: MessageTracker(
+     117           10 :         storage: storage,
+     118              :         context: StoreVersions.CONTEXT_MESSAGE_TRACKER,
+     119              :         version: StoreVersions.VERSION_MESSAGE_TRACKER,
+     120            0 :         fromJson: (dynamic value) {
+     121            0 :           return WalletConnectUtils.convertMapTo<String>(value);
+     122              :         },
+     123              :       ),
+     124           10 :       topicMap: GenericStore<String>(
+     125           10 :         storage: storage,
+     126              :         context: StoreVersions.CONTEXT_TOPIC_MAP,
+     127              :         version: StoreVersions.VERSION_TOPIC_MAP,
+     128            0 :         fromJson: (dynamic value) => value as String,
+     129              :       ),
+     130              :       socketHandler: webSocketHandler,
+     131              :     );
+     132           20 :     expirer = Expirer(
+     133           10 :       storage: storage,
+     134              :       context: StoreVersions.CONTEXT_EXPIRER,
+     135              :       version: StoreVersions.VERSION_EXPIRER,
+     136            0 :       fromJson: (dynamic value) => value as int,
+     137              :     );
+     138           20 :     pairing = Pairing(
+     139              :       core: this,
+     140           10 :       pairings: PairingStore(
+     141           10 :         storage: storage,
+     142              :         context: StoreVersions.CONTEXT_PAIRINGS,
+     143              :         version: StoreVersions.VERSION_PAIRINGS,
+     144            0 :         fromJson: (dynamic value) {
+     145            0 :           return PairingInfo.fromJson(value as Map<String, dynamic>);
+     146              :         },
+     147              :       ),
+     148           10 :       history: JsonRpcHistory(
+     149           10 :         storage: storage,
+     150              :         context: StoreVersions.CONTEXT_JSON_RPC_HISTORY,
+     151              :         version: StoreVersions.VERSION_JSON_RPC_HISTORY,
+     152            0 :         fromJson: (dynamic value) => JsonRpcRecord.fromJson(value),
+     153              :       ),
+     154           10 :       topicToReceiverPublicKey: GenericStore(
+     155           10 :         storage: storage,
+     156              :         context: StoreVersions.CONTEXT_TOPIC_TO_RECEIVER_PUBLIC_KEY,
+     157              :         version: StoreVersions.VERSION_TOPIC_TO_RECEIVER_PUBLIC_KEY,
+     158            0 :         fromJson: (dynamic value) => ReceiverPublicKey.fromJson(value),
+     159              :       ),
+     160              :     );
+     161           20 :     echo = Echo(
+     162              :       core: this,
+     163           10 :       echoClient: EchoClient(
+     164           10 :         baseUrl: pushUrl,
+     165              :         httpClient: httpClient,
+     166              :       ),
+     167              :     );
+     168           20 :     verify = Verify(
+     169              :       core: this,
+     170              :       httpClient: httpClient,
+     171              :     );
+     172              :   }
+     173              : 
+     174            9 :   @override
+     175              :   Future<void> start() async {
+     176           18 :     await storage.init();
+     177           18 :     await crypto.init();
+     178           18 :     await relayClient.init();
+     179           18 :     await expirer.init();
+     180           18 :     await pairing.init();
+     181           18 :     heartbeat.init();
+     182              :   }
+     183              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/crypto/crypto.dart.func-c.html b/coverage/html/core/crypto/crypto.dart.func-c.html new file mode 100644 index 00000000..c5f2096b --- /dev/null +++ b/coverage/html/core/crypto/crypto.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/crypto/crypto.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/crypto - crypto.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:86.2 %8775
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/crypto/crypto.dart.func.html b/coverage/html/core/crypto/crypto.dart.func.html new file mode 100644 index 00000000..c43d455e --- /dev/null +++ b/coverage/html/core/crypto/crypto.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/crypto/crypto.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/crypto - crypto.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:86.2 %8775
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/crypto/crypto.dart.gcov.html b/coverage/html/core/crypto/crypto.dart.gcov.html new file mode 100644 index 00000000..9490ac60 --- /dev/null +++ b/coverage/html/core/crypto/crypto.dart.gcov.html @@ -0,0 +1,330 @@ + + + + + + + LCOV - lcov.info - core/crypto/crypto.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/crypto - crypto.dartCoverageTotalHit
Test:lcov.infoLines:86.2 %8775
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:convert';
+       2              : import 'dart:typed_data';
+       3              : 
+       4              : import 'package:convert/convert.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/core/crypto/crypto_models.dart';
+       6              : import 'package:walletconnect_flutter_v2/apis/core/crypto/crypto_utils.dart';
+       7              : import 'package:walletconnect_flutter_v2/apis/core/i_core.dart';
+       8              : import 'package:walletconnect_flutter_v2/apis/core/crypto/i_crypto.dart';
+       9              : import 'package:walletconnect_flutter_v2/apis/core/crypto/i_crypto_utils.dart';
+      10              : import 'package:walletconnect_flutter_v2/apis/core/relay_auth/i_relay_auth.dart';
+      11              : import 'package:walletconnect_flutter_v2/apis/core/relay_auth/relay_auth.dart';
+      12              : import 'package:walletconnect_flutter_v2/apis/core/relay_auth/relay_auth_models.dart';
+      13              : import 'package:walletconnect_flutter_v2/apis/core/store/i_generic_store.dart';
+      14              : import 'package:walletconnect_flutter_v2/apis/utils/constants.dart';
+      15              : import 'package:walletconnect_flutter_v2/apis/utils/errors.dart';
+      16              : 
+      17              : class Crypto implements ICrypto {
+      18              :   static const cryptoContext = 'crypto';
+      19              :   static const cryptoClientSeed = 'client_ed25519_seed';
+      20              :   static const clientSeed = 'CLIENT_SEED';
+      21              : 
+      22              :   bool _initialized = false;
+      23              : 
+      24            0 :   @override
+      25              :   String get name => cryptoContext;
+      26              : 
+      27              :   final ICore core;
+      28              : 
+      29              :   @override
+      30              :   IGenericStore<String> keyChain;
+      31              : 
+      32              :   ICryptoUtils utils;
+      33              :   IRelayAuth relayAuth;
+      34              : 
+      35           10 :   Crypto({
+      36              :     required this.core,
+      37              :     required this.keyChain,
+      38              :     CryptoUtils? utils,
+      39              :     RelayAuth? relayAuth,
+      40           10 :   })  : utils = utils ?? CryptoUtils(),
+      41           10 :         relayAuth = relayAuth ?? RelayAuth();
+      42              : 
+      43           10 :   @override
+      44              :   Future<void> init() async {
+      45           10 :     if (_initialized) {
+      46              :       return;
+      47              :     }
+      48              : 
+      49           20 :     await keyChain.init();
+      50              : 
+      51           10 :     _initialized = true;
+      52              :   }
+      53              : 
+      54            0 :   @override
+      55              :   bool hasKeys(String tag) {
+      56            0 :     _checkInitialized();
+      57            0 :     return keyChain.has(tag);
+      58              :   }
+      59              : 
+      60            0 :   @override
+      61              :   Future<String> getClientId() async {
+      62            0 :     _checkInitialized();
+      63              : 
+      64              :     // If we don't have a pub key associated with the seed yet, make one
+      65            0 :     final Uint8List seed = await _getClientSeed();
+      66            0 :     final RelayAuthKeyPair keyPair = await relayAuth.generateKeyPair(seed);
+      67            0 :     return relayAuth.encodeIss(keyPair.publicKeyBytes);
+      68              :   }
+      69              : 
+      70            6 :   @override
+      71              :   Future<String> generateKeyPair() async {
+      72            6 :     _checkInitialized();
+      73              : 
+      74           12 :     CryptoKeyPair keyPair = utils.generateKeyPair();
+      75            6 :     return await _setPrivateKey(keyPair);
+      76              :   }
+      77              : 
+      78            6 :   @override
+      79              :   Future<String> generateSharedKey(
+      80              :     String selfPublicKey,
+      81              :     String peerPublicKey, {
+      82              :     String? overrideTopic,
+      83              :   }) async {
+      84            6 :     _checkInitialized();
+      85              : 
+      86            6 :     String privKey = _getPrivateKey(selfPublicKey)!;
+      87           12 :     String symKey = await utils.deriveSymKey(privKey, peerPublicKey);
+      88            6 :     return await setSymKey(symKey, overrideTopic: overrideTopic);
+      89              :   }
+      90              : 
+      91            8 :   @override
+      92              :   Future<String> setSymKey(
+      93              :     String symKey, {
+      94              :     String? overrideTopic,
+      95              :   }) async {
+      96            8 :     _checkInitialized();
+      97              : 
+      98           16 :     final String topic = overrideTopic ?? utils.hashKey(symKey);
+      99              :     // print('crypto setSymKey, symKey: $symKey, overrideTopic: $topic');
+     100           16 :     await keyChain.set(topic, symKey);
+     101              :     return topic;
+     102              :   }
+     103              : 
+     104            4 :   @override
+     105              :   Future<void> deleteKeyPair(String publicKey) async {
+     106            4 :     _checkInitialized();
+     107            8 :     await keyChain.delete(publicKey);
+     108              :   }
+     109              : 
+     110            6 :   @override
+     111              :   Future<void> deleteSymKey(String topic) async {
+     112            6 :     _checkInitialized();
+     113           12 :     await keyChain.delete(topic);
+     114              :   }
+     115              : 
+     116            7 :   @override
+     117              :   Future<String?> encode(
+     118              :     String topic,
+     119              :     Map<String, dynamic> payload, {
+     120              :     EncodeOptions? options,
+     121              :   }) async {
+     122            7 :     _checkInitialized();
+     123              : 
+     124              :     EncodingValidation params;
+     125              :     if (options == null) {
+     126           14 :       params = utils.validateEncoding();
+     127              :     } else {
+     128            4 :       params = utils.validateEncoding(
+     129            2 :         type: options.type,
+     130            2 :         senderPublicKey: options.senderPublicKey,
+     131            2 :         receiverPublicKey: options.receiverPublicKey,
+     132              :       );
+     133              :     }
+     134              : 
+     135            7 :     final String message = jsonEncode(payload);
+     136              : 
+     137           14 :     if (utils.isTypeOneEnvelope(params)) {
+     138            2 :       final String selfPublicKey = params.senderPublicKey!;
+     139            2 :       final String peerPublicKey = params.receiverPublicKey!;
+     140            2 :       topic = await generateSharedKey(selfPublicKey, peerPublicKey);
+     141              :     }
+     142              : 
+     143            7 :     final String? symKey = _getSymKey(topic);
+     144              :     if (symKey == null) {
+     145              :       return null;
+     146              :     }
+     147              : 
+     148           14 :     final String result = await utils.encrypt(
+     149              :       message,
+     150              :       symKey,
+     151            7 :       type: params.type,
+     152            7 :       senderPublicKey: params.senderPublicKey,
+     153              :     );
+     154              : 
+     155              :     return result;
+     156              :   }
+     157              : 
+     158            7 :   @override
+     159              :   Future<String?> decode(
+     160              :     String topic,
+     161              :     String encoded, {
+     162              :     DecodeOptions? options,
+     163              :   }) async {
+     164            7 :     _checkInitialized();
+     165              : 
+     166           14 :     final EncodingValidation params = utils.validateDecoding(
+     167              :       encoded,
+     168            6 :       receiverPublicKey: options?.receiverPublicKey,
+     169              :     );
+     170              : 
+     171           14 :     if (utils.isTypeOneEnvelope(params)) {
+     172            2 :       final String selfPublicKey = params.receiverPublicKey!;
+     173            2 :       final String peerPublicKey = params.senderPublicKey!;
+     174            2 :       topic = await generateSharedKey(selfPublicKey, peerPublicKey);
+     175              :     }
+     176            7 :     final String? symKey = _getSymKey(topic);
+     177              :     if (symKey == null) {
+     178              :       return null;
+     179              :     }
+     180              : 
+     181           14 :     final String message = await utils.decrypt(symKey, encoded);
+     182              : 
+     183              :     return message;
+     184              :   }
+     185              : 
+     186            9 :   @override
+     187              :   Future<String> signJWT(String aud) async {
+     188            9 :     _checkInitialized();
+     189              : 
+     190            9 :     final Uint8List seed = await _getClientSeed();
+     191           18 :     final RelayAuthKeyPair keyPair = await relayAuth.generateKeyPair(seed);
+     192           18 :     final String sub = utils.generateRandomBytes32();
+     193           18 :     final jwt = await relayAuth.signJWT(
+     194              :       sub: sub,
+     195              :       aud: aud,
+     196              :       ttl: WalletConnectConstants.ONE_DAY,
+     197              :       keyPair: keyPair,
+     198              :     );
+     199              :     return jwt;
+     200              :   }
+     201              : 
+     202            0 :   @override
+     203              :   int getPayloadType(String encoded) {
+     204            0 :     _checkInitialized();
+     205              : 
+     206            0 :     return utils.deserialize(encoded).type;
+     207              :   }
+     208              : 
+     209              :   // PRIVATE FUNCTIONS
+     210              : 
+     211            6 :   Future<String> _setPrivateKey(CryptoKeyPair keyPair) async {
+     212           24 :     await keyChain.set(keyPair.publicKey, keyPair.privateKey);
+     213            6 :     return keyPair.publicKey;
+     214              :   }
+     215              : 
+     216            6 :   String? _getPrivateKey(String publicKey) {
+     217           12 :     return keyChain.get(publicKey);
+     218              :   }
+     219              : 
+     220            7 :   String? _getSymKey(String topic) {
+     221              :     // print('crypto getSymKey: $topic');
+     222           14 :     return keyChain.get(topic);
+     223              :   }
+     224              : 
+     225              :   // Future<String> _getClientKeyFromSeed() async {
+     226              :   //   // Get the seed
+     227              :   //   String seed = await _getClientSeed();
+     228              : 
+     229              :   //   String pubKey = keyChain.get(seed);
+     230              :   //   if (pubKey == '') {
+     231              :   //     pubKey = await generateKeyPair();
+     232              :   //     await keyChain.set(seed, pubKey);
+     233              :   //   }
+     234              : 
+     235              :   //   return pubKey;
+     236              :   // }
+     237              : 
+     238            9 :   Future<Uint8List> _getClientSeed() async {
+     239           18 :     String? seed = keyChain.get(clientSeed);
+     240              :     if (seed == null) {
+     241           18 :       seed = utils.generateRandomBytes32();
+     242           18 :       await keyChain.set(clientSeed, seed);
+     243              :     }
+     244              : 
+     245           18 :     return Uint8List.fromList(hex.decode(seed));
+     246              :   }
+     247              : 
+     248           10 :   void _checkInitialized() {
+     249           10 :     if (!_initialized) {
+     250            1 :       throw Errors.getInternalError(Errors.NOT_INITIALIZED);
+     251              :     }
+     252              :   }
+     253              : 
+     254            7 :   @override
+     255              :   ICryptoUtils getUtils() {
+     256            7 :     return utils;
+     257              :   }
+     258              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/crypto/crypto_models.dart.func-c.html b/coverage/html/core/crypto/crypto_models.dart.func-c.html new file mode 100644 index 00000000..b6a7d772 --- /dev/null +++ b/coverage/html/core/crypto/crypto_models.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/crypto/crypto_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/crypto - crypto_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:50.0 %105
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/crypto/crypto_models.dart.func.html b/coverage/html/core/crypto/crypto_models.dart.func.html new file mode 100644 index 00000000..44e29f08 --- /dev/null +++ b/coverage/html/core/crypto/crypto_models.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/crypto/crypto_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/crypto - crypto_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:50.0 %105
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/crypto/crypto_models.dart.gcov.html b/coverage/html/core/crypto/crypto_models.dart.gcov.html new file mode 100644 index 00000000..7352f6b6 --- /dev/null +++ b/coverage/html/core/crypto/crypto_models.dart.gcov.html @@ -0,0 +1,157 @@ + + + + + + + LCOV - lcov.info - core/crypto/crypto_models.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/crypto - crypto_models.dartCoverageTotalHit
Test:lcov.infoLines:50.0 %105
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:typed_data';
+       2              : 
+       3              : import 'package:convert/convert.dart';
+       4              : 
+       5              : class CryptoKeyPair {
+       6              :   final String privateKey;
+       7              :   final String publicKey;
+       8              : 
+       9           22 :   const CryptoKeyPair(this.privateKey, this.publicKey);
+      10              : 
+      11            0 :   Uint8List getPrivateKeyBytes() {
+      12            0 :     return Uint8List.fromList(hex.decode(privateKey));
+      13              :   }
+      14              : 
+      15            0 :   Uint8List getPublicKeyBytes() {
+      16            0 :     return Uint8List.fromList(hex.decode(publicKey));
+      17              :   }
+      18              : }
+      19              : 
+      20              : class EncryptParams {
+      21              :   String message;
+      22              :   String symKey;
+      23              :   int? type;
+      24              :   String? iv;
+      25              :   String? senderPublicKey;
+      26              : 
+      27            0 :   EncryptParams(
+      28              :     this.message,
+      29              :     this.symKey, {
+      30              :     this.type,
+      31              :     this.iv,
+      32              :     this.senderPublicKey,
+      33              :   });
+      34              : }
+      35              : 
+      36              : class EncodingParams {
+      37              :   int type;
+      38              :   Uint8List sealed;
+      39              :   Uint8List iv;
+      40              :   Uint8List ivSealed;
+      41              :   Uint8List? senderPublicKey;
+      42              : 
+      43            7 :   EncodingParams(
+      44              :     this.type,
+      45              :     this.sealed,
+      46              :     this.iv,
+      47              :     this.ivSealed, {
+      48              :     this.senderPublicKey,
+      49              :   });
+      50              : }
+      51              : 
+      52              : class EncodingValidation {
+      53              :   int type;
+      54              :   String? senderPublicKey;
+      55              :   String? receiverPublicKey;
+      56              : 
+      57            7 :   EncodingValidation(
+      58              :     this.type, {
+      59              :     this.senderPublicKey,
+      60              :     this.receiverPublicKey,
+      61              :   });
+      62              : }
+      63              : 
+      64              : class EncodeOptions {
+      65              :   static const TYPE_0 = 0;
+      66              :   static const TYPE_1 = 1;
+      67              : 
+      68              :   int? type;
+      69              :   String? senderPublicKey;
+      70              :   String? receiverPublicKey;
+      71              : 
+      72            2 :   EncodeOptions({
+      73              :     this.type,
+      74              :     this.senderPublicKey,
+      75              :     this.receiverPublicKey,
+      76              :   });
+      77              : }
+      78              : 
+      79              : class DecodeOptions {
+      80              :   String? receiverPublicKey;
+      81              : 
+      82            6 :   DecodeOptions({
+      83              :     this.receiverPublicKey,
+      84              :   });
+      85              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/crypto/crypto_utils.dart.func-c.html b/coverage/html/core/crypto/crypto_utils.dart.func-c.html new file mode 100644 index 00000000..964b663f --- /dev/null +++ b/coverage/html/core/crypto/crypto_utils.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/crypto/crypto_utils.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/crypto - crypto_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %8383
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/crypto/crypto_utils.dart.func.html b/coverage/html/core/crypto/crypto_utils.dart.func.html new file mode 100644 index 00000000..664030ba --- /dev/null +++ b/coverage/html/core/crypto/crypto_utils.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/crypto/crypto_utils.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/crypto - crypto_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %8383
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/crypto/crypto_utils.dart.gcov.html b/coverage/html/core/crypto/crypto_utils.dart.gcov.html new file mode 100644 index 00000000..93f9bb6a --- /dev/null +++ b/coverage/html/core/crypto/crypto_utils.dart.gcov.html @@ -0,0 +1,323 @@ + + + + + + + LCOV - lcov.info - core/crypto/crypto_utils.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/crypto - crypto_utils.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %8383
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:convert';
+       2              : import 'dart:math';
+       3              : import 'dart:typed_data';
+       4              : 
+       5              : import 'package:convert/convert.dart';
+       6              : import 'package:cryptography/cryptography.dart' as dc;
+       7              : import 'package:pointycastle/digests/sha256.dart';
+       8              : import 'package:pointycastle/key_derivators/hkdf.dart';
+       9              : import 'package:pointycastle/pointycastle.dart' show HkdfParameters;
+      10              : import 'package:walletconnect_flutter_v2/apis/core/crypto/crypto_models.dart';
+      11              : import 'package:walletconnect_flutter_v2/apis/core/crypto/i_crypto_utils.dart';
+      12              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
+      13              : import 'package:x25519/x25519.dart' as x;
+      14              : 
+      15              : class CryptoUtils extends ICryptoUtils {
+      16           30 :   static final _random = Random.secure();
+      17              : 
+      18              :   static const IV_LENGTH = 12;
+      19              :   static const KEY_LENGTH = 32;
+      20              : 
+      21              :   static const TYPE_LENGTH = 1;
+      22              : 
+      23            6 :   @override
+      24              :   CryptoKeyPair generateKeyPair() {
+      25            6 :     final kp = x.generateKeyPair();
+      26              : 
+      27            6 :     return CryptoKeyPair(
+      28           12 :       hex.encode(kp.privateKey),
+      29           12 :       hex.encode(kp.publicKey),
+      30              :     );
+      31              :   }
+      32              : 
+      33           10 :   @override
+      34              :   Uint8List randomBytes(int length) {
+      35           10 :     final Uint8List random = Uint8List(length);
+      36           20 :     for (int i = 0; i < length; i++) {
+      37           30 :       random[i] = _random.nextInt(256);
+      38              :     }
+      39              :     return random;
+      40              :   }
+      41              : 
+      42           10 :   @override
+      43              :   String generateRandomBytes32() {
+      44           20 :     return hex.encode(randomBytes(32));
+      45              :   }
+      46              : 
+      47            6 :   @override
+      48              :   Future<String> deriveSymKey(String privKeyA, String pubKeyB) async {
+      49            6 :     final Uint8List sharedKey1 = x.X25519(
+      50            6 :       hex.decode(privKeyA),
+      51            6 :       hex.decode(pubKeyB),
+      52              :     );
+      53              : 
+      54            6 :     Uint8List out = Uint8List(KEY_LENGTH);
+      55              : 
+      56           12 :     final HKDFKeyDerivator hkdf = HKDFKeyDerivator(SHA256Digest());
+      57            6 :     final HkdfParameters params = HkdfParameters(
+      58              :       sharedKey1,
+      59              :       KEY_LENGTH,
+      60              :     );
+      61            6 :     hkdf.init(params);
+      62              :     // final pc.KeyParameter keyParam = hkdf.extract(null, sharedKey1);
+      63            6 :     hkdf.deriveKey(null, 0, out, 0);
+      64            6 :     return hex.encode(out);
+      65              :   }
+      66              : 
+      67            8 :   @override
+      68              :   String hashKey(String key) {
+      69            8 :     return hex.encode(
+      70           16 :       SHA256Digest().process(
+      71            8 :         Uint8List.fromList(
+      72            8 :           hex.decode(key),
+      73              :         ),
+      74              :       ),
+      75              :     );
+      76              :     // return hex.encode(Hash.sha256(hex.decode(key)));
+      77              :   }
+      78              : 
+      79            5 :   @override
+      80              :   String hashMessage(String message) {
+      81            5 :     return hex.encode(
+      82           10 :       SHA256Digest().process(
+      83            5 :         Uint8List.fromList(
+      84            5 :           utf8.encode(message),
+      85              :         ),
+      86              :       ),
+      87              :     );
+      88              :   }
+      89              : 
+      90            7 :   @override
+      91              :   Future<String> encrypt(
+      92              :     String message,
+      93              :     String symKey, {
+      94              :     int? type,
+      95              :     String? iv,
+      96              :     String? senderPublicKey,
+      97              :   }) async {
+      98              :     final int decodedType = type ?? EncodeOptions.TYPE_0;
+      99              :     // print(message);
+     100              :     // print(symKey);
+     101              : 
+     102              :     // Check for type 1 envelope, throw an error if data is invalid
+     103            7 :     if (decodedType == EncodeOptions.TYPE_1 && senderPublicKey == null) {
+     104              :       throw const WalletConnectError(
+     105              :         code: -1,
+     106              :         message: 'Missing sender public key for type 1 envelope',
+     107              :       );
+     108              :     }
+     109              : 
+     110              :     // final String senderPublicKey = senderPublicKey !=
+     111              :     final Uint8List usedIV =
+     112            8 :         (iv != null ? hex.decode(iv) : randomBytes(IV_LENGTH)) as Uint8List;
+     113              : 
+     114            7 :     final chacha = dc.Chacha20.poly1305Aead();
+     115            7 :     dc.SecretBox b = await chacha.encrypt(
+     116            7 :       utf8.encode(message),
+     117            7 :       secretKey: dc.SecretKey(
+     118            7 :         hex.decode(symKey),
+     119              :       ),
+     120              :       nonce: usedIV,
+     121              :     );
+     122              : 
+     123            7 :     return serialize(
+     124              :       decodedType,
+     125            7 :       b.concatenation(),
+     126              :       usedIV,
+     127              :       senderPublicKey: senderPublicKey != null
+     128            3 :           ? hex.decode(senderPublicKey) as Uint8List
+     129              :           : null,
+     130              :     );
+     131              :   }
+     132              : 
+     133            7 :   @override
+     134              :   Future<String> decrypt(String symKey, String encoded) async {
+     135            7 :     final chacha = dc.Chacha20.poly1305Aead();
+     136            7 :     final dc.SecretKey secretKey = dc.SecretKey(
+     137            7 :       hex.decode(symKey),
+     138              :     );
+     139            7 :     final EncodingParams encodedData = deserialize(encoded);
+     140            7 :     final dc.SecretBox b = dc.SecretBox.fromConcatenation(
+     141            7 :       encodedData.ivSealed,
+     142              :       nonceLength: 12,
+     143              :       macLength: 16,
+     144              :     );
+     145            7 :     List<int> data = await chacha.decrypt(b, secretKey: secretKey);
+     146            7 :     return utf8.decode(data);
+     147              :   }
+     148              : 
+     149            7 :   @override
+     150              :   String serialize(
+     151              :     int type,
+     152              :     Uint8List sealed,
+     153              :     Uint8List iv, {
+     154              :     Uint8List? senderPublicKey,
+     155              :   }) {
+     156            7 :     List<int> l = [type];
+     157              : 
+     158            7 :     if (type == EncodeOptions.TYPE_1) {
+     159              :       if (senderPublicKey == null) {
+     160              :         throw const WalletConnectError(
+     161              :           code: -1,
+     162              :           message: 'Missing sender public key for type 1 envelope',
+     163              :         );
+     164              :       }
+     165              : 
+     166            3 :       l.addAll(senderPublicKey);
+     167              :     }
+     168              : 
+     169              :     // l.addAll(iv);
+     170            7 :     l.addAll(sealed);
+     171              : 
+     172            7 :     return base64Encode(l);
+     173              :   }
+     174              : 
+     175            7 :   @override
+     176              :   EncodingParams deserialize(String encoded) {
+     177            7 :     final Uint8List bytes = base64Decode(encoded);
+     178            7 :     final int type = bytes[0];
+     179              : 
+     180              :     int index = TYPE_LENGTH;
+     181              :     Uint8List? senderPublicKey;
+     182            7 :     if (type == EncodeOptions.TYPE_1) {
+     183            3 :       senderPublicKey = bytes.sublist(
+     184              :         index,
+     185            3 :         index + KEY_LENGTH,
+     186              :       );
+     187            3 :       index += KEY_LENGTH;
+     188              :     }
+     189           14 :     Uint8List iv = bytes.sublist(index, index + IV_LENGTH);
+     190            7 :     Uint8List ivSealed = bytes.sublist(index);
+     191            7 :     index += IV_LENGTH;
+     192            7 :     Uint8List sealed = bytes.sublist(index);
+     193              : 
+     194            7 :     return EncodingParams(
+     195              :       type,
+     196              :       sealed,
+     197              :       iv,
+     198              :       ivSealed,
+     199              :       senderPublicKey: senderPublicKey,
+     200              :     );
+     201              :   }
+     202              : 
+     203            7 :   @override
+     204              :   EncodingValidation validateDecoding(
+     205              :     String encoded, {
+     206              :     String? receiverPublicKey,
+     207              :   }) {
+     208            7 :     final EncodingParams deserialized = deserialize(encoded);
+     209            7 :     final String? senderPublicKey = deserialized.senderPublicKey != null
+     210            6 :         ? hex.encode(deserialized.senderPublicKey!)
+     211              :         : null;
+     212            7 :     return validateEncoding(
+     213            7 :       type: deserialized.type,
+     214              :       senderPublicKey: senderPublicKey,
+     215              :       receiverPublicKey: receiverPublicKey,
+     216              :     );
+     217              :   }
+     218              : 
+     219            7 :   @override
+     220              :   EncodingValidation validateEncoding({
+     221              :     int? type,
+     222              :     String? senderPublicKey,
+     223              :     String? receiverPublicKey,
+     224              :   }) {
+     225              :     final int t = type ?? EncodeOptions.TYPE_0;
+     226            7 :     if (t == EncodeOptions.TYPE_1) {
+     227              :       if (senderPublicKey == null) {
+     228              :         throw const WalletConnectError(
+     229              :             code: -1, message: 'Missing sender public key');
+     230              :       }
+     231              :       if (receiverPublicKey == null) {
+     232              :         throw const WalletConnectError(
+     233              :             code: -1, message: 'Missing receiver public key');
+     234              :       }
+     235              :     }
+     236            7 :     return EncodingValidation(
+     237              :       t,
+     238              :       senderPublicKey: senderPublicKey,
+     239              :       receiverPublicKey: receiverPublicKey,
+     240              :     );
+     241              :   }
+     242              : 
+     243            7 :   @override
+     244              :   bool isTypeOneEnvelope(
+     245              :     EncodingValidation result,
+     246              :   ) {
+     247           14 :     return result.type == EncodeOptions.TYPE_1 &&
+     248            3 :         result.senderPublicKey != null &&
+     249            3 :         result.receiverPublicKey != null;
+     250              :   }
+     251              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/crypto/index-sort-f.html b/coverage/html/core/crypto/index-sort-f.html new file mode 100644 index 00000000..c179cdd0 --- /dev/null +++ b/coverage/html/core/crypto/index-sort-f.html @@ -0,0 +1,129 @@ + + + + + + + LCOV - lcov.info - core/crypto + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/cryptoCoverageTotalHit
Test:lcov.infoLines:90.6 %180163
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
crypto.dart +
86.2%86.2%
+
86.2 %8775-
crypto_models.dart +
50.0%50.0%
+
50.0 %105-
crypto_utils.dart +
100.0%
+
100.0 %8383-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/crypto/index-sort-l.html b/coverage/html/core/crypto/index-sort-l.html new file mode 100644 index 00000000..ab3f42b3 --- /dev/null +++ b/coverage/html/core/crypto/index-sort-l.html @@ -0,0 +1,109 @@ + + + + + + + LCOV - lcov.info - core/crypto + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/cryptoCoverageTotalHit
Test:lcov.infoLines:90.6 %180163
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
crypto_models.dart +
50.0%50.0%
+
50.0 %105
crypto.dart +
86.2%86.2%
+
86.2 %8775
crypto_utils.dart +
100.0%
+
100.0 %8383
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/crypto/index.html b/coverage/html/core/crypto/index.html new file mode 100644 index 00000000..7788838f --- /dev/null +++ b/coverage/html/core/crypto/index.html @@ -0,0 +1,109 @@ + + + + + + + LCOV - lcov.info - core/crypto + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/cryptoCoverageTotalHit
Test:lcov.infoLines:90.6 %180163
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
crypto.dart +
86.2%86.2%
+
86.2 %8775
crypto_models.dart +
50.0%50.0%
+
50.0 %105
crypto_utils.dart +
100.0%
+
100.0 %8383
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/echo/echo.dart.func-c.html b/coverage/html/core/echo/echo.dart.func-c.html new file mode 100644 index 00000000..95be6f5e --- /dev/null +++ b/coverage/html/core/echo/echo.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/echo/echo.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/echo - echo.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:88.2 %1715
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/echo/echo.dart.func.html b/coverage/html/core/echo/echo.dart.func.html new file mode 100644 index 00000000..a8a531c8 --- /dev/null +++ b/coverage/html/core/echo/echo.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/echo/echo.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/echo - echo.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:88.2 %1715
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/echo/echo.dart.gcov.html b/coverage/html/core/echo/echo.dart.gcov.html new file mode 100644 index 00000000..ccfe5963 --- /dev/null +++ b/coverage/html/core/echo/echo.dart.gcov.html @@ -0,0 +1,120 @@ + + + + + + + LCOV - lcov.info - core/echo/echo.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/echo - echo.dartCoverageTotalHit
Test:lcov.infoLines:88.2 %1715
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:walletconnect_flutter_v2/apis/core/echo/i_echo.dart';
+       2              : import 'package:walletconnect_flutter_v2/apis/core/echo/i_echo_client.dart';
+       3              : import 'package:walletconnect_flutter_v2/apis/core/i_core.dart';
+       4              : 
+       5              : class Echo implements IEcho {
+       6              :   static const SUCCESS_STATUS = 'SUCCESS';
+       7              :   final ICore core;
+       8              :   final IEchoClient echoClient;
+       9              : 
+      10           11 :   Echo({required this.core, required this.echoClient});
+      11              : 
+      12            1 :   @override
+      13              :   Future<void> register(String firebaseAccessToken) async {
+      14            2 :     final projectId = core.projectId;
+      15            3 :     final clientId = await core.crypto.getClientId();
+      16            2 :     final response = await echoClient.register(
+      17              :       projectId: projectId,
+      18              :       clientId: clientId,
+      19              :       firebaseAccessToken: firebaseAccessToken,
+      20              :     );
+      21              : 
+      22            2 :     if (response.status != SUCCESS_STATUS) {
+      23            3 :       if (response.errors != null && response.errors!.isNotEmpty) {
+      24            4 :         throw ArgumentError(response.errors!.first.message);
+      25              :       }
+      26              : 
+      27            0 :       throw Exception('Unknown error');
+      28              :     }
+      29              :   }
+      30              : 
+      31            1 :   @override
+      32              :   Future<void> unregister() async {
+      33            2 :     final projectId = core.projectId;
+      34            3 :     final clientId = await core.crypto.getClientId();
+      35            2 :     final response = await echoClient.unregister(
+      36              :       projectId: projectId,
+      37              :       clientId: clientId,
+      38              :     );
+      39              : 
+      40            2 :     if (response.status != SUCCESS_STATUS) {
+      41            3 :       if (response.errors != null && response.errors!.isNotEmpty) {
+      42            4 :         throw ArgumentError(response.errors!.first.message);
+      43              :       }
+      44              : 
+      45            0 :       throw Exception('Unknown error');
+      46              :     }
+      47              :   }
+      48              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/echo/echo_client.dart.func-c.html b/coverage/html/core/echo/echo_client.dart.func-c.html new file mode 100644 index 00000000..60067cb5 --- /dev/null +++ b/coverage/html/core/echo/echo_client.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/echo/echo_client.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/echo - echo_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %1313
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/echo/echo_client.dart.func.html b/coverage/html/core/echo/echo_client.dart.func.html new file mode 100644 index 00000000..941b8213 --- /dev/null +++ b/coverage/html/core/echo/echo_client.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/echo/echo_client.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/echo - echo_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %1313
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/echo/echo_client.dart.gcov.html b/coverage/html/core/echo/echo_client.dart.gcov.html new file mode 100644 index 00000000..59b3d006 --- /dev/null +++ b/coverage/html/core/echo/echo_client.dart.gcov.html @@ -0,0 +1,119 @@ + + + + + + + LCOV - lcov.info - core/echo/echo_client.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/echo - echo_client.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %1313
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:convert';
+       2              : 
+       3              : import 'package:http/http.dart' as http;
+       4              : import 'package:walletconnect_flutter_v2/apis/core/echo/i_echo_client.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/core/echo/models/echo_body.dart';
+       6              : import 'package:walletconnect_flutter_v2/apis/core/echo/models/echo_response.dart';
+       7              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/i_http_client.dart';
+       8              : 
+       9              : class EchoClient implements IEchoClient {
+      10              :   static const headers = {'Content-Type': 'application/json'};
+      11              :   final IHttpClient httpClient;
+      12              :   final String baseUrl;
+      13              : 
+      14           11 :   EchoClient({required this.baseUrl, required this.httpClient});
+      15              : 
+      16            1 :   @override
+      17              :   Future<EchoResponse> register({
+      18              :     required String projectId,
+      19              :     required String clientId,
+      20              :     required String firebaseAccessToken,
+      21              :   }) async {
+      22            1 :     final body = EchoBody(clientId: clientId, token: firebaseAccessToken);
+      23              : 
+      24            3 :     final url = Uri.parse('$baseUrl/$projectId/clients?auth=$clientId');
+      25            2 :     final http.Response response = await httpClient.post(
+      26              :       url,
+      27              :       headers: headers,
+      28            2 :       body: jsonEncode(body.toJson()),
+      29              :     );
+      30              : 
+      31            2 :     final jsonMap = json.decode(response.body);
+      32            1 :     return EchoResponse.fromJson(jsonMap);
+      33              :   }
+      34              : 
+      35            1 :   @override
+      36              :   Future<EchoResponse> unregister({
+      37              :     required String projectId,
+      38              :     required String clientId,
+      39              :   }) async {
+      40            3 :     final url = Uri.parse('$baseUrl/$projectId/clients/$clientId');
+      41              :     final http.Response response =
+      42            2 :         await httpClient.delete(url, headers: headers);
+      43              : 
+      44            2 :     final jsonMap = json.decode(response.body);
+      45            1 :     return EchoResponse.fromJson(jsonMap);
+      46              :   }
+      47              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/echo/index-sort-f.html b/coverage/html/core/echo/index-sort-f.html new file mode 100644 index 00000000..fd52e9f6 --- /dev/null +++ b/coverage/html/core/echo/index-sort-f.html @@ -0,0 +1,117 @@ + + + + + + + LCOV - lcov.info - core/echo + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/echoCoverageTotalHit
Test:lcov.infoLines:93.3 %3028
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
echo.dart +
88.2%88.2%
+
88.2 %1715-
echo_client.dart +
100.0%
+
100.0 %1313-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/echo/index-sort-l.html b/coverage/html/core/echo/index-sort-l.html new file mode 100644 index 00000000..f0cb662f --- /dev/null +++ b/coverage/html/core/echo/index-sort-l.html @@ -0,0 +1,100 @@ + + + + + + + LCOV - lcov.info - core/echo + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/echoCoverageTotalHit
Test:lcov.infoLines:93.3 %3028
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
echo.dart +
88.2%88.2%
+
88.2 %1715
echo_client.dart +
100.0%
+
100.0 %1313
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/echo/index.html b/coverage/html/core/echo/index.html new file mode 100644 index 00000000..b60e9c16 --- /dev/null +++ b/coverage/html/core/echo/index.html @@ -0,0 +1,100 @@ + + + + + + + LCOV - lcov.info - core/echo + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/echoCoverageTotalHit
Test:lcov.infoLines:93.3 %3028
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
echo.dart +
88.2%88.2%
+
88.2 %1715
echo_client.dart +
100.0%
+
100.0 %1313
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/echo/models/echo_body.dart.func-c.html b/coverage/html/core/echo/models/echo_body.dart.func-c.html new file mode 100644 index 00000000..fcad873d --- /dev/null +++ b/coverage/html/core/echo/models/echo_body.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/echo/models/echo_body.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/echo/models - echo_body.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:50.0 %42
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/echo/models/echo_body.dart.func.html b/coverage/html/core/echo/models/echo_body.dart.func.html new file mode 100644 index 00000000..22c00c55 --- /dev/null +++ b/coverage/html/core/echo/models/echo_body.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/echo/models/echo_body.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/echo/models - echo_body.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:50.0 %42
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/echo/models/echo_body.dart.gcov.html b/coverage/html/core/echo/models/echo_body.dart.gcov.html new file mode 100644 index 00000000..99b01738 --- /dev/null +++ b/coverage/html/core/echo/models/echo_body.dart.gcov.html @@ -0,0 +1,93 @@ + + + + + + + LCOV - lcov.info - core/echo/models/echo_body.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/echo/models - echo_body.dartCoverageTotalHit
Test:lcov.infoLines:50.0 %42
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:json_annotation/json_annotation.dart';
+       2              : 
+       3              : part 'echo_body.g.dart';
+       4              : 
+       5              : @JsonSerializable(fieldRename: FieldRename.snake)
+       6              : class EchoBody {
+       7              :   final String clientId;
+       8              :   final String token;
+       9              :   final String type;
+      10              : 
+      11            1 :   EchoBody({
+      12              :     required this.clientId,
+      13              :     required this.token,
+      14              :     this.type = 'fcm',
+      15              :   });
+      16              : 
+      17            0 :   factory EchoBody.fromJson(Map<String, dynamic> json) =>
+      18            0 :       _$EchoBodyFromJson(json);
+      19              : 
+      20            2 :   Map<String, dynamic> toJson() => _$EchoBodyToJson(this);
+      21              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/echo/models/echo_response.dart.func-c.html b/coverage/html/core/echo/models/echo_response.dart.func-c.html new file mode 100644 index 00000000..b25c49ba --- /dev/null +++ b/coverage/html/core/echo/models/echo_response.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/echo/models/echo_response.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/echo/models - echo_response.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:72.7 %118
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/echo/models/echo_response.dart.func.html b/coverage/html/core/echo/models/echo_response.dart.func.html new file mode 100644 index 00000000..4519efdd --- /dev/null +++ b/coverage/html/core/echo/models/echo_response.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/echo/models/echo_response.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/echo/models - echo_response.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:72.7 %118
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/echo/models/echo_response.dart.gcov.html b/coverage/html/core/echo/models/echo_response.dart.gcov.html new file mode 100644 index 00000000..455f0318 --- /dev/null +++ b/coverage/html/core/echo/models/echo_response.dart.gcov.html @@ -0,0 +1,123 @@ + + + + + + + LCOV - lcov.info - core/echo/models/echo_response.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/echo/models - echo_response.dartCoverageTotalHit
Test:lcov.infoLines:72.7 %118
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:json_annotation/json_annotation.dart';
+       2              : 
+       3              : part 'echo_response.g.dart';
+       4              : 
+       5              : @JsonSerializable(fieldRename: FieldRename.snake)
+       6              : class EchoResponse {
+       7              :   final List<ResponseError>? errors;
+       8              :   final List<Field>? fields;
+       9              :   final String status;
+      10              : 
+      11            1 :   EchoResponse({
+      12              :     this.errors,
+      13              :     this.fields,
+      14              :     required this.status,
+      15              :   });
+      16              : 
+      17            1 :   factory EchoResponse.fromJson(Map<String, dynamic> json) =>
+      18            1 :       _$EchoResponseFromJson(json);
+      19              : 
+      20            0 :   Map<String, dynamic> toJson() => _$EchoResponseToJson(this);
+      21              : }
+      22              : 
+      23              : @JsonSerializable(fieldRename: FieldRename.snake)
+      24              : class ResponseError {
+      25              :   final String message;
+      26              :   final String name;
+      27              : 
+      28            1 :   ResponseError({required this.message, required this.name});
+      29              : 
+      30            1 :   factory ResponseError.fromJson(Map<String, dynamic> json) =>
+      31            1 :       _$ResponseErrorFromJson(json);
+      32              : 
+      33            0 :   Map<String, dynamic> toJson() => _$ResponseErrorToJson(this);
+      34              : }
+      35              : 
+      36              : @JsonSerializable(fieldRename: FieldRename.snake)
+      37              : class Field {
+      38              :   final String description;
+      39              :   final String field;
+      40              :   final String location;
+      41              : 
+      42            1 :   Field({
+      43              :     required this.description,
+      44              :     required this.field,
+      45              :     required this.location,
+      46              :   });
+      47              : 
+      48            2 :   factory Field.fromJson(Map<String, dynamic> json) => _$FieldFromJson(json);
+      49              : 
+      50            0 :   Map<String, dynamic> toJson() => _$FieldToJson(this);
+      51              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/echo/models/index-sort-f.html b/coverage/html/core/echo/models/index-sort-f.html new file mode 100644 index 00000000..b9323b45 --- /dev/null +++ b/coverage/html/core/echo/models/index-sort-f.html @@ -0,0 +1,117 @@ + + + + + + + LCOV - lcov.info - core/echo/models + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/echo/modelsCoverageTotalHit
Test:lcov.infoLines:66.7 %1510
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
echo_body.dart +
50.0%50.0%
+
50.0 %42-
echo_response.dart +
72.7%72.7%
+
72.7 %118-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/echo/models/index-sort-l.html b/coverage/html/core/echo/models/index-sort-l.html new file mode 100644 index 00000000..e4f3b175 --- /dev/null +++ b/coverage/html/core/echo/models/index-sort-l.html @@ -0,0 +1,100 @@ + + + + + + + LCOV - lcov.info - core/echo/models + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/echo/modelsCoverageTotalHit
Test:lcov.infoLines:66.7 %1510
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
echo_body.dart +
50.0%50.0%
+
50.0 %42
echo_response.dart +
72.7%72.7%
+
72.7 %118
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/echo/models/index.html b/coverage/html/core/echo/models/index.html new file mode 100644 index 00000000..b7c8864c --- /dev/null +++ b/coverage/html/core/echo/models/index.html @@ -0,0 +1,100 @@ + + + + + + + LCOV - lcov.info - core/echo/models + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/echo/modelsCoverageTotalHit
Test:lcov.infoLines:66.7 %1510
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
echo_body.dart +
50.0%50.0%
+
50.0 %42
echo_response.dart +
72.7%72.7%
+
72.7 %118
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/heartbit/heartbeat.dart.func-c.html b/coverage/html/core/heartbit/heartbeat.dart.func-c.html new file mode 100644 index 00000000..cbdfc6b4 --- /dev/null +++ b/coverage/html/core/heartbit/heartbeat.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/heartbit/heartbeat.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/heartbit - heartbeat.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:66.7 %96
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/heartbit/heartbeat.dart.func.html b/coverage/html/core/heartbit/heartbeat.dart.func.html new file mode 100644 index 00000000..df62e08b --- /dev/null +++ b/coverage/html/core/heartbit/heartbeat.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/heartbit/heartbeat.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/heartbit - heartbeat.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:66.7 %96
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/heartbit/heartbeat.dart.gcov.html b/coverage/html/core/heartbit/heartbeat.dart.gcov.html new file mode 100644 index 00000000..6a728a27 --- /dev/null +++ b/coverage/html/core/heartbit/heartbeat.dart.gcov.html @@ -0,0 +1,103 @@ + + + + + + + LCOV - lcov.info - core/heartbit/heartbeat.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/heartbit - heartbeat.dartCoverageTotalHit
Test:lcov.infoLines:66.7 %96
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:async';
+       2              : 
+       3              : import 'package:event/event.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/core/heartbit/i_heartbeat.dart';
+       5              : 
+       6              : class HeartBeat implements IHeartBeat {
+       7              :   Timer? _heartbeatTimer;
+       8              : 
+       9              :   @override
+      10              :   int interval;
+      11              : 
+      12           10 :   HeartBeat({this.interval = 5});
+      13              : 
+      14            9 :   @override
+      15              :   void init() {
+      16            9 :     if (_heartbeatTimer != null) return;
+      17           18 :     _heartbeatTimer = Timer.periodic(
+      18           18 :       Duration(seconds: interval),
+      19           18 :       (timer) => onPulse.broadcast(),
+      20              :     );
+      21              :   }
+      22              : 
+      23            0 :   @override
+      24              :   void stop() {
+      25            0 :     _heartbeatTimer?.cancel();
+      26            0 :     _heartbeatTimer = null;
+      27              :   }
+      28              : 
+      29              :   @override
+      30              :   final Event<EventArgs> onPulse = Event();
+      31              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/heartbit/index-sort-f.html b/coverage/html/core/heartbit/index-sort-f.html new file mode 100644 index 00000000..06aa4960 --- /dev/null +++ b/coverage/html/core/heartbit/index-sort-f.html @@ -0,0 +1,105 @@ + + + + + + + LCOV - lcov.info - core/heartbit + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/heartbitCoverageTotalHit
Test:lcov.infoLines:66.7 %96
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
heartbeat.dart +
66.7%66.7%
+
66.7 %96-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/heartbit/index-sort-l.html b/coverage/html/core/heartbit/index-sort-l.html new file mode 100644 index 00000000..c779ba3d --- /dev/null +++ b/coverage/html/core/heartbit/index-sort-l.html @@ -0,0 +1,91 @@ + + + + + + + LCOV - lcov.info - core/heartbit + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/heartbitCoverageTotalHit
Test:lcov.infoLines:66.7 %96
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
heartbeat.dart +
66.7%66.7%
+
66.7 %96
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/heartbit/index.html b/coverage/html/core/heartbit/index.html new file mode 100644 index 00000000..ff323e89 --- /dev/null +++ b/coverage/html/core/heartbit/index.html @@ -0,0 +1,91 @@ + + + + + + + LCOV - lcov.info - core/heartbit + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/heartbitCoverageTotalHit
Test:lcov.infoLines:66.7 %96
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
heartbeat.dart +
66.7%66.7%
+
66.7 %96
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/index-sort-f.html b/coverage/html/core/index-sort-f.html new file mode 100644 index 00000000..3e1b0180 --- /dev/null +++ b/coverage/html/core/index-sort-f.html @@ -0,0 +1,105 @@ + + + + + + + LCOV - lcov.info - core + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - coreCoverageTotalHit
Test:lcov.infoLines:74.5 %5138
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
core.dart +
74.5%74.5%
+
74.5 %5138-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/index-sort-l.html b/coverage/html/core/index-sort-l.html new file mode 100644 index 00000000..701c0090 --- /dev/null +++ b/coverage/html/core/index-sort-l.html @@ -0,0 +1,91 @@ + + + + + + + LCOV - lcov.info - core + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - coreCoverageTotalHit
Test:lcov.infoLines:74.5 %5138
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
core.dart +
74.5%74.5%
+
74.5 %5138
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/index.html b/coverage/html/core/index.html new file mode 100644 index 00000000..e34b4ac2 --- /dev/null +++ b/coverage/html/core/index.html @@ -0,0 +1,91 @@ + + + + + + + LCOV - lcov.info - core + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - coreCoverageTotalHit
Test:lcov.infoLines:74.5 %5138
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
core.dart +
74.5%74.5%
+
74.5 %5138
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/expirer.dart.func-c.html b/coverage/html/core/pairing/expirer.dart.func-c.html new file mode 100644 index 00000000..e3e71c0e --- /dev/null +++ b/coverage/html/core/pairing/expirer.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/pairing/expirer.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairing - expirer.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:76.5 %1713
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/expirer.dart.func.html b/coverage/html/core/pairing/expirer.dart.func.html new file mode 100644 index 00000000..da3aad6f --- /dev/null +++ b/coverage/html/core/pairing/expirer.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/pairing/expirer.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairing - expirer.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:76.5 %1713
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/expirer.dart.gcov.html b/coverage/html/core/pairing/expirer.dart.gcov.html new file mode 100644 index 00000000..fee3ae31 --- /dev/null +++ b/coverage/html/core/pairing/expirer.dart.gcov.html @@ -0,0 +1,136 @@ + + + + + + + LCOV - lcov.info - core/pairing/expirer.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairing - expirer.dartCoverageTotalHit
Test:lcov.infoLines:76.5 %1713
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:event/event.dart';
+       2              : import 'package:walletconnect_flutter_v2/apis/core/pairing/i_expirer.dart';
+       3              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/pairing_models.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/core/store/generic_store.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/utils/walletconnect_utils.dart';
+       6              : 
+       7              : class Expirer extends GenericStore<int> implements IExpirer {
+       8              :   @override
+       9              :   final Event<ExpirationEvent> onExpire = Event();
+      10              : 
+      11           10 :   Expirer({
+      12              :     required super.storage,
+      13              :     required super.context,
+      14              :     required super.version,
+      15              :     required super.fromJson,
+      16              :   });
+      17              : 
+      18            0 :   @override
+      19              :   Future<bool> checkExpiry(String key, int expiry) async {
+      20            0 :     checkInitialized();
+      21              : 
+      22            0 :     if (WalletConnectUtils.isExpired(expiry)) {
+      23            0 :       await expire(key);
+      24              :       return true;
+      25              :     }
+      26              :     return false;
+      27              :   }
+      28              : 
+      29              :   /// Checks if the key has expired and deletes it if it has
+      30              :   /// Returns true if the key was deleted
+      31              :   /// Returns false if the key was not deleted
+      32            6 :   @override
+      33              :   Future<bool> checkAndExpire(String key) async {
+      34            6 :     checkInitialized();
+      35              : 
+      36           12 :     if (data.containsKey(key)) {
+      37           12 :       int expiration = data[key]!;
+      38            6 :       if (WalletConnectUtils.isExpired(expiration)) {
+      39            4 :         await expire(key);
+      40              :         return true;
+      41              :       }
+      42              :     }
+      43              : 
+      44              :     return false;
+      45              :   }
+      46              : 
+      47            4 :   @override
+      48              :   Future<void> expire(String key) async {
+      49            4 :     checkInitialized();
+      50              : 
+      51            8 :     int? expiry = data.remove(key);
+      52              :     if (expiry == null) {
+      53              :       return;
+      54              :     }
+      55              :     // print('Expiring $key');
+      56            8 :     onExpire.broadcast(
+      57            4 :       ExpirationEvent(
+      58              :         target: key,
+      59              :         expiry: expiry,
+      60              :       ),
+      61              :     );
+      62            4 :     await persist();
+      63              :   }
+      64              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/index-sort-f.html b/coverage/html/core/pairing/index-sort-f.html new file mode 100644 index 00000000..9521c990 --- /dev/null +++ b/coverage/html/core/pairing/index-sort-f.html @@ -0,0 +1,141 @@ + + + + + + + LCOV - lcov.info - core/pairing + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairingCoverageTotalHit
Test:lcov.infoLines:89.1 %303270
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
expirer.dart +
76.5%76.5%
+
76.5 %1713-
json_rpc_history.dart +
91.7%91.7%
+
91.7 %1211-
pairing.dart +
89.5%89.5%
+
89.5 %266238-
pairing_store.dart +
100.0%
+
100.0 %88-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/index-sort-l.html b/coverage/html/core/pairing/index-sort-l.html new file mode 100644 index 00000000..c66716f2 --- /dev/null +++ b/coverage/html/core/pairing/index-sort-l.html @@ -0,0 +1,118 @@ + + + + + + + LCOV - lcov.info - core/pairing + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairingCoverageTotalHit
Test:lcov.infoLines:89.1 %303270
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
expirer.dart +
76.5%76.5%
+
76.5 %1713
pairing.dart +
89.5%89.5%
+
89.5 %266238
json_rpc_history.dart +
91.7%91.7%
+
91.7 %1211
pairing_store.dart +
100.0%
+
100.0 %88
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/index.html b/coverage/html/core/pairing/index.html new file mode 100644 index 00000000..f7995060 --- /dev/null +++ b/coverage/html/core/pairing/index.html @@ -0,0 +1,118 @@ + + + + + + + LCOV - lcov.info - core/pairing + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairingCoverageTotalHit
Test:lcov.infoLines:89.1 %303270
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
expirer.dart +
76.5%76.5%
+
76.5 %1713
json_rpc_history.dart +
91.7%91.7%
+
91.7 %1211
pairing.dart +
89.5%89.5%
+
89.5 %266238
pairing_store.dart +
100.0%
+
100.0 %88
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/json_rpc_history.dart.func-c.html b/coverage/html/core/pairing/json_rpc_history.dart.func-c.html new file mode 100644 index 00000000..d500c7e4 --- /dev/null +++ b/coverage/html/core/pairing/json_rpc_history.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/pairing/json_rpc_history.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairing - json_rpc_history.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:91.7 %1211
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/json_rpc_history.dart.func.html b/coverage/html/core/pairing/json_rpc_history.dart.func.html new file mode 100644 index 00000000..ee21ab03 --- /dev/null +++ b/coverage/html/core/pairing/json_rpc_history.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/pairing/json_rpc_history.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairing - json_rpc_history.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:91.7 %1211
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/json_rpc_history.dart.gcov.html b/coverage/html/core/pairing/json_rpc_history.dart.gcov.html new file mode 100644 index 00000000..8e215e39 --- /dev/null +++ b/coverage/html/core/pairing/json_rpc_history.dart.gcov.html @@ -0,0 +1,110 @@ + + + + + + + LCOV - lcov.info - core/pairing/json_rpc_history.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairing - json_rpc_history.dartCoverageTotalHit
Test:lcov.infoLines:91.7 %1211
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:walletconnect_flutter_v2/apis/core/pairing/i_json_rpc_history.dart';
+       2              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/pairing_models.dart';
+       3              : import 'package:walletconnect_flutter_v2/apis/core/store/generic_store.dart';
+       4              : 
+       5              : class JsonRpcHistory extends GenericStore<JsonRpcRecord>
+       6              :     implements IJsonRpcHistory {
+       7           11 :   JsonRpcHistory({
+       8              :     required super.storage,
+       9              :     required super.context,
+      10              :     required super.version,
+      11              :     required super.fromJson,
+      12              :   });
+      13              : 
+      14            1 :   @override
+      15              :   Future<void> resolve(Map<String, dynamic> response) async {
+      16            1 :     checkInitialized();
+      17              : 
+      18              :     // If we don't have a matching id, stop
+      19            2 :     String sId = response['id'].toString();
+      20            2 :     if (!data.containsKey(sId)) {
+      21              :       return;
+      22              :     }
+      23              : 
+      24            1 :     JsonRpcRecord record = get(sId)!;
+      25              : 
+      26              :     // If we already recorded a response, stop
+      27            1 :     if (record.response != null) {
+      28              :       return;
+      29              :     }
+      30              : 
+      31            2 :     record = record.copyWith(
+      32            1 :       response: response.containsKey('result')
+      33            1 :           ? response['result']
+      34            0 :           : response['error'],
+      35              :     );
+      36            1 :     await set(sId, record);
+      37              :   }
+      38              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/pairing.dart.func-c.html b/coverage/html/core/pairing/pairing.dart.func-c.html new file mode 100644 index 00000000..e55a9469 --- /dev/null +++ b/coverage/html/core/pairing/pairing.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/pairing/pairing.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairing - pairing.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:89.5 %266238
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/pairing.dart.func.html b/coverage/html/core/pairing/pairing.dart.func.html new file mode 100644 index 00000000..9e103990 --- /dev/null +++ b/coverage/html/core/pairing/pairing.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/pairing/pairing.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairing - pairing.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:89.5 %266238
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/pairing.dart.gcov.html b/coverage/html/core/pairing/pairing.dart.gcov.html new file mode 100644 index 00000000..3c04729e --- /dev/null +++ b/coverage/html/core/pairing/pairing.dart.gcov.html @@ -0,0 +1,909 @@ + + + + + + + LCOV - lcov.info - core/pairing/pairing.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairing - pairing.dartCoverageTotalHit
Test:lcov.infoLines:89.5 %266238
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:async';
+       2              : import 'dart:convert';
+       3              : 
+       4              : import 'package:event/event.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/core/pairing/i_json_rpc_history.dart';
+       6              : import 'package:walletconnect_flutter_v2/apis/core/store/i_generic_store.dart';
+       7              : import 'package:walletconnect_flutter_v2/apis/core/crypto/crypto_models.dart';
+       8              : import 'package:walletconnect_flutter_v2/apis/core/i_core.dart';
+       9              : import 'package:walletconnect_flutter_v2/apis/core/pairing/i_pairing.dart';
+      10              : import 'package:walletconnect_flutter_v2/apis/core/pairing/i_pairing_store.dart';
+      11              : import 'package:walletconnect_flutter_v2/apis/models/uri_parse_result.dart';
+      12              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/pairing_models.dart';
+      13              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/json_rpc_utils.dart';
+      14              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client_models.dart';
+      15              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_error.dart';
+      16              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_request.dart';
+      17              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_response.dart';
+      18              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
+      19              : import 'package:walletconnect_flutter_v2/apis/utils/constants.dart';
+      20              : import 'package:walletconnect_flutter_v2/apis/utils/errors.dart';
+      21              : import 'package:walletconnect_flutter_v2/apis/utils/method_constants.dart';
+      22              : import 'package:walletconnect_flutter_v2/apis/utils/walletconnect_utils.dart';
+      23              : 
+      24              : class PendingRequestResponse {
+      25              :   Completer completer;
+      26              :   dynamic response;
+      27              :   JsonRpcError? error;
+      28              : 
+      29            6 :   PendingRequestResponse({
+      30              :     required this.completer,
+      31              :     this.response,
+      32              :     this.error,
+      33              :   });
+      34              : }
+      35              : 
+      36              : class Pairing implements IPairing {
+      37              :   bool _initialized = false;
+      38              : 
+      39              :   @override
+      40              :   final Event<PairingEvent> onPairingCreate = Event<PairingEvent>();
+      41              :   @override
+      42              :   final Event<PairingActivateEvent> onPairingActivate =
+      43              :       Event<PairingActivateEvent>();
+      44              :   @override
+      45              :   final Event<PairingEvent> onPairingPing = Event<PairingEvent>();
+      46              :   @override
+      47              :   final Event<PairingInvalidEvent> onPairingInvalid =
+      48              :       Event<PairingInvalidEvent>();
+      49              :   @override
+      50              :   final Event<PairingEvent> onPairingDelete = Event<PairingEvent>();
+      51              :   @override
+      52              :   final Event<PairingEvent> onPairingExpire = Event<PairingEvent>();
+      53              : 
+      54              :   /// Stores all the pending requests
+      55              :   Map<int, PendingRequestResponse> pendingRequests = {};
+      56              : 
+      57              :   final ICore core;
+      58              :   final IPairingStore pairings;
+      59              :   final IJsonRpcHistory history;
+      60              : 
+      61              :   /// Stores the public key of Type 1 Envelopes for a topic
+      62              :   /// Once a receiver public key has been used, it is removed from the store
+      63              :   /// Thus, this store works under the assumption that a public key will only be used once
+      64              :   final IGenericStore<ReceiverPublicKey> topicToReceiverPublicKey;
+      65              : 
+      66           10 :   Pairing({
+      67              :     required this.core,
+      68              :     required this.pairings,
+      69              :     required this.history,
+      70              :     required this.topicToReceiverPublicKey,
+      71              :   });
+      72              : 
+      73            9 :   @override
+      74              :   Future<void> init() async {
+      75            9 :     if (_initialized) {
+      76              :       return;
+      77              :     }
+      78              : 
+      79            9 :     _registerRelayEvents();
+      80            9 :     _registerExpirerEvents();
+      81            9 :     _registerheartbeatSubscription();
+      82              : 
+      83           27 :     await core.expirer.init();
+      84           18 :     await pairings.init();
+      85           18 :     await history.init();
+      86           18 :     await topicToReceiverPublicKey.init();
+      87              : 
+      88            9 :     await _cleanup();
+      89              : 
+      90            9 :     await _resubscribeAll();
+      91              : 
+      92            9 :     _initialized = true;
+      93              :   }
+      94              : 
+      95            6 :   @override
+      96              :   Future<void> checkAndExpire() async {
+      97           12 :     for (var pairing in getPairings()) {
+      98           24 :       await core.expirer.checkAndExpire(pairing.topic);
+      99              :     }
+     100              :   }
+     101              : 
+     102            7 :   @override
+     103              :   Future<CreateResponse> create({List<List<String>>? methods}) async {
+     104            7 :     _checkInitialized();
+     105           28 :     final String symKey = core.crypto.getUtils().generateRandomBytes32();
+     106           21 :     final String topic = await core.crypto.setSymKey(symKey);
+     107            7 :     final int expiry = WalletConnectUtils.calculateExpiry(
+     108              :       WalletConnectConstants.FIVE_MINUTES,
+     109              :     );
+     110            7 :     final Relay relay = Relay(WalletConnectConstants.RELAYER_DEFAULT_PROTOCOL);
+     111            7 :     final PairingInfo pairing = PairingInfo(
+     112              :       topic: topic,
+     113              :       expiry: expiry,
+     114              :       relay: relay,
+     115              :       active: false,
+     116           20 :       methods: methods?.expand((e) => e).toList() ?? [],
+     117              :     );
+     118            7 :     final Uri uri = WalletConnectUtils.formatUri(
+     119           14 :       protocol: core.protocol,
+     120           14 :       version: core.version,
+     121              :       topic: topic,
+     122              :       symKey: symKey,
+     123              :       relay: relay,
+     124              :       methods: methods,
+     125              :       expiry: expiry,
+     126              :     );
+     127              : 
+     128           14 :     onPairingCreate.broadcast(
+     129            7 :       PairingEvent(
+     130              :         topic: topic,
+     131              :       ),
+     132              :     );
+     133              : 
+     134           14 :     await pairings.set(topic, pairing);
+     135           21 :     await core.relayClient.subscribe(topic: topic);
+     136           21 :     await core.expirer.set(topic, expiry);
+     137              : 
+     138            7 :     return CreateResponse(
+     139              :       topic: topic,
+     140              :       uri: uri,
+     141              :       pairingInfo: pairing,
+     142              :     );
+     143              :   }
+     144              : 
+     145            7 :   @override
+     146              :   Future<PairingInfo> pair({
+     147              :     required Uri uri,
+     148              :     bool activatePairing = false,
+     149              :   }) async {
+     150            7 :     _checkInitialized();
+     151              : 
+     152              :     // print(uri.queryParameters);
+     153            7 :     final int expiry = WalletConnectUtils.calculateExpiry(
+     154              :       WalletConnectConstants.FIVE_MINUTES,
+     155              :     );
+     156            7 :     final URIParseResult parsedUri = WalletConnectUtils.parseUri(uri);
+     157           14 :     if (parsedUri.version != URIVersion.v2) {
+     158            3 :       throw Errors.getInternalError(
+     159              :         Errors.MISSING_OR_INVALID,
+     160              :         context: 'URI is not WalletConnect version 2 URI',
+     161              :       );
+     162              :     }
+     163              : 
+     164            7 :     final String topic = parsedUri.topic;
+     165           14 :     final Relay relay = parsedUri.v2Data!.relay;
+     166           14 :     final String symKey = parsedUri.v2Data!.symKey;
+     167            7 :     final PairingInfo pairing = PairingInfo(
+     168              :       topic: topic,
+     169              :       expiry: expiry,
+     170              :       relay: relay,
+     171              :       active: false,
+     172           14 :       methods: parsedUri.v2Data!.methods,
+     173              :     );
+     174              : 
+     175              :     try {
+     176            7 :       JsonRpcUtils.validateMethods(
+     177           14 :         parsedUri.v2Data!.methods,
+     178           21 :         routerMapRequest.values.toList(),
+     179              :       );
+     180            4 :     } on WalletConnectError catch (e) {
+     181              :       // Tell people that the pairing is invalid
+     182            8 :       onPairingInvalid.broadcast(
+     183            4 :         PairingInvalidEvent(
+     184            4 :           message: e.message,
+     185              :         ),
+     186              :       );
+     187              : 
+     188              :       // Delete the pairing: "publish internally with reason"
+     189              :       // await _deletePairing(
+     190              :       //   topic,
+     191              :       //   false,
+     192              :       // );
+     193              : 
+     194              :       rethrow;
+     195              :     }
+     196              : 
+     197              :     try {
+     198           14 :       await pairings.set(topic, pairing);
+     199           21 :       await core.crypto.setSymKey(symKey, overrideTopic: topic);
+     200           28 :       await core.relayClient.subscribe(topic: topic).timeout(
+     201              :             const Duration(seconds: 15),
+     202              :           );
+     203           21 :       await core.expirer.set(topic, expiry);
+     204              : 
+     205           14 :       onPairingCreate.broadcast(
+     206            7 :         PairingEvent(
+     207              :           topic: topic,
+     208              :         ),
+     209              :       );
+     210              : 
+     211              :       if (activatePairing) {
+     212            2 :         await activate(topic: topic);
+     213              :       }
+     214              :     } catch (e) {
+     215              :       rethrow;
+     216              :     }
+     217              : 
+     218              :     return pairing;
+     219              :   }
+     220              : 
+     221            7 :   @override
+     222              :   Future<void> activate({required String topic}) async {
+     223            7 :     _checkInitialized();
+     224            7 :     final int expiry = WalletConnectUtils.calculateExpiry(
+     225              :       WalletConnectConstants.THIRTY_DAYS,
+     226              :     );
+     227              :     // print('Activating pairing with topic: $topic');
+     228              : 
+     229           14 :     onPairingActivate.broadcast(
+     230            7 :       PairingActivateEvent(
+     231              :         topic: topic,
+     232              :         expiry: expiry,
+     233              :       ),
+     234              :     );
+     235              : 
+     236           14 :     await pairings.update(
+     237              :       topic,
+     238              :       expiry: expiry,
+     239              :       active: true,
+     240              :     );
+     241           21 :     await core.expirer.set(topic, expiry);
+     242              :   }
+     243              : 
+     244            9 :   @override
+     245              :   void register({
+     246              :     required String method,
+     247              :     required Function(String, JsonRpcRequest) function,
+     248              :     required ProtocolType type,
+     249              :   }) {
+     250           18 :     if (routerMapRequest.containsKey(method)) {
+     251            6 :       final registered = routerMapRequest[method];
+     252            6 :       if (registered!.type == type) {
+     253              :         throw const WalletConnectError(
+     254              :           code: -1,
+     255              :           message: 'Method already exists',
+     256              :         );
+     257              :       }
+     258              :     }
+     259              : 
+     260           27 :     routerMapRequest[method] = RegisteredFunction(
+     261              :       method: method,
+     262              :       function: function,
+     263              :       type: type,
+     264              :     );
+     265              :   }
+     266              : 
+     267            2 :   @override
+     268              :   Future<void> setReceiverPublicKey({
+     269              :     required String topic,
+     270              :     required String publicKey,
+     271              :     int? expiry,
+     272              :   }) async {
+     273            2 :     _checkInitialized();
+     274            4 :     await topicToReceiverPublicKey.set(
+     275              :       topic,
+     276            2 :       ReceiverPublicKey(
+     277              :         topic: topic,
+     278              :         publicKey: publicKey,
+     279            2 :         expiry: WalletConnectUtils.calculateExpiry(
+     280              :           expiry ?? WalletConnectConstants.FIVE_MINUTES,
+     281              :         ),
+     282              :       ),
+     283              :     );
+     284              :   }
+     285              : 
+     286            1 :   @override
+     287              :   Future<void> updateExpiry({
+     288              :     required String topic,
+     289              :     required int expiry,
+     290              :   }) async {
+     291            1 :     _checkInitialized();
+     292              : 
+     293              :     // Validate the expiry is less than 30 days
+     294            1 :     if (expiry >
+     295            1 :         WalletConnectUtils.calculateExpiry(
+     296              :           WalletConnectConstants.THIRTY_DAYS,
+     297              :         )) {
+     298              :       throw const WalletConnectError(
+     299              :         code: -1,
+     300              :         message: 'Expiry cannot be more than 30 days away',
+     301              :       );
+     302              :     }
+     303              : 
+     304            2 :     await pairings.update(
+     305              :       topic,
+     306              :       expiry: expiry,
+     307              :     );
+     308            3 :     await core.expirer.set(
+     309              :       topic,
+     310              :       expiry,
+     311              :     );
+     312              :   }
+     313              : 
+     314            5 :   @override
+     315              :   Future<void> updateMetadata({
+     316              :     required String topic,
+     317              :     required PairingMetadata metadata,
+     318              :   }) async {
+     319            5 :     _checkInitialized();
+     320           10 :     await pairings.update(
+     321              :       topic,
+     322              :       metadata: metadata,
+     323              :     );
+     324              :   }
+     325              : 
+     326            9 :   @override
+     327              :   List<PairingInfo> getPairings() {
+     328           18 :     return pairings.getAll();
+     329              :   }
+     330              : 
+     331            4 :   @override
+     332              :   PairingInfo? getPairing({required String topic}) {
+     333            8 :     return pairings.get(topic);
+     334              :   }
+     335              : 
+     336            5 :   @override
+     337              :   Future<void> ping({required String topic}) async {
+     338            5 :     _checkInitialized();
+     339              : 
+     340            5 :     await _isValidPing(topic);
+     341              : 
+     342           10 :     if (pairings.has(topic)) {
+     343              :       // try {
+     344            5 :       final bool _ = await sendRequest(
+     345              :         topic,
+     346              :         MethodConstants.WC_PAIRING_PING,
+     347            5 :         {},
+     348              :       );
+     349              :     }
+     350              :   }
+     351              : 
+     352            4 :   @override
+     353              :   Future<void> disconnect({required String topic}) async {
+     354            4 :     _checkInitialized();
+     355              : 
+     356            4 :     await _isValidDisconnect(topic);
+     357            8 :     if (pairings.has(topic)) {
+     358              :       // Send the request to delete the pairing, we don't care if it fails
+     359              :       try {
+     360            4 :         sendRequest(
+     361              :           topic,
+     362              :           MethodConstants.WC_PAIRING_DELETE,
+     363            8 :           Errors.getSdkError(Errors.USER_DISCONNECTED).toJson(),
+     364              :         );
+     365              :       } catch (_) {}
+     366              : 
+     367              :       // Delete the pairing
+     368            8 :       await pairings.delete(topic);
+     369              : 
+     370            8 :       onPairingDelete.broadcast(
+     371            4 :         PairingEvent(
+     372              :           topic: topic,
+     373              :         ),
+     374              :       );
+     375              :     }
+     376              :   }
+     377              : 
+     378            5 :   @override
+     379              :   IPairingStore getStore() {
+     380            5 :     return pairings;
+     381              :   }
+     382              : 
+     383            6 :   @override
+     384              :   Future<void> isValidPairingTopic({required String topic}) async {
+     385           12 :     if (!pairings.has(topic)) {
+     386            4 :       throw Errors.getInternalError(
+     387              :         Errors.NO_MATCHING_KEY,
+     388            4 :         context: "pairing topic doesn't exist: $topic",
+     389              :       );
+     390              :     }
+     391              : 
+     392           18 :     if (await core.expirer.checkAndExpire(topic)) {
+     393            0 :       throw Errors.getInternalError(
+     394              :         Errors.EXPIRED,
+     395            0 :         context: 'pairing topic: $topic',
+     396              :       );
+     397              :     }
+     398              :   }
+     399              : 
+     400              :   // RELAY COMMUNICATION HELPERS
+     401              : 
+     402            6 :   @override
+     403              :   Future sendRequest(
+     404              :     String topic,
+     405              :     String method,
+     406              :     dynamic params, {
+     407              :     int? id,
+     408              :     int? ttl,
+     409              :     EncodeOptions? encodeOptions,
+     410              :   }) async {
+     411           18 :     core.logger.t(
+     412            6 :       'pairing sendRequest, id: $id topic: $topic, method: $method, params: $params, ttl: $ttl',
+     413              :     );
+     414              : 
+     415            6 :     final payload = JsonRpcUtils.formatJsonRpcRequest(
+     416              :       method,
+     417              :       params,
+     418              :       id: id,
+     419              :     );
+     420              :     // print('sending request: $payload');
+     421              : 
+     422           18 :     final message = await core.crypto.encode(
+     423              :       topic,
+     424              :       payload,
+     425              :       options: encodeOptions,
+     426              :     );
+     427              : 
+     428              :     if (message == null) {
+     429              :       return;
+     430              :     }
+     431              : 
+     432           12 :     RpcOptions opts = MethodConstants.RPC_OPTS[method]!['req']!;
+     433              :     if (ttl != null) {
+     434            4 :       opts = opts.copyWith(ttl: ttl);
+     435              :     }
+     436              : 
+     437              :     // print('adding payload to pending requests: ${payload['id']}');
+     438           12 :     final resp = PendingRequestResponse(completer: Completer());
+     439           21 :     resp.completer.future.catchError((err) {
+     440              :       // Catch the error so that it won't throw an uncaught error
+     441              :     });
+     442           18 :     pendingRequests[payload['id']] = resp;
+     443              :     // print('sent request');
+     444           18 :     await core.relayClient.publish(
+     445              :       topic: topic,
+     446              :       message: message,
+     447            6 :       ttl: opts.ttl,
+     448            6 :       tag: opts.tag,
+     449              :     );
+     450              : 
+     451              :     // Get the result from the completer, if it's an error, throw it
+     452              :     try {
+     453            6 :       if (resp.error != null) {
+     454            0 :         throw resp.error!;
+     455              :       }
+     456              : 
+     457              :       // print('checking if completed');
+     458           12 :       if (resp.completer.isCompleted) {
+     459            0 :         return resp.response;
+     460              :       }
+     461              : 
+     462           12 :       return await resp.completer.future;
+     463              :     } catch (e) {
+     464              :       rethrow;
+     465              :     }
+     466              :   }
+     467              : 
+     468            6 :   @override
+     469              :   Future<void> sendResult(
+     470              :     int id,
+     471              :     String topic,
+     472              :     String method,
+     473              :     dynamic result, {
+     474              :     EncodeOptions? encodeOptions,
+     475              :   }) async {
+     476           18 :     core.logger.t(
+     477            6 :       'pairing sendResult, id: $id topic: $topic, method: $method, result: $result',
+     478              :     );
+     479              :     final Map<String, dynamic> payload =
+     480            6 :         JsonRpcUtils.formatJsonRpcResponse<dynamic>(
+     481              :       id,
+     482              :       result,
+     483              :     );
+     484           18 :     final String? message = await core.crypto.encode(
+     485              :       topic,
+     486              :       payload,
+     487              :       options: encodeOptions,
+     488              :     );
+     489              : 
+     490              :     if (message == null) {
+     491              :       return;
+     492              :     }
+     493              : 
+     494           12 :     final RpcOptions opts = MethodConstants.RPC_OPTS[method]!['res']!;
+     495           18 :     await core.relayClient.publish(
+     496              :       topic: topic,
+     497              :       message: message,
+     498            6 :       ttl: opts.ttl,
+     499            6 :       tag: opts.tag,
+     500              :     );
+     501              :   }
+     502              : 
+     503            3 :   @override
+     504              :   Future<void> sendError(
+     505              :     int id,
+     506              :     String topic,
+     507              :     String method,
+     508              :     JsonRpcError error, {
+     509              :     EncodeOptions? encodeOptions,
+     510              :     RpcOptions? rpcOptions,
+     511              :   }) async {
+     512            9 :     core.logger.t(
+     513            3 :       'pairing sendError, id: $id topic: $topic, method: $method, error: $error',
+     514              :     );
+     515              : 
+     516            3 :     final Map<String, dynamic> payload = JsonRpcUtils.formatJsonRpcError(
+     517              :       id,
+     518              :       error,
+     519              :     );
+     520            9 :     final String? message = await core.crypto.encode(
+     521              :       topic,
+     522              :       payload,
+     523              :       options: encodeOptions,
+     524              :     );
+     525              : 
+     526              :     if (message == null) {
+     527              :       return;
+     528              :     }
+     529              : 
+     530              :     final fallbackMethod = MethodConstants.UNREGISTERED_METHOD;
+     531            3 :     final fallbackRpcOpts = MethodConstants.RPC_OPTS[method] ??
+     532            0 :         MethodConstants.RPC_OPTS[fallbackMethod]!;
+     533            6 :     final fallbackOpts = fallbackRpcOpts['reject'] ?? fallbackRpcOpts['res']!;
+     534              : 
+     535              :     final RpcOptions opts = rpcOptions ?? fallbackOpts;
+     536              : 
+     537            9 :     await core.relayClient.publish(
+     538              :       topic: topic,
+     539              :       message: message,
+     540            3 :       ttl: opts.ttl,
+     541            3 :       tag: opts.tag,
+     542              :     );
+     543              :   }
+     544              : 
+     545              :   /// ---- Private Helpers ---- ///
+     546              : 
+     547            9 :   Future<void> _resubscribeAll() async {
+     548              :     // If the relay is not active, stop here
+     549           27 :     if (!core.relayClient.isConnected) {
+     550              :       return;
+     551              :     }
+     552              : 
+     553              :     // Resubscribe to all active pairings
+     554           16 :     final List<PairingInfo> activePairings = pairings.getAll();
+     555            8 :     for (final PairingInfo pairing in activePairings) {
+     556            0 :       if (pairing.active) {
+     557              :         // print('Resubscribing to topic: ${pairing.topic}');
+     558            0 :         await core.relayClient.subscribe(topic: pairing.topic);
+     559              :       }
+     560              :     }
+     561              :   }
+     562              : 
+     563            2 :   Future<void> _deletePairing(String topic, bool expirerHasDeleted) async {
+     564            6 :     await core.relayClient.unsubscribe(topic: topic);
+     565            4 :     await pairings.delete(topic);
+     566            6 :     await core.crypto.deleteSymKey(topic);
+     567              :     if (expirerHasDeleted) {
+     568            6 :       await core.expirer.delete(topic);
+     569              :     }
+     570              :   }
+     571              : 
+     572            9 :   Future<void> _cleanup() async {
+     573            9 :     final List<PairingInfo> expiredPairings = getPairings()
+     574            9 :         .where(
+     575            3 :           (PairingInfo info) => WalletConnectUtils.isExpired(info.expiry),
+     576              :         )
+     577            9 :         .toList();
+     578           10 :     for (final PairingInfo pairing in expiredPairings) {
+     579              :       // print('deleting expired pairing: ${pairing.topic}');
+     580            2 :       await _deletePairing(pairing.topic, true);
+     581              :     }
+     582              : 
+     583              :     // Cleanup all history records
+     584            9 :     final List<JsonRpcRecord> expiredHistory = history
+     585            9 :         .getAll()
+     586            9 :         .where(
+     587            4 :           (record) => WalletConnectUtils.isExpired(record.expiry ?? -1),
+     588              :         )
+     589            9 :         .toList();
+     590              :     // Loop through the expired records and delete them
+     591           10 :     for (final JsonRpcRecord record in expiredHistory) {
+     592              :       // print('deleting expired history record: ${record.id}');
+     593            4 :       await history.delete(record.id.toString());
+     594              :     }
+     595              : 
+     596              :     // Cleanup all of the expired receiver public keys
+     597              :     final List<ReceiverPublicKey> expiredReceiverPublicKeys =
+     598            9 :         topicToReceiverPublicKey
+     599            9 :             .getAll()
+     600           12 :             .where((receiver) => WalletConnectUtils.isExpired(receiver.expiry))
+     601            9 :             .toList();
+     602              :     // Loop through the expired receiver public keys and delete them
+     603           10 :     for (final ReceiverPublicKey receiver in expiredReceiverPublicKeys) {
+     604              :       // print('deleting expired receiver public key: $receiver');
+     605            3 :       await topicToReceiverPublicKey.delete(receiver.topic);
+     606              :     }
+     607              :   }
+     608              : 
+     609            7 :   void _checkInitialized() {
+     610            7 :     if (!_initialized) {
+     611            0 :       throw Errors.getInternalError(Errors.NOT_INITIALIZED);
+     612              :     }
+     613              :   }
+     614              : 
+     615              :   /// ---- Relay Event Router ---- ///
+     616              : 
+     617              :   Map<String, RegisteredFunction> routerMapRequest = {};
+     618              : 
+     619            9 :   void _registerRelayEvents() {
+     620           45 :     core.relayClient.onRelayClientConnect.subscribe(_onRelayConnect);
+     621           45 :     core.relayClient.onRelayClientMessage.subscribe(_onMessageEvent);
+     622              : 
+     623            9 :     register(
+     624              :       method: MethodConstants.WC_PAIRING_PING,
+     625            9 :       function: _onPairingPingRequest,
+     626              :       type: ProtocolType.pair,
+     627              :     );
+     628            9 :     register(
+     629              :       method: MethodConstants.WC_PAIRING_DELETE,
+     630            9 :       function: _onPairingDeleteRequest,
+     631              :       type: ProtocolType.pair,
+     632              :     );
+     633              :   }
+     634              : 
+     635            0 :   Future<void> _onRelayConnect(EventArgs? args) async {
+     636              :     // print('Pairing: Relay connected');
+     637            0 :     await _resubscribeAll();
+     638              :   }
+     639              : 
+     640            6 :   void _onMessageEvent(MessageEvent? event) async {
+     641              :     if (event == null) {
+     642              :       return;
+     643              :     }
+     644              : 
+     645              :     // If we have a reciever public key for the topic, use it
+     646              :     ReceiverPublicKey? receiverPublicKey =
+     647           18 :         topicToReceiverPublicKey.get(event.topic);
+     648              :     // If there was a public key, delete it. One use.
+     649              :     if (receiverPublicKey != null) {
+     650            6 :       await topicToReceiverPublicKey.delete(event.topic);
+     651              :     }
+     652              : 
+     653              :     // Decode the message
+     654           18 :     String? payloadString = await core.crypto.decode(
+     655            6 :       event.topic,
+     656            6 :       event.message,
+     657            6 :       options: DecodeOptions(
+     658            2 :         receiverPublicKey: receiverPublicKey?.publicKey,
+     659              :       ),
+     660              :     );
+     661              : 
+     662              :     if (payloadString == null) {
+     663              :       return;
+     664              :     }
+     665              :     // print(payloadString);
+     666              : 
+     667            6 :     Map<String, dynamic> data = jsonDecode(payloadString);
+     668           24 :     core.logger.i('Pairing _onMessageEvent, Received data: $data');
+     669              : 
+     670              :     // If it's an rpc request, handle it
+     671              :     // print('Pairing: Received data: $data');
+     672            6 :     if (data.containsKey('method')) {
+     673            6 :       final request = JsonRpcRequest.fromJson(data);
+     674           18 :       if (routerMapRequest.containsKey(request.method)) {
+     675           36 :         routerMapRequest[request.method]!.function(event.topic, request);
+     676              :       } else {
+     677            0 :         _onUnkownRpcMethodRequest(event.topic, request);
+     678              :       }
+     679              :     }
+     680              :     // Otherwise handle it as a response
+     681              :     else {
+     682            6 :       final response = JsonRpcResponse.fromJson(data);
+     683              : 
+     684              :       // Only handle the response if we have a record of the request
+     685              :       // final JsonRpcRecord? record = history.get(response.id.toString());
+     686              :       // // print(record);
+     687              :       // if (record == null) {
+     688              :       //   return;
+     689              :       // }
+     690              : 
+     691              :       // print(
+     692              :       //   'pendingRequests: ${pendingRequests.keys} has ${response.id} is ${pendingRequests.containsKey(response.id)}',
+     693              :       // );
+     694           18 :       if (pendingRequests.containsKey(response.id)) {
+     695            6 :         if (response.error != null) {
+     696           15 :           pendingRequests[response.id]!.error = response.error;
+     697            9 :           pendingRequests[response.id]!
+     698            3 :               .completer
+     699            6 :               .completeError(response.error!);
+     700              :         } else {
+     701              :           // print(
+     702              :           //   'completing: ${response.result}',
+     703              :           // );
+     704           30 :           pendingRequests[response.id]!.response = response.result;
+     705           36 :           pendingRequests[response.id]!.completer.complete(response.result);
+     706              :         }
+     707              :       }
+     708              :     }
+     709              :   }
+     710              : 
+     711            5 :   Future<void> _onPairingPingRequest(
+     712              :     String topic,
+     713              :     JsonRpcRequest request,
+     714              :   ) async {
+     715            5 :     final int id = request.id;
+     716              :     try {
+     717              :       // print('ping req');
+     718            5 :       await _isValidPing(topic);
+     719            5 :       await sendResult(
+     720              :         id,
+     721              :         topic,
+     722            5 :         request.method,
+     723              :         true,
+     724              :       );
+     725           10 :       onPairingPing.broadcast(
+     726            5 :         PairingEvent(
+     727              :           id: id,
+     728              :           topic: topic,
+     729              :         ),
+     730              :       );
+     731            0 :     } on JsonRpcError catch (e) {
+     732              :       // print(e);
+     733            0 :       await sendError(
+     734              :         id,
+     735              :         topic,
+     736            0 :         request.method,
+     737              :         e,
+     738              :       );
+     739              :     }
+     740              :   }
+     741              : 
+     742            4 :   Future<void> _onPairingDeleteRequest(
+     743              :     String topic,
+     744              :     JsonRpcRequest request,
+     745              :   ) async {
+     746              :     // print('delete');
+     747            4 :     final int id = request.id;
+     748              :     try {
+     749            4 :       await _isValidDisconnect(topic);
+     750            4 :       await sendResult(
+     751              :         id,
+     752              :         topic,
+     753            4 :         request.method,
+     754              :         true,
+     755              :       );
+     756            8 :       await pairings.delete(topic);
+     757            8 :       onPairingDelete.broadcast(
+     758            4 :         PairingEvent(
+     759              :           id: id,
+     760              :           topic: topic,
+     761              :         ),
+     762              :       );
+     763            0 :     } on JsonRpcError catch (e) {
+     764            0 :       await sendError(
+     765              :         id,
+     766              :         topic,
+     767            0 :         request.method,
+     768              :         e,
+     769              :       );
+     770              :     }
+     771              :   }
+     772              : 
+     773            0 :   Future<void> _onUnkownRpcMethodRequest(
+     774              :     String topic,
+     775              :     JsonRpcRequest request,
+     776              :   ) async {
+     777            0 :     final int id = request.id;
+     778            0 :     final String method = request.method;
+     779              :     try {
+     780            0 :       if (routerMapRequest.containsKey(method)) {
+     781              :         return;
+     782              :       }
+     783            0 :       final String message = Errors.getSdkError(
+     784              :         Errors.WC_METHOD_UNSUPPORTED,
+     785              :         context: method,
+     786            0 :       ).message;
+     787            0 :       await sendError(
+     788              :         id,
+     789              :         topic,
+     790            0 :         request.method,
+     791            0 :         JsonRpcError.methodNotFound(message),
+     792              :       );
+     793            0 :     } on JsonRpcError catch (e) {
+     794            0 :       await sendError(id, topic, request.method, e);
+     795              :     }
+     796              :   }
+     797              : 
+     798              :   /// ---- Expirer Events ---- ///
+     799              : 
+     800            9 :   void _registerExpirerEvents() {
+     801           45 :     core.expirer.onExpire.subscribe(_onExpired);
+     802              :   }
+     803              : 
+     804            9 :   void _registerheartbeatSubscription() {
+     805           45 :     core.heartbeat.onPulse.subscribe(_heartbeatSubscription);
+     806              :   }
+     807              : 
+     808            4 :   Future<void> _onExpired(ExpirationEvent? event) async {
+     809              :     if (event == null) {
+     810              :       return;
+     811              :     }
+     812              : 
+     813           12 :     if (pairings.has(event.target)) {
+     814              :       // Clean up the pairing
+     815            2 :       await _deletePairing(event.target, true);
+     816            2 :       onPairingExpire.broadcast(
+     817            1 :         PairingEvent(
+     818            1 :           topic: event.target,
+     819              :         ),
+     820              :       );
+     821              :     }
+     822              :   }
+     823              : 
+     824            6 :   void _heartbeatSubscription(EventArgs? args) async {
+     825            6 :     await checkAndExpire();
+     826              :   }
+     827              : 
+     828              :   /// ---- Validators ---- ///
+     829              : 
+     830            5 :   Future<void> _isValidPing(String topic) async {
+     831            5 :     await isValidPairingTopic(topic: topic);
+     832              :   }
+     833              : 
+     834            4 :   Future<void> _isValidDisconnect(String topic) async {
+     835            4 :     await isValidPairingTopic(topic: topic);
+     836              :   }
+     837              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/pairing_store.dart.func-c.html b/coverage/html/core/pairing/pairing_store.dart.func-c.html new file mode 100644 index 00000000..0a7fb0a9 --- /dev/null +++ b/coverage/html/core/pairing/pairing_store.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/pairing/pairing_store.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairing - pairing_store.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %88
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/pairing_store.dart.func.html b/coverage/html/core/pairing/pairing_store.dart.func.html new file mode 100644 index 00000000..f5c265d0 --- /dev/null +++ b/coverage/html/core/pairing/pairing_store.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/pairing/pairing_store.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairing - pairing_store.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %88
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/pairing_store.dart.gcov.html b/coverage/html/core/pairing/pairing_store.dart.gcov.html new file mode 100644 index 00000000..c71d2c06 --- /dev/null +++ b/coverage/html/core/pairing/pairing_store.dart.gcov.html @@ -0,0 +1,111 @@ + + + + + + + LCOV - lcov.info - core/pairing/pairing_store.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairing - pairing_store.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %88
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:walletconnect_flutter_v2/apis/core/pairing/i_pairing_store.dart';
+       2              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/pairing_models.dart';
+       3              : import 'package:walletconnect_flutter_v2/apis/core/store/generic_store.dart';
+       4              : 
+       5              : class PairingStore extends GenericStore<PairingInfo> implements IPairingStore {
+       6           11 :   PairingStore({
+       7              :     required super.storage,
+       8              :     required super.context,
+       9              :     required super.version,
+      10              :     required super.fromJson,
+      11              :   });
+      12              : 
+      13            8 :   @override
+      14              :   Future<void> update(
+      15              :     String topic, {
+      16              :     int? expiry,
+      17              :     bool? active,
+      18              :     PairingMetadata? metadata,
+      19              :   }) async {
+      20            8 :     checkInitialized();
+      21              : 
+      22            8 :     PairingInfo? info = get(topic);
+      23              :     if (info == null) {
+      24              :       return;
+      25              :     }
+      26              : 
+      27              :     if (expiry != null) {
+      28           16 :       info = info.copyWith(expiry: expiry);
+      29              :     }
+      30              :     if (active != null) {
+      31           14 :       info = info.copyWith(active: active);
+      32              :     }
+      33              :     if (metadata != null) {
+      34           10 :       info = info.copyWith(peerMetadata: metadata);
+      35              :     }
+      36              : 
+      37            8 :     await set(topic, info);
+      38              :   }
+      39              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/utils/index-sort-f.html b/coverage/html/core/pairing/utils/index-sort-f.html new file mode 100644 index 00000000..9dc16bf2 --- /dev/null +++ b/coverage/html/core/pairing/utils/index-sort-f.html @@ -0,0 +1,117 @@ + + + + + + + LCOV - lcov.info - core/pairing/utils + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairing/utilsCoverageTotalHit
Test:lcov.infoLines:54.7 %5329
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
json_rpc_utils.dart +
100.0%
+
100.0 %2121-
pairing_models.dart +
25.0%25.0%
+
25.0 %328-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/utils/index-sort-l.html b/coverage/html/core/pairing/utils/index-sort-l.html new file mode 100644 index 00000000..d4a6011b --- /dev/null +++ b/coverage/html/core/pairing/utils/index-sort-l.html @@ -0,0 +1,100 @@ + + + + + + + LCOV - lcov.info - core/pairing/utils + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairing/utilsCoverageTotalHit
Test:lcov.infoLines:54.7 %5329
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
pairing_models.dart +
25.0%25.0%
+
25.0 %328
json_rpc_utils.dart +
100.0%
+
100.0 %2121
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/utils/index.html b/coverage/html/core/pairing/utils/index.html new file mode 100644 index 00000000..efa9530f --- /dev/null +++ b/coverage/html/core/pairing/utils/index.html @@ -0,0 +1,100 @@ + + + + + + + LCOV - lcov.info - core/pairing/utils + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairing/utilsCoverageTotalHit
Test:lcov.infoLines:54.7 %5329
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
json_rpc_utils.dart +
100.0%
+
100.0 %2121
pairing_models.dart +
25.0%25.0%
+
25.0 %328
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/utils/json_rpc_utils.dart.func-c.html b/coverage/html/core/pairing/utils/json_rpc_utils.dart.func-c.html new file mode 100644 index 00000000..5c1c5d15 --- /dev/null +++ b/coverage/html/core/pairing/utils/json_rpc_utils.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/pairing/utils/json_rpc_utils.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairing/utils - json_rpc_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %2121
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/utils/json_rpc_utils.dart.func.html b/coverage/html/core/pairing/utils/json_rpc_utils.dart.func.html new file mode 100644 index 00000000..d0099607 --- /dev/null +++ b/coverage/html/core/pairing/utils/json_rpc_utils.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/pairing/utils/json_rpc_utils.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairing/utils - json_rpc_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %2121
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/utils/json_rpc_utils.dart.gcov.html b/coverage/html/core/pairing/utils/json_rpc_utils.dart.gcov.html new file mode 100644 index 00000000..0d1f7173 --- /dev/null +++ b/coverage/html/core/pairing/utils/json_rpc_utils.dart.gcov.html @@ -0,0 +1,146 @@ + + + + + + + LCOV - lcov.info - core/pairing/utils/json_rpc_utils.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairing/utils - json_rpc_utils.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %2121
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:math';
+       2              : 
+       3              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/pairing_models.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_error.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/utils/errors.dart';
+       6              : 
+       7              : class JsonRpcUtils {
+       8            8 :   static int payloadId({int entropy = 3}) {
+       9            8 :     int addedZeroes = (pow(10, entropy) as int);
+      10           24 :     int date = DateTime.now().millisecondsSinceEpoch * addedZeroes;
+      11           32 :     int extra = (Random().nextDouble() * addedZeroes).floor();
+      12            8 :     return date + extra;
+      13              :   }
+      14              : 
+      15            6 :   static Map<String, dynamic> formatJsonRpcRequest(
+      16              :     String method,
+      17              :     dynamic params, {
+      18              :     int? id,
+      19              :   }) {
+      20            6 :     return {
+      21            6 :       'id': id ??= payloadId(),
+      22              :       'jsonrpc': '2.0',
+      23              :       'method': method,
+      24              :       'params': params,
+      25              :     };
+      26              :   }
+      27              : 
+      28            6 :   static Map<String, dynamic> formatJsonRpcResponse<T>(
+      29              :     int id,
+      30              :     T result,
+      31              :   ) {
+      32            6 :     return {
+      33              :       'id': id,
+      34              :       'jsonrpc': '2.0',
+      35              :       'result': result,
+      36              :     };
+      37              :   }
+      38              : 
+      39            3 :   static Map<String, dynamic> formatJsonRpcError(int id, JsonRpcError error) {
+      40            3 :     return {
+      41              :       'id': id,
+      42              :       'jsonrpc': '2.0',
+      43            3 :       'error': error.toJson(),
+      44              :     };
+      45              :   }
+      46              : 
+      47            7 :   static bool validateMethods(
+      48              :     List<String> methods,
+      49              :     List<RegisteredFunction> registeredMethods,
+      50              :   ) {
+      51            7 :     List<String> unsupportedMethods = [];
+      52              : 
+      53              :     // Loop through the methods, and validate that each one exists in the registered methods
+      54           13 :     for (String method in methods) {
+      55           24 :       if (!registeredMethods.any((element) => element.method == method)) {
+      56              :         // print("Adding method: $method");
+      57            4 :         unsupportedMethods.add(method);
+      58              :       }
+      59              :     }
+      60              : 
+      61              :     // If there are any unsupported methods, throw an error
+      62            7 :     if (unsupportedMethods.isNotEmpty) {
+      63              :       // print(
+      64              :       //     'Unsupported Methods: $unsupportedMethods, Length: ${unsupportedMethods.length}');
+      65            4 :       throw Errors.getSdkError(
+      66              :         Errors.WC_METHOD_UNSUPPORTED,
+      67              :         context:
+      68            8 :             'The following methods are not registered: ${unsupportedMethods.join(', ')}.',
+      69              :       );
+      70              :     }
+      71              : 
+      72              :     return true;
+      73              :   }
+      74              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/utils/pairing_models.dart.func-c.html b/coverage/html/core/pairing/utils/pairing_models.dart.func-c.html new file mode 100644 index 00000000..76b6eb7b --- /dev/null +++ b/coverage/html/core/pairing/utils/pairing_models.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/pairing/utils/pairing_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairing/utils - pairing_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:25.0 %328
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/utils/pairing_models.dart.func.html b/coverage/html/core/pairing/utils/pairing_models.dart.func.html new file mode 100644 index 00000000..ea8f9656 --- /dev/null +++ b/coverage/html/core/pairing/utils/pairing_models.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/pairing/utils/pairing_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairing/utils - pairing_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:25.0 %328
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/pairing/utils/pairing_models.dart.gcov.html b/coverage/html/core/pairing/utils/pairing_models.dart.gcov.html new file mode 100644 index 00000000..6173aaf2 --- /dev/null +++ b/coverage/html/core/pairing/utils/pairing_models.dart.gcov.html @@ -0,0 +1,272 @@ + + + + + + + LCOV - lcov.info - core/pairing/utils/pairing_models.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/pairing/utils - pairing_models.dartCoverageTotalHit
Test:lcov.infoLines:25.0 %328
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:event/event.dart';
+       2              : import 'package:freezed_annotation/freezed_annotation.dart';
+       3              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client_models.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_error.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_request.dart';
+       6              : 
+       7              : part 'pairing_models.g.dart';
+       8              : part 'pairing_models.freezed.dart';
+       9              : 
+      10              : enum ProtocolType {
+      11              :   pair,
+      12              :   sign,
+      13              :   auth,
+      14              : }
+      15              : 
+      16              : @freezed
+      17              : class PairingInfo with _$PairingInfo {
+      18              :   @JsonSerializable()
+      19              :   const factory PairingInfo({
+      20              :     required String topic,
+      21              :     required int expiry,
+      22              :     required Relay relay,
+      23              :     required bool active,
+      24              :     List<String>? methods,
+      25              :     PairingMetadata? peerMetadata,
+      26              :   }) = _PairingInfo;
+      27              : 
+      28            0 :   factory PairingInfo.fromJson(Map<String, dynamic> json) =>
+      29            0 :       _$PairingInfoFromJson(json);
+      30              : }
+      31              : 
+      32              : @freezed
+      33              : class PairingMetadata with _$PairingMetadata {
+      34              :   @JsonSerializable(includeIfNull: false)
+      35              :   const factory PairingMetadata({
+      36              :     required String name,
+      37              :     required String description,
+      38              :     required String url,
+      39              :     required List<String> icons,
+      40              :     String? verifyUrl,
+      41              :     Redirect? redirect,
+      42              :   }) = _PairingMetadata;
+      43              : 
+      44            0 :   factory PairingMetadata.empty() => const PairingMetadata(
+      45              :         name: '',
+      46              :         description: '',
+      47              :         url: '',
+      48              :         icons: [],
+      49              :       );
+      50              : 
+      51            5 :   factory PairingMetadata.fromJson(Map<String, dynamic> json) =>
+      52            5 :       _$PairingMetadataFromJson(json);
+      53              : }
+      54              : 
+      55              : @freezed
+      56              : class Redirect with _$Redirect {
+      57              :   @JsonSerializable()
+      58              :   const factory Redirect({
+      59              :     String? native,
+      60              :     String? universal,
+      61              :   }) = _Redirect;
+      62              : 
+      63            0 :   factory Redirect.fromJson(Map<String, dynamic> json) =>
+      64            0 :       _$RedirectFromJson(json);
+      65              : }
+      66              : 
+      67              : class CreateResponse {
+      68              :   String topic;
+      69              :   Uri uri;
+      70              :   PairingInfo pairingInfo;
+      71              : 
+      72            7 :   CreateResponse({
+      73              :     required this.topic,
+      74              :     required this.uri,
+      75              :     required this.pairingInfo,
+      76              :   });
+      77              : 
+      78            0 :   @override
+      79              :   String toString() {
+      80            0 :     return 'CreateResponse(topic: $topic, uri: $uri, pairingInfo: ${pairingInfo.toJson()})';
+      81              :   }
+      82              : }
+      83              : 
+      84              : class ExpirationEvent extends EventArgs {
+      85              :   String target;
+      86              :   int expiry;
+      87              : 
+      88            4 :   ExpirationEvent({
+      89              :     required this.target,
+      90              :     required this.expiry,
+      91              :   });
+      92              : 
+      93            0 :   @override
+      94              :   String toString() {
+      95            0 :     return 'ExpirationEvent(target: $target, expiry: $expiry)';
+      96              :   }
+      97              : }
+      98              : 
+      99              : class HistoryEvent extends EventArgs {
+     100              :   JsonRpcRecord record;
+     101              : 
+     102            0 :   HistoryEvent({required this.record});
+     103              : 
+     104            0 :   @override
+     105              :   String toString() {
+     106            0 :     return 'HistoryEvent(record: $record)';
+     107              :   }
+     108              : }
+     109              : 
+     110              : class PairingInvalidEvent extends EventArgs {
+     111              :   String message;
+     112              : 
+     113            4 :   PairingInvalidEvent({
+     114              :     required this.message,
+     115              :   });
+     116              : 
+     117            0 :   @override
+     118              :   String toString() {
+     119            0 :     return 'PairingInvalidEvent(message: $message)';
+     120              :   }
+     121              : }
+     122              : 
+     123              : class PairingEvent extends EventArgs {
+     124              :   int? id;
+     125              :   String? topic;
+     126              :   JsonRpcError? error;
+     127              : 
+     128            7 :   PairingEvent({
+     129              :     this.id,
+     130              :     this.topic,
+     131              :     this.error,
+     132              :   });
+     133              : 
+     134            0 :   @override
+     135              :   String toString() {
+     136            0 :     return 'PairingEvent(id: $id, topic: $topic, error: $error)';
+     137              :   }
+     138              : }
+     139              : 
+     140              : class PairingActivateEvent extends EventArgs {
+     141              :   String topic;
+     142              :   int expiry;
+     143              : 
+     144            7 :   PairingActivateEvent({
+     145              :     required this.topic,
+     146              :     required this.expiry,
+     147              :   });
+     148              : 
+     149            0 :   @override
+     150              :   String toString() {
+     151            0 :     return 'PairingActivateEvent(topic: $topic, expiry: $expiry)';
+     152              :   }
+     153              : }
+     154              : 
+     155              : @freezed
+     156              : class JsonRpcRecord with _$JsonRpcRecord {
+     157              :   @JsonSerializable(includeIfNull: false)
+     158              :   const factory JsonRpcRecord({
+     159              :     required int id,
+     160              :     required String topic,
+     161              :     required String method,
+     162              :     required dynamic params,
+     163              :     String? chainId,
+     164              :     int? expiry,
+     165              :     dynamic response,
+     166              :   }) = _JsonRpcRecord;
+     167              : 
+     168            0 :   factory JsonRpcRecord.fromJson(Map<String, dynamic> json) =>
+     169            0 :       _$JsonRpcRecordFromJson(json);
+     170              : }
+     171              : 
+     172              : @freezed
+     173              : class ReceiverPublicKey with _$ReceiverPublicKey {
+     174              :   @JsonSerializable(includeIfNull: false)
+     175              :   const factory ReceiverPublicKey({
+     176              :     required String topic,
+     177              :     required String publicKey,
+     178              :     required int expiry,
+     179              :   }) = _ReceiverPublicKey;
+     180              : 
+     181            0 :   factory ReceiverPublicKey.fromJson(Map<String, dynamic> json) =>
+     182            0 :       _$ReceiverPublicKeyFromJson(json);
+     183              : }
+     184              : 
+     185              : class RegisteredFunction {
+     186              :   String method;
+     187              :   Function(String, JsonRpcRequest) function;
+     188              :   ProtocolType type;
+     189              : 
+     190            9 :   RegisteredFunction({
+     191              :     required this.method,
+     192              :     required this.function,
+     193              :     required this.type,
+     194              :   });
+     195              : 
+     196            0 :   @override
+     197              :   String toString() {
+     198            0 :     return 'RegisteredFunction(method: $method, function: $function, type: $type)';
+     199              :   }
+     200              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_auth/index-sort-f.html b/coverage/html/core/relay_auth/index-sort-f.html new file mode 100644 index 00000000..afb25eec --- /dev/null +++ b/coverage/html/core/relay_auth/index-sort-f.html @@ -0,0 +1,117 @@ + + + + + + + LCOV - lcov.info - core/relay_auth + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_authCoverageTotalHit
Test:lcov.infoLines:86.5 %11196
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
relay_auth.dart +
85.6%85.6%
+
85.6 %9077-
relay_auth_models.dart +
90.5%90.5%
+
90.5 %2119-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_auth/index-sort-l.html b/coverage/html/core/relay_auth/index-sort-l.html new file mode 100644 index 00000000..3b4c0c97 --- /dev/null +++ b/coverage/html/core/relay_auth/index-sort-l.html @@ -0,0 +1,100 @@ + + + + + + + LCOV - lcov.info - core/relay_auth + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_authCoverageTotalHit
Test:lcov.infoLines:86.5 %11196
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
relay_auth.dart +
85.6%85.6%
+
85.6 %9077
relay_auth_models.dart +
90.5%90.5%
+
90.5 %2119
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_auth/index.html b/coverage/html/core/relay_auth/index.html new file mode 100644 index 00000000..f409ad6b --- /dev/null +++ b/coverage/html/core/relay_auth/index.html @@ -0,0 +1,100 @@ + + + + + + + LCOV - lcov.info - core/relay_auth + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_authCoverageTotalHit
Test:lcov.infoLines:86.5 %11196
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
relay_auth.dart +
85.6%85.6%
+
85.6 %9077
relay_auth_models.dart +
90.5%90.5%
+
90.5 %2119
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_auth/relay_auth.dart.func-c.html b/coverage/html/core/relay_auth/relay_auth.dart.func-c.html new file mode 100644 index 00000000..8ba3c348 --- /dev/null +++ b/coverage/html/core/relay_auth/relay_auth.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_auth/relay_auth.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_auth - relay_auth.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:85.6 %9077
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_auth/relay_auth.dart.func.html b/coverage/html/core/relay_auth/relay_auth.dart.func.html new file mode 100644 index 00000000..99949ba7 --- /dev/null +++ b/coverage/html/core/relay_auth/relay_auth.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_auth/relay_auth.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_auth - relay_auth.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:85.6 %9077
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_auth/relay_auth.dart.gcov.html b/coverage/html/core/relay_auth/relay_auth.dart.gcov.html new file mode 100644 index 00000000..b75424a9 --- /dev/null +++ b/coverage/html/core/relay_auth/relay_auth.dart.gcov.html @@ -0,0 +1,308 @@ + + + + + + + LCOV - lcov.info - core/relay_auth/relay_auth.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_auth - relay_auth.dartCoverageTotalHit
Test:lcov.infoLines:85.6 %9077
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:convert';
+       2              : import 'dart:typed_data';
+       3              : 
+       4              : import 'package:bs58/bs58.dart';
+       5              : import 'package:ed25519_edwards/ed25519_edwards.dart' as ed;
+       6              : import 'package:walletconnect_flutter_v2/apis/core/relay_auth/i_relay_auth.dart';
+       7              : import 'package:walletconnect_flutter_v2/apis/core/relay_auth/relay_auth_models.dart';
+       8              : 
+       9              : class RelayAuth implements IRelayAuth {
+      10              :   static const String multicodecEd25519Header = 'K36';
+      11              :   static const String multicodecEd25519Base = 'z';
+      12              :   static const int multicodecEd25519Length = 32;
+      13              : 
+      14              :   static const String JWT_DELIMITER = '.';
+      15              : 
+      16              :   static const String DID_DELIMITER = ':';
+      17              :   static const String DID_PREFIX = 'did';
+      18              :   static const String DID_METHOD = 'key';
+      19              : 
+      20            9 :   @override
+      21              :   Future<RelayAuthKeyPair> generateKeyPair([Uint8List? seed]) async {
+      22              :     ed.PrivateKey privateKey;
+      23              :     ed.PublicKey publicKey;
+      24              :     if (seed == null) {
+      25            0 :       final keyPair = ed.generateKey();
+      26            0 :       privateKey = keyPair.privateKey;
+      27            0 :       publicKey = keyPair.publicKey;
+      28              :     } else {
+      29            9 :       privateKey = ed.newKeyFromSeed(seed);
+      30            9 :       publicKey = ed.public(privateKey);
+      31              :     }
+      32              : 
+      33            9 :     return RelayAuthKeyPair(
+      34           18 :       Uint8List.fromList(privateKey.bytes),
+      35           18 :       Uint8List.fromList(publicKey.bytes),
+      36              :     );
+      37              :   }
+      38              : 
+      39           10 :   @override
+      40              :   Future<String> signJWT({
+      41              :     required String sub,
+      42              :     required String aud,
+      43              :     required int ttl,
+      44              :     required RelayAuthKeyPair keyPair,
+      45              :     int? iat,
+      46              :   }) async {
+      47           36 :     iat ??= DateTime.now().millisecondsSinceEpoch ~/ 1000 - 60;
+      48           10 :     final JWTHeader header = JWTHeader();
+      49           20 :     final String iss = encodeIss(keyPair.publicKeyBytes);
+      50           10 :     final int exp = iat + ttl;
+      51           10 :     final JWTPayload payload = JWTPayload(
+      52              :       iss,
+      53              :       sub,
+      54              :       aud,
+      55              :       iat,
+      56              :       exp,
+      57              :     );
+      58           10 :     final Uint8List data = encodeData(
+      59           10 :       JWTData(
+      60              :         header,
+      61              :         payload,
+      62              :       ),
+      63              :     );
+      64           10 :     Uint8List signature = ed.sign(
+      65           20 :       ed.PrivateKey(keyPair.privateKeyBytes),
+      66              :       data,
+      67              :     );
+      68              :     // List<int> signature = keyPair.sign(data);
+      69           20 :     return encodeJWT(JWTSigned(signature, payload));
+      70              :   }
+      71              : 
+      72            1 :   @override
+      73              :   Future<bool> verifyJWT(String jwt) async {
+      74            1 :     JWTDecoded decoded = decodeJWT(jwt);
+      75              : 
+      76              :     // Check the header
+      77            3 :     if (decoded.header.alg != JWTHeader.JWT_ALG ||
+      78            3 :         decoded.header.typ != JWTHeader.JWT_TYP) {
+      79            0 :       throw VerifyJWTError(
+      80              :         jwt,
+      81              :         'JWT must use EdDSA algorithm',
+      82              :       );
+      83              :     }
+      84              : 
+      85            3 :     final Uint8List publicKey = decodeIss(decoded.payload.iss);
+      86            1 :     return ed.verify(
+      87            1 :       ed.PublicKey(publicKey),
+      88            2 :       Uint8List.fromList(decoded.data),
+      89            2 :       Uint8List.fromList(decoded.signature),
+      90              :     );
+      91              :     // final VerifyKey vKey = VerifyKey(publicKey);
+      92              :     // final SignedMessage signedMessage = SignedMessage.fromList(
+      93              :     //   signedMessage: Uint8List.fromList(
+      94              :     //     decoded.signature,
+      95              :     //   ),
+      96              :     // );
+      97              :     // return vKey.verify(
+      98              :     //   signature: signedMessage.signature,
+      99              :     //   message: Uint8List.fromList(decoded.data),
+     100              :     // );
+     101              :   }
+     102              : 
+     103           10 :   String stripEquals(String s) {
+     104           10 :     return s.replaceAll('=', '');
+     105              :   }
+     106              : 
+     107           10 :   @override
+     108              :   String encodeJson(Map<String, dynamic> value) {
+     109           10 :     return stripEquals(
+     110           10 :       base64Url.encode(
+     111           10 :         jsonEncode(
+     112              :           value,
+     113           10 :         ).codeUnits,
+     114              :       ),
+     115              :     );
+     116              :   }
+     117              : 
+     118            1 :   @override
+     119              :   Map<String, dynamic> decodeJson(String s) {
+     120            1 :     return jsonDecode(
+     121            1 :       utf8.decode(
+     122            1 :         base64Url.decode(
+     123            1 :           base64Url.normalize(
+     124              :             s,
+     125              :           ),
+     126              :         ),
+     127              :       ),
+     128              :     );
+     129              :   }
+     130              : 
+     131              :   /// Encodes the public key into a multicodec issuer
+     132           10 :   @override
+     133              :   String encodeIss(Uint8List publicKey) {
+     134           20 :     Uint8List header = base58.decode(multicodecEd25519Header);
+     135              :     final String multicodec =
+     136           50 :         '$multicodecEd25519Base${base58.encode(Uint8List.fromList(header + publicKey))}';
+     137           10 :     return <String>[
+     138              :       DID_PREFIX,
+     139              :       DID_METHOD,
+     140              :       multicodec,
+     141           10 :     ].join(DID_DELIMITER);
+     142              :   }
+     143              : 
+     144              :   /// Gets the public key from the issuer
+     145            1 :   @override
+     146              :   Uint8List decodeIss(String issuer) {
+     147            1 :     List<String> split = issuer.split(DID_DELIMITER);
+     148            4 :     if (split[0] != DID_PREFIX || split[1] != DID_METHOD) {
+     149            0 :       throw IssuerDecodeError(issuer, 'Issuer must be a DID with method "key"');
+     150              :     }
+     151            1 :     final String multicodec = split[2];
+     152              : 
+     153              :     // Check the base
+     154            1 :     String base = multicodec[0];
+     155            1 :     if (base != multicodecEd25519Base) {
+     156            0 :       throw IssuerDecodeError(
+     157              :         issuer,
+     158              :         'Issuer must be a key in the multicodec format',
+     159              :       );
+     160              :     }
+     161              : 
+     162              :     // Decode
+     163            3 :     final Uint8List bytes = base58.decode(multicodec.substring(1));
+     164              : 
+     165              :     // Check the header
+     166            3 :     String header = base58.encode(bytes.sublist(0, 2));
+     167            1 :     if (header != multicodecEd25519Header) {
+     168            0 :       throw IssuerDecodeError(
+     169              :         issuer,
+     170              :         'Issuer must be a public key with type "Ed25519',
+     171              :       );
+     172              :     }
+     173              : 
+     174              :     // Slice off the public key and validate the length
+     175            1 :     final Uint8List publicKey = bytes.sublist(2);
+     176            2 :     if (publicKey.length != multicodecEd25519Length) {
+     177            0 :       throw IssuerDecodeError(
+     178              :         issuer,
+     179              :         'Issuer must be public key with length 32 bytes',
+     180              :       );
+     181              :     }
+     182              : 
+     183              :     return publicKey;
+     184              :   }
+     185              : 
+     186           10 :   @override
+     187              :   Uint8List encodeData(JWTData params) {
+     188           10 :     final String data = <String>[
+     189           30 :       encodeJson(params.header.toJson()),
+     190           30 :       encodeJson(params.payload.toJson()),
+     191           10 :     ].join(JWT_DELIMITER);
+     192              : 
+     193           20 :     return Uint8List.fromList(utf8.encode(data));
+     194              :   }
+     195              : 
+     196            0 :   @override
+     197              :   JWTData decodeData(Uint8List data) {
+     198            0 :     final List<String> params = utf8.decode(data).split(JWT_DELIMITER);
+     199              : 
+     200            0 :     JWTHeader header = JWTHeader.fromJson(jsonDecode(params[0]));
+     201            0 :     JWTPayload payload = JWTPayload.fromJson(jsonDecode(params[1]));
+     202              : 
+     203            0 :     return JWTData(header, payload);
+     204              :   }
+     205              : 
+     206           10 :   @override
+     207              :   String encodeSig(Uint8List bytes) {
+     208           20 :     return stripEquals(base64Url.encode(bytes));
+     209              :   }
+     210              : 
+     211            1 :   @override
+     212              :   Uint8List decodeSig(String encoded) {
+     213            3 :     return Uint8List.fromList(base64Url.decode(base64Url.normalize(encoded)));
+     214              :   }
+     215              : 
+     216           10 :   @override
+     217              :   String encodeJWT(JWTSigned params) {
+     218           10 :     return <String>[
+     219           30 :       encodeJson(params.header.toJson()),
+     220           30 :       encodeJson(params.payload.toJson()),
+     221           30 :       encodeSig(Uint8List.fromList(params.signature)),
+     222           10 :     ].join(JWT_DELIMITER);
+     223              :   }
+     224              : 
+     225            1 :   @override
+     226              :   JWTDecoded decodeJWT(String encoded) {
+     227            1 :     final List<String> params = encoded.split(JWT_DELIMITER);
+     228              : 
+     229            3 :     JWTHeader header = JWTHeader.fromJson(decodeJson(params[0]));
+     230            3 :     JWTPayload payload = JWTPayload.fromJson(decodeJson(params[1]));
+     231            2 :     Uint8List signature = decodeSig(params[2]);
+     232            3 :     List<int> data = utf8.encode(params.sublist(0, 2).join(JWT_DELIMITER));
+     233              : 
+     234            1 :     return JWTDecoded(data, signature, payload, header: header);
+     235              :   }
+     236              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_auth/relay_auth_models.dart.func-c.html b/coverage/html/core/relay_auth/relay_auth_models.dart.func-c.html new file mode 100644 index 00000000..2fd74161 --- /dev/null +++ b/coverage/html/core/relay_auth/relay_auth_models.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_auth/relay_auth_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_auth - relay_auth_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:90.5 %2119
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_auth/relay_auth_models.dart.func.html b/coverage/html/core/relay_auth/relay_auth_models.dart.func.html new file mode 100644 index 00000000..5e31e8d2 --- /dev/null +++ b/coverage/html/core/relay_auth/relay_auth_models.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_auth/relay_auth_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_auth - relay_auth_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:90.5 %2119
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_auth/relay_auth_models.dart.gcov.html b/coverage/html/core/relay_auth/relay_auth_models.dart.gcov.html new file mode 100644 index 00000000..6439cfe6 --- /dev/null +++ b/coverage/html/core/relay_auth/relay_auth_models.dart.gcov.html @@ -0,0 +1,186 @@ + + + + + + + LCOV - lcov.info - core/relay_auth/relay_auth_models.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_auth - relay_auth_models.dartCoverageTotalHit
Test:lcov.infoLines:90.5 %2119
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:typed_data';
+       2              : 
+       3              : import 'package:convert/convert.dart';
+       4              : import 'package:json_annotation/json_annotation.dart';
+       5              : 
+       6              : part 'relay_auth_models.g.dart';
+       7              : 
+       8              : class RelayAuthKeyPair {
+       9              :   final Uint8List privateKeyBytes;
+      10              :   final Uint8List publicKeyBytes;
+      11              :   final String privateKey;
+      12              :   final String publicKey;
+      13              : 
+      14            9 :   RelayAuthKeyPair(
+      15              :     this.privateKeyBytes,
+      16              :     this.publicKeyBytes,
+      17            9 :   )   : privateKey = hex.encode(privateKeyBytes),
+      18            9 :         publicKey = hex.encode(publicKeyBytes);
+      19              : 
+      20            1 :   RelayAuthKeyPair.fromStrings(
+      21              :     this.privateKey,
+      22              :     this.publicKey,
+      23            2 :   )   : privateKeyBytes = Uint8List.fromList(hex.decode(privateKey)),
+      24            2 :         publicKeyBytes = Uint8List.fromList(hex.decode(publicKey));
+      25              : }
+      26              : 
+      27              : @JsonSerializable()
+      28              : class JWTHeader {
+      29              :   static const JWT_ALG = 'EdDSA';
+      30              :   static const JWT_TYP = 'JWT';
+      31              : 
+      32              :   String alg;
+      33              :   String typ;
+      34              : 
+      35           10 :   JWTHeader({
+      36              :     this.alg = 'EdDSA',
+      37              :     this.typ = 'JWT',
+      38              :   });
+      39              : 
+      40            1 :   factory JWTHeader.fromJson(Map<String, dynamic> json) =>
+      41            1 :       _$JWTHeaderFromJson(json);
+      42              : 
+      43           20 :   Map<String, dynamic> toJson() => _$JWTHeaderToJson(this);
+      44              : }
+      45              : 
+      46              : @JsonSerializable()
+      47              : class JWTPayload {
+      48              :   String iss;
+      49              :   String sub;
+      50              :   String aud;
+      51              :   int iat;
+      52              :   int exp;
+      53              : 
+      54           10 :   JWTPayload(
+      55              :     this.iss,
+      56              :     this.sub,
+      57              :     this.aud,
+      58              :     this.iat,
+      59              :     this.exp,
+      60              :   );
+      61              : 
+      62            1 :   factory JWTPayload.fromJson(Map<String, dynamic> json) =>
+      63            1 :       _$JWTPayloadFromJson(json);
+      64              : 
+      65           20 :   Map<String, dynamic> toJson() => _$JWTPayloadToJson(this);
+      66              : }
+      67              : 
+      68              : class JWTData {
+      69              :   JWTHeader header;
+      70              :   JWTPayload payload;
+      71              : 
+      72           10 :   JWTData(this.header, this.payload);
+      73              : }
+      74              : 
+      75              : class JWTSigned extends JWTData {
+      76              :   List<int> signature;
+      77              : 
+      78           10 :   JWTSigned(
+      79              :     this.signature,
+      80              :     JWTPayload payload, {
+      81              :     JWTHeader? header,
+      82           20 :   }) : super(header ?? JWTHeader(), payload);
+      83              : }
+      84              : 
+      85              : class JWTDecoded extends JWTSigned {
+      86              :   List<int> data;
+      87              : 
+      88            1 :   JWTDecoded(
+      89              :     this.data,
+      90              :     List<int> signature,
+      91              :     JWTPayload payload, {
+      92              :     JWTHeader? header,
+      93            1 :   }) : super(signature, payload, header: header);
+      94              : }
+      95              : 
+      96              : class IssuerDecodeError {
+      97              :   String received;
+      98              :   String message;
+      99              : 
+     100            0 :   IssuerDecodeError(
+     101              :     this.received,
+     102              :     this.message,
+     103              :   );
+     104              : }
+     105              : 
+     106              : class VerifyJWTError {
+     107              :   String jwt;
+     108              :   String message;
+     109              : 
+     110            0 :   VerifyJWTError(
+     111              :     this.jwt,
+     112              :     this.message,
+     113              :   );
+     114              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/i_relay_client.dart.func-c.html b/coverage/html/core/relay_client/i_relay_client.dart.func-c.html new file mode 100644 index 00000000..54f8658c --- /dev/null +++ b/coverage/html/core/relay_client/i_relay_client.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/i_relay_client.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client - i_relay_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %10
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/i_relay_client.dart.func.html b/coverage/html/core/relay_client/i_relay_client.dart.func.html new file mode 100644 index 00000000..ee7c9d5b --- /dev/null +++ b/coverage/html/core/relay_client/i_relay_client.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/i_relay_client.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client - i_relay_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %10
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/i_relay_client.dart.gcov.html b/coverage/html/core/relay_client/i_relay_client.dart.gcov.html new file mode 100644 index 00000000..f6d8c43a --- /dev/null +++ b/coverage/html/core/relay_client/i_relay_client.dart.gcov.html @@ -0,0 +1,120 @@ + + + + + + + LCOV - lcov.info - core/relay_client/i_relay_client.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client - i_relay_client.dartCoverageTotalHit
Test:lcov.infoLines:0.0 %10
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:event/event.dart';
+       2              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client_models.dart';
+       3              : 
+       4              : class PublishOptions {
+       5              :   final Relay? relay;
+       6              :   final int? ttl;
+       7              :   final bool? prompt;
+       8              :   final int? tag;
+       9              : 
+      10            0 :   PublishOptions(this.relay, this.ttl, this.prompt, this.tag);
+      11              : }
+      12              : 
+      13              : abstract class IRelayClient {
+      14              :   /// Relay Client Events
+      15              :   abstract final Event<MessageEvent> onRelayClientMessage;
+      16              :   abstract final Event onRelayClientConnect;
+      17              :   abstract final Event onRelayClientDisconnect;
+      18              :   abstract final Event<ErrorEvent> onRelayClientError;
+      19              : 
+      20              :   /// JSON RPC Events
+      21              :   // Event<EventArgs> onJsonRpcPayload();
+      22              :   // Event<EventArgs> onJsonRpcConnect();
+      23              :   // Event<EventArgs> onJsonRpcDisconnect();
+      24              :   // Event<ErrorEvent> onJsonRpcError();
+      25              : 
+      26              :   /// Subscriber Events
+      27              :   abstract final Event<SubscriptionEvent> onSubscriptionCreated;
+      28              :   abstract final Event<SubscriptionDeletionEvent> onSubscriptionDeleted;
+      29              :   // Event<EventArgs> onSubscriptionExpired();
+      30              :   // Event<EventArgs> onSubscriptionDisabled();
+      31              :   abstract final Event onSubscriptionSync;
+      32              :   abstract final Event onSubscriptionResubscribed;
+      33              : 
+      34              :   /// Returns true if the client is connected to a relay server
+      35              :   bool get isConnected;
+      36              : 
+      37              :   Future<void> init();
+      38              :   Future<void> publish({
+      39              :     required String topic,
+      40              :     required String message,
+      41              :     required int ttl,
+      42              :     required int tag,
+      43              :   });
+      44              :   Future<String> subscribe({required String topic});
+      45              :   Future<void> unsubscribe({required String topic});
+      46              :   Future<void> connect({String? relayUrl});
+      47              :   Future<void> disconnect();
+      48              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/index-sort-f.html b/coverage/html/core/relay_client/index-sort-f.html new file mode 100644 index 00000000..7cfdd313 --- /dev/null +++ b/coverage/html/core/relay_client/index-sort-f.html @@ -0,0 +1,141 @@ + + + + + + + LCOV - lcov.info - core/relay_client + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_clientCoverageTotalHit
Test:lcov.infoLines:85.6 %201172
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
i_relay_client.dart +
0.0%
+
0.0 %1-
message_tracker.dart +
100.0%
+
100.0 %1818-
relay_client.dart +
86.6%86.6%
+
86.6 %172149-
relay_client_models.dart +
50.0%50.0%
+
50.0 %105-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/index-sort-l.html b/coverage/html/core/relay_client/index-sort-l.html new file mode 100644 index 00000000..3026d9c7 --- /dev/null +++ b/coverage/html/core/relay_client/index-sort-l.html @@ -0,0 +1,118 @@ + + + + + + + LCOV - lcov.info - core/relay_client + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_clientCoverageTotalHit
Test:lcov.infoLines:85.6 %201172
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
i_relay_client.dart +
0.0%
+
0.0 %1
relay_client_models.dart +
50.0%50.0%
+
50.0 %105
relay_client.dart +
86.6%86.6%
+
86.6 %172149
message_tracker.dart +
100.0%
+
100.0 %1818
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/index.html b/coverage/html/core/relay_client/index.html new file mode 100644 index 00000000..46c46c2e --- /dev/null +++ b/coverage/html/core/relay_client/index.html @@ -0,0 +1,118 @@ + + + + + + + LCOV - lcov.info - core/relay_client + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_clientCoverageTotalHit
Test:lcov.infoLines:85.6 %201172
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
i_relay_client.dart +
0.0%
+
0.0 %1
message_tracker.dart +
100.0%
+
100.0 %1818
relay_client.dart +
86.6%86.6%
+
86.6 %172149
relay_client_models.dart +
50.0%50.0%
+
50.0 %105
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/error_code.dart.func-c.html b/coverage/html/core/relay_client/json_rpc_2/error_code.dart.func-c.html new file mode 100644 index 00000000..79cbf549 --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/error_code.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/error_code.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2 - error_code.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %60
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/error_code.dart.func.html b/coverage/html/core/relay_client/json_rpc_2/error_code.dart.func.html new file mode 100644 index 00000000..c1058981 --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/error_code.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/error_code.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2 - error_code.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %60
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/error_code.dart.gcov.html b/coverage/html/core/relay_client/json_rpc_2/error_code.dart.gcov.html new file mode 100644 index 00000000..6247e776 --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/error_code.dart.gcov.html @@ -0,0 +1,129 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/error_code.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2 - error_code.dartCoverageTotalHit
Test:lcov.infoLines:0.0 %60
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+       2              : // for details. All rights reserved. Use of this source code is governed by a
+       3              : // BSD-style license that can be found in the LICENSE file.
+       4              : 
+       5              : // ignore_for_file: constant_identifier_names
+       6              : 
+       7              : /// Error codes defined in the [JSON-RPC 2.0 specificiation][spec].
+       8              : ///
+       9              : /// These codes are generally used for protocol-level communication. Most of
+      10              : /// them shouldn't be used by the application. Those that should have
+      11              : /// convenience constructors in [RpcException].
+      12              : ///
+      13              : /// [spec]: http://www.jsonrpc.org/specification#error_object
+      14              : /// An error code indicating that invalid JSON was received by the server.
+      15              : const PARSE_ERROR = -32700;
+      16              : 
+      17              : /// An error code indicating that the request JSON was invalid according to the
+      18              : /// JSON-RPC 2.0 spec.
+      19              : const INVALID_REQUEST = -32600;
+      20              : 
+      21              : /// An error code indicating that the requested method does not exist or is
+      22              : /// unavailable.
+      23              : const METHOD_NOT_FOUND = -32601;
+      24              : 
+      25              : /// An error code indicating that the request parameters are invalid for the
+      26              : /// requested method.
+      27              : const INVALID_PARAMS = -32602;
+      28              : 
+      29              : /// An internal JSON-RPC error.
+      30              : const INTERNAL_ERROR = -32603;
+      31              : 
+      32              : /// An unexpected error occurred on the server.
+      33              : ///
+      34              : /// The spec reserves the range from -32000 to -32099 for implementation-defined
+      35              : /// server exceptions, but for now we only use one of those values.
+      36              : const SERVER_ERROR = -32000;
+      37              : 
+      38              : /// Returns a human-readable name for [errorCode] if it's one specified by the
+      39              : /// JSON-RPC 2.0 spec.
+      40              : ///
+      41              : /// If [errorCode] isn't defined in the JSON-RPC 2.0 spec, returns null.
+      42            0 : String? name(int errorCode) {
+      43              :   switch (errorCode) {
+      44            0 :     case PARSE_ERROR:
+      45              :       return 'parse error';
+      46            0 :     case INVALID_REQUEST:
+      47              :       return 'invalid request';
+      48            0 :     case METHOD_NOT_FOUND:
+      49              :       return 'method not found';
+      50            0 :     case INVALID_PARAMS:
+      51              :       return 'invalid parameters';
+      52            0 :     case INTERNAL_ERROR:
+      53              :       return 'internal error';
+      54              :     default:
+      55              :       return null;
+      56              :   }
+      57              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/index-sort-f.html b/coverage/html/core/relay_client/json_rpc_2/index-sort-f.html new file mode 100644 index 00000000..c449153c --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/index-sort-f.html @@ -0,0 +1,105 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2 + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2CoverageTotalHit
Test:lcov.infoLines:0.0 %60
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
error_code.dart +
0.0%
+
0.0 %6-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/index-sort-l.html b/coverage/html/core/relay_client/json_rpc_2/index-sort-l.html new file mode 100644 index 00000000..83dd21b6 --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/index-sort-l.html @@ -0,0 +1,91 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2 + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2CoverageTotalHit
Test:lcov.infoLines:0.0 %60
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
error_code.dart +
0.0%
+
0.0 %6
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/index.html b/coverage/html/core/relay_client/json_rpc_2/index.html new file mode 100644 index 00000000..e92c9983 --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/index.html @@ -0,0 +1,91 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2 + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2CoverageTotalHit
Test:lcov.infoLines:0.0 %60
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
error_code.dart +
0.0%
+
0.0 %6
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/src/client.dart.func-c.html b/coverage/html/core/relay_client/json_rpc_2/src/client.dart.func-c.html new file mode 100644 index 00000000..8648fe37 --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/src/client.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/src/client.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2/src - client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:73.1 %7857
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/src/client.dart.func.html b/coverage/html/core/relay_client/json_rpc_2/src/client.dart.func.html new file mode 100644 index 00000000..cfc385b8 --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/src/client.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/src/client.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2/src - client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:73.1 %7857
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/src/client.dart.gcov.html b/coverage/html/core/relay_client/json_rpc_2/src/client.dart.gcov.html new file mode 100644 index 00000000..9dd27861 --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/src/client.dart.gcov.html @@ -0,0 +1,316 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/src/client.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2/src - client.dartCoverageTotalHit
Test:lcov.infoLines:73.1 %7857
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+       2              : // for details. All rights reserved. Use of this source code is governed by a
+       3              : // BSD-style license that can be found in the LICENSE file.
+       4              : 
+       5              : import 'dart:async';
+       6              : 
+       7              : import 'package:stack_trace/stack_trace.dart';
+       8              : import 'package:stream_channel/stream_channel.dart';
+       9              : 
+      10              : import 'exception.dart';
+      11              : import 'utils.dart';
+      12              : 
+      13              : /// A JSON-RPC 2.0 client.
+      14              : ///
+      15              : /// A client calls methods on a server and handles the server's responses to
+      16              : /// those method calls. Methods can be called with [sendRequest], or with
+      17              : /// [sendNotification] if no response is expected.
+      18              : class Client {
+      19              :   final StreamChannel<dynamic> _channel;
+      20              : 
+      21              :   /// The next request id.
+      22              :   var _id = 0;
+      23              : 
+      24              :   /// The current batch of requests to be sent together.
+      25              :   ///
+      26              :   /// Each element is a JSON RPC spec compliant message.
+      27              :   List<Map<String, dynamic>>? _batch;
+      28              : 
+      29              :   /// The map of request ids to pending requests.
+      30              :   final _pendingRequests = <int, _Request>{};
+      31              : 
+      32              :   final _done = Completer<void>();
+      33              : 
+      34              :   /// Returns a [Future] that completes when the underlying connection is
+      35              :   /// closed.
+      36              :   ///
+      37              :   /// This is the same future that's returned by [listen] and [close]. It may
+      38              :   /// complete before [close] is called if the remote endpoint closes the
+      39              :   /// connection.
+      40           24 :   Future get done => _done.future;
+      41              : 
+      42              :   /// Whether the underlying connection is closed.
+      43              :   ///
+      44              :   /// Note that this will be `true` before [close] is called if the remote
+      45              :   /// endpoint closes the connection.
+      46           24 :   bool get isClosed => _done.isCompleted;
+      47              : 
+      48              :   /// Creates a [Client] that communicates over [channel].
+      49              :   ///
+      50              :   /// Note that the client won't begin listening to [responses] until
+      51              :   /// [Client.listen] is called.
+      52            0 :   Client(StreamChannel<String> channel)
+      53            0 :       : this.withoutJson(
+      54            0 :             jsonDocument.bind(channel).transformStream(ignoreFormatExceptions));
+      55              : 
+      56              :   /// Creates a [Client] that communicates using decoded messages over
+      57              :   /// [channel].
+      58              :   ///
+      59              :   /// Unlike [Client], this doesn't read or write JSON strings. Instead, it
+      60              :   /// reads and writes decoded maps or lists.
+      61              :   ///
+      62              :   /// Note that the client won't begin listening to [responses] until
+      63              :   /// [Client.listen] is called.
+      64            8 :   Client.withoutJson(this._channel) {
+      65           24 :     done.whenComplete(() {
+      66           21 :       for (var request in _pendingRequests.values) {
+      67           15 :         request.completer.completeError(StateError(
+      68           10 :             'The client closed with pending request "${request.method}".'));
+      69              :       }
+      70           16 :       _pendingRequests.clear();
+      71            8 :     }).catchError((_) {
+      72              :       // Avoid an unhandled error.
+      73              :     });
+      74              :   }
+      75              : 
+      76              :   /// Starts listening to the underlying stream.
+      77              :   ///
+      78              :   /// Returns a [Future] that will complete when the connection is closed or
+      79              :   /// when it has an error. This is the same as [done].
+      80              :   ///
+      81              :   /// [listen] may only be called once.
+      82            8 :   Future listen() {
+      83           32 :     _channel.stream.listen(_handleResponse, onError: (error, stackTrace) {
+      84            0 :       _done.completeError(error, stackTrace);
+      85            0 :       _channel.sink.close();
+      86            0 :     }, onDone: () {
+      87            0 :       if (!_done.isCompleted) _done.complete();
+      88            0 :       close();
+      89              :     });
+      90            8 :     return done;
+      91              :   }
+      92              : 
+      93              :   /// Closes the underlying connection.
+      94              :   ///
+      95              :   /// Returns a [Future] that completes when all resources have been released.
+      96              :   /// This is the same as [done].
+      97            8 :   Future close() {
+      98           24 :     _channel.sink.close();
+      99           32 :     if (!_done.isCompleted) _done.complete();
+     100            8 :     return done;
+     101              :   }
+     102              : 
+     103              :   /// Sends a JSON-RPC 2 request to invoke the given [method].
+     104              :   ///
+     105              :   /// If passed, [parameters] is the parameters for the method. This must be
+     106              :   /// either an [Iterable] (to pass parameters by position) or a [Map] with
+     107              :   /// [String] keys (to pass parameters by name). Either way, it must be
+     108              :   /// JSON-serializable.
+     109              :   ///
+     110              :   /// If the request succeeds, this returns the response result as a decoded
+     111              :   /// JSON-serializable object. If it fails, it throws an [RpcException]
+     112              :   /// describing the failure.
+     113              :   ///
+     114              :   /// Throws a [StateError] if the client is closed while the request is in
+     115              :   /// flight, or if the client is closed when this method is called.
+     116            8 :   Future sendRequest(String method, [parameters, int? id]) {
+     117            0 :     var idAct = id ?? _id++;
+     118            8 :     _send(method, parameters, idAct);
+     119              : 
+     120            8 :     var completer = Completer.sync();
+     121           32 :     _pendingRequests[idAct] = _Request(method, completer, Chain.current());
+     122            8 :     return completer.future;
+     123              :   }
+     124              : 
+     125              :   /// Sends a JSON-RPC 2 request to invoke the given [method] without expecting
+     126              :   /// a response.
+     127              :   ///
+     128              :   /// If passed, [parameters] is the parameters for the method. This must be
+     129              :   /// either an [Iterable] (to pass parameters by position) or a [Map] with
+     130              :   /// [String] keys (to pass parameters by name). Either way, it must be
+     131              :   /// JSON-serializable.
+     132              :   ///
+     133              :   /// Since this is just a notification to which the server isn't expected to
+     134              :   /// send a response, it has no return value.
+     135              :   ///
+     136              :   /// Throws a [StateError] if the client is closed when this method is called.
+     137            0 :   void sendNotification(String method, [parameters]) =>
+     138            0 :       _send(method, parameters);
+     139              : 
+     140              :   /// A helper method for [sendRequest] and [sendNotification].
+     141              :   ///
+     142              :   /// Sends a request to invoke [method] with [parameters]. If [id] is given,
+     143              :   /// the request uses that id.
+     144            8 :   void _send(String method, parameters, [int? id]) {
+     145            8 :     if (parameters is Iterable) parameters = parameters.toList();
+     146            8 :     if (parameters is! Map && parameters is! List && parameters != null) {
+     147            0 :       throw ArgumentError('Only maps and lists may be used as JSON-RPC '
+     148              :           'parameters, was "$parameters".');
+     149              :     }
+     150            8 :     if (isClosed) throw StateError('The client is closed.');
+     151              : 
+     152            8 :     var message = <String, dynamic>{'jsonrpc': '2.0', 'method': method};
+     153            8 :     if (id != null) message['id'] = id;
+     154            8 :     if (parameters != null) message['params'] = parameters;
+     155              : 
+     156            8 :     if (_batch != null) {
+     157            0 :       _batch!.add(message);
+     158              :     } else {
+     159           24 :       _channel.sink.add(message);
+     160              :     }
+     161              :   }
+     162              : 
+     163              :   /// Runs [callback] and batches any requests sent until it returns.
+     164              :   ///
+     165              :   /// A batch of requests is sent in a single message on the underlying stream,
+     166              :   /// and the responses are likewise sent back in a single message.
+     167              :   ///
+     168              :   /// [callback] may be synchronous or asynchronous. If it returns a [Future],
+     169              :   /// requests will be batched until that Future returns; otherwise, requests
+     170              :   /// will only be batched while synchronously executing [callback].
+     171              :   ///
+     172              :   /// If this is called in the context of another [withBatch] call, it just
+     173              :   /// invokes [callback] without creating another batch. This means that
+     174              :   /// responses are batched until the first batch ends.
+     175            0 :   void withBatch(Function() callback) {
+     176            0 :     if (_batch != null) {
+     177            0 :       callback();
+     178              :       return;
+     179              :     }
+     180              : 
+     181            0 :     _batch = [];
+     182            0 :     return tryFinally(callback, () {
+     183            0 :       _channel.sink.add(_batch);
+     184            0 :       _batch = null;
+     185              :     });
+     186              :   }
+     187              : 
+     188              :   /// Handles a decoded response from the server.
+     189            8 :   void _handleResponse(response) {
+     190            8 :     if (response is List) {
+     191            0 :       response.forEach(_handleSingleResponse);
+     192              :     } else {
+     193            8 :       _handleSingleResponse(response);
+     194              :     }
+     195              :   }
+     196              : 
+     197              :   /// Handles a decoded response from the server after batches have been
+     198              :   /// resolved.
+     199            8 :   void _handleSingleResponse(response) {
+     200            8 :     if (!_isResponseValid(response)) return;
+     201            8 :     var id = response['id'];
+     202            8 :     id = (id is String) ? int.parse(id) : id;
+     203           16 :     var request = _pendingRequests.remove(id)!;
+     204            8 :     if (response.containsKey('result')) {
+     205           21 :       request.completer.complete(response['result']);
+     206              :     } else {
+     207            8 :       request.completer.completeError(
+     208           20 :           RpcException(response['error']['code'], response['error']['message'],
+     209            8 :               data: response['error']['data']),
+     210            4 :           request.chain);
+     211              :     }
+     212              :   }
+     213              : 
+     214              :   /// Determines whether the server's response is valid per the spec.
+     215            8 :   bool _isResponseValid(response) {
+     216            8 :     if (response is! Map) return false;
+     217           16 :     if (response['jsonrpc'] != '2.0') return false;
+     218            8 :     var id = response['id'];
+     219            8 :     id = (id is String) ? int.parse(id) : id;
+     220           16 :     if (!_pendingRequests.containsKey(id)) return false;
+     221            8 :     if (response.containsKey('result')) return true;
+     222              : 
+     223            4 :     if (!response.containsKey('error')) return false;
+     224            4 :     var error = response['error'];
+     225            4 :     if (error is! Map) return false;
+     226            8 :     if (error['code'] is! int) return false;
+     227            8 :     if (error['message'] is! String) return false;
+     228              :     return true;
+     229              :   }
+     230              : }
+     231              : 
+     232              : /// A pending request to the server.
+     233              : class _Request {
+     234              :   /// THe method that was sent.
+     235              :   final String method;
+     236              : 
+     237              :   /// The completer to use to complete the response future.
+     238              :   final Completer completer;
+     239              : 
+     240              :   /// The stack chain from where the request was made.
+     241              :   final Chain chain;
+     242              : 
+     243            8 :   _Request(this.method, this.completer, this.chain);
+     244              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/src/exception.dart.func-c.html b/coverage/html/core/relay_client/json_rpc_2/src/exception.dart.func-c.html new file mode 100644 index 00000000..c6018733 --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/src/exception.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/src/exception.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2/src - exception.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:4.8 %211
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/src/exception.dart.func.html b/coverage/html/core/relay_client/json_rpc_2/src/exception.dart.func.html new file mode 100644 index 00000000..58967808 --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/src/exception.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/src/exception.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2/src - exception.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:4.8 %211
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/src/exception.dart.gcov.html b/coverage/html/core/relay_client/json_rpc_2/src/exception.dart.gcov.html new file mode 100644 index 00000000..c1d60b31 --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/src/exception.dart.gcov.html @@ -0,0 +1,145 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/src/exception.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2/src - exception.dartCoverageTotalHit
Test:lcov.infoLines:4.8 %211
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+       2              : // for details. All rights reserved. Use of this source code is governed by a
+       3              : // BSD-style license that can be found in the LICENSE file.
+       4              : 
+       5              : import '../error_code.dart' as error_code;
+       6              : 
+       7              : /// An exception from a JSON-RPC server that can be translated into an error
+       8              : /// response.
+       9              : class RpcException implements Exception {
+      10              :   /// The error code.
+      11              :   ///
+      12              :   /// All non-negative error codes are available for use by application
+      13              :   /// developers.
+      14              :   final int code;
+      15              : 
+      16              :   /// The error message.
+      17              :   ///
+      18              :   /// This should be limited to a concise single sentence. Further information
+      19              :   /// should be supplied via [data].
+      20              :   final String message;
+      21              : 
+      22              :   /// Extra application-defined information about the error.
+      23              :   ///
+      24              :   /// This must be a JSON-serializable object. If it's a [Map] without a
+      25              :   /// `"request"` key, a copy of the request that caused the error will
+      26              :   /// automatically be injected.
+      27              :   final Object? data;
+      28              : 
+      29            4 :   RpcException(this.code, this.message, {this.data});
+      30              : 
+      31              :   /// An exception indicating that the method named [methodName] was not found.
+      32              :   ///
+      33              :   /// This should usually be used only by fallback handlers.
+      34            0 :   RpcException.methodNotFound(String methodName)
+      35            0 :       : this(error_code.METHOD_NOT_FOUND, 'Unknown method "$methodName".');
+      36              : 
+      37              :   /// An exception indicating that the parameters for the requested method were
+      38              :   /// invalid.
+      39              :   ///
+      40              :   /// Methods can use this to reject requests with invalid parameters.
+      41            0 :   RpcException.invalidParams(String message)
+      42            0 :       : this(error_code.INVALID_PARAMS, message);
+      43              : 
+      44              :   /// Converts this exception into a JSON-serializable object that's a valid
+      45              :   /// JSON-RPC 2.0 error response.
+      46            0 :   Map<String, dynamic> serialize(request) {
+      47              :     dynamic modifiedData;
+      48            0 :     if (data is Map && !(data as Map).containsKey('request')) {
+      49            0 :       modifiedData = Map.from(data as Map);
+      50            0 :       modifiedData['request'] = request;
+      51            0 :     } else if (data == null) {
+      52            0 :       modifiedData = {'request': request};
+      53              :     } else {
+      54            0 :       modifiedData = data;
+      55              :     }
+      56              : 
+      57            0 :     var id = request is Map ? request['id'] : null;
+      58            0 :     if (id is! String && id is! num) id = null;
+      59            0 :     return {
+      60              :       'jsonrpc': '2.0',
+      61            0 :       'error': {'code': code, 'message': message, 'data': modifiedData},
+      62              :       'id': id
+      63              :     };
+      64              :   }
+      65              : 
+      66            0 :   @override
+      67              :   String toString() {
+      68            0 :     var prefix = 'JSON-RPC error $code';
+      69            0 :     var errorName = error_code.name(code);
+      70            0 :     if (errorName != null) prefix += ' ($errorName)';
+      71            0 :     return '$prefix: $message';
+      72              :   }
+      73              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/src/index-sort-f.html b/coverage/html/core/relay_client/json_rpc_2/src/index-sort-f.html new file mode 100644 index 00000000..ffac39ce --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/src/index-sort-f.html @@ -0,0 +1,165 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/src + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2/srcCoverageTotalHit
Test:lcov.infoLines:40.8 %360147
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
client.dart +
73.1%73.1%
+
73.1 %7857-
exception.dart +
4.8%4.8%
+
4.8 %211-
parameters.dart +
18.3%18.3%
+
18.3 %9317-
peer.dart +
59.2%59.2%
+
59.2 %4929-
server.dart +
39.2%39.2%
+
39.2 %9738-
utils.dart +
22.7%22.7%
+
22.7 %225-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/src/index-sort-l.html b/coverage/html/core/relay_client/json_rpc_2/src/index-sort-l.html new file mode 100644 index 00000000..9b765e9c --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/src/index-sort-l.html @@ -0,0 +1,136 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/src + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2/srcCoverageTotalHit
Test:lcov.infoLines:40.8 %360147
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
exception.dart +
4.8%4.8%
+
4.8 %211
parameters.dart +
18.3%18.3%
+
18.3 %9317
utils.dart +
22.7%22.7%
+
22.7 %225
server.dart +
39.2%39.2%
+
39.2 %9738
peer.dart +
59.2%59.2%
+
59.2 %4929
client.dart +
73.1%73.1%
+
73.1 %7857
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/src/index.html b/coverage/html/core/relay_client/json_rpc_2/src/index.html new file mode 100644 index 00000000..ab6c1d41 --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/src/index.html @@ -0,0 +1,136 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/src + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2/srcCoverageTotalHit
Test:lcov.infoLines:40.8 %360147
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
client.dart +
73.1%73.1%
+
73.1 %7857
exception.dart +
4.8%4.8%
+
4.8 %211
parameters.dart +
18.3%18.3%
+
18.3 %9317
peer.dart +
59.2%59.2%
+
59.2 %4929
server.dart +
39.2%39.2%
+
39.2 %9738
utils.dart +
22.7%22.7%
+
22.7 %225
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.func-c.html b/coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.func-c.html new file mode 100644 index 00000000..8f03765c --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/src/parameters.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2/src - parameters.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:18.3 %9317
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.func.html b/coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.func.html new file mode 100644 index 00000000..98937a45 --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/src/parameters.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2/src - parameters.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:18.3 %9317
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.gcov.html b/coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.gcov.html new file mode 100644 index 00000000..859acf14 --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.gcov.html @@ -0,0 +1,420 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/src/parameters.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2/src - parameters.dartCoverageTotalHit
Test:lcov.infoLines:18.3 %9317
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+       2              : // for details. All rights reserved. Use of this source code is governed by a
+       3              : // BSD-style license that can be found in the LICENSE file.
+       4              : 
+       5              : import 'dart:convert';
+       6              : 
+       7              : import 'exception.dart';
+       8              : 
+       9              : /// A wrapper for the parameters to a server method.
+      10              : ///
+      11              : /// JSON-RPC 2.0 allows parameters that are either a list or a map. This class
+      12              : /// provides functions that not only assert that the parameters object is the
+      13              : /// correct type, but also that the expected arguments exist and are themselves
+      14              : /// the correct type.
+      15              : ///
+      16              : /// Example usage:
+      17              : ///
+      18              : ///     server.registerMethod("subtract", (params) {
+      19              : ///       return params["minuend"].asNum - params["subtrahend"].asNum;
+      20              : ///     });
+      21              : class Parameters {
+      22              :   /// The name of the method that this request called.
+      23              :   final String method;
+      24              : 
+      25              :   /// The underlying value of the parameters object.
+      26              :   ///
+      27              :   /// If this is accessed for a [Parameter] that was not passed, the request
+      28              :   /// will be automatically rejected. To avoid this, use [Parameter.valueOr].
+      29              :   final dynamic value;
+      30              : 
+      31            7 :   Parameters(this.method, this.value);
+      32              : 
+      33              :   /// Returns a single parameter.
+      34              :   ///
+      35              :   /// If [key] is a [String], the request is expected to provide named
+      36              :   /// parameters. If it's an [int], the request is expected to provide
+      37              :   /// positional parameters. Requests that don't do so will be rejected
+      38              :   /// automatically.
+      39              :   ///
+      40              :   /// Whether or not the given parameter exists, this returns a [Parameter]
+      41              :   /// object. If a parameter's value is accessed through a getter like [value]
+      42              :   /// or [Parameter.asNum], the request will be rejected if that parameter
+      43              :   /// doesn't exist. On the other hand, if it's accessed through a method with a
+      44              :   /// default value like [Parameter.valueOr] or [Parameter.asNumOr], the default
+      45              :   /// value will be returned.
+      46            7 :   Parameter operator [](key) {
+      47            7 :     if (key is int) {
+      48            0 :       _assertPositional();
+      49            0 :       if (key < value.length) {
+      50            0 :         return Parameter._(method, value[key], this, key);
+      51              :       } else {
+      52            0 :         return _MissingParameter(method, this, key);
+      53              :       }
+      54            7 :     } else if (key is String) {
+      55            7 :       _assertNamed();
+      56           14 :       if (value.containsKey(key)) {
+      57           28 :         return Parameter._(method, value[key], this, key);
+      58              :       } else {
+      59            0 :         return _MissingParameter(method, this, key);
+      60              :       }
+      61              :     } else {
+      62            0 :       throw ArgumentError('Parameters[] only takes an int or a string, was '
+      63              :           '"$key".');
+      64              :     }
+      65              :   }
+      66              : 
+      67              :   /// Asserts that [value] exists and is a [List] and returns it.
+      68            0 :   List get asList {
+      69            0 :     _assertPositional();
+      70            0 :     return value;
+      71              :   }
+      72              : 
+      73              :   /// Asserts that [value] exists and is a [Map] and returns it.
+      74            0 :   Map get asMap {
+      75            0 :     _assertNamed();
+      76            0 :     return value;
+      77              :   }
+      78              : 
+      79              :   /// Asserts that [value] is a positional argument list.
+      80            0 :   void _assertPositional() {
+      81            0 :     if (value is List) return;
+      82            0 :     throw RpcException.invalidParams('Parameters for method "$method" '
+      83              :         'must be passed by position.');
+      84              :   }
+      85              : 
+      86              :   /// Asserts that [value] is a named argument map.
+      87            7 :   void _assertNamed() {
+      88           14 :     if (value is Map) return;
+      89            0 :     throw RpcException.invalidParams('Parameters for method "$method" '
+      90              :         'must be passed by name.');
+      91              :   }
+      92              : }
+      93              : 
+      94              : /// A wrapper for a single parameter to a server method.
+      95              : ///
+      96              : /// This provides numerous functions for asserting the type of the parameter in
+      97              : /// question. These functions each have a version that asserts that the
+      98              : /// parameter exists (for example, [asNum] and [asString]) and a version that
+      99              : /// returns a default value if the parameter doesn't exist (for example,
+     100              : /// [asNumOr] and [asStringOr]). If an assertion fails, the request is
+     101              : /// automatically rejected.
+     102              : ///
+     103              : /// This extends [Parameters] to make it easy to access nested parameters. For
+     104              : /// example:
+     105              : ///
+     106              : ///     // "params.value" is "{'scores': {'home': [5, 10, 17]}}"
+     107              : ///     params['scores']['home'][2].asInt // => 17
+     108              : class Parameter extends Parameters {
+     109              :   // The parent parameters, used to construct [_path].
+     110              :   final Parameters _parent;
+     111              : 
+     112              :   /// The key used to access [this], used to construct [_path].
+     113              :   final dynamic _key;
+     114              : 
+     115              :   /// A human-readable representation of the path of getters used to get this.
+     116              :   ///
+     117              :   /// Named parameters are represented as `.name`, whereas positional parameters
+     118              :   /// are represented as `[index]`. For example: `"foo[0].bar.baz"`. Named
+     119              :   /// parameters that contain characters that are neither alphanumeric,
+     120              :   /// underscores, or hyphens will be JSON-encoded. For example: `"foo
+     121              :   /// bar"."baz.bang"`. If quotes are used for an individual component, they
+     122              :   /// won't be used for the entire string.
+     123              :   ///
+     124              :   /// An exception is made for single-level parameters. A single-level
+     125              :   /// positional parameter is just represented by the index plus one, because
+     126              :   /// "parameter 1" is clearer than "parameter [0]". A single-level named
+     127              :   /// parameter is represented by that name in quotes.
+     128            0 :   String get _path {
+     129            0 :     if (_parent is! Parameter) {
+     130            0 :       return _key is int ? (_key + 1).toString() : jsonEncode(_key);
+     131              :     }
+     132              : 
+     133            0 :     String quoteKey(key) {
+     134            0 :       if (key.contains(RegExp(r'[^a-zA-Z0-9_-]'))) return jsonEncode(key);
+     135              :       return key;
+     136              :     }
+     137              : 
+     138            0 :     String computePath(params) {
+     139            0 :       if (params._parent is! Parameter) {
+     140            0 :         return params._key is int ? '[${params._key}]' : quoteKey(params._key);
+     141              :       }
+     142              : 
+     143            0 :       var path = computePath(params._parent);
+     144            0 :       return params._key is int
+     145            0 :           ? '$path[${params._key}]'
+     146            0 :           : '$path.${quoteKey(params._key)}';
+     147              :     }
+     148              : 
+     149            0 :     return computePath(this);
+     150              :   }
+     151              : 
+     152              :   /// Whether this parameter exists.
+     153            0 :   bool get exists => true;
+     154              : 
+     155            7 :   Parameter._(String method, value, this._parent, this._key)
+     156            7 :       : super(method, value);
+     157              : 
+     158              :   /// Returns [value], or [defaultValue] if this parameter wasn't passed.
+     159            0 :   dynamic valueOr(defaultValue) => value;
+     160              : 
+     161              :   /// Asserts that [value] exists and is a number and returns it.
+     162              :   ///
+     163              :   /// [asNumOr] may be used to provide a default value instead of rejecting the
+     164              :   /// request if [value] doesn't exist.
+     165            0 :   num get asNum => _getTyped('a number', (value) => value is num);
+     166              : 
+     167              :   /// Asserts that [value] is a number and returns it.
+     168              :   ///
+     169              :   /// If [value] doesn't exist, this returns [defaultValue].
+     170            0 :   num asNumOr(num defaultValue) => asNum;
+     171              : 
+     172              :   /// Asserts that [value] exists and is an integer and returns it.
+     173              :   ///
+     174              :   /// [asIntOr] may be used to provide a default value instead of rejecting the
+     175              :   /// request if [value] doesn't exist.
+     176              :   ///
+     177              :   /// Note that which values count as integers varies between the Dart VM and
+     178              :   /// dart2js. The value `1.0` will be considered an integer under dart2js but
+     179              :   /// not under the VM.
+     180            0 :   int get asInt => _getTyped('an integer', (value) => value is int);
+     181              : 
+     182              :   /// Asserts that [value] is an integer and returns it.
+     183              :   ///
+     184              :   /// If [value] doesn't exist, this returns [defaultValue].
+     185              :   ///
+     186              :   /// Note that which values count as integers varies between the Dart VM and
+     187              :   /// dart2js. The value `1.0` will be considered an integer under dart2js but
+     188              :   /// not under the VM.
+     189            0 :   int asIntOr(int defaultValue) => asInt;
+     190              : 
+     191              :   /// Asserts that [value] exists and is a boolean and returns it.
+     192              :   ///
+     193              :   /// [asBoolOr] may be used to provide a default value instead of rejecting the
+     194              :   /// request if [value] doesn't exist.
+     195            0 :   bool get asBool => _getTyped('a boolean', (value) => value is bool);
+     196              : 
+     197              :   /// Asserts that [value] is a boolean and returns it.
+     198              :   ///
+     199              :   /// If [value] doesn't exist, this returns [defaultValue].
+     200            0 :   bool asBoolOr(bool defaultValue) => asBool;
+     201              : 
+     202              :   /// Asserts that [value] exists and is a string and returns it.
+     203              :   ///
+     204              :   /// [asStringOr] may be used to provide a default value instead of rejecting
+     205              :   /// the request if [value] doesn't exist.
+     206            0 :   String get asString => _getTyped('a string', (value) => value is String);
+     207              : 
+     208              :   /// Asserts that [value] is a string and returns it.
+     209              :   ///
+     210              :   /// If [value] doesn't exist, this returns [defaultValue].
+     211            0 :   String asStringOr(String defaultValue) => asString;
+     212              : 
+     213              :   /// Asserts that [value] exists and is a [List] and returns it.
+     214              :   ///
+     215              :   /// [asListOr] may be used to provide a default value instead of rejecting the
+     216              :   /// request if [value] doesn't exist.
+     217            0 :   @override
+     218            0 :   List get asList => _getTyped('an Array', (value) => value is List);
+     219              : 
+     220              :   /// Asserts that [value] is a [List] and returns it.
+     221              :   ///
+     222              :   /// If [value] doesn't exist, this returns [defaultValue].
+     223            0 :   List asListOr(List defaultValue) => asList;
+     224              : 
+     225              :   /// Asserts that [value] exists and is a [Map] and returns it.
+     226              :   ///
+     227              :   /// [asMapOr] may be used to provide a default value instead of rejecting the
+     228              :   /// request if [value] doesn't exist.
+     229            7 :   @override
+     230           21 :   Map get asMap => _getTyped('an Object', (value) => value is Map);
+     231              : 
+     232              :   /// Asserts that [value] is a [Map] and returns it.
+     233              :   ///
+     234              :   /// If [value] doesn't exist, this returns [defaultValue].
+     235            0 :   Map asMapOr(Map defaultValue) => asMap;
+     236              : 
+     237              :   /// Asserts that [value] exists, is a string, and can be parsed as a
+     238              :   /// [DateTime] and returns it.
+     239              :   ///
+     240              :   /// [asDateTimeOr] may be used to provide a default value instead of rejecting
+     241              :   /// the request if [value] doesn't exist.
+     242            0 :   DateTime get asDateTime => _getParsed('date/time', DateTime.parse);
+     243              : 
+     244              :   /// Asserts that [value] exists, is a string, and can be parsed as a
+     245              :   /// [DateTime] and returns it.
+     246              :   ///
+     247              :   /// If [value] doesn't exist, this returns [defaultValue].
+     248            0 :   DateTime asDateTimeOr(DateTime defaultValue) => asDateTime;
+     249              : 
+     250              :   /// Asserts that [value] exists, is a string, and can be parsed as a
+     251              :   /// [Uri] and returns it.
+     252              :   ///
+     253              :   /// [asUriOr] may be used to provide a default value instead of rejecting the
+     254              :   /// request if [value] doesn't exist.
+     255            0 :   Uri get asUri => _getParsed('URI', Uri.parse);
+     256              : 
+     257              :   /// Asserts that [value] exists, is a string, and can be parsed as a
+     258              :   /// [Uri] and returns it.
+     259              :   ///
+     260              :   /// If [value] doesn't exist, this returns [defaultValue].
+     261            0 :   Uri asUriOr(Uri defaultValue) => asUri;
+     262              : 
+     263              :   /// Get a parameter named [named] that matches [test], or the value of calling
+     264              :   /// [orElse].
+     265              :   ///
+     266              :   /// [type] is used for the error message. It should begin with an indefinite
+     267              :   /// article.
+     268            7 :   dynamic _getTyped(String type, bool Function(dynamic) test) {
+     269           21 :     if (test(value)) return value;
+     270            0 :     throw RpcException.invalidParams('Parameter $_path for method '
+     271            0 :         '"$method" must be $type, but was ${jsonEncode(value)}.');
+     272              :   }
+     273              : 
+     274            0 :   dynamic _getParsed(String description, Function(String) parse) {
+     275            0 :     var string = asString;
+     276              :     try {
+     277            0 :       return parse(string);
+     278            0 :     } on FormatException catch (error) {
+     279              :       // DateTime.parse doesn't actually include any useful information in the
+     280              :       // FormatException, just the string that was being parsed. There's no use
+     281              :       // in including that in the RPC exception. See issue 17753.
+     282            0 :       var message = error.message;
+     283            0 :       if (message == string) {
+     284              :         message = '';
+     285              :       } else {
+     286            0 :         message = '\n$message';
+     287              :       }
+     288              : 
+     289            0 :       throw RpcException.invalidParams('Parameter $_path for method '
+     290            0 :           '"$method" must be a valid $description, but was '
+     291            0 :           '${jsonEncode(string)}.$message');
+     292              :     }
+     293              :   }
+     294              : 
+     295            0 :   @override
+     296              :   void _assertPositional() {
+     297              :     // Throw the standard exception for a mis-typed list.
+     298            0 :     asList;
+     299              :   }
+     300              : 
+     301            7 :   @override
+     302              :   void _assertNamed() {
+     303              :     // Throw the standard exception for a mis-typed map.
+     304            7 :     asMap;
+     305              :   }
+     306              : }
+     307              : 
+     308              : /// A subclass of [Parameter] representing a missing parameter.
+     309              : class _MissingParameter extends Parameter {
+     310            0 :   @override
+     311              :   dynamic get value {
+     312            0 :     throw RpcException.invalidParams('Request for method "$method" is '
+     313            0 :         'missing required parameter $_path.');
+     314              :   }
+     315              : 
+     316            0 :   @override
+     317              :   bool get exists => false;
+     318              : 
+     319            0 :   _MissingParameter(String method, Parameters parent, key)
+     320            0 :       : super._(method, null, parent, key);
+     321              : 
+     322            0 :   @override
+     323              :   dynamic valueOr(defaultValue) => defaultValue;
+     324              : 
+     325            0 :   @override
+     326              :   num asNumOr(num defaultValue) => defaultValue;
+     327              : 
+     328            0 :   @override
+     329              :   int asIntOr(int defaultValue) => defaultValue;
+     330              : 
+     331            0 :   @override
+     332              :   bool asBoolOr(bool defaultValue) => defaultValue;
+     333              : 
+     334            0 :   @override
+     335              :   String asStringOr(String defaultValue) => defaultValue;
+     336              : 
+     337            0 :   @override
+     338              :   List asListOr(List defaultValue) => defaultValue;
+     339              : 
+     340            0 :   @override
+     341              :   Map asMapOr(Map defaultValue) => defaultValue;
+     342              : 
+     343            0 :   @override
+     344              :   DateTime asDateTimeOr(DateTime defaultValue) => defaultValue;
+     345              : 
+     346            0 :   @override
+     347              :   Uri asUriOr(Uri defaultValue) => defaultValue;
+     348              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/src/peer.dart.func-c.html b/coverage/html/core/relay_client/json_rpc_2/src/peer.dart.func-c.html new file mode 100644 index 00000000..30a72ab9 --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/src/peer.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/src/peer.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2/src - peer.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:59.2 %4929
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/src/peer.dart.func.html b/coverage/html/core/relay_client/json_rpc_2/src/peer.dart.func.html new file mode 100644 index 00000000..6c77c970 --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/src/peer.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/src/peer.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2/src - peer.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:59.2 %4929
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/src/peer.dart.gcov.html b/coverage/html/core/relay_client/json_rpc_2/src/peer.dart.gcov.html new file mode 100644 index 00000000..44c451d4 --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/src/peer.dart.gcov.html @@ -0,0 +1,228 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/src/peer.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2/src - peer.dartCoverageTotalHit
Test:lcov.infoLines:59.2 %4929
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+       2              : // for details. All rights reserved. Use of this source code is governed by a
+       3              : // BSD-style license that can be found in the LICENSE file.
+       4              : 
+       5              : import 'dart:async';
+       6              : 
+       7              : import 'package:stream_channel/stream_channel.dart';
+       8              : 
+       9              : import 'client.dart';
+      10              : import 'parameters.dart';
+      11              : import 'server.dart';
+      12              : import 'utils.dart';
+      13              : 
+      14              : /// A JSON-RPC 2.0 client *and* server.
+      15              : ///
+      16              : /// This supports bidirectional peer-to-peer communication with another JSON-RPC
+      17              : /// 2.0 endpoint. It sends both requests and responses across the same
+      18              : /// communication channel and expects to connect to a peer that does the same.
+      19              : class Peer implements Client, Server {
+      20              :   final StreamChannel<dynamic> _channel;
+      21              : 
+      22              :   /// The underlying client that handles request-sending and response-receiving
+      23              :   /// logic.
+      24              :   late final Client _client;
+      25              : 
+      26              :   /// The underlying server that handles request-receiving and response-sending
+      27              :   /// logic.
+      28              :   late final Server _server;
+      29              : 
+      30              :   /// A stream controller that forwards incoming messages to [_server] if
+      31              :   /// they're requests.
+      32              :   final _serverIncomingForwarder = StreamController(sync: true);
+      33              : 
+      34              :   /// A stream controller that forwards incoming messages to [_client] if
+      35              :   /// they're responses.
+      36              :   final _clientIncomingForwarder = StreamController(sync: true);
+      37              : 
+      38              :   @override
+      39           56 :   late final Future done = Future.wait([_client.done, _server.done]);
+      40              : 
+      41            8 :   @override
+      42           32 :   bool get isClosed => _client.isClosed || _server.isClosed;
+      43              : 
+      44            0 :   @override
+      45            0 :   ErrorCallback? get onUnhandledError => _server.onUnhandledError;
+      46              : 
+      47            0 :   @override
+      48            0 :   bool get strictProtocolChecks => _server.strictProtocolChecks;
+      49              : 
+      50              :   /// Creates a [Peer] that communicates over [channel].
+      51              :   ///
+      52              :   /// Note that the peer won't begin listening to [channel] until [Peer.listen]
+      53              :   /// is called.
+      54              :   ///
+      55              :   /// Unhandled exceptions in callbacks will be forwarded to [onUnhandledError].
+      56              :   /// If this is not provided, unhandled exceptions will be swallowed.
+      57              :   ///
+      58              :   /// If [strictProtocolChecks] is false, the underlying [Server] will accept
+      59              :   /// some requests which are not conformant with the JSON-RPC 2.0
+      60              :   /// specification. In particular, requests missing the `jsonrpc` parameter
+      61              :   /// will be accepted.
+      62            8 :   Peer(StreamChannel<String> channel,
+      63              :       {ErrorCallback? onUnhandledError, bool strictProtocolChecks = true})
+      64            8 :       : this.withoutJson(
+      65           32 :             jsonDocument.bind(channel).transform(respondToFormatExceptions),
+      66              :             onUnhandledError: onUnhandledError,
+      67              :             strictProtocolChecks: strictProtocolChecks);
+      68              : 
+      69              :   /// Creates a [Peer] that communicates using decoded messages over [channel].
+      70              :   ///
+      71              :   /// Unlike [Peer], this doesn't read or write JSON strings. Instead, it
+      72              :   /// reads and writes decoded maps or lists.
+      73              :   ///
+      74              :   /// Note that the peer won't begin listening to [channel] until
+      75              :   /// [Peer.listen] is called.
+      76              :   ///
+      77              :   /// Unhandled exceptions in callbacks will be forwarded to [onUnhandledError].
+      78              :   /// If this is not provided, unhandled exceptions will be swallowed.
+      79              :   ///
+      80              :   /// If [strictProtocolChecks] is false, the underlying [Server] will accept
+      81              :   /// some requests which are not conformant with the JSON-RPC 2.0
+      82              :   /// specification. In particular, requests missing the `jsonrpc` parameter
+      83              :   /// will be accepted.
+      84            8 :   Peer.withoutJson(this._channel,
+      85              :       {ErrorCallback? onUnhandledError, bool strictProtocolChecks = true}) {
+      86           16 :     _server = Server.withoutJson(
+      87           40 :         StreamChannel(_serverIncomingForwarder.stream, _channel.sink),
+      88              :         onUnhandledError: onUnhandledError,
+      89              :         strictProtocolChecks: strictProtocolChecks);
+      90           16 :     _client = Client.withoutJson(
+      91           40 :         StreamChannel(_clientIncomingForwarder.stream, _channel.sink));
+      92              :   }
+      93              : 
+      94              :   // Client methods.
+      95              : 
+      96            8 :   @override
+      97              :   Future sendRequest(String method, [parameters, int? id]) =>
+      98           16 :       _client.sendRequest(method, parameters, id);
+      99              : 
+     100            0 :   @override
+     101              :   void sendNotification(String method, [parameters]) =>
+     102            0 :       _client.sendNotification(method, parameters);
+     103              : 
+     104            0 :   @override
+     105            0 :   void withBatch(Function() callback) => _client.withBatch(callback);
+     106              : 
+     107              :   // Server methods.
+     108              : 
+     109            8 :   @override
+     110              :   void registerMethod(String name, Function callback) =>
+     111           16 :       _server.registerMethod(name, callback);
+     112              : 
+     113            0 :   @override
+     114              :   void registerFallback(Function(Parameters parameters) callback) =>
+     115            0 :       _server.registerFallback(callback);
+     116              : 
+     117              :   // Shared methods.
+     118              : 
+     119            8 :   @override
+     120              :   Future listen() {
+     121           16 :     _client.listen();
+     122           16 :     _server.listen();
+     123           32 :     _channel.stream.listen((message) {
+     124            8 :       if (message is Map) {
+     125           16 :         if (message.containsKey('result') || message.containsKey('error')) {
+     126           16 :           _clientIncomingForwarder.add(message);
+     127              :         } else {
+     128           14 :           _serverIncomingForwarder.add(message);
+     129              :         }
+     130            0 :       } else if (message is List &&
+     131            0 :           message.isNotEmpty &&
+     132            0 :           message.first is Map) {
+     133            0 :         if (message.first.containsKey('result') ||
+     134            0 :             message.first.containsKey('error')) {
+     135            0 :           _clientIncomingForwarder.add(message);
+     136              :         } else {
+     137            0 :           _serverIncomingForwarder.add(message);
+     138              :         }
+     139              :       } else {
+     140              :         // Non-Map and -List messages are ill-formed, so we pass them to the
+     141              :         // server since it knows how to send error responses.
+     142            0 :         _serverIncomingForwarder.add(message);
+     143              :       }
+     144            0 :     }, onError: (error, stackTrace) {
+     145            0 :       _serverIncomingForwarder.addError(error, stackTrace);
+     146            8 :     }, onDone: close);
+     147            8 :     return done;
+     148              :   }
+     149              : 
+     150            8 :   @override
+     151              :   Future close() {
+     152           16 :     _client.close();
+     153           16 :     _server.close();
+     154            8 :     return done;
+     155              :   }
+     156              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/src/server.dart.func-c.html b/coverage/html/core/relay_client/json_rpc_2/src/server.dart.func-c.html new file mode 100644 index 00000000..35e2d24a --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/src/server.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/src/server.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2/src - server.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:39.2 %9738
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/src/server.dart.func.html b/coverage/html/core/relay_client/json_rpc_2/src/server.dart.func.html new file mode 100644 index 00000000..e8fba5e2 --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/src/server.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/src/server.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2/src - server.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:39.2 %9738
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/src/server.dart.gcov.html b/coverage/html/core/relay_client/json_rpc_2/src/server.dart.gcov.html new file mode 100644 index 00000000..943d9e9d --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/src/server.dart.gcov.html @@ -0,0 +1,391 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/src/server.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2/src - server.dartCoverageTotalHit
Test:lcov.infoLines:39.2 %9738
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+       2              : // for details. All rights reserved. Use of this source code is governed by a
+       3              : // BSD-style license that can be found in the LICENSE file.
+       4              : 
+       5              : import 'dart:async';
+       6              : import 'dart:collection';
+       7              : import 'dart:convert';
+       8              : 
+       9              : import 'package:stack_trace/stack_trace.dart';
+      10              : import 'package:stream_channel/stream_channel.dart';
+      11              : 
+      12              : import '../error_code.dart' as error_code;
+      13              : import 'exception.dart';
+      14              : import 'parameters.dart';
+      15              : import 'utils.dart';
+      16              : 
+      17              : /// A callback for unhandled exceptions.
+      18              : typedef ErrorCallback = void Function(dynamic error, dynamic stackTrace);
+      19              : 
+      20              : /// A JSON-RPC 2.0 server.
+      21              : ///
+      22              : /// A server exposes methods that are called by requests, to which it provides
+      23              : /// responses. Methods can be registered using [registerMethod] and
+      24              : /// [registerFallback]. Requests can be handled using [handleRequest] and
+      25              : /// [parseRequest].
+      26              : ///
+      27              : /// Note that since requests can arrive asynchronously and methods can run
+      28              : /// asynchronously, it's possible for multiple methods to be invoked at the same
+      29              : /// time, or even for a single method to be invoked multiple times at once.
+      30              : class Server {
+      31              :   final StreamChannel<dynamic> _channel;
+      32              : 
+      33              :   /// The methods registered for this server.
+      34              :   final _methods = <String, Function>{};
+      35              : 
+      36              :   /// The fallback methods for this server.
+      37              :   ///
+      38              :   /// These are tried in order until one of them doesn't throw a
+      39              :   /// [RpcException.methodNotFound] exception.
+      40              :   final _fallbacks = Queue<Function>();
+      41              : 
+      42              :   final _done = Completer<void>();
+      43              : 
+      44              :   /// Returns a [Future] that completes when the underlying connection is
+      45              :   /// closed.
+      46              :   ///
+      47              :   /// This is the same future that's returned by [listen] and [close]. It may
+      48              :   /// complete before [close] is called if the remote endpoint closes the
+      49              :   /// connection.
+      50           24 :   Future get done => _done.future;
+      51              : 
+      52              :   /// Whether the underlying connection is closed.
+      53              :   ///
+      54              :   /// Note that this will be `true` before [close] is called if the remote
+      55              :   /// endpoint closes the connection.
+      56           24 :   bool get isClosed => _done.isCompleted;
+      57              : 
+      58              :   /// A callback that is fired on unhandled exceptions.
+      59              :   ///
+      60              :   /// In the case where a user provided callback results in an exception that
+      61              :   /// cannot be properly routed back to the client, this handler will be
+      62              :   /// invoked. If it is not set, the exception will be swallowed.
+      63              :   final ErrorCallback? onUnhandledError;
+      64              : 
+      65              :   /// Whether to strictly enforce the JSON-RPC 2.0 specification for received
+      66              :   /// messages.
+      67              :   ///
+      68              :   /// If `false`, this [Server] will accept some requests which are not
+      69              :   /// conformant with the JSON-RPC 2.0 specification. In particular, requests
+      70              :   /// missing the `jsonrpc` parameter will be accepted.
+      71              :   final bool strictProtocolChecks;
+      72              : 
+      73              :   /// Creates a [Server] that communicates over [channel].
+      74              :   ///
+      75              :   /// Note that the server won't begin listening to [requests] until
+      76              :   /// [Server.listen] is called.
+      77              :   ///
+      78              :   /// Unhandled exceptions in callbacks will be forwarded to [onUnhandledError].
+      79              :   /// If this is not provided, unhandled exceptions will be swallowed.
+      80              :   ///
+      81              :   /// If [strictProtocolChecks] is false, this [Server] will accept some
+      82              :   /// requests which are not conformant with the JSON-RPC 2.0 specification. In
+      83              :   /// particular, requests missing the `jsonrpc` parameter will be accepted.
+      84            0 :   Server(StreamChannel<String> channel,
+      85              :       {ErrorCallback? onUnhandledError, bool strictProtocolChecks = true})
+      86            0 :       : this.withoutJson(
+      87            0 :             jsonDocument.bind(channel).transform(respondToFormatExceptions),
+      88              :             onUnhandledError: onUnhandledError,
+      89              :             strictProtocolChecks: strictProtocolChecks);
+      90              : 
+      91              :   /// Creates a [Server] that communicates using decoded messages over
+      92              :   /// [channel].
+      93              :   ///
+      94              :   /// Unlike [Server], this doesn't read or write JSON strings. Instead, it
+      95              :   /// reads and writes decoded maps or lists.
+      96              :   ///
+      97              :   /// Note that the server won't begin listening to [requests] until
+      98              :   /// [Server.listen] is called.
+      99              :   ///
+     100              :   /// Unhandled exceptions in callbacks will be forwarded to [onUnhandledError].
+     101              :   /// If this is not provided, unhandled exceptions will be swallowed.
+     102              :   ///
+     103              :   /// If [strictProtocolChecks] is false, this [Server] will accept some
+     104              :   /// requests which are not conformant with the JSON-RPC 2.0 specification. In
+     105              :   /// particular, requests missing the `jsonrpc` parameter will be accepted.
+     106            8 :   Server.withoutJson(this._channel,
+     107              :       {this.onUnhandledError, this.strictProtocolChecks = true});
+     108              : 
+     109              :   /// Starts listening to the underlying stream.
+     110              :   ///
+     111              :   /// Returns a [Future] that will complete when the connection is closed or
+     112              :   /// when it has an error. This is the same as [done].
+     113              :   ///
+     114              :   /// [listen] may only be called once.
+     115            8 :   Future listen() {
+     116           32 :     _channel.stream.listen(_handleRequest, onError: (error, stackTrace) {
+     117            0 :       _done.completeError(error, stackTrace);
+     118            0 :       _channel.sink.close();
+     119            0 :     }, onDone: () {
+     120            0 :       if (!_done.isCompleted) _done.complete();
+     121              :     });
+     122            8 :     return done;
+     123              :   }
+     124              : 
+     125              :   /// Closes the underlying connection.
+     126              :   ///
+     127              :   /// Returns a [Future] that completes when all resources have been released.
+     128              :   /// This is the same as [done].
+     129            8 :   Future close() {
+     130           24 :     _channel.sink.close();
+     131           32 :     if (!_done.isCompleted) _done.complete();
+     132            8 :     return done;
+     133              :   }
+     134              : 
+     135              :   /// Registers a method named [name] on this server.
+     136              :   ///
+     137              :   /// [callback] can take either zero or one arguments. If it takes zero, any
+     138              :   /// requests for that method that include parameters will be rejected. If it
+     139              :   /// takes one, it will be passed a [Parameters] object.
+     140              :   ///
+     141              :   /// [callback] can return either a JSON-serializable object or a Future that
+     142              :   /// completes to a JSON-serializable object. Any errors in [callback] will be
+     143              :   /// reported to the client as JSON-RPC 2.0 errors.
+     144            8 :   void registerMethod(String name, Function callback) {
+     145           16 :     if (_methods.containsKey(name)) {
+     146            0 :       throw ArgumentError('There\'s already a method named "$name".');
+     147              :     }
+     148              : 
+     149           16 :     _methods[name] = callback;
+     150              :   }
+     151              : 
+     152              :   /// Registers a fallback method on this server.
+     153              :   ///
+     154              :   /// A server may have any number of fallback methods. When a request comes in
+     155              :   /// that doesn't match any named methods, each fallback is tried in order. A
+     156              :   /// fallback can pass on handling a request by throwing a
+     157              :   /// [RpcException.methodNotFound] exception.
+     158              :   ///
+     159              :   /// [callback] can return either a JSON-serializable object or a Future that
+     160              :   /// completes to a JSON-serializable object. Any errors in [callback] will be
+     161              :   /// reported to the client as JSON-RPC 2.0 errors. [callback] may send custom
+     162              :   /// errors by throwing an [RpcException].
+     163            0 :   void registerFallback(Function(Parameters parameters) callback) {
+     164            0 :     _fallbacks.add(callback);
+     165              :   }
+     166              : 
+     167              :   /// Handle a request.
+     168              :   ///
+     169              :   /// [request] is expected to be a JSON-serializable object representing a
+     170              :   /// request sent by a client. This calls the appropriate method or methods for
+     171              :   /// handling that request and returns a JSON-serializable response, or `null`
+     172              :   /// if no response should be sent. [callback] may send custom
+     173              :   /// errors by throwing an [RpcException].
+     174            7 :   Future _handleRequest(request) async {
+     175              :     dynamic response;
+     176            7 :     if (request is List) {
+     177            0 :       if (request.isEmpty) {
+     178            0 :         response = RpcException(error_code.INVALID_REQUEST,
+     179              :                 'A batch must contain at least one request.')
+     180            0 :             .serialize(request);
+     181              :       } else {
+     182            0 :         var results = await Future.wait(request.map(_handleSingleRequest));
+     183            0 :         var nonNull = results.where((result) => result != null);
+     184            0 :         if (nonNull.isEmpty) return;
+     185            0 :         response = nonNull.toList();
+     186              :       }
+     187              :     } else {
+     188            7 :       response = await _handleSingleRequest(request);
+     189              :       if (response == null) return;
+     190              :     }
+     191              : 
+     192           28 :     if (!isClosed) _channel.sink.add(response);
+     193              :   }
+     194              : 
+     195              :   /// Handles an individual parsed request.
+     196            7 :   Future _handleSingleRequest(request) async {
+     197              :     try {
+     198            7 :       _validateRequest(request);
+     199              : 
+     200            7 :       var name = request['method'];
+     201           14 :       var method = _methods[name];
+     202            0 :       method ??= _tryFallbacks;
+     203              : 
+     204              :       Object? result;
+     205            7 :       if (method is ZeroArgumentFunction) {
+     206            0 :         if (request.containsKey('params')) {
+     207            0 :           throw RpcException.invalidParams('No parameters are allowed for '
+     208              :               'method "$name".');
+     209              :         }
+     210            0 :         result = await method();
+     211              :       } else {
+     212           21 :         result = await method(Parameters(name, request['params']));
+     213              :       }
+     214              : 
+     215              :       // A request without an id is a notification, which should not be sent a
+     216              :       // response, even if one is generated on the server.
+     217            7 :       if (!request.containsKey('id')) return null;
+     218              : 
+     219           14 :       return {'jsonrpc': '2.0', 'result': result, 'id': request['id']};
+     220              :     } catch (error, stackTrace) {
+     221            0 :       if (error is RpcException) {
+     222            0 :         if (error.code == error_code.INVALID_REQUEST ||
+     223            0 :             request.containsKey('id')) {
+     224            0 :           return error.serialize(request);
+     225              :         } else {
+     226            0 :           onUnhandledError?.call(error, stackTrace);
+     227              :           return null;
+     228              :         }
+     229            0 :       } else if (!request.containsKey('id')) {
+     230            0 :         onUnhandledError?.call(error, stackTrace);
+     231              :         return null;
+     232              :       }
+     233            0 :       final chain = Chain.forTrace(stackTrace);
+     234            0 :       return RpcException(error_code.SERVER_ERROR, getErrorMessage(error),
+     235            0 :           data: {
+     236            0 :             'full': '$error',
+     237            0 :             'stack': '$chain',
+     238            0 :           }).serialize(request);
+     239              :     }
+     240              :   }
+     241              : 
+     242              :   /// Validates that [request] matches the JSON-RPC spec.
+     243            7 :   void _validateRequest(request) {
+     244            7 :     if (request is! Map) {
+     245            0 :       throw RpcException(
+     246              :           error_code.INVALID_REQUEST,
+     247              :           'Request must be '
+     248              :           'an Array or an Object.');
+     249              :     }
+     250              : 
+     251           14 :     if (strictProtocolChecks && !request.containsKey('jsonrpc')) {
+     252            0 :       throw RpcException(
+     253              :           error_code.INVALID_REQUEST,
+     254              :           'Request must '
+     255              :           'contain a "jsonrpc" key.');
+     256              :     }
+     257              : 
+     258            7 :     if ((strictProtocolChecks || request.containsKey('jsonrpc')) &&
+     259           14 :         request['jsonrpc'] != '2.0') {
+     260            0 :       throw RpcException(
+     261            0 :           error_code.INVALID_REQUEST,
+     262              :           'Invalid JSON-RPC '
+     263            0 :           'version ${jsonEncode(request['jsonrpc'])}, expected "2.0".');
+     264              :     }
+     265              : 
+     266            7 :     if (!request.containsKey('method')) {
+     267            0 :       throw RpcException(
+     268              :           error_code.INVALID_REQUEST,
+     269              :           'Request must '
+     270              :           'contain a "method" key.');
+     271              :     }
+     272              : 
+     273            7 :     var method = request['method'];
+     274           14 :     if (request['method'] is! String) {
+     275            0 :       throw RpcException(
+     276            0 :           error_code.INVALID_REQUEST,
+     277              :           'Request method must '
+     278            0 :           'be a string, but was ${jsonEncode(method)}.');
+     279              :     }
+     280              : 
+     281            7 :     if (request.containsKey('params')) {
+     282            7 :       var params = request['params'];
+     283           14 :       if (params is! List && params is! Map) {
+     284            0 :         throw RpcException(
+     285            0 :             error_code.INVALID_REQUEST,
+     286              :             'Request params must '
+     287            0 :             'be an Array or an Object, but was ${jsonEncode(params)}.');
+     288              :       }
+     289              :     }
+     290              : 
+     291            7 :     var id = request['id'];
+     292           14 :     if (id != null && id is! String && id is! num) {
+     293            0 :       throw RpcException(
+     294            0 :           error_code.INVALID_REQUEST,
+     295              :           'Request id must be a '
+     296            0 :           'string, number, or null, but was ${jsonEncode(id)}.');
+     297              :     }
+     298              :   }
+     299              : 
+     300              :   /// Try all the fallback methods in order.
+     301            0 :   Future _tryFallbacks(Parameters params) {
+     302            0 :     var iterator = _fallbacks.toList().iterator;
+     303              : 
+     304            0 :     Future tryNext() async {
+     305            0 :       if (!iterator.moveNext()) {
+     306            0 :         throw RpcException.methodNotFound(params.method);
+     307              :       }
+     308              : 
+     309              :       try {
+     310            0 :         return await iterator.current(params);
+     311            0 :       } on RpcException catch (error) {
+     312            0 :         if (error.code != error_code.METHOD_NOT_FOUND) rethrow;
+     313            0 :         return tryNext();
+     314              :       }
+     315              :     }
+     316              : 
+     317            0 :     return tryNext();
+     318              :   }
+     319              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/src/utils.dart.func-c.html b/coverage/html/core/relay_client/json_rpc_2/src/utils.dart.func-c.html new file mode 100644 index 00000000..e2c4c6f7 --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/src/utils.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/src/utils.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2/src - utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:22.7 %225
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/src/utils.dart.func.html b/coverage/html/core/relay_client/json_rpc_2/src/utils.dart.func.html new file mode 100644 index 00000000..72222ef4 --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/src/utils.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/src/utils.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2/src - utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:22.7 %225
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/json_rpc_2/src/utils.dart.gcov.html b/coverage/html/core/relay_client/json_rpc_2/src/utils.dart.gcov.html new file mode 100644 index 00000000..ca94c96a --- /dev/null +++ b/coverage/html/core/relay_client/json_rpc_2/src/utils.dart.gcov.html @@ -0,0 +1,142 @@ + + + + + + + LCOV - lcov.info - core/relay_client/json_rpc_2/src/utils.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/json_rpc_2/src - utils.dartCoverageTotalHit
Test:lcov.infoLines:22.7 %225
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+       2              : // for details. All rights reserved. Use of this source code is governed by a
+       3              : // BSD-style license that can be found in the LICENSE file.
+       4              : 
+       5              : import 'dart:async';
+       6              : 
+       7              : import 'package:stream_channel/stream_channel.dart';
+       8              : 
+       9              : import '../error_code.dart' as error_code;
+      10              : import 'exception.dart';
+      11              : 
+      12              : typedef ZeroArgumentFunction = Function();
+      13              : 
+      14              : /// A regular expression to match the exception prefix that some exceptions'
+      15              : /// [Object.toString] values contain.
+      16            0 : final _exceptionPrefix = RegExp(r'^([A-Z][a-zA-Z]*)?(Exception|Error): ');
+      17              : 
+      18              : /// Get a string description of an exception.
+      19              : ///
+      20              : /// Many exceptions include the exception class name at the beginning of their
+      21              : /// [toString], so we remove that if it exists.
+      22            0 : String getErrorMessage(error) =>
+      23            0 :     error.toString().replaceFirst(_exceptionPrefix, '');
+      24              : 
+      25              : /// Like `try`/`finally`, run [body] and ensure that [whenComplete] runs
+      26              : /// afterwards, regardless of whether [body] succeeded.
+      27              : ///
+      28              : /// This is synchronicity-agnostic relative to [body]. If [body] returns a
+      29              : /// [Future], this wil run asynchronously; otherwise it will run synchronously.
+      30            0 : void tryFinally(Function() body, Function() whenComplete) {
+      31              :   dynamic result;
+      32              :   try {
+      33            0 :     result = body();
+      34              :   } catch (_) {
+      35            0 :     whenComplete();
+      36              :     rethrow;
+      37              :   }
+      38              : 
+      39            0 :   if (result is! Future) {
+      40            0 :     whenComplete();
+      41              :   } else {
+      42            0 :     result.whenComplete(whenComplete);
+      43              :   }
+      44              : }
+      45              : 
+      46              : /// A transformer that silently drops [FormatException]s.
+      47            0 : final ignoreFormatExceptions = StreamTransformer<Object?, Object?>.fromHandlers(
+      48            0 :     handleError: (error, stackTrace, sink) {
+      49            0 :   if (error is FormatException) return;
+      50            0 :   sink.addError(error, stackTrace);
+      51              : });
+      52              : 
+      53              : /// A transformer that sends error responses on [FormatException]s.
+      54           16 : final StreamChannelTransformer<Object?, Object?> respondToFormatExceptions =
+      55            8 :     _RespondToFormatExceptionsTransformer();
+      56              : 
+      57              : class _RespondToFormatExceptionsTransformer
+      58              :     implements StreamChannelTransformer<Object?, Object?> {
+      59            8 :   @override
+      60              :   StreamChannel<Object?> bind(StreamChannel<Object?> channel) {
+      61           16 :     return channel.changeStream((stream) {
+      62            8 :       return stream.handleError((dynamic error) {
+      63              :         final formatException = error as FormatException;
+      64            0 :         var exception = RpcException(
+      65            0 :             error_code.PARSE_ERROR, 'Invalid JSON: ${formatException.message}');
+      66            0 :         channel.sink.add(exception.serialize(formatException.source));
+      67            0 :       }, test: (error) => error is FormatException);
+      68              :     });
+      69              :   }
+      70              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/message_tracker.dart.func-c.html b/coverage/html/core/relay_client/message_tracker.dart.func-c.html new file mode 100644 index 00000000..9bbe532d --- /dev/null +++ b/coverage/html/core/relay_client/message_tracker.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/message_tracker.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client - message_tracker.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %1818
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/message_tracker.dart.func.html b/coverage/html/core/relay_client/message_tracker.dart.func.html new file mode 100644 index 00000000..f735d54f --- /dev/null +++ b/coverage/html/core/relay_client/message_tracker.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/message_tracker.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client - message_tracker.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %1818
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/message_tracker.dart.gcov.html b/coverage/html/core/relay_client/message_tracker.dart.gcov.html new file mode 100644 index 00000000..1a9f3a38 --- /dev/null +++ b/coverage/html/core/relay_client/message_tracker.dart.gcov.html @@ -0,0 +1,124 @@ + + + + + + + LCOV - lcov.info - core/relay_client/message_tracker.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client - message_tracker.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %1818
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:convert';
+       2              : import 'dart:typed_data';
+       3              : 
+       4              : import 'package:convert/convert.dart';
+       5              : import 'package:pointycastle/digests/sha256.dart';
+       6              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/i_message_tracker.dart';
+       7              : import 'package:walletconnect_flutter_v2/apis/core/store/generic_store.dart';
+       8              : import 'package:walletconnect_flutter_v2/apis/core/store/store_models.dart';
+       9              : 
+      10              : class MessageTracker extends GenericStore<Map<String, String>>
+      11              :     implements IMessageTracker {
+      12           11 :   MessageTracker({
+      13              :     required super.storage,
+      14              :     required super.context,
+      15              :     required super.version,
+      16              :     required super.fromJson,
+      17              :   });
+      18              : 
+      19            8 :   String hashMessage(String message) {
+      20            8 :     return hex.encode(
+      21           16 :       SHA256Digest().process(
+      22            8 :         Uint8List.fromList(
+      23            8 :           utf8.encode(message),
+      24              :         ),
+      25              :       ),
+      26              :     );
+      27              :   }
+      28              : 
+      29            8 :   @override
+      30              :   Future<void> recordMessageEvent(String topic, String message) async {
+      31            8 :     final String hash = hashMessage(message);
+      32              : 
+      33           16 :     onCreate.broadcast(
+      34            8 :       StoreCreateEvent(
+      35              :         topic,
+      36            8 :         {hash: message},
+      37              :       ),
+      38              :     );
+      39              : 
+      40           16 :     if (!data.containsKey(topic)) {
+      41           24 :       data[topic] = {};
+      42              :     }
+      43           24 :     data[topic]![hash] = message;
+      44            8 :     await persist();
+      45              :   }
+      46              : 
+      47            8 :   @override
+      48              :   bool messageIsRecorded(String topic, String message) {
+      49            8 :     final String hash = hashMessage(message);
+      50           40 :     return data.containsKey(topic) && data[topic]!.containsKey(hash);
+      51              :   }
+      52              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/relay_client.dart.func-c.html b/coverage/html/core/relay_client/relay_client.dart.func-c.html new file mode 100644 index 00000000..04c62e61 --- /dev/null +++ b/coverage/html/core/relay_client/relay_client.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/relay_client.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client - relay_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:86.6 %172149
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/relay_client.dart.func.html b/coverage/html/core/relay_client/relay_client.dart.func.html new file mode 100644 index 00000000..da54d500 --- /dev/null +++ b/coverage/html/core/relay_client/relay_client.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/relay_client.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client - relay_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:86.6 %172149
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/relay_client.dart.gcov.html b/coverage/html/core/relay_client/relay_client.dart.gcov.html new file mode 100644 index 00000000..8bc73788 --- /dev/null +++ b/coverage/html/core/relay_client/relay_client.dart.gcov.html @@ -0,0 +1,542 @@ + + + + + + + LCOV - lcov.info - core/relay_client/relay_client.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client - relay_client.dartCoverageTotalHit
Test:lcov.infoLines:86.6 %172149
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:async';
+       2              : 
+       3              : import 'package:event/event.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/core/i_core.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/json_rpc_utils.dart';
+       6              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/i_message_tracker.dart';
+       7              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/i_relay_client.dart';
+       8              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/json_rpc_2/src/parameters.dart';
+       9              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/json_rpc_2/src/peer.dart';
+      10              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/i_websocket_handler.dart';
+      11              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client_models.dart';
+      12              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/websocket_handler.dart';
+      13              : import 'package:walletconnect_flutter_v2/apis/core/store/i_generic_store.dart';
+      14              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
+      15              : import 'package:walletconnect_flutter_v2/apis/utils/constants.dart';
+      16              : import 'package:walletconnect_flutter_v2/apis/utils/errors.dart';
+      17              : import 'package:walletconnect_flutter_v2/apis/utils/walletconnect_utils.dart';
+      18              : 
+      19              : class RelayClient implements IRelayClient {
+      20              :   static const JSON_RPC_PUBLISH = 'publish';
+      21              :   static const JSON_RPC_SUBSCRIPTION = 'subscription';
+      22              :   static const JSON_RPC_SUBSCRIBE = 'subscribe';
+      23              :   static const JSON_RPC_UNSUBSCRIBE = 'unsubscribe';
+      24              : 
+      25              :   /// Events ///
+      26              :   /// Relay Client
+      27              : 
+      28              :   @override
+      29              :   final Event<EventArgs> onRelayClientConnect = Event();
+      30              : 
+      31              :   @override
+      32              :   final Event<EventArgs> onRelayClientDisconnect = Event();
+      33              : 
+      34              :   @override
+      35              :   final Event<ErrorEvent> onRelayClientError = Event<ErrorEvent>();
+      36              : 
+      37              :   @override
+      38              :   final Event<MessageEvent> onRelayClientMessage = Event<MessageEvent>();
+      39              : 
+      40              :   /// Subscriptions
+      41              :   @override
+      42              :   final Event<SubscriptionEvent> onSubscriptionCreated =
+      43              :       Event<SubscriptionEvent>();
+      44              : 
+      45              :   @override
+      46              :   final Event<SubscriptionDeletionEvent> onSubscriptionDeleted =
+      47              :       Event<SubscriptionDeletionEvent>();
+      48              : 
+      49              :   @override
+      50              :   final Event<EventArgs> onSubscriptionResubscribed = Event();
+      51              : 
+      52              :   @override
+      53              :   final Event<EventArgs> onSubscriptionSync = Event();
+      54              : 
+      55            9 :   @override
+      56           25 :   bool get isConnected => jsonRPC != null && !jsonRPC!.isClosed;
+      57              : 
+      58           20 :   bool get _relayIsClosed => jsonRPC != null && jsonRPC!.isClosed;
+      59              : 
+      60              :   bool _initialized = false;
+      61              :   bool _active = true;
+      62              :   bool _connecting = false;
+      63              :   Future _connectingFuture = Future.value();
+      64              :   bool _handledClose = false;
+      65              : 
+      66              :   // late WebSocketChannel socket;
+      67              :   // IWebSocketHandler? socket;
+      68              :   Peer? jsonRPC;
+      69              : 
+      70              :   /// Stores all the subs that haven't been completed
+      71              :   Map<String, Future<dynamic>> pendingSubscriptions = {};
+      72              : 
+      73              :   IMessageTracker messageTracker;
+      74              :   IGenericStore<String> topicMap;
+      75              :   final IWebSocketHandler socketHandler;
+      76              : 
+      77              :   ICore core;
+      78              : 
+      79              :   bool _subscribedToHeartbeat = false;
+      80              : 
+      81           10 :   RelayClient({
+      82              :     required this.core,
+      83              :     required this.messageTracker,
+      84              :     required this.topicMap,
+      85              :     IWebSocketHandler? socketHandler,
+      86           10 :   }) : socketHandler = socketHandler ?? WebSocketHandler();
+      87              : 
+      88            9 :   @override
+      89              :   Future<void> init() async {
+      90            9 :     if (_initialized) {
+      91              :       return;
+      92              :     }
+      93              : 
+      94           18 :     await messageTracker.init();
+      95           18 :     await topicMap.init();
+      96              : 
+      97              :     // Setup the json RPC server
+      98            9 :     await _connect();
+      99            9 :     _subscribeToHeartbeat();
+     100              : 
+     101            9 :     _initialized = true;
+     102              :   }
+     103              : 
+     104            7 :   @override
+     105              :   Future<void> publish({
+     106              :     required String topic,
+     107              :     required String message,
+     108              :     required int ttl,
+     109              :     required int tag,
+     110              :   }) async {
+     111            7 :     _checkInitialized();
+     112              : 
+     113            7 :     Map<String, dynamic> data = {
+     114              :       'message': message,
+     115              :       'ttl': ttl,
+     116              :       'topic': topic,
+     117              :       'tag': tag,
+     118              :     };
+     119              : 
+     120              :     try {
+     121           14 :       await messageTracker.recordMessageEvent(topic, message);
+     122            7 :       var _ = await _sendJsonRpcRequest(
+     123            7 :         _buildMethod(JSON_RPC_PUBLISH),
+     124              :         data,
+     125            7 :         JsonRpcUtils.payloadId(entropy: 6),
+     126              :       );
+     127              :     } catch (e) {
+     128              :       // print(e);
+     129           15 :       onRelayClientError.broadcast(ErrorEvent(e));
+     130              :     }
+     131              :   }
+     132              : 
+     133            7 :   @override
+     134              :   Future<String> subscribe({required String topic}) async {
+     135            7 :     _checkInitialized();
+     136              : 
+     137           21 :     pendingSubscriptions[topic] = _onSubscribe(topic);
+     138              : 
+     139           14 :     return await pendingSubscriptions[topic];
+     140              :   }
+     141              : 
+     142            5 :   @override
+     143              :   Future<void> unsubscribe({required String topic}) async {
+     144            5 :     _checkInitialized();
+     145              : 
+     146           10 :     String id = topicMap.get(topic) ?? '';
+     147              : 
+     148              :     try {
+     149            5 :       await _sendJsonRpcRequest(
+     150            5 :         _buildMethod(JSON_RPC_UNSUBSCRIBE),
+     151            5 :         {
+     152              :           'topic': topic,
+     153              :           'id': id,
+     154              :         },
+     155            5 :         JsonRpcUtils.payloadId(entropy: 6),
+     156              :       );
+     157              :     } catch (e) {
+     158           12 :       onRelayClientError.broadcast(ErrorEvent(e));
+     159              :     }
+     160              : 
+     161              :     // Remove the subscription
+     162           10 :     pendingSubscriptions.remove(topic);
+     163           10 :     await topicMap.delete(topic);
+     164              : 
+     165              :     // Delete all the messages
+     166           10 :     await messageTracker.delete(topic);
+     167              :   }
+     168              : 
+     169            0 :   @override
+     170              :   Future<void> connect({String? relayUrl}) async {
+     171            0 :     _checkInitialized();
+     172              : 
+     173            0 :     core.logger.i('RelayClient: Connecting to relay');
+     174              : 
+     175            0 :     await _connect(relayUrl: relayUrl);
+     176              :   }
+     177              : 
+     178            8 :   @override
+     179              :   Future<void> disconnect() async {
+     180            8 :     _checkInitialized();
+     181              : 
+     182           24 :     core.logger.i('RelayClient: Disconnecting from relay');
+     183              : 
+     184            8 :     await _disconnect();
+     185              :   }
+     186              : 
+     187              :   /// PRIVATE FUNCTIONS ///
+     188              : 
+     189            9 :   Future<void> _connect({String? relayUrl}) async {
+     190            9 :     if (isConnected) {
+     191              :       return;
+     192              :     }
+     193              : 
+     194           36 :     core.relayUrl = relayUrl ?? core.relayUrl;
+     195           63 :     core.logger.d('[$runtimeType] Connecting to relay ${core.relayUrl}');
+     196              : 
+     197              :     // If we have tried connecting to the relay before, disconnect
+     198            9 :     if (_active) {
+     199            9 :       await _disconnect();
+     200              :     }
+     201              : 
+     202              :     try {
+     203              :       // Connect and track the connection progress, then start the heartbeat
+     204           18 :       _connectingFuture = _createJsonRPCProvider();
+     205            9 :       await _connectingFuture;
+     206            8 :       _connecting = false;
+     207            8 :       _subscribeToHeartbeat();
+     208              :       //
+     209            2 :     } on TimeoutException catch (e) {
+     210            0 :       core.logger.d('[$runtimeType] Connect timeout: $e');
+     211            0 :       onRelayClientError.broadcast(ErrorEvent('Connection to relay timeout'));
+     212            0 :       _connecting = false;
+     213            0 :       _connect();
+     214              :     } catch (e) {
+     215           10 :       core.logger.d('[$runtimeType] Connect error: $e');
+     216            6 :       onRelayClientError.broadcast(ErrorEvent(e));
+     217            2 :       _connecting = false;
+     218              :     }
+     219              :   }
+     220              : 
+     221            9 :   Future<void> _disconnect() async {
+     222           27 :     core.logger.t('RelayClient Internal: Disconnecting from relay');
+     223            9 :     _active = false;
+     224              : 
+     225            9 :     final bool shouldBroadcastDisonnect = isConnected;
+     226              : 
+     227           17 :     await jsonRPC?.close();
+     228            9 :     jsonRPC = null;
+     229           18 :     await socketHandler.close();
+     230            9 :     _unsubscribeToHeartbeat();
+     231              : 
+     232              :     if (shouldBroadcastDisonnect) {
+     233           16 :       onRelayClientDisconnect.broadcast();
+     234              :     }
+     235              :   }
+     236              : 
+     237            9 :   Future<void> _createJsonRPCProvider() async {
+     238            9 :     _connecting = true;
+     239            9 :     _active = true;
+     240           45 :     final auth = await core.crypto.signJWT(core.relayUrl);
+     241           36 :     core.logger.t('Signed JWT: $auth');
+     242            9 :     final url = WalletConnectUtils.formatRelayRpcUrl(
+     243              :       protocol: WalletConnectConstants.CORE_PROTOCOL,
+     244              :       version: WalletConnectConstants.CORE_VERSION,
+     245           18 :       relayUrl: core.relayUrl,
+     246              :       sdkVersion: WalletConnectConstants.SDK_VERSION,
+     247              :       auth: auth,
+     248           18 :       projectId: core.projectId,
+     249            9 :       packageName: (await WalletConnectUtils.getPackageName()),
+     250              :     );
+     251              : 
+     252            9 :     if (jsonRPC != null) {
+     253            0 :       await jsonRPC!.close();
+     254            0 :       jsonRPC = null;
+     255              :     }
+     256              : 
+     257           36 :     core.logger.t('Initializing WebSocket with $url');
+     258           18 :     await socketHandler.setup(url: url);
+     259           34 :     await socketHandler.connect().timeout(Duration(seconds: 5));
+     260              : 
+     261           32 :     jsonRPC = Peer(socketHandler.channel!);
+     262              : 
+     263           16 :     jsonRPC!.registerMethod(
+     264            8 :       _buildMethod(JSON_RPC_SUBSCRIPTION),
+     265            8 :       _handleSubscription,
+     266              :     );
+     267           16 :     jsonRPC!.registerMethod(
+     268            8 :       _buildMethod(JSON_RPC_SUBSCRIBE),
+     269            8 :       _handleSubscribe,
+     270              :     );
+     271           16 :     jsonRPC!.registerMethod(
+     272            8 :       _buildMethod(JSON_RPC_UNSUBSCRIBE),
+     273            8 :       _handleUnsubscribe,
+     274              :     );
+     275              : 
+     276           16 :     if (jsonRPC!.isClosed) {
+     277              :       throw const WalletConnectError(
+     278              :         code: 0,
+     279              :         message: 'WebSocket closed',
+     280              :       );
+     281              :     }
+     282              : 
+     283           16 :     jsonRPC!.listen();
+     284              : 
+     285              :     // When jsonRPC closes, emit the event
+     286            8 :     _handledClose = false;
+     287           24 :     jsonRPC!.done.then(
+     288            8 :       (value) {
+     289            8 :         _handleRelayClose(
+     290           16 :           socketHandler.closeCode,
+     291           16 :           socketHandler.closeReason,
+     292              :         );
+     293              :       },
+     294              :     );
+     295              : 
+     296           16 :     onRelayClientConnect.broadcast();
+     297           56 :     core.logger.d('[$runtimeType] Connected to relay ${core.relayUrl}');
+     298              :   }
+     299              : 
+     300            8 :   Future<void> _handleRelayClose(int? code, String? reason) async {
+     301            8 :     if (_handledClose) {
+     302            0 :       core.logger.i('Relay close already handled');
+     303              :       return;
+     304              :     }
+     305            8 :     _handledClose = true;
+     306              : 
+     307           32 :     core.logger.i('Handling relay close, code: $code, reason: $reason');
+     308              :     // If the relay isn't active (Disconnected manually), don't do anything
+     309            8 :     if (!_active) {
+     310              :       return;
+     311              :     }
+     312              : 
+     313              :     // If the code requires reconnect, do so
+     314            1 :     final reconnectCodes = [1001, 4008, 4010, 1002, 1005, 10002];
+     315              :     if (code != null) {
+     316            1 :       if (reconnectCodes.contains(code)) {
+     317            0 :         await connect();
+     318              :       } else {
+     319            1 :         await disconnect();
+     320            1 :         final errorReason = code == 3000
+     321              :             ? reason ?? WebSocketErrors.INVALID_PROJECT_ID_OR_JWT
+     322              :             : '';
+     323            2 :         onRelayClientError.broadcast(
+     324            2 :           ErrorEvent(WalletConnectError(
+     325              :             code: code,
+     326              :             message: errorReason,
+     327              :           )),
+     328              :         );
+     329              :       }
+     330              :     }
+     331              :   }
+     332              : 
+     333            9 :   void _subscribeToHeartbeat() {
+     334            9 :     if (!_subscribedToHeartbeat) {
+     335           45 :       core.heartbeat.onPulse.subscribe(_heartbeatSubscription);
+     336            9 :       _subscribedToHeartbeat = true;
+     337              :     }
+     338              :   }
+     339              : 
+     340            9 :   void _unsubscribeToHeartbeat() {
+     341           45 :     core.heartbeat.onPulse.unsubscribe(_heartbeatSubscription);
+     342            9 :     _subscribedToHeartbeat = false;
+     343              :   }
+     344              : 
+     345            5 :   void _heartbeatSubscription(EventArgs? args) async {
+     346            5 :     if (_relayIsClosed) {
+     347            0 :       await _handleRelayClose(10002, null);
+     348              :     }
+     349              :   }
+     350              : 
+     351            8 :   String _buildMethod(String method) {
+     352            8 :     return '${WalletConnectConstants.RELAYER_DEFAULT_PROTOCOL}_$method';
+     353              :   }
+     354              : 
+     355              :   /// JSON RPC MESSAGE HANDLERS
+     356              : 
+     357            7 :   Future<bool> handlePublish(String topic, String message) async {
+     358           28 :     core.logger.t('Handling Publish Message: $topic, $message');
+     359              :     // If we want to ignore the message, stop
+     360            7 :     if (await _shouldIgnoreMessageEvent(topic, message)) {
+     361           24 :       core.logger.w('Ignoring Message: $topic, $message');
+     362              :       return false;
+     363              :     }
+     364              : 
+     365              :     // Record a message event
+     366           14 :     await messageTracker.recordMessageEvent(topic, message);
+     367              : 
+     368              :     // Broadcast the message
+     369           14 :     onRelayClientMessage.broadcast(
+     370            7 :       MessageEvent(
+     371              :         topic,
+     372              :         message,
+     373              :       ),
+     374              :     );
+     375              :     return true;
+     376              :   }
+     377              : 
+     378            7 :   Future<bool> _handleSubscription(Parameters params) async {
+     379           21 :     String topic = params['data']['topic'].value;
+     380           21 :     String message = params['data']['message'].value;
+     381            7 :     return await handlePublish(topic, message);
+     382              :   }
+     383              : 
+     384            0 :   int _handleSubscribe(Parameters params) {
+     385            0 :     return params.hashCode;
+     386              :   }
+     387              : 
+     388            0 :   void _handleUnsubscribe(Parameters params) {
+     389            0 :     core.logger.i('[$runtimeType] _handleUnsubscribe $params');
+     390              :   }
+     391              : 
+     392              :   /// MESSAGE HANDLING
+     393              : 
+     394            7 :   Future<bool> _shouldIgnoreMessageEvent(String topic, String message) async {
+     395            7 :     if (!await _isSubscribed(topic)) return true;
+     396           14 :     return messageTracker.messageIsRecorded(topic, message);
+     397              :   }
+     398              : 
+     399              :   /// SUBSCRIPTION HANDLING
+     400              : 
+     401            8 :   Future _sendJsonRpcRequest(
+     402              :     String method, [
+     403              :     dynamic parameters,
+     404              :     int? id,
+     405              :   ]) async {
+     406              :     // If we are connected and we know it send the message!
+     407            8 :     if (isConnected) {
+     408              :       // Here so we dont return null
+     409              :     }
+     410              :     // If we are connecting, then wait for the connection to establish and then send the message
+     411            5 :     else if (_connecting) {
+     412            0 :       await _connectingFuture;
+     413              :     }
+     414              :     // If we aren't connected but should be (active), try to (re)connect and then send the message
+     415           10 :     else if (!isConnected && _active) {
+     416            0 :       await connect();
+     417              :     }
+     418              :     // In all other cases return null
+     419              :     else {
+     420              :       return null;
+     421              :     }
+     422           16 :     return await jsonRPC!.sendRequest(
+     423              :       method,
+     424              :       parameters,
+     425              :       id,
+     426              :     );
+     427              :   }
+     428              : 
+     429            7 :   Future<String> _onSubscribe(String topic) async {
+     430              :     String? requestId;
+     431              :     try {
+     432            7 :       requestId = await _sendJsonRpcRequest(
+     433            7 :         _buildMethod(JSON_RPC_SUBSCRIBE),
+     434            7 :         {'topic': topic},
+     435            7 :         JsonRpcUtils.payloadId(entropy: 6),
+     436              :       );
+     437              :     } catch (e) {
+     438            4 :       core.logger.w('RelayClient, onSubscribe error. Topic: $topic, Error: $e');
+     439            3 :       onRelayClientError.broadcast(ErrorEvent(e));
+     440              :     }
+     441              : 
+     442              :     if (requestId == null) {
+     443              :       return '';
+     444              :     }
+     445              : 
+     446           21 :     await topicMap.set(topic, requestId.toString());
+     447           14 :     pendingSubscriptions.remove(topic);
+     448              : 
+     449              :     return requestId;
+     450              :   }
+     451              : 
+     452            7 :   Future<bool> _isSubscribed(String topic) async {
+     453           14 :     if (topicMap.has(topic)) {
+     454              :       return true;
+     455              :     }
+     456              : 
+     457            0 :     if (pendingSubscriptions.containsKey(topic)) {
+     458            0 :       await pendingSubscriptions[topic];
+     459            0 :       return topicMap.has(topic);
+     460              :     }
+     461              : 
+     462              :     return false;
+     463              :   }
+     464              : 
+     465            8 :   void _checkInitialized() {
+     466            8 :     if (!_initialized) {
+     467            0 :       throw Errors.getInternalError(Errors.NOT_INITIALIZED);
+     468              :     }
+     469              :   }
+     470              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/relay_client_models.dart.func-c.html b/coverage/html/core/relay_client/relay_client_models.dart.func-c.html new file mode 100644 index 00000000..730cbd9d --- /dev/null +++ b/coverage/html/core/relay_client/relay_client_models.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/relay_client_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client - relay_client_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:50.0 %105
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/relay_client_models.dart.func.html b/coverage/html/core/relay_client/relay_client_models.dart.func.html new file mode 100644 index 00000000..a077498a --- /dev/null +++ b/coverage/html/core/relay_client/relay_client_models.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/relay_client_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client - relay_client_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:50.0 %105
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/relay_client_models.dart.gcov.html b/coverage/html/core/relay_client/relay_client_models.dart.gcov.html new file mode 100644 index 00000000..18cb008d --- /dev/null +++ b/coverage/html/core/relay_client/relay_client_models.dart.gcov.html @@ -0,0 +1,129 @@ + + + + + + + LCOV - lcov.info - core/relay_client/relay_client_models.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client - relay_client_models.dartCoverageTotalHit
Test:lcov.infoLines:50.0 %105
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:event/event.dart';
+       2              : import 'package:json_annotation/json_annotation.dart';
+       3              : 
+       4              : part 'relay_client_models.g.dart';
+       5              : 
+       6              : @JsonSerializable()
+       7              : class Relay {
+       8              :   final String protocol;
+       9              :   final String? data;
+      10              : 
+      11           12 :   Relay(
+      12              :     this.protocol, {
+      13              :     this.data,
+      14              :   });
+      15              : 
+      16            8 :   factory Relay.fromJson(Map<String, dynamic> json) => _$RelayFromJson(json);
+      17              : 
+      18            8 :   Map<String, dynamic> toJson() => _$RelayToJson(this);
+      19              : }
+      20              : 
+      21              : class MessageEvent extends EventArgs {
+      22              :   String topic;
+      23              :   String message;
+      24              : 
+      25            7 :   MessageEvent(
+      26              :     this.topic,
+      27              :     this.message,
+      28              :   );
+      29              : 
+      30            0 :   @override
+      31            0 :   String toString() => 'topic: $topic, message: $message';
+      32              : }
+      33              : 
+      34              : class ErrorEvent extends EventArgs {
+      35              :   dynamic error;
+      36              : 
+      37            8 :   ErrorEvent(
+      38              :     this.error,
+      39              :   );
+      40              : }
+      41              : 
+      42              : class SubscriptionEvent extends EventArgs {
+      43              :   String id;
+      44              : 
+      45            0 :   SubscriptionEvent(
+      46              :     this.id,
+      47              :   );
+      48              : }
+      49              : 
+      50              : class SubscriptionDeletionEvent extends SubscriptionEvent {
+      51              :   String reason;
+      52              : 
+      53            0 :   SubscriptionDeletionEvent(
+      54              :     id,
+      55              :     this.reason,
+      56            0 :   ) : super(id);
+      57              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/websocket/http_client.dart.func-c.html b/coverage/html/core/relay_client/websocket/http_client.dart.func-c.html new file mode 100644 index 00000000..5d77f2cd --- /dev/null +++ b/coverage/html/core/relay_client/websocket/http_client.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/websocket/http_client.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/websocket - http_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:14.3 %71
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/websocket/http_client.dart.func.html b/coverage/html/core/relay_client/websocket/http_client.dart.func.html new file mode 100644 index 00000000..af594287 --- /dev/null +++ b/coverage/html/core/relay_client/websocket/http_client.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/websocket/http_client.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/websocket - http_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:14.3 %71
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/websocket/http_client.dart.gcov.html b/coverage/html/core/relay_client/websocket/http_client.dart.gcov.html new file mode 100644 index 00000000..fecb7aa9 --- /dev/null +++ b/coverage/html/core/relay_client/websocket/http_client.dart.gcov.html @@ -0,0 +1,100 @@ + + + + + + + LCOV - lcov.info - core/relay_client/websocket/http_client.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/websocket - http_client.dartCoverageTotalHit
Test:lcov.infoLines:14.3 %71
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:http/http.dart' as http;
+       2              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/i_http_client.dart';
+       3              : 
+       4              : class HttpWrapper extends IHttpClient {
+       5           82 :   const HttpWrapper();
+       6              : 
+       7            0 :   @override
+       8              :   Future<http.Response> get(
+       9              :     Uri url, {
+      10              :     Map<String, String>? headers,
+      11              :   }) async {
+      12            0 :     return await http.get(url, headers: headers);
+      13              :   }
+      14              : 
+      15            0 :   @override
+      16              :   Future<http.Response> delete(Uri url, {Map<String, String>? headers}) async {
+      17            0 :     return await http.delete(url, headers: headers);
+      18              :   }
+      19              : 
+      20            0 :   @override
+      21              :   Future<http.Response> post(
+      22              :     Uri url, {
+      23              :     Map<String, String>? headers,
+      24              :     Object? body,
+      25              :   }) async {
+      26            0 :     return await http.post(url, headers: headers, body: body);
+      27              :   }
+      28              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/websocket/i_http_client.dart.func-c.html b/coverage/html/core/relay_client/websocket/i_http_client.dart.func-c.html new file mode 100644 index 00000000..065db477 --- /dev/null +++ b/coverage/html/core/relay_client/websocket/i_http_client.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/websocket/i_http_client.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/websocket - i_http_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %11
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/websocket/i_http_client.dart.func.html b/coverage/html/core/relay_client/websocket/i_http_client.dart.func.html new file mode 100644 index 00000000..ada9bcaa --- /dev/null +++ b/coverage/html/core/relay_client/websocket/i_http_client.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/websocket/i_http_client.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/websocket - i_http_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %11
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/websocket/i_http_client.dart.gcov.html b/coverage/html/core/relay_client/websocket/i_http_client.dart.gcov.html new file mode 100644 index 00000000..e8aee9f9 --- /dev/null +++ b/coverage/html/core/relay_client/websocket/i_http_client.dart.gcov.html @@ -0,0 +1,93 @@ + + + + + + + LCOV - lcov.info - core/relay_client/websocket/i_http_client.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/websocket - i_http_client.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %11
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:http/http.dart' as http;
+       2              : 
+       3              : abstract class IHttpClient {
+       4           82 :   const IHttpClient();
+       5              : 
+       6              :   Future<http.Response> get(
+       7              :     Uri url, {
+       8              :     Map<String, String>? headers,
+       9              :   });
+      10              : 
+      11              :   Future<http.Response> post(
+      12              :     Uri url, {
+      13              :     Map<String, String>? headers,
+      14              :     Object? body,
+      15              :   });
+      16              : 
+      17              :   Future<http.Response> delete(
+      18              :     Uri url, {
+      19              :     Map<String, String>? headers,
+      20              :   });
+      21              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/websocket/index-sort-f.html b/coverage/html/core/relay_client/websocket/index-sort-f.html new file mode 100644 index 00000000..150716ab --- /dev/null +++ b/coverage/html/core/relay_client/websocket/index-sort-f.html @@ -0,0 +1,129 @@ + + + + + + + LCOV - lcov.info - core/relay_client/websocket + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/websocketCoverageTotalHit
Test:lcov.infoLines:60.0 %4024
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
http_client.dart +
14.3%14.3%
+
14.3 %71-
i_http_client.dart +
100.0%
+
100.0 %11-
websocket_handler.dart +
68.8%68.8%
+
68.8 %3222-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/websocket/index-sort-l.html b/coverage/html/core/relay_client/websocket/index-sort-l.html new file mode 100644 index 00000000..41517308 --- /dev/null +++ b/coverage/html/core/relay_client/websocket/index-sort-l.html @@ -0,0 +1,109 @@ + + + + + + + LCOV - lcov.info - core/relay_client/websocket + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/websocketCoverageTotalHit
Test:lcov.infoLines:60.0 %4024
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
http_client.dart +
14.3%14.3%
+
14.3 %71
websocket_handler.dart +
68.8%68.8%
+
68.8 %3222
i_http_client.dart +
100.0%
+
100.0 %11
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/websocket/index.html b/coverage/html/core/relay_client/websocket/index.html new file mode 100644 index 00000000..c199af58 --- /dev/null +++ b/coverage/html/core/relay_client/websocket/index.html @@ -0,0 +1,109 @@ + + + + + + + LCOV - lcov.info - core/relay_client/websocket + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/websocketCoverageTotalHit
Test:lcov.infoLines:60.0 %4024
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
http_client.dart +
14.3%14.3%
+
14.3 %71
i_http_client.dart +
100.0%
+
100.0 %11
websocket_handler.dart +
68.8%68.8%
+
68.8 %3222
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/websocket/websocket_handler.dart.func-c.html b/coverage/html/core/relay_client/websocket/websocket_handler.dart.func-c.html new file mode 100644 index 00000000..9a0650fa --- /dev/null +++ b/coverage/html/core/relay_client/websocket/websocket_handler.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/websocket/websocket_handler.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/websocket - websocket_handler.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:68.8 %3222
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/websocket/websocket_handler.dart.func.html b/coverage/html/core/relay_client/websocket/websocket_handler.dart.func.html new file mode 100644 index 00000000..d1963b84 --- /dev/null +++ b/coverage/html/core/relay_client/websocket/websocket_handler.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/relay_client/websocket/websocket_handler.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/websocket - websocket_handler.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:68.8 %3222
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/relay_client/websocket/websocket_handler.dart.gcov.html b/coverage/html/core/relay_client/websocket/websocket_handler.dart.gcov.html new file mode 100644 index 00000000..daa1f8e4 --- /dev/null +++ b/coverage/html/core/relay_client/websocket/websocket_handler.dart.gcov.html @@ -0,0 +1,162 @@ + + + + + + + LCOV - lcov.info - core/relay_client/websocket/websocket_handler.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/relay_client/websocket - websocket_handler.dartCoverageTotalHit
Test:lcov.infoLines:68.8 %3222
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:async';
+       2              : 
+       3              : import 'package:stream_channel/stream_channel.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/i_websocket_handler.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
+       6              : import 'package:web_socket_channel/web_socket_channel.dart';
+       7              : 
+       8              : class WebSocketHandler implements IWebSocketHandler {
+       9              :   String? _url;
+      10            8 :   @override
+      11            8 :   String? get url => _url;
+      12              : 
+      13              :   WebSocketChannel? _socket;
+      14              : 
+      15            8 :   @override
+      16           16 :   int? get closeCode => _socket?.closeCode;
+      17            8 :   @override
+      18           16 :   String? get closeReason => _socket?.closeReason;
+      19              : 
+      20              :   StreamChannel<String>? _channel;
+      21            8 :   @override
+      22            8 :   StreamChannel<String>? get channel => _channel;
+      23              : 
+      24            0 :   @override
+      25            0 :   Future<void> get ready => _socket!.ready;
+      26              : 
+      27              :   // const WebSocketHandler();
+      28              : 
+      29            8 :   @override
+      30              :   Future<void> setup({
+      31              :     required String url,
+      32              :   }) async {
+      33            8 :     _url = url;
+      34              : 
+      35            8 :     await close();
+      36              :   }
+      37              : 
+      38            8 :   @override
+      39              :   Future<void> connect() async {
+      40              :     // print('connecting');
+      41              :     try {
+      42           16 :       _socket = WebSocketChannel.connect(
+      43            8 :         Uri.parse(
+      44           16 :           '$url&useOnCloseEvent=true',
+      45              :         ),
+      46              :       );
+      47              :     } catch (e) {
+      48            0 :       throw WalletConnectError(
+      49            0 :         code: -1,
+      50            0 :         message: 'No internet connection: ${e.toString()}',
+      51              :       );
+      52              :     }
+      53              : 
+      54           24 :     _channel = _socket!.cast<String>();
+      55              : 
+      56            8 :     if (_channel == null) {
+      57              :       // print('Socket channel is null, waiting...');
+      58            0 :       await Future.delayed(const Duration(milliseconds: 500));
+      59            0 :       if (_channel == null) {
+      60              :         // print('Socket channel is still null, throwing ');
+      61            0 :         throw Exception('Socket channel is null');
+      62              :       }
+      63              :     }
+      64              : 
+      65           16 :     await _socket!.ready;
+      66              : 
+      67              :     // Check if the request was successful (status code 200)
+      68              :     // try {} catch (e) {
+      69              :     //   throw WalletConnectError(
+      70              :     //     code: 400,
+      71              :     //     message: 'WebSocket connection failed, missing or invalid project id.',
+      72              :     //   );
+      73              :     // }
+      74              :   }
+      75              : 
+      76            8 :   @override
+      77              :   Future<void> close() async {
+      78              :     try {
+      79            8 :       if (_socket != null) {
+      80           24 :         await _socket?.sink.close();
+      81              :       }
+      82              :     } catch (_) {}
+      83            8 :     _socket = null;
+      84              :   }
+      85              : 
+      86            0 :   @override
+      87              :   String toString() {
+      88            0 :     return 'WebSocketHandler{url: $url, _socket: $_socket, _channel: $_channel}';
+      89              :   }
+      90              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/store/generic_store.dart.func-c.html b/coverage/html/core/store/generic_store.dart.func-c.html new file mode 100644 index 00000000..f6155c70 --- /dev/null +++ b/coverage/html/core/store/generic_store.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/store/generic_store.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/store - generic_store.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:98.1 %5453
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/store/generic_store.dart.func.html b/coverage/html/core/store/generic_store.dart.func.html new file mode 100644 index 00000000..b996a19e --- /dev/null +++ b/coverage/html/core/store/generic_store.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/store/generic_store.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/store - generic_store.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:98.1 %5453
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/store/generic_store.dart.gcov.html b/coverage/html/core/store/generic_store.dart.gcov.html new file mode 100644 index 00000000..cd27193a --- /dev/null +++ b/coverage/html/core/store/generic_store.dart.gcov.html @@ -0,0 +1,243 @@ + + + + + + + LCOV - lcov.info - core/store/generic_store.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/store - generic_store.dartCoverageTotalHit
Test:lcov.infoLines:98.1 %5453
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:event/event.dart';
+       2              : import 'package:flutter/material.dart';
+       3              : import 'package:walletconnect_flutter_v2/apis/core/store/i_generic_store.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/core/store/i_store.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/core/store/store_models.dart';
+       6              : import 'package:walletconnect_flutter_v2/apis/utils/errors.dart';
+       7              : 
+       8              : class GenericStore<T> implements IGenericStore<T> {
+       9              :   @override
+      10              :   final String context;
+      11              :   @override
+      12              :   final String version;
+      13              : 
+      14           12 :   @override
+      15           36 :   String get storageKey => '$version//$context';
+      16              :   @override
+      17              :   final IStore storage;
+      18              : 
+      19              :   @override
+      20              :   final Event<StoreCreateEvent<T>> onCreate = Event();
+      21              :   @override
+      22              :   final Event<StoreUpdateEvent<T>> onUpdate = Event();
+      23              :   @override
+      24              :   final Event<StoreDeleteEvent<T>> onDelete = Event();
+      25              :   @override
+      26              :   final Event<StoreSyncEvent> onSync = Event();
+      27              : 
+      28              :   bool _initialized = false;
+      29              : 
+      30              :   /// Stores map of key to pairing info
+      31              :   Map<String, T> data = {};
+      32              : 
+      33              :   @override
+      34              :   final T Function(dynamic) fromJson;
+      35              : 
+      36           12 :   GenericStore({
+      37              :     required this.storage,
+      38              :     required this.context,
+      39              :     required this.version,
+      40              :     required this.fromJson,
+      41              :   });
+      42              : 
+      43           12 :   @override
+      44              :   Future<void> init() async {
+      45           12 :     if (_initialized) {
+      46              :       return;
+      47              :     }
+      48              : 
+      49           24 :     await storage.init();
+      50           12 :     await restore();
+      51              : 
+      52           12 :     _initialized = true;
+      53              :   }
+      54              : 
+      55            8 :   @override
+      56              :   bool has(String key) {
+      57            8 :     checkInitialized();
+      58           16 :     return data.containsKey(key);
+      59              :   }
+      60              : 
+      61           12 :   @override
+      62              :   T? get(String key) {
+      63           12 :     checkInitialized();
+      64           24 :     if (data.containsKey(key)) {
+      65           20 :       return data[key]!;
+      66              :     }
+      67              :     return null;
+      68              :   }
+      69              : 
+      70           10 :   @override
+      71              :   List<T> getAll() {
+      72           30 :     return data.values.toList();
+      73              :   }
+      74              : 
+      75           12 :   @override
+      76              :   Future<void> set(String key, T value) async {
+      77           12 :     checkInitialized();
+      78              : 
+      79           24 :     if (data.containsKey(key)) {
+      80           18 :       onUpdate.broadcast(
+      81            9 :         StoreUpdateEvent(
+      82              :           key,
+      83              :           value,
+      84              :         ),
+      85              :       );
+      86              :     } else {
+      87           24 :       onCreate.broadcast(
+      88           12 :         StoreCreateEvent(
+      89              :           key,
+      90              :           value,
+      91              :         ),
+      92              :       );
+      93              :     }
+      94              : 
+      95           24 :     data[key] = value;
+      96              : 
+      97           12 :     await persist();
+      98              :   }
+      99              : 
+     100            9 :   @override
+     101              :   Future<void> delete(String key) async {
+     102            9 :     checkInitialized();
+     103              : 
+     104           18 :     if (!data.containsKey(key)) {
+     105              :       return;
+     106              :     }
+     107              : 
+     108           18 :     onDelete.broadcast(
+     109            9 :       StoreDeleteEvent(
+     110              :         key,
+     111           18 :         data.remove(key) as T,
+     112              :       ),
+     113              :     );
+     114              : 
+     115            9 :     await persist();
+     116              :   }
+     117              : 
+     118           12 :   @override
+     119              :   Future<void> persist() async {
+     120           12 :     checkInitialized();
+     121              : 
+     122           24 :     onSync.broadcast(
+     123           12 :       StoreSyncEvent(),
+     124              :     );
+     125              : 
+     126           48 :     await storage.set(storageKey, data);
+     127              :   }
+     128              : 
+     129           12 :   @override
+     130              :   Future<void> restore() async {
+     131              :     // If we haven't stored our version yet, we need to store it and stop
+     132           36 :     if (!storage.has(context)) {
+     133              :       // print('Storing $context');
+     134           60 :       await storage.set(context, {'version': version});
+     135           48 :       await storage.set(storageKey, <String, dynamic>{});
+     136              :       return;
+     137              :     }
+     138              : 
+     139              :     // If we have stored our version, but it doesn't match, we need to delete the previous data,
+     140              :     // create a new version, and stop
+     141           32 :     final String storedVersion = storage.get(context)['version'];
+     142           16 :     if (storedVersion != version) {
+     143              :       // print('Updating storage from $storedVersion to $version');
+     144            4 :       await storage.delete('$storedVersion//$context');
+     145            5 :       await storage.set(context, {'version': version});
+     146            4 :       await storage.set(storageKey, <String, dynamic>{});
+     147              :       return;
+     148              :     }
+     149              : 
+     150           24 :     if (storage.has(storageKey)) {
+     151              :       // If there is invalid data, delete the stored data
+     152              :       // print('Restoring $storageKey');
+     153              :       try {
+     154           34 :         for (var entry in storage.get(storageKey).entries) {
+     155              :           // print(entry);
+     156           12 :           data[entry.key] = fromJson(entry.value);
+     157              :         }
+     158              :       } catch (e) {
+     159              :         // print('Error restoring $storageKey: $e');
+     160            2 :         await storage.delete(storedVersion);
+     161              :       }
+     162              :     }
+     163              :   }
+     164              : 
+     165           12 :   @protected
+     166              :   void checkInitialized() {
+     167           12 :     if (!_initialized) {
+     168            0 :       throw Errors.getInternalError(Errors.NOT_INITIALIZED);
+     169              :     }
+     170              :   }
+     171              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/store/index-sort-f.html b/coverage/html/core/store/index-sort-f.html new file mode 100644 index 00000000..18d19607 --- /dev/null +++ b/coverage/html/core/store/index-sort-f.html @@ -0,0 +1,129 @@ + + + + + + + LCOV - lcov.info - core/store + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/storeCoverageTotalHit
Test:lcov.infoLines:75.2 %12594
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
generic_store.dart +
98.1%98.1%
+
98.1 %5453-
shared_prefs_store.dart +
55.2%55.2%
+
55.2 %6737-
store_models.dart +
100.0%
+
100.0 %44-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/store/index-sort-l.html b/coverage/html/core/store/index-sort-l.html new file mode 100644 index 00000000..4bddb2d2 --- /dev/null +++ b/coverage/html/core/store/index-sort-l.html @@ -0,0 +1,109 @@ + + + + + + + LCOV - lcov.info - core/store + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/storeCoverageTotalHit
Test:lcov.infoLines:75.2 %12594
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
shared_prefs_store.dart +
55.2%55.2%
+
55.2 %6737
generic_store.dart +
98.1%98.1%
+
98.1 %5453
store_models.dart +
100.0%
+
100.0 %44
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/store/index.html b/coverage/html/core/store/index.html new file mode 100644 index 00000000..8b9b99c1 --- /dev/null +++ b/coverage/html/core/store/index.html @@ -0,0 +1,109 @@ + + + + + + + LCOV - lcov.info - core/store + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/storeCoverageTotalHit
Test:lcov.infoLines:75.2 %12594
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
generic_store.dart +
98.1%98.1%
+
98.1 %5453
shared_prefs_store.dart +
55.2%55.2%
+
55.2 %6737
store_models.dart +
100.0%
+
100.0 %44
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/store/shared_prefs_store.dart.func-c.html b/coverage/html/core/store/shared_prefs_store.dart.func-c.html new file mode 100644 index 00000000..86aff844 --- /dev/null +++ b/coverage/html/core/store/shared_prefs_store.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/store/shared_prefs_store.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/store - shared_prefs_store.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:55.2 %6737
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/store/shared_prefs_store.dart.func.html b/coverage/html/core/store/shared_prefs_store.dart.func.html new file mode 100644 index 00000000..ac040d97 --- /dev/null +++ b/coverage/html/core/store/shared_prefs_store.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/store/shared_prefs_store.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/store - shared_prefs_store.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:55.2 %6737
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/store/shared_prefs_store.dart.gcov.html b/coverage/html/core/store/shared_prefs_store.dart.gcov.html new file mode 100644 index 00000000..077f0ad1 --- /dev/null +++ b/coverage/html/core/store/shared_prefs_store.dart.gcov.html @@ -0,0 +1,232 @@ + + + + + + + LCOV - lcov.info - core/store/shared_prefs_store.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/store - shared_prefs_store.dartCoverageTotalHit
Test:lcov.infoLines:55.2 %6737
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:convert';
+       2              : 
+       3              : import 'package:shared_preferences/shared_preferences.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/core/store/i_store.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/utils/constants.dart';
+       6              : import 'package:walletconnect_flutter_v2/apis/utils/errors.dart';
+       7              : 
+       8              : class SharedPrefsStores implements IStore<Map<String, dynamic>> {
+       9              :   late SharedPreferences prefs;
+      10              :   bool _initialized = false;
+      11              : 
+      12              :   final Map<String, Map<String, dynamic>> _map;
+      13              : 
+      14            0 :   @override
+      15            0 :   Map<String, Map<String, dynamic>> get map => _map;
+      16              : 
+      17            0 :   @override
+      18            0 :   List<String> get keys => map.keys.toList();
+      19              : 
+      20            0 :   @override
+      21            0 :   List<Map<String, dynamic>> get values => map.values.toList();
+      22              : 
+      23           12 :   @override
+      24              :   String get storagePrefix => WalletConnectConstants.CORE_STORAGE_PREFIX;
+      25              : 
+      26              :   final bool memoryStore;
+      27              : 
+      28           12 :   SharedPrefsStores({
+      29              :     Map<String, Map<String, dynamic>>? defaultValue,
+      30              :     this.memoryStore = false,
+      31           12 :   }) : _map = defaultValue ?? {};
+      32              : 
+      33              :   /// Initializes the store, loading all persistent values into memory.
+      34           12 :   @override
+      35              :   Future<void> init() async {
+      36           12 :     if (_initialized) {
+      37              :       return;
+      38              :     }
+      39              : 
+      40           12 :     if (!memoryStore) {
+      41            0 :       prefs = await SharedPreferences.getInstance();
+      42              :     }
+      43              : 
+      44           12 :     _initialized = true;
+      45              :   }
+      46              : 
+      47              :   /// Gets the value of the specified key, if it hasn't been cached yet, it caches it.
+      48              :   /// If the key doesn't exist it throws an error.
+      49            8 :   @override
+      50              :   Map<String, dynamic>? get(String key) {
+      51            8 :     _checkInitialized();
+      52              : 
+      53            8 :     final String keyWithPrefix = _addPrefix(key);
+      54           16 :     if (_map.containsKey(keyWithPrefix)) {
+      55           16 :       return _map[keyWithPrefix];
+      56              :     }
+      57              : 
+      58            1 :     Map<String, dynamic>? value = _getPref(keyWithPrefix);
+      59              :     if (value != null) {
+      60            0 :       _map[keyWithPrefix] = value;
+      61              :     }
+      62              :     return value;
+      63              :   }
+      64              : 
+      65           12 :   @override
+      66              :   bool has(String key) {
+      67           12 :     final String keyWithPrefix = _addPrefix(key);
+      68           12 :     if (memoryStore) {
+      69           24 :       return _map.containsKey(keyWithPrefix);
+      70              :     }
+      71            0 :     return prefs.containsKey(keyWithPrefix);
+      72              :   }
+      73              : 
+      74              :   /// Gets all of the values of the store
+      75            0 :   @override
+      76              :   List<Map<String, dynamic>> getAll() {
+      77            0 :     _checkInitialized();
+      78            0 :     return values;
+      79              :   }
+      80              : 
+      81              :   /// Sets the value of a key within the store, overwriting the value if it exists.
+      82           12 :   @override
+      83              :   Future<void> set(String key, Map<String, dynamic> value) async {
+      84           12 :     _checkInitialized();
+      85              : 
+      86           12 :     final String keyWithPrefix = _addPrefix(key);
+      87           24 :     _map[keyWithPrefix] = value;
+      88           12 :     await _updatePref(keyWithPrefix, value);
+      89              :   }
+      90              : 
+      91              :   /// Updates the value of a key. Fails if it does not exist.
+      92            0 :   @override
+      93              :   Future<void> update(String key, Map<String, dynamic> value) async {
+      94            0 :     _checkInitialized();
+      95              : 
+      96            0 :     final String keyWithPrefix = _addPrefix(key);
+      97            0 :     if (!map.containsKey(keyWithPrefix)) {
+      98            0 :       throw Errors.getInternalError(Errors.NO_MATCHING_KEY);
+      99              :     } else {
+     100            0 :       _map[keyWithPrefix] = value;
+     101            0 :       await _updatePref(keyWithPrefix, value);
+     102              :     }
+     103              :   }
+     104              : 
+     105              :   /// Removes the key from the persistent store
+     106            1 :   @override
+     107              :   Future<void> delete(String key) async {
+     108            1 :     _checkInitialized();
+     109              : 
+     110            1 :     final String keyWithPrefix = _addPrefix(key);
+     111            2 :     _map.remove(keyWithPrefix);
+     112            1 :     await _removePref(keyWithPrefix);
+     113              :   }
+     114              : 
+     115            1 :   Map<String, dynamic>? _getPref(String key) {
+     116            1 :     if (memoryStore) {
+     117              :       return null;
+     118              :     }
+     119              : 
+     120            0 :     if (prefs.containsKey(key)) {
+     121            0 :       final value = prefs.getString(key)!;
+     122            0 :       return jsonDecode(value);
+     123              :     } else {
+     124            0 :       throw Errors.getInternalError(Errors.NO_MATCHING_KEY);
+     125              :     }
+     126              :   }
+     127              : 
+     128           12 :   Future<void> _updatePref(String key, Map<String, dynamic> value) async {
+     129           12 :     if (memoryStore) {
+     130              :       return;
+     131              :     }
+     132              : 
+     133              :     try {
+     134            0 :       final stringValue = jsonEncode(value);
+     135            0 :       await prefs.setString(key, stringValue);
+     136            0 :     } on Exception catch (e) {
+     137            0 :       throw Errors.getInternalError(
+     138              :         Errors.MISSING_OR_INVALID,
+     139            0 :         context: e.toString(),
+     140              :       );
+     141              :     }
+     142              :   }
+     143              : 
+     144            1 :   Future<void> _removePref(String key) async {
+     145            1 :     if (memoryStore) {
+     146              :       return;
+     147              :     }
+     148            0 :     await prefs.remove(key);
+     149              :   }
+     150              : 
+     151           12 :   String _addPrefix(String key) {
+     152           24 :     return '$storagePrefix$key';
+     153              :   }
+     154              : 
+     155           12 :   void _checkInitialized() {
+     156           12 :     if (!_initialized) {
+     157            0 :       throw Errors.getInternalError(Errors.NOT_INITIALIZED);
+     158              :     }
+     159              :   }
+     160              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/store/store_models.dart.func-c.html b/coverage/html/core/store/store_models.dart.func-c.html new file mode 100644 index 00000000..3330a52f --- /dev/null +++ b/coverage/html/core/store/store_models.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/store/store_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/store - store_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %44
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/store/store_models.dart.func.html b/coverage/html/core/store/store_models.dart.func.html new file mode 100644 index 00000000..99277502 --- /dev/null +++ b/coverage/html/core/store/store_models.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/store/store_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/store - store_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %44
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/store/store_models.dart.gcov.html b/coverage/html/core/store/store_models.dart.gcov.html new file mode 100644 index 00000000..b6a1c2fd --- /dev/null +++ b/coverage/html/core/store/store_models.dart.gcov.html @@ -0,0 +1,107 @@ + + + + + + + LCOV - lcov.info - core/store/store_models.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/store - store_models.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %44
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:event/event.dart';
+       2              : 
+       3              : class StoreCreateEvent<T> extends EventArgs {
+       4              :   final String key;
+       5              :   final T value;
+       6              : 
+       7           12 :   StoreCreateEvent(
+       8              :     this.key,
+       9              :     this.value,
+      10              :   );
+      11              : }
+      12              : 
+      13              : class StoreUpdateEvent<T> extends EventArgs {
+      14              :   final String key;
+      15              :   final T value;
+      16              : 
+      17            9 :   StoreUpdateEvent(
+      18              :     this.key,
+      19              :     this.value,
+      20              :   );
+      21              : }
+      22              : 
+      23              : class StoreDeleteEvent<T> extends EventArgs {
+      24              :   final String key;
+      25              :   final T value;
+      26              : 
+      27            9 :   StoreDeleteEvent(
+      28              :     this.key,
+      29              :     this.value,
+      30              :   );
+      31              : }
+      32              : 
+      33              : class StoreSyncEvent extends EventArgs {
+      34           12 :   StoreSyncEvent();
+      35              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/verify/index-sort-f.html b/coverage/html/core/verify/index-sort-f.html new file mode 100644 index 00000000..05fef30b --- /dev/null +++ b/coverage/html/core/verify/index-sort-f.html @@ -0,0 +1,105 @@ + + + + + + + LCOV - lcov.info - core/verify + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/verifyCoverageTotalHit
Test:lcov.infoLines:68.8 %1611
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
verify.dart +
68.8%68.8%
+
68.8 %1611-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/verify/index-sort-l.html b/coverage/html/core/verify/index-sort-l.html new file mode 100644 index 00000000..b58f2163 --- /dev/null +++ b/coverage/html/core/verify/index-sort-l.html @@ -0,0 +1,91 @@ + + + + + + + LCOV - lcov.info - core/verify + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/verifyCoverageTotalHit
Test:lcov.infoLines:68.8 %1611
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
verify.dart +
68.8%68.8%
+
68.8 %1611
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/verify/index.html b/coverage/html/core/verify/index.html new file mode 100644 index 00000000..364763fc --- /dev/null +++ b/coverage/html/core/verify/index.html @@ -0,0 +1,91 @@ + + + + + + + LCOV - lcov.info - core/verify + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/verifyCoverageTotalHit
Test:lcov.infoLines:68.8 %1611
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
verify.dart +
68.8%68.8%
+
68.8 %1611
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/verify/models/index-sort-f.html b/coverage/html/core/verify/models/index-sort-f.html new file mode 100644 index 00000000..8d4773bf --- /dev/null +++ b/coverage/html/core/verify/models/index-sort-f.html @@ -0,0 +1,105 @@ + + + + + + + LCOV - lcov.info - core/verify/models + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/verify/modelsCoverageTotalHit
Test:lcov.infoLines:11.1 %91
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
verify_context.dart +
11.1%11.1%
+
11.1 %91-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/verify/models/index-sort-l.html b/coverage/html/core/verify/models/index-sort-l.html new file mode 100644 index 00000000..e8f1561b --- /dev/null +++ b/coverage/html/core/verify/models/index-sort-l.html @@ -0,0 +1,91 @@ + + + + + + + LCOV - lcov.info - core/verify/models + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/verify/modelsCoverageTotalHit
Test:lcov.infoLines:11.1 %91
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
verify_context.dart +
11.1%11.1%
+
11.1 %91
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/verify/models/index.html b/coverage/html/core/verify/models/index.html new file mode 100644 index 00000000..b92f34cd --- /dev/null +++ b/coverage/html/core/verify/models/index.html @@ -0,0 +1,91 @@ + + + + + + + LCOV - lcov.info - core/verify/models + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/verify/modelsCoverageTotalHit
Test:lcov.infoLines:11.1 %91
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
verify_context.dart +
11.1%11.1%
+
11.1 %91
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/verify/models/verify_context.dart.func-c.html b/coverage/html/core/verify/models/verify_context.dart.func-c.html new file mode 100644 index 00000000..db576da9 --- /dev/null +++ b/coverage/html/core/verify/models/verify_context.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/verify/models/verify_context.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/verify/models - verify_context.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:11.1 %91
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/verify/models/verify_context.dart.func.html b/coverage/html/core/verify/models/verify_context.dart.func.html new file mode 100644 index 00000000..3ec78b10 --- /dev/null +++ b/coverage/html/core/verify/models/verify_context.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/verify/models/verify_context.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/verify/models - verify_context.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:11.1 %91
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/verify/models/verify_context.dart.gcov.html b/coverage/html/core/verify/models/verify_context.dart.gcov.html new file mode 100644 index 00000000..0aec3ceb --- /dev/null +++ b/coverage/html/core/verify/models/verify_context.dart.gcov.html @@ -0,0 +1,122 @@ + + + + + + + LCOV - lcov.info - core/verify/models/verify_context.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/verify/models - verify_context.dartCoverageTotalHit
Test:lcov.infoLines:11.1 %91
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:freezed_annotation/freezed_annotation.dart';
+       2              : 
+       3              : part 'verify_context.g.dart';
+       4              : part 'verify_context.freezed.dart';
+       5              : 
+       6              : enum Validation {
+       7              :   UNKNOWN,
+       8              :   VALID,
+       9              :   INVALID,
+      10              :   SCAM;
+      11              : 
+      12            0 :   bool get invalid => this == INVALID;
+      13            0 :   bool get valid => this == VALID;
+      14            0 :   bool get unknown => this == UNKNOWN;
+      15            0 :   bool get scam => this == SCAM;
+      16              : }
+      17              : 
+      18              : @freezed
+      19              : class VerifyContext with _$VerifyContext {
+      20              :   @JsonSerializable()
+      21              :   const factory VerifyContext({
+      22              :     required String origin,
+      23              :     required Validation validation,
+      24              :     required String verifyUrl,
+      25              :     bool? isScam,
+      26              :   }) = _VerifyContext;
+      27              : 
+      28            0 :   factory VerifyContext.fromJson(Map<String, dynamic> json) =>
+      29            0 :       _$VerifyContextFromJson(json);
+      30              : }
+      31              : 
+      32              : @freezed
+      33              : class AttestationResponse with _$AttestationResponse {
+      34              :   @JsonSerializable()
+      35              :   const factory AttestationResponse({
+      36              :     required String origin,
+      37              :     required String attestationId,
+      38              :     bool? isScam,
+      39              :   }) = _AttestationResponse;
+      40              : 
+      41            0 :   factory AttestationResponse.fromJson(Map<String, dynamic> json) =>
+      42            0 :       _$AttestationResponseFromJson(json);
+      43              : }
+      44              : 
+      45              : class AttestationNotFound implements Exception {
+      46              :   int code;
+      47              :   String message;
+      48              : 
+      49            8 :   AttestationNotFound({required this.code, required this.message}) : super();
+      50              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/verify/verify.dart.func-c.html b/coverage/html/core/verify/verify.dart.func-c.html new file mode 100644 index 00000000..75309f44 --- /dev/null +++ b/coverage/html/core/verify/verify.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/verify/verify.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/verify - verify.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:68.8 %1611
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/verify/verify.dart.func.html b/coverage/html/core/verify/verify.dart.func.html new file mode 100644 index 00000000..c7702288 --- /dev/null +++ b/coverage/html/core/verify/verify.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - core/verify/verify.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/verify - verify.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:68.8 %1611
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/core/verify/verify.dart.gcov.html b/coverage/html/core/verify/verify.dart.gcov.html new file mode 100644 index 00000000..80e3521d --- /dev/null +++ b/coverage/html/core/verify/verify.dart.gcov.html @@ -0,0 +1,132 @@ + + + + + + + LCOV - lcov.info - core/verify/verify.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - core/verify - verify.dartCoverageTotalHit
Test:lcov.infoLines:68.8 %1611
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:convert';
+       2              : 
+       3              : import 'package:walletconnect_flutter_v2/apis/core/i_core.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/i_http_client.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/core/verify/i_verify.dart';
+       6              : import 'package:walletconnect_flutter_v2/apis/core/verify/models/verify_context.dart';
+       7              : import 'package:walletconnect_flutter_v2/apis/utils/constants.dart';
+       8              : 
+       9              : class Verify implements IVerify {
+      10              :   final ICore _core;
+      11              :   final IHttpClient _httpClient;
+      12              :   late String _verifyUrl;
+      13              : 
+      14           10 :   Verify({
+      15              :     required ICore core,
+      16              :     required IHttpClient httpClient,
+      17              :   })  : _core = core,
+      18              :         _httpClient = httpClient;
+      19              : 
+      20            5 :   @override
+      21              :   Future<void> init({String? verifyUrl}) async {
+      22              :     // TODO custom verifyUrl is not yet allowed.
+      23              :     // Always using walletconnect urls for now
+      24           10 :     _verifyUrl = _setVerifyUrl(verifyUrl: verifyUrl);
+      25              :   }
+      26              : 
+      27            4 :   @override
+      28              :   Future<AttestationResponse?> resolve({required String attestationId}) async {
+      29              :     try {
+      30           12 :       final uri = Uri.parse('$_verifyUrl/attestation/$attestationId');
+      31           16 :       final response = await _httpClient.get(uri).timeout(Duration(seconds: 5));
+      32           16 :       if (response.statusCode == 404 || response.body.isEmpty) {
+      33            4 :         throw AttestationNotFound(
+      34              :           code: 404,
+      35              :           message: 'Attestion for this dapp could not be found',
+      36              :         );
+      37              :       }
+      38            0 :       if (response.statusCode != 200) {
+      39            0 :         throw Exception('Attestation response error: ${response.statusCode}');
+      40              :       }
+      41            0 :       return AttestationResponse.fromJson(jsonDecode(response.body));
+      42              :     } catch (e) {
+      43           20 :       _core.logger.d('[$runtimeType] resolve $e');
+      44              :       rethrow;
+      45              :     }
+      46              :   }
+      47              : 
+      48            5 :   String _setVerifyUrl({String? verifyUrl}) {
+      49              :     String url = verifyUrl ?? WalletConnectConstants.VERIFY_SERVER;
+      50              : 
+      51            5 :     if (!WalletConnectConstants.TRUSTED_VERIFY_URLS.contains(url)) {
+      52            0 :       _core.logger.i(
+      53            0 :         '[$runtimeType] verifyUrl $url not included in trusted list, '
+      54              :         'assigning default: ${WalletConnectConstants.VERIFY_SERVER}',
+      55              :       );
+      56              :       url = WalletConnectConstants.VERIFY_SERVER;
+      57              :     }
+      58              :     return url;
+      59              :   }
+      60              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/emerald.png b/coverage/html/emerald.png new file mode 100644 index 0000000000000000000000000000000000000000..38ad4f4068b935643d2486f323005fb294a9bd7e GIT binary patch literal 141 zcmeAS@N?(olHy`uVBq!ia0vp^j3CU&3?x-=hn)ga>?NMQuI!iC1^Jb!lvI6;R0X`wF(yt=9xVZRt1vCRixIA4P dLn>}1Cji+@42)0J?}79&c)I$ztaD0e0sy@GAL0N2 literal 0 HcmV?d00001 diff --git a/coverage/html/gcov.css b/coverage/html/gcov.css new file mode 100644 index 00000000..6c23ba93 --- /dev/null +++ b/coverage/html/gcov.css @@ -0,0 +1,1101 @@ +/* All views: initial background and text color */ +body +{ + color: #000000; + background-color: #ffffff; +} + +/* All views: standard link format*/ +a:link +{ + color: #284fa8; + text-decoration: underline; +} + +/* All views: standard link - visited format */ +a:visited +{ + color: #00cb40; + text-decoration: underline; +} + +/* All views: standard link - activated format */ +a:active +{ + color: #ff0040; + text-decoration: underline; +} + +/* All views: main title format */ +td.title +{ + text-align: center; + padding-bottom: 10px; + font-family: sans-serif; + font-size: 20pt; + font-style: italic; + font-weight: bold; +} +/* "Line coverage date bins" leader */ +td.subTableHeader +{ + text-align: center; + padding-bottom: 6px; + font-family: sans-serif; + font-weight: bold; + vertical-align: center; +} + +/* All views: header item format */ +td.headerItem +{ + text-align: right; + padding-right: 6px; + font-family: sans-serif; + font-weight: bold; + vertical-align: top; + white-space: nowrap; +} + +/* All views: header item value format */ +td.headerValue +{ + text-align: left; + color: #284fa8; + font-family: sans-serif; + font-weight: bold; + white-space: nowrap; +} + +/* All views: header item coverage table heading */ +td.headerCovTableHead +{ + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; +} + +/* All views: header item coverage table entry */ +td.headerCovTableEntry +{ + text-align: right; + color: #284fa8; + font-family: sans-serif; + font-weight: bold; + white-space: nowrap; + padding-left: 12px; + padding-right: 4px; + background-color: #dae7fe; +} + +/* All views: header item coverage table entry for high coverage rate */ +td.headerCovTableEntryHi +{ + text-align: right; + color: #000000; + font-family: sans-serif; + font-weight: bold; + white-space: nowrap; + padding-left: 12px; + padding-right: 4px; + background-color: #a7fc9d; +} + +/* All views: header item coverage table entry for medium coverage rate */ +td.headerCovTableEntryMed +{ + text-align: right; + color: #000000; + font-family: sans-serif; + font-weight: bold; + white-space: nowrap; + padding-left: 12px; + padding-right: 4px; + background-color: #ffea20; +} + +/* All views: header item coverage table entry for ow coverage rate */ +td.headerCovTableEntryLo +{ + text-align: right; + color: #000000; + font-family: sans-serif; + font-weight: bold; + white-space: nowrap; + padding-left: 12px; + padding-right: 4px; + background-color: #ff0000; +} + +/* All views: header legend value for legend entry */ +td.headerValueLeg +{ + text-align: left; + color: #000000; + font-family: sans-serif; + font-size: 80%; + white-space: nowrap; + padding-top: 4px; +} + +/* All views: color of horizontal ruler */ +td.ruler +{ + background-color: #6688d4; +} + +/* All views: version string format */ +td.versionInfo +{ + text-align: center; + padding-top: 2px; + font-family: sans-serif; + font-style: italic; +} + +/* Directory view/File view (all)/Test case descriptions: + table headline format */ +td.tableHead +{ + text-align: center; + color: #ffffff; + background-color: #6688d4; + font-family: sans-serif; + font-size: 120%; + font-weight: bold; + white-space: nowrap; + padding-left: 4px; + padding-right: 4px; +} + +span.tableHeadSort +{ + padding-right: 4px; +} + +/* Directory view/File view (all): filename entry format */ +td.coverFile +{ + text-align: left; + padding-left: 10px; + padding-right: 20px; + color: #284fa8; + background-color: #dae7fe; + font-family: monospace; +} + +/* Directory view/File view (all): directory name entry format */ +td.coverDirectory +{ + text-align: left; + padding-left: 10px; + padding-right: 20px; + color: #284fa8; + background-color: #b8d0ff; + font-family: monospace; +} + +/* Directory view/File view (all): filename entry format */ +td.overallOwner +{ + text-align: center; + font-weight: bold; + font-family: sans-serif; + background-color: #dae7fe; + padding-right: 10px; + padding-left: 10px; +} + +/* Directory view/File view (all): filename entry format */ +td.ownerName +{ + text-align: right; + font-style: italic; + font-family: sans-serif; + background-color: #E5DBDB; + padding-right: 10px; + padding-left: 20px; +} + +/* Directory view/File view (all): bar-graph entry format*/ +td.coverBar +{ + padding-left: 10px; + padding-right: 10px; + background-color: #dae7fe; +} + +/* Directory view/File view (all): bar-graph entry format*/ +td.owner_coverBar +{ + padding-left: 10px; + padding-right: 10px; + background-color: #E5DBDB; +} + +/* Directory view/File view (all): bar-graph outline color */ +td.coverBarOutline +{ + background-color: #000000; +} + +/* Directory view/File view (all): percentage entry for files with + high coverage rate */ +td.coverPerHi +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #a7fc9d; + font-weight: bold; + font-family: sans-serif; +} + +/* 'owner' entry: slightly lighter color than 'coverPerHi' */ +td.owner_coverPerHi +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #82E0AA; + font-weight: bold; + font-family: sans-serif; +} + +/* Directory view/File view (all): line count entry */ +td.coverNumDflt +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #dae7fe; + white-space: nowrap; + font-family: sans-serif; +} + +/* td background color and font for the 'owner' section of the table */ +td.ownerTla +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #E5DBDB; + white-space: nowrap; + font-family: sans-serif; + font-style: italic; +} + +/* Directory view/File view (all): line count entry for files with + high coverage rate */ +td.coverNumHi +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #a7fc9d; + white-space: nowrap; + font-family: sans-serif; +} + +td.owner_coverNumHi +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #82E0AA; + white-space: nowrap; + font-family: sans-serif; +} + +/* Directory view/File view (all): percentage entry for files with + medium coverage rate */ +td.coverPerMed +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #ffea20; + font-weight: bold; + font-family: sans-serif; +} + +td.owner_coverPerMed +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #F9E79F; + font-weight: bold; + font-family: sans-serif; +} + +/* Directory view/File view (all): line count entry for files with + medium coverage rate */ +td.coverNumMed +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #ffea20; + white-space: nowrap; + font-family: sans-serif; +} + +td.owner_coverNumMed +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #F9E79F; + white-space: nowrap; + font-family: sans-serif; +} + +/* Directory view/File view (all): percentage entry for files with + low coverage rate */ +td.coverPerLo +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #ff0000; + font-weight: bold; + font-family: sans-serif; +} + +td.owner_coverPerLo +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #EC7063; + font-weight: bold; + font-family: sans-serif; +} + +/* Directory view/File view (all): line count entry for files with + low coverage rate */ +td.coverNumLo +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #ff0000; + white-space: nowrap; + font-family: sans-serif; +} + +td.owner_coverNumLo +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #EC7063; + white-space: nowrap; + font-family: sans-serif; +} + +/* File view (all): "show/hide details" link format */ +a.detail:link +{ + color: #b8d0ff; + font-size:80%; +} + +/* File view (all): "show/hide details" link - visited format */ +a.detail:visited +{ + color: #b8d0ff; + font-size:80%; +} + +/* File view (all): "show/hide details" link - activated format */ +a.detail:active +{ + color: #ffffff; + font-size:80%; +} + +/* File view (detail): test name entry */ +td.testName +{ + text-align: right; + padding-right: 10px; + background-color: #dae7fe; + font-family: sans-serif; +} + +/* File view (detail): test percentage entry */ +td.testPer +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #dae7fe; + font-family: sans-serif; +} + +/* File view (detail): test lines count entry */ +td.testNum +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #dae7fe; + font-family: sans-serif; +} + +/* Test case descriptions: test name format*/ +dt +{ + font-family: sans-serif; + font-weight: bold; +} + +/* Test case descriptions: description table body */ +td.testDescription +{ + padding-top: 10px; + padding-left: 30px; + padding-bottom: 10px; + padding-right: 30px; + background-color: #dae7fe; +} + +/* Source code view: function entry */ +td.coverFn +{ + text-align: left; + padding-left: 10px; + padding-right: 20px; + color: #284fa8; + background-color: #dae7fe; + font-family: monospace; +} + +/* Source code view: function entry zero count*/ +td.coverFnLo +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #ff0000; + font-weight: bold; + font-family: sans-serif; +} + +/* Source code view: function entry nonzero count*/ +td.coverFnHi +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #dae7fe; + font-weight: bold; + font-family: sans-serif; +} + +td.coverFnAlias +{ + text-align: right; + padding-left: 10px; + padding-right: 20px; + color: #284fa8; + /* make this a slightly different color than the leader - otherwise, + otherwise the alias is hard to distinguish in the table */ + background-color: #E5DBDB; /* very light pale grey/blue */ + font-family: monospace; +} + +/* Source code view: function entry zero count*/ +td.coverFnAliasLo +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #EC7063; /* lighter red */ + font-family: sans-serif; +} + +/* Source code view: function entry nonzero count*/ +td.coverFnAliasHi +{ + text-align: right; + padding-left: 10px; + padding-right: 10px; + background-color: #dae7fe; + font-weight: bold; + font-family: sans-serif; +} + +/* Source code view: source code format */ +pre.source +{ + font-family: monospace; + white-space: pre; + margin-top: 2px; +} + +/* elided/removed code */ +span.elidedSource +{ + font-family: sans-serif; + /*font-size: 8pt; */ + font-style: italic; + background-color: lightgrey; +} + +/* Source code view: line number format */ +span.lineNum +{ + background-color: #efe383; +} + +/* Source code view: line number format when there are deleted + lines in the corresponding location */ +span.lineNumWithDelete +{ + foreground-color: #efe383; + background-color: lightgrey; +} + +/* Source code view: format for Cov legend */ +span.coverLegendCov +{ + padding-left: 10px; + padding-right: 10px; + padding-bottom: 2px; + background-color: #cad7fe; +} + +/* Source code view: format for NoCov legend */ +span.coverLegendNoCov +{ + padding-left: 10px; + padding-right: 10px; + padding-bottom: 2px; + background-color: #ff6230; +} + +/* Source code view: format for the source code heading line */ +pre.sourceHeading +{ + white-space: pre; + font-family: monospace; + font-weight: bold; + margin: 0px; +} + +/* All views: header legend value for low rate */ +td.headerValueLegL +{ + font-family: sans-serif; + text-align: center; + white-space: nowrap; + padding-left: 4px; + padding-right: 2px; + background-color: #ff0000; + font-size: 80%; +} + +/* All views: header legend value for med rate */ +td.headerValueLegM +{ + font-family: sans-serif; + text-align: center; + white-space: nowrap; + padding-left: 2px; + padding-right: 2px; + background-color: #ffea20; + font-size: 80%; +} + +/* All views: header legend value for hi rate */ +td.headerValueLegH +{ + font-family: sans-serif; + text-align: center; + white-space: nowrap; + padding-left: 2px; + padding-right: 4px; + background-color: #a7fc9d; + font-size: 80%; +} + +/* All views except source code view: legend format for low coverage */ +span.coverLegendCovLo +{ + padding-left: 10px; + padding-right: 10px; + padding-top: 2px; + background-color: #ff0000; +} + +/* All views except source code view: legend format for med coverage */ +span.coverLegendCovMed +{ + padding-left: 10px; + padding-right: 10px; + padding-top: 2px; + background-color: #ffea20; +} + +/* All views except source code view: legend format for hi coverage */ +span.coverLegendCovHi +{ + padding-left: 10px; + padding-right: 10px; + padding-top: 2px; + background-color: #a7fc9d; +} + +a.branchTla:link +{ + color: #000000; +} + +a.branchTla:visited +{ + color: #000000; +} + +/* Source code view/table entry background: format for lines classified as "Uncovered New Code (+ => 0): +Newly added code is not tested" */ +td.tlaUNC +{ + text-align: right; + background-color: #FF6230; +} +td.tlaBgUNC { + background-color: #FF6230; +} + +/* Source code view/table entry background: format for lines classified as "Uncovered New Code (+ => 0): +Newly added code is not tested" */ +span.tlaUNC +{ + text-align: left; + background-color: #FF6230; +} +span.tlaBgUNC { + background-color: #FF6230; +} +a.tlaBgUNC { + background-color: #FF6230; + color: #000000; +} + +td.headerCovTableHeadUNC { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #FF6230; +} + +/* Source code view/table entry background: format for lines classified as "Lost Baseline Coverage (1 => 0): +Unchanged code is no longer tested" */ +td.tlaLBC +{ + text-align: right; + background-color: #FF6230; +} +td.tlaBgLBC { + background-color: #FF6230; +} + +/* Source code view/table entry background: format for lines classified as "Lost Baseline Coverage (1 => 0): +Unchanged code is no longer tested" */ +span.tlaLBC +{ + text-align: left; + background-color: #FF6230; +} +span.tlaBgLBC { + background-color: #FF6230; +} +a.tlaBgLBC { + background-color: #FF6230; + color: #000000; +} + +td.headerCovTableHeadLBC { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #FF6230; +} + +/* Source code view/table entry background: format for lines classified as "Uncovered Included Code (# => 0): +Previously unused code is untested" */ +td.tlaUIC +{ + text-align: right; + background-color: #FF6230; +} +td.tlaBgUIC { + background-color: #FF6230; +} + +/* Source code view/table entry background: format for lines classified as "Uncovered Included Code (# => 0): +Previously unused code is untested" */ +span.tlaUIC +{ + text-align: left; + background-color: #FF6230; +} +span.tlaBgUIC { + background-color: #FF6230; +} +a.tlaBgUIC { + background-color: #FF6230; + color: #000000; +} + +td.headerCovTableHeadUIC { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #FF6230; +} + +/* Source code view/table entry background: format for lines classified as "Uncovered Baseline Code (0 => 0): +Unchanged code was untested before, is untested now" */ +td.tlaUBC +{ + text-align: right; + background-color: #FF6230; +} +td.tlaBgUBC { + background-color: #FF6230; +} + +/* Source code view/table entry background: format for lines classified as "Uncovered Baseline Code (0 => 0): +Unchanged code was untested before, is untested now" */ +span.tlaUBC +{ + text-align: left; + background-color: #FF6230; +} +span.tlaBgUBC { + background-color: #FF6230; +} +a.tlaBgUBC { + background-color: #FF6230; + color: #000000; +} + +td.headerCovTableHeadUBC { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #FF6230; +} + +/* Source code view/table entry background: format for lines classified as "Gained Baseline Coverage (0 => 1): +Unchanged code is tested now" */ +td.tlaGBC +{ + text-align: right; + background-color: #CAD7FE; +} +td.tlaBgGBC { + background-color: #CAD7FE; +} + +/* Source code view/table entry background: format for lines classified as "Gained Baseline Coverage (0 => 1): +Unchanged code is tested now" */ +span.tlaGBC +{ + text-align: left; + background-color: #CAD7FE; +} +span.tlaBgGBC { + background-color: #CAD7FE; +} +a.tlaBgGBC { + background-color: #CAD7FE; + color: #000000; +} + +td.headerCovTableHeadGBC { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #CAD7FE; +} + +/* Source code view/table entry background: format for lines classified as "Gained Included Coverage (# => 1): +Previously unused code is tested now" */ +td.tlaGIC +{ + text-align: right; + background-color: #CAD7FE; +} +td.tlaBgGIC { + background-color: #CAD7FE; +} + +/* Source code view/table entry background: format for lines classified as "Gained Included Coverage (# => 1): +Previously unused code is tested now" */ +span.tlaGIC +{ + text-align: left; + background-color: #CAD7FE; +} +span.tlaBgGIC { + background-color: #CAD7FE; +} +a.tlaBgGIC { + background-color: #CAD7FE; + color: #000000; +} + +td.headerCovTableHeadGIC { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #CAD7FE; +} + +/* Source code view/table entry background: format for lines classified as "Gained New Coverage (+ => 1): +Newly added code is tested" */ +td.tlaGNC +{ + text-align: right; + background-color: #CAD7FE; +} +td.tlaBgGNC { + background-color: #CAD7FE; +} + +/* Source code view/table entry background: format for lines classified as "Gained New Coverage (+ => 1): +Newly added code is tested" */ +span.tlaGNC +{ + text-align: left; + background-color: #CAD7FE; +} +span.tlaBgGNC { + background-color: #CAD7FE; +} +a.tlaBgGNC { + background-color: #CAD7FE; + color: #000000; +} + +td.headerCovTableHeadGNC { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #CAD7FE; +} + +/* Source code view/table entry background: format for lines classified as "Covered Baseline Code (1 => 1): +Unchanged code was tested before and is still tested" */ +td.tlaCBC +{ + text-align: right; + background-color: #CAD7FE; +} +td.tlaBgCBC { + background-color: #CAD7FE; +} + +/* Source code view/table entry background: format for lines classified as "Covered Baseline Code (1 => 1): +Unchanged code was tested before and is still tested" */ +span.tlaCBC +{ + text-align: left; + background-color: #CAD7FE; +} +span.tlaBgCBC { + background-color: #CAD7FE; +} +a.tlaBgCBC { + background-color: #CAD7FE; + color: #000000; +} + +td.headerCovTableHeadCBC { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #CAD7FE; +} + +/* Source code view/table entry background: format for lines classified as "Excluded Uncovered Baseline (0 => #): +Previously untested code is unused now" */ +td.tlaEUB +{ + text-align: right; + background-color: #FFFFFF; +} +td.tlaBgEUB { + background-color: #FFFFFF; +} + +/* Source code view/table entry background: format for lines classified as "Excluded Uncovered Baseline (0 => #): +Previously untested code is unused now" */ +span.tlaEUB +{ + text-align: left; + background-color: #FFFFFF; +} +span.tlaBgEUB { + background-color: #FFFFFF; +} +a.tlaBgEUB { + background-color: #FFFFFF; + color: #000000; +} + +td.headerCovTableHeadEUB { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #FFFFFF; +} + +/* Source code view/table entry background: format for lines classified as "Excluded Covered Baseline (1 => #): +Previously tested code is unused now" */ +td.tlaECB +{ + text-align: right; + background-color: #FFFFFF; +} +td.tlaBgECB { + background-color: #FFFFFF; +} + +/* Source code view/table entry background: format for lines classified as "Excluded Covered Baseline (1 => #): +Previously tested code is unused now" */ +span.tlaECB +{ + text-align: left; + background-color: #FFFFFF; +} +span.tlaBgECB { + background-color: #FFFFFF; +} +a.tlaBgECB { + background-color: #FFFFFF; + color: #000000; +} + +td.headerCovTableHeadECB { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #FFFFFF; +} + +/* Source code view/table entry background: format for lines classified as "Deleted Uncovered Baseline (0 => -): +Previously untested code has been deleted" */ +td.tlaDUB +{ + text-align: right; + background-color: #FFFFFF; +} +td.tlaBgDUB { + background-color: #FFFFFF; +} + +/* Source code view/table entry background: format for lines classified as "Deleted Uncovered Baseline (0 => -): +Previously untested code has been deleted" */ +span.tlaDUB +{ + text-align: left; + background-color: #FFFFFF; +} +span.tlaBgDUB { + background-color: #FFFFFF; +} +a.tlaBgDUB { + background-color: #FFFFFF; + color: #000000; +} + +td.headerCovTableHeadDUB { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #FFFFFF; +} + +/* Source code view/table entry background: format for lines classified as "Deleted Covered Baseline (1 => -): +Previously tested code has been deleted" */ +td.tlaDCB +{ + text-align: right; + background-color: #FFFFFF; +} +td.tlaBgDCB { + background-color: #FFFFFF; +} + +/* Source code view/table entry background: format for lines classified as "Deleted Covered Baseline (1 => -): +Previously tested code has been deleted" */ +span.tlaDCB +{ + text-align: left; + background-color: #FFFFFF; +} +span.tlaBgDCB { + background-color: #FFFFFF; +} +a.tlaBgDCB { + background-color: #FFFFFF; + color: #000000; +} + +td.headerCovTableHeadDCB { + text-align: center; + padding-right: 6px; + padding-left: 6px; + padding-bottom: 0px; + font-family: sans-serif; + white-space: nowrap; + background-color: #FFFFFF; +} + +/* Source code view: format for date/owner bin that is not hit */ +span.missBins +{ + background-color: #ff0000 /* red */ +} diff --git a/coverage/html/glass.png b/coverage/html/glass.png new file mode 100644 index 0000000000000000000000000000000000000000..e1abc00680a3093c49fdb775ae6bdb6764c95af2 GIT binary patch literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^j3CU&3?x-=hn)gaEa{HEjtmSN`?>!lvI6;R0X`wF z|Ns97GD8ntt^-nxB|(0{3=Yq3q=7g|-tI089jvk*Kn`btM`SSr1Gf+eGhVt|_XjA* zUgGKN%6^Gmn4d%Ph(nkFP>9RZ#WAE}PI3Z}&BVayv3^M*kj3EX>gTe~DWM4f=_Dpv literal 0 HcmV?d00001 diff --git a/coverage/html/index-sort-f.html b/coverage/html/index-sort-f.html new file mode 100644 index 00000000..7312040d --- /dev/null +++ b/coverage/html/index-sort-f.html @@ -0,0 +1,393 @@ + + + + + + + LCOV - lcov.info + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top levelCoverageTotalHit
Test:lcov.infoLines:61.2 %42152579
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Directory Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
auth_api/ +
75.5%75.5%
+
75.5 %192145-
core/ +
74.5%74.5%
+
74.5 %5138-
core/crypto/ +
90.6%90.6%
+
90.6 %180163-
core/echo/ +
93.3%93.3%
+
93.3 %3028-
core/echo/models/ +
66.7%66.7%
+
66.7 %1510-
core/heartbit/ +
66.7%66.7%
+
66.7 %96-
core/pairing/ +
89.1%89.1%
+
89.1 %303270-
core/pairing/utils/ +
54.7%54.7%
+
54.7 %5329-
core/relay_auth/ +
86.5%86.5%
+
86.5 %11196-
core/relay_client/ +
85.6%85.6%
+
85.6 %201172-
core/relay_client/json_rpc_2/ +
0.0%
+
0.0 %6-
core/relay_client/json_rpc_2/src/ +
40.8%40.8%
+
40.8 %360147-
core/relay_client/websocket/ +
60.0%60.0%
+
60.0 %4024-
core/store/ +
75.2%75.2%
+
75.2 %12594-
core/verify/ +
68.8%68.8%
+
68.8 %1611-
core/verify/models/ +
11.1%11.1%
+
11.1 %91-
models/ +
65.2%65.2%
+
65.2 %2315-
sign_api/ +
52.9%52.9%
+
52.9 %1211641-
sign_api/models/ +
45.5%45.5%
+
45.5 %9945-
sign_api/models/auth/ +
45.6%45.6%
+
45.6 %16977-
sign_api/utils/ +
80.7%80.7%
+
80.7 %11996-
sign_api/utils/auth/ +
21.9%21.9%
+
21.9 %32070-
utils/ +
71.2%71.2%
+
71.2 %319227-
web3app/ +
64.7%64.7%
+
64.7 %11675-
web3wallet/ +
71.7%71.7%
+
71.7 %13899-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/index-sort-l.html b/coverage/html/index-sort-l.html new file mode 100644 index 00000000..5af4387e --- /dev/null +++ b/coverage/html/index-sort-l.html @@ -0,0 +1,307 @@ + + + + + + + LCOV - lcov.info + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top levelCoverageTotalHit
Test:lcov.infoLines:61.2 %42152579
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Directory Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
core/relay_client/json_rpc_2/ +
0.0%
+
0.0 %6
core/verify/models/ +
11.1%11.1%
+
11.1 %91
sign_api/utils/auth/ +
21.9%21.9%
+
21.9 %32070
core/relay_client/json_rpc_2/src/ +
40.8%40.8%
+
40.8 %360147
sign_api/models/ +
45.5%45.5%
+
45.5 %9945
sign_api/models/auth/ +
45.6%45.6%
+
45.6 %16977
sign_api/ +
52.9%52.9%
+
52.9 %1211641
core/pairing/utils/ +
54.7%54.7%
+
54.7 %5329
core/relay_client/websocket/ +
60.0%60.0%
+
60.0 %4024
web3app/ +
64.7%64.7%
+
64.7 %11675
models/ +
65.2%65.2%
+
65.2 %2315
core/heartbit/ +
66.7%66.7%
+
66.7 %96
core/echo/models/ +
66.7%66.7%
+
66.7 %1510
core/verify/ +
68.8%68.8%
+
68.8 %1611
utils/ +
71.2%71.2%
+
71.2 %319227
web3wallet/ +
71.7%71.7%
+
71.7 %13899
core/ +
74.5%74.5%
+
74.5 %5138
core/store/ +
75.2%75.2%
+
75.2 %12594
auth_api/ +
75.5%75.5%
+
75.5 %192145
sign_api/utils/ +
80.7%80.7%
+
80.7 %11996
core/relay_client/ +
85.6%85.6%
+
85.6 %201172
core/relay_auth/ +
86.5%86.5%
+
86.5 %11196
core/pairing/ +
89.1%89.1%
+
89.1 %303270
core/crypto/ +
90.6%90.6%
+
90.6 %180163
core/echo/ +
93.3%93.3%
+
93.3 %3028
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/index.html b/coverage/html/index.html new file mode 100644 index 00000000..cec02a5b --- /dev/null +++ b/coverage/html/index.html @@ -0,0 +1,307 @@ + + + + + + + LCOV - lcov.info + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top levelCoverageTotalHit
Test:lcov.infoLines:61.2 %42152579
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Directory Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
auth_api/ +
75.5%75.5%
+
75.5 %192145
core/ +
74.5%74.5%
+
74.5 %5138
core/crypto/ +
90.6%90.6%
+
90.6 %180163
core/echo/ +
93.3%93.3%
+
93.3 %3028
core/echo/models/ +
66.7%66.7%
+
66.7 %1510
core/heartbit/ +
66.7%66.7%
+
66.7 %96
core/pairing/ +
89.1%89.1%
+
89.1 %303270
core/pairing/utils/ +
54.7%54.7%
+
54.7 %5329
core/relay_auth/ +
86.5%86.5%
+
86.5 %11196
core/relay_client/ +
85.6%85.6%
+
85.6 %201172
core/relay_client/json_rpc_2/ +
0.0%
+
0.0 %6
core/relay_client/json_rpc_2/src/ +
40.8%40.8%
+
40.8 %360147
core/relay_client/websocket/ +
60.0%60.0%
+
60.0 %4024
core/store/ +
75.2%75.2%
+
75.2 %12594
core/verify/ +
68.8%68.8%
+
68.8 %1611
core/verify/models/ +
11.1%11.1%
+
11.1 %91
models/ +
65.2%65.2%
+
65.2 %2315
sign_api/ +
52.9%52.9%
+
52.9 %1211641
sign_api/models/ +
45.5%45.5%
+
45.5 %9945
sign_api/models/auth/ +
45.6%45.6%
+
45.6 %16977
sign_api/utils/ +
80.7%80.7%
+
80.7 %11996
sign_api/utils/auth/ +
21.9%21.9%
+
21.9 %32070
utils/ +
71.2%71.2%
+
71.2 %319227
web3app/ +
64.7%64.7%
+
64.7 %11675
web3wallet/ +
71.7%71.7%
+
71.7 %13899
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/models/basic_models.dart.func-c.html b/coverage/html/models/basic_models.dart.func-c.html new file mode 100644 index 00000000..586c9e2c --- /dev/null +++ b/coverage/html/models/basic_models.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - models/basic_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - models - basic_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:50.0 %42
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/models/basic_models.dart.func.html b/coverage/html/models/basic_models.dart.func.html new file mode 100644 index 00000000..bfc2014b --- /dev/null +++ b/coverage/html/models/basic_models.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - models/basic_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - models - basic_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:50.0 %42
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/models/basic_models.dart.gcov.html b/coverage/html/models/basic_models.dart.gcov.html new file mode 100644 index 00000000..719519e0 --- /dev/null +++ b/coverage/html/models/basic_models.dart.gcov.html @@ -0,0 +1,116 @@ + + + + + + + LCOV - lcov.info - models/basic_models.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - models - basic_models.dartCoverageTotalHit
Test:lcov.infoLines:50.0 %42
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:freezed_annotation/freezed_annotation.dart';
+       2              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/pairing_models.dart';
+       3              : 
+       4              : part 'basic_models.g.dart';
+       5              : part 'basic_models.freezed.dart';
+       6              : 
+       7              : /// ERRORS
+       8              : 
+       9              : class WalletConnectErrorSilent {}
+      10              : 
+      11              : @freezed
+      12              : class WalletConnectError with _$WalletConnectError {
+      13              :   // @JsonSerializable(includeIfNull: false)
+      14              :   const factory WalletConnectError({
+      15              :     required int code,
+      16              :     required String message,
+      17              :     String? data,
+      18              :   }) = _WalletConnectError;
+      19              : 
+      20            0 :   factory WalletConnectError.fromJson(Map<String, dynamic> json) =>
+      21            0 :       _$WalletConnectErrorFromJson(json);
+      22              : }
+      23              : 
+      24              : @freezed
+      25              : class RpcOptions with _$RpcOptions {
+      26              :   // @JsonSerializable()
+      27              :   const factory RpcOptions({
+      28              :     required int ttl,
+      29              :     required bool prompt,
+      30              :     required int tag,
+      31              :   }) = _RpcOptions;
+      32              : }
+      33              : 
+      34              : @freezed
+      35              : class ConnectionMetadata with _$ConnectionMetadata {
+      36              :   // @JsonSerializable()
+      37              :   const factory ConnectionMetadata({
+      38              :     required String publicKey,
+      39              :     required PairingMetadata metadata,
+      40              :   }) = _ConnectionMetadata;
+      41              : 
+      42            5 :   factory ConnectionMetadata.fromJson(Map<String, dynamic> json) =>
+      43            5 :       _$ConnectionMetadataFromJson(json);
+      44              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/models/index-sort-f.html b/coverage/html/models/index-sort-f.html new file mode 100644 index 00000000..946daf35 --- /dev/null +++ b/coverage/html/models/index-sort-f.html @@ -0,0 +1,153 @@ + + + + + + + LCOV - lcov.info - models + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - modelsCoverageTotalHit
Test:lcov.infoLines:65.2 %2315
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
basic_models.dart +
50.0%50.0%
+
50.0 %42-
json_rpc_error.dart +
50.0%50.0%
+
50.0 %126-
json_rpc_request.dart +
100.0%
+
100.0 %22-
json_rpc_response.dart +
100.0%
+
100.0 %22-
uri_parse_result.dart +
100.0%
+
100.0 %33-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/models/index-sort-l.html b/coverage/html/models/index-sort-l.html new file mode 100644 index 00000000..58982d45 --- /dev/null +++ b/coverage/html/models/index-sort-l.html @@ -0,0 +1,127 @@ + + + + + + + LCOV - lcov.info - models + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - modelsCoverageTotalHit
Test:lcov.infoLines:65.2 %2315
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
basic_models.dart +
50.0%50.0%
+
50.0 %42
json_rpc_error.dart +
50.0%50.0%
+
50.0 %126
json_rpc_request.dart +
100.0%
+
100.0 %22
json_rpc_response.dart +
100.0%
+
100.0 %22
uri_parse_result.dart +
100.0%
+
100.0 %33
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/models/index.html b/coverage/html/models/index.html new file mode 100644 index 00000000..f9cd7bb6 --- /dev/null +++ b/coverage/html/models/index.html @@ -0,0 +1,127 @@ + + + + + + + LCOV - lcov.info - models + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - modelsCoverageTotalHit
Test:lcov.infoLines:65.2 %2315
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
basic_models.dart +
50.0%50.0%
+
50.0 %42
json_rpc_error.dart +
50.0%50.0%
+
50.0 %126
json_rpc_request.dart +
100.0%
+
100.0 %22
json_rpc_response.dart +
100.0%
+
100.0 %22
uri_parse_result.dart +
100.0%
+
100.0 %33
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/models/json_rpc_error.dart.func-c.html b/coverage/html/models/json_rpc_error.dart.func-c.html new file mode 100644 index 00000000..be8dcd4b --- /dev/null +++ b/coverage/html/models/json_rpc_error.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - models/json_rpc_error.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - models - json_rpc_error.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:50.0 %126
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/models/json_rpc_error.dart.func.html b/coverage/html/models/json_rpc_error.dart.func.html new file mode 100644 index 00000000..0b444a4e --- /dev/null +++ b/coverage/html/models/json_rpc_error.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - models/json_rpc_error.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - models - json_rpc_error.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:50.0 %126
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/models/json_rpc_error.dart.gcov.html b/coverage/html/models/json_rpc_error.dart.gcov.html new file mode 100644 index 00000000..64d6c799 --- /dev/null +++ b/coverage/html/models/json_rpc_error.dart.gcov.html @@ -0,0 +1,99 @@ + + + + + + + LCOV - lcov.info - models/json_rpc_error.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - models - json_rpc_error.dartCoverageTotalHit
Test:lcov.infoLines:50.0 %126
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:freezed_annotation/freezed_annotation.dart';
+       2              : 
+       3              : part 'json_rpc_error.g.dart';
+       4              : part 'json_rpc_error.freezed.dart';
+       5              : 
+       6              : @freezed
+       7              : class JsonRpcError with _$JsonRpcError {
+       8              :   @JsonSerializable(includeIfNull: false)
+       9              :   const factory JsonRpcError({
+      10              :     int? code,
+      11              :     String? message,
+      12              :   }) = _JsonRpcError;
+      13              : 
+      14            0 :   factory JsonRpcError.serverError(String message) =>
+      15            0 :       JsonRpcError(code: -32000, message: message);
+      16            3 :   factory JsonRpcError.invalidParams(String message) =>
+      17            6 :       JsonRpcError(code: -32602, message: message);
+      18            0 :   factory JsonRpcError.invalidRequest(String message) =>
+      19            0 :       JsonRpcError(code: -32600, message: message);
+      20            0 :   factory JsonRpcError.parseError(String message) =>
+      21            0 :       JsonRpcError(code: -32700, message: message);
+      22            3 :   factory JsonRpcError.methodNotFound(String message) =>
+      23            6 :       JsonRpcError(code: -32601, message: message);
+      24              : 
+      25            3 :   factory JsonRpcError.fromJson(Map<String, dynamic> json) =>
+      26            3 :       _$JsonRpcErrorFromJson(json);
+      27              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/models/json_rpc_request.dart.func-c.html b/coverage/html/models/json_rpc_request.dart.func-c.html new file mode 100644 index 00000000..126b9c9c --- /dev/null +++ b/coverage/html/models/json_rpc_request.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - models/json_rpc_request.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - models - json_rpc_request.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %22
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/models/json_rpc_request.dart.func.html b/coverage/html/models/json_rpc_request.dart.func.html new file mode 100644 index 00000000..d44befa1 --- /dev/null +++ b/coverage/html/models/json_rpc_request.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - models/json_rpc_request.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - models - json_rpc_request.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %22
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/models/json_rpc_request.dart.gcov.html b/coverage/html/models/json_rpc_request.dart.gcov.html new file mode 100644 index 00000000..f2083d8c --- /dev/null +++ b/coverage/html/models/json_rpc_request.dart.gcov.html @@ -0,0 +1,90 @@ + + + + + + + LCOV - lcov.info - models/json_rpc_request.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - models - json_rpc_request.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %22
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:freezed_annotation/freezed_annotation.dart';
+       2              : 
+       3              : part 'json_rpc_request.g.dart';
+       4              : part 'json_rpc_request.freezed.dart';
+       5              : 
+       6              : @freezed
+       7              : class JsonRpcRequest with _$JsonRpcRequest {
+       8              :   @JsonSerializable()
+       9              :   const factory JsonRpcRequest({
+      10              :     required int id,
+      11              :     @Default('2.0') String jsonrpc,
+      12              :     required String method,
+      13              :     dynamic params,
+      14              :   }) = _JsonRpcRequest;
+      15              : 
+      16            6 :   factory JsonRpcRequest.fromJson(Map<String, dynamic> json) =>
+      17            6 :       _$JsonRpcRequestFromJson(json);
+      18              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/models/json_rpc_response.dart.func-c.html b/coverage/html/models/json_rpc_response.dart.func-c.html new file mode 100644 index 00000000..076881dd --- /dev/null +++ b/coverage/html/models/json_rpc_response.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - models/json_rpc_response.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - models - json_rpc_response.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %22
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/models/json_rpc_response.dart.func.html b/coverage/html/models/json_rpc_response.dart.func.html new file mode 100644 index 00000000..d79d2f86 --- /dev/null +++ b/coverage/html/models/json_rpc_response.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - models/json_rpc_response.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - models - json_rpc_response.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %22
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/models/json_rpc_response.dart.gcov.html b/coverage/html/models/json_rpc_response.dart.gcov.html new file mode 100644 index 00000000..20e2c5f8 --- /dev/null +++ b/coverage/html/models/json_rpc_response.dart.gcov.html @@ -0,0 +1,91 @@ + + + + + + + LCOV - lcov.info - models/json_rpc_response.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - models - json_rpc_response.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %22
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:freezed_annotation/freezed_annotation.dart';
+       2              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_error.dart';
+       3              : 
+       4              : part 'json_rpc_response.g.dart';
+       5              : part 'json_rpc_response.freezed.dart';
+       6              : 
+       7              : @Freezed(genericArgumentFactories: true)
+       8              : class JsonRpcResponse<T> with _$JsonRpcResponse<T> {
+       9              :   // @JsonSerializable(genericArgumentFactories: true)
+      10              :   const factory JsonRpcResponse({
+      11              :     required int id,
+      12              :     @Default('2.0') String jsonrpc,
+      13              :     JsonRpcError? error,
+      14              :     T? result,
+      15              :   }) = _JsonRpcResponse<T>;
+      16              : 
+      17            6 :   factory JsonRpcResponse.fromJson(Map<String, dynamic> json) =>
+      18           12 :       _$JsonRpcResponseFromJson(json, (object) => object as T);
+      19              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/models/uri_parse_result.dart.func-c.html b/coverage/html/models/uri_parse_result.dart.func-c.html new file mode 100644 index 00000000..049e515b --- /dev/null +++ b/coverage/html/models/uri_parse_result.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - models/uri_parse_result.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - models - uri_parse_result.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %33
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/models/uri_parse_result.dart.func.html b/coverage/html/models/uri_parse_result.dart.func.html new file mode 100644 index 00000000..c6c5bee7 --- /dev/null +++ b/coverage/html/models/uri_parse_result.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - models/uri_parse_result.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - models - uri_parse_result.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %33
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/models/uri_parse_result.dart.gcov.html b/coverage/html/models/uri_parse_result.dart.gcov.html new file mode 100644 index 00000000..dfbad25d --- /dev/null +++ b/coverage/html/models/uri_parse_result.dart.gcov.html @@ -0,0 +1,116 @@ + + + + + + + LCOV - lcov.info - models/uri_parse_result.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - models - uri_parse_result.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %33
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client_models.dart';
+       2              : 
+       3              : enum URIVersion {
+       4              :   v1,
+       5              :   v2,
+       6              : }
+       7              : 
+       8              : class URIParseResult {
+       9              :   final String protocol;
+      10              :   final String topic;
+      11              :   final URIVersion? version;
+      12              :   final URIV1ParsedData? v1Data;
+      13              :   final URIV2ParsedData? v2Data;
+      14              : 
+      15            8 :   URIParseResult({
+      16              :     required this.protocol,
+      17              :     required this.version,
+      18              :     required this.topic,
+      19              :     this.v1Data,
+      20              :     this.v2Data,
+      21              :   });
+      22              : }
+      23              : 
+      24              : class URIV1ParsedData {
+      25              :   final String key;
+      26              :   final String bridge;
+      27              : 
+      28            5 :   URIV1ParsedData({
+      29              :     required this.key,
+      30              :     required this.bridge,
+      31              :   });
+      32              : }
+      33              : 
+      34              : class URIV2ParsedData {
+      35              :   final String symKey;
+      36              :   final Relay relay;
+      37              :   final List<String> methods;
+      38              : 
+      39            8 :   URIV2ParsedData({
+      40              :     required this.symKey,
+      41              :     required this.relay,
+      42              :     required this.methods,
+      43              :   });
+      44              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/ruby.png b/coverage/html/ruby.png new file mode 100644 index 0000000000000000000000000000000000000000..991b6d4ec9e78be165e3ef757eed1aada287364d GIT binary patch literal 141 zcmeAS@N?(olHy`uVBq!ia0vp^j3CU&3?x-=hn)ga>?NMQuI!iC1^FceV#7`HfI^%F z9+AZi4BSE>%y{W;-5;PJOS+@4BLl<6e(pbstUx|nfKQ0)e^Y%R^MdiLxj>4`)5S5Q b;#P73kj=!v_*DHKNFRfztDnm{r-UW|iOwIS literal 0 HcmV?d00001 diff --git a/coverage/html/sign_api/index-sort-f.html b/coverage/html/sign_api/index-sort-f.html new file mode 100644 index 00000000..12426721 --- /dev/null +++ b/coverage/html/sign_api/index-sort-f.html @@ -0,0 +1,129 @@ + + + + + + + LCOV - lcov.info - sign_api + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_apiCoverageTotalHit
Test:lcov.infoLines:52.9 %1211641
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
sessions.dart +
100.0%
+
100.0 %77-
sign_client.dart +
57.6%57.6%
+
57.6 %15891-
sign_engine.dart +
51.9%51.9%
+
51.9 %1046543-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/index-sort-l.html b/coverage/html/sign_api/index-sort-l.html new file mode 100644 index 00000000..19b67aeb --- /dev/null +++ b/coverage/html/sign_api/index-sort-l.html @@ -0,0 +1,109 @@ + + + + + + + LCOV - lcov.info - sign_api + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_apiCoverageTotalHit
Test:lcov.infoLines:52.9 %1211641
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
sign_engine.dart +
51.9%51.9%
+
51.9 %1046543
sign_client.dart +
57.6%57.6%
+
57.6 %15891
sessions.dart +
100.0%
+
100.0 %77
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/index.html b/coverage/html/sign_api/index.html new file mode 100644 index 00000000..bad13f86 --- /dev/null +++ b/coverage/html/sign_api/index.html @@ -0,0 +1,109 @@ + + + + + + + LCOV - lcov.info - sign_api + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_apiCoverageTotalHit
Test:lcov.infoLines:52.9 %1211641
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
sessions.dart +
100.0%
+
100.0 %77
sign_client.dart +
57.6%57.6%
+
57.6 %15891
sign_engine.dart +
51.9%51.9%
+
51.9 %1046543
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/auth/auth_client_events.dart.func-c.html b/coverage/html/sign_api/models/auth/auth_client_events.dart.func-c.html new file mode 100644 index 00000000..df39df89 --- /dev/null +++ b/coverage/html/sign_api/models/auth/auth_client_events.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/models/auth/auth_client_events.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models/auth - auth_client_events.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:16.7 %122
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/auth/auth_client_events.dart.func.html b/coverage/html/sign_api/models/auth/auth_client_events.dart.func.html new file mode 100644 index 00000000..bc6a2b92 --- /dev/null +++ b/coverage/html/sign_api/models/auth/auth_client_events.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/models/auth/auth_client_events.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models/auth - auth_client_events.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:16.7 %122
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/auth/auth_client_events.dart.gcov.html b/coverage/html/sign_api/models/auth/auth_client_events.dart.gcov.html new file mode 100644 index 00000000..221634af --- /dev/null +++ b/coverage/html/sign_api/models/auth/auth_client_events.dart.gcov.html @@ -0,0 +1,127 @@ + + + + + + + LCOV - lcov.info - sign_api/models/auth/auth_client_events.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models/auth - auth_client_events.dartCoverageTotalHit
Test:lcov.infoLines:16.7 %122
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:convert';
+       2              : 
+       3              : import 'package:event/event.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_error.dart';
+       6              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/auth_client_models.dart';
+       7              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/common_auth_models.dart';
+       8              : 
+       9              : class AuthRequest extends EventArgs {
+      10              :   final int id;
+      11              :   final String topic;
+      12              :   final AuthPayloadParams payloadParams;
+      13              :   final ConnectionMetadata requester;
+      14              : 
+      15            2 :   AuthRequest({
+      16              :     required this.id,
+      17              :     required this.topic,
+      18              :     required this.payloadParams,
+      19              :     required this.requester,
+      20              :   });
+      21              : 
+      22            0 :   @override
+      23              :   String toString() {
+      24            0 :     return 'AuthRequest(id: $id, topic: $topic, payloadParams: $payloadParams, requester: $requester)';
+      25              :   }
+      26              : }
+      27              : 
+      28              : class AuthResponse extends EventArgs {
+      29              :   final int id;
+      30              :   final String topic;
+      31              :   final Cacao? result;
+      32              :   final WalletConnectError? error;
+      33              :   final JsonRpcError? jsonRpcError;
+      34              : 
+      35            2 :   AuthResponse({
+      36              :     required this.id,
+      37              :     required this.topic,
+      38              :     this.result,
+      39              :     this.error,
+      40              :     this.jsonRpcError,
+      41              :   });
+      42              : 
+      43            0 :   Map<String, dynamic> toJson() => {
+      44            0 :         'id': id,
+      45            0 :         'topic': topic,
+      46            0 :         if (result != null) 'result': result?.toJson(),
+      47            0 :         if (error != null) 'error': error!.toJson(),
+      48            0 :         if (jsonRpcError != null) 'jsonRpcError': jsonRpcError!.toJson(),
+      49              :       };
+      50              : 
+      51            0 :   @override
+      52              :   String toString() {
+      53            0 :     return 'AuthResponse(${jsonEncode(toJson())})';
+      54              :   }
+      55              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/auth/auth_client_models.dart.func-c.html b/coverage/html/sign_api/models/auth/auth_client_models.dart.func-c.html new file mode 100644 index 00000000..1ceaec25 --- /dev/null +++ b/coverage/html/sign_api/models/auth/auth_client_models.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/models/auth/auth_client_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models/auth - auth_client_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:62.8 %4327
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/auth/auth_client_models.dart.func.html b/coverage/html/sign_api/models/auth/auth_client_models.dart.func.html new file mode 100644 index 00000000..501942af --- /dev/null +++ b/coverage/html/sign_api/models/auth/auth_client_models.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/models/auth/auth_client_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models/auth - auth_client_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:62.8 %4327
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/auth/auth_client_models.dart.gcov.html b/coverage/html/sign_api/models/auth/auth_client_models.dart.gcov.html new file mode 100644 index 00000000..ee8f1990 --- /dev/null +++ b/coverage/html/sign_api/models/auth/auth_client_models.dart.gcov.html @@ -0,0 +1,238 @@ + + + + + + + LCOV - lcov.info - sign_api/models/auth/auth_client_models.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models/auth - auth_client_models.dartCoverageTotalHit
Test:lcov.infoLines:62.8 %4327
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:async';
+       2              : 
+       3              : import 'package:freezed_annotation/freezed_annotation.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/auth_client_events.dart';
+       6              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/common_auth_models.dart';
+       7              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/auth/auth_utils.dart';
+       8              : 
+       9              : part 'auth_client_models.g.dart';
+      10              : part 'auth_client_models.freezed.dart';
+      11              : 
+      12              : class AuthRequestResponse {
+      13              :   final int id;
+      14              :   final String pairingTopic;
+      15              :   final Completer<AuthResponse> completer;
+      16              :   final Uri? uri;
+      17              : 
+      18            2 :   AuthRequestResponse({
+      19              :     required this.id,
+      20              :     required this.pairingTopic,
+      21              :     required this.completer,
+      22              :     this.uri,
+      23              :   });
+      24              : }
+      25              : 
+      26              : class AuthRequestParams {
+      27              :   /// The Chain ID.
+      28              :   /// Examples: eip155:1 (Eth Mainnet), eip155:43114 (Avalanche)
+      29              :   final String chainId;
+      30              : 
+      31              :   /// The complete URL you are logging into.
+      32              :   /// Example: https://example.com/login
+      33              :   final String aud;
+      34              : 
+      35              :   /// The domain you are logging in to.
+      36              :   /// Example: example.com
+      37              :   final String domain;
+      38              :   final String nonce;
+      39              :   final String? type;
+      40              :   final String? nbf;
+      41              :   final String? exp;
+      42              :   final String? statement;
+      43              :   final String? requestId;
+      44              :   final List<String>? resources;
+      45              :   final int? expiry;
+      46              : 
+      47            3 :   AuthRequestParams({
+      48              :     required this.chainId,
+      49              :     required this.domain,
+      50              :     required this.aud,
+      51              :     String? nonce,
+      52              :     this.type = CacaoHeader.EIP4361,
+      53              :     this.nbf,
+      54              :     this.exp,
+      55              :     this.statement,
+      56              :     this.requestId,
+      57              :     this.resources,
+      58              :     this.expiry,
+      59            3 :   }) : nonce = nonce ?? AuthUtils.generateNonce();
+      60              : 
+      61            0 :   Map<String, dynamic> toJson() => {
+      62            0 :         'chainId': chainId,
+      63            0 :         'aud': aud,
+      64            0 :         'domain': domain,
+      65            0 :         'nonce': nonce,
+      66            0 :         if (type != null) 'type': type,
+      67            0 :         if (nbf != null) 'nbf': nbf,
+      68            0 :         if (exp != null) 'exp': exp,
+      69            0 :         if (statement != null) 'statement': statement,
+      70            0 :         if (requestId != null) 'requestId': requestId,
+      71            0 :         if (resources != null) 'resources': resources,
+      72            0 :         if (expiry != null) 'expiry': expiry,
+      73              :       };
+      74              : }
+      75              : 
+      76              : @freezed
+      77              : class AuthPayloadParams with _$AuthPayloadParams {
+      78              :   @JsonSerializable(includeIfNull: false)
+      79              :   const factory AuthPayloadParams({
+      80              :     required String chainId,
+      81              :     required String aud,
+      82              :     required String domain,
+      83              :     required String nonce,
+      84              :     required String type,
+      85              :     //
+      86              :     required String version,
+      87              :     required String iat,
+      88              :     //
+      89              :     String? nbf,
+      90              :     String? exp,
+      91              :     String? statement,
+      92              :     String? requestId,
+      93              :     List<String>? resources,
+      94              :   }) = _AuthPayloadParams;
+      95              : 
+      96            2 :   factory AuthPayloadParams.fromRequestParams(AuthRequestParams params) {
+      97            2 :     final now = DateTime.now();
+      98            2 :     return AuthPayloadParams(
+      99            2 :       type: params.type ?? CacaoHeader.EIP4361,
+     100            2 :       chainId: params.chainId,
+     101            2 :       domain: params.domain,
+     102            2 :       aud: params.aud,
+     103              :       version: '1',
+     104            2 :       nonce: params.nonce,
+     105            2 :       iat: DateTime.utc(
+     106            2 :         now.year,
+     107            2 :         now.month,
+     108            2 :         now.day,
+     109            2 :         now.hour,
+     110            2 :         now.minute,
+     111            2 :         now.second,
+     112            2 :         now.millisecond,
+     113            2 :       ).toIso8601String(),
+     114            2 :       nbf: params.nbf,
+     115            2 :       exp: params.exp,
+     116            2 :       statement: params.statement,
+     117            2 :       requestId: params.requestId,
+     118            2 :       resources: params.resources,
+     119              :     );
+     120              :   }
+     121              : 
+     122            2 :   factory AuthPayloadParams.fromJson(Map<String, dynamic> json) =>
+     123            2 :       _$AuthPayloadParamsFromJson(json);
+     124              : }
+     125              : 
+     126              : @freezed
+     127              : class PendingAuthRequest with _$PendingAuthRequest {
+     128              :   @JsonSerializable(includeIfNull: false)
+     129              :   const factory PendingAuthRequest({
+     130              :     required int id,
+     131              :     required String pairingTopic,
+     132              :     required ConnectionMetadata metadata,
+     133              :     required CacaoRequestPayload cacaoPayload,
+     134              :   }) = _PendingAuthRequest;
+     135              : 
+     136            0 :   factory PendingAuthRequest.fromJson(Map<String, dynamic> json) =>
+     137            0 :       _$PendingAuthRequestFromJson(json);
+     138              : }
+     139              : 
+     140              : class AuthRequestCompleter {
+     141              :   final int id;
+     142              :   final String pairingTopic;
+     143              :   final String responseTopic;
+     144              :   final PendingAuthRequest request;
+     145              :   final Completer<Cacao> completer;
+     146              : 
+     147            0 :   AuthRequestCompleter({
+     148              :     required this.id,
+     149              :     required this.pairingTopic,
+     150              :     required this.responseTopic,
+     151              :     required this.request,
+     152              :     required this.completer,
+     153              :   });
+     154              : }
+     155              : 
+     156              : class RespondParams {
+     157              :   final int id;
+     158              :   final CacaoSignature? signature;
+     159              :   final WalletConnectError? error;
+     160              : 
+     161            0 :   RespondParams({
+     162              :     required this.id,
+     163              :     this.signature,
+     164              :     this.error,
+     165              :   });
+     166              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/auth/common_auth_models.dart.func-c.html b/coverage/html/sign_api/models/auth/common_auth_models.dart.func-c.html new file mode 100644 index 00000000..1b4ebc61 --- /dev/null +++ b/coverage/html/sign_api/models/auth/common_auth_models.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/models/auth/common_auth_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models/auth - common_auth_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:72.7 %6648
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/auth/common_auth_models.dart.func.html b/coverage/html/sign_api/models/auth/common_auth_models.dart.func.html new file mode 100644 index 00000000..3999380c --- /dev/null +++ b/coverage/html/sign_api/models/auth/common_auth_models.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/models/auth/common_auth_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models/auth - common_auth_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:72.7 %6648
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/auth/common_auth_models.dart.gcov.html b/coverage/html/sign_api/models/auth/common_auth_models.dart.gcov.html new file mode 100644 index 00000000..e25fc7f2 --- /dev/null +++ b/coverage/html/sign_api/models/auth/common_auth_models.dart.gcov.html @@ -0,0 +1,268 @@ + + + + + + + LCOV - lcov.info - sign_api/models/auth/common_auth_models.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models/auth - common_auth_models.dartCoverageTotalHit
Test:lcov.infoLines:72.7 %6648
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:freezed_annotation/freezed_annotation.dart';
+       2              : 
+       3              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/auth_client_models.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/session_auth_models.dart';
+       5              : 
+       6              : part 'common_auth_models.g.dart';
+       7              : part 'common_auth_models.freezed.dart';
+       8              : 
+       9              : @freezed
+      10              : class AuthPublicKey with _$AuthPublicKey {
+      11              :   @JsonSerializable(includeIfNull: false)
+      12              :   const factory AuthPublicKey({
+      13              :     required String publicKey,
+      14              :   }) = _AuthPublicKey;
+      15              : 
+      16            0 :   factory AuthPublicKey.fromJson(Map<String, dynamic> json) =>
+      17            0 :       _$AuthPublicKeyFromJson(json);
+      18              : }
+      19              : 
+      20              : @freezed
+      21              : class CacaoRequestPayload with _$CacaoRequestPayload {
+      22              :   @JsonSerializable(includeIfNull: false)
+      23              :   const factory CacaoRequestPayload({
+      24              :     required String domain,
+      25              :     required String aud,
+      26              :     required String version,
+      27              :     required String nonce,
+      28              :     required String iat,
+      29              :     String? nbf,
+      30              :     String? exp,
+      31              :     String? statement,
+      32              :     String? requestId,
+      33              :     List<String>? resources,
+      34              :   }) = _CacaoRequestPayload;
+      35              : 
+      36            2 :   factory CacaoRequestPayload.fromPayloadParams(AuthPayloadParams params) {
+      37            2 :     return CacaoRequestPayload(
+      38            2 :       domain: params.domain,
+      39            2 :       aud: params.aud,
+      40            2 :       version: params.version,
+      41            2 :       nonce: params.nonce,
+      42            2 :       iat: params.iat,
+      43            2 :       nbf: params.nbf,
+      44            2 :       exp: params.exp,
+      45            2 :       statement: params.statement,
+      46            2 :       requestId: params.requestId,
+      47            2 :       resources: params.resources,
+      48              :     );
+      49              :   }
+      50              : 
+      51            0 :   factory CacaoRequestPayload.fromSessionAuthPayload(
+      52              :     SessionAuthPayload params,
+      53              :   ) {
+      54            0 :     return CacaoRequestPayload(
+      55            0 :       domain: params.domain,
+      56            0 :       aud: params.aud,
+      57            0 :       version: params.version,
+      58            0 :       nonce: params.nonce,
+      59            0 :       iat: params.iat,
+      60            0 :       nbf: params.nbf,
+      61            0 :       exp: params.exp,
+      62            0 :       statement: params.statement,
+      63            0 :       requestId: params.requestId,
+      64            0 :       resources: params.resources,
+      65              :     );
+      66              :   }
+      67              : 
+      68            2 :   factory CacaoRequestPayload.fromCacaoPayload(CacaoPayload payload) {
+      69            2 :     return CacaoRequestPayload(
+      70            2 :       domain: payload.domain,
+      71            2 :       aud: payload.aud,
+      72            2 :       version: payload.version,
+      73            2 :       nonce: payload.nonce,
+      74            2 :       iat: payload.iat,
+      75            2 :       nbf: payload.nbf,
+      76            2 :       exp: payload.exp,
+      77            2 :       statement: payload.statement,
+      78            2 :       requestId: payload.requestId,
+      79            2 :       resources: payload.resources,
+      80              :     );
+      81              :   }
+      82              : 
+      83            0 :   factory CacaoRequestPayload.fromJson(Map<String, dynamic> json) =>
+      84            0 :       _$CacaoRequestPayloadFromJson(json);
+      85              : }
+      86              : 
+      87              : @freezed
+      88              : class CacaoPayload with _$CacaoPayload {
+      89              :   @JsonSerializable(includeIfNull: false)
+      90              :   const factory CacaoPayload({
+      91              :     required String iss,
+      92              :     required String domain,
+      93              :     required String aud,
+      94              :     required String version,
+      95              :     required String nonce,
+      96              :     required String iat,
+      97              :     String? nbf,
+      98              :     String? exp,
+      99              :     String? statement,
+     100              :     String? requestId,
+     101              :     List<String>? resources,
+     102              :   }) = _CacaoPayload;
+     103              : 
+     104            2 :   factory CacaoPayload.fromRequestPayload({
+     105              :     required String issuer,
+     106              :     required CacaoRequestPayload payload,
+     107              :   }) {
+     108            2 :     return CacaoPayload(
+     109              :       iss: issuer,
+     110            2 :       domain: payload.domain,
+     111            2 :       aud: payload.aud,
+     112            2 :       version: payload.version,
+     113            2 :       nonce: payload.nonce,
+     114            2 :       iat: payload.iat,
+     115            2 :       nbf: payload.nbf,
+     116            2 :       exp: payload.exp,
+     117            2 :       statement: payload.statement,
+     118            2 :       requestId: payload.requestId,
+     119            2 :       resources: payload.resources,
+     120              :     );
+     121              :   }
+     122              : 
+     123            2 :   factory CacaoPayload.fromJson(Map<String, dynamic> json) =>
+     124            2 :       _$CacaoPayloadFromJson(json);
+     125              : }
+     126              : 
+     127              : @freezed
+     128              : class CacaoHeader with _$CacaoHeader {
+     129              :   static const EIP4361 = 'eip4361';
+     130              :   static const CAIP122 = 'caip122';
+     131              : 
+     132              :   @JsonSerializable(includeIfNull: false)
+     133              :   const factory CacaoHeader({
+     134              :     @Default('eip4361') String t,
+     135              :   }) = _CacaoHeader;
+     136              : 
+     137            2 :   factory CacaoHeader.fromJson(Map<String, dynamic> json) =>
+     138            2 :       _$CacaoHeaderFromJson(json);
+     139              : }
+     140              : 
+     141              : @freezed
+     142              : class CacaoSignature with _$CacaoSignature {
+     143              :   static const EIP191 = 'eip191';
+     144              :   static const EIP1271 = 'eip1271';
+     145              : 
+     146              :   @JsonSerializable(includeIfNull: false)
+     147              :   const factory CacaoSignature({
+     148              :     required String t,
+     149              :     required String s,
+     150              :     String? m,
+     151              :   }) = _CacaoSignature;
+     152              : 
+     153            2 :   factory CacaoSignature.fromJson(Map<String, dynamic> json) =>
+     154            2 :       _$CacaoSignatureFromJson(json);
+     155              : }
+     156              : 
+     157              : @freezed
+     158              : class Cacao with _$Cacao {
+     159              :   @JsonSerializable(includeIfNull: false)
+     160              :   const factory Cacao({
+     161              :     required CacaoHeader h,
+     162              :     required CacaoPayload p,
+     163              :     required CacaoSignature s,
+     164              :   }) = _Cacao;
+     165              : 
+     166            4 :   factory Cacao.fromJson(Map<String, dynamic> json) => _$CacaoFromJson(json);
+     167              : }
+     168              : 
+     169              : @freezed
+     170              : class StoredCacao with _$StoredCacao {
+     171              :   @JsonSerializable(includeIfNull: false)
+     172              :   const factory StoredCacao({
+     173              :     required int id,
+     174              :     required String pairingTopic,
+     175              :     required CacaoHeader h,
+     176              :     required CacaoPayload p,
+     177              :     required CacaoSignature s,
+     178              :   }) = _StoredCacao;
+     179              : 
+     180            2 :   factory StoredCacao.fromCacao({
+     181              :     required int id,
+     182              :     required String pairingTopic,
+     183              :     required Cacao cacao,
+     184              :   }) {
+     185            2 :     return StoredCacao(
+     186              :       id: id,
+     187              :       pairingTopic: pairingTopic,
+     188            2 :       h: cacao.h,
+     189            2 :       p: cacao.p,
+     190            2 :       s: cacao.s,
+     191              :     );
+     192              :   }
+     193              : 
+     194            0 :   factory StoredCacao.fromJson(Map<String, dynamic> json) =>
+     195            0 :       _$StoredCacaoFromJson(json);
+     196              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/auth/index-sort-f.html b/coverage/html/sign_api/models/auth/index-sort-f.html new file mode 100644 index 00000000..3af50bbb --- /dev/null +++ b/coverage/html/sign_api/models/auth/index-sort-f.html @@ -0,0 +1,153 @@ + + + + + + + LCOV - lcov.info - sign_api/models/auth + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models/authCoverageTotalHit
Test:lcov.infoLines:45.6 %16977
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
auth_client_events.dart +
16.7%16.7%
+
16.7 %122-
auth_client_models.dart +
62.8%62.8%
+
62.8 %4327-
common_auth_models.dart +
72.7%72.7%
+
72.7 %6648-
session_auth_events.dart +
0.0%
+
0.0 %19-
session_auth_models.dart +
0.0%
+
0.0 %29-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/auth/index-sort-l.html b/coverage/html/sign_api/models/auth/index-sort-l.html new file mode 100644 index 00000000..130f99b7 --- /dev/null +++ b/coverage/html/sign_api/models/auth/index-sort-l.html @@ -0,0 +1,127 @@ + + + + + + + LCOV - lcov.info - sign_api/models/auth + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models/authCoverageTotalHit
Test:lcov.infoLines:45.6 %16977
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
session_auth_events.dart +
0.0%
+
0.0 %19
session_auth_models.dart +
0.0%
+
0.0 %29
auth_client_events.dart +
16.7%16.7%
+
16.7 %122
auth_client_models.dart +
62.8%62.8%
+
62.8 %4327
common_auth_models.dart +
72.7%72.7%
+
72.7 %6648
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/auth/index.html b/coverage/html/sign_api/models/auth/index.html new file mode 100644 index 00000000..5777aa86 --- /dev/null +++ b/coverage/html/sign_api/models/auth/index.html @@ -0,0 +1,127 @@ + + + + + + + LCOV - lcov.info - sign_api/models/auth + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models/authCoverageTotalHit
Test:lcov.infoLines:45.6 %16977
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
auth_client_events.dart +
16.7%16.7%
+
16.7 %122
auth_client_models.dart +
62.8%62.8%
+
62.8 %4327
common_auth_models.dart +
72.7%72.7%
+
72.7 %6648
session_auth_events.dart +
0.0%
+
0.0 %19
session_auth_models.dart +
0.0%
+
0.0 %29
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/auth/session_auth_events.dart.func-c.html b/coverage/html/sign_api/models/auth/session_auth_events.dart.func-c.html new file mode 100644 index 00000000..129489ed --- /dev/null +++ b/coverage/html/sign_api/models/auth/session_auth_events.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/models/auth/session_auth_events.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models/auth - session_auth_events.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %190
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/auth/session_auth_events.dart.func.html b/coverage/html/sign_api/models/auth/session_auth_events.dart.func.html new file mode 100644 index 00000000..e50ac9bc --- /dev/null +++ b/coverage/html/sign_api/models/auth/session_auth_events.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/models/auth/session_auth_events.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models/auth - session_auth_events.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %190
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/auth/session_auth_events.dart.gcov.html b/coverage/html/sign_api/models/auth/session_auth_events.dart.gcov.html new file mode 100644 index 00000000..2db22d45 --- /dev/null +++ b/coverage/html/sign_api/models/auth/session_auth_events.dart.gcov.html @@ -0,0 +1,143 @@ + + + + + + + LCOV - lcov.info - sign_api/models/auth/session_auth_events.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models/auth - session_auth_events.dartCoverageTotalHit
Test:lcov.infoLines:0.0 %190
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:convert';
+       2              : 
+       3              : import 'package:event/event.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/core/verify/models/verify_context.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
+       6              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_error.dart';
+       7              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/common_auth_models.dart';
+       8              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/session_models.dart';
+       9              : 
+      10              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/session_auth_models.dart';
+      11              : 
+      12              : class SessionAuthRequest extends EventArgs {
+      13              :   final int id;
+      14              :   final String topic;
+      15              :   final SessionAuthPayload authPayload;
+      16              :   final ConnectionMetadata requester;
+      17              :   final VerifyContext? verifyContext;
+      18              : 
+      19            0 :   SessionAuthRequest({
+      20              :     required this.id,
+      21              :     required this.topic,
+      22              :     required this.authPayload,
+      23              :     required this.requester,
+      24              :     this.verifyContext,
+      25              :   });
+      26              : 
+      27            0 :   Map<String, dynamic> toJson() => {
+      28            0 :         'id': id,
+      29            0 :         'topic': topic,
+      30            0 :         'authPayload': authPayload.toJson(),
+      31            0 :         'requester': requester.toJson(),
+      32            0 :         'verifyContext': verifyContext?.toJson(),
+      33              :       };
+      34              : 
+      35            0 :   @override
+      36              :   String toString() {
+      37            0 :     return 'SessionAuthRequest(${jsonEncode(toJson())})';
+      38              :   }
+      39              : }
+      40              : 
+      41              : class SessionAuthResponse extends EventArgs {
+      42              :   final int id;
+      43              :   final String topic;
+      44              :   final List<Cacao>? auths;
+      45              :   final SessionData? session;
+      46              :   final WalletConnectError? error;
+      47              :   final JsonRpcError? jsonRpcError;
+      48              : 
+      49            0 :   SessionAuthResponse({
+      50              :     required this.id,
+      51              :     required this.topic,
+      52              :     this.auths,
+      53              :     this.session,
+      54              :     this.error,
+      55              :     this.jsonRpcError,
+      56              :   });
+      57              : 
+      58            0 :   Map<String, dynamic> toJson() => {
+      59            0 :         'id': id,
+      60            0 :         'topic': topic,
+      61            0 :         if (auths != null) 'auths': auths,
+      62            0 :         if (session != null) 'session': session!.toJson(),
+      63            0 :         if (error != null) 'error': error!.toJson(),
+      64            0 :         if (jsonRpcError != null) 'jsonRpcError': jsonRpcError!.toJson(),
+      65              :       };
+      66              : 
+      67            0 :   @override
+      68              :   String toString() {
+      69            0 :     return 'SessionAuthResponse(${jsonEncode(toJson())})';
+      70              :   }
+      71              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/auth/session_auth_models.dart.func-c.html b/coverage/html/sign_api/models/auth/session_auth_models.dart.func-c.html new file mode 100644 index 00000000..3c595ca0 --- /dev/null +++ b/coverage/html/sign_api/models/auth/session_auth_models.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/models/auth/session_auth_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models/auth - session_auth_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %290
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/auth/session_auth_models.dart.func.html b/coverage/html/sign_api/models/auth/session_auth_models.dart.func.html new file mode 100644 index 00000000..1271183e --- /dev/null +++ b/coverage/html/sign_api/models/auth/session_auth_models.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/models/auth/session_auth_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models/auth - session_auth_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %290
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/auth/session_auth_models.dart.gcov.html b/coverage/html/sign_api/models/auth/session_auth_models.dart.gcov.html new file mode 100644 index 00000000..11cd6682 --- /dev/null +++ b/coverage/html/sign_api/models/auth/session_auth_models.dart.gcov.html @@ -0,0 +1,189 @@ + + + + + + + LCOV - lcov.info - sign_api/models/auth/session_auth_models.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models/auth - session_auth_models.dartCoverageTotalHit
Test:lcov.infoLines:0.0 %290
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:async';
+       2              : 
+       3              : import 'package:freezed_annotation/freezed_annotation.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/core/verify/models/verify_context.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
+       6              : 
+       7              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/common_auth_models.dart';
+       8              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/session_auth_events.dart';
+       9              : 
+      10              : part 'session_auth_models.g.dart';
+      11              : part 'session_auth_models.freezed.dart';
+      12              : 
+      13              : // TODO this should be under sign_client_models.dart probably
+      14              : class SessionAuthRequestResponse {
+      15              :   final int id;
+      16              :   final String pairingTopic;
+      17              :   final Completer<SessionAuthResponse> completer;
+      18              :   final Uri? uri;
+      19              : 
+      20            0 :   SessionAuthRequestResponse({
+      21              :     required this.id,
+      22              :     required this.pairingTopic,
+      23              :     required this.completer,
+      24              :     this.uri,
+      25              :   });
+      26              : }
+      27              : 
+      28              : @freezed
+      29              : class SessionAuthRequestParams with _$SessionAuthRequestParams {
+      30              :   @JsonSerializable(includeIfNull: false)
+      31              :   const factory SessionAuthRequestParams({
+      32              :     required List<String> chains,
+      33              :     required String domain,
+      34              :     required String nonce,
+      35              :     required String uri,
+      36              :     //
+      37              :     CacaoHeader? type,
+      38              :     String? nbf,
+      39              :     String? exp,
+      40              :     String? statement,
+      41              :     String? requestId,
+      42              :     List<String>? resources,
+      43              :     int? expiry,
+      44              :     @Default(<String>[]) List<String>? methods,
+      45              :   }) = _SessionAuthRequestParams;
+      46              :   //
+      47            0 :   factory SessionAuthRequestParams.fromJson(Map<String, dynamic> json) =>
+      48            0 :       _$SessionAuthRequestParamsFromJson(json);
+      49              : }
+      50              : 
+      51              : @freezed
+      52              : class SessionAuthPayload with _$SessionAuthPayload {
+      53              :   @JsonSerializable(includeIfNull: false)
+      54              :   const factory SessionAuthPayload({
+      55              :     required List<String> chains,
+      56              :     required String domain,
+      57              :     required String nonce,
+      58              :     required String aud,
+      59              :     required String type,
+      60              :     //
+      61              :     required String version,
+      62              :     required String iat,
+      63              :     //
+      64              :     String? nbf,
+      65              :     String? exp,
+      66              :     String? statement,
+      67              :     String? requestId,
+      68              :     List<String>? resources,
+      69              :   }) = _SessionAuthPayload;
+      70              : 
+      71            0 :   factory SessionAuthPayload.fromRequestParams(
+      72              :     SessionAuthRequestParams params,
+      73              :   ) {
+      74            0 :     final now = DateTime.now();
+      75            0 :     return SessionAuthPayload(
+      76            0 :       chains: params.chains,
+      77            0 :       domain: params.domain,
+      78            0 :       nonce: params.nonce,
+      79            0 :       aud: params.uri,
+      80            0 :       type: params.type?.t ?? 'eip4361',
+      81              :       version: '1',
+      82            0 :       iat: DateTime.utc(
+      83            0 :         now.year,
+      84            0 :         now.month,
+      85            0 :         now.day,
+      86            0 :         now.hour,
+      87            0 :         now.minute,
+      88            0 :         now.second,
+      89            0 :         now.millisecond,
+      90            0 :       ).toIso8601String(),
+      91            0 :       nbf: params.nbf,
+      92            0 :       exp: params.exp,
+      93            0 :       statement: params.statement,
+      94            0 :       requestId: params.requestId,
+      95            0 :       resources: params.resources,
+      96              :     );
+      97              :   }
+      98              : 
+      99            0 :   factory SessionAuthPayload.fromJson(Map<String, dynamic> json) =>
+     100            0 :       _$SessionAuthPayloadFromJson(json);
+     101              : }
+     102              : 
+     103              : @freezed
+     104              : class PendingSessionAuthRequest with _$PendingSessionAuthRequest {
+     105              :   @JsonSerializable(includeIfNull: false)
+     106              :   const factory PendingSessionAuthRequest({
+     107              :     required int id,
+     108              :     required String pairingTopic,
+     109              :     required ConnectionMetadata requester,
+     110              :     required int expiryTimestamp,
+     111              :     required CacaoRequestPayload authPayload,
+     112              :     required VerifyContext verifyContext,
+     113              :   }) = _PendingSessionAuthRequest;
+     114              : 
+     115            0 :   factory PendingSessionAuthRequest.fromJson(Map<String, dynamic> json) =>
+     116            0 :       _$PendingSessionAuthRequestFromJson(json);
+     117              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/index-sort-f.html b/coverage/html/sign_api/models/index-sort-f.html new file mode 100644 index 00000000..ecb8b3de --- /dev/null +++ b/coverage/html/sign_api/models/index-sort-f.html @@ -0,0 +1,153 @@ + + + + + + + LCOV - lcov.info - sign_api/models + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/modelsCoverageTotalHit
Test:lcov.infoLines:45.5 %9945
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
json_rpc_models.dart +
64.7%64.7%
+
64.7 %3422-
proposal_models.dart +
33.3%33.3%
+
33.3 %62-
session_models.dart +
33.3%33.3%
+
33.3 %93-
sign_client_events.dart +
36.4%36.4%
+
36.4 %4416-
sign_client_models.dart +
33.3%33.3%
+
33.3 %62-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/index-sort-l.html b/coverage/html/sign_api/models/index-sort-l.html new file mode 100644 index 00000000..4ba99186 --- /dev/null +++ b/coverage/html/sign_api/models/index-sort-l.html @@ -0,0 +1,127 @@ + + + + + + + LCOV - lcov.info - sign_api/models + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/modelsCoverageTotalHit
Test:lcov.infoLines:45.5 %9945
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
proposal_models.dart +
33.3%33.3%
+
33.3 %62
sign_client_models.dart +
33.3%33.3%
+
33.3 %62
session_models.dart +
33.3%33.3%
+
33.3 %93
sign_client_events.dart +
36.4%36.4%
+
36.4 %4416
json_rpc_models.dart +
64.7%64.7%
+
64.7 %3422
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/index.html b/coverage/html/sign_api/models/index.html new file mode 100644 index 00000000..f50fe465 --- /dev/null +++ b/coverage/html/sign_api/models/index.html @@ -0,0 +1,127 @@ + + + + + + + LCOV - lcov.info - sign_api/models + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/modelsCoverageTotalHit
Test:lcov.infoLines:45.5 %9945
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
json_rpc_models.dart +
64.7%64.7%
+
64.7 %3422
proposal_models.dart +
33.3%33.3%
+
33.3 %62
session_models.dart +
33.3%33.3%
+
33.3 %93
sign_client_events.dart +
36.4%36.4%
+
36.4 %4416
sign_client_models.dart +
33.3%33.3%
+
33.3 %62
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/json_rpc_models.dart.func-c.html b/coverage/html/sign_api/models/json_rpc_models.dart.func-c.html new file mode 100644 index 00000000..33e10dd4 --- /dev/null +++ b/coverage/html/sign_api/models/json_rpc_models.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/models/json_rpc_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models - json_rpc_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:64.7 %3422
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/json_rpc_models.dart.func.html b/coverage/html/sign_api/models/json_rpc_models.dart.func.html new file mode 100644 index 00000000..2e9d7638 --- /dev/null +++ b/coverage/html/sign_api/models/json_rpc_models.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/models/json_rpc_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models - json_rpc_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:64.7 %3422
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/json_rpc_models.dart.gcov.html b/coverage/html/sign_api/models/json_rpc_models.dart.gcov.html new file mode 100644 index 00000000..91fe7904 --- /dev/null +++ b/coverage/html/sign_api/models/json_rpc_models.dart.gcov.html @@ -0,0 +1,294 @@ + + + + + + + LCOV - lcov.info - sign_api/models/json_rpc_models.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models - json_rpc_models.dartCoverageTotalHit
Test:lcov.infoLines:64.7 %3422
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:freezed_annotation/freezed_annotation.dart';
+       2              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client_models.dart';
+       3              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/auth_client_models.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/common_auth_models.dart';
+       6              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/session_auth_models.dart';
+       7              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/proposal_models.dart';
+       8              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/session_models.dart';
+       9              : 
+      10              : part 'json_rpc_models.g.dart';
+      11              : part 'json_rpc_models.freezed.dart';
+      12              : 
+      13              : @freezed
+      14              : class WcPairingDeleteRequest with _$WcPairingDeleteRequest {
+      15              :   @JsonSerializable()
+      16              :   const factory WcPairingDeleteRequest({
+      17              :     required int code,
+      18              :     required String message,
+      19              :   }) = _WcPairingDeleteRequest;
+      20              : 
+      21            0 :   factory WcPairingDeleteRequest.fromJson(Map<String, dynamic> json) =>
+      22            0 :       _$WcPairingDeleteRequestFromJson(json);
+      23              : }
+      24              : 
+      25              : @freezed
+      26              : class WcPairingPingRequest with _$WcPairingPingRequest {
+      27              :   @JsonSerializable()
+      28              :   const factory WcPairingPingRequest({
+      29              :     required Map<String, dynamic> data,
+      30              :   }) = _WcPairingPingRequest;
+      31              : 
+      32            0 :   factory WcPairingPingRequest.fromJson(Map<String, dynamic> json) =>
+      33            0 :       _$WcPairingPingRequestFromJson(json);
+      34              : }
+      35              : 
+      36              : @freezed
+      37              : class WcSessionProposeRequest with _$WcSessionProposeRequest {
+      38              :   @JsonSerializable(includeIfNull: false)
+      39              :   const factory WcSessionProposeRequest({
+      40              :     required List<Relay> relays,
+      41              :     required Map<String, RequiredNamespace> requiredNamespaces,
+      42              :     Map<String, RequiredNamespace>? optionalNamespaces,
+      43              :     Map<String, String>? sessionProperties,
+      44              :     required ConnectionMetadata proposer,
+      45              :   }) = _WcSessionProposeRequest;
+      46              : 
+      47            4 :   factory WcSessionProposeRequest.fromJson(Map<String, dynamic> json) =>
+      48            4 :       _$WcSessionProposeRequestFromJson(json);
+      49              : }
+      50              : 
+      51              : @freezed
+      52              : class WcSessionProposeResponse with _$WcSessionProposeResponse {
+      53              :   @JsonSerializable()
+      54              :   const factory WcSessionProposeResponse({
+      55              :     required Relay relay,
+      56              :     required String responderPublicKey,
+      57              :   }) = _WcSessionProposeResponse;
+      58              : 
+      59            0 :   factory WcSessionProposeResponse.fromJson(Map<String, dynamic> json) =>
+      60            0 :       _$WcSessionProposeResponseFromJson(json);
+      61              : }
+      62              : 
+      63              : @freezed
+      64              : class WcSessionSettleRequest with _$WcSessionSettleRequest {
+      65              :   @JsonSerializable(includeIfNull: false)
+      66              :   const factory WcSessionSettleRequest({
+      67              :     required Relay relay,
+      68              :     required Map<String, Namespace> namespaces,
+      69              :     Map<String, RequiredNamespace>? requiredNamespaces,
+      70              :     Map<String, RequiredNamespace>? optionalNamespaces,
+      71              :     Map<String, String>? sessionProperties,
+      72              :     required int expiry,
+      73              :     required ConnectionMetadata controller,
+      74              :   }) = _WcSessionSettleRequest;
+      75              : 
+      76            4 :   factory WcSessionSettleRequest.fromJson(Map<String, dynamic> json) =>
+      77            4 :       _$WcSessionSettleRequestFromJson(json);
+      78              : }
+      79              : 
+      80              : @freezed
+      81              : class WcSessionUpdateRequest with _$WcSessionUpdateRequest {
+      82              :   @JsonSerializable()
+      83              :   const factory WcSessionUpdateRequest({
+      84              :     required Map<String, Namespace> namespaces,
+      85              :   }) = _WcSessionUpdateRequest;
+      86              : 
+      87            3 :   factory WcSessionUpdateRequest.fromJson(Map<String, dynamic> json) =>
+      88            3 :       _$WcSessionUpdateRequestFromJson(json);
+      89              : }
+      90              : 
+      91              : @freezed
+      92              : class WcSessionExtendRequest with _$WcSessionExtendRequest {
+      93              :   @JsonSerializable(includeIfNull: false)
+      94              :   const factory WcSessionExtendRequest({
+      95              :     Map<String, dynamic>? data,
+      96              :   }) = _WcSessionExtendRequest;
+      97              : 
+      98            3 :   factory WcSessionExtendRequest.fromJson(Map<String, dynamic> json) =>
+      99            3 :       _$WcSessionExtendRequestFromJson(json);
+     100              : }
+     101              : 
+     102              : @freezed
+     103              : class WcSessionDeleteRequest with _$WcSessionDeleteRequest {
+     104              :   @JsonSerializable(includeIfNull: false)
+     105              :   const factory WcSessionDeleteRequest({
+     106              :     required int code,
+     107              :     required String message,
+     108              :     String? data,
+     109              :   }) = _WcSessionDeleteRequest;
+     110              : 
+     111            3 :   factory WcSessionDeleteRequest.fromJson(Map<String, dynamic> json) =>
+     112            3 :       _$WcSessionDeleteRequestFromJson(json);
+     113              : }
+     114              : 
+     115              : @freezed
+     116              : class WcSessionPingRequest with _$WcSessionPingRequest {
+     117              :   @JsonSerializable(includeIfNull: false)
+     118              :   const factory WcSessionPingRequest({
+     119              :     Map<String, dynamic>? data,
+     120              :   }) = _WcSessionPingRequest;
+     121              : 
+     122            3 :   factory WcSessionPingRequest.fromJson(Map<String, dynamic> json) =>
+     123            3 :       _$WcSessionPingRequestFromJson(json);
+     124              : }
+     125              : 
+     126              : @freezed
+     127              : class WcSessionRequestRequest with _$WcSessionRequestRequest {
+     128              :   @JsonSerializable()
+     129              :   const factory WcSessionRequestRequest({
+     130              :     required String chainId,
+     131              :     required SessionRequestParams request,
+     132              :   }) = _WcSessionRequestRequest;
+     133              : 
+     134            3 :   factory WcSessionRequestRequest.fromJson(Map<String, dynamic> json) =>
+     135            3 :       _$WcSessionRequestRequestFromJson(json);
+     136              : }
+     137              : 
+     138              : @freezed
+     139              : class SessionRequestParams with _$SessionRequestParams {
+     140              :   @JsonSerializable()
+     141              :   const factory SessionRequestParams({
+     142              :     required String method,
+     143              :     required dynamic params,
+     144              :   }) = _SessionRequestParams;
+     145              : 
+     146            3 :   factory SessionRequestParams.fromJson(Map<String, dynamic> json) =>
+     147            3 :       _$SessionRequestParamsFromJson(json);
+     148              : }
+     149              : 
+     150              : @freezed
+     151              : class WcSessionEventRequest with _$WcSessionEventRequest {
+     152              :   @JsonSerializable()
+     153              :   const factory WcSessionEventRequest({
+     154              :     required String chainId,
+     155              :     required SessionEventParams event,
+     156              :   }) = _WcSessionEventRequest;
+     157              : 
+     158            3 :   factory WcSessionEventRequest.fromJson(Map<String, dynamic> json) =>
+     159            3 :       _$WcSessionEventRequestFromJson(json);
+     160              : }
+     161              : 
+     162              : @freezed
+     163              : class SessionEventParams with _$SessionEventParams {
+     164              :   @JsonSerializable()
+     165              :   const factory SessionEventParams({
+     166              :     required String name,
+     167              :     required dynamic data,
+     168              :   }) = _SessionEventParams;
+     169              : 
+     170            3 :   factory SessionEventParams.fromJson(Map<String, dynamic> json) =>
+     171            3 :       _$SessionEventParamsFromJson(json);
+     172              : }
+     173              : 
+     174              : /* AUTHENTICATION MODELS */
+     175              : 
+     176              : @freezed
+     177              : class WcAuthRequestRequest with _$WcAuthRequestRequest {
+     178              :   @JsonSerializable()
+     179              :   const factory WcAuthRequestRequest({
+     180              :     required AuthPayloadParams payloadParams,
+     181              :     required ConnectionMetadata requester,
+     182              :   }) = _WcAuthRequestRequest;
+     183              : 
+     184            2 :   factory WcAuthRequestRequest.fromJson(Map<String, dynamic> json) =>
+     185            2 :       _$WcAuthRequestRequestFromJson(json);
+     186              : }
+     187              : 
+     188              : @freezed
+     189              : class WcAuthRequestResult with _$WcAuthRequestResult {
+     190              :   @JsonSerializable()
+     191              :   const factory WcAuthRequestResult({
+     192              :     required Cacao cacao,
+     193              :   }) = _WcAuthRequestResult;
+     194              : 
+     195            0 :   factory WcAuthRequestResult.fromJson(Map<String, dynamic> json) =>
+     196            0 :       _$WcAuthRequestResultFromJson(json);
+     197              : }
+     198              : 
+     199              : @freezed
+     200              : class WcSessionAuthRequestParams with _$WcSessionAuthRequestParams {
+     201              :   @JsonSerializable()
+     202              :   const factory WcSessionAuthRequestParams({
+     203              :     required SessionAuthPayload authPayload,
+     204              :     required ConnectionMetadata requester,
+     205              :     required int expiryTimestamp,
+     206              :   }) = _WcSessionAuthRequestParams;
+     207              : 
+     208            0 :   factory WcSessionAuthRequestParams.fromJson(Map<String, dynamic> json) =>
+     209            0 :       _$WcSessionAuthRequestParamsFromJson(json);
+     210              : }
+     211              : 
+     212              : @freezed
+     213              : class WcSessionAuthRequestResult with _$WcSessionAuthRequestResult {
+     214              :   @JsonSerializable()
+     215              :   const factory WcSessionAuthRequestResult({
+     216              :     required List<Cacao> cacaos,
+     217              :     required ConnectionMetadata responder,
+     218              :   }) = _WcSessionAuthRequestResult;
+     219              : 
+     220            0 :   factory WcSessionAuthRequestResult.fromJson(Map<String, dynamic> json) =>
+     221            0 :       _$WcSessionAuthRequestResultFromJson(json);
+     222              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/proposal_models.dart.func-c.html b/coverage/html/sign_api/models/proposal_models.dart.func-c.html new file mode 100644 index 00000000..0101bcda --- /dev/null +++ b/coverage/html/sign_api/models/proposal_models.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/models/proposal_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models - proposal_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:33.3 %62
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/proposal_models.dart.func.html b/coverage/html/sign_api/models/proposal_models.dart.func.html new file mode 100644 index 00000000..9a0c0dec --- /dev/null +++ b/coverage/html/sign_api/models/proposal_models.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/models/proposal_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models - proposal_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:33.3 %62
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/proposal_models.dart.gcov.html b/coverage/html/sign_api/models/proposal_models.dart.gcov.html new file mode 100644 index 00000000..7544f38a --- /dev/null +++ b/coverage/html/sign_api/models/proposal_models.dart.gcov.html @@ -0,0 +1,123 @@ + + + + + + + LCOV - lcov.info - sign_api/models/proposal_models.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models - proposal_models.dartCoverageTotalHit
Test:lcov.infoLines:33.3 %62
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:freezed_annotation/freezed_annotation.dart';
+       2              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client_models.dart';
+       3              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/session_models.dart';
+       5              : 
+       6              : part 'proposal_models.g.dart';
+       7              : part 'proposal_models.freezed.dart';
+       8              : 
+       9              : @freezed
+      10              : class RequiredNamespace with _$RequiredNamespace {
+      11              :   @JsonSerializable(includeIfNull: false)
+      12              :   const factory RequiredNamespace({
+      13              :     List<String>? chains,
+      14              :     required List<String> methods,
+      15              :     required List<String> events,
+      16              :   }) = _RequiredNamespace;
+      17              : 
+      18            4 :   factory RequiredNamespace.fromJson(Map<String, dynamic> json) =>
+      19            4 :       _$RequiredNamespaceFromJson(json);
+      20              : }
+      21              : 
+      22              : @freezed
+      23              : class SessionProposal with _$SessionProposal {
+      24              :   @JsonSerializable()
+      25              :   const factory SessionProposal({
+      26              :     required int id,
+      27              :     required ProposalData params,
+      28              :   }) = _SessionProposal;
+      29              : 
+      30            0 :   factory SessionProposal.fromJson(Map<String, dynamic> json) =>
+      31            0 :       _$SessionProposalFromJson(json);
+      32              : }
+      33              : 
+      34              : @freezed
+      35              : class ProposalData with _$ProposalData {
+      36              :   @JsonSerializable(includeIfNull: false)
+      37              :   const factory ProposalData({
+      38              :     required int id,
+      39              :     required int expiry,
+      40              :     required List<Relay> relays,
+      41              :     required ConnectionMetadata proposer,
+      42              :     required Map<String, RequiredNamespace> requiredNamespaces,
+      43              :     required Map<String, RequiredNamespace> optionalNamespaces,
+      44              :     required String pairingTopic,
+      45              :     Map<String, String>? sessionProperties,
+      46              :     Map<String, Namespace>? generatedNamespaces,
+      47              :   }) = _ProposalData;
+      48              : 
+      49            0 :   factory ProposalData.fromJson(Map<String, dynamic> json) =>
+      50            0 :       _$ProposalDataFromJson(json);
+      51              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/session_models.dart.func-c.html b/coverage/html/sign_api/models/session_models.dart.func-c.html new file mode 100644 index 00000000..91420457 --- /dev/null +++ b/coverage/html/sign_api/models/session_models.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/models/session_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models - session_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:33.3 %93
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/session_models.dart.func.html b/coverage/html/sign_api/models/session_models.dart.func.html new file mode 100644 index 00000000..9078e316 --- /dev/null +++ b/coverage/html/sign_api/models/session_models.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/models/session_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models - session_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:33.3 %93
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/session_models.dart.gcov.html b/coverage/html/sign_api/models/session_models.dart.gcov.html new file mode 100644 index 00000000..dff442db --- /dev/null +++ b/coverage/html/sign_api/models/session_models.dart.gcov.html @@ -0,0 +1,159 @@ + + + + + + + LCOV - lcov.info - sign_api/models/session_models.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models - session_models.dartCoverageTotalHit
Test:lcov.infoLines:33.3 %93
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:async';
+       2              : 
+       3              : import 'package:freezed_annotation/freezed_annotation.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client_models.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/core/verify/models/verify_context.dart';
+       6              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
+       7              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/proposal_models.dart';
+       8              : 
+       9              : part 'session_models.g.dart';
+      10              : part 'session_models.freezed.dart';
+      11              : 
+      12              : class SessionProposalCompleter {
+      13              :   final int id;
+      14              :   final String selfPublicKey;
+      15              :   final String pairingTopic;
+      16              :   final Map<String, RequiredNamespace> requiredNamespaces;
+      17              :   final Map<String, RequiredNamespace> optionalNamespaces;
+      18              :   final Map<String, String>? sessionProperties;
+      19              :   final Completer completer;
+      20              : 
+      21            4 :   const SessionProposalCompleter({
+      22              :     required this.id,
+      23              :     required this.selfPublicKey,
+      24              :     required this.pairingTopic,
+      25              :     required this.requiredNamespaces,
+      26              :     required this.optionalNamespaces,
+      27              :     required this.completer,
+      28              :     this.sessionProperties,
+      29              :   });
+      30              : 
+      31            0 :   @override
+      32              :   String toString() {
+      33            0 :     return 'SessionProposalCompleter(id: $id, selfPublicKey: $selfPublicKey, pairingTopic: $pairingTopic, requiredNamespaces: $requiredNamespaces, optionalNamespaces: $optionalNamespaces, sessionProperties: $sessionProperties, completer: $completer)';
+      34              :   }
+      35              : }
+      36              : 
+      37              : @freezed
+      38              : class Namespace with _$Namespace {
+      39              :   @JsonSerializable(includeIfNull: false)
+      40              :   const factory Namespace({
+      41              :     List<String>? chains,
+      42              :     required List<String> accounts,
+      43              :     required List<String> methods,
+      44              :     required List<String> events,
+      45              :   }) = _Namespace;
+      46              : 
+      47            4 :   factory Namespace.fromJson(Map<String, dynamic> json) =>
+      48            4 :       _$NamespaceFromJson(json);
+      49              : }
+      50              : 
+      51              : @freezed
+      52              : class SessionData with _$SessionData {
+      53              :   @JsonSerializable(includeIfNull: false)
+      54              :   const factory SessionData({
+      55              :     required String topic,
+      56              :     required String pairingTopic,
+      57              :     required Relay relay,
+      58              :     required int expiry,
+      59              :     required bool acknowledged,
+      60              :     required String controller,
+      61              :     required Map<String, Namespace> namespaces,
+      62              :     Map<String, RequiredNamespace>? requiredNamespaces,
+      63              :     Map<String, RequiredNamespace>? optionalNamespaces,
+      64              :     Map<String, String>? sessionProperties,
+      65              :     required ConnectionMetadata self,
+      66              :     required ConnectionMetadata peer,
+      67              :   }) = _SessionData;
+      68              : 
+      69            0 :   factory SessionData.fromJson(Map<String, dynamic> json) =>
+      70            0 :       _$SessionDataFromJson(json);
+      71              : }
+      72              : 
+      73              : @freezed
+      74              : class SessionRequest with _$SessionRequest {
+      75              :   @JsonSerializable()
+      76              :   const factory SessionRequest({
+      77              :     required int id,
+      78              :     required String topic,
+      79              :     required String method,
+      80              :     required String chainId,
+      81              :     required dynamic params,
+      82              :     required VerifyContext verifyContext,
+      83              :   }) = _SessionRequest;
+      84              : 
+      85            0 :   factory SessionRequest.fromJson(Map<String, dynamic> json) =>
+      86            0 :       _$SessionRequestFromJson(json);
+      87              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/sign_client_events.dart.func-c.html b/coverage/html/sign_api/models/sign_client_events.dart.func-c.html new file mode 100644 index 00000000..adb4d8e5 --- /dev/null +++ b/coverage/html/sign_api/models/sign_client_events.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/models/sign_client_events.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models - sign_client_events.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:36.4 %4416
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/sign_client_events.dart.func.html b/coverage/html/sign_api/models/sign_client_events.dart.func.html new file mode 100644 index 00000000..7c1c93ea --- /dev/null +++ b/coverage/html/sign_api/models/sign_client_events.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/models/sign_client_events.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models - sign_client_events.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:36.4 %4416
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/sign_client_events.dart.gcov.html b/coverage/html/sign_api/models/sign_client_events.dart.gcov.html new file mode 100644 index 00000000..e3a8646a --- /dev/null +++ b/coverage/html/sign_api/models/sign_client_events.dart.gcov.html @@ -0,0 +1,266 @@ + + + + + + + LCOV - lcov.info - sign_api/models/sign_client_events.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models - sign_client_events.dartCoverageTotalHit
Test:lcov.infoLines:36.4 %4416
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:convert';
+       2              : 
+       3              : import 'package:event/event.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/core/verify/models/verify_context.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
+       6              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/proposal_models.dart';
+       7              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/session_models.dart';
+       8              : 
+       9              : class SessionProposalEvent extends EventArgs {
+      10              :   int id;
+      11              :   ProposalData params;
+      12              :   VerifyContext? verifyContext;
+      13              : 
+      14            4 :   SessionProposalEvent(
+      15              :     this.id,
+      16              :     this.params, [
+      17              :     this.verifyContext,
+      18              :   ]);
+      19              : 
+      20            0 :   Map<String, dynamic> toJson() => {
+      21            0 :         'id': id,
+      22            0 :         'params': params.toJson(),
+      23            0 :         'verifyContext': verifyContext?.toJson(),
+      24              :       };
+      25              : 
+      26            0 :   @override
+      27              :   String toString() {
+      28            0 :     return 'SessionProposalEvent(${jsonEncode(toJson())})';
+      29              :   }
+      30              : }
+      31              : 
+      32              : class SessionProposalErrorEvent extends EventArgs {
+      33              :   int id;
+      34              :   Map<String, RequiredNamespace> requiredNamespaces;
+      35              :   Map<String, Namespace> namespaces;
+      36              :   WalletConnectError error;
+      37              : 
+      38            0 :   SessionProposalErrorEvent(
+      39              :     this.id,
+      40              :     this.requiredNamespaces,
+      41              :     this.namespaces,
+      42              :     this.error,
+      43              :   );
+      44              : 
+      45            0 :   @override
+      46              :   String toString() {
+      47            0 :     return 'SessionProposalErrorEvent(id: $id, requiredNamespaces: $requiredNamespaces, namespaces: $namespaces, error: $error)';
+      48              :   }
+      49              : }
+      50              : 
+      51              : class SessionConnect extends EventArgs {
+      52              :   SessionData session;
+      53              : 
+      54            4 :   SessionConnect(
+      55              :     this.session,
+      56              :   );
+      57              : 
+      58            0 :   @override
+      59              :   String toString() {
+      60            0 :     return 'SessionConnect(session: $session)';
+      61              :   }
+      62              : }
+      63              : 
+      64              : class SessionUpdate extends EventArgs {
+      65              :   int id;
+      66              :   String topic;
+      67              :   Map<String, Namespace> namespaces;
+      68              : 
+      69            3 :   SessionUpdate(
+      70              :     this.id,
+      71              :     this.topic,
+      72              :     this.namespaces,
+      73              :   );
+      74              : 
+      75            0 :   @override
+      76              :   String toString() {
+      77            0 :     return 'SessionUpdate(id: $id, topic: $topic, namespaces: $namespaces)';
+      78              :   }
+      79              : }
+      80              : 
+      81              : class SessionExtend extends EventArgs {
+      82              :   int id;
+      83              :   String topic;
+      84              : 
+      85            3 :   SessionExtend(this.id, this.topic);
+      86              : 
+      87            0 :   @override
+      88              :   String toString() {
+      89            0 :     return 'SessionExtend(id: $id, topic: $topic)';
+      90              :   }
+      91              : }
+      92              : 
+      93              : class SessionPing extends EventArgs {
+      94              :   int id;
+      95              :   String topic;
+      96              : 
+      97            3 :   SessionPing(this.id, this.topic);
+      98              : 
+      99            0 :   @override
+     100              :   String toString() {
+     101            0 :     return 'SessionPing(id: $id, topic: $topic)';
+     102              :   }
+     103              : }
+     104              : 
+     105              : class SessionDelete extends EventArgs {
+     106              :   String topic;
+     107              :   int? id;
+     108              : 
+     109            3 :   SessionDelete(
+     110              :     this.topic, {
+     111              :     this.id,
+     112              :   });
+     113              : 
+     114            0 :   @override
+     115              :   String toString() {
+     116            0 :     return 'SessionDelete(topic: $topic, id: $id)';
+     117              :   }
+     118              : }
+     119              : 
+     120              : class SessionExpire extends EventArgs {
+     121              :   final String topic;
+     122              : 
+     123            3 :   SessionExpire(this.topic);
+     124              : 
+     125            0 :   @override
+     126              :   String toString() {
+     127            0 :     return 'SessionExpire(topic: $topic)';
+     128              :   }
+     129              : }
+     130              : 
+     131              : class SessionRequestEvent extends EventArgs {
+     132              :   int id;
+     133              :   String topic;
+     134              :   String method;
+     135              :   String chainId;
+     136              :   dynamic params;
+     137              : 
+     138            3 :   SessionRequestEvent(
+     139              :     this.id,
+     140              :     this.topic,
+     141              :     this.method,
+     142              :     this.chainId,
+     143              :     this.params,
+     144              :   );
+     145              : 
+     146            3 :   factory SessionRequestEvent.fromSessionRequest(
+     147              :     SessionRequest request,
+     148              :   ) {
+     149            3 :     return SessionRequestEvent(
+     150            3 :       request.id,
+     151            3 :       request.topic,
+     152            3 :       request.method,
+     153            3 :       request.chainId,
+     154            3 :       request.params,
+     155              :     );
+     156              :   }
+     157              : 
+     158            0 :   @override
+     159              :   String toString() {
+     160            0 :     return 'SessionRequestEvent(id: $id, topic: $topic, method: $method, chainId: $chainId, params: $params)';
+     161              :   }
+     162              : }
+     163              : 
+     164              : class SessionEvent extends EventArgs {
+     165              :   int id;
+     166              :   String topic;
+     167              :   String name;
+     168              :   String chainId;
+     169              :   dynamic data;
+     170              : 
+     171            3 :   SessionEvent(
+     172              :     this.id,
+     173              :     this.topic,
+     174              :     this.name,
+     175              :     this.chainId,
+     176              :     this.data,
+     177              :   );
+     178              : 
+     179            0 :   @override
+     180              :   String toString() {
+     181            0 :     return 'SessionEvent(id: $id, topic: $topic, name: $name, chainId: $chainId, data: $data)';
+     182              :   }
+     183              : }
+     184              : 
+     185              : class ProposalExpire extends EventArgs {
+     186              :   final int id;
+     187              : 
+     188            0 :   ProposalExpire(this.id);
+     189              : 
+     190            0 :   @override
+     191              :   String toString() {
+     192            0 :     return 'ProposalExpire(id: $id)';
+     193              :   }
+     194              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/sign_client_models.dart.func-c.html b/coverage/html/sign_api/models/sign_client_models.dart.func-c.html new file mode 100644 index 00000000..21a7c2a8 --- /dev/null +++ b/coverage/html/sign_api/models/sign_client_models.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/models/sign_client_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models - sign_client_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:33.3 %62
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/sign_client_models.dart.func.html b/coverage/html/sign_api/models/sign_client_models.dart.func.html new file mode 100644 index 00000000..e413369a --- /dev/null +++ b/coverage/html/sign_api/models/sign_client_models.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/models/sign_client_models.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models - sign_client_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:33.3 %62
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/models/sign_client_models.dart.gcov.html b/coverage/html/sign_api/models/sign_client_models.dart.gcov.html new file mode 100644 index 00000000..ccd1f124 --- /dev/null +++ b/coverage/html/sign_api/models/sign_client_models.dart.gcov.html @@ -0,0 +1,107 @@ + + + + + + + LCOV - lcov.info - sign_api/models/sign_client_models.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/models - sign_client_models.dartCoverageTotalHit
Test:lcov.infoLines:33.3 %62
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:async';
+       2              : 
+       3              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/session_models.dart';
+       4              : 
+       5              : class ConnectResponse {
+       6              :   final String pairingTopic;
+       7              :   final Completer<SessionData> session;
+       8              :   final Uri? uri;
+       9              : 
+      10            4 :   ConnectResponse({
+      11              :     required this.pairingTopic,
+      12              :     required this.session,
+      13              :     this.uri,
+      14              :   });
+      15              : 
+      16            0 :   @override
+      17              :   String toString() {
+      18            0 :     return 'ConnectResponse(pairingTopic: $pairingTopic, session: $session, uri: $uri)';
+      19              :   }
+      20              : }
+      21              : 
+      22              : class ApproveResponse {
+      23              :   final String topic;
+      24              :   final SessionData? session;
+      25              : 
+      26            4 :   ApproveResponse({
+      27              :     required this.topic,
+      28              :     required this.session,
+      29              :   });
+      30              : 
+      31            0 :   @override
+      32              :   String toString() {
+      33            0 :     return 'ApproveResponse(topic: $topic, session: $session)';
+      34              :   }
+      35              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/sessions.dart.func-c.html b/coverage/html/sign_api/sessions.dart.func-c.html new file mode 100644 index 00000000..36a2d025 --- /dev/null +++ b/coverage/html/sign_api/sessions.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/sessions.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api - sessions.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %77
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/sessions.dart.func.html b/coverage/html/sign_api/sessions.dart.func.html new file mode 100644 index 00000000..6b329609 --- /dev/null +++ b/coverage/html/sign_api/sessions.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/sessions.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api - sessions.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %77
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/sessions.dart.gcov.html b/coverage/html/sign_api/sessions.dart.gcov.html new file mode 100644 index 00000000..628e7eef --- /dev/null +++ b/coverage/html/sign_api/sessions.dart.gcov.html @@ -0,0 +1,108 @@ + + + + + + + LCOV - lcov.info - sign_api/sessions.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api - sessions.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %77
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:walletconnect_flutter_v2/apis/core/store/generic_store.dart';
+       2              : 
+       3              : import 'package:walletconnect_flutter_v2/apis/sign_api/i_sessions.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/session_models.dart';
+       5              : 
+       6              : class Sessions extends GenericStore<SessionData> implements ISessions {
+       7            6 :   Sessions({
+       8              :     required super.storage,
+       9              :     required super.context,
+      10              :     required super.version,
+      11              :     required super.fromJson,
+      12              :   });
+      13              : 
+      14            5 :   @override
+      15              :   Future<void> update(
+      16              :     String topic, {
+      17              :     int? expiry,
+      18              :     Map<String, Namespace>? namespaces,
+      19              :   }) async {
+      20            5 :     checkInitialized();
+      21              : 
+      22            5 :     SessionData? info = get(topic);
+      23              :     if (info == null) {
+      24              :       return;
+      25              :     }
+      26              : 
+      27              :     if (expiry != null) {
+      28           10 :       info = info.copyWith(expiry: expiry);
+      29              :     }
+      30              :     if (namespaces != null) {
+      31            6 :       info = info.copyWith(namespaces: namespaces);
+      32              :     }
+      33              : 
+      34            5 :     await set(topic, info);
+      35              :   }
+      36              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/sign_client.dart.func-c.html b/coverage/html/sign_api/sign_client.dart.func-c.html new file mode 100644 index 00000000..2eccc994 --- /dev/null +++ b/coverage/html/sign_api/sign_client.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/sign_client.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api - sign_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:57.6 %15891
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/sign_client.dart.func.html b/coverage/html/sign_api/sign_client.dart.func.html new file mode 100644 index 00000000..a200351e --- /dev/null +++ b/coverage/html/sign_api/sign_client.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/sign_client.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api - sign_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:57.6 %15891
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/sign_client.dart.gcov.html b/coverage/html/sign_api/sign_client.dart.gcov.html new file mode 100644 index 00000000..404c9b30 --- /dev/null +++ b/coverage/html/sign_api/sign_client.dart.gcov.html @@ -0,0 +1,748 @@ + + + + + + + LCOV - lcov.info - sign_api/sign_client.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api - sign_client.dartCoverageTotalHit
Test:lcov.infoLines:57.6 %15891
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:walletconnect_flutter_v2/apis/core/store/generic_store.dart';
+       2              : import 'package:walletconnect_flutter_v2/apis/core/store/i_generic_store.dart';
+       3              : import 'package:walletconnect_flutter_v2/apis/sign_api/i_sessions.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/sign_api/sign_engine.dart';
+       5              : import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart';
+       6              : 
+       7              : class SignClient implements ISignClient {
+       8              :   bool _initialized = false;
+       9              : 
+      10              :   @override
+      11              :   final String protocol = 'wc';
+      12              :   @override
+      13              :   final int version = 2;
+      14              : 
+      15            1 :   @override
+      16            2 :   Event<SessionDelete> get onSessionDelete => engine.onSessionDelete;
+      17            1 :   @override
+      18            2 :   Event<SessionConnect> get onSessionConnect => engine.onSessionConnect;
+      19            1 :   @override
+      20            2 :   Event<SessionEvent> get onSessionEvent => engine.onSessionEvent;
+      21            1 :   @override
+      22            2 :   Event<SessionExpire> get onSessionExpire => engine.onSessionExpire;
+      23            1 :   @override
+      24            2 :   Event<SessionExtend> get onSessionExtend => engine.onSessionExtend;
+      25            1 :   @override
+      26            2 :   Event<SessionPing> get onSessionPing => engine.onSessionPing;
+      27            1 :   @override
+      28            2 :   Event<SessionProposalEvent> get onSessionProposal => engine.onSessionProposal;
+      29            0 :   @override
+      30              :   Event<SessionProposalErrorEvent> get onSessionProposalError =>
+      31            0 :       engine.onSessionProposalError;
+      32            1 :   @override
+      33            2 :   Event<SessionProposalEvent> get onProposalExpire => engine.onProposalExpire;
+      34            1 :   @override
+      35            2 :   Event<SessionRequestEvent> get onSessionRequest => engine.onSessionRequest;
+      36            1 :   @override
+      37            2 :   Event<SessionUpdate> get onSessionUpdate => engine.onSessionUpdate;
+      38              : 
+      39            1 :   @override
+      40            2 :   ICore get core => engine.core;
+      41            0 :   @override
+      42            0 :   PairingMetadata get metadata => engine.metadata;
+      43            1 :   @override
+      44            2 :   IGenericStore<ProposalData> get proposals => engine.proposals;
+      45            1 :   @override
+      46            2 :   ISessions get sessions => engine.sessions;
+      47            1 :   @override
+      48            2 :   IGenericStore<SessionRequest> get pendingRequests => engine.pendingRequests;
+      49              : 
+      50              :   @override
+      51              :   late ISignEngine engine;
+      52              : 
+      53            0 :   static Future<SignClient> createInstance({
+      54              :     required String projectId,
+      55              :     String relayUrl = WalletConnectConstants.DEFAULT_RELAY_URL,
+      56              :     required PairingMetadata metadata,
+      57              :     bool memoryStore = false,
+      58              :     LogLevel logLevel = LogLevel.nothing,
+      59              :   }) async {
+      60            0 :     final client = SignClient(
+      61            0 :       core: Core(
+      62              :         projectId: projectId,
+      63              :         relayUrl: relayUrl,
+      64              :         memoryStore: memoryStore,
+      65              :         logLevel: logLevel,
+      66              :       ),
+      67              :       metadata: metadata,
+      68              :     );
+      69            0 :     await client.init();
+      70              : 
+      71              :     return client;
+      72              :   }
+      73              : 
+      74            1 :   SignClient({
+      75              :     required ICore core,
+      76              :     required PairingMetadata metadata,
+      77              :   }) {
+      78            2 :     engine = SignEngine(
+      79              :       core: core,
+      80              :       metadata: metadata,
+      81            1 :       proposals: GenericStore(
+      82            1 :         storage: core.storage,
+      83              :         context: StoreVersions.CONTEXT_PROPOSALS,
+      84              :         version: StoreVersions.VERSION_PROPOSALS,
+      85            0 :         fromJson: (dynamic value) {
+      86            0 :           return ProposalData.fromJson(value);
+      87              :         },
+      88              :       ),
+      89            1 :       sessions: Sessions(
+      90            1 :         storage: core.storage,
+      91              :         context: StoreVersions.CONTEXT_SESSIONS,
+      92              :         version: StoreVersions.VERSION_SESSIONS,
+      93            0 :         fromJson: (dynamic value) {
+      94            0 :           return SessionData.fromJson(value);
+      95              :         },
+      96              :       ),
+      97            1 :       pendingRequests: GenericStore(
+      98            1 :         storage: core.storage,
+      99              :         context: StoreVersions.CONTEXT_PENDING_REQUESTS,
+     100              :         version: StoreVersions.VERSION_PENDING_REQUESTS,
+     101            0 :         fromJson: (dynamic value) {
+     102            0 :           return SessionRequest.fromJson(value);
+     103              :         },
+     104              :       ),
+     105            1 :       authKeys: GenericStore(
+     106            1 :         storage: core.storage,
+     107              :         context: StoreVersions.CONTEXT_AUTH_KEYS,
+     108              :         version: StoreVersions.VERSION_AUTH_KEYS,
+     109            0 :         fromJson: (dynamic value) {
+     110            0 :           return AuthPublicKey.fromJson(value);
+     111              :         },
+     112              :       ),
+     113            1 :       pairingTopics: GenericStore(
+     114            1 :         storage: core.storage,
+     115              :         context: StoreVersions.CONTEXT_PAIRING_TOPICS,
+     116              :         version: StoreVersions.VERSION_PAIRING_TOPICS,
+     117            0 :         fromJson: (dynamic value) {
+     118              :           return value;
+     119              :         },
+     120              :       ),
+     121            1 :       authRequests: GenericStore(
+     122            1 :         storage: core.storage,
+     123              :         context: StoreVersions.CONTEXT_AUTH_REQUESTS,
+     124              :         version: StoreVersions.VERSION_AUTH_REQUESTS,
+     125            0 :         fromJson: (dynamic value) {
+     126            0 :           return PendingAuthRequest.fromJson(value);
+     127              :         },
+     128              :       ),
+     129            1 :       completeRequests: GenericStore(
+     130            1 :         storage: core.storage,
+     131              :         context: StoreVersions.CONTEXT_COMPLETE_REQUESTS,
+     132              :         version: StoreVersions.VERSION_COMPLETE_REQUESTS,
+     133            0 :         fromJson: (dynamic value) {
+     134            0 :           return StoredCacao.fromJson(value);
+     135              :         },
+     136              :       ),
+     137            1 :       sessionAuthRequests: GenericStore(
+     138            1 :         storage: core.storage,
+     139              :         context: StoreVersions.CONTEXT_AUTH_REQUESTS,
+     140              :         version: StoreVersions.VERSION_AUTH_REQUESTS,
+     141            0 :         fromJson: (dynamic value) {
+     142            0 :           return PendingSessionAuthRequest.fromJson(value);
+     143              :         },
+     144              :       ),
+     145              :     );
+     146              :   }
+     147              : 
+     148            1 :   @override
+     149              :   Future<void> init() async {
+     150            1 :     if (_initialized) {
+     151              :       return;
+     152              :     }
+     153              : 
+     154            2 :     await core.start();
+     155            2 :     await engine.init();
+     156              : 
+     157            1 :     _initialized = true;
+     158              :   }
+     159              : 
+     160            1 :   @override
+     161              :   Future<ConnectResponse> connect({
+     162              :     Map<String, RequiredNamespace>? requiredNamespaces,
+     163              :     Map<String, RequiredNamespace>? optionalNamespaces,
+     164              :     Map<String, String>? sessionProperties,
+     165              :     String? pairingTopic,
+     166              :     List<Relay>? relays,
+     167              :     List<List<String>>? methods = SignEngine.DEFAULT_METHODS,
+     168              :   }) async {
+     169              :     try {
+     170            2 :       return await engine.connect(
+     171              :         requiredNamespaces: requiredNamespaces,
+     172              :         optionalNamespaces: optionalNamespaces,
+     173              :         sessionProperties: sessionProperties,
+     174              :         pairingTopic: pairingTopic,
+     175              :         relays: relays,
+     176              :         methods: methods,
+     177              :       );
+     178              :     } catch (e) {
+     179              :       // print(e);
+     180              :       rethrow;
+     181              :     }
+     182              :   }
+     183              : 
+     184            1 :   @override
+     185              :   Future<PairingInfo> pair({
+     186              :     required Uri uri,
+     187              :   }) async {
+     188              :     try {
+     189            2 :       return await engine.pair(uri: uri);
+     190              :     } catch (e) {
+     191              :       rethrow;
+     192              :     }
+     193              :   }
+     194              : 
+     195            1 :   @override
+     196              :   Future<ApproveResponse> approve({
+     197              :     required int id,
+     198              :     required Map<String, Namespace> namespaces,
+     199              :     Map<String, String>? sessionProperties,
+     200              :     String? relayProtocol,
+     201              :   }) async {
+     202              :     try {
+     203            2 :       return await engine.approveSession(
+     204              :         id: id,
+     205              :         namespaces: namespaces,
+     206              :         sessionProperties: sessionProperties,
+     207              :         relayProtocol: relayProtocol,
+     208              :       );
+     209              :     } catch (e) {
+     210              :       rethrow;
+     211              :     }
+     212              :   }
+     213              : 
+     214            1 :   @override
+     215              :   Future<void> reject({
+     216              :     required int id,
+     217              :     required WalletConnectError reason,
+     218              :   }) async {
+     219              :     try {
+     220            2 :       return await engine.rejectSession(
+     221              :         id: id,
+     222              :         reason: reason,
+     223              :       );
+     224              :     } catch (e) {
+     225              :       rethrow;
+     226              :     }
+     227              :   }
+     228              : 
+     229            1 :   @override
+     230              :   Future<void> update({
+     231              :     required String topic,
+     232              :     required Map<String, Namespace> namespaces,
+     233              :   }) async {
+     234              :     try {
+     235            2 :       return await engine.updateSession(
+     236              :         topic: topic,
+     237              :         namespaces: namespaces,
+     238              :       );
+     239              :     } catch (e) {
+     240              :       // final error = e as WCError;
+     241              :       rethrow;
+     242              :     }
+     243              :   }
+     244              : 
+     245            1 :   @override
+     246              :   Future<void> extend({
+     247              :     required String topic,
+     248              :   }) async {
+     249              :     try {
+     250            2 :       return await engine.extendSession(topic: topic);
+     251              :     } catch (e) {
+     252              :       rethrow;
+     253              :     }
+     254              :   }
+     255              : 
+     256            1 :   @override
+     257              :   void registerRequestHandler({
+     258              :     required String chainId,
+     259              :     required String method,
+     260              :     void Function(String, dynamic)? handler,
+     261              :   }) {
+     262              :     try {
+     263            2 :       return engine.registerRequestHandler(
+     264              :         chainId: chainId,
+     265              :         method: method,
+     266              :         handler: handler,
+     267              :       );
+     268              :     } catch (e) {
+     269              :       rethrow;
+     270              :     }
+     271              :   }
+     272              : 
+     273            1 :   @override
+     274              :   Future<dynamic> request({
+     275              :     required String topic,
+     276              :     required String chainId,
+     277              :     required SessionRequestParams request,
+     278              :   }) async {
+     279              :     try {
+     280            2 :       return await engine.request(
+     281              :         topic: topic,
+     282              :         chainId: chainId,
+     283              :         request: request,
+     284              :       );
+     285              :     } catch (e) {
+     286              :       rethrow;
+     287              :     }
+     288              :   }
+     289              : 
+     290            0 :   @override
+     291              :   Future<List<dynamic>> requestReadContract({
+     292              :     required DeployedContract deployedContract,
+     293              :     required String functionName,
+     294              :     required String rpcUrl,
+     295              :     EthereumAddress? sender,
+     296              :     List parameters = const [],
+     297              :   }) async {
+     298              :     try {
+     299            0 :       return await engine.requestReadContract(
+     300              :         sender: sender,
+     301              :         deployedContract: deployedContract,
+     302              :         functionName: functionName,
+     303              :         rpcUrl: rpcUrl,
+     304              :         parameters: parameters,
+     305              :       );
+     306              :     } catch (e) {
+     307              :       rethrow;
+     308              :     }
+     309              :   }
+     310              : 
+     311            0 :   @override
+     312              :   Future<dynamic> requestWriteContract({
+     313              :     required String topic,
+     314              :     required String chainId,
+     315              :     required String rpcUrl,
+     316              :     required DeployedContract deployedContract,
+     317              :     required String functionName,
+     318              :     required Transaction transaction,
+     319              :     String? method,
+     320              :     List parameters = const [],
+     321              :   }) async {
+     322              :     try {
+     323            0 :       return await engine.requestWriteContract(
+     324              :         topic: topic,
+     325              :         chainId: chainId,
+     326              :         rpcUrl: rpcUrl,
+     327              :         deployedContract: deployedContract,
+     328              :         functionName: functionName,
+     329              :         transaction: transaction,
+     330              :         method: method,
+     331              :         parameters: parameters,
+     332              :       );
+     333              :     } catch (e) {
+     334              :       rethrow;
+     335              :     }
+     336              :   }
+     337              : 
+     338            1 :   @override
+     339              :   Future<void> respond({
+     340              :     required String topic,
+     341              :     required JsonRpcResponse response,
+     342              :   }) {
+     343              :     try {
+     344            2 :       return engine.respondSessionRequest(
+     345              :         topic: topic,
+     346              :         response: response,
+     347              :       );
+     348              :     } catch (e) {
+     349              :       rethrow;
+     350              :     }
+     351              :   }
+     352              : 
+     353            1 :   @override
+     354              :   void registerEventHandler({
+     355              :     required String chainId,
+     356              :     required String event,
+     357              :     dynamic Function(String, dynamic)? handler,
+     358              :   }) {
+     359              :     try {
+     360            2 :       return engine.registerEventHandler(
+     361              :         chainId: chainId,
+     362              :         event: event,
+     363              :         handler: handler,
+     364              :       );
+     365              :     } catch (e) {
+     366              :       rethrow;
+     367              :     }
+     368              :   }
+     369              : 
+     370            1 :   @override
+     371              :   void registerEventEmitter({
+     372              :     required String chainId,
+     373              :     required String event,
+     374              :   }) {
+     375              :     try {
+     376            2 :       return engine.registerEventEmitter(
+     377              :         chainId: chainId,
+     378              :         event: event,
+     379              :       );
+     380              :     } catch (e) {
+     381              :       rethrow;
+     382              :     }
+     383              :   }
+     384              : 
+     385            1 :   @override
+     386              :   void registerAccount({
+     387              :     required String chainId,
+     388              :     required String accountAddress,
+     389              :   }) {
+     390              :     try {
+     391            2 :       return engine.registerAccount(
+     392              :         chainId: chainId,
+     393              :         accountAddress: accountAddress,
+     394              :       );
+     395              :     } catch (e) {
+     396              :       rethrow;
+     397              :     }
+     398              :   }
+     399              : 
+     400            1 :   @override
+     401              :   Future<void> emit({
+     402              :     required String topic,
+     403              :     required String chainId,
+     404              :     required SessionEventParams event,
+     405              :   }) async {
+     406              :     try {
+     407            2 :       return await engine.emitSessionEvent(
+     408              :         topic: topic,
+     409              :         chainId: chainId,
+     410              :         event: event,
+     411              :       );
+     412              :     } catch (e) {
+     413              :       rethrow;
+     414              :     }
+     415              :   }
+     416              : 
+     417            1 :   @override
+     418              :   Future<void> ping({
+     419              :     required String topic,
+     420              :   }) async {
+     421              :     try {
+     422            2 :       return await engine.ping(topic: topic);
+     423              :     } catch (e) {
+     424              :       rethrow;
+     425              :     }
+     426              :   }
+     427              : 
+     428            1 :   @override
+     429              :   Future<void> disconnect({
+     430              :     required String topic,
+     431              :     required WalletConnectError reason,
+     432              :   }) async {
+     433              :     try {
+     434            2 :       return await engine.disconnectSession(
+     435              :         topic: topic,
+     436              :         reason: reason,
+     437              :       );
+     438              :     } catch (e) {
+     439              :       rethrow;
+     440              :     }
+     441              :   }
+     442              : 
+     443            1 :   @override
+     444              :   SessionData? find({
+     445              :     required Map<String, RequiredNamespace> requiredNamespaces,
+     446              :   }) {
+     447              :     try {
+     448            2 :       return engine.find(requiredNamespaces: requiredNamespaces);
+     449              :     } catch (e) {
+     450              :       rethrow;
+     451              :     }
+     452              :   }
+     453              : 
+     454            1 :   @override
+     455              :   Map<String, SessionData> getActiveSessions() {
+     456              :     try {
+     457            2 :       return engine.getActiveSessions();
+     458              :     } catch (e) {
+     459              :       rethrow;
+     460              :     }
+     461              :   }
+     462              : 
+     463            1 :   @override
+     464              :   Map<String, SessionData> getSessionsForPairing({
+     465              :     required String pairingTopic,
+     466              :   }) {
+     467              :     try {
+     468            2 :       return engine.getSessionsForPairing(
+     469              :         pairingTopic: pairingTopic,
+     470              :       );
+     471              :     } catch (e) {
+     472              :       rethrow;
+     473              :     }
+     474              :   }
+     475              : 
+     476            1 :   @override
+     477              :   Map<String, ProposalData> getPendingSessionProposals() {
+     478              :     try {
+     479            2 :       return engine.getPendingSessionProposals();
+     480              :     } catch (e) {
+     481              :       rethrow;
+     482              :     }
+     483              :   }
+     484              : 
+     485            1 :   @override
+     486              :   Map<String, SessionRequest> getPendingSessionRequests() {
+     487              :     try {
+     488            2 :       return engine.getPendingSessionRequests();
+     489              :     } catch (e) {
+     490              :       rethrow;
+     491              :     }
+     492              :   }
+     493              : 
+     494            0 :   @override
+     495            0 :   IPairingStore get pairings => core.pairing.getStore();
+     496              : 
+     497              :   // FORMER AUTH ENGINE METHODS
+     498              : 
+     499            0 :   @override
+     500            0 :   IGenericStore<PendingAuthRequest> get authRequests => engine.authRequests;
+     501              : 
+     502            0 :   @override
+     503              :   Map<int, PendingAuthRequest> getPendingAuthRequests() {
+     504              :     try {
+     505            0 :       return engine.getPendingAuthRequests();
+     506              :     } catch (e) {
+     507              :       rethrow;
+     508              :     }
+     509              :   }
+     510              : 
+     511            0 :   @override
+     512              :   Map<int, PendingSessionAuthRequest> getPendingSessionAuthRequests() {
+     513              :     try {
+     514            0 :       return engine.getPendingSessionAuthRequests();
+     515              :     } catch (e) {
+     516              :       rethrow;
+     517              :     }
+     518              :   }
+     519              : 
+     520            0 :   @override
+     521              :   IGenericStore<PendingSessionAuthRequest> get sessionAuthRequests =>
+     522            0 :       engine.sessionAuthRequests;
+     523              : 
+     524            0 :   @override
+     525            0 :   Event<AuthRequest> get onAuthRequest => engine.onAuthRequest;
+     526              : 
+     527            0 :   @override
+     528            0 :   Event<AuthResponse> get onAuthResponse => engine.onAuthResponse;
+     529              : 
+     530              :   // NEW 1-CLICK AUTH METHOD
+     531            0 :   @override
+     532              :   Event<SessionAuthResponse> get onSessionAuthResponse =>
+     533            0 :       engine.onSessionAuthResponse;
+     534              : 
+     535            0 :   @override
+     536              :   Event<SessionAuthRequest> get onSessionAuthRequest =>
+     537            0 :       engine.onSessionAuthRequest;
+     538              : 
+     539            0 :   @override
+     540              :   Future<AuthRequestResponse> requestAuth({
+     541              :     required AuthRequestParams params,
+     542              :     String? pairingTopic,
+     543              :     List<List<String>>? methods = SignEngine.DEFAULT_METHODS_AUTH,
+     544              :   }) {
+     545              :     try {
+     546            0 :       return engine.requestAuth(
+     547              :         params: params,
+     548              :         pairingTopic: pairingTopic,
+     549              :         methods: methods,
+     550              :       );
+     551              :     } catch (e) {
+     552              :       rethrow;
+     553              :     }
+     554              :   }
+     555              : 
+     556              :   // NEW ONE-CLICK AUTH METHOD FOR DAPPS
+     557            0 :   @override
+     558              :   Future<SessionAuthRequestResponse> authenticate({
+     559              :     required SessionAuthRequestParams params,
+     560              :     String? pairingTopic,
+     561              :     List<List<String>>? methods = const [
+     562              :       [MethodConstants.WC_SESSION_AUTHENTICATE]
+     563              :     ],
+     564              :   }) {
+     565              :     try {
+     566            0 :       return engine.authenticate(
+     567              :         params: params,
+     568              :         pairingTopic: pairingTopic,
+     569              :         methods: methods,
+     570              :       );
+     571              :     } catch (e) {
+     572              :       rethrow;
+     573              :     }
+     574              :   }
+     575              : 
+     576            0 :   @override
+     577              :   Future<void> respondAuthRequest({
+     578              :     required int id,
+     579              :     required String iss,
+     580              :     CacaoSignature? signature,
+     581              :     WalletConnectError? error,
+     582              :   }) {
+     583              :     try {
+     584            0 :       return engine.respondAuthRequest(
+     585              :         id: id,
+     586              :         iss: iss,
+     587              :         signature: signature,
+     588              :         error: error,
+     589              :       );
+     590              :     } catch (e) {
+     591              :       rethrow;
+     592              :     }
+     593              :   }
+     594              : 
+     595            0 :   @override
+     596              :   Future<ApproveResponse> approveSessionAuthenticate({
+     597              :     required int id,
+     598              :     List<Cacao>? auths,
+     599              :   }) {
+     600              :     try {
+     601            0 :       return engine.approveSessionAuthenticate(
+     602              :         id: id,
+     603              :         auths: auths,
+     604              :       );
+     605              :     } catch (e) {
+     606              :       rethrow;
+     607              :     }
+     608              :   }
+     609              : 
+     610            0 :   @override
+     611              :   Future<void> rejectSessionAuthenticate({
+     612              :     required int id,
+     613              :     required WalletConnectError reason,
+     614              :   }) {
+     615              :     try {
+     616            0 :       return engine.rejectSessionAuthenticate(
+     617              :         id: id,
+     618              :         reason: reason,
+     619              :       );
+     620              :     } catch (e) {
+     621              :       rethrow;
+     622              :     }
+     623              :   }
+     624              : 
+     625            0 :   @override
+     626            0 :   IGenericStore<AuthPublicKey> get authKeys => engine.authKeys;
+     627              : 
+     628            0 :   @override
+     629            0 :   IGenericStore<StoredCacao> get completeRequests => engine.completeRequests;
+     630              : 
+     631            0 :   @override
+     632              :   Future<bool> validateSignedCacao({
+     633              :     required Cacao cacao,
+     634              :     required String projectId,
+     635              :   }) {
+     636              :     try {
+     637            0 :       return engine.validateSignedCacao(
+     638              :         cacao: cacao,
+     639              :         projectId: projectId,
+     640              :       );
+     641              :     } catch (e) {
+     642              :       rethrow;
+     643              :     }
+     644              :   }
+     645              : 
+     646            0 :   @override
+     647              :   String formatAuthMessage({
+     648              :     required String iss,
+     649              :     required CacaoRequestPayload cacaoPayload,
+     650              :   }) {
+     651              :     try {
+     652            0 :       return engine.formatAuthMessage(
+     653              :         iss: iss,
+     654              :         cacaoPayload: cacaoPayload,
+     655              :       );
+     656              :     } catch (e) {
+     657              :       rethrow;
+     658              :     }
+     659              :   }
+     660              : 
+     661            0 :   @override
+     662              :   Map<int, StoredCacao> getCompletedRequestsForPairing({
+     663              :     required String pairingTopic,
+     664              :   }) {
+     665              :     try {
+     666            0 :       return engine.getCompletedRequestsForPairing(
+     667              :         pairingTopic: pairingTopic,
+     668              :       );
+     669              :     } catch (e) {
+     670              :       rethrow;
+     671              :     }
+     672              :   }
+     673              : 
+     674            0 :   @override
+     675            0 :   IGenericStore<String> get pairingTopics => engine.pairingTopics;
+     676              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/sign_engine.dart.func-c.html b/coverage/html/sign_api/sign_engine.dart.func-c.html new file mode 100644 index 00000000..167029cc --- /dev/null +++ b/coverage/html/sign_api/sign_engine.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/sign_engine.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api - sign_engine.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:51.9 %1046543
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/sign_engine.dart.func.html b/coverage/html/sign_api/sign_engine.dart.func.html new file mode 100644 index 00000000..ae549c60 --- /dev/null +++ b/coverage/html/sign_api/sign_engine.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/sign_engine.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api - sign_engine.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:51.9 %1046543
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/sign_engine.dart.gcov.html b/coverage/html/sign_api/sign_engine.dart.gcov.html new file mode 100644 index 00000000..7dd10db8 --- /dev/null +++ b/coverage/html/sign_api/sign_engine.dart.gcov.html @@ -0,0 +1,2861 @@ + + + + + + + LCOV - lcov.info - sign_api/sign_engine.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api - sign_engine.dartCoverageTotalHit
Test:lcov.infoLines:51.9 %1046543
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:async';
+       2              : import 'dart:convert';
+       3              : import 'dart:math';
+       4              : 
+       5              : import 'package:http/http.dart' as http;
+       6              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/json_rpc_utils.dart';
+       7              : import 'package:walletconnect_flutter_v2/apis/core/store/i_generic_store.dart';
+       8              : import 'package:walletconnect_flutter_v2/apis/sign_api/i_sessions.dart';
+       9              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/custom_credentials.dart';
+      10              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/sign_api_validator_utils.dart';
+      11              : import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart';
+      12              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/auth/recaps_utils.dart';
+      13              : import 'package:walletconnect_flutter_v2/apis/core/crypto/crypto_models.dart';
+      14              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/auth/auth_constants.dart';
+      15              : 
+      16              : class SignEngine implements ISignEngine {
+      17              :   static const List<List<String>> DEFAULT_METHODS = [
+      18              :     [
+      19              :       MethodConstants.WC_SESSION_PROPOSE,
+      20              :       MethodConstants.WC_SESSION_REQUEST,
+      21              :     ],
+      22              :   ];
+      23              : 
+      24              :   static const List<List<String>> DEFAULT_METHODS_AUTH = [
+      25              :     [
+      26              :       MethodConstants.WC_AUTH_REQUEST,
+      27              :     ]
+      28              :   ];
+      29              : 
+      30              :   bool _initialized = false;
+      31              : 
+      32              :   @override
+      33              :   final Event<SessionConnect> onSessionConnect = Event<SessionConnect>();
+      34              :   @override
+      35              :   final Event<SessionProposalEvent> onSessionProposal =
+      36              :       Event<SessionProposalEvent>();
+      37              :   @override
+      38              :   final Event<SessionProposalErrorEvent> onSessionProposalError =
+      39              :       Event<SessionProposalErrorEvent>();
+      40              :   @override
+      41              :   final Event<SessionProposalEvent> onProposalExpire =
+      42              :       Event<SessionProposalEvent>();
+      43              :   @override
+      44              :   final Event<SessionUpdate> onSessionUpdate = Event<SessionUpdate>();
+      45              :   @override
+      46              :   final Event<SessionExtend> onSessionExtend = Event<SessionExtend>();
+      47              :   @override
+      48              :   final Event<SessionExpire> onSessionExpire = Event<SessionExpire>();
+      49              :   @override
+      50              :   final Event<SessionRequestEvent> onSessionRequest =
+      51              :       Event<SessionRequestEvent>();
+      52              :   @override
+      53              :   final Event<SessionEvent> onSessionEvent = Event<SessionEvent>();
+      54              :   @override
+      55              :   final Event<SessionPing> onSessionPing = Event<SessionPing>();
+      56              :   @override
+      57              :   final Event<SessionDelete> onSessionDelete = Event<SessionDelete>();
+      58              : 
+      59              :   @override
+      60              :   final ICore core;
+      61              :   @override
+      62              :   final PairingMetadata metadata;
+      63              :   @override
+      64              :   final IGenericStore<ProposalData> proposals;
+      65              :   @override
+      66              :   final ISessions sessions;
+      67              :   @override
+      68              :   final IGenericStore<SessionRequest> pendingRequests;
+      69              : 
+      70              :   List<SessionProposalCompleter> pendingProposals = [];
+      71              : 
+      72              :   // FORMER AUTH ENGINE PROPERTY
+      73              :   @override
+      74              :   late IGenericStore<AuthPublicKey> authKeys;
+      75              :   @override
+      76              :   late IGenericStore<PendingAuthRequest> authRequests;
+      77              :   @override
+      78              :   IGenericStore<StoredCacao> completeRequests;
+      79              :   @override
+      80              :   final Event<AuthRequest> onAuthRequest = Event<AuthRequest>();
+      81              :   @override
+      82              :   final Event<AuthResponse> onAuthResponse = Event<AuthResponse>();
+      83              :   @override
+      84              :   late IGenericStore<String> pairingTopics;
+      85              : 
+      86              :   // NEW 1-CA METHOD
+      87              :   @override
+      88              :   late IGenericStore<PendingSessionAuthRequest> sessionAuthRequests;
+      89              :   @override
+      90              :   final Event<SessionAuthRequest> onSessionAuthRequest =
+      91              :       Event<SessionAuthRequest>();
+      92              :   @override
+      93              :   final Event<SessionAuthResponse> onSessionAuthResponse =
+      94              :       Event<SessionAuthResponse>();
+      95              : 
+      96              :   // FORMER AUTH ENGINE PROPERTY (apparently not used before and not used now)
+      97              :   List<AuthRequestCompleter> pendingAuthRequests = [];
+      98              : 
+      99            5 :   SignEngine({
+     100              :     required this.core,
+     101              :     required this.metadata,
+     102              :     required this.proposals,
+     103              :     required this.sessions,
+     104              :     required this.pendingRequests,
+     105              :     // FORMER AUTH ENGINE PROPERTIES
+     106              :     required this.authKeys,
+     107              :     required this.pairingTopics,
+     108              :     required this.authRequests,
+     109              :     required this.completeRequests,
+     110              :     // NEW 1-CA PROPERTY
+     111              :     required this.sessionAuthRequests,
+     112              :   });
+     113              : 
+     114            5 :   @override
+     115              :   Future<void> init() async {
+     116            5 :     if (_initialized) {
+     117              :       return;
+     118              :     }
+     119              : 
+     120           15 :     await core.pairing.init();
+     121           25 :     await core.verify.init(verifyUrl: metadata.verifyUrl);
+     122           10 :     await proposals.init();
+     123           10 :     await sessions.init();
+     124           10 :     await pendingRequests.init();
+     125              : 
+     126              :     // FORMER AUTH ENGINE PROPERTIES
+     127           10 :     await authKeys.init();
+     128           10 :     await pairingTopics.init();
+     129           10 :     await authRequests.init();
+     130           10 :     await completeRequests.init();
+     131              :     // NEW 1-CA PROPERTY
+     132           10 :     await sessionAuthRequests.init();
+     133              : 
+     134            5 :     _registerInternalEvents();
+     135            5 :     _registerRelayClientFunctions();
+     136            5 :     await _cleanup();
+     137              : 
+     138            5 :     await _resubscribeAll();
+     139              : 
+     140            5 :     _initialized = true;
+     141              :   }
+     142              : 
+     143            5 :   @override
+     144              :   Future<void> checkAndExpire() async {
+     145           14 :     for (var session in sessions.getAll()) {
+     146           16 :       await core.expirer.checkAndExpire(session.topic);
+     147              :     }
+     148              :   }
+     149              : 
+     150            4 :   @override
+     151              :   Future<ConnectResponse> connect({
+     152              :     Map<String, RequiredNamespace>? requiredNamespaces,
+     153              :     Map<String, RequiredNamespace>? optionalNamespaces,
+     154              :     Map<String, String>? sessionProperties,
+     155              :     String? pairingTopic,
+     156              :     List<Relay>? relays,
+     157              :     List<List<String>>? methods = DEFAULT_METHODS,
+     158              :   }) async {
+     159            4 :     _checkInitialized();
+     160              : 
+     161            4 :     await _isValidConnect(
+     162            0 :       requiredNamespaces: requiredNamespaces ?? {},
+     163            4 :       optionalNamespaces: optionalNamespaces ?? {},
+     164              :       sessionProperties: sessionProperties,
+     165              :       pairingTopic: pairingTopic,
+     166              :       relays: relays,
+     167              :     );
+     168              :     String? pTopic = pairingTopic;
+     169              :     Uri? uri;
+     170              : 
+     171              :     if (pTopic == null) {
+     172           12 :       final CreateResponse newTopicAndUri = await core.pairing.create(
+     173              :         methods: methods,
+     174              :       );
+     175            4 :       pTopic = newTopicAndUri.topic;
+     176            4 :       uri = newTopicAndUri.uri;
+     177              :       // print('connect generated topic: $topic');
+     178              :     } else {
+     179           12 :       core.pairing.isValidPairingTopic(topic: pTopic);
+     180              :     }
+     181              : 
+     182           12 :     final publicKey = await core.crypto.generateKeyPair();
+     183            4 :     final int id = JsonRpcUtils.payloadId();
+     184              : 
+     185            4 :     final request = WcSessionProposeRequest(
+     186              :       relays:
+     187            8 :           relays ?? [Relay(WalletConnectConstants.RELAYER_DEFAULT_PROTOCOL)],
+     188            0 :       requiredNamespaces: requiredNamespaces ?? {},
+     189            4 :       optionalNamespaces: optionalNamespaces ?? {},
+     190            4 :       proposer: ConnectionMetadata(
+     191              :         publicKey: publicKey,
+     192            4 :         metadata: metadata,
+     193              :       ),
+     194              :       sessionProperties: sessionProperties,
+     195              :     );
+     196              : 
+     197            4 :     final expiry = WalletConnectUtils.calculateExpiry(
+     198              :       WalletConnectConstants.FIVE_MINUTES,
+     199              :     );
+     200            4 :     final ProposalData proposal = ProposalData(
+     201              :       id: id,
+     202              :       expiry: expiry,
+     203            4 :       relays: request.relays,
+     204            4 :       proposer: request.proposer,
+     205            4 :       requiredNamespaces: request.requiredNamespaces,
+     206            4 :       optionalNamespaces: request.optionalNamespaces ?? {},
+     207            4 :       sessionProperties: request.sessionProperties,
+     208              :       pairingTopic: pTopic,
+     209              :     );
+     210            4 :     await _setProposal(
+     211              :       id,
+     212              :       proposal,
+     213              :     );
+     214              : 
+     215            4 :     Completer<SessionData> completer = Completer();
+     216              : 
+     217            8 :     pendingProposals.add(
+     218            4 :       SessionProposalCompleter(
+     219              :         id: id,
+     220              :         selfPublicKey: publicKey,
+     221              :         pairingTopic: pTopic,
+     222            4 :         requiredNamespaces: request.requiredNamespaces,
+     223            4 :         optionalNamespaces: request.optionalNamespaces ?? {},
+     224            4 :         sessionProperties: request.sessionProperties,
+     225              :         completer: completer,
+     226              :       ),
+     227              :     );
+     228            4 :     _connectResponseHandler(
+     229              :       pTopic,
+     230              :       request,
+     231              :       id,
+     232              :     );
+     233              : 
+     234            4 :     final ConnectResponse resp = ConnectResponse(
+     235              :       pairingTopic: pTopic,
+     236              :       session: completer,
+     237              :       uri: uri,
+     238              :     );
+     239              : 
+     240              :     return resp;
+     241              :   }
+     242              : 
+     243            4 :   Future<void> _connectResponseHandler(
+     244              :     String topic,
+     245              :     WcSessionProposeRequest request,
+     246              :     int requestId,
+     247              :   ) async {
+     248              :     // print("sending proposal for $topic");
+     249              :     // print('connectResponseHandler requestId: $requestId');
+     250              :     try {
+     251           12 :       final Map<String, dynamic> response = await core.pairing.sendRequest(
+     252              :         topic,
+     253              :         MethodConstants.WC_SESSION_PROPOSE,
+     254            4 :         request.toJson(),
+     255              :         id: requestId,
+     256              :       );
+     257            4 :       final String peerPublicKey = response['responderPublicKey'];
+     258              : 
+     259            8 :       final ProposalData proposal = proposals.get(
+     260            4 :         requestId.toString(),
+     261              :       )!;
+     262           12 :       final String sessionTopic = await core.crypto.generateSharedKey(
+     263            8 :         proposal.proposer.publicKey,
+     264              :         peerPublicKey,
+     265              :       );
+     266              :       // print('connectResponseHandler session topic: $sessionTopic');
+     267              : 
+     268              :       // Delete the proposal, we are done with it
+     269            4 :       await _deleteProposal(requestId);
+     270              : 
+     271           12 :       await core.relayClient.subscribe(topic: sessionTopic);
+     272           12 :       await core.pairing.activate(topic: topic);
+     273              :     } catch (e) {
+     274              :       // Get the completer and finish it with an error
+     275           12 :       pendingProposals.removeLast().completer.completeError(e);
+     276              :     }
+     277              :   }
+     278              : 
+     279            4 :   @override
+     280              :   Future<PairingInfo> pair({
+     281              :     required Uri uri,
+     282              :   }) async {
+     283            4 :     _checkInitialized();
+     284              : 
+     285           12 :     return await core.pairing.pair(
+     286              :       uri: uri,
+     287              :     );
+     288              :   }
+     289              : 
+     290              :   /// Approves a proposal with the id provided in the parameters.
+     291              :   /// Assumes the proposal is already created.
+     292            4 :   @override
+     293              :   Future<ApproveResponse> approveSession({
+     294              :     required int id,
+     295              :     required Map<String, Namespace> namespaces,
+     296              :     Map<String, String>? sessionProperties,
+     297              :     String? relayProtocol,
+     298              :   }) async {
+     299              :     // print('sign approveSession');
+     300            4 :     _checkInitialized();
+     301              : 
+     302            4 :     await _isValidApprove(
+     303              :       id: id,
+     304              :       namespaces: namespaces,
+     305              :       sessionProperties: sessionProperties,
+     306              :       relayProtocol: relayProtocol,
+     307              :     );
+     308              : 
+     309            8 :     final ProposalData proposal = proposals.get(
+     310            4 :       id.toString(),
+     311              :     )!;
+     312              : 
+     313           12 :     final String selfPubKey = await core.crypto.generateKeyPair();
+     314            8 :     final String peerPubKey = proposal.proposer.publicKey;
+     315           12 :     final String sessionTopic = await core.crypto.generateSharedKey(
+     316              :       selfPubKey,
+     317              :       peerPubKey,
+     318              :     );
+     319              :     // print('approve session topic: $sessionTopic');
+     320              :     final protocol =
+     321              :         relayProtocol ?? WalletConnectConstants.RELAYER_DEFAULT_PROTOCOL;
+     322            4 :     final relay = Relay(protocol);
+     323              : 
+     324              :     // Respond to the proposal
+     325           12 :     await core.pairing.sendResult(
+     326              :       id,
+     327            4 :       proposal.pairingTopic,
+     328              :       MethodConstants.WC_SESSION_PROPOSE,
+     329            4 :       WcSessionProposeResponse(
+     330              :         relay: relay,
+     331              :         responderPublicKey: selfPubKey,
+     332              :       ),
+     333              :     );
+     334            4 :     await _deleteProposal(id);
+     335           16 :     await core.pairing.activate(topic: proposal.pairingTopic);
+     336              : 
+     337           12 :     await core.pairing.updateMetadata(
+     338            4 :       topic: proposal.pairingTopic,
+     339            8 :       metadata: proposal.proposer.metadata,
+     340              :     );
+     341              : 
+     342           12 :     await core.relayClient.subscribe(topic: sessionTopic);
+     343              : 
+     344            4 :     final int expiry = WalletConnectUtils.calculateExpiry(
+     345              :       WalletConnectConstants.SEVEN_DAYS,
+     346              :     );
+     347              : 
+     348            4 :     SessionData session = SessionData(
+     349              :       topic: sessionTopic,
+     350            4 :       pairingTopic: proposal.pairingTopic,
+     351              :       relay: relay,
+     352              :       expiry: expiry,
+     353              :       acknowledged: false,
+     354              :       controller: selfPubKey,
+     355              :       namespaces: namespaces,
+     356            4 :       self: ConnectionMetadata(
+     357              :         publicKey: selfPubKey,
+     358            4 :         metadata: metadata,
+     359              :       ),
+     360            4 :       peer: proposal.proposer,
+     361            4 :       sessionProperties: proposal.sessionProperties,
+     362              :     );
+     363              : 
+     364           12 :     onSessionConnect.broadcast(SessionConnect(session));
+     365              : 
+     366            8 :     await sessions.set(sessionTopic, session);
+     367            4 :     await _setSessionExpiry(sessionTopic, expiry);
+     368              : 
+     369              :     // `wc_sessionSettle` is not critical throughout the entire session.
+     370            8 :     bool acknowledged = await core.pairing
+     371            4 :         .sendRequest(
+     372              :           sessionTopic,
+     373              :           MethodConstants.WC_SESSION_SETTLE,
+     374            4 :           WcSessionSettleRequest(
+     375              :             relay: relay,
+     376              :             namespaces: namespaces,
+     377              :             sessionProperties: sessionProperties,
+     378              :             expiry: expiry,
+     379            4 :             controller: ConnectionMetadata(
+     380              :               publicKey: selfPubKey,
+     381            4 :               metadata: metadata,
+     382              :             ),
+     383              :           ),
+     384              :         )
+     385              :         // Sometimes we don't receive any response for a long time,
+     386              :         // in which case we manually time out to prevent waiting indefinitely.
+     387            4 :         .timeout(const Duration(seconds: 15))
+     388            4 :         .catchError(
+     389            0 :       (_) {
+     390              :         return false;
+     391              :       },
+     392              :     );
+     393              : 
+     394            8 :     session = session.copyWith(
+     395              :       acknowledged: acknowledged,
+     396              :     );
+     397              : 
+     398            8 :     if (acknowledged && sessions.has(sessionTopic)) {
+     399              :       // We directly update the latest value.
+     400            8 :       await sessions.set(
+     401              :         sessionTopic,
+     402              :         session,
+     403              :       );
+     404              :     }
+     405              : 
+     406            4 :     return ApproveResponse(
+     407              :       topic: sessionTopic,
+     408              :       session: session,
+     409              :     );
+     410              :   }
+     411              : 
+     412            3 :   @override
+     413              :   Future<void> rejectSession({
+     414              :     required int id,
+     415              :     required WalletConnectError reason,
+     416              :   }) async {
+     417            3 :     _checkInitialized();
+     418              : 
+     419            3 :     await _isValidReject(id, reason);
+     420              : 
+     421            9 :     ProposalData? proposal = proposals.get(id.toString());
+     422              :     if (proposal != null) {
+     423              :       // Attempt to send a response, if the pairing is not active, this will fail
+     424              :       // but we don't care
+     425              :       try {
+     426              :         final method = MethodConstants.WC_SESSION_PROPOSE;
+     427            3 :         final rpcOpts = MethodConstants.RPC_OPTS[method];
+     428            9 :         await core.pairing.sendError(
+     429              :           id,
+     430            3 :           proposal.pairingTopic,
+     431              :           method,
+     432            9 :           JsonRpcError(code: reason.code, message: reason.message),
+     433            3 :           rpcOptions: rpcOpts?['reject'],
+     434              :         );
+     435              :       } catch (_) {
+     436              :         // print('got here');
+     437              :       }
+     438              :     }
+     439            3 :     await _deleteProposal(id);
+     440              :   }
+     441              : 
+     442            3 :   @override
+     443              :   Future<void> updateSession({
+     444              :     required String topic,
+     445              :     required Map<String, Namespace> namespaces,
+     446              :   }) async {
+     447            3 :     _checkInitialized();
+     448            3 :     await _isValidUpdate(
+     449              :       topic,
+     450              :       namespaces,
+     451              :     );
+     452              : 
+     453            6 :     await sessions.update(
+     454              :       topic,
+     455              :       namespaces: namespaces,
+     456              :     );
+     457              : 
+     458            9 :     await core.pairing.sendRequest(
+     459              :       topic,
+     460              :       MethodConstants.WC_SESSION_UPDATE,
+     461            3 :       WcSessionUpdateRequest(namespaces: namespaces),
+     462              :     );
+     463              :   }
+     464              : 
+     465            3 :   @override
+     466              :   Future<void> extendSession({
+     467              :     required String topic,
+     468              :   }) async {
+     469            3 :     _checkInitialized();
+     470            3 :     await _isValidSessionTopic(topic);
+     471              : 
+     472            9 :     await core.pairing.sendRequest(
+     473              :       topic,
+     474              :       MethodConstants.WC_SESSION_EXTEND,
+     475            3 :       {},
+     476              :     );
+     477              : 
+     478            3 :     await _setSessionExpiry(
+     479              :       topic,
+     480            3 :       WalletConnectUtils.calculateExpiry(
+     481              :         WalletConnectConstants.SEVEN_DAYS,
+     482              :       ),
+     483              :     );
+     484              :   }
+     485              : 
+     486              :   /// Maps a request using chainId:method to its handler
+     487              :   final Map<String, dynamic Function(String, dynamic)?> _methodHandlers = {};
+     488              : 
+     489            3 :   @override
+     490              :   void registerRequestHandler({
+     491              :     required String chainId,
+     492              :     required String method,
+     493              :     dynamic Function(String, dynamic)? handler,
+     494              :   }) {
+     495            9 :     _methodHandlers[_getRegisterKey(chainId, method)] = handler;
+     496              :   }
+     497              : 
+     498            3 :   @override
+     499              :   Future request({
+     500              :     required String topic,
+     501              :     required String chainId,
+     502              :     required SessionRequestParams request,
+     503              :   }) async {
+     504            3 :     _checkInitialized();
+     505            3 :     await _isValidRequest(
+     506              :       topic,
+     507              :       chainId,
+     508              :       request,
+     509              :     );
+     510            9 :     return await core.pairing.sendRequest(
+     511              :       topic,
+     512              :       MethodConstants.WC_SESSION_REQUEST,
+     513            3 :       WcSessionRequestRequest(
+     514              :         chainId: chainId,
+     515              :         request: request,
+     516              :       ),
+     517              :     );
+     518              :   }
+     519              : 
+     520            0 :   @override
+     521              :   Future<List<dynamic>> requestReadContract({
+     522              :     required DeployedContract deployedContract,
+     523              :     required String functionName,
+     524              :     required String rpcUrl,
+     525              :     EthereumAddress? sender,
+     526              :     List<dynamic> parameters = const [],
+     527              :   }) async {
+     528              :     try {
+     529            0 :       final results = await Web3Client(rpcUrl, http.Client()).call(
+     530              :         sender: sender,
+     531              :         contract: deployedContract,
+     532            0 :         function: deployedContract.function(functionName),
+     533              :         params: parameters,
+     534              :       );
+     535              : 
+     536              :       return results;
+     537              :     } catch (e) {
+     538              :       rethrow;
+     539              :     }
+     540              :   }
+     541              : 
+     542            0 :   @override
+     543              :   Future<dynamic> requestWriteContract({
+     544              :     required String topic,
+     545              :     required String chainId,
+     546              :     required String rpcUrl,
+     547              :     required DeployedContract deployedContract,
+     548              :     required String functionName,
+     549              :     required Transaction transaction,
+     550              :     String? method,
+     551              :     List<dynamic> parameters = const [],
+     552              :   }) async {
+     553            0 :     if (transaction.from == null) {
+     554            0 :       throw Exception('Transaction must include `from` value');
+     555              :     }
+     556            0 :     final credentials = CustomCredentials(
+     557              :       signEngine: this,
+     558              :       topic: topic,
+     559              :       chainId: chainId,
+     560            0 :       address: transaction.from!,
+     561              :       method: method,
+     562              :     );
+     563            0 :     final trx = Transaction.callContract(
+     564              :       contract: deployedContract,
+     565            0 :       function: deployedContract.function(functionName),
+     566            0 :       from: credentials.address,
+     567            0 :       value: transaction.value,
+     568            0 :       maxGas: transaction.maxGas,
+     569            0 :       gasPrice: transaction.gasPrice,
+     570            0 :       nonce: transaction.nonce,
+     571            0 :       maxFeePerGas: transaction.maxFeePerGas,
+     572            0 :       maxPriorityFeePerGas: transaction.maxPriorityFeePerGas,
+     573              :       parameters: parameters,
+     574              :     );
+     575              : 
+     576            0 :     if (chainId.contains(':')) {
+     577            0 :       chainId = chainId.split(':').last;
+     578              :     }
+     579            0 :     return await Web3Client(rpcUrl, http.Client()).sendTransaction(
+     580              :       credentials,
+     581              :       trx,
+     582            0 :       chainId: int.parse(chainId),
+     583              :     );
+     584              :   }
+     585              : 
+     586            3 :   @override
+     587              :   Future<void> respondSessionRequest({
+     588              :     required String topic,
+     589              :     required JsonRpcResponse response,
+     590              :   }) async {
+     591            3 :     _checkInitialized();
+     592            3 :     await _isValidResponse(topic, response);
+     593              : 
+     594              :     // final SessionRequest req = pendingRequests.get(response.id.toString())!;
+     595              :     // print('respondSessionRequest: ${req.toJson()}');
+     596            3 :     if (response.result != null) {
+     597            9 :       await core.pairing.sendResult(
+     598            3 :         response.id,
+     599              :         topic,
+     600              :         MethodConstants.WC_SESSION_REQUEST,
+     601            3 :         response.result,
+     602              :       );
+     603              :     } else {
+     604            9 :       await core.pairing.sendError(
+     605            3 :         response.id,
+     606              :         topic,
+     607              :         MethodConstants.WC_SESSION_REQUEST,
+     608            3 :         response.error!,
+     609              :       );
+     610              :     }
+     611              : 
+     612            6 :     await _deletePendingRequest(response.id);
+     613              :   }
+     614              : 
+     615              :   /// Maps a request using chainId:event to its handler
+     616              :   final Map<String, dynamic Function(String, dynamic)?> _eventHandlers = {};
+     617              : 
+     618            3 :   @override
+     619              :   void registerEventHandler({
+     620              :     required String chainId,
+     621              :     required String event,
+     622              :     dynamic Function(String, dynamic)? handler,
+     623              :   }) {
+     624            3 :     _checkInitialized();
+     625            9 :     _eventHandlers[_getRegisterKey(chainId, event)] = handler;
+     626              :   }
+     627              : 
+     628            3 :   @override
+     629              :   Future<void> emitSessionEvent({
+     630              :     required String topic,
+     631              :     required String chainId,
+     632              :     required SessionEventParams event,
+     633              :   }) async {
+     634            3 :     _checkInitialized();
+     635            3 :     await _isValidEmit(
+     636              :       topic,
+     637              :       event,
+     638              :       chainId,
+     639              :     );
+     640            9 :     await core.pairing.sendRequest(
+     641              :       topic,
+     642              :       MethodConstants.WC_SESSION_EVENT,
+     643            3 :       WcSessionEventRequest(
+     644              :         chainId: chainId,
+     645              :         event: event,
+     646              :       ),
+     647              :     );
+     648              :   }
+     649              : 
+     650            3 :   @override
+     651              :   Future<void> ping({
+     652              :     required String topic,
+     653              :   }) async {
+     654            3 :     _checkInitialized();
+     655            3 :     await _isValidPing(topic);
+     656              : 
+     657            6 :     if (sessions.has(topic)) {
+     658            9 :       bool _ = await core.pairing.sendRequest(
+     659              :         topic,
+     660              :         MethodConstants.WC_SESSION_PING,
+     661            3 :         {},
+     662              :       );
+     663           12 :     } else if (core.pairing.getStore().has(topic)) {
+     664            9 :       await core.pairing.ping(topic: topic);
+     665              :     }
+     666              :   }
+     667              : 
+     668            3 :   @override
+     669              :   Future<void> disconnectSession({
+     670              :     required String topic,
+     671              :     required WalletConnectError reason,
+     672              :   }) async {
+     673            3 :     _checkInitialized();
+     674              :     try {
+     675            3 :       await _isValidDisconnect(topic);
+     676              : 
+     677            6 :       if (sessions.has(topic)) {
+     678              :         // Send the request to delete the session, we don't care if it fails
+     679              :         try {
+     680            9 :           core.pairing.sendRequest(
+     681              :             topic,
+     682              :             MethodConstants.WC_SESSION_DELETE,
+     683            3 :             WcSessionDeleteRequest(
+     684            3 :               code: reason.code,
+     685            3 :               message: reason.message,
+     686            3 :               data: reason.data,
+     687              :             ),
+     688              :           );
+     689              :         } catch (_) {}
+     690              : 
+     691            3 :         await _deleteSession(topic);
+     692              :       } else {
+     693            9 :         await core.pairing.disconnect(topic: topic);
+     694              :       }
+     695            0 :     } on WalletConnectError catch (error, s) {
+     696            0 :       core.logger.e(
+     697            0 :         '[$runtimeType] disconnectSession()',
+     698              :         error: error,
+     699              :         stackTrace: s,
+     700              :       );
+     701              :     }
+     702              :   }
+     703              : 
+     704            3 :   @override
+     705              :   SessionData? find({
+     706              :     required Map<String, RequiredNamespace> requiredNamespaces,
+     707              :   }) {
+     708            3 :     _checkInitialized();
+     709           12 :     final compatible = sessions.getAll().where((element) {
+     710            3 :       return SignApiValidatorUtils.isSessionCompatible(
+     711              :         session: element,
+     712              :         requiredNamespaces: requiredNamespaces,
+     713              :       );
+     714              :     });
+     715              : 
+     716            6 :     return compatible.isNotEmpty ? compatible.first : null;
+     717              :   }
+     718              : 
+     719            4 :   @override
+     720              :   Map<String, SessionData> getActiveSessions() {
+     721            4 :     _checkInitialized();
+     722              : 
+     723            4 :     Map<String, SessionData> activeSessions = {};
+     724           16 :     sessions.getAll().forEach((session) {
+     725            8 :       activeSessions[session.topic] = session;
+     726              :     });
+     727              : 
+     728              :     return activeSessions;
+     729              :   }
+     730              : 
+     731            3 :   @override
+     732              :   Map<String, SessionData> getSessionsForPairing({
+     733              :     required String pairingTopic,
+     734              :   }) {
+     735            3 :     _checkInitialized();
+     736              : 
+     737            3 :     Map<String, SessionData> pairingSessions = {};
+     738            3 :     sessions
+     739            3 :         .getAll()
+     740           12 :         .where((session) => session.pairingTopic == pairingTopic)
+     741            6 :         .forEach((session) {
+     742            6 :       pairingSessions[session.topic] = session;
+     743              :     });
+     744              : 
+     745              :     return pairingSessions;
+     746              :   }
+     747              : 
+     748            4 :   @override
+     749              :   Map<String, ProposalData> getPendingSessionProposals() {
+     750            4 :     _checkInitialized();
+     751              : 
+     752            4 :     Map<String, ProposalData> pendingProposals = {};
+     753           16 :     proposals.getAll().forEach((proposal) {
+     754           12 :       pendingProposals[proposal.id.toString()] = proposal;
+     755              :     });
+     756              : 
+     757              :     return pendingProposals;
+     758              :   }
+     759              : 
+     760            3 :   @override
+     761              :   Map<String, SessionRequest> getPendingSessionRequests() {
+     762            3 :     _checkInitialized();
+     763              : 
+     764            3 :     Map<String, SessionRequest> requests = {};
+     765           12 :     pendingRequests.getAll().forEach((r) {
+     766            9 :       requests[r.id.toString()] = r;
+     767              :     });
+     768              : 
+     769              :     return requests;
+     770              :   }
+     771              : 
+     772            1 :   @override
+     773            3 :   IPairingStore get pairings => core.pairing.getStore();
+     774              : 
+     775              :   final Set<String> _eventEmitters = {};
+     776              :   final Set<String> _accounts = {};
+     777              : 
+     778            3 :   @override
+     779              :   void registerEventEmitter({
+     780              :     required String chainId,
+     781              :     required String event,
+     782              :   }) {
+     783            3 :     final bool isChainId = NamespaceUtils.isValidChainId(chainId);
+     784              :     if (!isChainId) {
+     785            3 :       throw Errors.getSdkError(
+     786              :         Errors.UNSUPPORTED_CHAINS,
+     787              :         context:
+     788            3 :             'registerEventEmitter, chain $chainId should conform to "namespace:chainId" format',
+     789              :       );
+     790              :     }
+     791            3 :     final String value = _getRegisterKey(chainId, event);
+     792            3 :     SignApiValidatorUtils.isValidAccounts(
+     793            3 :       accounts: [value],
+     794              :       context: 'registerEventEmitter',
+     795              :     );
+     796            6 :     _eventEmitters.add(value);
+     797              :   }
+     798              : 
+     799            3 :   @override
+     800              :   void registerAccount({
+     801              :     required String chainId,
+     802              :     required String accountAddress,
+     803              :   }) {
+     804            3 :     final bool isChainId = NamespaceUtils.isValidChainId(chainId);
+     805              :     if (!isChainId) {
+     806            3 :       throw Errors.getSdkError(
+     807              :         Errors.UNSUPPORTED_CHAINS,
+     808              :         context:
+     809            3 :             'registerAccount, chain $chainId should conform to "namespace:chainId" format',
+     810              :       );
+     811              :     }
+     812            3 :     final String value = _getRegisterKey(chainId, accountAddress);
+     813            3 :     SignApiValidatorUtils.isValidAccounts(
+     814            3 :       accounts: [value],
+     815              :       context: 'registerAccount',
+     816              :     );
+     817            6 :     _accounts.add(value);
+     818              :   }
+     819              : 
+     820              :   /// ---- PRIVATE HELPERS ---- ////
+     821              : 
+     822            5 :   Future<void> _resubscribeAll() async {
+     823              :     // If the relay is not connected, stop here
+     824           15 :     if (!core.relayClient.isConnected) {
+     825              :       return;
+     826              :     }
+     827              : 
+     828              :     // Subscribe to all the sessions
+     829           10 :     for (final SessionData session in sessions.getAll()) {
+     830              :       // print('Session: subscribing to ${session.topic}');
+     831            0 :       await core.relayClient.subscribe(topic: session.topic);
+     832              :     }
+     833              :   }
+     834              : 
+     835            4 :   void _checkInitialized() {
+     836            4 :     if (!_initialized) {
+     837            0 :       throw Errors.getInternalError(Errors.NOT_INITIALIZED);
+     838              :     }
+     839              :   }
+     840              : 
+     841            3 :   String _getRegisterKey(String chainId, String value) {
+     842            3 :     return '$chainId:$value';
+     843              :   }
+     844              : 
+     845            3 :   Future<void> _deleteSession(
+     846              :     String topic, {
+     847              :     bool expirerHasDeleted = false,
+     848              :   }) async {
+     849              :     // print('deleting session: $topic, expirerHasDeleted: $expirerHasDeleted');
+     850            6 :     final SessionData? session = sessions.get(topic);
+     851              :     if (session == null) {
+     852              :       return;
+     853              :     }
+     854            9 :     await core.relayClient.unsubscribe(topic: topic);
+     855              : 
+     856            6 :     await sessions.delete(topic);
+     857           15 :     await core.crypto.deleteKeyPair(session.self.publicKey);
+     858            9 :     await core.crypto.deleteSymKey(topic);
+     859              :     if (expirerHasDeleted) {
+     860            9 :       await core.expirer.delete(topic);
+     861              :     }
+     862              : 
+     863            6 :     onSessionDelete.broadcast(
+     864            3 :       SessionDelete(
+     865              :         topic,
+     866              :       ),
+     867              :     );
+     868              :   }
+     869              : 
+     870            4 :   Future<void> _deleteProposal(
+     871              :     int id, {
+     872              :     bool expirerHasDeleted = false,
+     873              :   }) async {
+     874           12 :     await proposals.delete(id.toString());
+     875              :     if (expirerHasDeleted) {
+     876           12 :       await core.expirer.delete(id.toString());
+     877              :     }
+     878              :   }
+     879              : 
+     880            3 :   Future<void> _deletePendingRequest(
+     881              :     int id, {
+     882              :     bool expirerHasDeleted = false,
+     883              :   }) async {
+     884            9 :     await pendingRequests.delete(id.toString());
+     885              :     if (expirerHasDeleted) {
+     886            0 :       await core.expirer.delete(id.toString());
+     887              :     }
+     888              :   }
+     889              : 
+     890            4 :   Future<void> _setSessionExpiry(String topic, int expiry) async {
+     891            8 :     if (sessions.has(topic)) {
+     892            8 :       await sessions.update(
+     893              :         topic,
+     894              :         expiry: expiry,
+     895              :       );
+     896              :     }
+     897           12 :     await core.expirer.set(topic, expiry);
+     898              :   }
+     899              : 
+     900            4 :   Future<void> _setProposal(int id, ProposalData proposal) async {
+     901           12 :     await proposals.set(id.toString(), proposal);
+     902           20 :     core.expirer.set(id.toString(), proposal.expiry);
+     903              :   }
+     904              : 
+     905            3 :   Future<void> _setPendingRequest(int id, SessionRequest request) async {
+     906            6 :     await pendingRequests.set(
+     907            3 :       id.toString(),
+     908              :       request,
+     909              :     );
+     910            9 :     core.expirer.set(
+     911            3 :       id.toString(),
+     912            3 :       WalletConnectUtils.calculateExpiry(
+     913              :         WalletConnectConstants.FIVE_MINUTES,
+     914              :       ),
+     915              :     );
+     916              :   }
+     917              : 
+     918            5 :   Future<void> _cleanup() async {
+     919            5 :     final List<String> sessionTopics = [];
+     920            5 :     final List<int> proposalIds = [];
+     921              : 
+     922           10 :     for (final SessionData session in sessions.getAll()) {
+     923            0 :       if (WalletConnectUtils.isExpired(session.expiry)) {
+     924            0 :         sessionTopics.add(session.topic);
+     925              :       }
+     926              :     }
+     927           10 :     for (final ProposalData proposal in proposals.getAll()) {
+     928            0 :       if (WalletConnectUtils.isExpired(proposal.expiry)) {
+     929            0 :         proposalIds.add(proposal.id);
+     930              :       }
+     931              :     }
+     932              : 
+     933            5 :     sessionTopics.map((topic) async {
+     934              :       // print('deleting expired session $topic');
+     935            0 :       await _deleteSession(topic);
+     936              :     });
+     937            5 :     proposalIds.map((id) async => await _deleteProposal(id));
+     938              :   }
+     939              : 
+     940              :   /// ---- Relay Events ---- ///
+     941              : 
+     942            5 :   void _registerRelayClientFunctions() {
+     943           15 :     core.pairing.register(
+     944              :       method: MethodConstants.WC_SESSION_PROPOSE,
+     945            5 :       function: _onSessionProposeRequest,
+     946              :       type: ProtocolType.sign,
+     947              :     );
+     948           15 :     core.pairing.register(
+     949              :       method: MethodConstants.WC_SESSION_SETTLE,
+     950            5 :       function: _onSessionSettleRequest,
+     951              :       type: ProtocolType.sign,
+     952              :     );
+     953           15 :     core.pairing.register(
+     954              :       method: MethodConstants.WC_SESSION_UPDATE,
+     955            5 :       function: _onSessionUpdateRequest,
+     956              :       type: ProtocolType.sign,
+     957              :     );
+     958           15 :     core.pairing.register(
+     959              :       method: MethodConstants.WC_SESSION_EXTEND,
+     960            5 :       function: _onSessionExtendRequest,
+     961              :       type: ProtocolType.sign,
+     962              :     );
+     963           15 :     core.pairing.register(
+     964              :       method: MethodConstants.WC_SESSION_PING,
+     965            5 :       function: _onSessionPingRequest,
+     966              :       type: ProtocolType.sign,
+     967              :     );
+     968           15 :     core.pairing.register(
+     969              :       method: MethodConstants.WC_SESSION_DELETE,
+     970            5 :       function: _onSessionDeleteRequest,
+     971              :       type: ProtocolType.sign,
+     972              :     );
+     973           15 :     core.pairing.register(
+     974              :       method: MethodConstants.WC_SESSION_REQUEST,
+     975            5 :       function: _onSessionRequest,
+     976              :       type: ProtocolType.sign,
+     977              :     );
+     978           15 :     core.pairing.register(
+     979              :       method: MethodConstants.WC_SESSION_EVENT,
+     980            5 :       function: _onSessionEventRequest,
+     981              :       type: ProtocolType.sign,
+     982              :     );
+     983              :     // FORMER AUTH ENGINE PROPERTY
+     984           15 :     core.pairing.register(
+     985              :       method: MethodConstants.WC_AUTH_REQUEST,
+     986            5 :       function: _onAuthRequest,
+     987              :       type: ProtocolType.sign,
+     988              :     );
+     989           15 :     core.pairing.register(
+     990              :       method: MethodConstants.WC_SESSION_AUTHENTICATE,
+     991            5 :       function: _onSessionAuthRequest,
+     992              :       type: ProtocolType.sign,
+     993              :     );
+     994              :   }
+     995              : 
+     996            4 :   bool _shouldIgnoreSessionPropose(String topic) {
+     997           12 :     final PairingInfo? pairingInfo = core.pairing.getPairing(topic: topic);
+     998           12 :     final implementSessionAuth = onSessionAuthRequest.subscriberCount > 0;
+     999              :     final method = MethodConstants.WC_SESSION_AUTHENTICATE;
+    1000            8 :     final containsMethod = (pairingInfo?.methods ?? []).contains(method);
+    1001              : 
+    1002              :     return implementSessionAuth && containsMethod;
+    1003              :   }
+    1004              : 
+    1005            4 :   Future<void> _onSessionProposeRequest(
+    1006              :     String topic,
+    1007              :     JsonRpcRequest payload,
+    1008              :   ) async {
+    1009            4 :     if (_shouldIgnoreSessionPropose(topic)) {
+    1010            0 :       core.logger.t(
+    1011              :         'Session Propose ignored. Session Authenticate will be used instead',
+    1012              :       );
+    1013              :       return;
+    1014              :     }
+    1015              :     try {
+    1016           12 :       core.logger.t(
+    1017            4 :         '_onSessionProposeRequest, topic: $topic, payload: $payload',
+    1018              :       );
+    1019            8 :       final proposeRequest = WcSessionProposeRequest.fromJson(payload.params);
+    1020            4 :       await _isValidConnect(
+    1021            4 :         requiredNamespaces: proposeRequest.requiredNamespaces,
+    1022            4 :         optionalNamespaces: proposeRequest.optionalNamespaces,
+    1023            4 :         sessionProperties: proposeRequest.sessionProperties,
+    1024              :         pairingTopic: topic,
+    1025            4 :         relays: proposeRequest.relays,
+    1026              :       );
+    1027              : 
+    1028              :       // If there are accounts and event emitters, then handle the Namespace generate automatically
+    1029              :       Map<String, Namespace>? namespaces;
+    1030           16 :       if (_accounts.isNotEmpty || _eventEmitters.isNotEmpty) {
+    1031            3 :         namespaces = NamespaceUtils.constructNamespaces(
+    1032            3 :           availableAccounts: _accounts,
+    1033            9 :           availableMethods: _methodHandlers.keys.toSet(),
+    1034            3 :           availableEvents: _eventEmitters,
+    1035            3 :           requiredNamespaces: proposeRequest.requiredNamespaces,
+    1036            3 :           optionalNamespaces: proposeRequest.optionalNamespaces,
+    1037              :         );
+    1038              : 
+    1039              :         // Check that the namespaces are conforming
+    1040              :         try {
+    1041            3 :           SignApiValidatorUtils.isConformingNamespaces(
+    1042            3 :             requiredNamespaces: proposeRequest.requiredNamespaces,
+    1043              :             namespaces: namespaces,
+    1044              :             context: 'onSessionProposeRequest',
+    1045              :           );
+    1046            0 :         } on WalletConnectError catch (err) {
+    1047              :           // If they aren't, send an error
+    1048            0 :           core.logger.t(
+    1049            0 :             '_onSessionProposeRequest WalletConnectError: $err',
+    1050              :           );
+    1051            0 :           final rpcOpts = MethodConstants.RPC_OPTS[payload.method];
+    1052            0 :           await core.pairing.sendError(
+    1053            0 :             payload.id,
+    1054              :             topic,
+    1055            0 :             payload.method,
+    1056            0 :             JsonRpcError(code: err.code, message: err.message),
+    1057            0 :             rpcOptions: rpcOpts?['autoReject'],
+    1058              :           );
+    1059              : 
+    1060              :           // Broadcast that a session proposal error has occurred
+    1061            0 :           onSessionProposalError.broadcast(
+    1062            0 :             SessionProposalErrorEvent(
+    1063            0 :               payload.id,
+    1064            0 :               proposeRequest.requiredNamespaces,
+    1065              :               namespaces,
+    1066              :               err,
+    1067              :             ),
+    1068              :           );
+    1069              :           return;
+    1070              :         }
+    1071              :       }
+    1072              : 
+    1073            4 :       final expiry = WalletConnectUtils.calculateExpiry(
+    1074              :         WalletConnectConstants.FIVE_MINUTES,
+    1075              :       );
+    1076            4 :       final ProposalData proposal = ProposalData(
+    1077            4 :         id: payload.id,
+    1078              :         expiry: expiry,
+    1079            4 :         relays: proposeRequest.relays,
+    1080            4 :         proposer: proposeRequest.proposer,
+    1081            4 :         requiredNamespaces: proposeRequest.requiredNamespaces,
+    1082            4 :         optionalNamespaces: proposeRequest.optionalNamespaces ?? {},
+    1083            4 :         sessionProperties: proposeRequest.sessionProperties,
+    1084              :         pairingTopic: topic,
+    1085              :         generatedNamespaces: namespaces,
+    1086              :       );
+    1087              : 
+    1088            8 :       await _setProposal(payload.id, proposal);
+    1089              : 
+    1090            4 :       final verifyContext = await _getVerifyContext(
+    1091              :         payload,
+    1092            8 :         proposal.proposer.metadata,
+    1093              :       );
+    1094              : 
+    1095            8 :       onSessionProposal.broadcast(
+    1096            4 :         SessionProposalEvent(
+    1097            4 :           payload.id,
+    1098              :           proposal,
+    1099              :           verifyContext,
+    1100              :         ),
+    1101              :       );
+    1102            0 :     } on WalletConnectError catch (err) {
+    1103            0 :       core.logger.e('_onSessionProposeRequest Error: $err');
+    1104            0 :       final rpcOpts = MethodConstants.RPC_OPTS[payload.method];
+    1105            0 :       await core.pairing.sendError(
+    1106            0 :         payload.id,
+    1107              :         topic,
+    1108            0 :         payload.method,
+    1109            0 :         JsonRpcError(code: err.code, message: err.message),
+    1110            0 :         rpcOptions: rpcOpts?['autoReject'],
+    1111              :       );
+    1112              :     }
+    1113              :   }
+    1114              : 
+    1115            4 :   Future<void> _onSessionSettleRequest(
+    1116              :     String topic,
+    1117              :     JsonRpcRequest payload,
+    1118              :   ) async {
+    1119              :     // print('wc session settle');
+    1120            8 :     final request = WcSessionSettleRequest.fromJson(payload.params);
+    1121              :     try {
+    1122           12 :       await _isValidSessionSettleRequest(request.namespaces, request.expiry);
+    1123              : 
+    1124              :       final SessionProposalCompleter sProposalCompleter =
+    1125            8 :           pendingProposals.removeLast();
+    1126              :       // print(sProposalCompleter);
+    1127              : 
+    1128              :       // Create the session
+    1129            4 :       final SessionData session = SessionData(
+    1130              :         topic: topic,
+    1131            4 :         pairingTopic: sProposalCompleter.pairingTopic,
+    1132            4 :         relay: request.relay,
+    1133            4 :         expiry: request.expiry,
+    1134              :         acknowledged: true,
+    1135            8 :         controller: request.controller.publicKey,
+    1136            4 :         namespaces: request.namespaces,
+    1137            4 :         sessionProperties: request.sessionProperties,
+    1138            4 :         self: ConnectionMetadata(
+    1139            4 :           publicKey: sProposalCompleter.selfPublicKey,
+    1140            4 :           metadata: metadata,
+    1141              :         ),
+    1142            4 :         peer: request.controller,
+    1143              :       );
+    1144              : 
+    1145              :       // Update all the things: session, expiry, metadata, pairing
+    1146            8 :       sessions.set(topic, session);
+    1147            8 :       _setSessionExpiry(topic, session.expiry);
+    1148           12 :       await core.pairing.updateMetadata(
+    1149            4 :         topic: sProposalCompleter.pairingTopic,
+    1150            8 :         metadata: request.controller.metadata,
+    1151              :       );
+    1152           12 :       final pairing = core.pairing.getPairing(topic: topic);
+    1153            0 :       if (pairing != null && !pairing.active) {
+    1154            0 :         await core.pairing.activate(topic: topic);
+    1155              :       }
+    1156              : 
+    1157              :       // Send the session back to the completer
+    1158            8 :       sProposalCompleter.completer.complete(session);
+    1159              : 
+    1160              :       // Send back a success!
+    1161              :       // print('responding to session settle: acknolwedged');
+    1162           12 :       await core.pairing.sendResult(
+    1163            4 :         payload.id,
+    1164              :         topic,
+    1165              :         MethodConstants.WC_SESSION_SETTLE,
+    1166              :         true,
+    1167              :       );
+    1168            8 :       onSessionConnect.broadcast(
+    1169            4 :         SessionConnect(session),
+    1170              :       );
+    1171            0 :     } on WalletConnectError catch (err) {
+    1172            0 :       core.logger.e('_onSessionSettleRequest Error: $err');
+    1173            0 :       await core.pairing.sendError(
+    1174            0 :         payload.id,
+    1175              :         topic,
+    1176            0 :         payload.method,
+    1177            0 :         JsonRpcError.invalidParams(
+    1178            0 :           err.message,
+    1179              :         ),
+    1180              :       );
+    1181              :     }
+    1182              :   }
+    1183              : 
+    1184            3 :   Future<void> _onSessionUpdateRequest(
+    1185              :     String topic,
+    1186              :     JsonRpcRequest payload,
+    1187              :   ) async {
+    1188              :     try {
+    1189              :       // print(payload.params);
+    1190            6 :       final request = WcSessionUpdateRequest.fromJson(payload.params);
+    1191            6 :       await _isValidUpdate(topic, request.namespaces);
+    1192            6 :       await sessions.update(
+    1193              :         topic,
+    1194            3 :         namespaces: request.namespaces,
+    1195              :       );
+    1196            9 :       await core.pairing.sendResult(
+    1197            3 :         payload.id,
+    1198              :         topic,
+    1199              :         MethodConstants.WC_SESSION_UPDATE,
+    1200              :         true,
+    1201              :       );
+    1202            6 :       onSessionUpdate.broadcast(
+    1203            3 :         SessionUpdate(
+    1204            3 :           payload.id,
+    1205              :           topic,
+    1206            3 :           request.namespaces,
+    1207              :         ),
+    1208              :       );
+    1209            0 :     } on WalletConnectError catch (err) {
+    1210            0 :       core.logger.e('_onSessionUpdateRequest Error: $err');
+    1211            0 :       await core.pairing.sendError(
+    1212            0 :         payload.id,
+    1213              :         topic,
+    1214            0 :         payload.method,
+    1215            0 :         JsonRpcError.invalidParams(
+    1216            0 :           err.message,
+    1217              :         ),
+    1218              :       );
+    1219              :     }
+    1220              :   }
+    1221              : 
+    1222            3 :   Future<void> _onSessionExtendRequest(
+    1223              :     String topic,
+    1224              :     JsonRpcRequest payload,
+    1225              :   ) async {
+    1226              :     try {
+    1227            6 :       final _ = WcSessionExtendRequest.fromJson(payload.params);
+    1228            3 :       await _isValidSessionTopic(topic);
+    1229            3 :       await _setSessionExpiry(
+    1230              :         topic,
+    1231            3 :         WalletConnectUtils.calculateExpiry(
+    1232              :           WalletConnectConstants.SEVEN_DAYS,
+    1233              :         ),
+    1234              :       );
+    1235            9 :       await core.pairing.sendResult(
+    1236            3 :         payload.id,
+    1237              :         topic,
+    1238              :         MethodConstants.WC_SESSION_EXTEND,
+    1239              :         true,
+    1240              :       );
+    1241            6 :       onSessionExtend.broadcast(
+    1242            3 :         SessionExtend(
+    1243            3 :           payload.id,
+    1244              :           topic,
+    1245              :         ),
+    1246              :       );
+    1247            0 :     } on WalletConnectError catch (err) {
+    1248            0 :       await core.pairing.sendError(
+    1249            0 :         payload.id,
+    1250              :         topic,
+    1251            0 :         payload.method,
+    1252            0 :         JsonRpcError.invalidParams(
+    1253            0 :           err.message,
+    1254              :         ),
+    1255              :       );
+    1256              :     }
+    1257              :   }
+    1258              : 
+    1259            3 :   Future<void> _onSessionPingRequest(
+    1260              :     String topic,
+    1261              :     JsonRpcRequest payload,
+    1262              :   ) async {
+    1263              :     try {
+    1264            6 :       final _ = WcSessionPingRequest.fromJson(payload.params);
+    1265            3 :       await _isValidPing(topic);
+    1266            9 :       await core.pairing.sendResult(
+    1267            3 :         payload.id,
+    1268              :         topic,
+    1269              :         MethodConstants.WC_SESSION_PING,
+    1270              :         true,
+    1271              :       );
+    1272            6 :       onSessionPing.broadcast(
+    1273            3 :         SessionPing(
+    1274            3 :           payload.id,
+    1275              :           topic,
+    1276              :         ),
+    1277              :       );
+    1278            0 :     } on WalletConnectError catch (err) {
+    1279            0 :       await core.pairing.sendError(
+    1280            0 :         payload.id,
+    1281              :         topic,
+    1282            0 :         payload.method,
+    1283            0 :         JsonRpcError.invalidParams(
+    1284            0 :           err.message,
+    1285              :         ),
+    1286              :       );
+    1287              :     }
+    1288              :   }
+    1289              : 
+    1290            3 :   Future<void> _onSessionDeleteRequest(
+    1291              :     String topic,
+    1292              :     JsonRpcRequest payload,
+    1293              :   ) async {
+    1294              :     try {
+    1295            6 :       final _ = WcSessionDeleteRequest.fromJson(payload.params);
+    1296            3 :       await _isValidDisconnect(topic);
+    1297            9 :       await core.pairing.sendResult(
+    1298            3 :         payload.id,
+    1299              :         topic,
+    1300              :         MethodConstants.WC_SESSION_DELETE,
+    1301              :         true,
+    1302              :       );
+    1303            3 :       await _deleteSession(topic);
+    1304            0 :     } on WalletConnectError catch (err) {
+    1305            0 :       await core.pairing.sendError(
+    1306            0 :         payload.id,
+    1307              :         topic,
+    1308            0 :         payload.method,
+    1309            0 :         JsonRpcError.invalidParams(
+    1310            0 :           err.message,
+    1311              :         ),
+    1312              :       );
+    1313              :     }
+    1314              :   }
+    1315              : 
+    1316              :   /// Called when a session request is received
+    1317              :   /// Will attempt to find a handler for the request, if it doesn't,
+    1318              :   /// it will throw an error.
+    1319            3 :   Future<void> _onSessionRequest(String topic, JsonRpcRequest payload) async {
+    1320              :     try {
+    1321            6 :       final request = WcSessionRequestRequest.fromJson(payload.params);
+    1322            3 :       await _isValidRequest(
+    1323              :         topic,
+    1324            3 :         request.chainId,
+    1325            3 :         request.request,
+    1326              :       );
+    1327              : 
+    1328            6 :       final session = sessions.get(topic)!;
+    1329            3 :       final verifyContext = await _getVerifyContext(
+    1330              :         payload,
+    1331            6 :         session.peer.metadata,
+    1332              :       );
+    1333              : 
+    1334            3 :       final sessionRequest = SessionRequest(
+    1335            3 :         id: payload.id,
+    1336              :         topic: topic,
+    1337            6 :         method: request.request.method,
+    1338            3 :         chainId: request.chainId,
+    1339            6 :         params: request.request.params,
+    1340              :         verifyContext: verifyContext,
+    1341              :       );
+    1342              : 
+    1343              :       // print('payload id: ${payload.id}');
+    1344            3 :       await _setPendingRequest(
+    1345            3 :         payload.id,
+    1346              :         sessionRequest,
+    1347              :       );
+    1348              : 
+    1349            3 :       final methodKey = _getRegisterKey(
+    1350            3 :         request.chainId,
+    1351            6 :         request.request.method,
+    1352              :       );
+    1353            6 :       final handler = _methodHandlers[methodKey];
+    1354              :       // If a method handler has been set using registerRequestHandler we use it to process the request
+    1355              :       if (handler != null) {
+    1356              :         try {
+    1357            9 :           await handler(topic, request.request.params);
+    1358            0 :         } on WalletConnectError catch (e) {
+    1359            0 :           await core.pairing.sendError(
+    1360            0 :             payload.id,
+    1361              :             topic,
+    1362            0 :             payload.method,
+    1363            0 :             JsonRpcError.fromJson(
+    1364            0 :               e.toJson(),
+    1365              :             ),
+    1366              :           );
+    1367            0 :           await _deletePendingRequest(payload.id);
+    1368            0 :         } on WalletConnectErrorSilent catch (_) {
+    1369              :           // Do nothing on silent error
+    1370            0 :           await _deletePendingRequest(payload.id);
+    1371              :         } catch (err) {
+    1372            0 :           await core.pairing.sendError(
+    1373            0 :             payload.id,
+    1374              :             topic,
+    1375            0 :             payload.method,
+    1376            0 :             JsonRpcError.invalidParams(
+    1377            0 :               err.toString(),
+    1378              :             ),
+    1379              :           );
+    1380            0 :           await _deletePendingRequest(payload.id);
+    1381              :         }
+    1382              :       } else {
+    1383              :         // Otherwise we send onSessionRequest event
+    1384            6 :         onSessionRequest.broadcast(
+    1385            3 :           SessionRequestEvent.fromSessionRequest(
+    1386              :             sessionRequest,
+    1387              :           ),
+    1388              :         );
+    1389              :       }
+    1390            0 :     } on WalletConnectError catch (err) {
+    1391            0 :       await core.pairing.sendError(
+    1392            0 :         payload.id,
+    1393              :         topic,
+    1394            0 :         payload.method,
+    1395            0 :         JsonRpcError.invalidParams(
+    1396            0 :           err.message,
+    1397              :         ),
+    1398              :       );
+    1399              :     }
+    1400              :   }
+    1401              : 
+    1402            3 :   Future<void> _onSessionEventRequest(
+    1403              :     String topic,
+    1404              :     JsonRpcRequest payload,
+    1405              :   ) async {
+    1406              :     try {
+    1407            6 :       final request = WcSessionEventRequest.fromJson(payload.params);
+    1408            3 :       final SessionEventParams event = request.event;
+    1409            3 :       await _isValidEmit(
+    1410              :         topic,
+    1411              :         event,
+    1412            3 :         request.chainId,
+    1413              :       );
+    1414              : 
+    1415            3 :       final String eventKey = _getRegisterKey(
+    1416            3 :         request.chainId,
+    1417            6 :         request.event.name,
+    1418              :       );
+    1419            6 :       if (_eventHandlers.containsKey(eventKey)) {
+    1420            6 :         final handler = _methodHandlers[eventKey];
+    1421              :         if (handler != null) {
+    1422            0 :           final handler = _eventHandlers[eventKey]!;
+    1423              :           try {
+    1424            0 :             await handler(
+    1425              :               topic,
+    1426            0 :               event.data,
+    1427              :             );
+    1428              :           } catch (err) {
+    1429            0 :             await core.pairing.sendError(
+    1430            0 :               payload.id,
+    1431              :               topic,
+    1432            0 :               payload.method,
+    1433            0 :               JsonRpcError.invalidParams(
+    1434            0 :                 err.toString(),
+    1435              :               ),
+    1436              :             );
+    1437              :           }
+    1438              :         }
+    1439              : 
+    1440            9 :         await core.pairing.sendResult(
+    1441            3 :           payload.id,
+    1442              :           topic,
+    1443              :           MethodConstants.WC_SESSION_REQUEST,
+    1444              :           true,
+    1445              :         );
+    1446              : 
+    1447            6 :         onSessionEvent.broadcast(
+    1448            3 :           SessionEvent(
+    1449            3 :             payload.id,
+    1450              :             topic,
+    1451            3 :             event.name,
+    1452            3 :             request.chainId,
+    1453            3 :             event.data,
+    1454              :           ),
+    1455              :         );
+    1456              :       } else {
+    1457            9 :         await core.pairing.sendError(
+    1458            3 :           payload.id,
+    1459              :           topic,
+    1460            3 :           payload.method,
+    1461            3 :           JsonRpcError.methodNotFound(
+    1462            3 :             'No handler found for chainId:event -> $eventKey',
+    1463              :           ),
+    1464              :         );
+    1465              :       }
+    1466            0 :     } on WalletConnectError catch (err) {
+    1467            0 :       await core.pairing.sendError(
+    1468            0 :         payload.id,
+    1469              :         topic,
+    1470            0 :         payload.method,
+    1471            0 :         JsonRpcError.invalidParams(
+    1472            0 :           err.message,
+    1473              :         ),
+    1474              :       );
+    1475              :     }
+    1476              :   }
+    1477              : 
+    1478              :   /// ---- Event Registers ---- ///
+    1479              : 
+    1480            5 :   void _registerInternalEvents() {
+    1481           25 :     core.relayClient.onRelayClientConnect.subscribe(_onRelayConnect);
+    1482           25 :     core.expirer.onExpire.subscribe(_onExpired);
+    1483           25 :     core.pairing.onPairingDelete.subscribe(_onPairingDelete);
+    1484           25 :     core.pairing.onPairingExpire.subscribe(_onPairingDelete);
+    1485           25 :     core.heartbeat.onPulse.subscribe(_heartbeatSubscription);
+    1486              :   }
+    1487              : 
+    1488            0 :   Future<void> _onRelayConnect(EventArgs? args) async {
+    1489              :     // print('Session: relay connected');
+    1490            0 :     await _resubscribeAll();
+    1491              :   }
+    1492              : 
+    1493            3 :   Future<void> _onPairingDelete(PairingEvent? event) async {
+    1494              :     // Delete all the sessions associated with the pairing
+    1495              :     if (event == null) {
+    1496              :       return;
+    1497              :     }
+    1498              : 
+    1499              :     // Delete the proposals
+    1500            3 :     final List<ProposalData> proposalsToDelete = proposals
+    1501            3 :         .getAll()
+    1502           15 :         .where((proposal) => proposal.pairingTopic == event.topic)
+    1503            3 :         .toList();
+    1504              : 
+    1505            6 :     for (final proposal in proposalsToDelete) {
+    1506            3 :       await _deleteProposal(
+    1507            3 :         proposal.id,
+    1508              :       );
+    1509              :     }
+    1510              : 
+    1511              :     // Delete the sessions
+    1512            3 :     final List<SessionData> sessionsToDelete = sessions
+    1513            3 :         .getAll()
+    1514           15 :         .where((session) => session.pairingTopic == event.topic)
+    1515            3 :         .toList();
+    1516              : 
+    1517            6 :     for (final session in sessionsToDelete) {
+    1518            3 :       await _deleteSession(
+    1519            3 :         session.topic,
+    1520              :       );
+    1521              :     }
+    1522              :   }
+    1523              : 
+    1524            3 :   Future<void> _onExpired(ExpirationEvent? event) async {
+    1525              :     if (event == null) {
+    1526              :       return;
+    1527              :     }
+    1528              : 
+    1529            9 :     if (sessions.has(event.target)) {
+    1530            3 :       await _deleteSession(
+    1531            3 :         event.target,
+    1532              :         expirerHasDeleted: true,
+    1533              :       );
+    1534            6 :       onSessionExpire.broadcast(
+    1535            3 :         SessionExpire(
+    1536            3 :           event.target,
+    1537              :         ),
+    1538              :       );
+    1539            9 :     } else if (proposals.has(event.target)) {
+    1540            9 :       ProposalData proposal = proposals.get(event.target)!;
+    1541            3 :       await _deleteProposal(
+    1542            6 :         int.parse(event.target),
+    1543              :         expirerHasDeleted: true,
+    1544              :       );
+    1545            6 :       onProposalExpire.broadcast(
+    1546            3 :         SessionProposalEvent(
+    1547            6 :           int.parse(event.target),
+    1548              :           proposal,
+    1549              :         ),
+    1550              :       );
+    1551            0 :     } else if (pendingRequests.has(event.target)) {
+    1552            0 :       await _deletePendingRequest(
+    1553            0 :         int.parse(event.target),
+    1554              :         expirerHasDeleted: true,
+    1555              :       );
+    1556              :       return;
+    1557              :     }
+    1558              :   }
+    1559              : 
+    1560            5 :   void _heartbeatSubscription(EventArgs? args) async {
+    1561            5 :     await checkAndExpire();
+    1562              :   }
+    1563              : 
+    1564              :   /// ---- Validation Helpers ---- ///
+    1565              : 
+    1566            3 :   Future<bool> _isValidSessionTopic(String topic) async {
+    1567            6 :     if (!sessions.has(topic)) {
+    1568            3 :       throw Errors.getInternalError(
+    1569              :         Errors.NO_MATCHING_KEY,
+    1570            3 :         context: "session topic doesn't exist: $topic",
+    1571              :       );
+    1572              :     }
+    1573              : 
+    1574            9 :     if (await core.expirer.checkAndExpire(topic)) {
+    1575            3 :       throw Errors.getInternalError(
+    1576              :         Errors.EXPIRED,
+    1577            3 :         context: 'session topic: $topic',
+    1578              :       );
+    1579              :     }
+    1580              : 
+    1581              :     return true;
+    1582              :   }
+    1583              : 
+    1584            3 :   Future<bool> _isValidSessionOrPairingTopic(String topic) async {
+    1585            6 :     if (sessions.has(topic)) {
+    1586            3 :       await _isValidSessionTopic(topic);
+    1587           12 :     } else if (core.pairing.getStore().has(topic)) {
+    1588            9 :       await core.pairing.isValidPairingTopic(topic: topic);
+    1589              :     } else {
+    1590            3 :       throw Errors.getInternalError(
+    1591              :         Errors.NO_MATCHING_KEY,
+    1592            3 :         context: "session or pairing topic doesn't exist: $topic",
+    1593              :       );
+    1594              :     }
+    1595              : 
+    1596              :     return true;
+    1597              :   }
+    1598              : 
+    1599            4 :   Future<bool> _isValidProposalId(int id) async {
+    1600           12 :     if (!proposals.has(id.toString())) {
+    1601            3 :       throw Errors.getInternalError(
+    1602              :         Errors.NO_MATCHING_KEY,
+    1603            3 :         context: "proposal id doesn't exist: $id",
+    1604              :       );
+    1605              :     }
+    1606              : 
+    1607           16 :     if (await core.expirer.checkAndExpire(id.toString())) {
+    1608            3 :       throw Errors.getInternalError(
+    1609              :         Errors.EXPIRED,
+    1610            3 :         context: 'proposal id: $id',
+    1611              :       );
+    1612              :     }
+    1613              : 
+    1614              :     return true;
+    1615              :   }
+    1616              : 
+    1617            3 :   Future<bool> _isValidPendingRequest(int id) async {
+    1618            9 :     if (!pendingRequests.has(id.toString())) {
+    1619            0 :       throw Errors.getInternalError(
+    1620              :         Errors.NO_MATCHING_KEY,
+    1621            0 :         context: "proposal id doesn't exist: $id",
+    1622              :       );
+    1623              :     }
+    1624              : 
+    1625           12 :     if (await core.expirer.checkAndExpire(id.toString())) {
+    1626            0 :       throw Errors.getInternalError(
+    1627              :         Errors.EXPIRED,
+    1628            0 :         context: 'pending request id: $id',
+    1629              :       );
+    1630              :     }
+    1631              : 
+    1632              :     return true;
+    1633              :   }
+    1634              : 
+    1635              :   /// ---- Validations ---- ///
+    1636              : 
+    1637            4 :   Future<bool> _isValidConnect({
+    1638              :     Map<String, RequiredNamespace>? requiredNamespaces,
+    1639              :     Map<String, RequiredNamespace>? optionalNamespaces,
+    1640              :     Map<String, String>? sessionProperties,
+    1641              :     String? pairingTopic,
+    1642              :     List<Relay>? relays,
+    1643              :   }) async {
+    1644              :     // No need to validate sessionProperties. Strict typing enforces Strings are valid
+    1645              :     // No need to see if the relays are a valid array and whatnot. Strict typing enforces that.
+    1646              :     if (pairingTopic != null) {
+    1647           12 :       await core.pairing.isValidPairingTopic(
+    1648              :         topic: pairingTopic,
+    1649              :       );
+    1650              :     }
+    1651              : 
+    1652              :     if (requiredNamespaces != null) {
+    1653            4 :       SignApiValidatorUtils.isValidRequiredNamespaces(
+    1654              :         requiredNamespaces: requiredNamespaces,
+    1655              :         context: 'connect() check requiredNamespaces.',
+    1656              :       );
+    1657              :     }
+    1658              : 
+    1659              :     if (optionalNamespaces != null) {
+    1660            4 :       SignApiValidatorUtils.isValidRequiredNamespaces(
+    1661              :         requiredNamespaces: optionalNamespaces,
+    1662              :         context: 'connect() check optionalNamespaces.',
+    1663              :       );
+    1664              :     }
+    1665              : 
+    1666              :     return true;
+    1667              :   }
+    1668              : 
+    1669            4 :   Future<bool> _isValidApprove({
+    1670              :     required int id,
+    1671              :     required Map<String, Namespace> namespaces,
+    1672              :     Map<String, String>? sessionProperties,
+    1673              :     String? relayProtocol,
+    1674              :   }) async {
+    1675              :     // No need to validate sessionProperties. Strict typing enforces Strings are valid
+    1676            4 :     await _isValidProposalId(id);
+    1677           12 :     final ProposalData proposal = proposals.get(id.toString())!;
+    1678              : 
+    1679              :     // Validate the namespaces
+    1680            4 :     SignApiValidatorUtils.isValidNamespaces(
+    1681              :       namespaces: namespaces,
+    1682              :       context: 'approve()',
+    1683              :     );
+    1684              : 
+    1685              :     // Validate the required and optional namespaces
+    1686            4 :     SignApiValidatorUtils.isValidRequiredNamespaces(
+    1687            4 :       requiredNamespaces: proposal.requiredNamespaces,
+    1688              :       context: 'approve() check requiredNamespaces.',
+    1689              :     );
+    1690            4 :     SignApiValidatorUtils.isValidRequiredNamespaces(
+    1691            4 :       requiredNamespaces: proposal.optionalNamespaces,
+    1692              :       context: 'approve() check optionalNamespaces.',
+    1693              :     );
+    1694              : 
+    1695              :     // Make sure the provided namespaces conforms with the required
+    1696            4 :     SignApiValidatorUtils.isConformingNamespaces(
+    1697            4 :       requiredNamespaces: proposal.requiredNamespaces,
+    1698              :       namespaces: namespaces,
+    1699              :       context: 'approve()',
+    1700              :     );
+    1701              : 
+    1702              :     return true;
+    1703              :   }
+    1704              : 
+    1705            3 :   Future<bool> _isValidReject(int id, WalletConnectError reason) async {
+    1706              :     // No need to validate reason. Strict typing enforces ErrorResponse is valid
+    1707            3 :     await _isValidProposalId(id);
+    1708              :     return true;
+    1709              :   }
+    1710              : 
+    1711            4 :   Future<bool> _isValidSessionSettleRequest(
+    1712              :     Map<String, Namespace> namespaces,
+    1713              :     int expiry,
+    1714              :   ) async {
+    1715            4 :     SignApiValidatorUtils.isValidNamespaces(
+    1716              :       namespaces: namespaces,
+    1717              :       context: 'onSessionSettleRequest()',
+    1718              :     );
+    1719              : 
+    1720            4 :     if (WalletConnectUtils.isExpired(expiry)) {
+    1721            0 :       throw Errors.getInternalError(
+    1722              :         Errors.EXPIRED,
+    1723              :         context: 'onSessionSettleRequest()',
+    1724              :       );
+    1725              :     }
+    1726              : 
+    1727              :     return true;
+    1728              :   }
+    1729              : 
+    1730            3 :   Future<bool> _isValidUpdate(
+    1731              :     String topic,
+    1732              :     Map<String, Namespace> namespaces,
+    1733              :   ) async {
+    1734            3 :     await _isValidSessionTopic(topic);
+    1735            3 :     SignApiValidatorUtils.isValidNamespaces(
+    1736              :       namespaces: namespaces,
+    1737              :       context: 'update()',
+    1738              :     );
+    1739            6 :     final SessionData session = sessions.get(topic)!;
+    1740              : 
+    1741            3 :     SignApiValidatorUtils.isConformingNamespaces(
+    1742            6 :       requiredNamespaces: session.requiredNamespaces ?? {},
+    1743              :       namespaces: namespaces,
+    1744              :       context: 'update()',
+    1745              :     );
+    1746              : 
+    1747              :     return true;
+    1748              :   }
+    1749              : 
+    1750            3 :   Future<bool> _isValidRequest(
+    1751              :     String topic,
+    1752              :     String chainId,
+    1753              :     SessionRequestParams request,
+    1754              :   ) async {
+    1755            3 :     await _isValidSessionTopic(topic);
+    1756            6 :     final SessionData session = sessions.get(topic)!;
+    1757            3 :     SignApiValidatorUtils.isValidNamespacesChainId(
+    1758            3 :       namespaces: session.namespaces,
+    1759              :       chainId: chainId,
+    1760              :     );
+    1761            3 :     SignApiValidatorUtils.isValidNamespacesRequest(
+    1762            3 :       namespaces: session.namespaces,
+    1763              :       chainId: chainId,
+    1764            3 :       method: request.method,
+    1765              :     );
+    1766              : 
+    1767              :     return true;
+    1768              :   }
+    1769              : 
+    1770            3 :   Future<bool> _isValidResponse(
+    1771              :     String topic,
+    1772              :     JsonRpcResponse response,
+    1773              :   ) async {
+    1774            3 :     await _isValidSessionTopic(topic);
+    1775              : 
+    1776            6 :     if (response.result == null && response.error == null) {
+    1777            0 :       throw Errors.getInternalError(
+    1778              :         Errors.MISSING_OR_INVALID,
+    1779              :         context: 'JSON-RPC response and error cannot both be null',
+    1780              :       );
+    1781              :     }
+    1782              : 
+    1783            6 :     await _isValidPendingRequest(response.id);
+    1784              : 
+    1785              :     return true;
+    1786              :   }
+    1787              : 
+    1788            3 :   Future<bool> _isValidPing(
+    1789              :     String topic,
+    1790              :   ) async {
+    1791            3 :     await _isValidSessionOrPairingTopic(topic);
+    1792              : 
+    1793              :     return true;
+    1794              :   }
+    1795              : 
+    1796            3 :   Future<bool> _isValidEmit(
+    1797              :     String topic,
+    1798              :     SessionEventParams event,
+    1799              :     String chainId,
+    1800              :   ) async {
+    1801            3 :     await _isValidSessionTopic(topic);
+    1802            6 :     final SessionData session = sessions.get(topic)!;
+    1803            3 :     SignApiValidatorUtils.isValidNamespacesChainId(
+    1804            3 :       namespaces: session.namespaces,
+    1805              :       chainId: chainId,
+    1806              :     );
+    1807            3 :     SignApiValidatorUtils.isValidNamespacesEvent(
+    1808            3 :       namespaces: session.namespaces,
+    1809              :       chainId: chainId,
+    1810            3 :       eventName: event.name,
+    1811              :     );
+    1812              : 
+    1813              :     return true;
+    1814              :   }
+    1815              : 
+    1816            3 :   Future<bool> _isValidDisconnect(String topic) async {
+    1817            3 :     await _isValidSessionOrPairingTopic(topic);
+    1818              : 
+    1819              :     return true;
+    1820              :   }
+    1821              : 
+    1822            4 :   Future<VerifyContext> _getVerifyContext(
+    1823              :     JsonRpcRequest payload,
+    1824              :     PairingMetadata proposerMetada,
+    1825              :   ) async {
+    1826              :     try {
+    1827            8 :       final jsonStringify = jsonEncode(payload.toJson());
+    1828           16 :       final hash = core.crypto.getUtils().hashMessage(jsonStringify);
+    1829              : 
+    1830           12 :       final result = await core.verify.resolve(attestationId: hash);
+    1831            0 :       final validation = result?.origin == Uri.parse(proposerMetada.url).origin
+    1832              :           ? Validation.VALID
+    1833              :           : Validation.INVALID;
+    1834              : 
+    1835            0 :       return VerifyContext(
+    1836            0 :         origin: result?.origin ?? proposerMetada.url,
+    1837            0 :         verifyUrl: proposerMetada.verifyUrl ?? '',
+    1838            0 :         validation: result?.isScam == true ? Validation.SCAM : validation,
+    1839            0 :         isScam: result?.isScam,
+    1840              :       );
+    1841              :     } catch (e, s) {
+    1842            4 :       if (e is! AttestationNotFound) {
+    1843            0 :         core.logger.e('[$runtimeType] verify error', error: e, stackTrace: s);
+    1844              :       }
+    1845            4 :       return VerifyContext(
+    1846            4 :         origin: proposerMetada.url,
+    1847            4 :         verifyUrl: proposerMetada.verifyUrl ?? '',
+    1848              :         validation: Validation.UNKNOWN,
+    1849              :       );
+    1850              :     }
+    1851              :   }
+    1852              : 
+    1853              :   // NEW 1-CA METHOD (Should this be private?)
+    1854              : 
+    1855            0 :   @override
+    1856              :   Future<bool> validateSignedCacao({
+    1857              :     required Cacao cacao,
+    1858              :     required String projectId,
+    1859              :   }) async {
+    1860            0 :     final CacaoSignature signature = cacao.s;
+    1861            0 :     final CacaoPayload payload = cacao.p;
+    1862              : 
+    1863            0 :     final reconstructed = formatAuthMessage(
+    1864            0 :       iss: payload.iss,
+    1865            0 :       cacaoPayload: CacaoRequestPayload.fromCacaoPayload(payload),
+    1866              :     );
+    1867              : 
+    1868            0 :     final walletAddress = AddressUtils.getDidAddress(payload.iss);
+    1869            0 :     final chainId = AddressUtils.getDidChainId(payload.iss);
+    1870              : 
+    1871            0 :     final isValid = await AuthSignature.verifySignature(
+    1872              :       walletAddress,
+    1873              :       reconstructed,
+    1874              :       signature,
+    1875              :       chainId,
+    1876              :       projectId,
+    1877              :     );
+    1878              : 
+    1879              :     return isValid;
+    1880              :   }
+    1881              : 
+    1882              :   // FORMER AUTH ENGINE PROPERTY
+    1883            0 :   @override
+    1884              :   String formatAuthMessage({
+    1885              :     required String iss,
+    1886              :     required CacaoRequestPayload cacaoPayload,
+    1887              :   }) {
+    1888              :     final header =
+    1889            0 :         '${cacaoPayload.domain} wants you to sign in with your Ethereum account:';
+    1890            0 :     final walletAddress = AddressUtils.getDidAddress(iss);
+    1891              : 
+    1892            0 :     if (cacaoPayload.aud.isEmpty) {
+    1893            0 :       throw WalletConnectError(code: -1, message: 'aud is required');
+    1894              :     }
+    1895              : 
+    1896            0 :     String statement = cacaoPayload.statement ?? '';
+    1897            0 :     final uri = 'URI: ${cacaoPayload.aud}';
+    1898            0 :     final version = 'Version: ${cacaoPayload.version}';
+    1899            0 :     final chainId = 'Chain ID: ${AddressUtils.getDidChainId(iss)}';
+    1900            0 :     final nonce = 'Nonce: ${cacaoPayload.nonce}';
+    1901            0 :     final issuedAt = 'Issued At: ${cacaoPayload.iat}';
+    1902            0 :     final expirationTime = (cacaoPayload.exp != null)
+    1903            0 :         ? 'Expiration Time: ${cacaoPayload.exp}'
+    1904            0 :         : null;
+    1905              :     final notBefore =
+    1906            0 :         (cacaoPayload.nbf != null) ? 'Not Before: ${cacaoPayload.nbf}' : null;
+    1907            0 :     final requestId = (cacaoPayload.requestId != null)
+    1908            0 :         ? 'Request ID: ${cacaoPayload.requestId}'
+    1909            0 :         : null;
+    1910            0 :     final resources = cacaoPayload.resources != null &&
+    1911            0 :             cacaoPayload.resources!.isNotEmpty
+    1912            0 :         ? 'Resources:\n${cacaoPayload.resources!.map((resource) => '- $resource').join('\n')}'
+    1913            0 :         : null;
+    1914            0 :     final recap = ReCapsUtils.getRecapFromResources(
+    1915            0 :       resources: cacaoPayload.resources,
+    1916              :     );
+    1917              :     if (recap != null) {
+    1918            0 :       final decoded = ReCapsUtils.decodeRecap(recap);
+    1919            0 :       statement = ReCapsUtils.formatStatementFromRecap(
+    1920              :         statement: statement,
+    1921              :         recap: decoded,
+    1922              :       );
+    1923              :     }
+    1924              : 
+    1925            0 :     final message = [
+    1926              :       header,
+    1927              :       walletAddress,
+    1928              :       '',
+    1929              :       statement,
+    1930              :       '',
+    1931              :       uri,
+    1932              :       version,
+    1933              :       chainId,
+    1934              :       nonce,
+    1935              :       issuedAt,
+    1936              :       expirationTime,
+    1937              :       notBefore,
+    1938              :       requestId,
+    1939              :       resources,
+    1940            0 :     ].where((element) => element != null).join('\n');
+    1941              : 
+    1942              :     return message;
+    1943              :   }
+    1944              : 
+    1945              :   // FORMER AUTH ENGINE PROPERTY
+    1946            0 :   @override
+    1947              :   Map<int, StoredCacao> getCompletedRequestsForPairing({
+    1948              :     required String pairingTopic,
+    1949              :   }) {
+    1950            0 :     Map<int, StoredCacao> completedRequests = {};
+    1951            0 :     completeRequests
+    1952            0 :         .getAll()
+    1953            0 :         .where(
+    1954            0 :           (e) => e.pairingTopic == pairingTopic,
+    1955              :         )
+    1956            0 :         .forEach((key) {
+    1957            0 :       completedRequests[key.id] = key;
+    1958              :     });
+    1959              :     return completedRequests;
+    1960              :   }
+    1961              : 
+    1962              :   // FORMER AUTH ENGINE PROPERTY
+    1963            0 :   @override
+    1964              :   Map<int, PendingAuthRequest> getPendingAuthRequests() {
+    1965            0 :     Map<int, PendingAuthRequest> pendingRequests = {};
+    1966            0 :     authRequests.getAll().forEach((key) {
+    1967            0 :       pendingRequests[key.id] = key;
+    1968              :     });
+    1969              :     return pendingRequests;
+    1970              :   }
+    1971              : 
+    1972              :   // FORMER AUTH ENGINE PROPERTY
+    1973            0 :   @override
+    1974              :   Future<AuthRequestResponse> requestAuth({
+    1975              :     required AuthRequestParams params,
+    1976              :     String? pairingTopic,
+    1977              :     List<List<String>>? methods = DEFAULT_METHODS_AUTH,
+    1978              :   }) async {
+    1979            0 :     _checkInitialized();
+    1980              : 
+    1981            0 :     AuthApiValidators.isValidRequest(params);
+    1982              :     String? pTopic = pairingTopic;
+    1983              :     Uri? uri;
+    1984              : 
+    1985              :     if (pTopic == null) {
+    1986            0 :       final CreateResponse newTopicAndUri = await core.pairing.create(
+    1987              :         methods: methods,
+    1988              :       );
+    1989            0 :       pTopic = newTopicAndUri.topic;
+    1990            0 :       uri = newTopicAndUri.uri;
+    1991              :     } else {
+    1992              :       // TODO this should be used when pairingTopic is passed (existent pairing topic case)
+    1993              :       // but it does not seems right
+    1994            0 :       core.pairing.isValidPairingTopic(topic: pTopic);
+    1995              :     }
+    1996              : 
+    1997            0 :     final publicKey = await core.crypto.generateKeyPair();
+    1998              :     // print('requestAuth, publicKey: $publicKey');
+    1999            0 :     final String responseTopic = core.crypto.getUtils().hashKey(publicKey);
+    2000            0 :     final int id = JsonRpcUtils.payloadId();
+    2001              : 
+    2002            0 :     final request = WcAuthRequestRequest(
+    2003            0 :       payloadParams: AuthPayloadParams.fromRequestParams(
+    2004              :         params,
+    2005              :       ),
+    2006            0 :       requester: ConnectionMetadata(
+    2007              :         publicKey: publicKey,
+    2008            0 :         metadata: metadata,
+    2009              :       ),
+    2010              :     );
+    2011              : 
+    2012            0 :     final int expiry = params.expiry ?? WalletConnectConstants.FIVE_MINUTES;
+    2013              : 
+    2014            0 :     await authKeys.set(
+    2015              :       AuthConstants.AUTH_CLIENT_PUBLIC_KEY_NAME,
+    2016            0 :       AuthPublicKey(publicKey: publicKey),
+    2017              :     );
+    2018              : 
+    2019            0 :     await pairingTopics.set(
+    2020              :       responseTopic,
+    2021              :       pTopic,
+    2022              :     );
+    2023              : 
+    2024              :     // Set the one time use receiver public key for decoding the Type 1 envelope
+    2025            0 :     await core.pairing.setReceiverPublicKey(
+    2026              :       topic: responseTopic,
+    2027              :       publicKey: publicKey,
+    2028              :       expiry: expiry,
+    2029              :     );
+    2030              : 
+    2031            0 :     Completer<AuthResponse> completer = Completer();
+    2032              : 
+    2033            0 :     _requestAuthResponseHandler(
+    2034              :       pairingTopic: pTopic,
+    2035              :       responseTopic: responseTopic,
+    2036              :       request: request,
+    2037              :       id: id,
+    2038              :       expiry: expiry,
+    2039              :       completer: completer,
+    2040              :     );
+    2041              : 
+    2042            0 :     return AuthRequestResponse(
+    2043              :       id: id,
+    2044              :       pairingTopic: pTopic,
+    2045              :       completer: completer,
+    2046              :       uri: uri,
+    2047              :     );
+    2048              :   }
+    2049              : 
+    2050              :   // FORMER AUTH ENGINE PROPERTY
+    2051            0 :   Future<void> _requestAuthResponseHandler({
+    2052              :     required String pairingTopic,
+    2053              :     required String responseTopic,
+    2054              :     required WcAuthRequestRequest request,
+    2055              :     required int id,
+    2056              :     required int expiry,
+    2057              :     required Completer<AuthResponse> completer,
+    2058              :   }) async {
+    2059              :     // Subscribe to the responseTopic because we expect the response to use this topic
+    2060            0 :     await core.relayClient.subscribe(topic: responseTopic);
+    2061              : 
+    2062              :     late WcAuthRequestResult result;
+    2063              :     try {
+    2064            0 :       final Map<String, dynamic> response = await core.pairing.sendRequest(
+    2065              :         pairingTopic,
+    2066              :         MethodConstants.WC_AUTH_REQUEST,
+    2067            0 :         request.toJson(),
+    2068              :         id: id,
+    2069              :         ttl: expiry,
+    2070              :       );
+    2071            0 :       result = WcAuthRequestResult.fromJson({'cacao': response});
+    2072              :     } catch (error) {
+    2073            0 :       final response = AuthResponse(
+    2074              :         id: id,
+    2075              :         topic: responseTopic,
+    2076            0 :         jsonRpcError: (error is JsonRpcError) ? error : null,
+    2077            0 :         error: (error is! JsonRpcError)
+    2078            0 :             ? WalletConnectError(
+    2079            0 :                 code: -1,
+    2080            0 :                 message: error.toString(),
+    2081              :               )
+    2082              :             : null,
+    2083              :       );
+    2084            0 :       onAuthResponse.broadcast(response);
+    2085            0 :       completer.complete(response);
+    2086              :       return;
+    2087              :     }
+    2088              : 
+    2089            0 :     await core.pairing.activate(topic: pairingTopic);
+    2090              : 
+    2091            0 :     final Cacao cacao = result.cacao;
+    2092            0 :     await completeRequests.set(
+    2093            0 :       id.toString(),
+    2094            0 :       StoredCacao.fromCacao(
+    2095              :         id: id,
+    2096              :         pairingTopic: pairingTopic,
+    2097              :         cacao: cacao,
+    2098              :       ),
+    2099              :     );
+    2100              : 
+    2101            0 :     final isValid = await validateSignedCacao(
+    2102              :       cacao: cacao,
+    2103            0 :       projectId: core.projectId,
+    2104              :     );
+    2105              : 
+    2106              :     if (!isValid) {
+    2107            0 :       final resp = AuthResponse(
+    2108              :         id: id,
+    2109              :         topic: responseTopic,
+    2110              :         error: const WalletConnectError(
+    2111              :           code: -1,
+    2112              :           message: 'Invalid signature',
+    2113              :         ),
+    2114              :       );
+    2115            0 :       onAuthResponse.broadcast(resp);
+    2116            0 :       completer.complete(resp);
+    2117              :     } else {
+    2118            0 :       final resp = AuthResponse(
+    2119              :         id: id,
+    2120              :         topic: responseTopic,
+    2121              :         result: cacao,
+    2122              :       );
+    2123            0 :       onAuthResponse.broadcast(resp);
+    2124            0 :       completer.complete(resp);
+    2125              :     }
+    2126              :   }
+    2127              : 
+    2128              :   // NEW ONE-CLICK AUTH METHOD FOR DAPPS
+    2129            0 :   @override
+    2130              :   Map<int, PendingSessionAuthRequest> getPendingSessionAuthRequests() {
+    2131            0 :     Map<int, PendingSessionAuthRequest> pendingRequests = {};
+    2132            0 :     sessionAuthRequests.getAll().forEach((key) {
+    2133            0 :       pendingRequests[key.id] = key;
+    2134              :     });
+    2135              :     return pendingRequests;
+    2136              :   }
+    2137              : 
+    2138            0 :   @override
+    2139              :   Future<SessionAuthRequestResponse> authenticate({
+    2140              :     required SessionAuthRequestParams params,
+    2141              :     String? pairingTopic,
+    2142              :     List<List<String>>? methods = const [
+    2143              :       [MethodConstants.WC_SESSION_AUTHENTICATE]
+    2144              :     ],
+    2145              :   }) async {
+    2146            0 :     _checkInitialized();
+    2147              : 
+    2148            0 :     AuthApiValidators.isValidAuthenticate(params);
+    2149              : 
+    2150            0 :     final chains = params.chains;
+    2151            0 :     final resources = params.resources ?? [];
+    2152            0 :     final requestMethods = params.methods ?? [];
+    2153              : 
+    2154              :     String? pTopic = pairingTopic;
+    2155              :     Uri? connectionUri;
+    2156              : 
+    2157              :     if (pTopic == null) {
+    2158            0 :       final CreateResponse pairing = await core.pairing.create(
+    2159              :         methods: methods,
+    2160              :       );
+    2161            0 :       pTopic = pairing.topic;
+    2162            0 :       connectionUri = pairing.uri;
+    2163              :     } else {
+    2164            0 :       core.pairing.isValidPairingTopic(topic: pTopic);
+    2165              :     }
+    2166              : 
+    2167            0 :     final publicKey = await core.crypto.generateKeyPair();
+    2168            0 :     final responseTopic = core.crypto.getUtils().hashKey(publicKey);
+    2169              : 
+    2170            0 :     await Future.wait([
+    2171            0 :       authKeys.set(
+    2172              :         AuthConstants.OCAUTH_CLIENT_PUBLIC_KEY_NAME,
+    2173            0 :         AuthPublicKey(publicKey: publicKey),
+    2174              :       ),
+    2175            0 :       pairingTopics.set(responseTopic, pTopic),
+    2176              :     ]);
+    2177              : 
+    2178            0 :     if (requestMethods.isNotEmpty) {
+    2179            0 :       final namespace = NamespaceUtils.getNamespaceFromChain(chains.first);
+    2180            0 :       String recap = ReCapsUtils.createEncodedRecap(
+    2181              :         namespace,
+    2182              :         'request',
+    2183              :         requestMethods,
+    2184              :       );
+    2185            0 :       final existingRecap = ReCapsUtils.getRecapFromResources(
+    2186              :         resources: resources,
+    2187              :       );
+    2188              :       if (existingRecap != null) {
+    2189              :         // per Recaps spec, recap must occupy the last position in the resources array
+    2190              :         // using .removeLast() to remove the element given we already checked it's a recap and will replace it
+    2191            0 :         recap = ReCapsUtils.mergeEncodedRecaps(recap, resources.removeLast());
+    2192              :       }
+    2193            0 :       resources.add(recap);
+    2194              :     }
+    2195              : 
+    2196              :     // Subscribe to the responseTopic because we expect the response to use this topic
+    2197            0 :     await core.relayClient.subscribe(topic: responseTopic);
+    2198              : 
+    2199            0 :     final id = JsonRpcUtils.payloadId();
+    2200            0 :     final proposalId = JsonRpcUtils.payloadId();
+    2201              : 
+    2202              :     // Ensure the expiry is greater than the minimum required for the request - currently 1h
+    2203              :     final method = MethodConstants.WC_SESSION_AUTHENTICATE;
+    2204            0 :     final opts = MethodConstants.RPC_OPTS[method]!['req']!;
+    2205            0 :     final authRequestExpiry = max((params.expiry ?? 0), opts.ttl);
+    2206            0 :     final expiryTimestamp = DateTime.now().add(
+    2207            0 :       Duration(seconds: authRequestExpiry),
+    2208              :     );
+    2209              : 
+    2210            0 :     final request = WcSessionAuthRequestParams(
+    2211            0 :       authPayload: SessionAuthPayload.fromRequestParams(params).copyWith(
+    2212              :         resources: resources,
+    2213              :       ),
+    2214            0 :       requester: ConnectionMetadata(
+    2215              :         publicKey: publicKey,
+    2216            0 :         metadata: metadata,
+    2217              :       ),
+    2218            0 :       expiryTimestamp: expiryTimestamp.millisecondsSinceEpoch,
+    2219              :     );
+    2220              : 
+    2221              :     // Set the one time use receiver public key for decoding the Type 1 envelope
+    2222            0 :     await core.pairing.setReceiverPublicKey(
+    2223              :       topic: responseTopic,
+    2224              :       publicKey: publicKey,
+    2225              :       expiry: authRequestExpiry,
+    2226              :     );
+    2227              : 
+    2228            0 :     Completer<SessionAuthResponse> completer = Completer();
+    2229              : 
+    2230              :     // ----- build fallback session proposal request ----- //
+    2231              : 
+    2232              :     final fallbackMethod = MethodConstants.WC_SESSION_PROPOSE;
+    2233            0 :     final fallbackOpts = MethodConstants.RPC_OPTS[fallbackMethod]!['req']!;
+    2234            0 :     final fallbackExpiryTimestamp = DateTime.now().add(
+    2235            0 :       Duration(seconds: fallbackOpts.ttl),
+    2236              :     );
+    2237            0 :     final proposalData = ProposalData(
+    2238              :       id: proposalId,
+    2239            0 :       requiredNamespaces: {},
+    2240            0 :       optionalNamespaces: {
+    2241            0 :         'eip155': RequiredNamespace(
+    2242              :           chains: chains,
+    2243            0 :           methods: {'personal_sign', ...requestMethods}.toList(),
+    2244              :           events: EventsConstants.requiredEvents,
+    2245              :         ),
+    2246              :       },
+    2247            0 :       relays: [Relay(WalletConnectConstants.RELAYER_DEFAULT_PROTOCOL)],
+    2248            0 :       expiry: fallbackExpiryTimestamp.millisecondsSinceEpoch,
+    2249            0 :       proposer: ConnectionMetadata(
+    2250              :         publicKey: publicKey,
+    2251            0 :         metadata: metadata,
+    2252              :       ),
+    2253              :       pairingTopic: pTopic,
+    2254              :     );
+    2255            0 :     final proposeRequest = WcSessionProposeRequest(
+    2256            0 :       relays: proposalData.relays,
+    2257            0 :       requiredNamespaces: proposalData.requiredNamespaces,
+    2258            0 :       optionalNamespaces: proposalData.optionalNamespaces,
+    2259            0 :       proposer: proposalData.proposer,
+    2260              :     );
+    2261            0 :     await _setProposal(proposalData.id, proposalData);
+    2262              : 
+    2263            0 :     Completer<SessionData> completerFallback = Completer();
+    2264              : 
+    2265            0 :     pendingProposals.add(
+    2266            0 :       SessionProposalCompleter(
+    2267            0 :         id: proposalData.id,
+    2268            0 :         selfPublicKey: proposalData.proposer.publicKey,
+    2269            0 :         pairingTopic: proposalData.pairingTopic,
+    2270            0 :         requiredNamespaces: proposalData.requiredNamespaces,
+    2271            0 :         optionalNamespaces: proposalData.optionalNamespaces,
+    2272              :         completer: completerFallback,
+    2273              :       ),
+    2274              :     );
+    2275              : 
+    2276              :     // ------------------------------------------------------- //
+    2277              : 
+    2278              :     // Send One-Click Auth request
+    2279            0 :     _sessionAuthResponseHandler(
+    2280              :       id: id,
+    2281              :       publicKey: publicKey,
+    2282              :       pairingTopic: pTopic,
+    2283              :       responseTopic: responseTopic,
+    2284              :       request: request,
+    2285              :       expiry: authRequestExpiry,
+    2286              :       completer: completer,
+    2287              :     );
+    2288              : 
+    2289              :     // Send Session Proposal request
+    2290            0 :     _connectResponseHandler(
+    2291              :       pTopic,
+    2292              :       proposeRequest,
+    2293            0 :       proposalData.id,
+    2294              :     );
+    2295              : 
+    2296            0 :     return SessionAuthRequestResponse(
+    2297              :       id: id,
+    2298              :       pairingTopic: pTopic,
+    2299              :       completer: completer,
+    2300              :       uri: connectionUri,
+    2301              :     );
+    2302              :   }
+    2303              : 
+    2304            0 :   Future<void> _sessionAuthResponseHandler({
+    2305              :     required int id,
+    2306              :     required String publicKey,
+    2307              :     required String pairingTopic,
+    2308              :     required String responseTopic,
+    2309              :     required int expiry,
+    2310              :     required WcSessionAuthRequestParams request,
+    2311              :     required Completer<SessionAuthResponse> completer,
+    2312              :   }) async {
+    2313              :     //
+    2314              :     late WcSessionAuthRequestResult result;
+    2315              :     try {
+    2316            0 :       final Map<String, dynamic> response = await core.pairing.sendRequest(
+    2317              :         pairingTopic,
+    2318              :         MethodConstants.WC_SESSION_AUTHENTICATE,
+    2319            0 :         request.toJson(),
+    2320              :         id: id,
+    2321              :         ttl: expiry,
+    2322              :       );
+    2323            0 :       result = WcSessionAuthRequestResult.fromJson(response);
+    2324              :     } catch (error) {
+    2325            0 :       final response = SessionAuthResponse(
+    2326              :         id: id,
+    2327              :         topic: responseTopic,
+    2328            0 :         jsonRpcError: (error is JsonRpcError) ? error : null,
+    2329            0 :         error: (error is! JsonRpcError)
+    2330            0 :             ? WalletConnectError(
+    2331            0 :                 code: -1,
+    2332            0 :                 message: error.toString(),
+    2333              :               )
+    2334              :             : null,
+    2335              :       );
+    2336            0 :       onSessionAuthResponse.broadcast(response);
+    2337            0 :       completer.complete(response);
+    2338              :       return;
+    2339              :     }
+    2340              : 
+    2341            0 :     await core.pairing.activate(topic: pairingTopic);
+    2342              : 
+    2343            0 :     final List<Cacao> cacaos = result.cacaos;
+    2344            0 :     final ConnectionMetadata responder = result.responder;
+    2345              : 
+    2346              :     final approvedMethods = <String>{};
+    2347              :     final approvedAccounts = <String>{};
+    2348              : 
+    2349              :     try {
+    2350            0 :       for (final Cacao cacao in cacaos) {
+    2351            0 :         final isValid = await validateSignedCacao(
+    2352              :           cacao: cacao,
+    2353            0 :           projectId: core.projectId,
+    2354              :         );
+    2355              :         if (!isValid) {
+    2356            0 :           throw Errors.getSdkError(
+    2357              :             Errors.SIGNATURE_VERIFICATION_FAILED,
+    2358              :             context: 'Invalid signature',
+    2359              :           );
+    2360              :         }
+    2361              : 
+    2362              :         // This is used on Auth request, would it be needed on 1-CA?
+    2363              :         // await completeRequests.set(
+    2364              :         //   id.toString(),
+    2365              :         //   StoredCacao.fromCacao(
+    2366              :         //     id: id,
+    2367              :         //     pairingTopic: pairingTopic,
+    2368              :         //     cacao: cacao,
+    2369              :         //   ),
+    2370              :         // );
+    2371              : 
+    2372            0 :         final CacaoPayload payload = cacao.p;
+    2373            0 :         final chainId = AddressUtils.getDidChainId(payload.iss);
+    2374            0 :         final approvedChains = ['eip155:$chainId'];
+    2375              : 
+    2376            0 :         final recap = ReCapsUtils.getRecapFromResources(
+    2377            0 :           resources: payload.resources,
+    2378              :         );
+    2379              :         if (recap != null) {
+    2380            0 :           final methodsfromRecap = ReCapsUtils.getMethodsFromRecap(recap);
+    2381            0 :           final chainsFromRecap = ReCapsUtils.getChainsFromRecap(recap);
+    2382            0 :           approvedMethods.addAll(methodsfromRecap);
+    2383            0 :           approvedChains.addAll(chainsFromRecap);
+    2384              :         }
+    2385              : 
+    2386            0 :         final parsedAddress = AddressUtils.getDidAddress(payload.iss);
+    2387            0 :         for (var chain in approvedChains.toSet()) {
+    2388            0 :           approvedAccounts.add('$chain:$parsedAddress');
+    2389              :         }
+    2390              :       }
+    2391            0 :     } on WalletConnectError catch (e) {
+    2392            0 :       final resp = SessionAuthResponse(
+    2393              :         id: id,
+    2394              :         topic: responseTopic,
+    2395            0 :         error: WalletConnectError(
+    2396            0 :           code: e.code,
+    2397            0 :           message: e.message,
+    2398              :         ),
+    2399              :       );
+    2400            0 :       onSessionAuthResponse.broadcast(resp);
+    2401            0 :       completer.complete(resp);
+    2402              :       return;
+    2403              :     }
+    2404              : 
+    2405            0 :     final sessionTopic = await core.crypto.generateSharedKey(
+    2406              :       publicKey,
+    2407            0 :       responder.publicKey,
+    2408              :     );
+    2409              : 
+    2410              :     SessionData? session;
+    2411            0 :     if (approvedMethods.isNotEmpty) {
+    2412            0 :       session = SessionData(
+    2413              :         topic: sessionTopic,
+    2414              :         acknowledged: true,
+    2415            0 :         self: ConnectionMetadata(
+    2416              :           publicKey: publicKey,
+    2417            0 :           metadata: metadata,
+    2418              :         ),
+    2419              :         peer: responder,
+    2420              :         controller: publicKey,
+    2421            0 :         expiry: WalletConnectUtils.calculateExpiry(
+    2422              :           WalletConnectConstants.SEVEN_DAYS,
+    2423              :         ),
+    2424            0 :         relay: Relay(WalletConnectConstants.RELAYER_DEFAULT_PROTOCOL),
+    2425              :         pairingTopic: pairingTopic,
+    2426            0 :         namespaces: NamespaceUtils.buildNamespacesFromAuth(
+    2427              :           accounts: approvedAccounts,
+    2428              :           methods: approvedMethods,
+    2429              :         ),
+    2430              :       );
+    2431              : 
+    2432            0 :       await core.relayClient.subscribe(topic: sessionTopic);
+    2433            0 :       await sessions.set(sessionTopic, session);
+    2434              : 
+    2435            0 :       await core.pairing.updateMetadata(
+    2436              :         topic: pairingTopic,
+    2437            0 :         metadata: responder.metadata,
+    2438              :       );
+    2439              : 
+    2440            0 :       session = sessions.get(sessionTopic);
+    2441              :     }
+    2442              : 
+    2443            0 :     final resp = SessionAuthResponse(
+    2444              :       id: id,
+    2445              :       topic: responseTopic,
+    2446              :       auths: cacaos,
+    2447              :       session: session,
+    2448              :     );
+    2449            0 :     onSessionAuthResponse.broadcast(resp);
+    2450            0 :     completer.complete(resp);
+    2451              :   }
+    2452              : 
+    2453              :   // FORMER AUTH ENGINE PROPERTY
+    2454            0 :   @override
+    2455              :   Future<void> respondAuthRequest({
+    2456              :     required int id,
+    2457              :     required String iss,
+    2458              :     CacaoSignature? signature,
+    2459              :     WalletConnectError? error,
+    2460              :   }) async {
+    2461            0 :     _checkInitialized();
+    2462              : 
+    2463            0 :     Map<int, PendingAuthRequest> pendingRequests = getPendingAuthRequests();
+    2464            0 :     AuthApiValidators.isValidRespond(
+    2465              :       id: id,
+    2466              :       pendingRequests: pendingRequests,
+    2467              :       signature: signature,
+    2468              :       error: error,
+    2469              :     );
+    2470              : 
+    2471            0 :     final PendingAuthRequest pendingRequest = pendingRequests[id]!;
+    2472            0 :     final String receiverPublicKey = pendingRequest.metadata.publicKey;
+    2473            0 :     final String senderPublicKey = await core.crypto.generateKeyPair();
+    2474            0 :     final String responseTopic = core.crypto.getUtils().hashKey(
+    2475              :           receiverPublicKey,
+    2476              :         );
+    2477            0 :     final EncodeOptions encodeOpts = EncodeOptions(
+    2478              :       type: EncodeOptions.TYPE_1,
+    2479              :       receiverPublicKey: receiverPublicKey,
+    2480              :       senderPublicKey: senderPublicKey,
+    2481              :     );
+    2482              : 
+    2483              :     if (error != null) {
+    2484            0 :       await core.pairing.sendError(
+    2485              :         id,
+    2486              :         responseTopic,
+    2487              :         MethodConstants.WC_AUTH_REQUEST,
+    2488            0 :         JsonRpcError.serverError(error.message),
+    2489              :         encodeOptions: encodeOpts,
+    2490              :       );
+    2491              :     } else {
+    2492            0 :       final Cacao cacao = Cacao(
+    2493              :         h: const CacaoHeader(),
+    2494            0 :         p: CacaoPayload.fromRequestPayload(
+    2495              :           issuer: iss,
+    2496            0 :           payload: pendingRequest.cacaoPayload,
+    2497              :         ),
+    2498              :         s: signature!,
+    2499              :       );
+    2500              : 
+    2501              :       // print('auth res id: $id');
+    2502            0 :       await core.pairing.sendResult(
+    2503              :         id,
+    2504              :         responseTopic,
+    2505              :         MethodConstants.WC_AUTH_REQUEST,
+    2506            0 :         cacao.toJson(),
+    2507              :         encodeOptions: encodeOpts,
+    2508              :       );
+    2509              : 
+    2510            0 :       await authRequests.delete(id.toString());
+    2511              : 
+    2512            0 :       await completeRequests.set(
+    2513            0 :         id.toString(),
+    2514            0 :         StoredCacao.fromCacao(
+    2515              :           id: id,
+    2516            0 :           pairingTopic: pendingRequest.pairingTopic,
+    2517              :           cacao: cacao,
+    2518              :         ),
+    2519              :       );
+    2520              :     }
+    2521              :   }
+    2522              : 
+    2523            0 :   @override
+    2524              :   Future<ApproveResponse> approveSessionAuthenticate({
+    2525              :     required int id,
+    2526              :     List<Cacao>? auths,
+    2527              :   }) async {
+    2528            0 :     _checkInitialized();
+    2529              : 
+    2530            0 :     final pendingRequests = getPendingSessionAuthRequests();
+    2531              : 
+    2532            0 :     AuthApiValidators.isValidRespondAuthenticate(
+    2533              :       id: id,
+    2534              :       pendingRequests: pendingRequests,
+    2535              :       auths: auths,
+    2536              :     );
+    2537              : 
+    2538            0 :     final PendingSessionAuthRequest pendingRequest = pendingRequests[id]!;
+    2539            0 :     final receiverPublicKey = pendingRequest.requester.publicKey;
+    2540            0 :     final senderPublicKey = await core.crypto.generateKeyPair();
+    2541            0 :     final responseTopic = core.crypto.getUtils().hashKey(receiverPublicKey);
+    2542              : 
+    2543            0 :     final encodeOpts = EncodeOptions(
+    2544              :       type: EncodeOptions.TYPE_1,
+    2545              :       receiverPublicKey: receiverPublicKey,
+    2546              :       senderPublicKey: senderPublicKey,
+    2547              :     );
+    2548              : 
+    2549              :     final approvedMethods = <String>{};
+    2550              :     final approvedAccounts = <String>{};
+    2551            0 :     for (final Cacao cacao in auths!) {
+    2552            0 :       final isValid = await validateSignedCacao(
+    2553              :         cacao: cacao,
+    2554            0 :         projectId: core.projectId,
+    2555              :       );
+    2556              :       if (!isValid) {
+    2557            0 :         final error = Errors.getSdkError(
+    2558              :           Errors.SIGNATURE_VERIFICATION_FAILED,
+    2559              :           context: 'Signature verification failed',
+    2560              :         );
+    2561            0 :         await core.pairing.sendError(
+    2562              :           id,
+    2563              :           responseTopic,
+    2564              :           MethodConstants.WC_SESSION_AUTHENTICATE,
+    2565            0 :           JsonRpcError(code: error.code, message: error.message),
+    2566              :           encodeOptions: encodeOpts,
+    2567              :         );
+    2568              :         throw error;
+    2569              :       }
+    2570              : 
+    2571            0 :       final CacaoPayload payload = cacao.p;
+    2572            0 :       final chainId = AddressUtils.getDidChainId(payload.iss);
+    2573            0 :       final approvedChains = ['eip155:$chainId'];
+    2574              : 
+    2575            0 :       final recap = ReCapsUtils.getRecapFromResources(
+    2576            0 :         resources: payload.resources,
+    2577              :       );
+    2578              :       if (recap != null) {
+    2579            0 :         final methodsfromRecap = ReCapsUtils.getMethodsFromRecap(recap);
+    2580            0 :         final chainsFromRecap = ReCapsUtils.getChainsFromRecap(recap);
+    2581            0 :         approvedMethods.addAll(methodsfromRecap);
+    2582            0 :         approvedChains.addAll(chainsFromRecap);
+    2583              :       }
+    2584              : 
+    2585            0 :       final parsedAddress = AddressUtils.getDidAddress(payload.iss);
+    2586            0 :       for (var chain in approvedChains.toSet()) {
+    2587            0 :         approvedAccounts.add('$chain:$parsedAddress');
+    2588              :       }
+    2589              :     }
+    2590              : 
+    2591            0 :     final sessionTopic = await core.crypto.generateSharedKey(
+    2592              :       senderPublicKey,
+    2593              :       receiverPublicKey,
+    2594              :     );
+    2595              : 
+    2596              :     SessionData? session;
+    2597            0 :     if (approvedMethods.isNotEmpty) {
+    2598            0 :       session = SessionData(
+    2599              :         topic: sessionTopic,
+    2600              :         acknowledged: true,
+    2601            0 :         self: ConnectionMetadata(
+    2602              :           publicKey: senderPublicKey,
+    2603            0 :           metadata: metadata,
+    2604              :         ),
+    2605            0 :         peer: pendingRequest.requester,
+    2606              :         controller: receiverPublicKey,
+    2607            0 :         expiry: WalletConnectUtils.calculateExpiry(
+    2608              :           WalletConnectConstants.SEVEN_DAYS,
+    2609              :         ),
+    2610            0 :         relay: Relay(WalletConnectConstants.RELAYER_DEFAULT_PROTOCOL),
+    2611            0 :         pairingTopic: pendingRequest.pairingTopic,
+    2612            0 :         namespaces: NamespaceUtils.buildNamespacesFromAuth(
+    2613              :           accounts: approvedAccounts,
+    2614              :           methods: approvedMethods,
+    2615              :         ),
+    2616              :       );
+    2617              : 
+    2618            0 :       await core.relayClient.subscribe(topic: sessionTopic);
+    2619            0 :       await sessions.set(sessionTopic, session);
+    2620              : 
+    2621            0 :       session = sessions.get(sessionTopic);
+    2622              :     }
+    2623              : 
+    2624            0 :     final result = WcSessionAuthRequestResult(
+    2625              :       cacaos: auths,
+    2626            0 :       responder: ConnectionMetadata(
+    2627              :         publicKey: senderPublicKey,
+    2628            0 :         metadata: metadata,
+    2629              :       ),
+    2630              :     );
+    2631            0 :     await core.pairing.sendResult(
+    2632              :       id,
+    2633              :       responseTopic,
+    2634              :       MethodConstants.WC_SESSION_AUTHENTICATE,
+    2635            0 :       result.toJson(),
+    2636              :       encodeOptions: encodeOpts,
+    2637              :     );
+    2638              : 
+    2639            0 :     await sessionAuthRequests.delete(id.toString());
+    2640            0 :     await core.pairing.activate(topic: pendingRequest.pairingTopic);
+    2641            0 :     await core.pairing.updateMetadata(
+    2642            0 :       topic: pendingRequest.pairingTopic,
+    2643            0 :       metadata: pendingRequest.requester.metadata,
+    2644              :     );
+    2645              : 
+    2646            0 :     return ApproveResponse(
+    2647              :       topic: sessionTopic,
+    2648              :       session: session,
+    2649              :     );
+    2650              :   }
+    2651              : 
+    2652            0 :   @override
+    2653              :   Future<void> rejectSessionAuthenticate({
+    2654              :     required int id,
+    2655              :     required WalletConnectError reason,
+    2656              :   }) async {
+    2657            0 :     _checkInitialized();
+    2658              : 
+    2659            0 :     final pendingRequests = getPendingSessionAuthRequests();
+    2660              : 
+    2661            0 :     if (!pendingRequests.containsKey(id)) {
+    2662            0 :       throw Errors.getInternalError(
+    2663              :         Errors.MISSING_OR_INVALID,
+    2664              :         context:
+    2665            0 :             'rejectSessionAuthenticate() Could not find pending auth request with id $id',
+    2666              :       );
+    2667              :     }
+    2668              : 
+    2669            0 :     final PendingSessionAuthRequest pendingRequest = pendingRequests[id]!;
+    2670            0 :     final receiverPublicKey = pendingRequest.requester.publicKey;
+    2671            0 :     final senderPublicKey = await core.crypto.generateKeyPair();
+    2672            0 :     final responseTopic = core.crypto.getUtils().hashKey(receiverPublicKey);
+    2673              : 
+    2674            0 :     final encodeOpts = EncodeOptions(
+    2675              :       type: EncodeOptions.TYPE_1,
+    2676              :       receiverPublicKey: receiverPublicKey,
+    2677              :       senderPublicKey: senderPublicKey,
+    2678              :     );
+    2679              : 
+    2680              :     final method = MethodConstants.WC_SESSION_AUTHENTICATE;
+    2681            0 :     final rpcOpts = MethodConstants.RPC_OPTS[method];
+    2682            0 :     await core.pairing.sendError(
+    2683              :       id,
+    2684              :       responseTopic,
+    2685              :       method,
+    2686            0 :       JsonRpcError(code: reason.code, message: reason.message),
+    2687              :       encodeOptions: encodeOpts,
+    2688            0 :       rpcOptions: rpcOpts?['reject'],
+    2689              :     );
+    2690              : 
+    2691            0 :     await sessionAuthRequests.delete(id.toString());
+    2692            0 :     await _deleteProposal(id);
+    2693              :   }
+    2694              : 
+    2695              :   // FORMER AUTH ENGINE PROPERTY
+    2696            0 :   void _onAuthRequest(String topic, JsonRpcRequest payload) async {
+    2697              :     try {
+    2698            0 :       final request = WcAuthRequestRequest.fromJson(payload.params);
+    2699              : 
+    2700              :       final CacaoRequestPayload cacaoPayload =
+    2701            0 :           CacaoRequestPayload.fromPayloadParams(
+    2702            0 :         request.payloadParams,
+    2703              :       );
+    2704              : 
+    2705            0 :       authRequests.set(
+    2706            0 :         payload.id.toString(),
+    2707            0 :         PendingAuthRequest(
+    2708            0 :           id: payload.id,
+    2709              :           pairingTopic: topic,
+    2710            0 :           metadata: request.requester,
+    2711              :           cacaoPayload: cacaoPayload,
+    2712              :         ),
+    2713              :       );
+    2714              : 
+    2715            0 :       onAuthRequest.broadcast(
+    2716            0 :         AuthRequest(
+    2717            0 :           id: payload.id,
+    2718              :           topic: topic,
+    2719            0 :           requester: request.requester,
+    2720            0 :           payloadParams: request.payloadParams,
+    2721              :         ),
+    2722              :       );
+    2723            0 :     } on WalletConnectError catch (err) {
+    2724            0 :       await core.pairing.sendError(
+    2725            0 :         payload.id,
+    2726              :         topic,
+    2727            0 :         payload.method,
+    2728            0 :         JsonRpcError.invalidParams(
+    2729            0 :           err.message,
+    2730              :         ),
+    2731              :       );
+    2732              :     }
+    2733              :   }
+    2734              : 
+    2735            0 :   void _onSessionAuthRequest(String topic, JsonRpcRequest payload) async {
+    2736            0 :     core.logger.t('_onSessionAuthRequest, topic: $topic, payload: $payload');
+    2737              : 
+    2738            0 :     final sessionAuthRequest = WcSessionAuthRequestParams.fromJson(
+    2739            0 :       payload.params,
+    2740              :     );
+    2741              :     try {
+    2742            0 :       final cacaoPayload = CacaoRequestPayload.fromSessionAuthPayload(
+    2743            0 :         sessionAuthRequest.authPayload,
+    2744              :       );
+    2745              : 
+    2746            0 :       final verifyContext = await _getVerifyContext(payload, metadata);
+    2747              : 
+    2748            0 :       sessionAuthRequests.set(
+    2749            0 :         payload.id.toString(),
+    2750            0 :         PendingSessionAuthRequest(
+    2751            0 :           id: payload.id,
+    2752              :           pairingTopic: topic,
+    2753            0 :           requester: sessionAuthRequest.requester,
+    2754              :           authPayload: cacaoPayload,
+    2755            0 :           expiryTimestamp: sessionAuthRequest.expiryTimestamp,
+    2756              :           verifyContext: verifyContext,
+    2757              :         ),
+    2758              :       );
+    2759              : 
+    2760            0 :       onSessionAuthRequest.broadcast(
+    2761            0 :         SessionAuthRequest(
+    2762            0 :           id: payload.id,
+    2763              :           topic: topic,
+    2764            0 :           requester: sessionAuthRequest.requester,
+    2765            0 :           authPayload: sessionAuthRequest.authPayload,
+    2766              :           verifyContext: verifyContext,
+    2767              :         ),
+    2768              :       );
+    2769            0 :     } on WalletConnectError catch (err) {
+    2770            0 :       final receiverPublicKey = sessionAuthRequest.requester.publicKey;
+    2771            0 :       final senderPublicKey = await core.crypto.generateKeyPair();
+    2772              : 
+    2773            0 :       final encodeOpts = EncodeOptions(
+    2774              :         type: EncodeOptions.TYPE_1,
+    2775              :         receiverPublicKey: receiverPublicKey,
+    2776              :         senderPublicKey: senderPublicKey,
+    2777              :       );
+    2778            0 :       final rpcOpts = MethodConstants.RPC_OPTS[payload.method];
+    2779            0 :       await core.pairing.sendError(
+    2780            0 :         payload.id,
+    2781              :         topic,
+    2782            0 :         payload.method,
+    2783            0 :         JsonRpcError.invalidParams(err.message),
+    2784              :         encodeOptions: encodeOpts,
+    2785            0 :         rpcOptions: rpcOpts?['autoReject'],
+    2786              :       );
+    2787              :     }
+    2788              :   }
+    2789              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/auth/address_utils.dart.func-c.html b/coverage/html/sign_api/utils/auth/address_utils.dart.func-c.html new file mode 100644 index 00000000..ab48e819 --- /dev/null +++ b/coverage/html/sign_api/utils/auth/address_utils.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/auth/address_utils.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils/auth - address_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:66.7 %64
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/auth/address_utils.dart.func.html b/coverage/html/sign_api/utils/auth/address_utils.dart.func.html new file mode 100644 index 00000000..1e89e6e2 --- /dev/null +++ b/coverage/html/sign_api/utils/auth/address_utils.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/auth/address_utils.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils/auth - address_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:66.7 %64
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/auth/address_utils.dart.gcov.html b/coverage/html/sign_api/utils/auth/address_utils.dart.gcov.html new file mode 100644 index 00000000..c5e4f729 --- /dev/null +++ b/coverage/html/sign_api/utils/auth/address_utils.dart.gcov.html @@ -0,0 +1,85 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/auth/address_utils.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils/auth - address_utils.dartCoverageTotalHit
Test:lcov.infoLines:66.7 %64
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : class AddressUtils {
+       2            3 :   static String getDidAddress(String iss) {
+       3            6 :     return iss.split(':').last;
+       4              :   }
+       5              : 
+       6            3 :   static String getDidChainId(String iss) {
+       7            6 :     return iss.split(':')[3];
+       8              :   }
+       9              : 
+      10            0 :   static String getNamespaceDidChainId(String iss) {
+      11            0 :     return iss.substring(iss.indexOf(RegExp(r':')) + 1);
+      12              :   }
+      13              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/auth/auth_api_validators.dart.func-c.html b/coverage/html/sign_api/utils/auth/auth_api_validators.dart.func-c.html new file mode 100644 index 00000000..63277826 --- /dev/null +++ b/coverage/html/sign_api/utils/auth/auth_api_validators.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/auth/auth_api_validators.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils/auth - auth_api_validators.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:45.5 %4420
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/auth/auth_api_validators.dart.func.html b/coverage/html/sign_api/utils/auth/auth_api_validators.dart.func.html new file mode 100644 index 00000000..b3c2eaff --- /dev/null +++ b/coverage/html/sign_api/utils/auth/auth_api_validators.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/auth/auth_api_validators.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils/auth - auth_api_validators.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:45.5 %4420
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/auth/auth_api_validators.dart.gcov.html b/coverage/html/sign_api/utils/auth/auth_api_validators.dart.gcov.html new file mode 100644 index 00000000..486eb5bb --- /dev/null +++ b/coverage/html/sign_api/utils/auth/auth_api_validators.dart.gcov.html @@ -0,0 +1,218 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/auth/auth_api_validators.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils/auth - auth_api_validators.dartCoverageTotalHit
Test:lcov.infoLines:45.5 %4420
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/auth/auth_constants.dart';
+       2              : import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart';
+       3              : 
+       4              : class AuthApiValidators {
+       5            1 :   static bool isValidRequestExpiry(int expiry) {
+       6            1 :     return AuthConstants.AUTH_REQUEST_EXPIRY_MIN <= expiry &&
+       7            1 :         expiry <= AuthConstants.AUTH_REQUEST_EXPIRY_MAX;
+       8              :   }
+       9              : 
+      10            3 :   static bool isValidRequest(AuthRequestParams params) {
+      11            6 :     if (!NamespaceUtils.isValidUrl(params.aud)) {
+      12            2 :       throw Errors.getInternalError(
+      13              :         Errors.MISSING_OR_INVALID,
+      14              :         context:
+      15            4 :             'requestAuth() invalid aud: ${params.aud}. Must be a valid url.',
+      16              :       );
+      17              :     }
+      18              : 
+      19            6 :     if (params.nonce.isEmpty) {
+      20            1 :       throw Errors.getInternalError(
+      21              :         Errors.MISSING_OR_INVALID,
+      22              :         context: 'requestAuth() nonce must be nonempty.',
+      23              :       );
+      24              :     }
+      25              : 
+      26              :     // params.type == null || params.type == CacaoHeader.EIP4361
+      27            9 :     if (params.type != null && params.type != CacaoHeader.EIP4361) {
+      28            1 :       throw Errors.getInternalError(
+      29              :         Errors.MISSING_OR_INVALID,
+      30              :         context: 'requestAuth() type must null or ${CacaoHeader.EIP4361}.',
+      31              :       );
+      32              :     }
+      33              : 
+      34            3 :     final expiry = params.expiry;
+      35            1 :     if (expiry != null && !isValidRequestExpiry(expiry)) {
+      36            1 :       throw Errors.getInternalError(
+      37              :         Errors.MISSING_OR_INVALID,
+      38              :         context:
+      39            1 :             'requestAuth() expiry: $expiry. Expiry must be a number (in seconds) between ${AuthConstants.AUTH_REQUEST_EXPIRY_MIN} and ${AuthConstants.AUTH_REQUEST_EXPIRY_MAX}',
+      40              :       );
+      41              :     }
+      42              : 
+      43              :     return true;
+      44              :   }
+      45              : 
+      46            3 :   static bool isValidRespond({
+      47              :     required int id,
+      48              :     required Map<int, PendingAuthRequest> pendingRequests,
+      49              :     CacaoSignature? signature,
+      50              :     WalletConnectError? error,
+      51              :   }) {
+      52            3 :     if (!pendingRequests.containsKey(id)) {
+      53            2 :       throw Errors.getInternalError(
+      54              :         Errors.MISSING_OR_INVALID,
+      55            2 :         context: 'respondAuth() invalid id: $id. No pending request found.',
+      56              :       );
+      57              :     }
+      58              : 
+      59              :     if (signature == null && error == null) {
+      60            1 :       throw Errors.getInternalError(
+      61              :         Errors.MISSING_OR_INVALID,
+      62              :         context:
+      63              :             'respondAuth() invalid response. Must contain either signature or error.',
+      64              :       );
+      65              :     }
+      66              : 
+      67              :     return true;
+      68              :   }
+      69              : 
+      70            0 :   static bool isValidAuthenticate(SessionAuthRequestParams params) {
+      71            0 :     if (params.chains.isEmpty) {
+      72            0 :       throw Errors.getInternalError(
+      73              :         Errors.MISSING_OR_INVALID,
+      74              :         context: 'authenticate() invalid chains: Must not be emtpy.',
+      75              :       );
+      76              :     }
+      77              : 
+      78            0 :     if (!NamespaceUtils.isValidUrl(params.uri)) {
+      79            0 :       throw Errors.getInternalError(
+      80              :         Errors.MISSING_OR_INVALID,
+      81              :         context:
+      82            0 :             'authenticate() invalid uri: ${params.uri}. Must be a valid url.',
+      83              :       );
+      84              :     }
+      85              : 
+      86            0 :     if (params.nonce.isEmpty) {
+      87            0 :       throw Errors.getInternalError(
+      88              :         Errors.MISSING_OR_INVALID,
+      89              :         context: 'authenticate() nonce must be nonempty.',
+      90              :       );
+      91              :     }
+      92              : 
+      93            0 :     if (params.type != null && params.type!.t != CacaoHeader.EIP4361) {
+      94            0 :       throw Errors.getInternalError(
+      95              :         Errors.MISSING_OR_INVALID,
+      96              :         context: 'authenticate() type must null or ${CacaoHeader.EIP4361}.',
+      97              :       );
+      98              :     }
+      99              : 
+     100            0 :     final uniqueNamespaces = params.chains.map((chain) {
+     101            0 :       return NamespaceUtils.getNamespaceFromChain(chain);
+     102            0 :     }).toSet();
+     103            0 :     if (uniqueNamespaces.length > 1) {
+     104            0 :       throw Errors.getInternalError(
+     105              :         Errors.NON_CONFORMING_NAMESPACES,
+     106              :         context:
+     107              :             'authenticate() Multi-namespace requests are not supported. Please request single namespace only.',
+     108              :       );
+     109              :     }
+     110              : 
+     111            0 :     final namespace = NamespaceUtils.getNamespaceFromChain(params.chains.first);
+     112            0 :     if (namespace != 'eip155') {
+     113            0 :       throw Errors.getInternalError(
+     114              :         Errors.NON_CONFORMING_NAMESPACES,
+     115              :         context:
+     116              :             'authenticate() Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.',
+     117              :       );
+     118              :     }
+     119              : 
+     120              :     return true;
+     121              :   }
+     122              : 
+     123            0 :   static bool isValidRespondAuthenticate({
+     124              :     required int id,
+     125              :     required Map<int, PendingSessionAuthRequest> pendingRequests,
+     126              :     List<Cacao>? auths,
+     127              :   }) {
+     128            0 :     if (!pendingRequests.containsKey(id)) {
+     129            0 :       throw Errors.getInternalError(
+     130              :         Errors.MISSING_OR_INVALID,
+     131              :         context:
+     132            0 :             'approveSessionAuthenticate() Could not find pending auth request with id $id',
+     133              :       );
+     134              :     }
+     135              : 
+     136            0 :     if (auths == null || auths.isEmpty) {
+     137            0 :       throw Errors.getInternalError(
+     138              :         Errors.MISSING_OR_INVALID,
+     139              :         context:
+     140              :             'approveSessionAuthenticate() invalid response. Must contain Cacao signatures.',
+     141              :       );
+     142              :     }
+     143              : 
+     144              :     return true;
+     145              :   }
+     146              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/auth/auth_signature.dart.func-c.html b/coverage/html/sign_api/utils/auth/auth_signature.dart.func-c.html new file mode 100644 index 00000000..cafb4812 --- /dev/null +++ b/coverage/html/sign_api/utils/auth/auth_signature.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/auth/auth_signature.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils/auth - auth_signature.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:44.4 %9944
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/auth/auth_signature.dart.func.html b/coverage/html/sign_api/utils/auth/auth_signature.dart.func.html new file mode 100644 index 00000000..01e3c1fe --- /dev/null +++ b/coverage/html/sign_api/utils/auth/auth_signature.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/auth/auth_signature.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils/auth - auth_signature.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:44.4 %9944
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/auth/auth_signature.dart.gcov.html b/coverage/html/sign_api/utils/auth/auth_signature.dart.gcov.html new file mode 100644 index 00000000..eef1f8b8 --- /dev/null +++ b/coverage/html/sign_api/utils/auth/auth_signature.dart.gcov.html @@ -0,0 +1,375 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/auth/auth_signature.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils/auth - auth_signature.dartCoverageTotalHit
Test:lcov.infoLines:44.4 %9944
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:convert';
+       2              : import 'dart:typed_data';
+       3              : import 'package:convert/convert.dart';
+       4              : import 'package:http/http.dart' as http;
+       5              : 
+       6              : import 'package:pointycastle/digests/keccak.dart';
+       7              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/json_rpc_utils.dart';
+       8              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
+       9              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/common_auth_models.dart';
+      10              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/session_auth_models.dart';
+      11              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/auth/auth_constants.dart';
+      12              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/auth/recaps_utils.dart';
+      13              : import 'package:web3dart/crypto.dart' as crypto;
+      14              : 
+      15              : class AuthSignature {
+      16            9 :   static final KeccakDigest keccakDigest = KeccakDigest(256);
+      17            3 :   static Uint8List keccak256(Uint8List input) {
+      18            6 :     keccakDigest.reset();
+      19            6 :     return keccakDigest.process(input);
+      20              :   }
+      21              : 
+      22            3 :   static Uint8List hashMessage(String message) {
+      23            3 :     return keccak256(
+      24            3 :       Uint8List.fromList(
+      25            3 :         utf8.encode(
+      26            3 :           [
+      27              :             '\x19Ethereum Signed Message:\n',
+      28            6 :             message.length.toString(),
+      29              :             message,
+      30            3 :           ].join(),
+      31              :         ),
+      32              :       ),
+      33              :     );
+      34              :   }
+      35              : 
+      36            3 :   static int getNormalizedV(int v) {
+      37            6 :     if (v == 0 || v == 27) {
+      38              :       return 27;
+      39              :     }
+      40            6 :     if (v == 1 || v == 28) {
+      41              :       return 28;
+      42              :     }
+      43            0 :     return v & 1 == 1 ? 27 : 28;
+      44              :   }
+      45              : 
+      46            3 :   static bool isValidEip191Signature(
+      47              :     String address,
+      48              :     String message,
+      49              :     String sig,
+      50              :   ) {
+      51              :     // Get the sig bytes
+      52              :     // print(sig);
+      53            3 :     final sigBytes = Uint8List.fromList(
+      54            6 :       hex.decode(sig.substring(2)),
+      55              :     );
+      56              : 
+      57              :     // If the sig bytes aren't 65 bytes long, throw an error
+      58            6 :     if (sigBytes.length != 65) {
+      59            0 :       throw Exception('Invalid signature length');
+      60              :     }
+      61              : 
+      62              :     // Get the r and s values from the sig bytes
+      63            3 :     final r = BigInt.parse(
+      64            6 :       hex.encode(sigBytes.sublist(0, 32)),
+      65              :       radix: 16,
+      66              :     );
+      67            3 :     final s = BigInt.parse(
+      68            6 :       hex.encode(sigBytes.sublist(32, 64)),
+      69              :       radix: 16,
+      70              :     );
+      71              :     // print(sigBytes[64]);
+      72            6 :     final v = getNormalizedV(sigBytes[64]);
+      73              :     // print(r);
+      74              :     // print(s);
+      75              :     // print(v);
+      76              : 
+      77              :     // // Recover the public key from the signature
+      78              :     // Uint8List? publicKeyBytes = AuthSecp256k1.recoverPublicKeyFromSignature(
+      79              :     //   v - 27,
+      80              :     //   r,
+      81              :     //   s,
+      82              :     //   hashMessage(message),
+      83              :     // );
+      84              : 
+      85              :     // // If the public key is null, return false
+      86              :     // if (publicKeyBytes == null) {
+      87              :     //   print('Could not derive publicKey');
+      88              :     //   return false;
+      89              :     // }
+      90              : 
+      91              :     // Convert the public key to an address
+      92            3 :     final publicKeyBytes = crypto.ecRecover(
+      93            3 :       hashMessage(message),
+      94            3 :       crypto.MsgSignature(r, s, v),
+      95              :     );
+      96              :     // print(hex.encode(publicKeyBytes));
+      97            3 :     final hashedPubKeyBytes = keccak256(publicKeyBytes);
+      98            3 :     final addressBytes = hashedPubKeyBytes.sublist(12, 32);
+      99            6 :     final recoveredAddress = '0x${hex.encode(addressBytes)}';
+     100              : 
+     101              :     // final String recoveredAddress = EthSigUtil.recoverSignature(
+     102              :     //   signature: sig,
+     103              :     //   message: hashMessage(message),
+     104              :     //   //  Uint8List.fromList(
+     105              :     //   //   ascii.encode(message),
+     106              :     //   // ),
+     107              :     // );
+     108              : 
+     109              :     // print(recoveredAddress.toLowerCase());
+     110              :     // print(address.toLowerCase());
+     111              : 
+     112            9 :     return recoveredAddress.toLowerCase() == address.toLowerCase();
+     113              :   }
+     114              : 
+     115            0 :   static Future<bool> isValidEip1271Signature(
+     116              :     String address,
+     117              :     String reconstructedMessage,
+     118              :     String cacaoSignature,
+     119              :     String chainId,
+     120              :     String projectId,
+     121              :   ) async {
+     122              :     try {
+     123              :       const String eip1271MagicValue = '0x1626ba7e';
+     124              :       const String dynamicTypeOffset =
+     125              :           '0000000000000000000000000000000000000000000000000000000000000040';
+     126              :       const String dynamicTypeLength =
+     127              :           '0000000000000000000000000000000000000000000000000000000000000041';
+     128            0 :       final String nonPrefixedSignature = cacaoSignature.substring(2);
+     129              :       final String nonPrefixedHashedMessage =
+     130            0 :           hex.encode(hashMessage(reconstructedMessage)).substring(2);
+     131              : 
+     132            0 :       final String data = eip1271MagicValue +
+     133            0 :           nonPrefixedHashedMessage +
+     134            0 :           dynamicTypeOffset +
+     135            0 :           dynamicTypeLength +
+     136              :           nonPrefixedSignature;
+     137              : 
+     138            0 :       final Uri url = Uri.parse(
+     139            0 :         '${AuthConstants.AUTH_DEFAULT_URL}/?chainId=$chainId&projectId=$projectId',
+     140              :       );
+     141            0 :       final Map<String, dynamic> body = JsonRpcUtils.formatJsonRpcRequest(
+     142              :         'eth_call',
+     143            0 :         {
+     144              :           'to': address,
+     145              :           'data': data,
+     146              :         },
+     147              :       );
+     148              : 
+     149            0 :       final http.Response response = await http.post(
+     150              :         url,
+     151              :         body: body,
+     152              :       );
+     153              : 
+     154              :       // print(response.body);
+     155              :       // final jsonBody = jsonDecode(response.body);
+     156              :       final String recoveredValue =
+     157            0 :           response.body.substring(0, eip1271MagicValue.length);
+     158            0 :       return recoveredValue.toLowerCase() == eip1271MagicValue.toLowerCase();
+     159              :     } catch (e) {
+     160              :       return false;
+     161              :     }
+     162              :   }
+     163              : 
+     164              :   // verifies CACAO signature
+     165              :   // Used by the wallet after formatting the message
+     166            3 :   static Future<bool> verifySignature(
+     167              :     String address,
+     168              :     String reconstructedMessage,
+     169              :     CacaoSignature cacaoSignature,
+     170              :     String chainId,
+     171              :     String projectId,
+     172              :   ) async {
+     173            6 :     if (cacaoSignature.t == 'eip191') {
+     174            3 :       return isValidEip191Signature(
+     175              :         address,
+     176              :         reconstructedMessage,
+     177            3 :         cacaoSignature.s,
+     178              :       );
+     179            0 :     } else if (cacaoSignature.t == 'eip1271') {
+     180            0 :       return await isValidEip1271Signature(
+     181              :         address,
+     182              :         reconstructedMessage,
+     183            0 :         cacaoSignature.s,
+     184              :         chainId,
+     185              :         projectId,
+     186              :       );
+     187              :     } else {
+     188            0 :       throw Exception(
+     189            0 :         'verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${cacaoSignature.t}',
+     190              :       );
+     191              :     }
+     192              :   }
+     193              : 
+     194            0 :   static Cacao buildAuthObject({
+     195              :     required CacaoRequestPayload requestPayload,
+     196              :     required CacaoSignature signature,
+     197              :     required String iss,
+     198              :   }) {
+     199            0 :     if (!iss.contains('did:pkh:')) {
+     200            0 :       iss = 'did:pkh:$iss';
+     201              :     }
+     202            0 :     return Cacao(
+     203              :       h: const CacaoHeader(t: CacaoHeader.CAIP122),
+     204            0 :       p: CacaoPayload.fromRequestPayload(
+     205              :         issuer: iss,
+     206              :         payload: requestPayload,
+     207              :       ),
+     208              :       s: signature,
+     209              :     );
+     210              :   }
+     211              : 
+     212            0 :   static SessionAuthPayload populateAuthPayload({
+     213              :     required SessionAuthPayload authPayload,
+     214              :     required List<String> chains,
+     215              :     required List<String> methods,
+     216              :   }) {
+     217            0 :     final statement = authPayload.statement ?? '';
+     218              : 
+     219            0 :     if (chains.isEmpty) return authPayload;
+     220              : 
+     221            0 :     final requested = authPayload.chains;
+     222              :     final supported = chains;
+     223              : 
+     224              :     final approvedChains =
+     225            0 :         supported.where((value) => requested.contains(value)).toList();
+     226            0 :     if (approvedChains.isEmpty) {
+     227            0 :       throw WalletConnectError(code: -1, message: 'No supported chains');
+     228              :     }
+     229              : 
+     230            0 :     final requestedRecaps = ReCapsUtils.getDecodedRecapFromResources(
+     231            0 :       resources: authPayload.resources,
+     232              :     );
+     233              :     if (requestedRecaps == null) return authPayload;
+     234              : 
+     235            0 :     ReCapsUtils.isValidRecap(requestedRecaps);
+     236              : 
+     237            0 :     final resource = ReCapsUtils.getRecapResource(
+     238              :       recap: requestedRecaps,
+     239              :       resource: 'eip155',
+     240              :     );
+     241            0 :     List<String> updatedResources = authPayload.resources ?? [];
+     242              : 
+     243            0 :     if (resource.isNotEmpty) {
+     244            0 :       final actions = ReCapsUtils.getReCapActions(abilities: resource);
+     245              :       final approvedActions =
+     246            0 :           actions.where((value) => methods.contains(value)).toList();
+     247            0 :       if (approvedActions.isEmpty) {
+     248            0 :         throw WalletConnectError(
+     249            0 :           code: -1,
+     250            0 :           message: 'Supported methods don\'t satisfy the requested: $actions, '
+     251              :               'supported: $methods',
+     252              :         );
+     253              :       }
+     254            0 :       final formattedActions = ReCapsUtils.assignAbilityToActions(
+     255              :         'request',
+     256              :         approvedActions,
+     257            0 :         limits: {'chains': approvedChains},
+     258              :       );
+     259            0 :       final updatedRecap = ReCapsUtils.addResourceToRecap(
+     260              :         recap: requestedRecaps,
+     261              :         resource: 'eip155',
+     262              :         actions: formattedActions,
+     263              :       );
+     264              :       // remove recap from resources as we will add the updated one
+     265            0 :       updatedResources = List<String>.from((authPayload.resources ?? []))
+     266            0 :         ..removeLast();
+     267            0 :       updatedResources.add(ReCapsUtils.encodeRecap(updatedRecap));
+     268              :     }
+     269              :     //
+     270            0 :     return SessionAuthPayload.fromJson(authPayload.toJson()).copyWith(
+     271            0 :       statement: ReCapsUtils.buildRecapStatement(
+     272              :         statement,
+     273            0 :         ReCapsUtils.getRecapFromResources(resources: updatedResources),
+     274              :       ),
+     275              :       chains: approvedChains,
+     276            0 :       resources: updatedResources.isNotEmpty ? updatedResources : null,
+     277              :     );
+     278              :   }
+     279              : 
+     280            1 :   static String getAddressFromMessage(String message) {
+     281              :     try {
+     282            1 :       final regexp = RegExp('0x[a-fA-F0-9]{40}');
+     283            1 :       final matches = regexp.allMatches(message);
+     284            2 :       for (final Match m in matches) {
+     285            1 :         return m[0]!;
+     286              :       }
+     287              :       return '';
+     288              :     } catch (_) {}
+     289              :     return '';
+     290              :   }
+     291              : 
+     292            1 :   static String getChainIdFromMessage(String message) {
+     293              :     try {
+     294              :       final pattern = 'Chain ID: ';
+     295            2 :       final regexp = RegExp('$pattern(?<temp1>\\d+)');
+     296            1 :       final matches = regexp.allMatches(message);
+     297            2 :       for (final Match m in matches) {
+     298            3 :         return m[0]!.toString().replaceAll(pattern, '');
+     299              :       }
+     300              :     } catch (_) {}
+     301              :     return '';
+     302              :   }
+     303              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/auth/auth_utils.dart.func-c.html b/coverage/html/sign_api/utils/auth/auth_utils.dart.func-c.html new file mode 100644 index 00000000..18d315ed --- /dev/null +++ b/coverage/html/sign_api/utils/auth/auth_utils.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/auth/auth_utils.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils/auth - auth_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %22
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/auth/auth_utils.dart.func.html b/coverage/html/sign_api/utils/auth/auth_utils.dart.func.html new file mode 100644 index 00000000..08898c58 --- /dev/null +++ b/coverage/html/sign_api/utils/auth/auth_utils.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/auth/auth_utils.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils/auth - auth_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %22
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/auth/auth_utils.dart.gcov.html b/coverage/html/sign_api/utils/auth/auth_utils.dart.gcov.html new file mode 100644 index 00000000..e42ee3a1 --- /dev/null +++ b/coverage/html/sign_api/utils/auth/auth_utils.dart.gcov.html @@ -0,0 +1,77 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/auth/auth_utils.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils/auth - auth_utils.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %22
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : class AuthUtils {
+       2            3 :   static String generateNonce() {
+       3            9 :     return DateTime.now().millisecondsSinceEpoch.toString();
+       4              :   }
+       5              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/auth/index-sort-f.html b/coverage/html/sign_api/utils/auth/index-sort-f.html new file mode 100644 index 00000000..c98322d5 --- /dev/null +++ b/coverage/html/sign_api/utils/auth/index-sort-f.html @@ -0,0 +1,153 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/auth + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils/authCoverageTotalHit
Test:lcov.infoLines:21.9 %32070
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
address_utils.dart +
66.7%66.7%
+
66.7 %64-
auth_api_validators.dart +
45.5%45.5%
+
45.5 %4420-
auth_signature.dart +
44.4%44.4%
+
44.4 %9944-
auth_utils.dart +
100.0%
+
100.0 %22-
recaps_utils.dart +
0.0%
+
0.0 %169-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/auth/index-sort-l.html b/coverage/html/sign_api/utils/auth/index-sort-l.html new file mode 100644 index 00000000..87f2a26b --- /dev/null +++ b/coverage/html/sign_api/utils/auth/index-sort-l.html @@ -0,0 +1,127 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/auth + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils/authCoverageTotalHit
Test:lcov.infoLines:21.9 %32070
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
recaps_utils.dart +
0.0%
+
0.0 %169
auth_signature.dart +
44.4%44.4%
+
44.4 %9944
auth_api_validators.dart +
45.5%45.5%
+
45.5 %4420
address_utils.dart +
66.7%66.7%
+
66.7 %64
auth_utils.dart +
100.0%
+
100.0 %22
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/auth/index.html b/coverage/html/sign_api/utils/auth/index.html new file mode 100644 index 00000000..40a1bb06 --- /dev/null +++ b/coverage/html/sign_api/utils/auth/index.html @@ -0,0 +1,127 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/auth + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils/authCoverageTotalHit
Test:lcov.infoLines:21.9 %32070
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
address_utils.dart +
66.7%66.7%
+
66.7 %64
auth_api_validators.dart +
45.5%45.5%
+
45.5 %4420
auth_signature.dart +
44.4%44.4%
+
44.4 %9944
auth_utils.dart +
100.0%
+
100.0 %22
recaps_utils.dart +
0.0%
+
0.0 %169
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/auth/recaps_utils.dart.func-c.html b/coverage/html/sign_api/utils/auth/recaps_utils.dart.func-c.html new file mode 100644 index 00000000..12c1e693 --- /dev/null +++ b/coverage/html/sign_api/utils/auth/recaps_utils.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/auth/recaps_utils.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils/auth - recaps_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %1690
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/auth/recaps_utils.dart.func.html b/coverage/html/sign_api/utils/auth/recaps_utils.dart.func.html new file mode 100644 index 00000000..07179f7f --- /dev/null +++ b/coverage/html/sign_api/utils/auth/recaps_utils.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/auth/recaps_utils.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils/auth - recaps_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %1690
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/auth/recaps_utils.dart.gcov.html b/coverage/html/sign_api/utils/auth/recaps_utils.dart.gcov.html new file mode 100644 index 00000000..801ed432 --- /dev/null +++ b/coverage/html/sign_api/utils/auth/recaps_utils.dart.gcov.html @@ -0,0 +1,420 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/auth/recaps_utils.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils/auth - recaps_utils.dartCoverageTotalHit
Test:lcov.infoLines:0.0 %1690
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:convert';
+       2              : 
+       3              : import 'package:flutter/foundation.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/utils/errors.dart';
+       5              : 
+       6              : class ReCapsUtils {
+       7              :   //
+       8            0 :   static String? getRecapFromResources({List<String>? resources}) {
+       9            0 :     final resourcesList = resources ?? [];
+      10            0 :     if (resourcesList.isEmpty) return null;
+      11              :     // per spec, recap is always the last resource
+      12            0 :     final recap = resourcesList.last;
+      13            0 :     return isRecap(recap) ? recap : null;
+      14              :   }
+      15              : 
+      16            0 :   static bool isRecap(String resource) {
+      17            0 :     return resource.contains('urn:recap:');
+      18              :   }
+      19              : 
+      20            0 :   static List<String> getMethodsFromRecap(String recap) {
+      21            0 :     final decodedRecap = decodeRecap(recap);
+      22            0 :     if (!isValidRecap(decodedRecap)) return [];
+      23              : 
+      24              :     try {
+      25              :       // methods are only available for eip155 as per the current implementation
+      26            0 :       final resource = decodedRecap['att']?['eip155'] as Map<String, dynamic>?;
+      27            0 :       if (resource == null) return [];
+      28              : 
+      29            0 :       return resource.keys.map((k) => k.split('/').last).toList();
+      30              :     } catch (e) {
+      31            0 :       return [];
+      32              :     }
+      33              :   }
+      34              : 
+      35            0 :   static List<String> getChainsFromRecap(String recap) {
+      36            0 :     final decodedRecap = decodeRecap(recap);
+      37            0 :     if (!isValidRecap(decodedRecap)) return [];
+      38              : 
+      39            0 :     final List<dynamic> recapChains = [];
+      40              :     try {
+      41              :       final att =
+      42            0 :           decodedRecap['att'] as Map<String, dynamic>? ?? <String, dynamic>{};
+      43              : 
+      44            0 :       for (var resources in att.values) {
+      45              :         final resourcesMap = resources as Map<String, dynamic>;
+      46            0 :         final resourcesValues = resourcesMap.values.first as List;
+      47            0 :         for (var value in resourcesValues) {
+      48              :           final chainValues = value as Map<String, dynamic>;
+      49            0 :           final chains = chainValues['chains'] as List;
+      50            0 :           recapChains.addAll(chains);
+      51              :         }
+      52              :       }
+      53            0 :       return recapChains.map((e) => e.toString()).toSet().toList();
+      54              :     } catch (e) {
+      55            0 :       return [];
+      56              :     }
+      57              :   }
+      58              : 
+      59            0 :   static Map<String, dynamic> decodeRecap(String recap) {
+      60              :     // Add the padding that was removed during encoding
+      61            0 :     String paddedRecap = recap.replaceAll('urn:recap:', '');
+      62            0 :     final padding = paddedRecap.length % 4;
+      63            0 :     if (padding > 0) {
+      64            0 :       paddedRecap += '=' * (4 - padding);
+      65              :     }
+      66              : 
+      67            0 :     final decoded = utf8.decode(base64.decode(paddedRecap));
+      68            0 :     final decodedRecap = jsonDecode(decoded) as Map<String, dynamic>;
+      69            0 :     isValidRecap(decodedRecap);
+      70              :     return decodedRecap;
+      71              :   }
+      72              : 
+      73            0 :   static bool isValidRecap(Map<String, dynamic> recap) {
+      74            0 :     final att = recap['att'] as Map<String, dynamic>?;
+      75              :     if (att == null) {
+      76            0 :       throw Errors.getInternalError(
+      77              :         Errors.MISSING_OR_INVALID,
+      78              :         context: 'Invalid ReCap. No `att` property found',
+      79              :       );
+      80              :     }
+      81              :     //
+      82            0 :     final resources = att.keys;
+      83            0 :     if (resources.isEmpty) {
+      84            0 :       throw Errors.getInternalError(
+      85              :         Errors.MISSING_OR_INVALID,
+      86              :         context: 'Invalid ReCap. No resources found in `att` property',
+      87              :       );
+      88              :     }
+      89              :     //
+      90            0 :     for (var resource in resources) {
+      91            0 :       final abilities = att[resource];
+      92            0 :       if (abilities is! Map) {
+      93            0 :         throw Errors.getInternalError(
+      94              :           Errors.MISSING_OR_INVALID,
+      95            0 :           context: 'Invalid ReCap. Resource must be an object: $resource',
+      96              :         );
+      97              :       }
+      98            0 :       final resourceAbilities = (abilities as Map<String, dynamic>).keys;
+      99            0 :       if (resourceAbilities.isEmpty) {
+     100            0 :         throw Errors.getInternalError(
+     101              :           Errors.MISSING_OR_INVALID,
+     102            0 :           context: 'Invalid ReCap. Resource object is empty: $resource',
+     103              :         );
+     104              :       }
+     105              :       //
+     106            0 :       for (var ability in resourceAbilities) {
+     107            0 :         final limits = abilities[ability];
+     108            0 :         if (limits is! List) {
+     109            0 :           throw Errors.getInternalError(
+     110              :             Errors.MISSING_OR_INVALID,
+     111            0 :             context: 'Invalid ReCap. Ability limits $ability must be an array '
+     112              :                 'of objects, found: $limits',
+     113              :           );
+     114              :         }
+     115            0 :         if ((limits).isEmpty) {
+     116            0 :           throw Errors.getInternalError(
+     117              :             Errors.MISSING_OR_INVALID,
+     118            0 :             context: 'Invalid ReCap. Value of $ability is empty array, must be '
+     119              :                 'an array with objects',
+     120              :           );
+     121              :         }
+     122              :         //
+     123            0 :         for (var limit in limits) {
+     124            0 :           if (limit is! Map) {
+     125            0 :             throw Errors.getInternalError(
+     126              :               Errors.MISSING_OR_INVALID,
+     127            0 :               context:
+     128              :                   'Invalid ReCap. Ability limits ($ability) must be an array '
+     129              :                   'of objects, found: $limit',
+     130              :             );
+     131              :           }
+     132              :         }
+     133              :       }
+     134              :     }
+     135              : 
+     136              :     return true;
+     137              :   }
+     138              : 
+     139            0 :   static String createEncodedRecap(
+     140              :     String namespace,
+     141              :     String ability,
+     142              :     List<String> methods,
+     143              :   ) {
+     144            0 :     final recap = createRecap(namespace, ability, methods);
+     145            0 :     return encodeRecap(recap);
+     146              :   }
+     147              : 
+     148            0 :   static String encodeRecap(Map<String, dynamic> recap) {
+     149            0 :     isValidRecap(recap);
+     150            0 :     final jsonRecap = jsonEncode(recap);
+     151            0 :     final bytes = utf8.encode(jsonRecap).toList();
+     152              :     // remove the padding from the base64 string as per recap spec
+     153            0 :     return 'urn:recap:${base64.encode(bytes).replaceAll('=', '')}';
+     154              :   }
+     155              : 
+     156            0 :   static Map<String, dynamic> createRecap(
+     157              :     String namespace,
+     158              :     String ability,
+     159              :     List<String> methods, {
+     160              :     Map limits = const {},
+     161              :   }) {
+     162              :     try {
+     163            0 :       final sortedMethods = List<String>.from(methods)
+     164            0 :         ..sort((a, b) => a.compareTo(b));
+     165              : 
+     166            0 :       Map<String, dynamic> abilities = {};
+     167            0 :       for (var method in sortedMethods) {
+     168            0 :         abilities['$ability/$method'] = [
+     169            0 :           ...(abilities['$ability/$method'] ?? []),
+     170            0 :           limits,
+     171              :         ];
+     172              :       }
+     173              : 
+     174            0 :       return {
+     175            0 :         'att': {
+     176            0 :           namespace: Map<String, dynamic>.fromEntries(abilities.entries),
+     177              :         }
+     178              :       };
+     179              :     } catch (e) {
+     180              :       rethrow;
+     181              :     }
+     182              :   }
+     183              : 
+     184            0 :   static String mergeEncodedRecaps(String recap1, String recap2) {
+     185            0 :     final decoded1 = decodeRecap(recap1);
+     186            0 :     final decoded2 = decodeRecap(recap2);
+     187            0 :     final merged = mergeRecaps(decoded1, decoded2);
+     188            0 :     return encodeRecap(merged);
+     189              :   }
+     190              : 
+     191            0 :   static Map<String, dynamic> mergeRecaps(
+     192              :     Map<String, dynamic> recap1,
+     193              :     Map<String, dynamic> recap2,
+     194              :   ) {
+     195            0 :     isValidRecap(recap1);
+     196            0 :     isValidRecap(recap2);
+     197            0 :     final att1 = recap1['att'] as Map<String, dynamic>;
+     198            0 :     final att2 = recap2['att'] as Map<String, dynamic>;
+     199            0 :     final keys = [...att1.keys, ...att2.keys]..sort(
+     200            0 :         (a, b) => a.compareTo(b),
+     201              :       );
+     202            0 :     final mergedRecap = {'att': {}};
+     203              : 
+     204            0 :     for (var key in keys) {
+     205            0 :       final actions1 = att1[key] as Map<String, dynamic>? ?? {};
+     206            0 :       final actions1Keys = actions1.keys;
+     207            0 :       final actions2 = att2[key] as Map<String, dynamic>? ?? {};
+     208            0 :       final actions2Keys = actions2.keys;
+     209            0 :       final actions = [...actions1Keys, ...actions2Keys]..sort(
+     210            0 :           (a, b) => a.compareTo(b),
+     211              :         );
+     212              : 
+     213            0 :       for (var action in actions) {
+     214            0 :         mergedRecap['att']![key] = {
+     215            0 :           ...mergedRecap['att']?[key],
+     216            0 :           [action]: recap1['att'][key]?[action] || recap2['att'][key]?[action],
+     217              :         };
+     218              :       }
+     219              :     }
+     220              : 
+     221              :     return mergedRecap;
+     222              :   }
+     223              : 
+     224            0 :   static Map<String, dynamic>? getDecodedRecapFromResources({
+     225              :     List<String>? resources,
+     226              :   }) {
+     227            0 :     final resource = getRecapFromResources(resources: resources);
+     228              :     if (resource == null) return null;
+     229            0 :     if (!isRecap(resource)) return null;
+     230            0 :     return decodeRecap(resource);
+     231              :   }
+     232              : 
+     233            0 :   static String formatStatementFromRecap({
+     234              :     String statement = '',
+     235              :     Map<String, dynamic> recap = const {},
+     236              :   }) {
+     237            0 :     isValidRecap(recap);
+     238              :     //
+     239              :     final baseStatement =
+     240              :         'I further authorize the stated URI to perform the following actions on my behalf: ';
+     241            0 :     if (statement.contains(baseStatement)) return statement;
+     242              :     //
+     243            0 :     final List<String> statementForRecap = <String>[];
+     244              :     int currentCounter = 0;
+     245            0 :     final att = recap['att'] as Map<String, dynamic>;
+     246            0 :     final resources = att.keys;
+     247            0 :     for (var resource in resources) {
+     248            0 :       final abilities = att[resource];
+     249            0 :       final resourceAbilities = (abilities as Map<String, dynamic>).keys;
+     250            0 :       final actions = resourceAbilities.map((ability) {
+     251            0 :         return {
+     252            0 :           'ability': ability.split('/')[0],
+     253            0 :           'action': ability.split('/')[1],
+     254              :         };
+     255            0 :       }).toList();
+     256            0 :       actions.sort((a, b) => a['action']!.compareTo(b['action']!));
+     257              :       //
+     258            0 :       final uniqueAbilities = <String, dynamic>{};
+     259            0 :       for (var actionMap in actions) {
+     260            0 :         final ability = actionMap['ability']!;
+     261            0 :         final action = actionMap['action']!;
+     262            0 :         if (uniqueAbilities[ability] == null) {
+     263            0 :           uniqueAbilities[ability] = [];
+     264              :         }
+     265            0 :         uniqueAbilities[ability].add(action);
+     266              :       }
+     267              :       //
+     268            0 :       final abilitiesStatements = uniqueAbilities.keys.map((ability) {
+     269            0 :         currentCounter++;
+     270            0 :         final abilities = (uniqueAbilities[ability] as List).join('\', \'');
+     271            0 :         return '($currentCounter) \'$ability\': \'$abilities\' for \'$resource\'.';
+     272            0 :       }).toList();
+     273              : 
+     274            0 :       statementForRecap.add(
+     275            0 :         abilitiesStatements.join(', ').replaceAll('.,', '.'),
+     276              :       );
+     277              :     }
+     278              :     //
+     279            0 :     final recapStatemet = statementForRecap.join(' ');
+     280            0 :     final recapStatement = '$baseStatement$recapStatemet';
+     281              :     // add a space if there is a statement
+     282            0 :     return '${statement.isNotEmpty ? "$statement " : ""}$recapStatement';
+     283              :   }
+     284              : 
+     285            0 :   static List<String> getRecapResource({
+     286              :     required Map<String, dynamic> recap,
+     287              :     required String resource,
+     288              :   }) {
+     289              :     try {
+     290            0 :       final att = recap['att'] as Map<String, dynamic>?;
+     291            0 :       final abilities = att?[resource] as Map<String, dynamic>?;
+     292              :       if (abilities != null) {
+     293            0 :         return abilities.keys.toList();
+     294              :       }
+     295              :     } catch (e) {
+     296            0 :       debugPrint(e.toString());
+     297              :     }
+     298            0 :     return [];
+     299              :   }
+     300              : 
+     301            0 :   static List<String> getReCapActions({required List<String> abilities}) {
+     302              :     try {
+     303            0 :       return abilities.map((ability) => ability.split('/')[1]).toList();
+     304              :     } catch (e) {
+     305            0 :       debugPrint(e.toString());
+     306              :     }
+     307            0 :     return [];
+     308              :   }
+     309              : 
+     310            0 :   static Map<String, dynamic> assignAbilityToActions(
+     311              :     String ability,
+     312              :     List<String> actions, {
+     313              :     Map limits = const {},
+     314              :   }) {
+     315            0 :     final sortedActions = List<String>.from(actions)
+     316            0 :       ..sort((a, b) => a.compareTo(b));
+     317              : 
+     318            0 :     Map<String, dynamic> abilities = {};
+     319            0 :     for (var method in sortedActions) {
+     320            0 :       abilities['$ability/$method'] = [
+     321            0 :         ...(abilities['$ability/$method'] ?? []),
+     322            0 :         limits,
+     323              :       ];
+     324              :     }
+     325              : 
+     326            0 :     return Map<String, dynamic>.fromEntries(abilities.entries);
+     327              :   }
+     328              : 
+     329            0 :   static Map<String, dynamic> addResourceToRecap({
+     330              :     required Map<String, dynamic> recap,
+     331              :     required String resource,
+     332              :     required Map<String, dynamic> actions,
+     333              :   }) {
+     334              :     //
+     335            0 :     final sortedRecap = Map<String, dynamic>.from(recap);
+     336            0 :     sortedRecap['att']![resource] = actions;
+     337            0 :     sortedRecap.keys.toList().sort((a, b) => a.compareTo(b));
+     338            0 :     isValidRecap(sortedRecap);
+     339              :     return sortedRecap;
+     340              :   }
+     341              : 
+     342            0 :   static String buildRecapStatement(String statement, String? recap) {
+     343            0 :     if ((recap ?? '').isEmpty) return statement;
+     344            0 :     final decoded = decodeRecap(recap!);
+     345            0 :     isValidRecap(decoded);
+     346            0 :     return formatStatementFromRecap(statement: statement, recap: decoded);
+     347              :   }
+     348              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/custom_credentials.dart.func-c.html b/coverage/html/sign_api/utils/custom_credentials.dart.func-c.html new file mode 100644 index 00000000..fff10874 --- /dev/null +++ b/coverage/html/sign_api/utils/custom_credentials.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/custom_credentials.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils - custom_credentials.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %230
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/custom_credentials.dart.func.html b/coverage/html/sign_api/utils/custom_credentials.dart.func.html new file mode 100644 index 00000000..f0561ad3 --- /dev/null +++ b/coverage/html/sign_api/utils/custom_credentials.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/custom_credentials.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils - custom_credentials.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %230
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/custom_credentials.dart.gcov.html b/coverage/html/sign_api/utils/custom_credentials.dart.gcov.html new file mode 100644 index 00000000..2dd62329 --- /dev/null +++ b/coverage/html/sign_api/utils/custom_credentials.dart.gcov.html @@ -0,0 +1,152 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/custom_credentials.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils - custom_credentials.dartCoverageTotalHit
Test:lcov.infoLines:0.0 %230
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:convert';
+       2              : import 'dart:typed_data';
+       3              : 
+       4              : import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart';
+       5              : import 'package:web3dart/crypto.dart' as crypto;
+       6              : 
+       7              : class CustomCredentials extends CustomTransactionSender {
+       8            0 :   CustomCredentials({
+       9              :     required ISignEngine signEngine,
+      10              :     required String topic,
+      11              :     required String chainId,
+      12              :     required EthereumAddress address,
+      13              :     String? method,
+      14              :   })  : _signEngine = signEngine,
+      15              :         _topic = topic,
+      16              :         _chainId = chainId,
+      17              :         _address = address,
+      18              :         _method = method;
+      19              : 
+      20              :   final ISignEngine _signEngine;
+      21              :   final String _topic;
+      22              :   final String _chainId;
+      23              :   final EthereumAddress _address;
+      24              :   final String? _method;
+      25              : 
+      26            0 :   @override
+      27            0 :   EthereumAddress get address => _address;
+      28              : 
+      29            0 :   @override
+      30              :   Future<String> sendTransaction(Transaction transaction) async {
+      31            0 :     final result = await _sendTransaction(transaction);
+      32            0 :     if (result is Map) {
+      33            0 :       return jsonEncode(result);
+      34              :     }
+      35            0 :     return result.toString();
+      36              :   }
+      37              : 
+      38            0 :   Future<dynamic> _sendTransaction(Transaction transaction) async {
+      39            0 :     final sessionRequestParams = SessionRequestParams(
+      40            0 :       method: _method ?? MethodsConstants.ethSendTransaction,
+      41            0 :       params: [
+      42            0 :         transaction.toJson(),
+      43              :       ],
+      44              :     );
+      45              : 
+      46            0 :     final result = await _signEngine.request(
+      47            0 :       topic: _topic,
+      48            0 :       chainId: _chainId,
+      49              :       request: sessionRequestParams,
+      50              :     );
+      51              :     return result;
+      52              :   }
+      53              : 
+      54            0 :   @override
+      55            0 :   Future<EthereumAddress> extractAddress() => Future.value(_address);
+      56              : 
+      57            0 :   @override
+      58              :   Future<crypto.MsgSignature> signToSignature(
+      59              :     Uint8List payload, {
+      60              :     int? chainId,
+      61              :     bool isEIP1559 = false,
+      62              :   }) {
+      63            0 :     final signature = signToEcSignature(
+      64              :       payload,
+      65              :       chainId: chainId,
+      66              :       isEIP1559: isEIP1559,
+      67              :     );
+      68            0 :     return Future.value(signature);
+      69              :   }
+      70              : 
+      71            0 :   @override
+      72              :   crypto.MsgSignature signToEcSignature(
+      73              :     Uint8List payload, {
+      74              :     int? chainId,
+      75              :     bool isEIP1559 = false,
+      76              :   }) {
+      77              :     // TODO: implement signToEcSignature
+      78            0 :     throw UnimplementedError();
+      79              :   }
+      80              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/index-sort-f.html b/coverage/html/sign_api/utils/index-sort-f.html new file mode 100644 index 00000000..a9e826ab --- /dev/null +++ b/coverage/html/sign_api/utils/index-sort-f.html @@ -0,0 +1,117 @@ + + + + + + + LCOV - lcov.info - sign_api/utils + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utilsCoverageTotalHit
Test:lcov.infoLines:80.7 %11996
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
custom_credentials.dart +
0.0%
+
0.0 %23-
sign_api_validator_utils.dart +
100.0%
+
100.0 %9696-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/index-sort-l.html b/coverage/html/sign_api/utils/index-sort-l.html new file mode 100644 index 00000000..6943d71d --- /dev/null +++ b/coverage/html/sign_api/utils/index-sort-l.html @@ -0,0 +1,100 @@ + + + + + + + LCOV - lcov.info - sign_api/utils + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utilsCoverageTotalHit
Test:lcov.infoLines:80.7 %11996
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
custom_credentials.dart +
0.0%
+
0.0 %23
sign_api_validator_utils.dart +
100.0%
+
100.0 %9696
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/index.html b/coverage/html/sign_api/utils/index.html new file mode 100644 index 00000000..b11ed9f3 --- /dev/null +++ b/coverage/html/sign_api/utils/index.html @@ -0,0 +1,100 @@ + + + + + + + LCOV - lcov.info - sign_api/utils + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utilsCoverageTotalHit
Test:lcov.infoLines:80.7 %11996
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
custom_credentials.dart +
0.0%
+
0.0 %23
sign_api_validator_utils.dart +
100.0%
+
100.0 %9696
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/sign_api_validator_utils.dart.func-c.html b/coverage/html/sign_api/utils/sign_api_validator_utils.dart.func-c.html new file mode 100644 index 00000000..9b4a7023 --- /dev/null +++ b/coverage/html/sign_api/utils/sign_api_validator_utils.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/sign_api_validator_utils.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils - sign_api_validator_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %9696
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/sign_api_validator_utils.dart.func.html b/coverage/html/sign_api/utils/sign_api_validator_utils.dart.func.html new file mode 100644 index 00000000..82c1a14c --- /dev/null +++ b/coverage/html/sign_api/utils/sign_api_validator_utils.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/sign_api_validator_utils.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils - sign_api_validator_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %9696
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/sign_api/utils/sign_api_validator_utils.dart.gcov.html b/coverage/html/sign_api/utils/sign_api_validator_utils.dart.gcov.html new file mode 100644 index 00000000..a53abd39 --- /dev/null +++ b/coverage/html/sign_api/utils/sign_api_validator_utils.dart.gcov.html @@ -0,0 +1,396 @@ + + + + + + + LCOV - lcov.info - sign_api/utils/sign_api_validator_utils.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - sign_api/utils - sign_api_validator_utils.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %9696
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/proposal_models.dart';
+       2              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/session_models.dart';
+       3              : import 'package:walletconnect_flutter_v2/apis/utils/namespace_utils.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/utils/errors.dart';
+       5              : 
+       6              : class SignApiValidatorUtils {
+       7            6 :   static bool isContainedIn({
+       8              :     required List<dynamic> container,
+       9              :     required List<dynamic> contained,
+      10              :   }) {
+      11              :     List<dynamic> matches = contained
+      12            6 :         .where(
+      13           12 :           (x) => container.contains(x),
+      14              :         )
+      15            6 :         .toList();
+      16           18 :     return matches.length == contained.length;
+      17              :   }
+      18              : 
+      19              :   /// This function will throw an error if
+      20              :   /// 1. the nsOrChainId parameter is a chainId, and the chains param exists
+      21              :   /// 2. The list of chains contains an invalid chainId
+      22            5 :   static bool isValidChains({
+      23              :     required String nsOrChainId,
+      24              :     List<String>? chains,
+      25              :     required String context,
+      26              :   }) {
+      27              :     // If the key is a valid chain Id, then the chains should be empty
+      28            5 :     final bool isChainId = NamespaceUtils.isValidChainId(nsOrChainId);
+      29              :     if (isChainId) {
+      30            4 :       if (chains != null && chains.isNotEmpty) {
+      31            4 :         throw Errors.getSdkError(
+      32              :           Errors.UNSUPPORTED_CHAINS,
+      33            4 :           context: '$context, namespace is a chainId, but chains is not empty',
+      34              :         );
+      35              :       }
+      36              :     } else {
+      37           10 :       for (String c in chains!) {
+      38            5 :         if (!NamespaceUtils.isValidChainId(c)) {
+      39            1 :           throw Errors.getSdkError(
+      40              :             Errors.UNSUPPORTED_CHAINS,
+      41              :             context:
+      42            1 :                 '$context, chain $c should conform to "namespace:chainId" format',
+      43              :           );
+      44              :         }
+      45              :       }
+      46              :     }
+      47              : 
+      48              :     return true;
+      49              :   }
+      50              : 
+      51              :   /// Validates the data of the Required Namespaces, ensuring it conforms to CAIP-25
+      52            5 :   static bool isValidRequiredNamespaces({
+      53              :     required Map<String, RequiredNamespace> requiredNamespaces,
+      54              :     required String context,
+      55              :   }) {
+      56           10 :     requiredNamespaces.forEach((key, namespace) {
+      57            5 :       isValidChains(
+      58              :         nsOrChainId: key,
+      59            5 :         chains: namespace.chains,
+      60            5 :         context: '$context requiredNamespace',
+      61              :       );
+      62              :     });
+      63              : 
+      64              :     return true;
+      65              :   }
+      66              : 
+      67              :   /// Loops through each account, and validates it
+      68              :   /// Context is used to provide more information in the error message
+      69            5 :   static bool isValidAccounts({
+      70              :     required List<String> accounts,
+      71              :     required String context,
+      72              :   }) {
+      73           10 :     for (String account in accounts) {
+      74            5 :       if (!NamespaceUtils.isValidAccount(account)) {
+      75            4 :         throw Errors.getSdkError(
+      76              :           Errors.UNSUPPORTED_ACCOUNTS,
+      77              :           context:
+      78            4 :               '$context, account $account should conform to "namespace:chainId:address" format',
+      79              :         );
+      80              :       }
+      81              :     }
+      82              : 
+      83              :     return true;
+      84              :   }
+      85              : 
+      86              :   /// Validates the data of the Namespaces, ensuring it conforms to CAIP-25
+      87            5 :   static bool isValidNamespaces({
+      88              :     required Map<String, Namespace> namespaces,
+      89              :     required String context,
+      90              :   }) {
+      91           10 :     namespaces.forEach((key, namespace) {
+      92            5 :       isValidAccounts(
+      93            5 :         accounts: namespace.accounts,
+      94            5 :         context: '$context namespace',
+      95              :       );
+      96              :     });
+      97              : 
+      98              :     return true;
+      99              :   }
+     100              : 
+     101              :   /// Validates the provided chainId, then ensures that the chainId is contained
+     102              :   /// in the namespaces
+     103            4 :   static bool isValidNamespacesChainId({
+     104              :     required Map<String, Namespace> namespaces,
+     105              :     required String chainId,
+     106              :   }) {
+     107              :     // Validate the chainId
+     108            4 :     if (!NamespaceUtils.isValidChainId(chainId)) {
+     109            1 :       throw Errors.getSdkError(
+     110              :         Errors.UNSUPPORTED_CHAINS,
+     111            1 :         context: 'chain $chainId should conform to "namespace:chainId" format',
+     112              :       );
+     113              :     }
+     114              : 
+     115              :     // Validate the namespaces
+     116            4 :     isValidNamespaces(
+     117              :       namespaces: namespaces,
+     118              :       context: 'isValidNamespacesChainId',
+     119              :     );
+     120              : 
+     121              :     // Get the chains from the namespaces and
+     122            4 :     List<String> chains = NamespaceUtils.getChainIdsFromNamespaces(
+     123              :       namespaces: namespaces,
+     124              :     );
+     125              : 
+     126            4 :     if (!chains.contains(chainId)) {
+     127            4 :       throw Errors.getSdkError(
+     128              :         Errors.UNSUPPORTED_CHAINS,
+     129            4 :         context: 'The chain $chainId is not supported',
+     130              :       );
+     131              :     }
+     132              : 
+     133              :     return true;
+     134              :   }
+     135              : 
+     136              :   /// Validates the provided chainId, then gets the methods for that chainId
+     137              :   /// and ensures that the method request is contained in the methods
+     138            4 :   static bool isValidNamespacesRequest({
+     139              :     required Map<String, Namespace> namespaces,
+     140              :     required String chainId,
+     141              :     required String method,
+     142              :   }) {
+     143              :     // Validate the chainId
+     144            4 :     if (!NamespaceUtils.isValidChainId(chainId)) {
+     145            1 :       throw Errors.getSdkError(
+     146              :         Errors.UNSUPPORTED_CHAINS,
+     147            1 :         context: 'chain $chainId should conform to "namespace:chainId" format',
+     148              :       );
+     149              :     }
+     150              : 
+     151              :     // Validate the namespaces
+     152            4 :     isValidNamespaces(
+     153              :       namespaces: namespaces,
+     154              :       context: 'isValidNamespacesRequest',
+     155              :     );
+     156              : 
+     157            4 :     List<dynamic> methods = NamespaceUtils.getNamespacesMethodsForChainId(
+     158              :       namespaces: namespaces,
+     159              :       chainId: chainId,
+     160              :     );
+     161              : 
+     162            4 :     if (!methods.contains(method)) {
+     163            4 :       throw Errors.getSdkError(
+     164              :         Errors.UNSUPPORTED_METHODS,
+     165            4 :         context: 'The method $method is not supported',
+     166              :       );
+     167              :     }
+     168              : 
+     169              :     return true;
+     170              :   }
+     171              : 
+     172              :   /// Validates the provided chainId, then gets the events for that chainId
+     173              :   /// and ensures that the event request is contained in the events
+     174            4 :   static bool isValidNamespacesEvent({
+     175              :     required Map<String, Namespace> namespaces,
+     176              :     required String chainId,
+     177              :     required String eventName,
+     178              :   }) {
+     179              :     // Validate the chainId
+     180            4 :     if (!NamespaceUtils.isValidChainId(chainId)) {
+     181            1 :       throw Errors.getSdkError(
+     182              :         Errors.UNSUPPORTED_CHAINS,
+     183            1 :         context: 'chain $chainId should conform to "namespace:chainId" format',
+     184              :       );
+     185              :     }
+     186              : 
+     187              :     // Validate the namespaces
+     188            4 :     isValidNamespaces(
+     189              :       namespaces: namespaces,
+     190              :       context: 'isValidNamespacesEvent',
+     191              :     );
+     192              : 
+     193            4 :     List<dynamic> events = NamespaceUtils.getNamespacesEventsForChain(
+     194              :       namespaces: namespaces,
+     195              :       chainId: chainId,
+     196              :     );
+     197              : 
+     198            4 :     if (!events.contains(eventName)) {
+     199            4 :       throw Errors.getSdkError(
+     200              :         Errors.UNSUPPORTED_EVENTS,
+     201            4 :         context: 'The event $eventName is not supported',
+     202              :       );
+     203              :     }
+     204              : 
+     205              :     return true;
+     206              :   }
+     207              : 
+     208              :   /// Makes sure that the chains, methods and events of the required namespaces
+     209              :   /// are contained in the namespaces
+     210            6 :   static bool isConformingNamespaces({
+     211              :     required Map<String, RequiredNamespace> requiredNamespaces,
+     212              :     required Map<String, Namespace> namespaces,
+     213              :     required String context,
+     214              :   }) {
+     215           12 :     List<String> requiredNamespaceKeys = requiredNamespaces.keys.toList();
+     216           12 :     List<String> namespaceKeys = namespaces.keys.toList();
+     217              : 
+     218              :     // If the namespaces doesn't have the correct keys, we can fail automatically
+     219            6 :     if (!isContainedIn(
+     220              :         container: namespaceKeys, contained: requiredNamespaceKeys)) {
+     221            4 :       throw Errors.getSdkError(
+     222              :         Errors.UNSUPPORTED_NAMESPACE_KEY,
+     223            4 :         context: "$context namespaces keys don't satisfy requiredNamespaces",
+     224              :       );
+     225              :     } else {
+     226           12 :       for (var key in requiredNamespaceKeys) {
+     227              :         List<String> requiredNamespaceChains =
+     228            6 :             NamespaceUtils.getChainsFromRequiredNamespace(
+     229              :           nsOrChainId: key,
+     230            6 :           requiredNamespace: requiredNamespaces[key]!,
+     231              :         );
+     232            6 :         List<String> namespaceChains = NamespaceUtils.getChainIdsFromNamespace(
+     233              :           nsOrChainId: key,
+     234            6 :           namespace: namespaces[key]!,
+     235              :         );
+     236              : 
+     237              :         // Check the chains, methods and events for overlaps.
+     238              :         // If any of them don't have it, we fail.
+     239            6 :         final bool chainsOverlap = isContainedIn(
+     240              :           container: namespaceChains,
+     241              :           contained: requiredNamespaceChains,
+     242              :         );
+     243            6 :         final bool methodsOverlap = isContainedIn(
+     244           12 :           container: namespaces[key]!.methods,
+     245           12 :           contained: requiredNamespaces[key]!.methods,
+     246              :         );
+     247            6 :         final bool eventsOverlap = isContainedIn(
+     248           12 :           container: namespaces[key]!.events,
+     249           12 :           contained: requiredNamespaces[key]!.events,
+     250              :         );
+     251              : 
+     252              :         if (!chainsOverlap) {
+     253            5 :           throw Errors.getSdkError(
+     254              :             Errors.UNSUPPORTED_CHAINS,
+     255              :             context:
+     256            5 :                 "$context namespaces chains don't satisfy requiredNamespaces chains for $key. Requested: $requiredNamespaceChains, Supported: $namespaceChains",
+     257              :           );
+     258              :         } else if (!methodsOverlap) {
+     259            2 :           throw Errors.getSdkError(
+     260              :             Errors.UNSUPPORTED_METHODS,
+     261              :             context:
+     262           10 :                 "$context namespaces methods don't satisfy requiredNamespaces methods for $key. Requested: ${requiredNamespaces[key]!.methods}, Supported: ${namespaces[key]!.methods}",
+     263              :           );
+     264              :         } else if (!eventsOverlap) {
+     265            2 :           throw Errors.getSdkError(
+     266              :             Errors.UNSUPPORTED_EVENTS,
+     267              :             context:
+     268           10 :                 "$context namespaces events don't satisfy requiredNamespaces events for $key. Requested: ${requiredNamespaces[key]!.events}, Supported: ${namespaces[key]!.events}",
+     269              :           );
+     270              :         }
+     271              :       }
+     272              :     }
+     273              : 
+     274              :     return true;
+     275              :   }
+     276              : 
+     277            4 :   static bool isSessionCompatible({
+     278              :     required SessionData session,
+     279              :     required Map<String, RequiredNamespace> requiredNamespaces,
+     280              :   }) {
+     281           12 :     List<String> sessionKeys = session.namespaces.keys.toList();
+     282            8 :     List<String> paramsKeys = requiredNamespaces.keys.toList();
+     283              :     bool compatible = true;
+     284              : 
+     285            4 :     if (!isContainedIn(container: sessionKeys, contained: paramsKeys)) {
+     286              :       return false;
+     287              :     }
+     288              : 
+     289            8 :     for (var key in sessionKeys) {
+     290            8 :       Namespace namespace = session.namespaces[key]!;
+     291            4 :       RequiredNamespace requiredNamespace = requiredNamespaces[key]!;
+     292              :       List<String> requiredNamespaceChains =
+     293            4 :           NamespaceUtils.getChainsFromRequiredNamespace(
+     294              :         nsOrChainId: key,
+     295              :         requiredNamespace: requiredNamespace,
+     296              :       );
+     297            4 :       List<String> namespaceChains = NamespaceUtils.getChainIdsFromNamespace(
+     298              :         nsOrChainId: key,
+     299              :         namespace: namespace,
+     300              :       );
+     301              : 
+     302              :       // Check the chains, methods and events for overlaps.
+     303              :       // If any of them don't have it, we fail.
+     304            4 :       final bool chainsOverlap = isContainedIn(
+     305              :         container: namespaceChains,
+     306              :         contained: requiredNamespaceChains,
+     307              :       );
+     308            4 :       final bool methodsOverlap = isContainedIn(
+     309            4 :         container: namespace.methods,
+     310            8 :         contained: requiredNamespaces[key]!.methods,
+     311              :       );
+     312            4 :       final bool eventsOverlap = isContainedIn(
+     313            4 :         container: namespace.events,
+     314            8 :         contained: requiredNamespaces[key]!.events,
+     315              :       );
+     316              : 
+     317              :       if (!chainsOverlap || !methodsOverlap || !eventsOverlap) {
+     318              :         compatible = false;
+     319              :       }
+     320              :     }
+     321              : 
+     322              :     return compatible;
+     323              :   }
+     324              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/snow.png b/coverage/html/snow.png new file mode 100644 index 0000000000000000000000000000000000000000..2cdae107fceec6e7f02ac7acb4a34a82a540caa5 GIT binary patch literal 141 zcmeAS@N?(olHy`uVBq!ia0vp^j3CU&3?x-=hn)ga>?NMQuI!iC1^MM!lvI6;R0X`wF|Ns97GD8ntt^-nBo-U3d c6}OTTfNUlP#;5A{K>8RwUHx3vIVCg!071?oo&W#< literal 0 HcmV?d00001 diff --git a/coverage/html/updown.png b/coverage/html/updown.png new file mode 100644 index 0000000000000000000000000000000000000000..aa56a238b3e6c435265250f9266cd1b8caba0f20 GIT binary patch literal 117 zcmeAS@N?(olHy`uVBq!ia0vp^AT}Qd8;}%R+`Ae`*?77*hG?8mPH5^{)z4*}Q$iB}huR`+ literal 0 HcmV?d00001 diff --git a/coverage/html/utils/errors.dart.func-c.html b/coverage/html/utils/errors.dart.func-c.html new file mode 100644 index 00000000..d443337b --- /dev/null +++ b/coverage/html/utils/errors.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - utils/errors.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - utils - errors.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %1414
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/utils/errors.dart.func.html b/coverage/html/utils/errors.dart.func.html new file mode 100644 index 00000000..a063dfc4 --- /dev/null +++ b/coverage/html/utils/errors.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - utils/errors.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - utils - errors.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %1414
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/utils/errors.dart.gcov.html b/coverage/html/utils/errors.dart.gcov.html new file mode 100644 index 00000000..147acfa7 --- /dev/null +++ b/coverage/html/utils/errors.dart.gcov.html @@ -0,0 +1,349 @@ + + + + + + + LCOV - lcov.info - utils/errors.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - utils - errors.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %1414
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
+       2              : 
+       3              : class Errors {
+       4              :   static const INVALID_METHOD = 'INVALID_METHOD';
+       5              :   static const INVALID_EVENT = 'INVALID_EVENT';
+       6              :   static const INVALID_UPDATE_REQUEST = 'INVALID_UPDATE_REQUEST';
+       7              :   static const INVALID_EXTEND_REQUEST = 'INVALID_EXTEND_REQUEST';
+       8              :   static const INVALID_SESSION_SETTLE_REQUEST =
+       9              :       'INVALID_SESSION_SETTLE_REQUEST';
+      10              :   static const UNAUTHORIZED_METHOD = 'UNAUTHORIZED_METHOD';
+      11              :   static const UNAUTHORIZED_EVENT = 'UNAUTHORIZED_EVENT';
+      12              :   static const UNAUTHORIZED_UPDATE_REQUEST = 'UNAUTHORIZED_UPDATE_REQUEST';
+      13              :   static const UNAUTHORIZED_EXTEND_REQUEST = 'UNAUTHORIZED_EXTEND_REQUEST';
+      14              :   static const USER_REJECTED_SIGN = 'USER_REJECTED_SIGN';
+      15              :   static const USER_REJECTED = 'USER_REJECTED';
+      16              :   static const USER_REJECTED_CHAINS = 'USER_REJECTED_CHAINS';
+      17              :   static const USER_REJECTED_METHODS = 'USER_REJECTED_METHODS';
+      18              :   static const USER_REJECTED_EVENTS = 'USER_REJECTED_EVENTS';
+      19              :   static const UNSUPPORTED_CHAINS = 'UNSUPPORTED_CHAINS';
+      20              :   static const UNSUPPORTED_METHODS = 'UNSUPPORTED_METHODS';
+      21              :   static const UNSUPPORTED_EVENTS = 'UNSUPPORTED_EVENTS';
+      22              :   static const UNSUPPORTED_ACCOUNTS = 'UNSUPPORTED_ACCOUNTS';
+      23              :   static const UNSUPPORTED_NAMESPACE_KEY = 'UNSUPPORTED_NAMESPACE_KEY';
+      24              :   static const USER_DISCONNECTED = 'USER_DISCONNECTED';
+      25              :   static const SESSION_SETTLEMENT_FAILED = 'SESSION_SETTLEMENT_FAILED';
+      26              :   static const NO_SESSION_FOR_TOPIC = 'NO_SESSION_FOR_TOPIC';
+      27              :   static const REQUEST_EXPIRED_SESSION = 'SESSION_REQUEST_EXPIRED';
+      28              :   static const WC_METHOD_UNSUPPORTED = 'WC_METHOD_UNSUPPORTED';
+      29              : 
+      30              :   // AUTH
+      31              :   static const MALFORMED_RESPONSE_PARAMS = 'MALFORMED_RESPONSE_PARAMS';
+      32              :   static const MALFORMED_REQUEST_PARAMS = 'MALFORMED_REQUEST_PARAMS';
+      33              :   static const MESSAGE_COMPROMISED = 'MESSAGE_COMPROMISED';
+      34              :   static const SIGNATURE_VERIFICATION_FAILED = 'SIGNATURE_VERIFICATION_FAILED';
+      35              :   static const REQUEST_EXPIRED_AUTH = 'AUTH_REQUEST_EXPIRED';
+      36              :   static const MISSING_ISSUER_AUTH = 'AUTH_MISSING_ISSUER';
+      37              :   static const USER_REJECTED_AUTH = 'AUTH_USER_REJECTED';
+      38              :   static const USER_DISCONNECTED_AUTH = 'AUTH_USER_DISCONNECTED';
+      39              : 
+      40              :   static const SDK_ERRORS = {
+      41              :     /* ----- INVALID (1xxx) ----- */
+      42              :     INVALID_METHOD: {
+      43              :       'message': 'Invalid method.',
+      44              :       'code': 1001,
+      45              :     },
+      46              :     INVALID_EVENT: {
+      47              :       'message': 'Invalid event.',
+      48              :       'code': 1002,
+      49              :     },
+      50              :     INVALID_UPDATE_REQUEST: {
+      51              :       'message': 'Invalid update request.',
+      52              :       'code': 1003,
+      53              :     },
+      54              :     INVALID_EXTEND_REQUEST: {
+      55              :       'message': 'Invalid extend request.',
+      56              :       'code': 1004,
+      57              :     },
+      58              :     INVALID_SESSION_SETTLE_REQUEST: {
+      59              :       'message': 'Invalid session settle request.',
+      60              :       'code': 1005,
+      61              :     },
+      62              :     /* ----- UNAUTHORIZED (3xxx) ----- */
+      63              :     UNAUTHORIZED_METHOD: {
+      64              :       'message': 'Unauthorized method.',
+      65              :       'code': 3001,
+      66              :     },
+      67              :     UNAUTHORIZED_EVENT: {
+      68              :       'message': 'Unauthorized event.',
+      69              :       'code': 3002,
+      70              :     },
+      71              :     UNAUTHORIZED_UPDATE_REQUEST: {
+      72              :       'message': 'Unauthorized update request.',
+      73              :       'code': 3003,
+      74              :     },
+      75              :     UNAUTHORIZED_EXTEND_REQUEST: {
+      76              :       'message': 'Unauthorized extend request.',
+      77              :       'code': 3004,
+      78              :     },
+      79              :     /* ----- REJECTED (5xxx) ----- */
+      80              :     USER_REJECTED_SIGN: {
+      81              :       'message': 'User rejected.',
+      82              :       'code': 4001,
+      83              :     },
+      84              :     /* ----- REJECTED (5xxx) ----- */
+      85              :     USER_REJECTED: {
+      86              :       'message': 'User rejected.',
+      87              :       'code': 5000,
+      88              :     },
+      89              :     USER_REJECTED_CHAINS: {
+      90              :       'message': 'User rejected chains.',
+      91              :       'code': 5001,
+      92              :     },
+      93              :     USER_REJECTED_METHODS: {
+      94              :       'message': 'User rejected methods.',
+      95              :       'code': 5002,
+      96              :     },
+      97              :     USER_REJECTED_EVENTS: {
+      98              :       'message': 'User rejected events.',
+      99              :       'code': 5003,
+     100              :     },
+     101              :     UNSUPPORTED_CHAINS: {
+     102              :       'message': 'Unsupported chains.',
+     103              :       'code': 5100,
+     104              :     },
+     105              :     UNSUPPORTED_METHODS: {
+     106              :       'message': 'Unsupported methods.',
+     107              :       'code': 5101,
+     108              :     },
+     109              :     UNSUPPORTED_EVENTS: {
+     110              :       'message': 'Unsupported events.',
+     111              :       'code': 5102,
+     112              :     },
+     113              :     UNSUPPORTED_ACCOUNTS: {
+     114              :       'message': 'Unsupported accounts.',
+     115              :       'code': 5103,
+     116              :     },
+     117              :     UNSUPPORTED_NAMESPACE_KEY: {
+     118              :       'message': 'Unsupported namespace key.',
+     119              :       'code': 5104,
+     120              :     },
+     121              :     /* ----- REASON (6xxx) ----- */
+     122              :     USER_DISCONNECTED: {
+     123              :       'message': 'User disconnected.',
+     124              :       'code': 6000,
+     125              :     },
+     126              :     /* ----- FAILURE (7xxx) ----- */
+     127              :     SESSION_SETTLEMENT_FAILED: {
+     128              :       'message': 'Session settlement failed.',
+     129              :       'code': 7000,
+     130              :     },
+     131              :     NO_SESSION_FOR_TOPIC: {
+     132              :       'message': 'No session for topic.',
+     133              :       'code': 7001,
+     134              :     },
+     135              :     /* ----- FAILURE (8xxx) ----- */
+     136              :     REQUEST_EXPIRED_SESSION: {
+     137              :       'message': 'Session request expired.',
+     138              :       'code': 8000,
+     139              :     },
+     140              :     /* ----- PAIRING (10xxx) ----- */
+     141              :     WC_METHOD_UNSUPPORTED: {
+     142              :       'message': 'Unsupported wc_ method.',
+     143              :       'code': 10001,
+     144              :     },
+     145              :     /* ----- AUTH VALIDATION (11xxx) ----- */
+     146              :     MALFORMED_RESPONSE_PARAMS: {
+     147              :       'message': 'Malformed response parameters.',
+     148              :       'code': 11001,
+     149              :     },
+     150              :     MALFORMED_REQUEST_PARAMS: {
+     151              :       'message': 'Malformed request parameters.',
+     152              :       'code': 11002,
+     153              :     },
+     154              :     MESSAGE_COMPROMISED: {
+     155              :       'message': 'Message compromised.',
+     156              :       'code': 11003,
+     157              :     },
+     158              :     SIGNATURE_VERIFICATION_FAILED: {
+     159              :       'message': 'Signature verification failed.',
+     160              :       'code': 11004,
+     161              :     },
+     162              :     REQUEST_EXPIRED_AUTH: {
+     163              :       'message': 'Auth request expired.',
+     164              :       'code': 11005,
+     165              :     },
+     166              :     MISSING_ISSUER_AUTH: {
+     167              :       'message': 'Missing Issuer.',
+     168              :       'code': 11006,
+     169              :     },
+     170              :     /* ----- AUTH REJECTED (12xxx) ----- */
+     171              :     USER_REJECTED_AUTH: {
+     172              :       'message': 'User rejected auth request.',
+     173              :       'code': 12001,
+     174              :     },
+     175              :     USER_DISCONNECTED_AUTH: {
+     176              :       'message': 'User disconnect auth.',
+     177              :       'code': 12002,
+     178              :     },
+     179              :   };
+     180              : 
+     181              :   static const NOT_INITIALIZED = 'NOT_INITIALIZED';
+     182              :   static const NO_MATCHING_KEY = 'NO_MATCHING_KEY';
+     183              :   static const RESTORE_WILL_OVERRIDE = 'RESTORE_WILL_OVERRIDE';
+     184              :   static const RESUBSCRIBED = 'RESUBSCRIBED';
+     185              :   static const MISSING_OR_INVALID = 'MISSING_OR_INVALID';
+     186              :   static const EXPIRED = 'EXPIRED';
+     187              :   static const UNKNOWN_TYPE = 'UNKNOWN_TYPE';
+     188              :   static const MISMATCHED_TOPIC = 'MISMATCHED_TOPIC';
+     189              :   static const NON_CONFORMING_NAMESPACES = 'NON_CONFORMING_NAMESPACES';
+     190              : 
+     191              :   static const INTERNAL_ERRORS = {
+     192              :     NOT_INITIALIZED: {
+     193              :       'message': 'Not initialized.',
+     194              :       'code': 1,
+     195              :     },
+     196              :     NO_MATCHING_KEY: {
+     197              :       'message': 'No matching key.',
+     198              :       'code': 2,
+     199              :     },
+     200              :     RESTORE_WILL_OVERRIDE: {
+     201              :       'message': 'Restore will override.',
+     202              :       'code': 3,
+     203              :     },
+     204              :     RESUBSCRIBED: {
+     205              :       'message': 'Resubscribed.',
+     206              :       'code': 4,
+     207              :     },
+     208              :     MISSING_OR_INVALID: {
+     209              :       'message': 'Missing or invalid.',
+     210              :       'code': 5,
+     211              :     },
+     212              :     EXPIRED: {
+     213              :       'message': 'Expired.',
+     214              :       'code': 6,
+     215              :     },
+     216              :     UNKNOWN_TYPE: {
+     217              :       'message': 'Unknown type.',
+     218              :       'code': 7,
+     219              :     },
+     220              :     MISMATCHED_TOPIC: {
+     221              :       'message': 'Mismatched topic.',
+     222              :       'code': 8,
+     223              :     },
+     224              :     NON_CONFORMING_NAMESPACES: {
+     225              :       'message': 'Non conforming namespaces.',
+     226              :       'code': 9,
+     227              :     },
+     228              :   };
+     229              : 
+     230            7 :   static WalletConnectError getInternalError(
+     231              :     String key, {
+     232              :     String context = '',
+     233              :   }) {
+     234            7 :     if (INTERNAL_ERRORS.containsKey(key)) {
+     235            7 :       return WalletConnectError(
+     236           14 :         code: INTERNAL_ERRORS[key]!['code']! as int,
+     237            7 :         message: context != ''
+     238           12 :             ? "${INTERNAL_ERRORS[key]!['message']! as String} $context"
+     239            8 :             : INTERNAL_ERRORS[key]!['message']! as String,
+     240              :       );
+     241              :     }
+     242              :     return const WalletConnectError(
+     243              :         code: -1, message: 'UNKNOWN INTERNAL ERROR');
+     244              :   }
+     245              : 
+     246            6 :   static WalletConnectError getSdkError(
+     247              :     String key, {
+     248              :     String context = '',
+     249              :   }) {
+     250            6 :     if (SDK_ERRORS.containsKey(key)) {
+     251            6 :       return WalletConnectError(
+     252           12 :         code: SDK_ERRORS[key]!['code']! as int,
+     253            6 :         message: context != ''
+     254           12 :             ? "${SDK_ERRORS[key]!['message']! as String} $context"
+     255           14 :             : SDK_ERRORS[key]!['message']! as String,
+     256              :       );
+     257              :     }
+     258              :     return const WalletConnectError(code: -1, message: 'UNKNOWN SDK ERROR');
+     259              :   }
+     260              : }
+     261              : 
+     262              : class WebSocketErrors {
+     263              :   static const int PROJECT_ID_NOT_FOUND = 401;
+     264              :   static const int INVALID_PROJECT_ID = 403;
+     265              :   static const int TOO_MANY_REQUESTS = 1013;
+     266              :   static const String INVALID_PROJECT_ID_OR_JWT =
+     267              :       'Invalid project ID or JWT Token';
+     268              :   static const String INVALID_PROJECT_ID_MESSAGE =
+     269              :       'Invalid project id. Please check your project id.';
+     270              :   static const String PROJECT_ID_NOT_FOUND_MESSAGE = 'Project id not found.';
+     271              :   static const String TOO_MANY_REQUESTS_MESSAGE =
+     272              :       'Too many requests. Please try again later.';
+     273              : 
+     274              :   static const int SERVER_TERMINATING = 1001;
+     275              :   static const int CLIENT_STALE = 4008;
+     276              :   static const int LOAD_REBALANCING = 4010;
+     277              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/utils/extensions.dart.func-c.html b/coverage/html/utils/extensions.dart.func-c.html new file mode 100644 index 00000000..be64b2eb --- /dev/null +++ b/coverage/html/utils/extensions.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - utils/extensions.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - utils - extensions.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %400
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/utils/extensions.dart.func.html b/coverage/html/utils/extensions.dart.func.html new file mode 100644 index 00000000..9d6d0e10 --- /dev/null +++ b/coverage/html/utils/extensions.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - utils/extensions.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - utils - extensions.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %400
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/utils/extensions.dart.gcov.html b/coverage/html/utils/extensions.dart.gcov.html new file mode 100644 index 00000000..2eb02495 --- /dev/null +++ b/coverage/html/utils/extensions.dart.gcov.html @@ -0,0 +1,152 @@ + + + + + + + LCOV - lcov.info - utils/extensions.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - utils - extensions.dartCoverageTotalHit
Test:lcov.infoLines:0.0 %400
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:typed_data';
+       2              : 
+       3              : import 'package:convert/convert.dart';
+       4              : import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart';
+       5              : import 'package:web3dart/crypto.dart' as crypto;
+       6              : 
+       7              : extension TransactionExtension on Transaction {
+       8            0 :   Map<String, dynamic> toJson() {
+       9            0 :     return {
+      10            0 :       if (from != null) 'from': from!.hex,
+      11            0 :       if (to != null) 'to': to!.hex,
+      12            0 :       if (maxGas != null) 'gas': '0x${maxGas!.toRadixString(16)}',
+      13            0 :       if (gasPrice != null)
+      14            0 :         'gasPrice': '0x${gasPrice!.getInWei.toRadixString(16)}',
+      15            0 :       if (value != null) 'value': '0x${value!.getInWei.toRadixString(16)}',
+      16            0 :       if (data != null) 'data': crypto.bytesToHex(data!),
+      17            0 :       if (nonce != null) 'nonce': nonce,
+      18            0 :       if (maxFeePerGas != null)
+      19            0 :         'maxFeePerGas': '0x${maxFeePerGas!.getInWei.toRadixString(16)}',
+      20            0 :       if (maxPriorityFeePerGas != null)
+      21            0 :         'maxPriorityFeePerGas':
+      22            0 :             '0x${maxPriorityFeePerGas!.getInWei.toRadixString(16)}',
+      23              :     };
+      24              :   }
+      25              : }
+      26              : 
+      27              : extension TransactionExtension2 on Map<String, dynamic> {
+      28            0 :   Transaction toTransaction() {
+      29            0 :     return Transaction(
+      30            0 :       from: EthereumAddress.fromHex(this['from']),
+      31            0 :       to: EthereumAddress.fromHex(this['to']),
+      32            0 :       value: (this['value'] as String?).toEthereAmount(),
+      33            0 :       gasPrice: (this['gasPrice'] as String?).toEthereAmount(),
+      34            0 :       maxFeePerGas: (this['maxFeePerGas'] as String?).toEthereAmount(),
+      35              :       maxPriorityFeePerGas:
+      36            0 :           (this['maxPriorityFeePerGas'] as String?).toEthereAmount(),
+      37            0 :       maxGas: (this['maxGas'] as String?).toIntFromHex(),
+      38            0 :       nonce: this['nonce']?.toInt(),
+      39            0 :       data: _parseTransactionData(this['data']),
+      40              :     );
+      41              :   }
+      42              : }
+      43              : 
+      44            0 : Uint8List? _parseTransactionData(dynamic data) {
+      45            0 :   if (data != null && data != '0x') {
+      46            0 :     if (data.startsWith('0x')) {
+      47            0 :       return Uint8List.fromList(hex.decode(data.substring(2)));
+      48              :     }
+      49            0 :     return Uint8List.fromList(hex.decode(data));
+      50              :   }
+      51              :   return null;
+      52              : }
+      53              : 
+      54              : extension EtheraAmountExtension on String? {
+      55            0 :   EtherAmount? toEthereAmount() {
+      56              :     if (this != null) {
+      57            0 :       final hexValue = this!.replaceFirst('0x', '');
+      58            0 :       return EtherAmount.fromBigInt(
+      59              :         EtherUnit.wei,
+      60            0 :         BigInt.from(int.parse(hexValue, radix: 16)),
+      61              :       );
+      62              :     }
+      63              :     return null;
+      64              :   }
+      65              : 
+      66            0 :   int? toIntFromHex() {
+      67              :     if (this != null) {
+      68            0 :       final hexValue = this!.replaceFirst('0x', '');
+      69            0 :       return int.parse(hexValue, radix: 16);
+      70              :     }
+      71              :     return null;
+      72              :   }
+      73              : 
+      74            0 :   int? toInt() {
+      75              :     if (this != null) {
+      76            0 :       return int.tryParse(this!);
+      77              :     }
+      78              :     return null;
+      79              :   }
+      80              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/utils/index-sort-f.html b/coverage/html/utils/index-sort-f.html new file mode 100644 index 00000000..1185ae09 --- /dev/null +++ b/coverage/html/utils/index-sort-f.html @@ -0,0 +1,153 @@ + + + + + + + LCOV - lcov.info - utils + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - utilsCoverageTotalHit
Test:lcov.infoLines:71.2 %319227
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
errors.dart +
100.0%
+
100.0 %1414-
extensions.dart +
0.0%
+
0.0 %40-
log_level.dart +
100.0%
+
100.0 %77-
namespace_utils.dart +
76.2%76.2%
+
76.2 %168128-
walletconnect_utils.dart +
86.7%86.7%
+
86.7 %9078-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/utils/index-sort-l.html b/coverage/html/utils/index-sort-l.html new file mode 100644 index 00000000..1bd04649 --- /dev/null +++ b/coverage/html/utils/index-sort-l.html @@ -0,0 +1,127 @@ + + + + + + + LCOV - lcov.info - utils + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - utilsCoverageTotalHit
Test:lcov.infoLines:71.2 %319227
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
extensions.dart +
0.0%
+
0.0 %40
namespace_utils.dart +
76.2%76.2%
+
76.2 %168128
walletconnect_utils.dart +
86.7%86.7%
+
86.7 %9078
log_level.dart +
100.0%
+
100.0 %77
errors.dart +
100.0%
+
100.0 %1414
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/utils/index.html b/coverage/html/utils/index.html new file mode 100644 index 00000000..a7edd2ee --- /dev/null +++ b/coverage/html/utils/index.html @@ -0,0 +1,127 @@ + + + + + + + LCOV - lcov.info - utils + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - utilsCoverageTotalHit
Test:lcov.infoLines:71.2 %319227
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
errors.dart +
100.0%
+
100.0 %1414
extensions.dart +
0.0%
+
0.0 %40
log_level.dart +
100.0%
+
100.0 %77
namespace_utils.dart +
76.2%76.2%
+
76.2 %168128
walletconnect_utils.dart +
86.7%86.7%
+
86.7 %9078
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/utils/log_level.dart.func-c.html b/coverage/html/utils/log_level.dart.func-c.html new file mode 100644 index 00000000..36dea479 --- /dev/null +++ b/coverage/html/utils/log_level.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - utils/log_level.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - utils - log_level.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %77
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/utils/log_level.dart.func.html b/coverage/html/utils/log_level.dart.func.html new file mode 100644 index 00000000..6305a1d9 --- /dev/null +++ b/coverage/html/utils/log_level.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - utils/log_level.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - utils - log_level.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %77
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/utils/log_level.dart.gcov.html b/coverage/html/utils/log_level.dart.gcov.html new file mode 100644 index 00000000..de0219dc --- /dev/null +++ b/coverage/html/utils/log_level.dart.gcov.html @@ -0,0 +1,102 @@ + + + + + + + LCOV - lcov.info - utils/log_level.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - utils - log_level.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %77
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:logger/logger.dart';
+       2              : 
+       3              : enum LogLevel {
+       4              :   verbose,
+       5              :   debug,
+       6              :   info,
+       7              :   warning,
+       8              :   error,
+       9              :   wtf,
+      10              :   nothing;
+      11              : 
+      12           10 :   Level toLevel() {
+      13              :     switch (this) {
+      14           10 :       case LogLevel.verbose:
+      15              :         return Level.trace;
+      16           10 :       case LogLevel.debug:
+      17              :         return Level.debug;
+      18           10 :       case LogLevel.info:
+      19              :         return Level.info;
+      20            6 :       case LogLevel.warning:
+      21              :         return Level.warning;
+      22            6 :       case LogLevel.error:
+      23              :         return Level.error;
+      24            6 :       case LogLevel.wtf:
+      25              :         return Level.fatal;
+      26              :       default:
+      27              :         return Level.off;
+      28              :     }
+      29              :   }
+      30              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/utils/namespace_utils.dart.func-c.html b/coverage/html/utils/namespace_utils.dart.func-c.html new file mode 100644 index 00000000..11a15ec7 --- /dev/null +++ b/coverage/html/utils/namespace_utils.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - utils/namespace_utils.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - utils - namespace_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:76.2 %168128
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/utils/namespace_utils.dart.func.html b/coverage/html/utils/namespace_utils.dart.func.html new file mode 100644 index 00000000..0d1b2b48 --- /dev/null +++ b/coverage/html/utils/namespace_utils.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - utils/namespace_utils.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - utils - namespace_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:76.2 %168128
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/utils/namespace_utils.dart.gcov.html b/coverage/html/utils/namespace_utils.dart.gcov.html new file mode 100644 index 00000000..39745484 --- /dev/null +++ b/coverage/html/utils/namespace_utils.dart.gcov.html @@ -0,0 +1,515 @@ + + + + + + + LCOV - lcov.info - utils/namespace_utils.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - utils - namespace_utils.dartCoverageTotalHit
Test:lcov.infoLines:76.2 %168128
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/proposal_models.dart';
+       2              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/session_models.dart';
+       3              : import 'package:walletconnect_flutter_v2/apis/utils/constants.dart';
+       4              : 
+       5              : class NamespaceUtils {
+       6              :   /// Checks if the string is a chain
+       7            6 :   static bool isValidChainId(String value) {
+       8            6 :     if (value.contains(':')) {
+       9            6 :       List<String> split = value.split(':');
+      10           12 :       return split.length == 2;
+      11              :     }
+      12              :     return false;
+      13              :   }
+      14              : 
+      15              :   /// Checks if the string is an account
+      16            6 :   static bool isValidAccount(String value) {
+      17            6 :     if (value.contains(':')) {
+      18            6 :       List<String> split = value.split(':');
+      19           12 :       if (split.length == 3) {
+      20           18 :         String chainId = '${split[0]}:${split[1]}';
+      21           18 :         return split.length >= 2 && isValidChainId(chainId);
+      22              :       }
+      23              :     }
+      24              :     return false;
+      25              :   }
+      26              : 
+      27            4 :   static bool isValidUrl(String value) {
+      28              :     try {
+      29            4 :       Uri.parse(value);
+      30              :       return true;
+      31              :     } catch (e) {
+      32              :       return false;
+      33              :     }
+      34              :   }
+      35              : 
+      36            1 :   static String getAccount(String namespaceAccount) {
+      37            1 :     if (isValidAccount(namespaceAccount)) {
+      38            2 :       return namespaceAccount.split(':')[2];
+      39              :     }
+      40              :     return namespaceAccount;
+      41              :   }
+      42              : 
+      43            6 :   static String getChainFromAccount(String account) {
+      44            6 :     if (isValidAccount(account)) {
+      45            6 :       List<String> parts = account.split(':');
+      46            6 :       String namespace = parts[0];
+      47            6 :       String reference = parts[1];
+      48            6 :       return '$namespace:$reference';
+      49              :     }
+      50              :     return account;
+      51              :   }
+      52              : 
+      53              :   /// Gets all unique chains from the provided list of accounts
+      54              :   /// This function assumes that all accounts are valid
+      55            6 :   static List<String> getChainsFromAccounts(List<String> accounts) {
+      56              :     Set<String> chains = {};
+      57           12 :     for (var account in accounts) {
+      58            6 :       chains.add(
+      59            6 :         getChainFromAccount(
+      60              :           account,
+      61              :         ),
+      62              :       );
+      63              :     }
+      64              : 
+      65            6 :     return chains.toList();
+      66              :   }
+      67              : 
+      68              :   /// Gets the namespace string id from the chainId
+      69              :   /// If the chain id is not valid, then it returns the chain id
+      70            1 :   static String getNamespaceFromChain(String chainId) {
+      71            1 :     if (isValidChainId(chainId)) {
+      72            2 :       return chainId.split(':')[0];
+      73              :     }
+      74              :     return chainId;
+      75              :   }
+      76              : 
+      77              :   /// Gets all unique namespaces from the provided list of accounts
+      78              :   /// This function assumes that all accounts are valid
+      79            0 :   static Map<String, Namespace> getNamespacesFromAccounts(
+      80              :     List<String> accounts,
+      81              :   ) {
+      82            0 :     Map<String, Namespace> namespaces = {};
+      83            0 :     for (var account in accounts) {
+      84            0 :       final ns = account.split(':')[0];
+      85            0 :       final cid = account.split(':')[1];
+      86            0 :       if (namespaces[ns] == null) {
+      87            0 :         namespaces[ns] = Namespace(
+      88            0 :           accounts: [],
+      89            0 :           methods: [],
+      90            0 :           events: [],
+      91              :         );
+      92              :       }
+      93            0 :       namespaces[ns] = namespaces[ns]!.copyWith(
+      94            0 :         accounts: [
+      95            0 :           ...namespaces[ns]!.accounts,
+      96            0 :           account,
+      97              :         ],
+      98            0 :         chains: [
+      99            0 :           ...(namespaces[ns]?.chains ?? []),
+     100            0 :           '$ns:$cid',
+     101              :         ],
+     102              :       );
+     103              :     }
+     104              : 
+     105              :     return namespaces;
+     106              :   }
+     107              : 
+     108              :   /// Gets the chains from the namespace.
+     109              :   /// If the namespace is a chain, then it returns the chain.
+     110              :   /// Otherwise it gets the chains from the accounts in the namespace.
+     111            6 :   static List<String> getChainIdsFromNamespace({
+     112              :     required String nsOrChainId,
+     113              :     required Namespace namespace,
+     114              :   }) {
+     115            6 :     if (isValidChainId(nsOrChainId)) {
+     116            6 :       return [nsOrChainId];
+     117              :     }
+     118              : 
+     119           12 :     return getChainsFromAccounts(namespace.accounts);
+     120              :   }
+     121              : 
+     122              :   /// Gets the chainIds from the namespace.
+     123            5 :   static List<String> getChainIdsFromNamespaces({
+     124              :     required Map<String, Namespace> namespaces,
+     125              :   }) {
+     126              :     Set<String> chainIds = {};
+     127              : 
+     128           10 :     namespaces.forEach((String ns, Namespace namespace) {
+     129            5 :       chainIds.addAll(
+     130            5 :         getChainIdsFromNamespace(
+     131              :           nsOrChainId: ns,
+     132              :           namespace: namespace,
+     133              :         ),
+     134              :       );
+     135              :     });
+     136              : 
+     137            5 :     return chainIds.toList();
+     138              :   }
+     139              : 
+     140              :   /// Gets the methods from a namespace map for the given chain
+     141            5 :   static List<String> getNamespacesMethodsForChainId({
+     142              :     required String chainId,
+     143              :     required Map<String, Namespace> namespaces,
+     144              :   }) {
+     145            5 :     List<String> methods = [];
+     146           10 :     namespaces.forEach((String nsOrChain, Namespace namespace) {
+     147            5 :       if (nsOrChain == chainId) {
+     148            2 :         methods.addAll(namespace.methods);
+     149              :       } else {
+     150           10 :         List<String> chains = getChainsFromAccounts(namespace.accounts);
+     151            5 :         if (chains.contains(chainId)) {
+     152           10 :           methods.addAll(namespace.methods);
+     153              :         }
+     154              :       }
+     155              :     });
+     156              : 
+     157              :     return methods;
+     158              :   }
+     159              : 
+     160              :   /// Gets the optional methods from a namespace map for the given chain
+     161            0 :   static List<String> getOptionalMethodsForChainId({
+     162              :     required String chainId,
+     163              :     required Map<String, RequiredNamespace> optionalNamespaces,
+     164              :   }) {
+     165            0 :     List<String> methods = [];
+     166            0 :     optionalNamespaces.forEach((String nsOrChain, RequiredNamespace rns) {
+     167            0 :       if (nsOrChain == chainId) {
+     168            0 :         methods.addAll(rns.methods);
+     169              :       } else {
+     170            0 :         if ((rns.chains ?? []).contains('$nsOrChain:$chainId')) {
+     171            0 :           methods.addAll(rns.methods);
+     172              :         }
+     173              :       }
+     174              :     });
+     175              : 
+     176              :     return methods;
+     177              :   }
+     178              : 
+     179              :   /// Gets the methods from a namespace map for the given chain id
+     180            5 :   static List<String> getNamespacesEventsForChain({
+     181              :     required String chainId,
+     182              :     required Map<String, Namespace> namespaces,
+     183              :   }) {
+     184            5 :     List<String> events = [];
+     185           10 :     namespaces.forEach((String nsOrChain, Namespace namespace) {
+     186            5 :       if (nsOrChain == chainId) {
+     187            2 :         events.addAll(namespace.events);
+     188              :       } else {
+     189           10 :         List<String> chains = getChainsFromAccounts(namespace.accounts);
+     190            5 :         if (chains.contains(chainId)) {
+     191           10 :           events.addAll(namespace.events);
+     192              :         }
+     193              :       }
+     194              :     });
+     195              : 
+     196              :     return events;
+     197              :   }
+     198              : 
+     199              :   /// If the namespace is a chain, add it to the list and return it
+     200              :   /// Otherwise, get the chains from the required namespaces
+     201            6 :   static List<String> getChainsFromRequiredNamespace({
+     202              :     required String nsOrChainId,
+     203              :     required RequiredNamespace requiredNamespace,
+     204              :   }) {
+     205            6 :     List<String> chains = [];
+     206            6 :     if (isValidChainId(nsOrChainId)) {
+     207            6 :       chains.add(nsOrChainId);
+     208            6 :     } else if (requiredNamespace.chains != null) {
+     209              :       // We are assuming that the namespace is a chain
+     210              :       // Validate the requiredNamespace before it is sent here
+     211           12 :       chains.addAll(requiredNamespace.chains!);
+     212              :     }
+     213              : 
+     214              :     return chains;
+     215              :   }
+     216              : 
+     217              :   /// Gets the chains from the required namespaces
+     218              :   /// If keys value is provided, it will only get the chains for the provided keys
+     219            1 :   static List<String> getChainIdsFromRequiredNamespaces({
+     220              :     required Map<String, RequiredNamespace> requiredNamespaces,
+     221              :   }) {
+     222              :     Set<String> chainIds = {};
+     223              : 
+     224              :     // Loop through the required namespaces
+     225            2 :     requiredNamespaces.forEach((String ns, RequiredNamespace value) {
+     226            1 :       chainIds.addAll(
+     227            1 :         getChainsFromRequiredNamespace(
+     228              :           nsOrChainId: ns,
+     229              :           requiredNamespace: value,
+     230              :         ),
+     231              :       );
+     232              :     });
+     233              : 
+     234            1 :     return chainIds.toList();
+     235              :   }
+     236              : 
+     237              :   /// Using the availabe accounts, methods, and events, construct the namespaces
+     238              :   /// If optional namespaces are provided, then they will be added to the namespaces as well
+     239            4 :   static Map<String, Namespace> constructNamespaces({
+     240              :     required Set<String> availableAccounts,
+     241              :     required Set<String> availableMethods,
+     242              :     required Set<String> availableEvents,
+     243              :     required Map<String, RequiredNamespace> requiredNamespaces,
+     244              :     Map<String, RequiredNamespace>? optionalNamespaces,
+     245              :   }) {
+     246            4 :     final Map<String, Namespace> namespaces = _constructNamespaces(
+     247              :       availableAccounts: availableAccounts,
+     248              :       availableMethods: availableMethods,
+     249              :       availableEvents: availableEvents,
+     250              :       namespacesMap: requiredNamespaces,
+     251              :     );
+     252            4 :     final Map<String, Namespace> optionals = _constructNamespaces(
+     253              :       availableAccounts: availableAccounts,
+     254              :       availableMethods: availableMethods,
+     255              :       availableEvents: availableEvents,
+     256            1 :       namespacesMap: optionalNamespaces ?? {},
+     257              :     );
+     258              : 
+     259              :     // Loop through the optional keys and if they exist in the namespaces, then merge them and delete them from optional
+     260            8 :     List<String> keys = optionals.keys.toList();
+     261            9 :     for (int i = 0; i < keys.length; i++) {
+     262            1 :       String key = keys[i];
+     263            1 :       if (namespaces.containsKey(key)) {
+     264            2 :         namespaces[key] = Namespace(
+     265            1 :           accounts: namespaces[key]!
+     266            1 :               .accounts
+     267            1 :               .toSet()
+     268            4 :               .union(optionals[key]!.accounts.toSet())
+     269            1 :               .toList(),
+     270            1 :           methods: namespaces[key]!
+     271            1 :               .methods
+     272            1 :               .toSet()
+     273            4 :               .union(optionals[key]!.methods.toSet())
+     274            1 :               .toList(),
+     275            1 :           events: namespaces[key]!
+     276            1 :               .events
+     277            1 :               .toSet()
+     278            4 :               .union(optionals[key]!.events.toSet())
+     279            1 :               .toList(),
+     280              :         );
+     281            1 :         optionals.remove(key);
+     282              :       }
+     283              :     }
+     284              : 
+     285            4 :     return {
+     286              :       ...namespaces,
+     287            4 :       ...optionals,
+     288              :     };
+     289              :   }
+     290              : 
+     291            0 :   static Map<String, Namespace> buildNamespacesFromAuth({
+     292              :     required Set<String> methods,
+     293              :     required Set<String> accounts,
+     294              :   }) {
+     295            0 :     final parsedAccounts = accounts.map(
+     296            0 :       (account) => account.replaceAll('did:pkh:', ''),
+     297              :     );
+     298              : 
+     299            0 :     final namespaces = getNamespacesFromAccounts(parsedAccounts.toList());
+     300              : 
+     301            0 :     final entries = namespaces.entries.map((e) {
+     302            0 :       return MapEntry(
+     303            0 :         e.key,
+     304            0 :         Namespace.fromJson(e.value.toJson()).copyWith(
+     305            0 :           methods: methods.toList(),
+     306              :           events: EventsConstants.allEvents,
+     307              :         ),
+     308              :       );
+     309              :     });
+     310              : 
+     311            0 :     return Map<String, Namespace>.fromEntries(entries);
+     312              :   }
+     313              : 
+     314              :   /// Gets the matching items from the available items using the chainId
+     315              :   /// This function assumes that each element in the available items is in the format of chainId:itemId
+     316            4 :   static Set<String> _getMatching({
+     317              :     required String namespaceOrChainId,
+     318              :     required Set<String> available,
+     319              :     Set<String>? requested,
+     320              :     bool takeLast = true,
+     321              :   }) {
+     322              :     Set<String> matching = {};
+     323              :     // Loop through the available items, and if it starts with the chainId,
+     324              :     // and is in the requested items, add it to the matching items
+     325            8 :     for (var item in available) {
+     326            8 :       if (item.startsWith('$namespaceOrChainId:')) {
+     327           12 :         matching.add(takeLast ? item.split(':').last : item);
+     328              :       }
+     329              :     }
+     330              : 
+     331              :     if (requested != null) {
+     332            4 :       matching = matching.intersection(requested);
+     333              :     }
+     334              : 
+     335              :     return matching;
+     336              :   }
+     337              : 
+     338            4 :   static Map<String, Namespace> _constructNamespaces({
+     339              :     required Set<String> availableAccounts,
+     340              :     required Set<String> availableMethods,
+     341              :     required Set<String> availableEvents,
+     342              :     required Map<String, RequiredNamespace> namespacesMap,
+     343              :   }) {
+     344            4 :     Map<String, Namespace> namespaces = {};
+     345              : 
+     346              :     // Loop through the required namespaces
+     347            8 :     for (final String namespaceOrChainId in namespacesMap.keys) {
+     348              :       // If the key is a chain, add all of the chain specific events, keys, and methods first
+     349            4 :       final List<String> accounts = [];
+     350            4 :       final List<String> events = [];
+     351            4 :       final List<String> methods = [];
+     352            4 :       final namespace = namespacesMap[namespaceOrChainId]!;
+     353            8 :       final chains = namespace.chains ?? [];
+     354            8 :       if (NamespaceUtils.isValidChainId(namespaceOrChainId) || chains.isEmpty) {
+     355              :         // Add the chain specific availableAccounts
+     356            4 :         accounts.addAll(
+     357            4 :           _getMatching(
+     358              :             namespaceOrChainId: namespaceOrChainId,
+     359              :             available: availableAccounts,
+     360              :             takeLast: false,
+     361              :           ),
+     362              :         );
+     363              :         // Add the chain specific events
+     364            4 :         events.addAll(
+     365            4 :           _getMatching(
+     366              :             namespaceOrChainId: namespaceOrChainId,
+     367              :             available: availableEvents,
+     368            8 :             requested: namespace.events.toSet(),
+     369              :           ),
+     370              :         );
+     371              :         // Add the chain specific methods
+     372            4 :         methods.addAll(
+     373            4 :           _getMatching(
+     374              :             namespaceOrChainId: namespaceOrChainId,
+     375              :             available: availableMethods,
+     376            8 :             requested: namespace.methods.toSet(),
+     377              :           ),
+     378              :         );
+     379              :       } else {
+     380              :         // Loop through all of the chains
+     381            8 :         for (final String chainId in chains) {
+     382              :           // Add the chain specific availableAccounts
+     383            4 :           accounts.addAll(
+     384            4 :             _getMatching(
+     385              :               namespaceOrChainId: chainId,
+     386              :               available: availableAccounts,
+     387           12 :             ).map((e) => '$chainId:$e'),
+     388              :           );
+     389              :           // Add the chain specific events
+     390            4 :           events.addAll(
+     391            4 :             _getMatching(
+     392              :               namespaceOrChainId: chainId,
+     393              :               available: availableEvents,
+     394            8 :               requested: namespace.events.toSet(),
+     395              :             ),
+     396              :           );
+     397              :           // Add the chain specific methods
+     398            4 :           methods.addAll(
+     399            4 :             _getMatching(
+     400              :               namespaceOrChainId: chainId,
+     401              :               available: availableMethods,
+     402            8 :               requested: namespace.methods.toSet(),
+     403              :             ),
+     404              :           );
+     405              :         }
+     406              :       }
+     407              : 
+     408              :       // Add the namespace to the list
+     409            8 :       namespaces[namespaceOrChainId] = Namespace(
+     410            8 :         accounts: accounts.toSet().toList(),
+     411            8 :         events: events.toSet().toList(),
+     412            8 :         methods: methods.toSet().toList(),
+     413              :       );
+     414              :     }
+     415              : 
+     416              :     return namespaces;
+     417              :   }
+     418              : 
+     419              :   /// To be used by Wallet to regenerate already generatedNamespaces but adding `chains` parameter
+     420              :   ///
+     421              :   /// Example usage on onSessionProposal(SessionProposalEvent? event)
+     422              :   ///
+     423              :   /// await _web3Wallet!.approveSession(
+     424              :   ///   id: event.id,
+     425              :   ///   namespaces: NamespaceUtils.regenerateNamespacesWithChains(
+     426              :   ///     event.params.generatedNamespaces!,
+     427              :   ///   ),
+     428              :   ///   sessionProperties: event.params.sessionProperties,
+     429              :   /// );
+     430              : 
+     431            0 :   static Map<String, Namespace> regenerateNamespacesWithChains(
+     432              :     Map<String, Namespace> generatedNamespaces,
+     433              :   ) {
+     434            0 :     Map<String, Namespace> regeneratedNamespaces = {};
+     435            0 :     for (var key in generatedNamespaces.keys) {
+     436            0 :       final namespace = generatedNamespaces[key]!.copyWith(
+     437            0 :         chains: getChainsFromAccounts(generatedNamespaces[key]!.accounts),
+     438              :       );
+     439            0 :       regeneratedNamespaces[key] = namespace;
+     440              :     }
+     441              :     return regeneratedNamespaces;
+     442              :   }
+     443              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/utils/walletconnect_utils.dart.func-c.html b/coverage/html/utils/walletconnect_utils.dart.func-c.html new file mode 100644 index 00000000..16648e77 --- /dev/null +++ b/coverage/html/utils/walletconnect_utils.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - utils/walletconnect_utils.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - utils - walletconnect_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:86.7 %9078
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/utils/walletconnect_utils.dart.func.html b/coverage/html/utils/walletconnect_utils.dart.func.html new file mode 100644 index 00000000..5c9e25dd --- /dev/null +++ b/coverage/html/utils/walletconnect_utils.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - utils/walletconnect_utils.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - utils - walletconnect_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:86.7 %9078
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/utils/walletconnect_utils.dart.gcov.html b/coverage/html/utils/walletconnect_utils.dart.gcov.html new file mode 100644 index 00000000..11a6ee07 --- /dev/null +++ b/coverage/html/utils/walletconnect_utils.dart.gcov.html @@ -0,0 +1,302 @@ + + + + + + + LCOV - lcov.info - utils/walletconnect_utils.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - utils - walletconnect_utils.dartCoverageTotalHit
Test:lcov.infoLines:86.7 %9078
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'dart:convert';
+       2              : import 'dart:io';
+       3              : 
+       4              : import 'package:package_info_plus/package_info_plus.dart';
+       5              : import 'package:flutter/foundation.dart' show kIsWeb;
+       6              : import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart';
+       7              : 
+       8              : class WalletConnectUtils {
+       9            7 :   static bool isExpired(int expiry) {
+      10           21 :     return DateTime.now().toUtc().compareTo(
+      11            7 :               DateTime.fromMillisecondsSinceEpoch(
+      12            7 :                 toMilliseconds(expiry),
+      13              :               ),
+      14            7 :             ) >=
+      15              :         0;
+      16              :   }
+      17              : 
+      18            0 :   static DateTime expiryToDateTime(int expiry) {
+      19            0 :     final milliseconds = expiry * 1000;
+      20            0 :     return DateTime.fromMillisecondsSinceEpoch(milliseconds);
+      21              :   }
+      22              : 
+      23            7 :   static int toMilliseconds(int seconds) {
+      24            7 :     return seconds * 1000;
+      25              :   }
+      26              : 
+      27            7 :   static int calculateExpiry(int offset) {
+      28           35 :     return DateTime.now().toUtc().millisecondsSinceEpoch ~/ 1000 + offset;
+      29              :   }
+      30              : 
+      31            9 :   static String getOS() {
+      32              :     if (kIsWeb) {
+      33              :       // TODO change this into an actual value
+      34              :       return 'web-browser';
+      35              :     } else {
+      36           27 :       return <String>[Platform.operatingSystem, Platform.operatingSystemVersion]
+      37            9 :           .join('-');
+      38              :     }
+      39              :   }
+      40              : 
+      41            9 :   static Future<String> getPackageName() async {
+      42            9 :     final packageInfo = await PackageInfo.fromPlatform();
+      43            9 :     return packageInfo.packageName;
+      44              :   }
+      45              : 
+      46            9 :   static String getId() {
+      47              :     if (kIsWeb) {
+      48              :       return 'web';
+      49              :     } else {
+      50            9 :       if (Platform.isAndroid) {
+      51              :         return 'android';
+      52            9 :       } else if (Platform.isIOS) {
+      53              :         return 'ios';
+      54            9 :       } else if (Platform.isLinux) {
+      55              :         return 'linux';
+      56            9 :       } else if (Platform.isMacOS) {
+      57              :         return 'macos';
+      58            0 :       } else if (Platform.isWindows) {
+      59              :         return 'windows';
+      60              :       } else {
+      61              :         return 'unknown';
+      62              :       }
+      63              :     }
+      64              :   }
+      65              : 
+      66            9 :   static String formatUA(
+      67              :     String protocol,
+      68              :     int version,
+      69              :     String sdkVersion,
+      70              :   ) {
+      71            9 :     String os = getOS();
+      72            9 :     String id = getId();
+      73            9 :     return <String>[
+      74           18 :       [protocol, version].join('-'),
+      75           18 :       <String>['Flutter', sdkVersion].join('-'),
+      76              :       os,
+      77              :       id,
+      78            9 :     ].join('/');
+      79              :   }
+      80              : 
+      81            9 :   static String formatRelayRpcUrl({
+      82              :     required String protocol,
+      83              :     required int version,
+      84              :     required String relayUrl,
+      85              :     required String sdkVersion,
+      86              :     required String auth,
+      87              :     String? projectId,
+      88              :     String? packageName,
+      89              :   }) {
+      90            9 :     final Uri uri = Uri.parse(relayUrl);
+      91           18 :     final Map<String, String> queryParams = Uri.splitQueryString(uri.query);
+      92            9 :     final userAgent = formatUA(protocol, version, sdkVersion);
+      93              : 
+      94              :     // Add basic query params
+      95            9 :     final Map<String, String> relayParams = {
+      96              :       'auth': auth,
+      97              :       'ua': userAgent,
+      98              :     };
+      99              : 
+     100              :     // Add projectId query param
+     101            9 :     if ((projectId ?? '').isNotEmpty) {
+     102            9 :       relayParams['projectId'] = projectId!;
+     103              :     }
+     104              : 
+     105              :     // Add bundleId, packageName or origin query param based on platform
+     106            9 :     if ((packageName ?? '').isNotEmpty) {
+     107            9 :       final platform = getId();
+     108            9 :       if (platform == 'ios') {
+     109            0 :         relayParams['bundleId'] = packageName!;
+     110            9 :       } else if (platform == 'android') {
+     111            0 :         relayParams['packageName'] = packageName!;
+     112              :       } else {
+     113            9 :         relayParams['origin'] = packageName!;
+     114              :       }
+     115              :     }
+     116              : 
+     117            9 :     queryParams.addAll(relayParams);
+     118           18 :     return uri.replace(queryParameters: queryParams).toString();
+     119              :   }
+     120              : 
+     121              :   /// ---- URI HANDLING --- ///
+     122              : 
+     123            8 :   static URIParseResult parseUri(Uri uri) {
+     124            8 :     String protocol = uri.scheme;
+     125            8 :     String path = uri.path;
+     126            8 :     final List<String> splitParams = path.split('@');
+     127           16 :     if (splitParams.length == 1) {
+     128              :       throw const WalletConnectError(
+     129              :         code: 0,
+     130              :         message: 'Invalid URI: Missing @',
+     131              :       );
+     132              :     }
+     133           16 :     List<String> methods = (uri.queryParameters['methods'] ?? '')
+     134              :         // Replace all the square brackets with empty string, split by comma
+     135           16 :         .replaceAll(RegExp(r'[\[\]"]+'), '')
+     136            8 :         .split(',');
+     137           30 :     if (methods.length == 1 && methods[0].isEmpty) {
+     138            7 :       methods = [];
+     139              :     }
+     140              :     final URIVersion? version;
+     141            8 :     switch (splitParams[1]) {
+     142            8 :       case '1':
+     143              :         version = URIVersion.v1;
+     144              :         break;
+     145            8 :       case '2':
+     146              :         version = URIVersion.v2;
+     147              :         break;
+     148              :       default:
+     149              :         version = null;
+     150              :     }
+     151              :     final URIV1ParsedData? v1Data;
+     152              :     final URIV2ParsedData? v2Data;
+     153            8 :     if (version == URIVersion.v1) {
+     154            5 :       v1Data = URIV1ParsedData(
+     155           10 :         key: uri.queryParameters['key']!,
+     156           10 :         bridge: uri.queryParameters['bridge']!,
+     157              :       );
+     158              :       v2Data = null;
+     159              :     } else {
+     160              :       v1Data = null;
+     161            8 :       v2Data = URIV2ParsedData(
+     162           16 :         symKey: uri.queryParameters['symKey']!,
+     163            8 :         relay: Relay(
+     164           16 :           uri.queryParameters['relay-protocol']!,
+     165           16 :           data: uri.queryParameters.containsKey('relay-data')
+     166            0 :               ? uri.queryParameters['relay-data']
+     167              :               : null,
+     168              :         ),
+     169              :         methods: methods,
+     170              :       );
+     171              :     }
+     172              : 
+     173            8 :     URIParseResult ret = URIParseResult(
+     174              :       protocol: protocol,
+     175              :       version: version,
+     176            8 :       topic: splitParams[0],
+     177              :       v1Data: v1Data,
+     178              :       v2Data: v2Data,
+     179              :     );
+     180              :     return ret;
+     181              :   }
+     182              : 
+     183            7 :   static Map<String, String> formatRelayParams(
+     184              :     Relay relay, {
+     185              :     String delimiter = '-',
+     186              :   }) {
+     187            7 :     Map<String, String> params = {};
+     188           28 :     params[['relay', 'protocol'].join(delimiter)] = relay.protocol;
+     189            7 :     if (relay.data != null) {
+     190            0 :       params[['relay', 'data'].join(delimiter)] = relay.data!;
+     191              :     }
+     192              :     return params;
+     193              :   }
+     194              : 
+     195            7 :   static Uri formatUri({
+     196              :     required String protocol,
+     197              :     required String version,
+     198              :     required String topic,
+     199              :     required String symKey,
+     200              :     required Relay relay,
+     201              :     required List<List<String>>? methods,
+     202              :     int? expiry,
+     203              :   }) {
+     204            7 :     Map<String, String> params = formatRelayParams(relay);
+     205            7 :     params['symKey'] = symKey;
+     206              :     if (methods != null) {
+     207           18 :       final uriMethods = methods.expand((e) => e).toList();
+     208            6 :       params['methods'] =
+     209           30 :           uriMethods.map((e) => jsonEncode(e)).join(',').replaceAll('"', '');
+     210              :     }
+     211              : 
+     212              :     if (expiry != null) {
+     213           14 :       params['expiryTimestamp'] = expiry.toString();
+     214              :     }
+     215              : 
+     216            7 :     return Uri(
+     217              :       scheme: protocol,
+     218            7 :       path: '$topic@$version',
+     219              :       queryParameters: params,
+     220              :     );
+     221              :   }
+     222              : 
+     223            0 :   static Map<String, T> convertMapTo<T>(Map<String, dynamic> inMap) {
+     224            0 :     Map<String, T> m = {};
+     225            0 :     for (var entry in inMap.entries) {
+     226            0 :       m[entry.key] = entry.value as T;
+     227              :     }
+     228              :     return m;
+     229              :   }
+     230              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/web3app/index-sort-f.html b/coverage/html/web3app/index-sort-f.html new file mode 100644 index 00000000..e47e2032 --- /dev/null +++ b/coverage/html/web3app/index-sort-f.html @@ -0,0 +1,105 @@ + + + + + + + LCOV - lcov.info - web3app + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - web3appCoverageTotalHit
Test:lcov.infoLines:64.7 %11675
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
web3app.dart +
64.7%64.7%
+
64.7 %11675-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/web3app/index-sort-l.html b/coverage/html/web3app/index-sort-l.html new file mode 100644 index 00000000..461ff737 --- /dev/null +++ b/coverage/html/web3app/index-sort-l.html @@ -0,0 +1,91 @@ + + + + + + + LCOV - lcov.info - web3app + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - web3appCoverageTotalHit
Test:lcov.infoLines:64.7 %11675
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
web3app.dart +
64.7%64.7%
+
64.7 %11675
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/web3app/index.html b/coverage/html/web3app/index.html new file mode 100644 index 00000000..e2fb5e12 --- /dev/null +++ b/coverage/html/web3app/index.html @@ -0,0 +1,91 @@ + + + + + + + LCOV - lcov.info - web3app + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - web3appCoverageTotalHit
Test:lcov.infoLines:64.7 %11675
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
web3app.dart +
64.7%64.7%
+
64.7 %11675
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/web3app/web3app.dart.func-c.html b/coverage/html/web3app/web3app.dart.func-c.html new file mode 100644 index 00000000..94575476 --- /dev/null +++ b/coverage/html/web3app/web3app.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - web3app/web3app.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - web3app - web3app.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:64.7 %11675
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/web3app/web3app.dart.func.html b/coverage/html/web3app/web3app.dart.func.html new file mode 100644 index 00000000..3ca32b9f --- /dev/null +++ b/coverage/html/web3app/web3app.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - web3app/web3app.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - web3app - web3app.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:64.7 %11675
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/web3app/web3app.dart.gcov.html b/coverage/html/web3app/web3app.dart.gcov.html new file mode 100644 index 00000000..b2fbb284 --- /dev/null +++ b/coverage/html/web3app/web3app.dart.gcov.html @@ -0,0 +1,526 @@ + + + + + + + LCOV - lcov.info - web3app/web3app.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - web3app - web3app.dartCoverageTotalHit
Test:lcov.infoLines:64.7 %11675
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:walletconnect_flutter_v2/apis/auth_api/auth_engine.dart';
+       2              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/http_client.dart';
+       3              : import 'package:walletconnect_flutter_v2/apis/core/store/generic_store.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/core/store/i_generic_store.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/sign_api/i_sessions.dart';
+       6              : import 'package:walletconnect_flutter_v2/apis/sign_api/sign_engine.dart';
+       7              : import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart';
+       8              : 
+       9              : class Web3App implements IWeb3App {
+      10              :   static const List<List<String>> DEFAULT_METHODS = [
+      11              :     [
+      12              :       MethodConstants.WC_SESSION_PROPOSE,
+      13              :       MethodConstants.WC_SESSION_REQUEST,
+      14              :     ],
+      15              :     [
+      16              :       MethodConstants.WC_AUTH_REQUEST,
+      17              :     ]
+      18              :   ];
+      19              : 
+      20              :   bool _initialized = false;
+      21              : 
+      22            2 :   static Future<Web3App> createInstance({
+      23              :     required String projectId,
+      24              :     String relayUrl = WalletConnectConstants.DEFAULT_RELAY_URL,
+      25              :     required PairingMetadata metadata,
+      26              :     bool memoryStore = false,
+      27              :     LogLevel logLevel = LogLevel.nothing,
+      28              :     HttpWrapper httpClient = const HttpWrapper(),
+      29              :   }) async {
+      30            2 :     final client = Web3App(
+      31            2 :       core: Core(
+      32              :         projectId: projectId,
+      33              :         relayUrl: relayUrl,
+      34              :         memoryStore: memoryStore,
+      35              :         logLevel: logLevel,
+      36              :         httpClient: httpClient,
+      37              :       ),
+      38              :       metadata: metadata,
+      39              :     );
+      40            2 :     await client.init();
+      41              : 
+      42              :     return client;
+      43              :   }
+      44              : 
+      45              :   ///---------- GENERIC ----------///
+      46              : 
+      47              :   @override
+      48              :   final String protocol = 'wc';
+      49              :   @override
+      50              :   final int version = 2;
+      51              : 
+      52              :   @override
+      53              :   final ICore core;
+      54              :   @override
+      55              :   final PairingMetadata metadata;
+      56              : 
+      57            2 :   Web3App({
+      58              :     required this.core,
+      59              :     required this.metadata,
+      60              :   }) {
+      61            4 :     signEngine = SignEngine(
+      62            2 :       core: core,
+      63            2 :       metadata: metadata,
+      64            2 :       proposals: GenericStore(
+      65            4 :         storage: core.storage,
+      66              :         context: StoreVersions.CONTEXT_PROPOSALS,
+      67              :         version: StoreVersions.VERSION_PROPOSALS,
+      68            0 :         fromJson: (dynamic value) {
+      69            0 :           return ProposalData.fromJson(value);
+      70              :         },
+      71              :       ),
+      72            2 :       sessions: Sessions(
+      73            4 :         storage: core.storage,
+      74              :         context: StoreVersions.CONTEXT_SESSIONS,
+      75              :         version: StoreVersions.VERSION_SESSIONS,
+      76            0 :         fromJson: (dynamic value) {
+      77            0 :           return SessionData.fromJson(value);
+      78              :         },
+      79              :       ),
+      80            2 :       pendingRequests: GenericStore(
+      81            4 :         storage: core.storage,
+      82              :         context: StoreVersions.CONTEXT_PENDING_REQUESTS,
+      83              :         version: StoreVersions.VERSION_PENDING_REQUESTS,
+      84            0 :         fromJson: (dynamic value) {
+      85            0 :           return SessionRequest.fromJson(value);
+      86              :         },
+      87              :       ),
+      88            2 :       authKeys: GenericStore(
+      89            4 :         storage: core.storage,
+      90              :         context: StoreVersions.CONTEXT_AUTH_KEYS,
+      91              :         version: StoreVersions.VERSION_AUTH_KEYS,
+      92            0 :         fromJson: (dynamic value) {
+      93            0 :           return AuthPublicKey.fromJson(value);
+      94              :         },
+      95              :       ),
+      96            2 :       pairingTopics: GenericStore(
+      97            4 :         storage: core.storage,
+      98              :         context: StoreVersions.CONTEXT_PAIRING_TOPICS,
+      99              :         version: StoreVersions.VERSION_PAIRING_TOPICS,
+     100            0 :         fromJson: (dynamic value) {
+     101              :           return value;
+     102              :         },
+     103              :       ),
+     104            2 :       authRequests: GenericStore(
+     105            4 :         storage: core.storage,
+     106              :         context: StoreVersions.CONTEXT_AUTH_REQUESTS,
+     107              :         version: StoreVersions.VERSION_AUTH_REQUESTS,
+     108            0 :         fromJson: (dynamic value) {
+     109            0 :           return PendingAuthRequest.fromJson(value);
+     110              :         },
+     111              :       ),
+     112            2 :       completeRequests: GenericStore(
+     113            4 :         storage: core.storage,
+     114              :         context: StoreVersions.CONTEXT_COMPLETE_REQUESTS,
+     115              :         version: StoreVersions.VERSION_COMPLETE_REQUESTS,
+     116            0 :         fromJson: (dynamic value) {
+     117            0 :           return StoredCacao.fromJson(value);
+     118              :         },
+     119              :       ),
+     120            2 :       sessionAuthRequests: GenericStore(
+     121            4 :         storage: core.storage,
+     122              :         context: StoreVersions.CONTEXT_AUTH_REQUESTS,
+     123              :         version: StoreVersions.VERSION_AUTH_REQUESTS,
+     124            0 :         fromJson: (dynamic value) {
+     125            0 :           return PendingSessionAuthRequest.fromJson(value);
+     126              :         },
+     127              :       ),
+     128              :     );
+     129              : 
+     130            4 :     authEngine = AuthEngine(
+     131            2 :       core: core,
+     132            2 :       metadata: metadata,
+     133            4 :       authKeys: signEngine.authKeys,
+     134            4 :       pairingTopics: signEngine.pairingTopics,
+     135            4 :       authRequests: signEngine.authRequests,
+     136            4 :       completeRequests: signEngine.completeRequests,
+     137              :     );
+     138              :   }
+     139              : 
+     140            2 :   @override
+     141              :   Future<void> init() async {
+     142            2 :     if (_initialized) {
+     143              :       return;
+     144              :     }
+     145              : 
+     146            4 :     await core.start();
+     147            4 :     await signEngine.init();
+     148            4 :     await authEngine.init();
+     149              : 
+     150            2 :     _initialized = true;
+     151              :   }
+     152              : 
+     153              :   ///---------- SIGN ENGINE ----------///
+     154              : 
+     155            2 :   @override
+     156            4 :   Event<SessionConnect> get onSessionConnect => signEngine.onSessionConnect;
+     157            1 :   @override
+     158            2 :   Event<SessionEvent> get onSessionEvent => signEngine.onSessionEvent;
+     159            1 :   @override
+     160            2 :   Event<SessionExpire> get onSessionExpire => signEngine.onSessionExpire;
+     161            0 :   @override
+     162              :   Event<SessionProposalEvent> get onProposalExpire =>
+     163            0 :       signEngine.onProposalExpire;
+     164            1 :   @override
+     165            2 :   Event<SessionExtend> get onSessionExtend => signEngine.onSessionExtend;
+     166            1 :   @override
+     167            2 :   Event<SessionPing> get onSessionPing => signEngine.onSessionPing;
+     168            1 :   @override
+     169            2 :   Event<SessionUpdate> get onSessionUpdate => signEngine.onSessionUpdate;
+     170            1 :   @override
+     171            2 :   Event<SessionDelete> get onSessionDelete => signEngine.onSessionDelete;
+     172              : 
+     173            1 :   @override
+     174            2 :   IGenericStore<ProposalData> get proposals => signEngine.proposals;
+     175            1 :   @override
+     176            2 :   ISessions get sessions => signEngine.sessions;
+     177            0 :   @override
+     178              :   IGenericStore<SessionRequest> get pendingRequests =>
+     179            0 :       signEngine.pendingRequests;
+     180              : 
+     181              :   @override
+     182              :   late ISignEngine signEngine;
+     183              : 
+     184            2 :   @override
+     185              :   Future<ConnectResponse> connect({
+     186              :     Map<String, RequiredNamespace>? requiredNamespaces,
+     187              :     Map<String, RequiredNamespace>? optionalNamespaces,
+     188              :     Map<String, String>? sessionProperties,
+     189              :     String? pairingTopic,
+     190              :     List<Relay>? relays,
+     191              :     List<List<String>>? methods = DEFAULT_METHODS,
+     192              :   }) async {
+     193              :     try {
+     194            4 :       return await signEngine.connect(
+     195              :         requiredNamespaces: requiredNamespaces,
+     196              :         optionalNamespaces: optionalNamespaces,
+     197              :         sessionProperties: sessionProperties,
+     198              :         pairingTopic: pairingTopic,
+     199              :         relays: relays,
+     200              :         methods: methods,
+     201              :       );
+     202              :     } catch (e) {
+     203              :       // print(e);
+     204              :       rethrow;
+     205              :     }
+     206              :   }
+     207              : 
+     208            1 :   @override
+     209              :   Future<dynamic> request({
+     210              :     required String topic,
+     211              :     required String chainId,
+     212              :     required SessionRequestParams request,
+     213              :   }) async {
+     214              :     try {
+     215            2 :       return await signEngine.request(
+     216              :         topic: topic,
+     217              :         chainId: chainId,
+     218              :         request: request,
+     219              :       );
+     220              :     } catch (e) {
+     221              :       rethrow;
+     222              :     }
+     223              :   }
+     224              : 
+     225            0 :   @override
+     226              :   Future<List<dynamic>> requestReadContract({
+     227              :     required DeployedContract deployedContract,
+     228              :     required String functionName,
+     229              :     required String rpcUrl,
+     230              :     EthereumAddress? sender,
+     231              :     List parameters = const [],
+     232              :   }) async {
+     233              :     try {
+     234            0 :       return await signEngine.requestReadContract(
+     235              :         sender: sender,
+     236              :         deployedContract: deployedContract,
+     237              :         functionName: functionName,
+     238              :         rpcUrl: rpcUrl,
+     239              :         parameters: parameters,
+     240              :       );
+     241              :     } catch (e) {
+     242              :       rethrow;
+     243              :     }
+     244              :   }
+     245              : 
+     246            0 :   @override
+     247              :   Future<dynamic> requestWriteContract({
+     248              :     required String topic,
+     249              :     required String chainId,
+     250              :     required String rpcUrl,
+     251              :     required DeployedContract deployedContract,
+     252              :     required String functionName,
+     253              :     required Transaction transaction,
+     254              :     String? method,
+     255              :     List parameters = const [],
+     256              :   }) async {
+     257              :     try {
+     258            0 :       return await signEngine.requestWriteContract(
+     259              :         topic: topic,
+     260              :         chainId: chainId,
+     261              :         rpcUrl: rpcUrl,
+     262              :         deployedContract: deployedContract,
+     263              :         functionName: functionName,
+     264              :         transaction: transaction,
+     265              :         method: method,
+     266              :         parameters: parameters,
+     267              :       );
+     268              :     } catch (e) {
+     269              :       rethrow;
+     270              :     }
+     271              :   }
+     272              : 
+     273            1 :   @override
+     274              :   void registerEventHandler({
+     275              :     required String chainId,
+     276              :     required String event,
+     277              :     void Function(String, dynamic)? handler,
+     278              :   }) {
+     279              :     try {
+     280            2 :       return signEngine.registerEventHandler(
+     281              :         chainId: chainId,
+     282              :         event: event,
+     283              :         handler: handler,
+     284              :       );
+     285              :     } catch (e) {
+     286              :       rethrow;
+     287              :     }
+     288              :   }
+     289              : 
+     290            1 :   @override
+     291              :   Future<void> ping({
+     292              :     required String topic,
+     293              :   }) async {
+     294              :     try {
+     295            2 :       return await signEngine.ping(topic: topic);
+     296              :     } catch (e) {
+     297              :       rethrow;
+     298              :     }
+     299              :   }
+     300              : 
+     301            1 :   @override
+     302              :   Future<void> disconnectSession({
+     303              :     required String topic,
+     304              :     required WalletConnectError reason,
+     305              :   }) async {
+     306              :     try {
+     307            2 :       return await signEngine.disconnectSession(
+     308              :         topic: topic,
+     309              :         reason: reason,
+     310              :       );
+     311              :     } catch (e) {
+     312              :       rethrow;
+     313              :     }
+     314              :   }
+     315              : 
+     316            2 :   @override
+     317              :   Map<String, SessionData> getActiveSessions() {
+     318              :     try {
+     319            4 :       return signEngine.getActiveSessions();
+     320              :     } catch (e) {
+     321              :       rethrow;
+     322              :     }
+     323              :   }
+     324              : 
+     325            1 :   @override
+     326              :   Map<String, SessionData> getSessionsForPairing({
+     327              :     required String pairingTopic,
+     328              :   }) {
+     329              :     try {
+     330            2 :       return signEngine.getSessionsForPairing(
+     331              :         pairingTopic: pairingTopic,
+     332              :       );
+     333              :     } catch (e) {
+     334              :       rethrow;
+     335              :     }
+     336              :   }
+     337              : 
+     338            1 :   @override
+     339              :   Map<String, ProposalData> getPendingSessionProposals() {
+     340              :     try {
+     341            2 :       return signEngine.getPendingSessionProposals();
+     342              :     } catch (e) {
+     343              :       rethrow;
+     344              :     }
+     345              :   }
+     346              : 
+     347            2 :   @override
+     348            6 :   IPairingStore get pairings => core.pairing.getStore();
+     349              : 
+     350              :   ///---------- (DEPRECATED) AUTH ENGINE ----------///
+     351              : 
+     352            0 :   @override
+     353            0 :   Event<AuthResponse> get onAuthResponse => authEngine.onAuthResponse;
+     354              : 
+     355            0 :   @override
+     356            0 :   IGenericStore<AuthPublicKey> get authKeys => authEngine.authKeys;
+     357            0 :   @override
+     358            0 :   IGenericStore<String> get pairingTopics => authEngine.pairingTopics;
+     359            0 :   @override
+     360              :   IGenericStore<StoredCacao> get completeRequests =>
+     361            0 :       authEngine.completeRequests;
+     362              : 
+     363              :   @Deprecated(
+     364              :     'AuthEngine/AuthClient is deprecated and will be removed soon.\n'
+     365              :     'Please use authentication methods from SignEngine/SignClient instead',
+     366              :   )
+     367              :   @override
+     368              :   late IAuthEngine authEngine;
+     369              : 
+     370            1 :   @override
+     371              :   Future<AuthRequestResponse> requestAuth({
+     372              :     required AuthRequestParams params,
+     373              :     String? pairingTopic,
+     374              :     List<List<String>>? methods = DEFAULT_METHODS,
+     375              :   }) async {
+     376              :     try {
+     377            2 :       return authEngine.requestAuth(
+     378              :         params: params,
+     379              :         pairingTopic: pairingTopic,
+     380              :         methods: methods,
+     381              :       );
+     382              :     } catch (e) {
+     383              :       rethrow;
+     384              :     }
+     385              :   }
+     386              : 
+     387            0 :   @override
+     388              :   Map<int, StoredCacao> getCompletedRequestsForPairing({
+     389              :     required String pairingTopic,
+     390              :   }) {
+     391              :     try {
+     392            0 :       return authEngine.getCompletedRequestsForPairing(
+     393              :         pairingTopic: pairingTopic,
+     394              :       );
+     395              :     } catch (e) {
+     396              :       rethrow;
+     397              :     }
+     398              :   }
+     399              : 
+     400              :   ///---------- ONE-CLICK AUTH SIGN ENGINE ----------///
+     401              : 
+     402            0 :   @override
+     403              :   Event<SessionAuthResponse> get onSessionAuthResponse =>
+     404            0 :       signEngine.onSessionAuthResponse;
+     405              : 
+     406            0 :   @override
+     407              :   Future<SessionAuthRequestResponse> authenticate({
+     408              :     required SessionAuthRequestParams params,
+     409              :     String? pairingTopic,
+     410              :     List<List<String>>? methods = const [
+     411              :       [MethodConstants.WC_SESSION_AUTHENTICATE]
+     412              :     ],
+     413              :   }) async {
+     414              :     try {
+     415            0 :       return signEngine.authenticate(
+     416              :         params: params,
+     417              :         pairingTopic: pairingTopic,
+     418              :         methods: methods,
+     419              :       );
+     420              :     } catch (e) {
+     421              :       rethrow;
+     422              :     }
+     423              :   }
+     424              : 
+     425            0 :   @override
+     426              :   Future<bool> validateSignedCacao({
+     427              :     required Cacao cacao,
+     428              :     required String projectId,
+     429              :   }) {
+     430              :     try {
+     431            0 :       return signEngine.validateSignedCacao(
+     432              :         cacao: cacao,
+     433              :         projectId: projectId,
+     434              :       );
+     435              :     } catch (e) {
+     436              :       rethrow;
+     437              :     }
+     438              :   }
+     439              : 
+     440            0 :   @override
+     441              :   String formatAuthMessage({
+     442              :     required String iss,
+     443              :     required CacaoRequestPayload cacaoPayload,
+     444              :   }) {
+     445              :     try {
+     446            0 :       return signEngine.formatAuthMessage(
+     447              :         iss: iss,
+     448              :         cacaoPayload: cacaoPayload,
+     449              :       );
+     450              :     } catch (e) {
+     451              :       rethrow;
+     452              :     }
+     453              :   }
+     454              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/web3wallet/index-sort-f.html b/coverage/html/web3wallet/index-sort-f.html new file mode 100644 index 00000000..79586ac9 --- /dev/null +++ b/coverage/html/web3wallet/index-sort-f.html @@ -0,0 +1,105 @@ + + + + + + + LCOV - lcov.info - web3wallet + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - web3walletCoverageTotalHit
Test:lcov.infoLines:71.7 %13899
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
web3wallet.dart +
71.7%71.7%
+
71.7 %13899-
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/web3wallet/index-sort-l.html b/coverage/html/web3wallet/index-sort-l.html new file mode 100644 index 00000000..6ae5355a --- /dev/null +++ b/coverage/html/web3wallet/index-sort-l.html @@ -0,0 +1,91 @@ + + + + + + + LCOV - lcov.info - web3wallet + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - web3walletCoverageTotalHit
Test:lcov.infoLines:71.7 %13899
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
web3wallet.dart +
71.7%71.7%
+
71.7 %13899
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/web3wallet/index.html b/coverage/html/web3wallet/index.html new file mode 100644 index 00000000..e84954e3 --- /dev/null +++ b/coverage/html/web3wallet/index.html @@ -0,0 +1,91 @@ + + + + + + + LCOV - lcov.info - web3wallet + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - web3walletCoverageTotalHit
Test:lcov.infoLines:71.7 %13899
Test Date:2024-07-25 14:52:52
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
web3wallet.dart +
71.7%71.7%
+
71.7 %13899
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/web3wallet/web3wallet.dart.func-c.html b/coverage/html/web3wallet/web3wallet.dart.func-c.html new file mode 100644 index 00000000..35b071fe --- /dev/null +++ b/coverage/html/web3wallet/web3wallet.dart.func-c.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - web3wallet/web3wallet.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - web3wallet - web3wallet.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:71.7 %13899
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/web3wallet/web3wallet.dart.func.html b/coverage/html/web3wallet/web3wallet.dart.func.html new file mode 100644 index 00000000..edd605f9 --- /dev/null +++ b/coverage/html/web3wallet/web3wallet.dart.func.html @@ -0,0 +1,75 @@ + + + + + + + LCOV - lcov.info - web3wallet/web3wallet.dart - functions + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - web3wallet - web3wallet.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:71.7 %13899
Test Date:2024-07-25 14:51:04Functions:-00
+
+ +
+ + + + + + + + + +

Function Name Sort by function nameHit count Sort by function hit count
+
+
+ + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/html/web3wallet/web3wallet.dart.gcov.html b/coverage/html/web3wallet/web3wallet.dart.gcov.html new file mode 100644 index 00000000..6cea2e08 --- /dev/null +++ b/coverage/html/web3wallet/web3wallet.dart.gcov.html @@ -0,0 +1,612 @@ + + + + + + + LCOV - lcov.info - web3wallet/web3wallet.dart + + + + + + + + + + + + + + +
LCOV - code coverage report
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Current view:top level - web3wallet - web3wallet.dartCoverageTotalHit
Test:lcov.infoLines:71.7 %13899
Test Date:2024-07-25 14:52:52
+
+ + + + + + + + +

+
            Line data    Source code
+
+       1              : import 'package:walletconnect_flutter_v2/apis/auth_api/auth_engine.dart';
+       2              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/http_client.dart';
+       3              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/i_http_client.dart';
+       4              : import 'package:walletconnect_flutter_v2/apis/core/store/generic_store.dart';
+       5              : import 'package:walletconnect_flutter_v2/apis/core/store/i_generic_store.dart';
+       6              : import 'package:walletconnect_flutter_v2/apis/sign_api/i_sessions.dart';
+       7              : import 'package:walletconnect_flutter_v2/apis/sign_api/sign_engine.dart';
+       8              : import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart';
+       9              : 
+      10              : class Web3Wallet implements IWeb3Wallet {
+      11              :   bool _initialized = false;
+      12              : 
+      13            3 :   static Future<Web3Wallet> createInstance({
+      14              :     required String projectId,
+      15              :     String relayUrl = WalletConnectConstants.DEFAULT_RELAY_URL,
+      16              :     String pushUrl = WalletConnectConstants.DEFAULT_PUSH_URL,
+      17              :     required PairingMetadata metadata,
+      18              :     bool memoryStore = false,
+      19              :     LogLevel logLevel = LogLevel.nothing,
+      20              :     IHttpClient httpClient = const HttpWrapper(),
+      21              :   }) async {
+      22            3 :     final client = Web3Wallet(
+      23            3 :       core: Core(
+      24              :         projectId: projectId,
+      25              :         relayUrl: relayUrl,
+      26              :         pushUrl: pushUrl,
+      27              :         memoryStore: memoryStore,
+      28              :         logLevel: logLevel,
+      29              :         httpClient: httpClient,
+      30              :       ),
+      31              :       metadata: metadata,
+      32              :     );
+      33            3 :     await client.init();
+      34              : 
+      35              :     return client;
+      36              :   }
+      37              : 
+      38              :   ///---------- GENERIC ----------///
+      39              : 
+      40              :   @override
+      41              :   final String protocol = 'wc';
+      42              :   @override
+      43              :   final int version = 2;
+      44              : 
+      45              :   @override
+      46              :   final ICore core;
+      47              :   @override
+      48              :   final PairingMetadata metadata;
+      49              : 
+      50            3 :   Web3Wallet({
+      51              :     required this.core,
+      52              :     required this.metadata,
+      53              :   }) {
+      54            6 :     signEngine = SignEngine(
+      55            3 :       core: core,
+      56            3 :       metadata: metadata,
+      57            3 :       proposals: GenericStore(
+      58            6 :         storage: core.storage,
+      59              :         context: StoreVersions.CONTEXT_PROPOSALS,
+      60              :         version: StoreVersions.VERSION_PROPOSALS,
+      61            0 :         fromJson: (dynamic value) {
+      62            0 :           return ProposalData.fromJson(value);
+      63              :         },
+      64              :       ),
+      65            3 :       sessions: Sessions(
+      66            6 :         storage: core.storage,
+      67              :         context: StoreVersions.CONTEXT_SESSIONS,
+      68              :         version: StoreVersions.VERSION_SESSIONS,
+      69            0 :         fromJson: (dynamic value) {
+      70            0 :           return SessionData.fromJson(value);
+      71              :         },
+      72              :       ),
+      73            3 :       pendingRequests: GenericStore(
+      74            6 :         storage: core.storage,
+      75              :         context: StoreVersions.CONTEXT_PENDING_REQUESTS,
+      76              :         version: StoreVersions.VERSION_PENDING_REQUESTS,
+      77            0 :         fromJson: (dynamic value) {
+      78            0 :           return SessionRequest.fromJson(value);
+      79              :         },
+      80              :       ),
+      81            3 :       authKeys: GenericStore(
+      82            6 :         storage: core.storage,
+      83              :         context: StoreVersions.CONTEXT_AUTH_KEYS,
+      84              :         version: StoreVersions.VERSION_AUTH_KEYS,
+      85            0 :         fromJson: (dynamic value) {
+      86            0 :           return AuthPublicKey.fromJson(value);
+      87              :         },
+      88              :       ),
+      89            3 :       pairingTopics: GenericStore(
+      90            6 :         storage: core.storage,
+      91              :         context: StoreVersions.CONTEXT_PAIRING_TOPICS,
+      92              :         version: StoreVersions.VERSION_PAIRING_TOPICS,
+      93            0 :         fromJson: (dynamic value) {
+      94              :           return value;
+      95              :         },
+      96              :       ),
+      97            3 :       authRequests: GenericStore(
+      98            6 :         storage: core.storage,
+      99              :         context: StoreVersions.CONTEXT_AUTH_REQUESTS,
+     100              :         version: StoreVersions.VERSION_AUTH_REQUESTS,
+     101            0 :         fromJson: (dynamic value) {
+     102            0 :           return PendingAuthRequest.fromJson(value);
+     103              :         },
+     104              :       ),
+     105            3 :       completeRequests: GenericStore(
+     106            6 :         storage: core.storage,
+     107              :         context: StoreVersions.CONTEXT_COMPLETE_REQUESTS,
+     108              :         version: StoreVersions.VERSION_COMPLETE_REQUESTS,
+     109            0 :         fromJson: (dynamic value) {
+     110            0 :           return StoredCacao.fromJson(value);
+     111              :         },
+     112              :       ),
+     113            3 :       sessionAuthRequests: GenericStore(
+     114            6 :         storage: core.storage,
+     115              :         context: StoreVersions.CONTEXT_AUTH_REQUESTS,
+     116              :         version: StoreVersions.VERSION_AUTH_REQUESTS,
+     117            0 :         fromJson: (dynamic value) {
+     118            0 :           return PendingSessionAuthRequest.fromJson(value);
+     119              :         },
+     120              :       ),
+     121              :     );
+     122              : 
+     123            6 :     authEngine = AuthEngine(
+     124            3 :       core: core,
+     125            3 :       metadata: metadata,
+     126            6 :       authKeys: signEngine.authKeys,
+     127            6 :       pairingTopics: signEngine.pairingTopics,
+     128            6 :       authRequests: signEngine.authRequests,
+     129            6 :       completeRequests: signEngine.completeRequests,
+     130              :     );
+     131              :   }
+     132              : 
+     133            3 :   @override
+     134              :   Future<void> init() async {
+     135            3 :     if (_initialized) {
+     136              :       return;
+     137              :     }
+     138              : 
+     139            6 :     await core.start();
+     140            6 :     await signEngine.init();
+     141            6 :     await authEngine.init();
+     142              : 
+     143            3 :     _initialized = true;
+     144              :   }
+     145              : 
+     146            2 :   @override
+     147              :   Future<PairingInfo> pair({
+     148              :     required Uri uri,
+     149              :   }) async {
+     150              :     try {
+     151            4 :       return await signEngine.pair(uri: uri);
+     152              :     } catch (e) {
+     153              :       rethrow;
+     154              :     }
+     155              :   }
+     156              : 
+     157              :   ///---------- SIGN ENGINE ----------///
+     158              : 
+     159            1 :   @override
+     160            2 :   Event<SessionConnect> get onSessionConnect => signEngine.onSessionConnect;
+     161            1 :   @override
+     162            2 :   Event<SessionDelete> get onSessionDelete => signEngine.onSessionDelete;
+     163            1 :   @override
+     164            2 :   Event<SessionExpire> get onSessionExpire => signEngine.onSessionExpire;
+     165            2 :   @override
+     166              :   Event<SessionProposalEvent> get onSessionProposal =>
+     167            4 :       signEngine.onSessionProposal;
+     168            0 :   @override
+     169              :   Event<SessionProposalErrorEvent> get onSessionProposalError =>
+     170            0 :       signEngine.onSessionProposalError;
+     171            1 :   @override
+     172              :   Event<SessionProposalEvent> get onProposalExpire =>
+     173            2 :       signEngine.onProposalExpire;
+     174            1 :   @override
+     175              :   Event<SessionRequestEvent> get onSessionRequest =>
+     176            2 :       signEngine.onSessionRequest;
+     177            1 :   @override
+     178            2 :   Event<SessionPing> get onSessionPing => signEngine.onSessionPing;
+     179              : 
+     180            1 :   @override
+     181            2 :   IGenericStore<ProposalData> get proposals => signEngine.proposals;
+     182            1 :   @override
+     183            2 :   ISessions get sessions => signEngine.sessions;
+     184            1 :   @override
+     185              :   IGenericStore<SessionRequest> get pendingRequests =>
+     186            2 :       signEngine.pendingRequests;
+     187              : 
+     188              :   @override
+     189              :   late ISignEngine signEngine;
+     190              : 
+     191            2 :   @override
+     192              :   Future<ApproveResponse> approveSession({
+     193              :     required int id,
+     194              :     required Map<String, Namespace> namespaces,
+     195              :     Map<String, String>? sessionProperties,
+     196              :     String? relayProtocol,
+     197              :   }) async {
+     198              :     try {
+     199            4 :       return await signEngine.approveSession(
+     200              :         id: id,
+     201              :         namespaces: namespaces,
+     202              :         sessionProperties: sessionProperties,
+     203              :         relayProtocol: relayProtocol,
+     204              :       );
+     205              :     } catch (e) {
+     206              :       rethrow;
+     207              :     }
+     208              :   }
+     209              : 
+     210            1 :   @override
+     211              :   Future<void> rejectSession({
+     212              :     required int id,
+     213              :     required WalletConnectError reason,
+     214              :   }) async {
+     215              :     try {
+     216            2 :       return await signEngine.rejectSession(
+     217              :         id: id,
+     218              :         reason: reason,
+     219              :       );
+     220              :     } catch (e) {
+     221              :       rethrow;
+     222              :     }
+     223              :   }
+     224              : 
+     225            1 :   @override
+     226              :   Future<void> updateSession({
+     227              :     required String topic,
+     228              :     required Map<String, Namespace> namespaces,
+     229              :   }) async {
+     230              :     try {
+     231            2 :       return await signEngine.updateSession(
+     232              :         topic: topic,
+     233              :         namespaces: namespaces,
+     234              :       );
+     235              :     } catch (e) {
+     236              :       // final error = e as WCError;
+     237              :       rethrow;
+     238              :     }
+     239              :   }
+     240              : 
+     241            1 :   @override
+     242              :   Future<void> extendSession({
+     243              :     required String topic,
+     244              :   }) async {
+     245              :     try {
+     246            2 :       return await signEngine.extendSession(topic: topic);
+     247              :     } catch (e) {
+     248              :       rethrow;
+     249              :     }
+     250              :   }
+     251              : 
+     252            1 :   @override
+     253              :   void registerRequestHandler({
+     254              :     required String chainId,
+     255              :     required String method,
+     256              :     dynamic Function(String, dynamic)? handler,
+     257              :   }) {
+     258              :     try {
+     259            2 :       return signEngine.registerRequestHandler(
+     260              :         chainId: chainId,
+     261              :         method: method,
+     262              :         handler: handler,
+     263              :       );
+     264              :     } catch (e) {
+     265              :       rethrow;
+     266              :     }
+     267              :   }
+     268              : 
+     269            1 :   @override
+     270              :   Future<void> respondSessionRequest({
+     271              :     required String topic,
+     272              :     required JsonRpcResponse response,
+     273              :   }) {
+     274              :     try {
+     275            2 :       return signEngine.respondSessionRequest(
+     276              :         topic: topic,
+     277              :         response: response,
+     278              :       );
+     279              :     } catch (e) {
+     280              :       rethrow;
+     281              :     }
+     282              :   }
+     283              : 
+     284            1 :   @override
+     285              :   void registerEventEmitter({
+     286              :     required String chainId,
+     287              :     required String event,
+     288              :   }) {
+     289              :     try {
+     290            2 :       return signEngine.registerEventEmitter(
+     291              :         chainId: chainId,
+     292              :         event: event,
+     293              :       );
+     294              :     } catch (e) {
+     295              :       rethrow;
+     296              :     }
+     297              :   }
+     298              : 
+     299            1 :   @override
+     300              :   void registerAccount({
+     301              :     required String chainId,
+     302              :     required String accountAddress,
+     303              :   }) {
+     304              :     try {
+     305            2 :       return signEngine.registerAccount(
+     306              :         chainId: chainId,
+     307              :         accountAddress: accountAddress,
+     308              :       );
+     309              :     } catch (e) {
+     310              :       rethrow;
+     311              :     }
+     312              :   }
+     313              : 
+     314            1 :   @override
+     315              :   Future<void> emitSessionEvent({
+     316              :     required String topic,
+     317              :     required String chainId,
+     318              :     required SessionEventParams event,
+     319              :   }) async {
+     320              :     try {
+     321            2 :       return await signEngine.emitSessionEvent(
+     322              :         topic: topic,
+     323              :         chainId: chainId,
+     324              :         event: event,
+     325              :       );
+     326              :     } catch (e) {
+     327              :       rethrow;
+     328              :     }
+     329              :   }
+     330              : 
+     331            1 :   @override
+     332              :   Future<void> disconnectSession({
+     333              :     required String topic,
+     334              :     required WalletConnectError reason,
+     335              :   }) async {
+     336              :     try {
+     337            2 :       return await signEngine.disconnectSession(
+     338              :         topic: topic,
+     339              :         reason: reason,
+     340              :       );
+     341              :     } catch (e) {
+     342              :       rethrow;
+     343              :     }
+     344              :   }
+     345              : 
+     346            1 :   @override
+     347              :   SessionData? find({
+     348              :     required Map<String, RequiredNamespace> requiredNamespaces,
+     349              :   }) {
+     350              :     try {
+     351            2 :       return signEngine.find(requiredNamespaces: requiredNamespaces);
+     352              :     } catch (e) {
+     353              :       rethrow;
+     354              :     }
+     355              :   }
+     356              : 
+     357            2 :   @override
+     358              :   Map<String, SessionData> getActiveSessions() {
+     359              :     try {
+     360            4 :       return signEngine.getActiveSessions();
+     361              :     } catch (e) {
+     362              :       rethrow;
+     363              :     }
+     364              :   }
+     365              : 
+     366            1 :   @override
+     367              :   Map<String, SessionData> getSessionsForPairing({
+     368              :     required String pairingTopic,
+     369              :   }) {
+     370              :     try {
+     371            2 :       return signEngine.getSessionsForPairing(
+     372              :         pairingTopic: pairingTopic,
+     373              :       );
+     374              :     } catch (e) {
+     375              :       rethrow;
+     376              :     }
+     377              :   }
+     378              : 
+     379            2 :   @override
+     380              :   Map<String, ProposalData> getPendingSessionProposals() {
+     381              :     try {
+     382            4 :       return signEngine.getPendingSessionProposals();
+     383              :     } catch (e) {
+     384              :       rethrow;
+     385              :     }
+     386              :   }
+     387              : 
+     388            1 :   @override
+     389              :   Map<String, SessionRequest> getPendingSessionRequests() {
+     390              :     try {
+     391            2 :       return signEngine.getPendingSessionRequests();
+     392              :     } catch (e) {
+     393              :       rethrow;
+     394              :     }
+     395              :   }
+     396              : 
+     397            2 :   @override
+     398            6 :   IPairingStore get pairings => core.pairing.getStore();
+     399              : 
+     400              :   ///---------- (DEPRECATED) AUTH ENGINE ----------///
+     401              : 
+     402            2 :   @override
+     403            4 :   Event<AuthRequest> get onAuthRequest => authEngine.onAuthRequest;
+     404              : 
+     405            0 :   @override
+     406            0 :   IGenericStore<AuthPublicKey> get authKeys => authEngine.authKeys;
+     407            0 :   @override
+     408            0 :   IGenericStore<String> get pairingTopics => authEngine.pairingTopics;
+     409            0 :   @override
+     410            0 :   IGenericStore<PendingAuthRequest> get authRequests => authEngine.authRequests;
+     411            0 :   @override
+     412              :   IGenericStore<StoredCacao> get completeRequests =>
+     413            0 :       authEngine.completeRequests;
+     414              : 
+     415              :   @Deprecated(
+     416              :     'AuthEngine/AuthClient is deprecated and will be removed soon.\n'
+     417              :     'Please use authentication methods from SignEngine/SignClient instead',
+     418              :   )
+     419              :   @override
+     420              :   late IAuthEngine authEngine;
+     421              : 
+     422            2 :   @override
+     423              :   Future<void> respondAuthRequest({
+     424              :     required int id,
+     425              :     required String iss,
+     426              :     CacaoSignature? signature,
+     427              :     WalletConnectError? error,
+     428              :   }) {
+     429              :     try {
+     430            4 :       return authEngine.respondAuthRequest(
+     431              :         id: id,
+     432              :         iss: iss,
+     433              :         signature: signature,
+     434              :         error: error,
+     435              :       );
+     436              :     } catch (e) {
+     437              :       rethrow;
+     438              :     }
+     439              :   }
+     440              : 
+     441            2 :   @override
+     442              :   Map<int, PendingAuthRequest> getPendingAuthRequests() {
+     443              :     try {
+     444            4 :       return authEngine.getPendingAuthRequests();
+     445              :     } catch (e) {
+     446              :       rethrow;
+     447              :     }
+     448              :   }
+     449              : 
+     450            1 :   @override
+     451              :   Map<int, StoredCacao> getCompletedRequestsForPairing({
+     452              :     required String pairingTopic,
+     453              :   }) {
+     454              :     try {
+     455            2 :       return authEngine.getCompletedRequestsForPairing(
+     456              :         pairingTopic: pairingTopic,
+     457              :       );
+     458              :     } catch (e) {
+     459              :       rethrow;
+     460              :     }
+     461              :   }
+     462              : 
+     463              :   ///---------- ONE-CLICK AUTH SIGN ENGINE ----------///
+     464              : 
+     465            0 :   @override
+     466              :   IGenericStore<PendingSessionAuthRequest> get sessionAuthRequests =>
+     467            0 :       signEngine.sessionAuthRequests;
+     468            0 :   @override
+     469              :   Event<SessionAuthRequest> get onSessionAuthRequest =>
+     470            0 :       signEngine.onSessionAuthRequest;
+     471              : 
+     472            0 :   @override
+     473              :   Future<ApproveResponse> approveSessionAuthenticate({
+     474              :     required int id,
+     475              :     List<Cacao>? auths,
+     476              :   }) {
+     477              :     try {
+     478            0 :       return signEngine.approveSessionAuthenticate(
+     479              :         id: id,
+     480              :         auths: auths,
+     481              :       );
+     482              :     } catch (e) {
+     483              :       rethrow;
+     484              :     }
+     485              :   }
+     486              : 
+     487            0 :   @override
+     488              :   Future<void> rejectSessionAuthenticate({
+     489              :     required int id,
+     490              :     required WalletConnectError reason,
+     491              :   }) {
+     492              :     try {
+     493            0 :       return signEngine.rejectSessionAuthenticate(
+     494              :         id: id,
+     495              :         reason: reason,
+     496              :       );
+     497              :     } catch (e) {
+     498              :       rethrow;
+     499              :     }
+     500              :   }
+     501              : 
+     502            0 :   @override
+     503              :   Map<int, PendingSessionAuthRequest> getPendingSessionAuthRequests() {
+     504              :     try {
+     505            0 :       return signEngine.getPendingSessionAuthRequests();
+     506              :     } catch (e) {
+     507              :       rethrow;
+     508              :     }
+     509              :   }
+     510              : 
+     511            0 :   @override
+     512              :   String formatAuthMessage({
+     513              :     required String iss,
+     514              :     required CacaoRequestPayload cacaoPayload,
+     515              :   }) {
+     516              :     try {
+     517            0 :       return signEngine.formatAuthMessage(
+     518              :         iss: iss,
+     519              :         cacaoPayload: cacaoPayload,
+     520              :       );
+     521              :     } catch (e) {
+     522              :       rethrow;
+     523              :     }
+     524              :   }
+     525              : 
+     526            0 :   @override
+     527              :   Future<bool> validateSignedCacao({
+     528              :     required Cacao cacao,
+     529              :     required String projectId,
+     530              :   }) {
+     531              :     try {
+     532            0 :       return signEngine.validateSignedCacao(
+     533              :         cacao: cacao,
+     534              :         projectId: projectId,
+     535              :       );
+     536              :     } catch (e) {
+     537              :       rethrow;
+     538              :     }
+     539              :   }
+     540              : }
+        
+
+
+ + + + +
Generated by: LCOV version 2.1-1
+
+ + + diff --git a/coverage/lcov.info b/coverage/lcov.info new file mode 100644 index 00000000..e0eef0de --- /dev/null +++ b/coverage/lcov.info @@ -0,0 +1,4705 @@ +TN: +SF:lib/apis/auth_api/auth_client.dart +FNF:0 +FNH:0 +DA:22,0 +DA:25,0 +DA:28,0 +DA:29,0 +DA:30,1 +DA:31,2 +DA:33,1 +DA:34,2 +DA:35,0 +DA:36,0 +DA:37,0 +DA:38,0 +DA:39,0 +DA:40,0 +DA:41,0 +DA:42,0 +DA:43,0 +DA:44,0 +DA:49,0 +DA:57,0 +DA:58,0 +DA:67,0 +DA:72,1 +DA:76,2 +DA:79,1 +DA:80,1 +DA:83,0 +DA:84,0 +DA:87,1 +DA:88,1 +DA:91,0 +DA:95,1 +DA:96,1 +DA:99,0 +DA:100,0 +DA:103,1 +DA:104,1 +DA:107,0 +DA:108,0 +DA:114,1 +DA:116,1 +DA:120,2 +DA:121,2 +DA:123,1 +DA:126,1 +DA:133,2 +DA:143,0 +DA:151,0 +DA:162,0 +DA:165,0 +DA:171,1 +DA:176,2 +DA:184,1 +DA:190,2 +LF:54 +LH:25 +end_of_record +TN: +SF:lib/apis/auth_api/auth_engine.dart +FNF:0 +FNH:0 +DA:54,3 +DA:63,3 +DA:65,3 +DA:69,9 +DA:70,6 +DA:71,6 +DA:72,6 +DA:73,6 +DA:75,3 +DA:77,3 +DA:80,2 +DA:86,2 +DA:88,2 +DA:93,3 +DA:96,1 +DA:97,1 +DA:99,6 +DA:102,6 +DA:104,8 +DA:105,2 +DA:107,2 +DA:108,2 +DA:111,2 +DA:113,2 +DA:117,2 +DA:119,4 +DA:121,2 +DA:124,4 +DA:130,6 +DA:136,2 +DA:138,2 +DA:147,2 +DA:155,2 +DA:167,6 +DA:170,6 +DA:173,2 +DA:177,0 +DA:178,0 +DA:183,0 +DA:184,0 +DA:188,6 +DA:190,2 +DA:191,2 +DA:192,2 +DA:193,4 +DA:194,2 +DA:195,2 +DA:202,2 +DA:203,2 +DA:204,2 +DA:207,4 +DA:208,4 +DA:210,2 +DA:211,0 +DA:216,2 +DA:217,0 +DA:223,2 +DA:228,4 +DA:232,0 +DA:240,0 +DA:241,0 +DA:243,2 +DA:248,4 +DA:249,2 +DA:253,2 +DA:260,2 +DA:262,2 +DA:263,2 +DA:270,2 +DA:271,4 +DA:272,6 +DA:273,8 +DA:276,2 +DA:283,0 +DA:287,0 +DA:291,2 +DA:293,2 +DA:295,2 +DA:301,6 +DA:305,2 +DA:309,6 +DA:311,4 +DA:312,2 +DA:313,2 +DA:315,2 +DA:322,2 +DA:324,2 +DA:325,8 +DA:326,4 +DA:331,1 +DA:335,1 +DA:336,1 +DA:337,1 +DA:338,1 +DA:339,3 +DA:341,2 +DA:342,2 +DA:347,2 +DA:353,4 +DA:354,2 +DA:355,4 +DA:356,4 +DA:357,4 +DA:358,4 +DA:359,4 +DA:360,2 +DA:361,2 +DA:362,5 +DA:363,1 +DA:365,2 +DA:369,2 +DA:377,6 +DA:384,2 +DA:385,2 +DA:386,0 +DA:392,3 +DA:393,9 +DA:395,3 +DA:400,2 +DA:405,4 +DA:408,2 +DA:409,2 +DA:412,4 +DA:413,4 +DA:414,2 +DA:415,2 +DA:417,2 +DA:422,4 +DA:423,2 +DA:424,2 +DA:426,2 +DA:427,2 +DA:430,0 +DA:431,0 +DA:432,0 +DA:434,0 +DA:435,0 +DA:436,0 +LF:138 +LH:120 +end_of_record +TN: +SF:lib/apis/core/core.dart +FNF:0 +FNH:0 +DA:33,7 +DA:35,7 +DA:72,9 +DA:73,9 +DA:75,0 +DA:77,0 +DA:80,0 +DA:82,0 +DA:88,10 +DA:97,20 +DA:98,10 +DA:99,10 +DA:101,20 +DA:102,20 +DA:105,20 +DA:107,10 +DA:108,10 +DA:111,0 +DA:114,20 +DA:116,10 +DA:117,10 +DA:120,0 +DA:121,0 +DA:124,10 +DA:125,10 +DA:128,0 +DA:132,20 +DA:133,10 +DA:136,0 +DA:138,20 +DA:140,10 +DA:141,10 +DA:144,0 +DA:145,0 +DA:148,10 +DA:149,10 +DA:152,0 +DA:154,10 +DA:155,10 +DA:158,0 +DA:161,20 +DA:163,10 +DA:164,10 +DA:168,20 +DA:174,9 +DA:176,18 +DA:177,18 +DA:178,18 +DA:179,18 +DA:180,18 +DA:181,18 +LF:51 +LH:38 +end_of_record +TN: +SF:lib/apis/core/crypto/crypto.dart +FNF:0 +FNH:0 +DA:24,0 +DA:35,10 +DA:40,10 +DA:41,10 +DA:43,10 +DA:45,10 +DA:49,20 +DA:51,10 +DA:54,0 +DA:56,0 +DA:57,0 +DA:60,0 +DA:62,0 +DA:65,0 +DA:66,0 +DA:67,0 +DA:70,6 +DA:72,6 +DA:74,12 +DA:75,6 +DA:78,6 +DA:84,6 +DA:86,6 +DA:87,12 +DA:88,6 +DA:91,8 +DA:96,8 +DA:98,16 +DA:100,16 +DA:104,4 +DA:106,4 +DA:107,8 +DA:110,6 +DA:112,6 +DA:113,12 +DA:116,7 +DA:122,7 +DA:126,14 +DA:128,4 +DA:129,2 +DA:130,2 +DA:131,2 +DA:135,7 +DA:137,14 +DA:138,2 +DA:139,2 +DA:140,2 +DA:143,7 +DA:148,14 +DA:151,7 +DA:152,7 +DA:158,7 +DA:164,7 +DA:166,14 +DA:168,6 +DA:171,14 +DA:172,2 +DA:173,2 +DA:174,2 +DA:176,7 +DA:181,14 +DA:186,9 +DA:188,9 +DA:190,9 +DA:191,18 +DA:192,18 +DA:193,18 +DA:202,0 +DA:204,0 +DA:206,0 +DA:211,6 +DA:212,24 +DA:213,6 +DA:216,6 +DA:217,12 +DA:220,7 +DA:222,14 +DA:238,9 +DA:239,18 +DA:241,18 +DA:242,18 +DA:245,18 +DA:248,10 +DA:249,10 +DA:250,1 +DA:254,7 +DA:256,7 +LF:87 +LH:75 +end_of_record +TN: +SF:lib/apis/core/crypto/crypto_models.dart +FNF:0 +FNH:0 +DA:9,22 +DA:11,0 +DA:12,0 +DA:15,0 +DA:16,0 +DA:27,0 +DA:43,7 +DA:57,7 +DA:72,2 +DA:82,6 +LF:10 +LH:5 +end_of_record +TN: +SF:lib/apis/core/crypto/crypto_utils.dart +FNF:0 +FNH:0 +DA:16,30 +DA:23,6 +DA:25,6 +DA:27,6 +DA:28,12 +DA:29,12 +DA:33,10 +DA:35,10 +DA:36,20 +DA:37,30 +DA:42,10 +DA:44,20 +DA:47,6 +DA:49,6 +DA:50,6 +DA:51,6 +DA:54,6 +DA:56,12 +DA:57,6 +DA:61,6 +DA:63,6 +DA:64,6 +DA:67,8 +DA:69,8 +DA:70,16 +DA:71,8 +DA:72,8 +DA:79,5 +DA:81,5 +DA:82,10 +DA:83,5 +DA:84,5 +DA:90,7 +DA:103,7 +DA:112,8 +DA:114,7 +DA:115,7 +DA:116,7 +DA:117,7 +DA:118,7 +DA:123,7 +DA:125,7 +DA:128,3 +DA:133,7 +DA:135,7 +DA:136,7 +DA:137,7 +DA:139,7 +DA:140,7 +DA:141,7 +DA:145,7 +DA:146,7 +DA:149,7 +DA:156,7 +DA:158,7 +DA:166,3 +DA:170,7 +DA:172,7 +DA:175,7 +DA:177,7 +DA:178,7 +DA:182,7 +DA:183,3 +DA:185,3 +DA:187,3 +DA:189,14 +DA:190,7 +DA:191,7 +DA:192,7 +DA:194,7 +DA:203,7 +DA:208,7 +DA:209,7 +DA:210,6 +DA:212,7 +DA:213,7 +DA:219,7 +DA:226,7 +DA:236,7 +DA:243,7 +DA:247,14 +DA:248,3 +DA:249,3 +LF:83 +LH:83 +end_of_record +TN: +SF:lib/apis/core/echo/echo.dart +FNF:0 +FNH:0 +DA:10,11 +DA:12,1 +DA:14,2 +DA:15,3 +DA:16,2 +DA:22,2 +DA:23,3 +DA:24,4 +DA:27,0 +DA:31,1 +DA:33,2 +DA:34,3 +DA:35,2 +DA:40,2 +DA:41,3 +DA:42,4 +DA:45,0 +LF:17 +LH:15 +end_of_record +TN: +SF:lib/apis/core/echo/echo_client.dart +FNF:0 +FNH:0 +DA:14,11 +DA:16,1 +DA:22,1 +DA:24,3 +DA:25,2 +DA:28,2 +DA:31,2 +DA:32,1 +DA:35,1 +DA:40,3 +DA:42,2 +DA:44,2 +DA:45,1 +LF:13 +LH:13 +end_of_record +TN: +SF:lib/apis/core/echo/models/echo_body.dart +FNF:0 +FNH:0 +DA:11,1 +DA:17,0 +DA:18,0 +DA:20,2 +LF:4 +LH:2 +end_of_record +TN: +SF:lib/apis/core/echo/models/echo_response.dart +FNF:0 +FNH:0 +DA:11,1 +DA:17,1 +DA:18,1 +DA:20,0 +DA:28,1 +DA:30,1 +DA:31,1 +DA:33,0 +DA:42,1 +DA:48,2 +DA:50,0 +LF:11 +LH:8 +end_of_record +TN: +SF:lib/apis/core/heartbit/heartbeat.dart +FNF:0 +FNH:0 +DA:12,10 +DA:14,9 +DA:16,9 +DA:17,18 +DA:18,18 +DA:19,18 +DA:23,0 +DA:25,0 +DA:26,0 +LF:9 +LH:6 +end_of_record +TN: +SF:lib/apis/core/pairing/expirer.dart +FNF:0 +FNH:0 +DA:11,10 +DA:18,0 +DA:20,0 +DA:22,0 +DA:23,0 +DA:32,6 +DA:34,6 +DA:36,12 +DA:37,12 +DA:38,6 +DA:39,4 +DA:47,4 +DA:49,4 +DA:51,8 +DA:56,8 +DA:57,4 +DA:62,4 +LF:17 +LH:13 +end_of_record +TN: +SF:lib/apis/core/pairing/json_rpc_history.dart +FNF:0 +FNH:0 +DA:7,11 +DA:14,1 +DA:16,1 +DA:19,2 +DA:20,2 +DA:24,1 +DA:27,1 +DA:31,2 +DA:32,1 +DA:33,1 +DA:34,0 +DA:36,1 +LF:12 +LH:11 +end_of_record +TN: +SF:lib/apis/core/pairing/pairing.dart +FNF:0 +FNH:0 +DA:29,6 +DA:66,10 +DA:73,9 +DA:75,9 +DA:79,9 +DA:80,9 +DA:81,9 +DA:83,27 +DA:84,18 +DA:85,18 +DA:86,18 +DA:88,9 +DA:90,9 +DA:92,9 +DA:95,6 +DA:97,12 +DA:98,24 +DA:102,7 +DA:104,7 +DA:105,28 +DA:106,21 +DA:107,7 +DA:110,7 +DA:111,7 +DA:116,20 +DA:118,7 +DA:119,14 +DA:120,14 +DA:128,14 +DA:129,7 +DA:134,14 +DA:135,21 +DA:136,21 +DA:138,7 +DA:145,7 +DA:150,7 +DA:153,7 +DA:156,7 +DA:157,14 +DA:158,3 +DA:164,7 +DA:165,14 +DA:166,14 +DA:167,7 +DA:172,14 +DA:176,7 +DA:177,14 +DA:178,21 +DA:180,4 +DA:182,8 +DA:183,4 +DA:184,4 +DA:198,14 +DA:199,21 +DA:200,28 +DA:203,21 +DA:205,14 +DA:206,7 +DA:212,2 +DA:221,7 +DA:223,7 +DA:224,7 +DA:229,14 +DA:230,7 +DA:236,14 +DA:241,21 +DA:244,9 +DA:250,18 +DA:251,6 +DA:252,6 +DA:260,27 +DA:267,2 +DA:273,2 +DA:274,4 +DA:276,2 +DA:279,2 +DA:286,1 +DA:291,1 +DA:294,1 +DA:295,1 +DA:304,2 +DA:308,3 +DA:314,5 +DA:319,5 +DA:320,10 +DA:326,9 +DA:328,18 +DA:331,4 +DA:333,8 +DA:336,5 +DA:338,5 +DA:340,5 +DA:342,10 +DA:344,5 +DA:347,5 +DA:352,4 +DA:354,4 +DA:356,4 +DA:357,8 +DA:360,4 +DA:363,8 +DA:368,8 +DA:370,8 +DA:371,4 +DA:378,5 +DA:380,5 +DA:383,6 +DA:385,12 +DA:386,4 +DA:388,4 +DA:392,18 +DA:393,0 +DA:395,0 +DA:402,6 +DA:411,18 +DA:412,6 +DA:415,6 +DA:422,18 +DA:432,12 +DA:434,4 +DA:438,12 +DA:439,21 +DA:442,18 +DA:444,18 +DA:447,6 +DA:448,6 +DA:453,6 +DA:454,0 +DA:458,12 +DA:459,0 +DA:462,12 +DA:468,6 +DA:476,18 +DA:477,6 +DA:480,6 +DA:484,18 +DA:494,12 +DA:495,18 +DA:498,6 +DA:499,6 +DA:503,3 +DA:512,9 +DA:513,3 +DA:516,3 +DA:520,9 +DA:531,3 +DA:532,0 +DA:533,6 +DA:537,9 +DA:540,3 +DA:541,3 +DA:547,9 +DA:549,27 +DA:554,16 +DA:555,8 +DA:556,0 +DA:558,0 +DA:563,2 +DA:564,6 +DA:565,4 +DA:566,6 +DA:568,6 +DA:572,9 +DA:573,9 +DA:574,9 +DA:575,3 +DA:577,9 +DA:578,10 +DA:580,2 +DA:584,9 +DA:585,9 +DA:586,9 +DA:587,4 +DA:589,9 +DA:591,10 +DA:593,4 +DA:598,9 +DA:599,9 +DA:600,12 +DA:601,9 +DA:603,10 +DA:605,3 +DA:609,7 +DA:610,7 +DA:611,0 +DA:619,9 +DA:620,45 +DA:621,45 +DA:623,9 +DA:625,9 +DA:628,9 +DA:630,9 +DA:635,0 +DA:637,0 +DA:640,6 +DA:647,18 +DA:650,6 +DA:654,18 +DA:655,6 +DA:656,6 +DA:657,6 +DA:658,2 +DA:667,6 +DA:668,24 +DA:672,6 +DA:673,6 +DA:674,18 +DA:675,36 +DA:677,0 +DA:682,6 +DA:694,18 +DA:695,6 +DA:696,15 +DA:697,9 +DA:698,3 +DA:699,6 +DA:704,30 +DA:705,36 +DA:711,5 +DA:715,5 +DA:718,5 +DA:719,5 +DA:722,5 +DA:725,10 +DA:726,5 +DA:731,0 +DA:733,0 +DA:736,0 +DA:742,4 +DA:747,4 +DA:749,4 +DA:750,4 +DA:753,4 +DA:756,8 +DA:757,8 +DA:758,4 +DA:763,0 +DA:764,0 +DA:767,0 +DA:773,0 +DA:777,0 +DA:778,0 +DA:780,0 +DA:783,0 +DA:786,0 +DA:787,0 +DA:790,0 +DA:791,0 +DA:793,0 +DA:794,0 +DA:800,9 +DA:801,45 +DA:804,9 +DA:805,45 +DA:808,4 +DA:813,12 +DA:815,2 +DA:816,2 +DA:817,1 +DA:818,1 +DA:824,6 +DA:825,6 +DA:830,5 +DA:831,5 +DA:834,4 +DA:835,4 +LF:266 +LH:238 +end_of_record +TN: +SF:lib/apis/core/pairing/pairing_store.dart +FNF:0 +FNH:0 +DA:6,11 +DA:13,8 +DA:20,8 +DA:22,8 +DA:28,16 +DA:31,14 +DA:34,10 +DA:37,8 +LF:8 +LH:8 +end_of_record +TN: +SF:lib/apis/core/pairing/utils/json_rpc_utils.dart +FNF:0 +FNH:0 +DA:8,8 +DA:9,8 +DA:10,24 +DA:11,32 +DA:12,8 +DA:15,6 +DA:20,6 +DA:21,6 +DA:28,6 +DA:32,6 +DA:39,3 +DA:40,3 +DA:43,3 +DA:47,7 +DA:51,7 +DA:54,13 +DA:55,24 +DA:57,4 +DA:62,7 +DA:65,4 +DA:68,8 +LF:21 +LH:21 +end_of_record +TN: +SF:lib/apis/core/pairing/utils/pairing_models.dart +FNF:0 +FNH:0 +DA:28,0 +DA:29,0 +DA:44,0 +DA:51,5 +DA:52,5 +DA:63,0 +DA:64,0 +DA:72,7 +DA:78,0 +DA:80,0 +DA:88,4 +DA:93,0 +DA:95,0 +DA:102,0 +DA:104,0 +DA:106,0 +DA:113,4 +DA:117,0 +DA:119,0 +DA:128,7 +DA:134,0 +DA:136,0 +DA:144,7 +DA:149,0 +DA:151,0 +DA:168,0 +DA:169,0 +DA:181,0 +DA:182,0 +DA:190,9 +DA:196,0 +DA:198,0 +LF:32 +LH:8 +end_of_record +TN: +SF:lib/apis/core/relay_auth/relay_auth.dart +FNF:0 +FNH:0 +DA:20,9 +DA:25,0 +DA:26,0 +DA:27,0 +DA:29,9 +DA:30,9 +DA:33,9 +DA:34,18 +DA:35,18 +DA:39,10 +DA:47,36 +DA:48,10 +DA:49,20 +DA:50,10 +DA:51,10 +DA:58,10 +DA:59,10 +DA:64,10 +DA:65,20 +DA:69,20 +DA:72,1 +DA:74,1 +DA:77,3 +DA:78,3 +DA:79,0 +DA:85,3 +DA:86,1 +DA:87,1 +DA:88,2 +DA:89,2 +DA:103,10 +DA:104,10 +DA:107,10 +DA:109,10 +DA:110,10 +DA:111,10 +DA:113,10 +DA:118,1 +DA:120,1 +DA:121,1 +DA:122,1 +DA:123,1 +DA:132,10 +DA:134,20 +DA:136,50 +DA:137,10 +DA:141,10 +DA:145,1 +DA:147,1 +DA:148,4 +DA:149,0 +DA:151,1 +DA:154,1 +DA:155,1 +DA:156,0 +DA:163,3 +DA:166,3 +DA:167,1 +DA:168,0 +DA:175,1 +DA:176,2 +DA:177,0 +DA:186,10 +DA:188,10 +DA:189,30 +DA:190,30 +DA:191,10 +DA:193,20 +DA:196,0 +DA:198,0 +DA:200,0 +DA:201,0 +DA:203,0 +DA:206,10 +DA:208,20 +DA:211,1 +DA:213,3 +DA:216,10 +DA:218,10 +DA:219,30 +DA:220,30 +DA:221,30 +DA:222,10 +DA:225,1 +DA:227,1 +DA:229,3 +DA:230,3 +DA:231,2 +DA:232,3 +DA:234,1 +LF:90 +LH:77 +end_of_record +TN: +SF:lib/apis/core/relay_auth/relay_auth_models.dart +FNF:0 +FNH:0 +DA:14,9 +DA:17,9 +DA:18,9 +DA:20,1 +DA:23,2 +DA:24,2 +DA:35,10 +DA:40,1 +DA:41,1 +DA:43,20 +DA:54,10 +DA:62,1 +DA:63,1 +DA:65,20 +DA:72,10 +DA:78,10 +DA:82,20 +DA:88,1 +DA:93,1 +DA:100,0 +DA:110,0 +LF:21 +LH:19 +end_of_record +TN: +SF:lib/apis/core/relay_client/i_relay_client.dart +FNF:0 +FNH:0 +DA:10,0 +LF:1 +LH:0 +end_of_record +TN: +SF:lib/apis/core/relay_client/json_rpc_2/error_code.dart +FNF:0 +FNH:0 +DA:42,0 +DA:44,0 +DA:46,0 +DA:48,0 +DA:50,0 +DA:52,0 +LF:6 +LH:0 +end_of_record +TN: +SF:lib/apis/core/relay_client/json_rpc_2/src/client.dart +FNF:0 +FNH:0 +DA:40,24 +DA:46,24 +DA:52,0 +DA:53,0 +DA:54,0 +DA:64,8 +DA:65,24 +DA:66,21 +DA:67,15 +DA:68,10 +DA:70,16 +DA:71,8 +DA:82,8 +DA:83,32 +DA:84,0 +DA:85,0 +DA:86,0 +DA:87,0 +DA:88,0 +DA:90,8 +DA:97,8 +DA:98,24 +DA:99,32 +DA:100,8 +DA:116,8 +DA:117,0 +DA:118,8 +DA:120,8 +DA:121,32 +DA:122,8 +DA:137,0 +DA:138,0 +DA:144,8 +DA:145,8 +DA:146,8 +DA:147,0 +DA:150,8 +DA:152,8 +DA:153,8 +DA:154,8 +DA:156,8 +DA:157,0 +DA:159,24 +DA:175,0 +DA:176,0 +DA:177,0 +DA:181,0 +DA:182,0 +DA:183,0 +DA:184,0 +DA:189,8 +DA:190,8 +DA:191,0 +DA:193,8 +DA:199,8 +DA:200,8 +DA:201,8 +DA:202,8 +DA:203,16 +DA:204,8 +DA:205,21 +DA:207,8 +DA:208,20 +DA:209,8 +DA:210,4 +DA:215,8 +DA:216,8 +DA:217,16 +DA:218,8 +DA:219,8 +DA:220,16 +DA:221,8 +DA:223,4 +DA:224,4 +DA:225,4 +DA:226,8 +DA:227,8 +DA:243,8 +LF:78 +LH:57 +end_of_record +TN: +SF:lib/apis/core/relay_client/json_rpc_2/src/exception.dart +FNF:0 +FNH:0 +DA:29,4 +DA:34,0 +DA:35,0 +DA:41,0 +DA:42,0 +DA:46,0 +DA:48,0 +DA:49,0 +DA:50,0 +DA:51,0 +DA:52,0 +DA:54,0 +DA:57,0 +DA:58,0 +DA:59,0 +DA:61,0 +DA:66,0 +DA:68,0 +DA:69,0 +DA:70,0 +DA:71,0 +LF:21 +LH:1 +end_of_record +TN: +SF:lib/apis/core/relay_client/json_rpc_2/src/parameters.dart +FNF:0 +FNH:0 +DA:31,7 +DA:46,7 +DA:47,7 +DA:48,0 +DA:49,0 +DA:50,0 +DA:52,0 +DA:54,7 +DA:55,7 +DA:56,14 +DA:57,28 +DA:59,0 +DA:62,0 +DA:68,0 +DA:69,0 +DA:70,0 +DA:74,0 +DA:75,0 +DA:76,0 +DA:80,0 +DA:81,0 +DA:82,0 +DA:87,7 +DA:88,14 +DA:89,0 +DA:128,0 +DA:129,0 +DA:130,0 +DA:133,0 +DA:134,0 +DA:138,0 +DA:139,0 +DA:140,0 +DA:143,0 +DA:144,0 +DA:145,0 +DA:146,0 +DA:149,0 +DA:153,0 +DA:155,7 +DA:156,7 +DA:159,0 +DA:165,0 +DA:170,0 +DA:180,0 +DA:189,0 +DA:195,0 +DA:200,0 +DA:206,0 +DA:211,0 +DA:217,0 +DA:218,0 +DA:223,0 +DA:229,7 +DA:230,21 +DA:235,0 +DA:242,0 +DA:248,0 +DA:255,0 +DA:261,0 +DA:268,7 +DA:269,21 +DA:270,0 +DA:271,0 +DA:274,0 +DA:275,0 +DA:277,0 +DA:278,0 +DA:282,0 +DA:283,0 +DA:286,0 +DA:289,0 +DA:290,0 +DA:291,0 +DA:295,0 +DA:298,0 +DA:301,7 +DA:304,7 +DA:310,0 +DA:312,0 +DA:313,0 +DA:316,0 +DA:319,0 +DA:320,0 +DA:322,0 +DA:325,0 +DA:328,0 +DA:331,0 +DA:334,0 +DA:337,0 +DA:340,0 +DA:343,0 +DA:346,0 +LF:93 +LH:17 +end_of_record +TN: +SF:lib/apis/core/relay_client/json_rpc_2/src/peer.dart +FNF:0 +FNH:0 +DA:39,56 +DA:41,8 +DA:42,32 +DA:44,0 +DA:45,0 +DA:47,0 +DA:48,0 +DA:62,8 +DA:64,8 +DA:65,32 +DA:84,8 +DA:86,16 +DA:87,40 +DA:90,16 +DA:91,40 +DA:96,8 +DA:98,16 +DA:100,0 +DA:102,0 +DA:104,0 +DA:105,0 +DA:109,8 +DA:111,16 +DA:113,0 +DA:115,0 +DA:119,8 +DA:121,16 +DA:122,16 +DA:123,32 +DA:124,8 +DA:125,16 +DA:126,16 +DA:128,14 +DA:130,0 +DA:131,0 +DA:132,0 +DA:133,0 +DA:134,0 +DA:135,0 +DA:137,0 +DA:142,0 +DA:144,0 +DA:145,0 +DA:146,8 +DA:147,8 +DA:150,8 +DA:152,16 +DA:153,16 +DA:154,8 +LF:49 +LH:29 +end_of_record +TN: +SF:lib/apis/core/relay_client/json_rpc_2/src/server.dart +FNF:0 +FNH:0 +DA:50,24 +DA:56,24 +DA:84,0 +DA:86,0 +DA:87,0 +DA:106,8 +DA:115,8 +DA:116,32 +DA:117,0 +DA:118,0 +DA:119,0 +DA:120,0 +DA:122,8 +DA:129,8 +DA:130,24 +DA:131,32 +DA:132,8 +DA:144,8 +DA:145,16 +DA:146,0 +DA:149,16 +DA:163,0 +DA:164,0 +DA:174,7 +DA:176,7 +DA:177,0 +DA:178,0 +DA:180,0 +DA:182,0 +DA:183,0 +DA:184,0 +DA:185,0 +DA:188,7 +DA:192,28 +DA:196,7 +DA:198,7 +DA:200,7 +DA:201,14 +DA:202,0 +DA:205,7 +DA:206,0 +DA:207,0 +DA:210,0 +DA:212,21 +DA:217,7 +DA:219,14 +DA:221,0 +DA:222,0 +DA:223,0 +DA:224,0 +DA:226,0 +DA:229,0 +DA:230,0 +DA:233,0 +DA:234,0 +DA:235,0 +DA:236,0 +DA:237,0 +DA:238,0 +DA:243,7 +DA:244,7 +DA:245,0 +DA:251,14 +DA:252,0 +DA:258,7 +DA:259,14 +DA:260,0 +DA:261,0 +DA:263,0 +DA:266,7 +DA:267,0 +DA:273,7 +DA:274,14 +DA:275,0 +DA:276,0 +DA:278,0 +DA:281,7 +DA:282,7 +DA:283,14 +DA:284,0 +DA:285,0 +DA:287,0 +DA:291,7 +DA:292,14 +DA:293,0 +DA:294,0 +DA:296,0 +DA:301,0 +DA:302,0 +DA:304,0 +DA:305,0 +DA:306,0 +DA:310,0 +DA:311,0 +DA:312,0 +DA:313,0 +DA:317,0 +LF:97 +LH:38 +end_of_record +TN: +SF:lib/apis/core/relay_client/json_rpc_2/src/utils.dart +FNF:0 +FNH:0 +DA:16,0 +DA:22,0 +DA:23,0 +DA:30,0 +DA:33,0 +DA:35,0 +DA:39,0 +DA:40,0 +DA:42,0 +DA:47,0 +DA:48,0 +DA:49,0 +DA:50,0 +DA:54,16 +DA:55,8 +DA:59,8 +DA:61,16 +DA:62,8 +DA:64,0 +DA:65,0 +DA:66,0 +DA:67,0 +LF:22 +LH:5 +end_of_record +TN: +SF:lib/apis/core/relay_client/message_tracker.dart +FNF:0 +FNH:0 +DA:12,11 +DA:19,8 +DA:20,8 +DA:21,16 +DA:22,8 +DA:23,8 +DA:29,8 +DA:31,8 +DA:33,16 +DA:34,8 +DA:36,8 +DA:40,16 +DA:41,24 +DA:43,24 +DA:44,8 +DA:47,8 +DA:49,8 +DA:50,40 +LF:18 +LH:18 +end_of_record +TN: +SF:lib/apis/core/relay_client/relay_client.dart +FNF:0 +FNH:0 +DA:55,9 +DA:56,25 +DA:58,20 +DA:81,10 +DA:86,10 +DA:88,9 +DA:90,9 +DA:94,18 +DA:95,18 +DA:98,9 +DA:99,9 +DA:101,9 +DA:104,7 +DA:111,7 +DA:113,7 +DA:121,14 +DA:122,7 +DA:123,7 +DA:125,7 +DA:129,15 +DA:133,7 +DA:135,7 +DA:137,21 +DA:139,14 +DA:142,5 +DA:144,5 +DA:146,10 +DA:149,5 +DA:150,5 +DA:151,5 +DA:155,5 +DA:158,12 +DA:162,10 +DA:163,10 +DA:166,10 +DA:169,0 +DA:171,0 +DA:173,0 +DA:175,0 +DA:178,8 +DA:180,8 +DA:182,24 +DA:184,8 +DA:189,9 +DA:190,9 +DA:194,36 +DA:195,63 +DA:198,9 +DA:199,9 +DA:204,18 +DA:205,9 +DA:206,8 +DA:207,8 +DA:209,2 +DA:210,0 +DA:211,0 +DA:212,0 +DA:213,0 +DA:215,10 +DA:216,6 +DA:217,2 +DA:221,9 +DA:222,27 +DA:223,9 +DA:225,9 +DA:227,17 +DA:228,9 +DA:229,18 +DA:230,9 +DA:233,16 +DA:237,9 +DA:238,9 +DA:239,9 +DA:240,45 +DA:241,36 +DA:242,9 +DA:245,18 +DA:248,18 +DA:249,9 +DA:252,9 +DA:253,0 +DA:254,0 +DA:257,36 +DA:258,18 +DA:259,34 +DA:261,32 +DA:263,16 +DA:264,8 +DA:265,8 +DA:267,16 +DA:268,8 +DA:269,8 +DA:271,16 +DA:272,8 +DA:273,8 +DA:276,16 +DA:283,16 +DA:286,8 +DA:287,24 +DA:288,8 +DA:289,8 +DA:290,16 +DA:291,16 +DA:296,16 +DA:297,56 +DA:300,8 +DA:301,8 +DA:302,0 +DA:305,8 +DA:307,32 +DA:309,8 +DA:314,1 +DA:316,1 +DA:317,0 +DA:319,1 +DA:320,1 +DA:323,2 +DA:324,2 +DA:333,9 +DA:334,9 +DA:335,45 +DA:336,9 +DA:340,9 +DA:341,45 +DA:342,9 +DA:345,5 +DA:346,5 +DA:347,0 +DA:351,8 +DA:352,8 +DA:357,7 +DA:358,28 +DA:360,7 +DA:361,24 +DA:366,14 +DA:369,14 +DA:370,7 +DA:378,7 +DA:379,21 +DA:380,21 +DA:381,7 +DA:384,0 +DA:385,0 +DA:388,0 +DA:389,0 +DA:394,7 +DA:395,7 +DA:396,14 +DA:401,8 +DA:407,8 +DA:411,5 +DA:412,0 +DA:415,10 +DA:416,0 +DA:422,16 +DA:429,7 +DA:432,7 +DA:433,7 +DA:434,7 +DA:435,7 +DA:438,4 +DA:439,3 +DA:446,21 +DA:447,14 +DA:452,7 +DA:453,14 +DA:457,0 +DA:458,0 +DA:459,0 +DA:465,8 +DA:466,8 +DA:467,0 +LF:172 +LH:149 +end_of_record +TN: +SF:lib/apis/core/relay_client/relay_client_models.dart +FNF:0 +FNH:0 +DA:11,12 +DA:16,8 +DA:18,8 +DA:25,7 +DA:30,0 +DA:31,0 +DA:37,8 +DA:45,0 +DA:53,0 +DA:56,0 +LF:10 +LH:5 +end_of_record +TN: +SF:lib/apis/core/relay_client/websocket/http_client.dart +FNF:0 +FNH:0 +DA:5,82 +DA:7,0 +DA:12,0 +DA:15,0 +DA:17,0 +DA:20,0 +DA:26,0 +LF:7 +LH:1 +end_of_record +TN: +SF:lib/apis/core/relay_client/websocket/i_http_client.dart +FNF:0 +FNH:0 +DA:4,82 +LF:1 +LH:1 +end_of_record +TN: +SF:lib/apis/core/relay_client/websocket/websocket_handler.dart +FNF:0 +FNH:0 +DA:10,8 +DA:11,8 +DA:15,8 +DA:16,16 +DA:17,8 +DA:18,16 +DA:21,8 +DA:22,8 +DA:24,0 +DA:25,0 +DA:29,8 +DA:33,8 +DA:35,8 +DA:38,8 +DA:42,16 +DA:43,8 +DA:44,16 +DA:48,0 +DA:49,0 +DA:50,0 +DA:54,24 +DA:56,8 +DA:58,0 +DA:59,0 +DA:61,0 +DA:65,16 +DA:76,8 +DA:79,8 +DA:80,24 +DA:83,8 +DA:86,0 +DA:88,0 +LF:32 +LH:22 +end_of_record +TN: +SF:lib/apis/core/store/generic_store.dart +FNF:0 +FNH:0 +DA:14,12 +DA:15,36 +DA:36,12 +DA:43,12 +DA:45,12 +DA:49,24 +DA:50,12 +DA:52,12 +DA:55,8 +DA:57,8 +DA:58,16 +DA:61,12 +DA:63,12 +DA:64,24 +DA:65,20 +DA:70,10 +DA:72,30 +DA:75,12 +DA:77,12 +DA:79,24 +DA:80,18 +DA:81,9 +DA:87,24 +DA:88,12 +DA:95,24 +DA:97,12 +DA:100,9 +DA:102,9 +DA:104,18 +DA:108,18 +DA:109,9 +DA:111,18 +DA:115,9 +DA:118,12 +DA:120,12 +DA:122,24 +DA:123,12 +DA:126,48 +DA:129,12 +DA:132,36 +DA:134,60 +DA:135,48 +DA:141,32 +DA:142,16 +DA:144,4 +DA:145,5 +DA:146,4 +DA:150,24 +DA:154,34 +DA:156,12 +DA:160,2 +DA:165,12 +DA:167,12 +DA:168,0 +LF:54 +LH:53 +end_of_record +TN: +SF:lib/apis/core/store/shared_prefs_store.dart +FNF:0 +FNH:0 +DA:14,0 +DA:15,0 +DA:17,0 +DA:18,0 +DA:20,0 +DA:21,0 +DA:23,12 +DA:28,12 +DA:31,12 +DA:34,12 +DA:36,12 +DA:40,12 +DA:41,0 +DA:44,12 +DA:49,8 +DA:51,8 +DA:53,8 +DA:54,16 +DA:55,16 +DA:58,1 +DA:60,0 +DA:65,12 +DA:67,12 +DA:68,12 +DA:69,24 +DA:71,0 +DA:75,0 +DA:77,0 +DA:78,0 +DA:82,12 +DA:84,12 +DA:86,12 +DA:87,24 +DA:88,12 +DA:92,0 +DA:94,0 +DA:96,0 +DA:97,0 +DA:98,0 +DA:100,0 +DA:101,0 +DA:106,1 +DA:108,1 +DA:110,1 +DA:111,2 +DA:112,1 +DA:115,1 +DA:116,1 +DA:120,0 +DA:121,0 +DA:122,0 +DA:124,0 +DA:128,12 +DA:129,12 +DA:134,0 +DA:135,0 +DA:136,0 +DA:137,0 +DA:139,0 +DA:144,1 +DA:145,1 +DA:148,0 +DA:151,12 +DA:152,24 +DA:155,12 +DA:156,12 +DA:157,0 +LF:67 +LH:37 +end_of_record +TN: +SF:lib/apis/core/store/store_models.dart +FNF:0 +FNH:0 +DA:7,12 +DA:17,9 +DA:27,9 +DA:34,12 +LF:4 +LH:4 +end_of_record +TN: +SF:lib/apis/core/verify/models/verify_context.dart +FNF:0 +FNH:0 +DA:12,0 +DA:13,0 +DA:14,0 +DA:15,0 +DA:28,0 +DA:29,0 +DA:41,0 +DA:42,0 +DA:49,8 +LF:9 +LH:1 +end_of_record +TN: +SF:lib/apis/core/verify/verify.dart +FNF:0 +FNH:0 +DA:14,10 +DA:20,5 +DA:24,10 +DA:27,4 +DA:30,12 +DA:31,16 +DA:32,16 +DA:33,4 +DA:38,0 +DA:39,0 +DA:41,0 +DA:43,20 +DA:48,5 +DA:51,5 +DA:52,0 +DA:53,0 +LF:16 +LH:11 +end_of_record +TN: +SF:lib/apis/models/basic_models.dart +FNF:0 +FNH:0 +DA:20,0 +DA:21,0 +DA:42,5 +DA:43,5 +LF:4 +LH:2 +end_of_record +TN: +SF:lib/apis/models/json_rpc_error.dart +FNF:0 +FNH:0 +DA:14,0 +DA:15,0 +DA:16,3 +DA:17,6 +DA:18,0 +DA:19,0 +DA:20,0 +DA:21,0 +DA:22,3 +DA:23,6 +DA:25,3 +DA:26,3 +LF:12 +LH:6 +end_of_record +TN: +SF:lib/apis/models/json_rpc_request.dart +FNF:0 +FNH:0 +DA:16,6 +DA:17,6 +LF:2 +LH:2 +end_of_record +TN: +SF:lib/apis/models/json_rpc_response.dart +FNF:0 +FNH:0 +DA:17,6 +DA:18,12 +LF:2 +LH:2 +end_of_record +TN: +SF:lib/apis/models/uri_parse_result.dart +FNF:0 +FNH:0 +DA:15,8 +DA:28,5 +DA:39,8 +LF:3 +LH:3 +end_of_record +TN: +SF:lib/apis/sign_api/models/auth/auth_client_events.dart +FNF:0 +FNH:0 +DA:15,2 +DA:22,0 +DA:24,0 +DA:35,2 +DA:43,0 +DA:44,0 +DA:45,0 +DA:46,0 +DA:47,0 +DA:48,0 +DA:51,0 +DA:53,0 +LF:12 +LH:2 +end_of_record +TN: +SF:lib/apis/sign_api/models/auth/auth_client_models.dart +FNF:0 +FNH:0 +DA:18,2 +DA:47,3 +DA:59,3 +DA:61,0 +DA:62,0 +DA:63,0 +DA:64,0 +DA:65,0 +DA:66,0 +DA:67,0 +DA:68,0 +DA:69,0 +DA:70,0 +DA:71,0 +DA:72,0 +DA:96,2 +DA:97,2 +DA:98,2 +DA:99,2 +DA:100,2 +DA:101,2 +DA:102,2 +DA:104,2 +DA:105,2 +DA:106,2 +DA:107,2 +DA:108,2 +DA:109,2 +DA:110,2 +DA:111,2 +DA:112,2 +DA:113,2 +DA:114,2 +DA:115,2 +DA:116,2 +DA:117,2 +DA:118,2 +DA:122,2 +DA:123,2 +DA:136,0 +DA:137,0 +DA:147,0 +DA:161,0 +LF:43 +LH:27 +end_of_record +TN: +SF:lib/apis/sign_api/models/auth/common_auth_models.dart +FNF:0 +FNH:0 +DA:16,0 +DA:17,0 +DA:36,2 +DA:37,2 +DA:38,2 +DA:39,2 +DA:40,2 +DA:41,2 +DA:42,2 +DA:43,2 +DA:44,2 +DA:45,2 +DA:46,2 +DA:47,2 +DA:51,0 +DA:54,0 +DA:55,0 +DA:56,0 +DA:57,0 +DA:58,0 +DA:59,0 +DA:60,0 +DA:61,0 +DA:62,0 +DA:63,0 +DA:64,0 +DA:68,2 +DA:69,2 +DA:70,2 +DA:71,2 +DA:72,2 +DA:73,2 +DA:74,2 +DA:75,2 +DA:76,2 +DA:77,2 +DA:78,2 +DA:79,2 +DA:83,0 +DA:84,0 +DA:104,2 +DA:108,2 +DA:110,2 +DA:111,2 +DA:112,2 +DA:113,2 +DA:114,2 +DA:115,2 +DA:116,2 +DA:117,2 +DA:118,2 +DA:119,2 +DA:123,2 +DA:124,2 +DA:137,2 +DA:138,2 +DA:153,2 +DA:154,2 +DA:166,4 +DA:180,2 +DA:185,2 +DA:188,2 +DA:189,2 +DA:190,2 +DA:194,0 +DA:195,0 +LF:66 +LH:48 +end_of_record +TN: +SF:lib/apis/sign_api/models/auth/session_auth_events.dart +FNF:0 +FNH:0 +DA:19,0 +DA:27,0 +DA:28,0 +DA:29,0 +DA:30,0 +DA:31,0 +DA:32,0 +DA:35,0 +DA:37,0 +DA:49,0 +DA:58,0 +DA:59,0 +DA:60,0 +DA:61,0 +DA:62,0 +DA:63,0 +DA:64,0 +DA:67,0 +DA:69,0 +LF:19 +LH:0 +end_of_record +TN: +SF:lib/apis/sign_api/models/auth/session_auth_models.dart +FNF:0 +FNH:0 +DA:20,0 +DA:47,0 +DA:48,0 +DA:71,0 +DA:74,0 +DA:75,0 +DA:76,0 +DA:77,0 +DA:78,0 +DA:79,0 +DA:80,0 +DA:82,0 +DA:83,0 +DA:84,0 +DA:85,0 +DA:86,0 +DA:87,0 +DA:88,0 +DA:89,0 +DA:90,0 +DA:91,0 +DA:92,0 +DA:93,0 +DA:94,0 +DA:95,0 +DA:99,0 +DA:100,0 +DA:115,0 +DA:116,0 +LF:29 +LH:0 +end_of_record +TN: +SF:lib/apis/sign_api/models/json_rpc_models.dart +FNF:0 +FNH:0 +DA:21,0 +DA:22,0 +DA:32,0 +DA:33,0 +DA:47,4 +DA:48,4 +DA:59,0 +DA:60,0 +DA:76,4 +DA:77,4 +DA:87,3 +DA:88,3 +DA:98,3 +DA:99,3 +DA:111,3 +DA:112,3 +DA:122,3 +DA:123,3 +DA:134,3 +DA:135,3 +DA:146,3 +DA:147,3 +DA:158,3 +DA:159,3 +DA:170,3 +DA:171,3 +DA:184,2 +DA:185,2 +DA:195,0 +DA:196,0 +DA:208,0 +DA:209,0 +DA:220,0 +DA:221,0 +LF:34 +LH:22 +end_of_record +TN: +SF:lib/apis/sign_api/models/proposal_models.dart +FNF:0 +FNH:0 +DA:18,4 +DA:19,4 +DA:30,0 +DA:31,0 +DA:49,0 +DA:50,0 +LF:6 +LH:2 +end_of_record +TN: +SF:lib/apis/sign_api/models/session_models.dart +FNF:0 +FNH:0 +DA:21,4 +DA:31,0 +DA:33,0 +DA:47,4 +DA:48,4 +DA:69,0 +DA:70,0 +DA:85,0 +DA:86,0 +LF:9 +LH:3 +end_of_record +TN: +SF:lib/apis/sign_api/models/sign_client_events.dart +FNF:0 +FNH:0 +DA:14,4 +DA:20,0 +DA:21,0 +DA:22,0 +DA:23,0 +DA:26,0 +DA:28,0 +DA:38,0 +DA:45,0 +DA:47,0 +DA:54,4 +DA:58,0 +DA:60,0 +DA:69,3 +DA:75,0 +DA:77,0 +DA:85,3 +DA:87,0 +DA:89,0 +DA:97,3 +DA:99,0 +DA:101,0 +DA:109,3 +DA:114,0 +DA:116,0 +DA:123,3 +DA:125,0 +DA:127,0 +DA:138,3 +DA:146,3 +DA:149,3 +DA:150,3 +DA:151,3 +DA:152,3 +DA:153,3 +DA:154,3 +DA:158,0 +DA:160,0 +DA:171,3 +DA:179,0 +DA:181,0 +DA:188,0 +DA:190,0 +DA:192,0 +LF:44 +LH:16 +end_of_record +TN: +SF:lib/apis/sign_api/models/sign_client_models.dart +FNF:0 +FNH:0 +DA:10,4 +DA:16,0 +DA:18,0 +DA:26,4 +DA:31,0 +DA:33,0 +LF:6 +LH:2 +end_of_record +TN: +SF:lib/apis/sign_api/sessions.dart +FNF:0 +FNH:0 +DA:7,6 +DA:14,5 +DA:20,5 +DA:22,5 +DA:28,10 +DA:31,6 +DA:34,5 +LF:7 +LH:7 +end_of_record +TN: +SF:lib/apis/sign_api/sign_client.dart +FNF:0 +FNH:0 +DA:15,1 +DA:16,2 +DA:17,1 +DA:18,2 +DA:19,1 +DA:20,2 +DA:21,1 +DA:22,2 +DA:23,1 +DA:24,2 +DA:25,1 +DA:26,2 +DA:27,1 +DA:28,2 +DA:29,0 +DA:31,0 +DA:32,1 +DA:33,2 +DA:34,1 +DA:35,2 +DA:36,1 +DA:37,2 +DA:39,1 +DA:40,2 +DA:41,0 +DA:42,0 +DA:43,1 +DA:44,2 +DA:45,1 +DA:46,2 +DA:47,1 +DA:48,2 +DA:53,0 +DA:60,0 +DA:61,0 +DA:69,0 +DA:74,1 +DA:78,2 +DA:81,1 +DA:82,1 +DA:85,0 +DA:86,0 +DA:89,1 +DA:90,1 +DA:93,0 +DA:94,0 +DA:97,1 +DA:98,1 +DA:101,0 +DA:102,0 +DA:105,1 +DA:106,1 +DA:109,0 +DA:110,0 +DA:113,1 +DA:114,1 +DA:117,0 +DA:121,1 +DA:122,1 +DA:125,0 +DA:126,0 +DA:129,1 +DA:130,1 +DA:133,0 +DA:134,0 +DA:137,1 +DA:138,1 +DA:141,0 +DA:142,0 +DA:148,1 +DA:150,1 +DA:154,2 +DA:155,2 +DA:157,1 +DA:160,1 +DA:170,2 +DA:184,1 +DA:189,2 +DA:195,1 +DA:203,2 +DA:214,1 +DA:220,2 +DA:229,1 +DA:235,2 +DA:245,1 +DA:250,2 +DA:256,1 +DA:263,2 +DA:273,1 +DA:280,2 +DA:290,0 +DA:299,0 +DA:311,0 +DA:323,0 +DA:338,1 +DA:344,2 +DA:353,1 +DA:360,2 +DA:370,1 +DA:376,2 +DA:385,1 +DA:391,2 +DA:400,1 +DA:407,2 +DA:417,1 +DA:422,2 +DA:428,1 +DA:434,2 +DA:443,1 +DA:448,2 +DA:454,1 +DA:457,2 +DA:463,1 +DA:468,2 +DA:476,1 +DA:479,2 +DA:485,1 +DA:488,2 +DA:494,0 +DA:495,0 +DA:499,0 +DA:500,0 +DA:502,0 +DA:505,0 +DA:511,0 +DA:514,0 +DA:520,0 +DA:522,0 +DA:524,0 +DA:525,0 +DA:527,0 +DA:528,0 +DA:531,0 +DA:533,0 +DA:535,0 +DA:537,0 +DA:539,0 +DA:546,0 +DA:557,0 +DA:566,0 +DA:576,0 +DA:584,0 +DA:595,0 +DA:601,0 +DA:610,0 +DA:616,0 +DA:625,0 +DA:626,0 +DA:628,0 +DA:629,0 +DA:631,0 +DA:637,0 +DA:646,0 +DA:652,0 +DA:661,0 +DA:666,0 +DA:674,0 +DA:675,0 +LF:158 +LH:91 +end_of_record +TN: +SF:lib/apis/sign_api/sign_engine.dart +FNF:0 +FNH:0 +DA:99,5 +DA:114,5 +DA:116,5 +DA:120,15 +DA:121,25 +DA:122,10 +DA:123,10 +DA:124,10 +DA:127,10 +DA:128,10 +DA:129,10 +DA:130,10 +DA:132,10 +DA:134,5 +DA:135,5 +DA:136,5 +DA:138,5 +DA:140,5 +DA:143,5 +DA:145,14 +DA:146,16 +DA:150,4 +DA:159,4 +DA:161,4 +DA:162,0 +DA:163,4 +DA:172,12 +DA:175,4 +DA:176,4 +DA:179,12 +DA:182,12 +DA:183,4 +DA:185,4 +DA:187,8 +DA:188,0 +DA:189,4 +DA:190,4 +DA:192,4 +DA:197,4 +DA:200,4 +DA:203,4 +DA:204,4 +DA:205,4 +DA:206,4 +DA:207,4 +DA:210,4 +DA:215,4 +DA:217,8 +DA:218,4 +DA:222,4 +DA:223,4 +DA:224,4 +DA:228,4 +DA:234,4 +DA:243,4 +DA:251,12 +DA:254,4 +DA:257,4 +DA:259,8 +DA:260,4 +DA:262,12 +DA:263,8 +DA:269,4 +DA:271,12 +DA:272,12 +DA:275,12 +DA:279,4 +DA:283,4 +DA:285,12 +DA:292,4 +DA:300,4 +DA:302,4 +DA:309,8 +DA:310,4 +DA:313,12 +DA:314,8 +DA:315,12 +DA:322,4 +DA:325,12 +DA:327,4 +DA:329,4 +DA:334,4 +DA:335,16 +DA:337,12 +DA:338,4 +DA:339,8 +DA:342,12 +DA:344,4 +DA:348,4 +DA:350,4 +DA:356,4 +DA:358,4 +DA:360,4 +DA:361,4 +DA:364,12 +DA:366,8 +DA:367,4 +DA:370,8 +DA:371,4 +DA:374,4 +DA:379,4 +DA:381,4 +DA:387,4 +DA:388,4 +DA:389,0 +DA:394,8 +DA:398,8 +DA:400,8 +DA:406,4 +DA:412,3 +DA:417,3 +DA:419,3 +DA:421,9 +DA:427,3 +DA:428,9 +DA:430,3 +DA:432,9 +DA:433,3 +DA:439,3 +DA:442,3 +DA:447,3 +DA:448,3 +DA:453,6 +DA:458,9 +DA:461,3 +DA:465,3 +DA:469,3 +DA:470,3 +DA:472,9 +DA:475,3 +DA:478,3 +DA:480,3 +DA:489,3 +DA:495,9 +DA:498,3 +DA:504,3 +DA:505,3 +DA:510,9 +DA:513,3 +DA:520,0 +DA:529,0 +DA:532,0 +DA:542,0 +DA:553,0 +DA:554,0 +DA:556,0 +DA:560,0 +DA:563,0 +DA:565,0 +DA:566,0 +DA:567,0 +DA:568,0 +DA:569,0 +DA:570,0 +DA:571,0 +DA:572,0 +DA:576,0 +DA:577,0 +DA:579,0 +DA:582,0 +DA:586,3 +DA:591,3 +DA:592,3 +DA:596,3 +DA:597,9 +DA:598,3 +DA:601,3 +DA:604,9 +DA:605,3 +DA:608,3 +DA:612,6 +DA:618,3 +DA:624,3 +DA:625,9 +DA:628,3 +DA:634,3 +DA:635,3 +DA:640,9 +DA:643,3 +DA:650,3 +DA:654,3 +DA:655,3 +DA:657,6 +DA:658,9 +DA:661,3 +DA:663,12 +DA:664,9 +DA:668,3 +DA:673,3 +DA:675,3 +DA:677,6 +DA:680,9 +DA:683,3 +DA:684,3 +DA:685,3 +DA:686,3 +DA:691,3 +DA:693,9 +DA:695,0 +DA:696,0 +DA:697,0 +DA:704,3 +DA:708,3 +DA:709,12 +DA:710,3 +DA:716,6 +DA:719,4 +DA:721,4 +DA:723,4 +DA:724,16 +DA:725,8 +DA:731,3 +DA:735,3 +DA:737,3 +DA:738,3 +DA:739,3 +DA:740,12 +DA:741,6 +DA:742,6 +DA:748,4 +DA:750,4 +DA:752,4 +DA:753,16 +DA:754,12 +DA:760,3 +DA:762,3 +DA:764,3 +DA:765,12 +DA:766,9 +DA:772,1 +DA:773,3 +DA:778,3 +DA:783,3 +DA:785,3 +DA:788,3 +DA:791,3 +DA:792,3 +DA:793,3 +DA:796,6 +DA:799,3 +DA:804,3 +DA:806,3 +DA:809,3 +DA:812,3 +DA:813,3 +DA:814,3 +DA:817,6 +DA:822,5 +DA:824,15 +DA:829,10 +DA:831,0 +DA:835,4 +DA:836,4 +DA:837,0 +DA:841,3 +DA:842,3 +DA:845,3 +DA:850,6 +DA:854,9 +DA:856,6 +DA:857,15 +DA:858,9 +DA:860,9 +DA:863,6 +DA:864,3 +DA:870,4 +DA:874,12 +DA:876,12 +DA:880,3 +DA:884,9 +DA:886,0 +DA:890,4 +DA:891,8 +DA:892,8 +DA:897,12 +DA:900,4 +DA:901,12 +DA:902,20 +DA:905,3 +DA:906,6 +DA:907,3 +DA:910,9 +DA:911,3 +DA:912,3 +DA:918,5 +DA:919,5 +DA:920,5 +DA:922,10 +DA:923,0 +DA:924,0 +DA:927,10 +DA:928,0 +DA:929,0 +DA:933,5 +DA:935,0 +DA:937,5 +DA:942,5 +DA:943,15 +DA:945,5 +DA:948,15 +DA:950,5 +DA:953,15 +DA:955,5 +DA:958,15 +DA:960,5 +DA:963,15 +DA:965,5 +DA:968,15 +DA:970,5 +DA:973,15 +DA:975,5 +DA:978,15 +DA:980,5 +DA:984,15 +DA:986,5 +DA:989,15 +DA:991,5 +DA:996,4 +DA:997,12 +DA:998,12 +DA:1000,8 +DA:1005,4 +DA:1009,4 +DA:1010,0 +DA:1016,12 +DA:1017,4 +DA:1019,8 +DA:1020,4 +DA:1021,4 +DA:1022,4 +DA:1023,4 +DA:1025,4 +DA:1030,16 +DA:1031,3 +DA:1032,3 +DA:1033,9 +DA:1034,3 +DA:1035,3 +DA:1036,3 +DA:1041,3 +DA:1042,3 +DA:1046,0 +DA:1048,0 +DA:1049,0 +DA:1051,0 +DA:1052,0 +DA:1053,0 +DA:1055,0 +DA:1056,0 +DA:1057,0 +DA:1061,0 +DA:1062,0 +DA:1063,0 +DA:1064,0 +DA:1073,4 +DA:1076,4 +DA:1077,4 +DA:1079,4 +DA:1080,4 +DA:1081,4 +DA:1082,4 +DA:1083,4 +DA:1088,8 +DA:1090,4 +DA:1092,8 +DA:1095,8 +DA:1096,4 +DA:1097,4 +DA:1102,0 +DA:1103,0 +DA:1104,0 +DA:1105,0 +DA:1106,0 +DA:1108,0 +DA:1109,0 +DA:1110,0 +DA:1115,4 +DA:1120,8 +DA:1122,12 +DA:1125,8 +DA:1129,4 +DA:1131,4 +DA:1132,4 +DA:1133,4 +DA:1135,8 +DA:1136,4 +DA:1137,4 +DA:1138,4 +DA:1139,4 +DA:1140,4 +DA:1142,4 +DA:1146,8 +DA:1147,8 +DA:1148,12 +DA:1149,4 +DA:1150,8 +DA:1152,12 +DA:1153,0 +DA:1154,0 +DA:1158,8 +DA:1162,12 +DA:1163,4 +DA:1168,8 +DA:1169,4 +DA:1171,0 +DA:1172,0 +DA:1173,0 +DA:1174,0 +DA:1176,0 +DA:1177,0 +DA:1178,0 +DA:1184,3 +DA:1190,6 +DA:1191,6 +DA:1192,6 +DA:1194,3 +DA:1196,9 +DA:1197,3 +DA:1202,6 +DA:1203,3 +DA:1204,3 +DA:1206,3 +DA:1209,0 +DA:1210,0 +DA:1211,0 +DA:1212,0 +DA:1214,0 +DA:1215,0 +DA:1216,0 +DA:1222,3 +DA:1227,6 +DA:1228,3 +DA:1229,3 +DA:1231,3 +DA:1235,9 +DA:1236,3 +DA:1241,6 +DA:1242,3 +DA:1243,3 +DA:1247,0 +DA:1248,0 +DA:1249,0 +DA:1251,0 +DA:1252,0 +DA:1253,0 +DA:1259,3 +DA:1264,6 +DA:1265,3 +DA:1266,9 +DA:1267,3 +DA:1272,6 +DA:1273,3 +DA:1274,3 +DA:1278,0 +DA:1279,0 +DA:1280,0 +DA:1282,0 +DA:1283,0 +DA:1284,0 +DA:1290,3 +DA:1295,6 +DA:1296,3 +DA:1297,9 +DA:1298,3 +DA:1303,3 +DA:1304,0 +DA:1305,0 +DA:1306,0 +DA:1308,0 +DA:1309,0 +DA:1310,0 +DA:1319,3 +DA:1321,6 +DA:1322,3 +DA:1324,3 +DA:1325,3 +DA:1328,6 +DA:1329,3 +DA:1331,6 +DA:1334,3 +DA:1335,3 +DA:1337,6 +DA:1338,3 +DA:1339,6 +DA:1344,3 +DA:1345,3 +DA:1349,3 +DA:1350,3 +DA:1351,6 +DA:1353,6 +DA:1357,9 +DA:1358,0 +DA:1359,0 +DA:1360,0 +DA:1362,0 +DA:1363,0 +DA:1364,0 +DA:1367,0 +DA:1368,0 +DA:1370,0 +DA:1372,0 +DA:1373,0 +DA:1375,0 +DA:1376,0 +DA:1377,0 +DA:1380,0 +DA:1384,6 +DA:1385,3 +DA:1390,0 +DA:1391,0 +DA:1392,0 +DA:1394,0 +DA:1395,0 +DA:1396,0 +DA:1402,3 +DA:1407,6 +DA:1408,3 +DA:1409,3 +DA:1412,3 +DA:1415,3 +DA:1416,3 +DA:1417,6 +DA:1419,6 +DA:1420,6 +DA:1422,0 +DA:1424,0 +DA:1426,0 +DA:1429,0 +DA:1430,0 +DA:1432,0 +DA:1433,0 +DA:1434,0 +DA:1440,9 +DA:1441,3 +DA:1447,6 +DA:1448,3 +DA:1449,3 +DA:1451,3 +DA:1452,3 +DA:1453,3 +DA:1457,9 +DA:1458,3 +DA:1460,3 +DA:1461,3 +DA:1462,3 +DA:1466,0 +DA:1467,0 +DA:1468,0 +DA:1470,0 +DA:1471,0 +DA:1472,0 +DA:1480,5 +DA:1481,25 +DA:1482,25 +DA:1483,25 +DA:1484,25 +DA:1485,25 +DA:1488,0 +DA:1490,0 +DA:1493,3 +DA:1500,3 +DA:1501,3 +DA:1502,15 +DA:1503,3 +DA:1505,6 +DA:1506,3 +DA:1507,3 +DA:1512,3 +DA:1513,3 +DA:1514,15 +DA:1515,3 +DA:1517,6 +DA:1518,3 +DA:1519,3 +DA:1524,3 +DA:1529,9 +DA:1530,3 +DA:1531,3 +DA:1534,6 +DA:1535,3 +DA:1536,3 +DA:1539,9 +DA:1540,9 +DA:1541,3 +DA:1542,6 +DA:1545,6 +DA:1546,3 +DA:1547,6 +DA:1551,0 +DA:1552,0 +DA:1553,0 +DA:1560,5 +DA:1561,5 +DA:1566,3 +DA:1567,6 +DA:1568,3 +DA:1570,3 +DA:1574,9 +DA:1575,3 +DA:1577,3 +DA:1584,3 +DA:1585,6 +DA:1586,3 +DA:1587,12 +DA:1588,9 +DA:1590,3 +DA:1592,3 +DA:1599,4 +DA:1600,12 +DA:1601,3 +DA:1603,3 +DA:1607,16 +DA:1608,3 +DA:1610,3 +DA:1617,3 +DA:1618,9 +DA:1619,0 +DA:1621,0 +DA:1625,12 +DA:1626,0 +DA:1628,0 +DA:1637,4 +DA:1647,12 +DA:1653,4 +DA:1660,4 +DA:1669,4 +DA:1676,4 +DA:1677,12 +DA:1680,4 +DA:1686,4 +DA:1687,4 +DA:1690,4 +DA:1691,4 +DA:1696,4 +DA:1697,4 +DA:1705,3 +DA:1707,3 +DA:1711,4 +DA:1715,4 +DA:1720,4 +DA:1721,0 +DA:1730,3 +DA:1734,3 +DA:1735,3 +DA:1739,6 +DA:1741,3 +DA:1742,6 +DA:1750,3 +DA:1755,3 +DA:1756,6 +DA:1757,3 +DA:1758,3 +DA:1761,3 +DA:1762,3 +DA:1764,3 +DA:1770,3 +DA:1774,3 +DA:1776,6 +DA:1777,0 +DA:1783,6 +DA:1788,3 +DA:1791,3 +DA:1796,3 +DA:1801,3 +DA:1802,6 +DA:1803,3 +DA:1804,3 +DA:1807,3 +DA:1808,3 +DA:1810,3 +DA:1816,3 +DA:1817,3 +DA:1822,4 +DA:1827,8 +DA:1828,16 +DA:1830,12 +DA:1831,0 +DA:1835,0 +DA:1836,0 +DA:1837,0 +DA:1838,0 +DA:1839,0 +DA:1842,4 +DA:1843,0 +DA:1845,4 +DA:1846,4 +DA:1847,4 +DA:1855,0 +DA:1860,0 +DA:1861,0 +DA:1863,0 +DA:1864,0 +DA:1865,0 +DA:1868,0 +DA:1869,0 +DA:1871,0 +DA:1883,0 +DA:1889,0 +DA:1890,0 +DA:1892,0 +DA:1893,0 +DA:1896,0 +DA:1897,0 +DA:1898,0 +DA:1899,0 +DA:1900,0 +DA:1901,0 +DA:1902,0 +DA:1903,0 +DA:1904,0 +DA:1906,0 +DA:1907,0 +DA:1908,0 +DA:1909,0 +DA:1910,0 +DA:1911,0 +DA:1912,0 +DA:1913,0 +DA:1914,0 +DA:1915,0 +DA:1918,0 +DA:1919,0 +DA:1925,0 +DA:1940,0 +DA:1946,0 +DA:1950,0 +DA:1951,0 +DA:1952,0 +DA:1953,0 +DA:1954,0 +DA:1956,0 +DA:1957,0 +DA:1963,0 +DA:1965,0 +DA:1966,0 +DA:1967,0 +DA:1973,0 +DA:1979,0 +DA:1981,0 +DA:1986,0 +DA:1989,0 +DA:1990,0 +DA:1994,0 +DA:1997,0 +DA:1999,0 +DA:2000,0 +DA:2002,0 +DA:2003,0 +DA:2006,0 +DA:2008,0 +DA:2012,0 +DA:2014,0 +DA:2016,0 +DA:2019,0 +DA:2025,0 +DA:2031,0 +DA:2033,0 +DA:2042,0 +DA:2051,0 +DA:2060,0 +DA:2064,0 +DA:2067,0 +DA:2071,0 +DA:2073,0 +DA:2076,0 +DA:2077,0 +DA:2078,0 +DA:2079,0 +DA:2080,0 +DA:2084,0 +DA:2085,0 +DA:2089,0 +DA:2091,0 +DA:2092,0 +DA:2093,0 +DA:2094,0 +DA:2101,0 +DA:2103,0 +DA:2107,0 +DA:2115,0 +DA:2116,0 +DA:2118,0 +DA:2123,0 +DA:2124,0 +DA:2129,0 +DA:2131,0 +DA:2132,0 +DA:2133,0 +DA:2138,0 +DA:2146,0 +DA:2148,0 +DA:2150,0 +DA:2151,0 +DA:2152,0 +DA:2158,0 +DA:2161,0 +DA:2162,0 +DA:2164,0 +DA:2167,0 +DA:2168,0 +DA:2170,0 +DA:2171,0 +DA:2173,0 +DA:2175,0 +DA:2178,0 +DA:2179,0 +DA:2180,0 +DA:2185,0 +DA:2191,0 +DA:2193,0 +DA:2197,0 +DA:2199,0 +DA:2200,0 +DA:2204,0 +DA:2205,0 +DA:2206,0 +DA:2207,0 +DA:2210,0 +DA:2211,0 +DA:2214,0 +DA:2216,0 +DA:2218,0 +DA:2222,0 +DA:2228,0 +DA:2233,0 +DA:2234,0 +DA:2235,0 +DA:2237,0 +DA:2239,0 +DA:2240,0 +DA:2241,0 +DA:2243,0 +DA:2247,0 +DA:2248,0 +DA:2249,0 +DA:2251,0 +DA:2255,0 +DA:2256,0 +DA:2257,0 +DA:2258,0 +DA:2259,0 +DA:2261,0 +DA:2263,0 +DA:2265,0 +DA:2266,0 +DA:2267,0 +DA:2268,0 +DA:2269,0 +DA:2270,0 +DA:2271,0 +DA:2279,0 +DA:2290,0 +DA:2293,0 +DA:2296,0 +DA:2304,0 +DA:2316,0 +DA:2319,0 +DA:2323,0 +DA:2325,0 +DA:2328,0 +DA:2329,0 +DA:2330,0 +DA:2331,0 +DA:2332,0 +DA:2336,0 +DA:2337,0 +DA:2341,0 +DA:2343,0 +DA:2344,0 +DA:2350,0 +DA:2351,0 +DA:2353,0 +DA:2356,0 +DA:2372,0 +DA:2373,0 +DA:2374,0 +DA:2376,0 +DA:2377,0 +DA:2380,0 +DA:2381,0 +DA:2382,0 +DA:2383,0 +DA:2386,0 +DA:2387,0 +DA:2388,0 +DA:2391,0 +DA:2392,0 +DA:2395,0 +DA:2396,0 +DA:2397,0 +DA:2400,0 +DA:2401,0 +DA:2405,0 +DA:2407,0 +DA:2411,0 +DA:2412,0 +DA:2415,0 +DA:2417,0 +DA:2421,0 +DA:2424,0 +DA:2426,0 +DA:2432,0 +DA:2433,0 +DA:2435,0 +DA:2437,0 +DA:2440,0 +DA:2443,0 +DA:2449,0 +DA:2450,0 +DA:2454,0 +DA:2461,0 +DA:2463,0 +DA:2464,0 +DA:2471,0 +DA:2472,0 +DA:2473,0 +DA:2474,0 +DA:2477,0 +DA:2484,0 +DA:2488,0 +DA:2492,0 +DA:2494,0 +DA:2496,0 +DA:2502,0 +DA:2506,0 +DA:2510,0 +DA:2512,0 +DA:2513,0 +DA:2514,0 +DA:2516,0 +DA:2523,0 +DA:2528,0 +DA:2530,0 +DA:2532,0 +DA:2538,0 +DA:2539,0 +DA:2540,0 +DA:2541,0 +DA:2543,0 +DA:2551,0 +DA:2552,0 +DA:2554,0 +DA:2557,0 +DA:2561,0 +DA:2565,0 +DA:2571,0 +DA:2572,0 +DA:2573,0 +DA:2575,0 +DA:2576,0 +DA:2579,0 +DA:2580,0 +DA:2581,0 +DA:2582,0 +DA:2585,0 +DA:2586,0 +DA:2587,0 +DA:2591,0 +DA:2597,0 +DA:2598,0 +DA:2601,0 +DA:2603,0 +DA:2605,0 +DA:2607,0 +DA:2610,0 +DA:2611,0 +DA:2612,0 +DA:2618,0 +DA:2619,0 +DA:2621,0 +DA:2624,0 +DA:2626,0 +DA:2628,0 +DA:2631,0 +DA:2635,0 +DA:2639,0 +DA:2640,0 +DA:2641,0 +DA:2642,0 +DA:2643,0 +DA:2646,0 +DA:2652,0 +DA:2657,0 +DA:2659,0 +DA:2661,0 +DA:2662,0 +DA:2665,0 +DA:2669,0 +DA:2670,0 +DA:2671,0 +DA:2672,0 +DA:2674,0 +DA:2681,0 +DA:2682,0 +DA:2686,0 +DA:2688,0 +DA:2691,0 +DA:2692,0 +DA:2696,0 +DA:2698,0 +DA:2701,0 +DA:2702,0 +DA:2705,0 +DA:2706,0 +DA:2707,0 +DA:2708,0 +DA:2710,0 +DA:2715,0 +DA:2716,0 +DA:2717,0 +DA:2719,0 +DA:2720,0 +DA:2723,0 +DA:2724,0 +DA:2725,0 +DA:2727,0 +DA:2728,0 +DA:2729,0 +DA:2735,0 +DA:2736,0 +DA:2738,0 +DA:2739,0 +DA:2742,0 +DA:2743,0 +DA:2746,0 +DA:2748,0 +DA:2749,0 +DA:2750,0 +DA:2751,0 +DA:2753,0 +DA:2755,0 +DA:2760,0 +DA:2761,0 +DA:2762,0 +DA:2764,0 +DA:2765,0 +DA:2769,0 +DA:2770,0 +DA:2771,0 +DA:2773,0 +DA:2778,0 +DA:2779,0 +DA:2780,0 +DA:2782,0 +DA:2783,0 +DA:2785,0 +LF:1046 +LH:543 +end_of_record +TN: +SF:lib/apis/sign_api/utils/auth/address_utils.dart +FNF:0 +FNH:0 +DA:2,3 +DA:3,6 +DA:6,3 +DA:7,6 +DA:10,0 +DA:11,0 +LF:6 +LH:4 +end_of_record +TN: +SF:lib/apis/sign_api/utils/auth/auth_api_validators.dart +FNF:0 +FNH:0 +DA:5,1 +DA:6,1 +DA:7,1 +DA:10,3 +DA:11,6 +DA:12,2 +DA:15,4 +DA:19,6 +DA:20,1 +DA:27,9 +DA:28,1 +DA:34,3 +DA:35,1 +DA:36,1 +DA:39,1 +DA:46,3 +DA:52,3 +DA:53,2 +DA:55,2 +DA:60,1 +DA:70,0 +DA:71,0 +DA:72,0 +DA:78,0 +DA:79,0 +DA:82,0 +DA:86,0 +DA:87,0 +DA:93,0 +DA:94,0 +DA:100,0 +DA:101,0 +DA:102,0 +DA:103,0 +DA:104,0 +DA:111,0 +DA:112,0 +DA:113,0 +DA:123,0 +DA:128,0 +DA:129,0 +DA:132,0 +DA:136,0 +DA:137,0 +LF:44 +LH:20 +end_of_record +TN: +SF:lib/apis/sign_api/utils/auth/auth_signature.dart +FNF:0 +FNH:0 +DA:16,9 +DA:17,3 +DA:18,6 +DA:19,6 +DA:22,3 +DA:23,3 +DA:24,3 +DA:25,3 +DA:26,3 +DA:28,6 +DA:30,3 +DA:36,3 +DA:37,6 +DA:40,6 +DA:43,0 +DA:46,3 +DA:53,3 +DA:54,6 +DA:58,6 +DA:59,0 +DA:63,3 +DA:64,6 +DA:67,3 +DA:68,6 +DA:72,6 +DA:92,3 +DA:93,3 +DA:94,3 +DA:97,3 +DA:98,3 +DA:99,6 +DA:112,9 +DA:115,0 +DA:128,0 +DA:130,0 +DA:132,0 +DA:133,0 +DA:134,0 +DA:135,0 +DA:138,0 +DA:139,0 +DA:141,0 +DA:143,0 +DA:149,0 +DA:157,0 +DA:158,0 +DA:166,3 +DA:173,6 +DA:174,3 +DA:177,3 +DA:179,0 +DA:180,0 +DA:183,0 +DA:188,0 +DA:189,0 +DA:194,0 +DA:199,0 +DA:200,0 +DA:202,0 +DA:204,0 +DA:212,0 +DA:217,0 +DA:219,0 +DA:221,0 +DA:225,0 +DA:226,0 +DA:227,0 +DA:230,0 +DA:231,0 +DA:235,0 +DA:237,0 +DA:241,0 +DA:243,0 +DA:244,0 +DA:246,0 +DA:247,0 +DA:248,0 +DA:249,0 +DA:250,0 +DA:254,0 +DA:257,0 +DA:259,0 +DA:265,0 +DA:266,0 +DA:267,0 +DA:270,0 +DA:271,0 +DA:273,0 +DA:276,0 +DA:280,1 +DA:282,1 +DA:283,1 +DA:284,2 +DA:285,1 +DA:292,1 +DA:295,2 +DA:296,1 +DA:297,2 +DA:298,3 +LF:99 +LH:44 +end_of_record +TN: +SF:lib/apis/sign_api/utils/auth/auth_utils.dart +FNF:0 +FNH:0 +DA:2,3 +DA:3,9 +LF:2 +LH:2 +end_of_record +TN: +SF:lib/apis/sign_api/utils/auth/recaps_utils.dart +FNF:0 +FNH:0 +DA:8,0 +DA:9,0 +DA:10,0 +DA:12,0 +DA:13,0 +DA:16,0 +DA:17,0 +DA:20,0 +DA:21,0 +DA:22,0 +DA:26,0 +DA:27,0 +DA:29,0 +DA:31,0 +DA:35,0 +DA:36,0 +DA:37,0 +DA:39,0 +DA:42,0 +DA:44,0 +DA:46,0 +DA:47,0 +DA:49,0 +DA:50,0 +DA:53,0 +DA:55,0 +DA:59,0 +DA:61,0 +DA:62,0 +DA:63,0 +DA:64,0 +DA:67,0 +DA:68,0 +DA:69,0 +DA:73,0 +DA:74,0 +DA:76,0 +DA:82,0 +DA:83,0 +DA:84,0 +DA:90,0 +DA:91,0 +DA:92,0 +DA:93,0 +DA:95,0 +DA:98,0 +DA:99,0 +DA:100,0 +DA:102,0 +DA:106,0 +DA:107,0 +DA:108,0 +DA:109,0 +DA:111,0 +DA:115,0 +DA:116,0 +DA:118,0 +DA:123,0 +DA:124,0 +DA:125,0 +DA:127,0 +DA:139,0 +DA:144,0 +DA:145,0 +DA:148,0 +DA:149,0 +DA:150,0 +DA:151,0 +DA:153,0 +DA:156,0 +DA:163,0 +DA:164,0 +DA:166,0 +DA:167,0 +DA:168,0 +DA:169,0 +DA:170,0 +DA:174,0 +DA:175,0 +DA:176,0 +DA:184,0 +DA:185,0 +DA:186,0 +DA:187,0 +DA:188,0 +DA:191,0 +DA:195,0 +DA:196,0 +DA:197,0 +DA:198,0 +DA:199,0 +DA:200,0 +DA:202,0 +DA:204,0 +DA:205,0 +DA:206,0 +DA:207,0 +DA:208,0 +DA:209,0 +DA:210,0 +DA:213,0 +DA:214,0 +DA:215,0 +DA:216,0 +DA:224,0 +DA:227,0 +DA:229,0 +DA:230,0 +DA:233,0 +DA:237,0 +DA:241,0 +DA:243,0 +DA:245,0 +DA:246,0 +DA:247,0 +DA:248,0 +DA:249,0 +DA:250,0 +DA:251,0 +DA:252,0 +DA:253,0 +DA:255,0 +DA:256,0 +DA:258,0 +DA:259,0 +DA:260,0 +DA:261,0 +DA:262,0 +DA:263,0 +DA:265,0 +DA:268,0 +DA:269,0 +DA:270,0 +DA:271,0 +DA:272,0 +DA:274,0 +DA:275,0 +DA:279,0 +DA:280,0 +DA:282,0 +DA:285,0 +DA:290,0 +DA:291,0 +DA:293,0 +DA:296,0 +DA:298,0 +DA:301,0 +DA:303,0 +DA:305,0 +DA:307,0 +DA:310,0 +DA:315,0 +DA:316,0 +DA:318,0 +DA:319,0 +DA:320,0 +DA:321,0 +DA:322,0 +DA:326,0 +DA:329,0 +DA:335,0 +DA:336,0 +DA:337,0 +DA:338,0 +DA:342,0 +DA:343,0 +DA:344,0 +DA:345,0 +DA:346,0 +LF:169 +LH:0 +end_of_record +TN: +SF:lib/apis/sign_api/utils/custom_credentials.dart +FNF:0 +FNH:0 +DA:8,0 +DA:26,0 +DA:27,0 +DA:29,0 +DA:31,0 +DA:32,0 +DA:33,0 +DA:35,0 +DA:38,0 +DA:39,0 +DA:40,0 +DA:41,0 +DA:42,0 +DA:46,0 +DA:47,0 +DA:48,0 +DA:54,0 +DA:55,0 +DA:57,0 +DA:63,0 +DA:68,0 +DA:71,0 +DA:78,0 +LF:23 +LH:0 +end_of_record +TN: +SF:lib/apis/sign_api/utils/sign_api_validator_utils.dart +FNF:0 +FNH:0 +DA:7,6 +DA:12,6 +DA:13,12 +DA:15,6 +DA:16,18 +DA:22,5 +DA:28,5 +DA:30,4 +DA:31,4 +DA:33,4 +DA:37,10 +DA:38,5 +DA:39,1 +DA:42,1 +DA:52,5 +DA:56,10 +DA:57,5 +DA:59,5 +DA:60,5 +DA:69,5 +DA:73,10 +DA:74,5 +DA:75,4 +DA:78,4 +DA:87,5 +DA:91,10 +DA:92,5 +DA:93,5 +DA:94,5 +DA:103,4 +DA:108,4 +DA:109,1 +DA:111,1 +DA:116,4 +DA:122,4 +DA:126,4 +DA:127,4 +DA:129,4 +DA:138,4 +DA:144,4 +DA:145,1 +DA:147,1 +DA:152,4 +DA:157,4 +DA:162,4 +DA:163,4 +DA:165,4 +DA:174,4 +DA:180,4 +DA:181,1 +DA:183,1 +DA:188,4 +DA:193,4 +DA:198,4 +DA:199,4 +DA:201,4 +DA:210,6 +DA:215,12 +DA:216,12 +DA:219,6 +DA:221,4 +DA:223,4 +DA:226,12 +DA:228,6 +DA:230,6 +DA:232,6 +DA:234,6 +DA:239,6 +DA:243,6 +DA:244,12 +DA:245,12 +DA:247,6 +DA:248,12 +DA:249,12 +DA:253,5 +DA:256,5 +DA:259,2 +DA:262,10 +DA:265,2 +DA:268,10 +DA:277,4 +DA:281,12 +DA:282,8 +DA:285,4 +DA:289,8 +DA:290,8 +DA:291,4 +DA:293,4 +DA:297,4 +DA:304,4 +DA:308,4 +DA:309,4 +DA:310,8 +DA:312,4 +DA:313,4 +DA:314,8 +LF:96 +LH:96 +end_of_record +TN: +SF:lib/apis/utils/errors.dart +FNF:0 +FNH:0 +DA:230,7 +DA:234,7 +DA:235,7 +DA:236,14 +DA:237,7 +DA:238,12 +DA:239,8 +DA:246,6 +DA:250,6 +DA:251,6 +DA:252,12 +DA:253,6 +DA:254,12 +DA:255,14 +LF:14 +LH:14 +end_of_record +TN: +SF:lib/apis/utils/extensions.dart +FNF:0 +FNH:0 +DA:8,0 +DA:9,0 +DA:10,0 +DA:11,0 +DA:12,0 +DA:13,0 +DA:14,0 +DA:15,0 +DA:16,0 +DA:17,0 +DA:18,0 +DA:19,0 +DA:20,0 +DA:21,0 +DA:22,0 +DA:28,0 +DA:29,0 +DA:30,0 +DA:31,0 +DA:32,0 +DA:33,0 +DA:34,0 +DA:36,0 +DA:37,0 +DA:38,0 +DA:39,0 +DA:44,0 +DA:45,0 +DA:46,0 +DA:47,0 +DA:49,0 +DA:55,0 +DA:57,0 +DA:58,0 +DA:60,0 +DA:66,0 +DA:68,0 +DA:69,0 +DA:74,0 +DA:76,0 +LF:40 +LH:0 +end_of_record +TN: +SF:lib/apis/utils/log_level.dart +FNF:0 +FNH:0 +DA:12,10 +DA:14,10 +DA:16,10 +DA:18,10 +DA:20,6 +DA:22,6 +DA:24,6 +LF:7 +LH:7 +end_of_record +TN: +SF:lib/apis/utils/namespace_utils.dart +FNF:0 +FNH:0 +DA:7,6 +DA:8,6 +DA:9,6 +DA:10,12 +DA:16,6 +DA:17,6 +DA:18,6 +DA:19,12 +DA:20,18 +DA:21,18 +DA:27,4 +DA:29,4 +DA:36,1 +DA:37,1 +DA:38,2 +DA:43,6 +DA:44,6 +DA:45,6 +DA:46,6 +DA:47,6 +DA:48,6 +DA:55,6 +DA:57,12 +DA:58,6 +DA:59,6 +DA:65,6 +DA:70,1 +DA:71,1 +DA:72,2 +DA:79,0 +DA:82,0 +DA:83,0 +DA:84,0 +DA:85,0 +DA:86,0 +DA:87,0 +DA:88,0 +DA:89,0 +DA:90,0 +DA:93,0 +DA:94,0 +DA:95,0 +DA:96,0 +DA:98,0 +DA:99,0 +DA:100,0 +DA:111,6 +DA:115,6 +DA:116,6 +DA:119,12 +DA:123,5 +DA:128,10 +DA:129,5 +DA:130,5 +DA:137,5 +DA:141,5 +DA:145,5 +DA:146,10 +DA:147,5 +DA:148,2 +DA:150,10 +DA:151,5 +DA:152,10 +DA:161,0 +DA:165,0 +DA:166,0 +DA:167,0 +DA:168,0 +DA:170,0 +DA:171,0 +DA:180,5 +DA:184,5 +DA:185,10 +DA:186,5 +DA:187,2 +DA:189,10 +DA:190,5 +DA:191,10 +DA:201,6 +DA:205,6 +DA:206,6 +DA:207,6 +DA:208,6 +DA:211,12 +DA:219,1 +DA:225,2 +DA:226,1 +DA:227,1 +DA:234,1 +DA:239,4 +DA:246,4 +DA:252,4 +DA:256,1 +DA:260,8 +DA:261,9 +DA:262,1 +DA:263,1 +DA:264,2 +DA:265,1 +DA:266,1 +DA:267,1 +DA:268,4 +DA:269,1 +DA:270,1 +DA:271,1 +DA:272,1 +DA:273,4 +DA:274,1 +DA:275,1 +DA:276,1 +DA:277,1 +DA:278,4 +DA:279,1 +DA:281,1 +DA:285,4 +DA:287,4 +DA:291,0 +DA:295,0 +DA:296,0 +DA:299,0 +DA:301,0 +DA:302,0 +DA:303,0 +DA:304,0 +DA:305,0 +DA:311,0 +DA:316,4 +DA:325,8 +DA:326,8 +DA:327,12 +DA:332,4 +DA:338,4 +DA:344,4 +DA:347,8 +DA:349,4 +DA:350,4 +DA:351,4 +DA:352,4 +DA:353,8 +DA:354,8 +DA:356,4 +DA:357,4 +DA:364,4 +DA:365,4 +DA:368,8 +DA:372,4 +DA:373,4 +DA:376,8 +DA:381,8 +DA:383,4 +DA:384,4 +DA:387,12 +DA:390,4 +DA:391,4 +DA:394,8 +DA:398,4 +DA:399,4 +DA:402,8 +DA:409,8 +DA:410,8 +DA:411,8 +DA:412,8 +DA:431,0 +DA:434,0 +DA:435,0 +DA:436,0 +DA:437,0 +DA:439,0 +LF:168 +LH:128 +end_of_record +TN: +SF:lib/apis/utils/walletconnect_utils.dart +FNF:0 +FNH:0 +DA:9,7 +DA:10,21 +DA:11,7 +DA:12,7 +DA:14,7 +DA:18,0 +DA:19,0 +DA:20,0 +DA:23,7 +DA:24,7 +DA:27,7 +DA:28,35 +DA:31,9 +DA:36,27 +DA:37,9 +DA:41,9 +DA:42,9 +DA:43,9 +DA:46,9 +DA:50,9 +DA:52,9 +DA:54,9 +DA:56,9 +DA:58,0 +DA:66,9 +DA:71,9 +DA:72,9 +DA:73,9 +DA:74,18 +DA:75,18 +DA:78,9 +DA:81,9 +DA:90,9 +DA:91,18 +DA:92,9 +DA:95,9 +DA:101,9 +DA:102,9 +DA:106,9 +DA:107,9 +DA:108,9 +DA:109,0 +DA:110,9 +DA:111,0 +DA:113,9 +DA:117,9 +DA:118,18 +DA:123,8 +DA:124,8 +DA:125,8 +DA:126,8 +DA:127,16 +DA:133,16 +DA:135,16 +DA:136,8 +DA:137,30 +DA:138,7 +DA:141,8 +DA:142,8 +DA:145,8 +DA:153,8 +DA:154,5 +DA:155,10 +DA:156,10 +DA:161,8 +DA:162,16 +DA:163,8 +DA:164,16 +DA:165,16 +DA:166,0 +DA:173,8 +DA:176,8 +DA:183,7 +DA:187,7 +DA:188,28 +DA:189,7 +DA:190,0 +DA:195,7 +DA:204,7 +DA:205,7 +DA:207,18 +DA:208,6 +DA:209,30 +DA:213,14 +DA:216,7 +DA:218,7 +DA:223,0 +DA:224,0 +DA:225,0 +DA:226,0 +LF:90 +LH:78 +end_of_record +TN: +SF:lib/apis/web3app/web3app.dart +FNF:0 +FNH:0 +DA:22,2 +DA:30,2 +DA:31,2 +DA:40,2 +DA:57,2 +DA:61,4 +DA:62,2 +DA:63,2 +DA:64,2 +DA:65,4 +DA:68,0 +DA:69,0 +DA:72,2 +DA:73,4 +DA:76,0 +DA:77,0 +DA:80,2 +DA:81,4 +DA:84,0 +DA:85,0 +DA:88,2 +DA:89,4 +DA:92,0 +DA:93,0 +DA:96,2 +DA:97,4 +DA:100,0 +DA:104,2 +DA:105,4 +DA:108,0 +DA:109,0 +DA:112,2 +DA:113,4 +DA:116,0 +DA:117,0 +DA:120,2 +DA:121,4 +DA:124,0 +DA:125,0 +DA:130,4 +DA:131,2 +DA:132,2 +DA:133,4 +DA:134,4 +DA:135,4 +DA:136,4 +DA:140,2 +DA:142,2 +DA:146,4 +DA:147,4 +DA:148,4 +DA:150,2 +DA:155,2 +DA:156,4 +DA:157,1 +DA:158,2 +DA:159,1 +DA:160,2 +DA:161,0 +DA:163,0 +DA:164,1 +DA:165,2 +DA:166,1 +DA:167,2 +DA:168,1 +DA:169,2 +DA:170,1 +DA:171,2 +DA:173,1 +DA:174,2 +DA:175,1 +DA:176,2 +DA:177,0 +DA:179,0 +DA:184,2 +DA:194,4 +DA:208,1 +DA:215,2 +DA:225,0 +DA:234,0 +DA:246,0 +DA:258,0 +DA:273,1 +DA:280,2 +DA:290,1 +DA:295,2 +DA:301,1 +DA:307,2 +DA:316,2 +DA:319,4 +DA:325,1 +DA:330,2 +DA:338,1 +DA:341,2 +DA:347,2 +DA:348,6 +DA:352,0 +DA:353,0 +DA:355,0 +DA:356,0 +DA:357,0 +DA:358,0 +DA:359,0 +DA:361,0 +DA:370,1 +DA:377,2 +DA:387,0 +DA:392,0 +DA:402,0 +DA:404,0 +DA:406,0 +DA:415,0 +DA:425,0 +DA:431,0 +DA:440,0 +DA:446,0 +LF:116 +LH:75 +end_of_record +TN: +SF:lib/apis/web3wallet/web3wallet.dart +FNF:0 +FNH:0 +DA:13,3 +DA:22,3 +DA:23,3 +DA:33,3 +DA:50,3 +DA:54,6 +DA:55,3 +DA:56,3 +DA:57,3 +DA:58,6 +DA:61,0 +DA:62,0 +DA:65,3 +DA:66,6 +DA:69,0 +DA:70,0 +DA:73,3 +DA:74,6 +DA:77,0 +DA:78,0 +DA:81,3 +DA:82,6 +DA:85,0 +DA:86,0 +DA:89,3 +DA:90,6 +DA:93,0 +DA:97,3 +DA:98,6 +DA:101,0 +DA:102,0 +DA:105,3 +DA:106,6 +DA:109,0 +DA:110,0 +DA:113,3 +DA:114,6 +DA:117,0 +DA:118,0 +DA:123,6 +DA:124,3 +DA:125,3 +DA:126,6 +DA:127,6 +DA:128,6 +DA:129,6 +DA:133,3 +DA:135,3 +DA:139,6 +DA:140,6 +DA:141,6 +DA:143,3 +DA:146,2 +DA:151,4 +DA:159,1 +DA:160,2 +DA:161,1 +DA:162,2 +DA:163,1 +DA:164,2 +DA:165,2 +DA:167,4 +DA:168,0 +DA:170,0 +DA:171,1 +DA:173,2 +DA:174,1 +DA:176,2 +DA:177,1 +DA:178,2 +DA:180,1 +DA:181,2 +DA:182,1 +DA:183,2 +DA:184,1 +DA:186,2 +DA:191,2 +DA:199,4 +DA:210,1 +DA:216,2 +DA:225,1 +DA:231,2 +DA:241,1 +DA:246,2 +DA:252,1 +DA:259,2 +DA:269,1 +DA:275,2 +DA:284,1 +DA:290,2 +DA:299,1 +DA:305,2 +DA:314,1 +DA:321,2 +DA:331,1 +DA:337,2 +DA:346,1 +DA:351,2 +DA:357,2 +DA:360,4 +DA:366,1 +DA:371,2 +DA:379,2 +DA:382,4 +DA:388,1 +DA:391,2 +DA:397,2 +DA:398,6 +DA:402,2 +DA:403,4 +DA:405,0 +DA:406,0 +DA:407,0 +DA:408,0 +DA:409,0 +DA:410,0 +DA:411,0 +DA:413,0 +DA:422,2 +DA:430,4 +DA:441,2 +DA:444,4 +DA:450,1 +DA:455,2 +DA:465,0 +DA:467,0 +DA:468,0 +DA:470,0 +DA:472,0 +DA:478,0 +DA:487,0 +DA:493,0 +DA:502,0 +DA:505,0 +DA:511,0 +DA:517,0 +DA:526,0 +DA:532,0 +LF:138 +LH:99 +end_of_record From b2ed25c3fe295f268ba82b239f861be771bc4663 Mon Sep 17 00:00:00 2001 From: Alfreedom <00tango.bromine@icloud.com> Date: Mon, 5 Aug 2024 12:23:15 +0200 Subject: [PATCH 3/3] removed coverage from tracking --- .gitignore | 1 + coverage/html/amber.png | Bin 141 -> 0 bytes .../auth_api/auth_client.dart.func-c.html | 75 - .../html/auth_api/auth_client.dart.func.html | 75 - .../html/auth_api/auth_client.dart.gcov.html | 270 - .../auth_api/auth_engine.dart.func-c.html | 75 - .../html/auth_api/auth_engine.dart.func.html | 75 - .../html/auth_api/auth_engine.dart.gcov.html | 513 -- coverage/html/auth_api/index-sort-f.html | 117 - coverage/html/auth_api/index-sort-l.html | 100 - coverage/html/auth_api/index.html | 100 - coverage/html/cmd_line | 1 - coverage/html/core/core.dart.func-c.html | 75 - coverage/html/core/core.dart.func.html | 75 - coverage/html/core/core.dart.gcov.html | 255 - .../html/core/crypto/crypto.dart.func-c.html | 75 - .../html/core/crypto/crypto.dart.func.html | 75 - .../html/core/crypto/crypto.dart.gcov.html | 330 -- .../crypto/crypto_models.dart.func-c.html | 75 - .../core/crypto/crypto_models.dart.func.html | 75 - .../core/crypto/crypto_models.dart.gcov.html | 157 - .../core/crypto/crypto_utils.dart.func-c.html | 75 - .../core/crypto/crypto_utils.dart.func.html | 75 - .../core/crypto/crypto_utils.dart.gcov.html | 323 -- coverage/html/core/crypto/index-sort-f.html | 129 - coverage/html/core/crypto/index-sort-l.html | 109 - coverage/html/core/crypto/index.html | 109 - coverage/html/core/echo/echo.dart.func-c.html | 75 - coverage/html/core/echo/echo.dart.func.html | 75 - coverage/html/core/echo/echo.dart.gcov.html | 120 - .../core/echo/echo_client.dart.func-c.html | 75 - .../html/core/echo/echo_client.dart.func.html | 75 - .../html/core/echo/echo_client.dart.gcov.html | 119 - coverage/html/core/echo/index-sort-f.html | 117 - coverage/html/core/echo/index-sort-l.html | 100 - coverage/html/core/echo/index.html | 100 - .../echo/models/echo_body.dart.func-c.html | 75 - .../core/echo/models/echo_body.dart.func.html | 75 - .../core/echo/models/echo_body.dart.gcov.html | 93 - .../models/echo_response.dart.func-c.html | 75 - .../echo/models/echo_response.dart.func.html | 75 - .../echo/models/echo_response.dart.gcov.html | 123 - .../html/core/echo/models/index-sort-f.html | 117 - .../html/core/echo/models/index-sort-l.html | 100 - coverage/html/core/echo/models/index.html | 100 - .../core/heartbit/heartbeat.dart.func-c.html | 75 - .../core/heartbit/heartbeat.dart.func.html | 75 - .../core/heartbit/heartbeat.dart.gcov.html | 103 - coverage/html/core/heartbit/index-sort-f.html | 105 - coverage/html/core/heartbit/index-sort-l.html | 91 - coverage/html/core/heartbit/index.html | 91 - coverage/html/core/index-sort-f.html | 105 - coverage/html/core/index-sort-l.html | 91 - coverage/html/core/index.html | 91 - .../core/pairing/expirer.dart.func-c.html | 75 - .../html/core/pairing/expirer.dart.func.html | 75 - .../html/core/pairing/expirer.dart.gcov.html | 136 - coverage/html/core/pairing/index-sort-f.html | 141 - coverage/html/core/pairing/index-sort-l.html | 118 - coverage/html/core/pairing/index.html | 118 - .../pairing/json_rpc_history.dart.func-c.html | 75 - .../pairing/json_rpc_history.dart.func.html | 75 - .../pairing/json_rpc_history.dart.gcov.html | 110 - .../core/pairing/pairing.dart.func-c.html | 75 - .../html/core/pairing/pairing.dart.func.html | 75 - .../html/core/pairing/pairing.dart.gcov.html | 909 ---- .../pairing/pairing_store.dart.func-c.html | 75 - .../core/pairing/pairing_store.dart.func.html | 75 - .../core/pairing/pairing_store.dart.gcov.html | 111 - .../html/core/pairing/utils/index-sort-f.html | 117 - .../html/core/pairing/utils/index-sort-l.html | 100 - coverage/html/core/pairing/utils/index.html | 100 - .../utils/json_rpc_utils.dart.func-c.html | 75 - .../utils/json_rpc_utils.dart.func.html | 75 - .../utils/json_rpc_utils.dart.gcov.html | 146 - .../utils/pairing_models.dart.func-c.html | 75 - .../utils/pairing_models.dart.func.html | 75 - .../utils/pairing_models.dart.gcov.html | 272 - .../html/core/relay_auth/index-sort-f.html | 117 - .../html/core/relay_auth/index-sort-l.html | 100 - coverage/html/core/relay_auth/index.html | 100 - .../relay_auth/relay_auth.dart.func-c.html | 75 - .../core/relay_auth/relay_auth.dart.func.html | 75 - .../core/relay_auth/relay_auth.dart.gcov.html | 308 -- .../relay_auth_models.dart.func-c.html | 75 - .../relay_auth_models.dart.func.html | 75 - .../relay_auth_models.dart.gcov.html | 186 - .../i_relay_client.dart.func-c.html | 75 - .../i_relay_client.dart.func.html | 75 - .../i_relay_client.dart.gcov.html | 120 - .../html/core/relay_client/index-sort-f.html | 141 - .../html/core/relay_client/index-sort-l.html | 118 - coverage/html/core/relay_client/index.html | 118 - .../json_rpc_2/error_code.dart.func-c.html | 75 - .../json_rpc_2/error_code.dart.func.html | 75 - .../json_rpc_2/error_code.dart.gcov.html | 129 - .../relay_client/json_rpc_2/index-sort-f.html | 105 - .../relay_client/json_rpc_2/index-sort-l.html | 91 - .../core/relay_client/json_rpc_2/index.html | 91 - .../json_rpc_2/src/client.dart.func-c.html | 75 - .../json_rpc_2/src/client.dart.func.html | 75 - .../json_rpc_2/src/client.dart.gcov.html | 316 -- .../json_rpc_2/src/exception.dart.func-c.html | 75 - .../json_rpc_2/src/exception.dart.func.html | 75 - .../json_rpc_2/src/exception.dart.gcov.html | 145 - .../json_rpc_2/src/index-sort-f.html | 165 - .../json_rpc_2/src/index-sort-l.html | 136 - .../relay_client/json_rpc_2/src/index.html | 136 - .../src/parameters.dart.func-c.html | 75 - .../json_rpc_2/src/parameters.dart.func.html | 75 - .../json_rpc_2/src/parameters.dart.gcov.html | 420 -- .../json_rpc_2/src/peer.dart.func-c.html | 75 - .../json_rpc_2/src/peer.dart.func.html | 75 - .../json_rpc_2/src/peer.dart.gcov.html | 228 - .../json_rpc_2/src/server.dart.func-c.html | 75 - .../json_rpc_2/src/server.dart.func.html | 75 - .../json_rpc_2/src/server.dart.gcov.html | 391 -- .../json_rpc_2/src/utils.dart.func-c.html | 75 - .../json_rpc_2/src/utils.dart.func.html | 75 - .../json_rpc_2/src/utils.dart.gcov.html | 142 - .../message_tracker.dart.func-c.html | 75 - .../message_tracker.dart.func.html | 75 - .../message_tracker.dart.gcov.html | 124 - .../relay_client.dart.func-c.html | 75 - .../relay_client/relay_client.dart.func.html | 75 - .../relay_client/relay_client.dart.gcov.html | 542 -- .../relay_client_models.dart.func-c.html | 75 - .../relay_client_models.dart.func.html | 75 - .../relay_client_models.dart.gcov.html | 129 - .../websocket/http_client.dart.func-c.html | 75 - .../websocket/http_client.dart.func.html | 75 - .../websocket/http_client.dart.gcov.html | 100 - .../websocket/i_http_client.dart.func-c.html | 75 - .../websocket/i_http_client.dart.func.html | 75 - .../websocket/i_http_client.dart.gcov.html | 93 - .../relay_client/websocket/index-sort-f.html | 129 - .../relay_client/websocket/index-sort-l.html | 109 - .../core/relay_client/websocket/index.html | 109 - .../websocket_handler.dart.func-c.html | 75 - .../websocket_handler.dart.func.html | 75 - .../websocket_handler.dart.gcov.html | 162 - .../core/store/generic_store.dart.func-c.html | 75 - .../core/store/generic_store.dart.func.html | 75 - .../core/store/generic_store.dart.gcov.html | 243 - coverage/html/core/store/index-sort-f.html | 129 - coverage/html/core/store/index-sort-l.html | 109 - coverage/html/core/store/index.html | 109 - .../store/shared_prefs_store.dart.func-c.html | 75 - .../store/shared_prefs_store.dart.func.html | 75 - .../store/shared_prefs_store.dart.gcov.html | 232 - .../core/store/store_models.dart.func-c.html | 75 - .../core/store/store_models.dart.func.html | 75 - .../core/store/store_models.dart.gcov.html | 107 - coverage/html/core/verify/index-sort-f.html | 105 - coverage/html/core/verify/index-sort-l.html | 91 - coverage/html/core/verify/index.html | 91 - .../html/core/verify/models/index-sort-f.html | 105 - .../html/core/verify/models/index-sort-l.html | 91 - coverage/html/core/verify/models/index.html | 91 - .../models/verify_context.dart.func-c.html | 75 - .../models/verify_context.dart.func.html | 75 - .../models/verify_context.dart.gcov.html | 122 - .../html/core/verify/verify.dart.func-c.html | 75 - .../html/core/verify/verify.dart.func.html | 75 - .../html/core/verify/verify.dart.gcov.html | 132 - coverage/html/emerald.png | Bin 141 -> 0 bytes coverage/html/gcov.css | 1101 ---- coverage/html/glass.png | Bin 167 -> 0 bytes coverage/html/index-sort-f.html | 393 -- coverage/html/index-sort-l.html | 307 -- coverage/html/index.html | 307 -- .../html/models/basic_models.dart.func-c.html | 75 - .../html/models/basic_models.dart.func.html | 75 - .../html/models/basic_models.dart.gcov.html | 116 - coverage/html/models/index-sort-f.html | 153 - coverage/html/models/index-sort-l.html | 127 - coverage/html/models/index.html | 127 - .../models/json_rpc_error.dart.func-c.html | 75 - .../html/models/json_rpc_error.dart.func.html | 75 - .../html/models/json_rpc_error.dart.gcov.html | 99 - .../models/json_rpc_request.dart.func-c.html | 75 - .../models/json_rpc_request.dart.func.html | 75 - .../models/json_rpc_request.dart.gcov.html | 90 - .../models/json_rpc_response.dart.func-c.html | 75 - .../models/json_rpc_response.dart.func.html | 75 - .../models/json_rpc_response.dart.gcov.html | 91 - .../models/uri_parse_result.dart.func-c.html | 75 - .../models/uri_parse_result.dart.func.html | 75 - .../models/uri_parse_result.dart.gcov.html | 116 - coverage/html/ruby.png | Bin 141 -> 0 bytes coverage/html/sign_api/index-sort-f.html | 129 - coverage/html/sign_api/index-sort-l.html | 109 - coverage/html/sign_api/index.html | 109 - .../auth/auth_client_events.dart.func-c.html | 75 - .../auth/auth_client_events.dart.func.html | 75 - .../auth/auth_client_events.dart.gcov.html | 127 - .../auth/auth_client_models.dart.func-c.html | 75 - .../auth/auth_client_models.dart.func.html | 75 - .../auth/auth_client_models.dart.gcov.html | 238 - .../auth/common_auth_models.dart.func-c.html | 75 - .../auth/common_auth_models.dart.func.html | 75 - .../auth/common_auth_models.dart.gcov.html | 268 - .../sign_api/models/auth/index-sort-f.html | 153 - .../sign_api/models/auth/index-sort-l.html | 127 - coverage/html/sign_api/models/auth/index.html | 127 - .../auth/session_auth_events.dart.func-c.html | 75 - .../auth/session_auth_events.dart.func.html | 75 - .../auth/session_auth_events.dart.gcov.html | 143 - .../auth/session_auth_models.dart.func-c.html | 75 - .../auth/session_auth_models.dart.func.html | 75 - .../auth/session_auth_models.dart.gcov.html | 189 - .../html/sign_api/models/index-sort-f.html | 153 - .../html/sign_api/models/index-sort-l.html | 127 - coverage/html/sign_api/models/index.html | 127 - .../models/json_rpc_models.dart.func-c.html | 75 - .../models/json_rpc_models.dart.func.html | 75 - .../models/json_rpc_models.dart.gcov.html | 294 - .../models/proposal_models.dart.func-c.html | 75 - .../models/proposal_models.dart.func.html | 75 - .../models/proposal_models.dart.gcov.html | 123 - .../models/session_models.dart.func-c.html | 75 - .../models/session_models.dart.func.html | 75 - .../models/session_models.dart.gcov.html | 159 - .../sign_client_events.dart.func-c.html | 75 - .../models/sign_client_events.dart.func.html | 75 - .../models/sign_client_events.dart.gcov.html | 266 - .../sign_client_models.dart.func-c.html | 75 - .../models/sign_client_models.dart.func.html | 75 - .../models/sign_client_models.dart.gcov.html | 107 - .../html/sign_api/sessions.dart.func-c.html | 75 - .../html/sign_api/sessions.dart.func.html | 75 - .../html/sign_api/sessions.dart.gcov.html | 108 - .../sign_api/sign_client.dart.func-c.html | 75 - .../html/sign_api/sign_client.dart.func.html | 75 - .../html/sign_api/sign_client.dart.gcov.html | 748 --- .../sign_api/sign_engine.dart.func-c.html | 75 - .../html/sign_api/sign_engine.dart.func.html | 75 - .../html/sign_api/sign_engine.dart.gcov.html | 2861 ---------- .../utils/auth/address_utils.dart.func-c.html | 75 - .../utils/auth/address_utils.dart.func.html | 75 - .../utils/auth/address_utils.dart.gcov.html | 85 - .../auth/auth_api_validators.dart.func-c.html | 75 - .../auth/auth_api_validators.dart.func.html | 75 - .../auth/auth_api_validators.dart.gcov.html | 218 - .../auth/auth_signature.dart.func-c.html | 75 - .../utils/auth/auth_signature.dart.func.html | 75 - .../utils/auth/auth_signature.dart.gcov.html | 375 -- .../utils/auth/auth_utils.dart.func-c.html | 75 - .../utils/auth/auth_utils.dart.func.html | 75 - .../utils/auth/auth_utils.dart.gcov.html | 77 - .../sign_api/utils/auth/index-sort-f.html | 153 - .../sign_api/utils/auth/index-sort-l.html | 127 - coverage/html/sign_api/utils/auth/index.html | 127 - .../utils/auth/recaps_utils.dart.func-c.html | 75 - .../utils/auth/recaps_utils.dart.func.html | 75 - .../utils/auth/recaps_utils.dart.gcov.html | 420 -- .../utils/custom_credentials.dart.func-c.html | 75 - .../utils/custom_credentials.dart.func.html | 75 - .../utils/custom_credentials.dart.gcov.html | 152 - .../html/sign_api/utils/index-sort-f.html | 117 - .../html/sign_api/utils/index-sort-l.html | 100 - coverage/html/sign_api/utils/index.html | 100 - .../sign_api_validator_utils.dart.func-c.html | 75 - .../sign_api_validator_utils.dart.func.html | 75 - .../sign_api_validator_utils.dart.gcov.html | 396 -- coverage/html/snow.png | Bin 141 -> 0 bytes coverage/html/updown.png | Bin 117 -> 0 bytes coverage/html/utils/errors.dart.func-c.html | 75 - coverage/html/utils/errors.dart.func.html | 75 - coverage/html/utils/errors.dart.gcov.html | 349 -- .../html/utils/extensions.dart.func-c.html | 75 - coverage/html/utils/extensions.dart.func.html | 75 - coverage/html/utils/extensions.dart.gcov.html | 152 - coverage/html/utils/index-sort-f.html | 153 - coverage/html/utils/index-sort-l.html | 127 - coverage/html/utils/index.html | 127 - .../html/utils/log_level.dart.func-c.html | 75 - coverage/html/utils/log_level.dart.func.html | 75 - coverage/html/utils/log_level.dart.gcov.html | 102 - .../utils/namespace_utils.dart.func-c.html | 75 - .../html/utils/namespace_utils.dart.func.html | 75 - .../html/utils/namespace_utils.dart.gcov.html | 515 -- .../walletconnect_utils.dart.func-c.html | 75 - .../utils/walletconnect_utils.dart.func.html | 75 - .../utils/walletconnect_utils.dart.gcov.html | 302 -- coverage/html/web3app/index-sort-f.html | 105 - coverage/html/web3app/index-sort-l.html | 91 - coverage/html/web3app/index.html | 91 - .../html/web3app/web3app.dart.func-c.html | 75 - coverage/html/web3app/web3app.dart.func.html | 75 - coverage/html/web3app/web3app.dart.gcov.html | 526 -- coverage/html/web3wallet/index-sort-f.html | 105 - coverage/html/web3wallet/index-sort-l.html | 91 - coverage/html/web3wallet/index.html | 91 - .../web3wallet/web3wallet.dart.func-c.html | 75 - .../html/web3wallet/web3wallet.dart.func.html | 75 - .../html/web3wallet/web3wallet.dart.gcov.html | 612 --- coverage/lcov.info | 4705 ----------------- 298 files changed, 1 insertion(+), 44724 deletions(-) delete mode 100644 coverage/html/amber.png delete mode 100644 coverage/html/auth_api/auth_client.dart.func-c.html delete mode 100644 coverage/html/auth_api/auth_client.dart.func.html delete mode 100644 coverage/html/auth_api/auth_client.dart.gcov.html delete mode 100644 coverage/html/auth_api/auth_engine.dart.func-c.html delete mode 100644 coverage/html/auth_api/auth_engine.dart.func.html delete mode 100644 coverage/html/auth_api/auth_engine.dart.gcov.html delete mode 100644 coverage/html/auth_api/index-sort-f.html delete mode 100644 coverage/html/auth_api/index-sort-l.html delete mode 100644 coverage/html/auth_api/index.html delete mode 100644 coverage/html/cmd_line delete mode 100644 coverage/html/core/core.dart.func-c.html delete mode 100644 coverage/html/core/core.dart.func.html delete mode 100644 coverage/html/core/core.dart.gcov.html delete mode 100644 coverage/html/core/crypto/crypto.dart.func-c.html delete mode 100644 coverage/html/core/crypto/crypto.dart.func.html delete mode 100644 coverage/html/core/crypto/crypto.dart.gcov.html delete mode 100644 coverage/html/core/crypto/crypto_models.dart.func-c.html delete mode 100644 coverage/html/core/crypto/crypto_models.dart.func.html delete mode 100644 coverage/html/core/crypto/crypto_models.dart.gcov.html delete mode 100644 coverage/html/core/crypto/crypto_utils.dart.func-c.html delete mode 100644 coverage/html/core/crypto/crypto_utils.dart.func.html delete mode 100644 coverage/html/core/crypto/crypto_utils.dart.gcov.html delete mode 100644 coverage/html/core/crypto/index-sort-f.html delete mode 100644 coverage/html/core/crypto/index-sort-l.html delete mode 100644 coverage/html/core/crypto/index.html delete mode 100644 coverage/html/core/echo/echo.dart.func-c.html delete mode 100644 coverage/html/core/echo/echo.dart.func.html delete mode 100644 coverage/html/core/echo/echo.dart.gcov.html delete mode 100644 coverage/html/core/echo/echo_client.dart.func-c.html delete mode 100644 coverage/html/core/echo/echo_client.dart.func.html delete mode 100644 coverage/html/core/echo/echo_client.dart.gcov.html delete mode 100644 coverage/html/core/echo/index-sort-f.html delete mode 100644 coverage/html/core/echo/index-sort-l.html delete mode 100644 coverage/html/core/echo/index.html delete mode 100644 coverage/html/core/echo/models/echo_body.dart.func-c.html delete mode 100644 coverage/html/core/echo/models/echo_body.dart.func.html delete mode 100644 coverage/html/core/echo/models/echo_body.dart.gcov.html delete mode 100644 coverage/html/core/echo/models/echo_response.dart.func-c.html delete mode 100644 coverage/html/core/echo/models/echo_response.dart.func.html delete mode 100644 coverage/html/core/echo/models/echo_response.dart.gcov.html delete mode 100644 coverage/html/core/echo/models/index-sort-f.html delete mode 100644 coverage/html/core/echo/models/index-sort-l.html delete mode 100644 coverage/html/core/echo/models/index.html delete mode 100644 coverage/html/core/heartbit/heartbeat.dart.func-c.html delete mode 100644 coverage/html/core/heartbit/heartbeat.dart.func.html delete mode 100644 coverage/html/core/heartbit/heartbeat.dart.gcov.html delete mode 100644 coverage/html/core/heartbit/index-sort-f.html delete mode 100644 coverage/html/core/heartbit/index-sort-l.html delete mode 100644 coverage/html/core/heartbit/index.html delete mode 100644 coverage/html/core/index-sort-f.html delete mode 100644 coverage/html/core/index-sort-l.html delete mode 100644 coverage/html/core/index.html delete mode 100644 coverage/html/core/pairing/expirer.dart.func-c.html delete mode 100644 coverage/html/core/pairing/expirer.dart.func.html delete mode 100644 coverage/html/core/pairing/expirer.dart.gcov.html delete mode 100644 coverage/html/core/pairing/index-sort-f.html delete mode 100644 coverage/html/core/pairing/index-sort-l.html delete mode 100644 coverage/html/core/pairing/index.html delete mode 100644 coverage/html/core/pairing/json_rpc_history.dart.func-c.html delete mode 100644 coverage/html/core/pairing/json_rpc_history.dart.func.html delete mode 100644 coverage/html/core/pairing/json_rpc_history.dart.gcov.html delete mode 100644 coverage/html/core/pairing/pairing.dart.func-c.html delete mode 100644 coverage/html/core/pairing/pairing.dart.func.html delete mode 100644 coverage/html/core/pairing/pairing.dart.gcov.html delete mode 100644 coverage/html/core/pairing/pairing_store.dart.func-c.html delete mode 100644 coverage/html/core/pairing/pairing_store.dart.func.html delete mode 100644 coverage/html/core/pairing/pairing_store.dart.gcov.html delete mode 100644 coverage/html/core/pairing/utils/index-sort-f.html delete mode 100644 coverage/html/core/pairing/utils/index-sort-l.html delete mode 100644 coverage/html/core/pairing/utils/index.html delete mode 100644 coverage/html/core/pairing/utils/json_rpc_utils.dart.func-c.html delete mode 100644 coverage/html/core/pairing/utils/json_rpc_utils.dart.func.html delete mode 100644 coverage/html/core/pairing/utils/json_rpc_utils.dart.gcov.html delete mode 100644 coverage/html/core/pairing/utils/pairing_models.dart.func-c.html delete mode 100644 coverage/html/core/pairing/utils/pairing_models.dart.func.html delete mode 100644 coverage/html/core/pairing/utils/pairing_models.dart.gcov.html delete mode 100644 coverage/html/core/relay_auth/index-sort-f.html delete mode 100644 coverage/html/core/relay_auth/index-sort-l.html delete mode 100644 coverage/html/core/relay_auth/index.html delete mode 100644 coverage/html/core/relay_auth/relay_auth.dart.func-c.html delete mode 100644 coverage/html/core/relay_auth/relay_auth.dart.func.html delete mode 100644 coverage/html/core/relay_auth/relay_auth.dart.gcov.html delete mode 100644 coverage/html/core/relay_auth/relay_auth_models.dart.func-c.html delete mode 100644 coverage/html/core/relay_auth/relay_auth_models.dart.func.html delete mode 100644 coverage/html/core/relay_auth/relay_auth_models.dart.gcov.html delete mode 100644 coverage/html/core/relay_client/i_relay_client.dart.func-c.html delete mode 100644 coverage/html/core/relay_client/i_relay_client.dart.func.html delete mode 100644 coverage/html/core/relay_client/i_relay_client.dart.gcov.html delete mode 100644 coverage/html/core/relay_client/index-sort-f.html delete mode 100644 coverage/html/core/relay_client/index-sort-l.html delete mode 100644 coverage/html/core/relay_client/index.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/error_code.dart.func-c.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/error_code.dart.func.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/error_code.dart.gcov.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/index-sort-f.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/index-sort-l.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/index.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/src/client.dart.func-c.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/src/client.dart.func.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/src/client.dart.gcov.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/src/exception.dart.func-c.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/src/exception.dart.func.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/src/exception.dart.gcov.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/src/index-sort-f.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/src/index-sort-l.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/src/index.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.func-c.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.func.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.gcov.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/src/peer.dart.func-c.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/src/peer.dart.func.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/src/peer.dart.gcov.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/src/server.dart.func-c.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/src/server.dart.func.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/src/server.dart.gcov.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/src/utils.dart.func-c.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/src/utils.dart.func.html delete mode 100644 coverage/html/core/relay_client/json_rpc_2/src/utils.dart.gcov.html delete mode 100644 coverage/html/core/relay_client/message_tracker.dart.func-c.html delete mode 100644 coverage/html/core/relay_client/message_tracker.dart.func.html delete mode 100644 coverage/html/core/relay_client/message_tracker.dart.gcov.html delete mode 100644 coverage/html/core/relay_client/relay_client.dart.func-c.html delete mode 100644 coverage/html/core/relay_client/relay_client.dart.func.html delete mode 100644 coverage/html/core/relay_client/relay_client.dart.gcov.html delete mode 100644 coverage/html/core/relay_client/relay_client_models.dart.func-c.html delete mode 100644 coverage/html/core/relay_client/relay_client_models.dart.func.html delete mode 100644 coverage/html/core/relay_client/relay_client_models.dart.gcov.html delete mode 100644 coverage/html/core/relay_client/websocket/http_client.dart.func-c.html delete mode 100644 coverage/html/core/relay_client/websocket/http_client.dart.func.html delete mode 100644 coverage/html/core/relay_client/websocket/http_client.dart.gcov.html delete mode 100644 coverage/html/core/relay_client/websocket/i_http_client.dart.func-c.html delete mode 100644 coverage/html/core/relay_client/websocket/i_http_client.dart.func.html delete mode 100644 coverage/html/core/relay_client/websocket/i_http_client.dart.gcov.html delete mode 100644 coverage/html/core/relay_client/websocket/index-sort-f.html delete mode 100644 coverage/html/core/relay_client/websocket/index-sort-l.html delete mode 100644 coverage/html/core/relay_client/websocket/index.html delete mode 100644 coverage/html/core/relay_client/websocket/websocket_handler.dart.func-c.html delete mode 100644 coverage/html/core/relay_client/websocket/websocket_handler.dart.func.html delete mode 100644 coverage/html/core/relay_client/websocket/websocket_handler.dart.gcov.html delete mode 100644 coverage/html/core/store/generic_store.dart.func-c.html delete mode 100644 coverage/html/core/store/generic_store.dart.func.html delete mode 100644 coverage/html/core/store/generic_store.dart.gcov.html delete mode 100644 coverage/html/core/store/index-sort-f.html delete mode 100644 coverage/html/core/store/index-sort-l.html delete mode 100644 coverage/html/core/store/index.html delete mode 100644 coverage/html/core/store/shared_prefs_store.dart.func-c.html delete mode 100644 coverage/html/core/store/shared_prefs_store.dart.func.html delete mode 100644 coverage/html/core/store/shared_prefs_store.dart.gcov.html delete mode 100644 coverage/html/core/store/store_models.dart.func-c.html delete mode 100644 coverage/html/core/store/store_models.dart.func.html delete mode 100644 coverage/html/core/store/store_models.dart.gcov.html delete mode 100644 coverage/html/core/verify/index-sort-f.html delete mode 100644 coverage/html/core/verify/index-sort-l.html delete mode 100644 coverage/html/core/verify/index.html delete mode 100644 coverage/html/core/verify/models/index-sort-f.html delete mode 100644 coverage/html/core/verify/models/index-sort-l.html delete mode 100644 coverage/html/core/verify/models/index.html delete mode 100644 coverage/html/core/verify/models/verify_context.dart.func-c.html delete mode 100644 coverage/html/core/verify/models/verify_context.dart.func.html delete mode 100644 coverage/html/core/verify/models/verify_context.dart.gcov.html delete mode 100644 coverage/html/core/verify/verify.dart.func-c.html delete mode 100644 coverage/html/core/verify/verify.dart.func.html delete mode 100644 coverage/html/core/verify/verify.dart.gcov.html delete mode 100644 coverage/html/emerald.png delete mode 100644 coverage/html/gcov.css delete mode 100644 coverage/html/glass.png delete mode 100644 coverage/html/index-sort-f.html delete mode 100644 coverage/html/index-sort-l.html delete mode 100644 coverage/html/index.html delete mode 100644 coverage/html/models/basic_models.dart.func-c.html delete mode 100644 coverage/html/models/basic_models.dart.func.html delete mode 100644 coverage/html/models/basic_models.dart.gcov.html delete mode 100644 coverage/html/models/index-sort-f.html delete mode 100644 coverage/html/models/index-sort-l.html delete mode 100644 coverage/html/models/index.html delete mode 100644 coverage/html/models/json_rpc_error.dart.func-c.html delete mode 100644 coverage/html/models/json_rpc_error.dart.func.html delete mode 100644 coverage/html/models/json_rpc_error.dart.gcov.html delete mode 100644 coverage/html/models/json_rpc_request.dart.func-c.html delete mode 100644 coverage/html/models/json_rpc_request.dart.func.html delete mode 100644 coverage/html/models/json_rpc_request.dart.gcov.html delete mode 100644 coverage/html/models/json_rpc_response.dart.func-c.html delete mode 100644 coverage/html/models/json_rpc_response.dart.func.html delete mode 100644 coverage/html/models/json_rpc_response.dart.gcov.html delete mode 100644 coverage/html/models/uri_parse_result.dart.func-c.html delete mode 100644 coverage/html/models/uri_parse_result.dart.func.html delete mode 100644 coverage/html/models/uri_parse_result.dart.gcov.html delete mode 100644 coverage/html/ruby.png delete mode 100644 coverage/html/sign_api/index-sort-f.html delete mode 100644 coverage/html/sign_api/index-sort-l.html delete mode 100644 coverage/html/sign_api/index.html delete mode 100644 coverage/html/sign_api/models/auth/auth_client_events.dart.func-c.html delete mode 100644 coverage/html/sign_api/models/auth/auth_client_events.dart.func.html delete mode 100644 coverage/html/sign_api/models/auth/auth_client_events.dart.gcov.html delete mode 100644 coverage/html/sign_api/models/auth/auth_client_models.dart.func-c.html delete mode 100644 coverage/html/sign_api/models/auth/auth_client_models.dart.func.html delete mode 100644 coverage/html/sign_api/models/auth/auth_client_models.dart.gcov.html delete mode 100644 coverage/html/sign_api/models/auth/common_auth_models.dart.func-c.html delete mode 100644 coverage/html/sign_api/models/auth/common_auth_models.dart.func.html delete mode 100644 coverage/html/sign_api/models/auth/common_auth_models.dart.gcov.html delete mode 100644 coverage/html/sign_api/models/auth/index-sort-f.html delete mode 100644 coverage/html/sign_api/models/auth/index-sort-l.html delete mode 100644 coverage/html/sign_api/models/auth/index.html delete mode 100644 coverage/html/sign_api/models/auth/session_auth_events.dart.func-c.html delete mode 100644 coverage/html/sign_api/models/auth/session_auth_events.dart.func.html delete mode 100644 coverage/html/sign_api/models/auth/session_auth_events.dart.gcov.html delete mode 100644 coverage/html/sign_api/models/auth/session_auth_models.dart.func-c.html delete mode 100644 coverage/html/sign_api/models/auth/session_auth_models.dart.func.html delete mode 100644 coverage/html/sign_api/models/auth/session_auth_models.dart.gcov.html delete mode 100644 coverage/html/sign_api/models/index-sort-f.html delete mode 100644 coverage/html/sign_api/models/index-sort-l.html delete mode 100644 coverage/html/sign_api/models/index.html delete mode 100644 coverage/html/sign_api/models/json_rpc_models.dart.func-c.html delete mode 100644 coverage/html/sign_api/models/json_rpc_models.dart.func.html delete mode 100644 coverage/html/sign_api/models/json_rpc_models.dart.gcov.html delete mode 100644 coverage/html/sign_api/models/proposal_models.dart.func-c.html delete mode 100644 coverage/html/sign_api/models/proposal_models.dart.func.html delete mode 100644 coverage/html/sign_api/models/proposal_models.dart.gcov.html delete mode 100644 coverage/html/sign_api/models/session_models.dart.func-c.html delete mode 100644 coverage/html/sign_api/models/session_models.dart.func.html delete mode 100644 coverage/html/sign_api/models/session_models.dart.gcov.html delete mode 100644 coverage/html/sign_api/models/sign_client_events.dart.func-c.html delete mode 100644 coverage/html/sign_api/models/sign_client_events.dart.func.html delete mode 100644 coverage/html/sign_api/models/sign_client_events.dart.gcov.html delete mode 100644 coverage/html/sign_api/models/sign_client_models.dart.func-c.html delete mode 100644 coverage/html/sign_api/models/sign_client_models.dart.func.html delete mode 100644 coverage/html/sign_api/models/sign_client_models.dart.gcov.html delete mode 100644 coverage/html/sign_api/sessions.dart.func-c.html delete mode 100644 coverage/html/sign_api/sessions.dart.func.html delete mode 100644 coverage/html/sign_api/sessions.dart.gcov.html delete mode 100644 coverage/html/sign_api/sign_client.dart.func-c.html delete mode 100644 coverage/html/sign_api/sign_client.dart.func.html delete mode 100644 coverage/html/sign_api/sign_client.dart.gcov.html delete mode 100644 coverage/html/sign_api/sign_engine.dart.func-c.html delete mode 100644 coverage/html/sign_api/sign_engine.dart.func.html delete mode 100644 coverage/html/sign_api/sign_engine.dart.gcov.html delete mode 100644 coverage/html/sign_api/utils/auth/address_utils.dart.func-c.html delete mode 100644 coverage/html/sign_api/utils/auth/address_utils.dart.func.html delete mode 100644 coverage/html/sign_api/utils/auth/address_utils.dart.gcov.html delete mode 100644 coverage/html/sign_api/utils/auth/auth_api_validators.dart.func-c.html delete mode 100644 coverage/html/sign_api/utils/auth/auth_api_validators.dart.func.html delete mode 100644 coverage/html/sign_api/utils/auth/auth_api_validators.dart.gcov.html delete mode 100644 coverage/html/sign_api/utils/auth/auth_signature.dart.func-c.html delete mode 100644 coverage/html/sign_api/utils/auth/auth_signature.dart.func.html delete mode 100644 coverage/html/sign_api/utils/auth/auth_signature.dart.gcov.html delete mode 100644 coverage/html/sign_api/utils/auth/auth_utils.dart.func-c.html delete mode 100644 coverage/html/sign_api/utils/auth/auth_utils.dart.func.html delete mode 100644 coverage/html/sign_api/utils/auth/auth_utils.dart.gcov.html delete mode 100644 coverage/html/sign_api/utils/auth/index-sort-f.html delete mode 100644 coverage/html/sign_api/utils/auth/index-sort-l.html delete mode 100644 coverage/html/sign_api/utils/auth/index.html delete mode 100644 coverage/html/sign_api/utils/auth/recaps_utils.dart.func-c.html delete mode 100644 coverage/html/sign_api/utils/auth/recaps_utils.dart.func.html delete mode 100644 coverage/html/sign_api/utils/auth/recaps_utils.dart.gcov.html delete mode 100644 coverage/html/sign_api/utils/custom_credentials.dart.func-c.html delete mode 100644 coverage/html/sign_api/utils/custom_credentials.dart.func.html delete mode 100644 coverage/html/sign_api/utils/custom_credentials.dart.gcov.html delete mode 100644 coverage/html/sign_api/utils/index-sort-f.html delete mode 100644 coverage/html/sign_api/utils/index-sort-l.html delete mode 100644 coverage/html/sign_api/utils/index.html delete mode 100644 coverage/html/sign_api/utils/sign_api_validator_utils.dart.func-c.html delete mode 100644 coverage/html/sign_api/utils/sign_api_validator_utils.dart.func.html delete mode 100644 coverage/html/sign_api/utils/sign_api_validator_utils.dart.gcov.html delete mode 100644 coverage/html/snow.png delete mode 100644 coverage/html/updown.png delete mode 100644 coverage/html/utils/errors.dart.func-c.html delete mode 100644 coverage/html/utils/errors.dart.func.html delete mode 100644 coverage/html/utils/errors.dart.gcov.html delete mode 100644 coverage/html/utils/extensions.dart.func-c.html delete mode 100644 coverage/html/utils/extensions.dart.func.html delete mode 100644 coverage/html/utils/extensions.dart.gcov.html delete mode 100644 coverage/html/utils/index-sort-f.html delete mode 100644 coverage/html/utils/index-sort-l.html delete mode 100644 coverage/html/utils/index.html delete mode 100644 coverage/html/utils/log_level.dart.func-c.html delete mode 100644 coverage/html/utils/log_level.dart.func.html delete mode 100644 coverage/html/utils/log_level.dart.gcov.html delete mode 100644 coverage/html/utils/namespace_utils.dart.func-c.html delete mode 100644 coverage/html/utils/namespace_utils.dart.func.html delete mode 100644 coverage/html/utils/namespace_utils.dart.gcov.html delete mode 100644 coverage/html/utils/walletconnect_utils.dart.func-c.html delete mode 100644 coverage/html/utils/walletconnect_utils.dart.func.html delete mode 100644 coverage/html/utils/walletconnect_utils.dart.gcov.html delete mode 100644 coverage/html/web3app/index-sort-f.html delete mode 100644 coverage/html/web3app/index-sort-l.html delete mode 100644 coverage/html/web3app/index.html delete mode 100644 coverage/html/web3app/web3app.dart.func-c.html delete mode 100644 coverage/html/web3app/web3app.dart.func.html delete mode 100644 coverage/html/web3app/web3app.dart.gcov.html delete mode 100644 coverage/html/web3wallet/index-sort-f.html delete mode 100644 coverage/html/web3wallet/index-sort-l.html delete mode 100644 coverage/html/web3wallet/index.html delete mode 100644 coverage/html/web3wallet/web3wallet.dart.func-c.html delete mode 100644 coverage/html/web3wallet/web3wallet.dart.func.html delete mode 100644 coverage/html/web3wallet/web3wallet.dart.gcov.html delete mode 100644 coverage/lcov.info diff --git a/.gitignore b/.gitignore index c68c1976..de3a30be 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ .pub/ pubspec.lock /build/ +coverage/ # Web related lib/generated_plugin_registrant.dart diff --git a/coverage/html/amber.png b/coverage/html/amber.png deleted file mode 100644 index 2cab170d8359081983a4e343848dfe06bc490f12..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 141 zcmeAS@N?(olHy`uVBq!ia0vp^j3CU&3?x-=hn)ga>?NMQuI!iC1^G2tW}LqE04T&+ z;1OBOz`!j8!i<;h*8KqrvZOouIx;Y9?C1WI$O`1M1^9%x{(levWG - - - - - - LCOV - lcov.info - auth_api/auth_client.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - auth_api - auth_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:46.3 %5425
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/auth_api/auth_client.dart.func.html b/coverage/html/auth_api/auth_client.dart.func.html deleted file mode 100644 index 5e7a70a6..00000000 --- a/coverage/html/auth_api/auth_client.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - auth_api/auth_client.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - auth_api - auth_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:46.3 %5425
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/auth_api/auth_client.dart.gcov.html b/coverage/html/auth_api/auth_client.dart.gcov.html deleted file mode 100644 index 6bb4fd81..00000000 --- a/coverage/html/auth_api/auth_client.dart.gcov.html +++ /dev/null @@ -1,270 +0,0 @@ - - - - - - - LCOV - lcov.info - auth_api/auth_client.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - auth_api - auth_client.dartCoverageTotalHit
Test:lcov.infoLines:46.3 %5425
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:event/event.dart';
-       2              : import 'package:walletconnect_flutter_v2/apis/auth_api/auth_engine.dart';
-       3              : import 'package:walletconnect_flutter_v2/apis/auth_api/i_auth_client.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/auth_api/i_auth_engine.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/auth_client_events.dart';
-       6              : import 'package:walletconnect_flutter_v2/apis/core/core.dart';
-       7              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/http_client.dart';
-       8              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/i_http_client.dart';
-       9              : import 'package:walletconnect_flutter_v2/apis/core/store/generic_store.dart';
-      10              : import 'package:walletconnect_flutter_v2/apis/core/store/i_generic_store.dart';
-      11              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/auth_client_models.dart';
-      12              : import 'package:walletconnect_flutter_v2/apis/core/i_core.dart';
-      13              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
-      14              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/pairing_models.dart';
-      15              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/common_auth_models.dart';
-      16              : import 'package:walletconnect_flutter_v2/apis/utils/constants.dart';
-      17              : import 'package:walletconnect_flutter_v2/apis/utils/log_level.dart';
-      18              : 
-      19              : class AuthClient implements IAuthClient {
-      20              :   bool _initialized = false;
-      21              : 
-      22            0 :   @override
-      23              :   String get protocol => 'wc';
-      24              : 
-      25            0 :   @override
-      26              :   int get version => 2;
-      27              : 
-      28            0 :   @override
-      29            0 :   Event<AuthRequest> get onAuthRequest => engine.onAuthRequest;
-      30            1 :   @override
-      31            2 :   Event<AuthResponse> get onAuthResponse => engine.onAuthResponse;
-      32              : 
-      33            1 :   @override
-      34            2 :   ICore get core => engine.core;
-      35            0 :   @override
-      36            0 :   PairingMetadata get metadata => engine.metadata;
-      37            0 :   @override
-      38            0 :   IGenericStore<AuthPublicKey> get authKeys => engine.authKeys;
-      39            0 :   @override
-      40            0 :   IGenericStore<String> get pairingTopics => engine.pairingTopics;
-      41            0 :   @override
-      42            0 :   IGenericStore<PendingAuthRequest> get authRequests => engine.authRequests;
-      43            0 :   @override
-      44            0 :   IGenericStore<StoredCacao> get completeRequests => engine.completeRequests;
-      45              : 
-      46              :   @override
-      47              :   late IAuthEngine engine;
-      48              : 
-      49            0 :   static Future<AuthClient> createInstance({
-      50              :     required String projectId,
-      51              :     String relayUrl = WalletConnectConstants.DEFAULT_RELAY_URL,
-      52              :     required PairingMetadata metadata,
-      53              :     bool memoryStore = false,
-      54              :     IHttpClient httpClient = const HttpWrapper(),
-      55              :     LogLevel logLevel = LogLevel.nothing,
-      56              :   }) async {
-      57            0 :     final client = AuthClient(
-      58            0 :       core: Core(
-      59              :         projectId: projectId,
-      60              :         relayUrl: relayUrl,
-      61              :         memoryStore: memoryStore,
-      62              :         httpClient: httpClient,
-      63              :         logLevel: logLevel,
-      64              :       ),
-      65              :       metadata: metadata,
-      66              :     );
-      67            0 :     await client.init();
-      68              : 
-      69              :     return client;
-      70              :   }
-      71              : 
-      72            1 :   AuthClient({
-      73              :     required ICore core,
-      74              :     required PairingMetadata metadata,
-      75              :   }) {
-      76            2 :     engine = AuthEngine(
-      77              :       core: core,
-      78              :       metadata: metadata,
-      79            1 :       authKeys: GenericStore(
-      80            1 :         storage: core.storage,
-      81              :         context: StoreVersions.CONTEXT_AUTH_KEYS,
-      82              :         version: StoreVersions.VERSION_AUTH_KEYS,
-      83            0 :         fromJson: (dynamic value) {
-      84            0 :           return AuthPublicKey.fromJson(value);
-      85              :         },
-      86              :       ),
-      87            1 :       pairingTopics: GenericStore(
-      88            1 :         storage: core.storage,
-      89              :         context: StoreVersions.CONTEXT_PAIRING_TOPICS,
-      90              :         version: StoreVersions.VERSION_PAIRING_TOPICS,
-      91            0 :         fromJson: (dynamic value) {
-      92              :           return value as String;
-      93              :         },
-      94              :       ),
-      95            1 :       authRequests: GenericStore(
-      96            1 :         storage: core.storage,
-      97              :         context: StoreVersions.CONTEXT_AUTH_REQUESTS,
-      98              :         version: StoreVersions.VERSION_AUTH_REQUESTS,
-      99            0 :         fromJson: (dynamic value) {
-     100            0 :           return PendingAuthRequest.fromJson(value);
-     101              :         },
-     102              :       ),
-     103            1 :       completeRequests: GenericStore(
-     104            1 :         storage: core.storage,
-     105              :         context: StoreVersions.CONTEXT_COMPLETE_REQUESTS,
-     106              :         version: StoreVersions.VERSION_COMPLETE_REQUESTS,
-     107            0 :         fromJson: (dynamic value) {
-     108            0 :           return StoredCacao.fromJson(value);
-     109              :         },
-     110              :       ),
-     111              :     );
-     112              :   }
-     113              : 
-     114            1 :   @override
-     115              :   Future<void> init() async {
-     116            1 :     if (_initialized) {
-     117              :       return;
-     118              :     }
-     119              : 
-     120            2 :     await core.start();
-     121            2 :     await engine.init();
-     122              : 
-     123            1 :     _initialized = true;
-     124              :   }
-     125              : 
-     126            1 :   @override
-     127              :   Future<AuthRequestResponse> request({
-     128              :     required AuthRequestParams params,
-     129              :     String? pairingTopic,
-     130              :     List<List<String>>? methods = AuthEngine.DEFAULT_METHODS,
-     131              :   }) async {
-     132              :     try {
-     133            2 :       return engine.requestAuth(
-     134              :         params: params,
-     135              :         pairingTopic: pairingTopic,
-     136              :         methods: methods,
-     137              :       );
-     138              :     } catch (e) {
-     139              :       rethrow;
-     140              :     }
-     141              :   }
-     142              : 
-     143            0 :   @override
-     144              :   Future<void> respond({
-     145              :     required int id,
-     146              :     required String iss,
-     147              :     CacaoSignature? signature,
-     148              :     WalletConnectError? error,
-     149              :   }) async {
-     150              :     try {
-     151            0 :       return engine.respondAuthRequest(
-     152              :         id: id,
-     153              :         iss: iss,
-     154              :         signature: signature,
-     155              :         error: error,
-     156              :       );
-     157              :     } catch (e) {
-     158              :       rethrow;
-     159              :     }
-     160              :   }
-     161              : 
-     162            0 :   @override
-     163              :   Map<int, PendingAuthRequest> getPendingRequests() {
-     164              :     try {
-     165            0 :       return engine.getPendingAuthRequests();
-     166              :     } catch (e) {
-     167              :       rethrow;
-     168              :     }
-     169              :   }
-     170              : 
-     171            1 :   @override
-     172              :   Map<int, StoredCacao> getCompletedRequestsForPairing({
-     173              :     required String pairingTopic,
-     174              :   }) {
-     175              :     try {
-     176            2 :       return engine.getCompletedRequestsForPairing(
-     177              :         pairingTopic: pairingTopic,
-     178              :       );
-     179              :     } catch (e) {
-     180              :       rethrow;
-     181              :     }
-     182              :   }
-     183              : 
-     184            1 :   @override
-     185              :   String formatMessage({
-     186              :     required String iss,
-     187              :     required CacaoRequestPayload cacaoPayload,
-     188              :   }) {
-     189              :     try {
-     190            2 :       return engine.formatAuthMessage(
-     191              :         iss: iss,
-     192              :         cacaoPayload: cacaoPayload,
-     193              :       );
-     194              :     } catch (e) {
-     195              :       rethrow;
-     196              :     }
-     197              :   }
-     198              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/auth_api/auth_engine.dart.func-c.html b/coverage/html/auth_api/auth_engine.dart.func-c.html deleted file mode 100644 index 05177775..00000000 --- a/coverage/html/auth_api/auth_engine.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - auth_api/auth_engine.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - auth_api - auth_engine.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:87.0 %138120
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/auth_api/auth_engine.dart.func.html b/coverage/html/auth_api/auth_engine.dart.func.html deleted file mode 100644 index 6fb8d3f6..00000000 --- a/coverage/html/auth_api/auth_engine.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - auth_api/auth_engine.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - auth_api - auth_engine.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:87.0 %138120
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/auth_api/auth_engine.dart.gcov.html b/coverage/html/auth_api/auth_engine.dart.gcov.html deleted file mode 100644 index 84453b82..00000000 --- a/coverage/html/auth_api/auth_engine.dart.gcov.html +++ /dev/null @@ -1,513 +0,0 @@ - - - - - - - LCOV - lcov.info - auth_api/auth_engine.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - auth_api - auth_engine.dartCoverageTotalHit
Test:lcov.infoLines:87.0 %138120
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:async';
-       2              : 
-       3              : import 'package:event/event.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/auth_api/i_auth_engine.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/auth_client_events.dart';
-       6              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/auth_client_models.dart';
-       7              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/common_auth_models.dart';
-       8              : import 'package:walletconnect_flutter_v2/apis/core/store/i_generic_store.dart';
-       9              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/json_rpc_models.dart';
-      10              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/auth/address_utils.dart';
-      11              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/auth/auth_api_validators.dart';
-      12              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/auth/auth_constants.dart';
-      13              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/auth/auth_signature.dart';
-      14              : import 'package:walletconnect_flutter_v2/apis/core/crypto/crypto_models.dart';
-      15              : import 'package:walletconnect_flutter_v2/apis/core/i_core.dart';
-      16              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/pairing_models.dart';
-      17              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/json_rpc_utils.dart';
-      18              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
-      19              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_error.dart';
-      20              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_request.dart';
-      21              : import 'package:walletconnect_flutter_v2/apis/utils/constants.dart';
-      22              : import 'package:walletconnect_flutter_v2/apis/utils/errors.dart';
-      23              : import 'package:walletconnect_flutter_v2/apis/utils/method_constants.dart';
-      24              : 
-      25              : class AuthEngine implements IAuthEngine {
-      26              :   static const List<List<String>> DEFAULT_METHODS = [
-      27              :     [
-      28              :       MethodConstants.WC_AUTH_REQUEST,
-      29              :     ]
-      30              :   ];
-      31              : 
-      32              :   bool _initialized = false;
-      33              : 
-      34              :   @override
-      35              :   final Event<AuthRequest> onAuthRequest = Event();
-      36              :   @override
-      37              :   final Event<AuthResponse> onAuthResponse = Event();
-      38              : 
-      39              :   @override
-      40              :   final ICore core;
-      41              :   @override
-      42              :   final PairingMetadata metadata;
-      43              :   @override
-      44              :   late IGenericStore<AuthPublicKey> authKeys;
-      45              :   @override
-      46              :   late IGenericStore<String> pairingTopics;
-      47              :   @override
-      48              :   late IGenericStore<PendingAuthRequest> authRequests;
-      49              :   @override
-      50              :   late IGenericStore<StoredCacao> completeRequests;
-      51              : 
-      52              :   List<AuthRequestCompleter> pendingAuthRequests = [];
-      53              : 
-      54            3 :   AuthEngine({
-      55              :     required this.core,
-      56              :     required this.metadata,
-      57              :     required this.authKeys,
-      58              :     required this.pairingTopics,
-      59              :     required this.authRequests,
-      60              :     required this.completeRequests,
-      61              :   });
-      62              : 
-      63            3 :   @override
-      64              :   Future<void> init() async {
-      65            3 :     if (_initialized) {
-      66              :       return;
-      67              :     }
-      68              : 
-      69            9 :     await core.pairing.init();
-      70            6 :     await authKeys.init();
-      71            6 :     await pairingTopics.init();
-      72            6 :     await authRequests.init();
-      73            6 :     await completeRequests.init();
-      74              : 
-      75            3 :     _registerRelayClientFunctions();
-      76              : 
-      77            3 :     _initialized = true;
-      78              :   }
-      79              : 
-      80            2 :   @override
-      81              :   Future<AuthRequestResponse> requestAuth({
-      82              :     required AuthRequestParams params,
-      83              :     String? pairingTopic,
-      84              :     List<List<String>>? methods = DEFAULT_METHODS,
-      85              :   }) async {
-      86            2 :     _checkInitialized();
-      87              : 
-      88            2 :     AuthApiValidators.isValidRequest(params);
-      89              :     String? pTopic = pairingTopic;
-      90              :     Uri? uri;
-      91              : 
-      92              :     if (pTopic == null) {
-      93            3 :       final CreateResponse newTopicAndUri = await core.pairing.create(
-      94              :         methods: methods,
-      95              :       );
-      96            1 :       pTopic = newTopicAndUri.topic;
-      97            1 :       uri = newTopicAndUri.uri;
-      98              :     } else {
-      99            6 :       core.pairing.isValidPairingTopic(topic: pTopic);
-     100              :     }
-     101              : 
-     102            6 :     final publicKey = await core.crypto.generateKeyPair();
-     103              :     // print('requestAuth, publicKey: $publicKey');
-     104            8 :     final String responseTopic = core.crypto.getUtils().hashKey(publicKey);
-     105            2 :     final int id = JsonRpcUtils.payloadId();
-     106              : 
-     107            2 :     WcAuthRequestRequest request = WcAuthRequestRequest(
-     108            2 :       payloadParams: AuthPayloadParams.fromRequestParams(
-     109              :         params,
-     110              :       ),
-     111            2 :       requester: ConnectionMetadata(
-     112              :         publicKey: publicKey,
-     113            2 :         metadata: metadata,
-     114              :       ),
-     115              :     );
-     116              : 
-     117            2 :     final int expiry = params.expiry ?? WalletConnectConstants.FIVE_MINUTES;
-     118              : 
-     119            4 :     await authKeys.set(
-     120              :       AuthConstants.AUTH_CLIENT_PUBLIC_KEY_NAME,
-     121            2 :       AuthPublicKey(publicKey: publicKey),
-     122              :     );
-     123              : 
-     124            4 :     await pairingTopics.set(
-     125              :       responseTopic,
-     126              :       pTopic,
-     127              :     );
-     128              : 
-     129              :     // Set the one time use receiver public key for decoding the Type 1 envelope
-     130            6 :     await core.pairing.setReceiverPublicKey(
-     131              :       topic: responseTopic,
-     132              :       publicKey: publicKey,
-     133              :       expiry: expiry,
-     134              :     );
-     135              : 
-     136            2 :     Completer<AuthResponse> completer = Completer();
-     137              : 
-     138            2 :     _requestAuthResponseHandler(
-     139              :       pairingTopic: pTopic,
-     140              :       responseTopic: responseTopic,
-     141              :       request: request,
-     142              :       id: id,
-     143              :       expiry: expiry,
-     144              :       completer: completer,
-     145              :     );
-     146              : 
-     147            2 :     return AuthRequestResponse(
-     148              :       id: id,
-     149              :       pairingTopic: pTopic,
-     150              :       completer: completer,
-     151              :       uri: uri,
-     152              :     );
-     153              :   }
-     154              : 
-     155            2 :   Future<void> _requestAuthResponseHandler({
-     156              :     required String pairingTopic,
-     157              :     required String responseTopic,
-     158              :     required WcAuthRequestRequest request,
-     159              :     required int id,
-     160              :     required int expiry,
-     161              :     required Completer<AuthResponse> completer,
-     162              :   }) async {
-     163              :     Map<String, dynamic>? resp;
-     164              : 
-     165              :     // Subscribe to the responseTopic because we expect the response to use this topic
-     166              :     // print('got here');
-     167            6 :     await core.relayClient.subscribe(topic: responseTopic);
-     168              : 
-     169              :     try {
-     170            6 :       resp = await core.pairing.sendRequest(
-     171              :         pairingTopic,
-     172              :         MethodConstants.WC_AUTH_REQUEST,
-     173            2 :         request.toJson(),
-     174              :         id: id,
-     175              :         ttl: expiry,
-     176              :       );
-     177            0 :     } on JsonRpcError catch (e) {
-     178            0 :       final resp = AuthResponse(
-     179              :         id: id,
-     180              :         topic: responseTopic,
-     181              :         jsonRpcError: e,
-     182              :       );
-     183            0 :       onAuthResponse.broadcast(resp);
-     184            0 :       completer.complete(resp);
-     185              :       return;
-     186              :     }
-     187              : 
-     188            6 :     await core.pairing.activate(topic: pairingTopic);
-     189              : 
-     190            2 :     final Cacao cacao = Cacao.fromJson(resp!);
-     191            2 :     final CacaoSignature sig = cacao.s;
-     192            2 :     final CacaoPayload payload = cacao.p;
-     193            4 :     await completeRequests.set(
-     194            2 :       id.toString(),
-     195            2 :       StoredCacao.fromCacao(
-     196              :         id: id,
-     197              :         pairingTopic: pairingTopic,
-     198              :         cacao: cacao,
-     199              :       ),
-     200              :     );
-     201              : 
-     202            2 :     final String reconstructed = formatAuthMessage(
-     203            2 :       iss: payload.iss,
-     204            2 :       cacaoPayload: CacaoRequestPayload.fromCacaoPayload(payload),
-     205              :     );
-     206              : 
-     207            4 :     final String walletAddress = AddressUtils.getDidAddress(payload.iss);
-     208            4 :     final String chainId = AddressUtils.getDidChainId(payload.iss);
-     209              : 
-     210            2 :     if (walletAddress.isEmpty) {
-     211            0 :       throw Errors.getSdkError(
-     212              :         Errors.MISSING_OR_INVALID,
-     213              :         context: 'authResponse walletAddress is empty',
-     214              :       );
-     215              :     }
-     216            2 :     if (chainId.isEmpty) {
-     217            0 :       throw Errors.getSdkError(
-     218              :         Errors.MISSING_OR_INVALID,
-     219              :         context: 'authResponse chainId is empty',
-     220              :       );
-     221              :     }
-     222              : 
-     223            2 :     final bool isValid = await AuthSignature.verifySignature(
-     224              :       walletAddress,
-     225              :       reconstructed,
-     226              :       sig,
-     227              :       chainId,
-     228            4 :       core.projectId,
-     229              :     );
-     230              : 
-     231              :     if (!isValid) {
-     232            0 :       final resp = AuthResponse(
-     233              :         id: id,
-     234              :         topic: responseTopic,
-     235              :         error: const WalletConnectError(
-     236              :           code: -1,
-     237              :           message: 'Invalid signature',
-     238              :         ),
-     239              :       );
-     240            0 :       onAuthResponse.broadcast(resp);
-     241            0 :       completer.complete(resp);
-     242              :     } else {
-     243            2 :       final resp = AuthResponse(
-     244              :         id: id,
-     245              :         topic: responseTopic,
-     246              :         result: cacao,
-     247              :       );
-     248            4 :       onAuthResponse.broadcast(resp);
-     249            2 :       completer.complete(resp);
-     250              :     }
-     251              :   }
-     252              : 
-     253            2 :   @override
-     254              :   Future<void> respondAuthRequest({
-     255              :     required int id,
-     256              :     required String iss,
-     257              :     CacaoSignature? signature,
-     258              :     WalletConnectError? error,
-     259              :   }) async {
-     260            2 :     _checkInitialized();
-     261              : 
-     262            2 :     Map<int, PendingAuthRequest> pendingRequests = getPendingAuthRequests();
-     263            2 :     AuthApiValidators.isValidRespond(
-     264              :       id: id,
-     265              :       pendingRequests: pendingRequests,
-     266              :       signature: signature,
-     267              :       error: error,
-     268              :     );
-     269              : 
-     270            2 :     final PendingAuthRequest pendingRequest = pendingRequests[id]!;
-     271            4 :     final String receiverPublicKey = pendingRequest.metadata.publicKey;
-     272            6 :     final String senderPublicKey = await core.crypto.generateKeyPair();
-     273            8 :     final String responseTopic = core.crypto.getUtils().hashKey(
-     274              :           receiverPublicKey,
-     275              :         );
-     276            2 :     final EncodeOptions encodeOpts = EncodeOptions(
-     277              :       type: EncodeOptions.TYPE_1,
-     278              :       receiverPublicKey: receiverPublicKey,
-     279              :       senderPublicKey: senderPublicKey,
-     280              :     );
-     281              : 
-     282              :     if (error != null) {
-     283            0 :       await core.pairing.sendError(
-     284              :         id,
-     285              :         responseTopic,
-     286              :         MethodConstants.WC_AUTH_REQUEST,
-     287            0 :         JsonRpcError.serverError(error.message),
-     288              :         encodeOptions: encodeOpts,
-     289              :       );
-     290              :     } else {
-     291            2 :       final Cacao cacao = Cacao(
-     292              :         h: const CacaoHeader(),
-     293            2 :         p: CacaoPayload.fromRequestPayload(
-     294              :           issuer: iss,
-     295            2 :           payload: pendingRequest.cacaoPayload,
-     296              :         ),
-     297              :         s: signature!,
-     298              :       );
-     299              : 
-     300              :       // print('auth res id: $id');
-     301            6 :       await core.pairing.sendResult(
-     302              :         id,
-     303              :         responseTopic,
-     304              :         MethodConstants.WC_AUTH_REQUEST,
-     305            2 :         cacao.toJson(),
-     306              :         encodeOptions: encodeOpts,
-     307              :       );
-     308              : 
-     309            6 :       await authRequests.delete(id.toString());
-     310              : 
-     311            4 :       await completeRequests.set(
-     312            2 :         id.toString(),
-     313            2 :         StoredCacao.fromCacao(
-     314              :           id: id,
-     315            2 :           pairingTopic: pendingRequest.pairingTopic,
-     316              :           cacao: cacao,
-     317              :         ),
-     318              :       );
-     319              :     }
-     320              :   }
-     321              : 
-     322            2 :   @override
-     323              :   Map<int, PendingAuthRequest> getPendingAuthRequests() {
-     324            2 :     Map<int, PendingAuthRequest> pendingRequests = {};
-     325            8 :     authRequests.getAll().forEach((key) {
-     326            4 :       pendingRequests[key.id] = key;
-     327              :     });
-     328              :     return pendingRequests;
-     329              :   }
-     330              : 
-     331            1 :   @override
-     332              :   Map<int, StoredCacao> getCompletedRequestsForPairing({
-     333              :     required String pairingTopic,
-     334              :   }) {
-     335            1 :     Map<int, StoredCacao> completedRequests = {};
-     336            1 :     completeRequests
-     337            1 :         .getAll()
-     338            1 :         .where(
-     339            3 :           (e) => e.pairingTopic == pairingTopic,
-     340              :         )
-     341            2 :         .forEach((key) {
-     342            2 :       completedRequests[key.id] = key;
-     343              :     });
-     344              :     return completedRequests;
-     345              :   }
-     346              : 
-     347            2 :   @override
-     348              :   String formatAuthMessage({
-     349              :     required String iss,
-     350              :     required CacaoRequestPayload cacaoPayload,
-     351              :   }) {
-     352              :     final header =
-     353            4 :         '${cacaoPayload.domain} wants you to sign in with your Ethereum account:';
-     354            2 :     final walletAddress = AddressUtils.getDidAddress(iss);
-     355            4 :     final uri = 'URI: ${cacaoPayload.aud}';
-     356            4 :     final version = 'Version: ${cacaoPayload.version}';
-     357            4 :     final chainId = 'Chain ID: ${AddressUtils.getDidChainId(iss)}';
-     358            4 :     final nonce = 'Nonce: ${cacaoPayload.nonce}';
-     359            4 :     final issuedAt = 'Issued At: ${cacaoPayload.iat}';
-     360            2 :     final resources = cacaoPayload.resources != null &&
-     361            2 :             cacaoPayload.resources!.isNotEmpty
-     362            5 :         ? 'Resources:\n${cacaoPayload.resources!.map((resource) => '- $resource').join('\n')}'
-     363            1 :         : null;
-     364              : 
-     365            2 :     final message = [
-     366              :       header,
-     367              :       walletAddress,
-     368              :       '',
-     369            2 :       cacaoPayload.statement,
-     370              :       '',
-     371              :       uri,
-     372              :       version,
-     373              :       chainId,
-     374              :       nonce,
-     375              :       issuedAt,
-     376              :       resources,
-     377            6 :     ].where((element) => element != null).join('\n');
-     378              : 
-     379              :     return message;
-     380              :   }
-     381              : 
-     382              :   /// ---- PRIVATE HELPERS ---- ///
-     383              : 
-     384            2 :   void _checkInitialized() {
-     385            2 :     if (!_initialized) {
-     386            0 :       throw Errors.getInternalError(Errors.NOT_INITIALIZED);
-     387              :     }
-     388              :   }
-     389              : 
-     390              :   /// ---- Relay Events ---- ///
-     391              : 
-     392            3 :   void _registerRelayClientFunctions() {
-     393            9 :     core.pairing.register(
-     394              :       method: MethodConstants.WC_AUTH_REQUEST,
-     395            3 :       function: _onAuthRequest,
-     396              :       type: ProtocolType.auth,
-     397              :     );
-     398              :   }
-     399              : 
-     400            2 :   void _onAuthRequest(
-     401              :     String topic,
-     402              :     JsonRpcRequest payload,
-     403              :   ) async {
-     404              :     try {
-     405            4 :       final request = WcAuthRequestRequest.fromJson(payload.params);
-     406              : 
-     407              :       final CacaoRequestPayload cacaoPayload =
-     408            2 :           CacaoRequestPayload.fromPayloadParams(
-     409            2 :         request.payloadParams,
-     410              :       );
-     411              : 
-     412            4 :       authRequests.set(
-     413            4 :         payload.id.toString(),
-     414            2 :         PendingAuthRequest(
-     415            2 :           id: payload.id,
-     416              :           pairingTopic: topic,
-     417            2 :           metadata: request.requester,
-     418              :           cacaoPayload: cacaoPayload,
-     419              :         ),
-     420              :       );
-     421              : 
-     422            4 :       onAuthRequest.broadcast(
-     423            2 :         AuthRequest(
-     424            2 :           id: payload.id,
-     425              :           topic: topic,
-     426            2 :           requester: request.requester,
-     427            2 :           payloadParams: request.payloadParams,
-     428              :         ),
-     429              :       );
-     430            0 :     } on WalletConnectError catch (err) {
-     431            0 :       await core.pairing.sendError(
-     432            0 :         payload.id,
-     433              :         topic,
-     434            0 :         payload.method,
-     435            0 :         JsonRpcError.invalidParams(
-     436            0 :           err.message,
-     437              :         ),
-     438              :       );
-     439              :     }
-     440              :   }
-     441              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/auth_api/index-sort-f.html b/coverage/html/auth_api/index-sort-f.html deleted file mode 100644 index 283b5b22..00000000 --- a/coverage/html/auth_api/index-sort-f.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - LCOV - lcov.info - auth_api - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - auth_apiCoverageTotalHit
Test:lcov.infoLines:75.5 %192145
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
auth_client.dart -
46.3%46.3%
-
46.3 %5425-
auth_engine.dart -
87.0%87.0%
-
87.0 %138120-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/auth_api/index-sort-l.html b/coverage/html/auth_api/index-sort-l.html deleted file mode 100644 index 49efc2e8..00000000 --- a/coverage/html/auth_api/index-sort-l.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - LCOV - lcov.info - auth_api - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - auth_apiCoverageTotalHit
Test:lcov.infoLines:75.5 %192145
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
auth_client.dart -
46.3%46.3%
-
46.3 %5425
auth_engine.dart -
87.0%87.0%
-
87.0 %138120
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/auth_api/index.html b/coverage/html/auth_api/index.html deleted file mode 100644 index 279fd510..00000000 --- a/coverage/html/auth_api/index.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - LCOV - lcov.info - auth_api - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - auth_apiCoverageTotalHit
Test:lcov.infoLines:75.5 %192145
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
auth_client.dart -
46.3%46.3%
-
46.3 %5425
auth_engine.dart -
87.0%87.0%
-
87.0 %138120
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/cmd_line b/coverage/html/cmd_line deleted file mode 100644 index fff562af..00000000 --- a/coverage/html/cmd_line +++ /dev/null @@ -1 +0,0 @@ -genhtml --rc genhtml_hi_limit=75 --rc genhtml_med_limit=50 -o coverage/html coverage/lcov.info --no-function-coverage diff --git a/coverage/html/core/core.dart.func-c.html b/coverage/html/core/core.dart.func-c.html deleted file mode 100644 index cb2e0536..00000000 --- a/coverage/html/core/core.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/core.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core - core.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:74.5 %5138
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/core.dart.func.html b/coverage/html/core/core.dart.func.html deleted file mode 100644 index 77fdda59..00000000 --- a/coverage/html/core/core.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/core.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core - core.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:74.5 %5138
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/core.dart.gcov.html b/coverage/html/core/core.dart.gcov.html deleted file mode 100644 index ecd9d828..00000000 --- a/coverage/html/core/core.dart.gcov.html +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - - LCOV - lcov.info - core/core.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core - core.dartCoverageTotalHit
Test:lcov.infoLines:74.5 %5138
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:logger/logger.dart';
-       2              : import 'package:walletconnect_flutter_v2/apis/core/crypto/crypto.dart';
-       3              : import 'package:walletconnect_flutter_v2/apis/core/crypto/i_crypto.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/core/echo/echo.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/core/echo/echo_client.dart';
-       6              : import 'package:walletconnect_flutter_v2/apis/core/echo/i_echo.dart';
-       7              : import 'package:walletconnect_flutter_v2/apis/core/heartbit/heartbeat.dart';
-       8              : import 'package:walletconnect_flutter_v2/apis/core/heartbit/i_heartbeat.dart';
-       9              : import 'package:walletconnect_flutter_v2/apis/core/i_core.dart';
-      10              : import 'package:walletconnect_flutter_v2/apis/core/pairing/expirer.dart';
-      11              : import 'package:walletconnect_flutter_v2/apis/core/pairing/i_expirer.dart';
-      12              : import 'package:walletconnect_flutter_v2/apis/core/pairing/json_rpc_history.dart';
-      13              : import 'package:walletconnect_flutter_v2/apis/core/pairing/pairing.dart';
-      14              : import 'package:walletconnect_flutter_v2/apis/core/pairing/pairing_store.dart';
-      15              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/pairing_models.dart';
-      16              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/message_tracker.dart';
-      17              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client.dart';
-      18              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/http_client.dart';
-      19              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/i_http_client.dart';
-      20              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/i_websocket_handler.dart';
-      21              : import 'package:walletconnect_flutter_v2/apis/core/store/generic_store.dart';
-      22              : import 'package:walletconnect_flutter_v2/apis/core/store/i_store.dart';
-      23              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/i_relay_client.dart';
-      24              : import 'package:walletconnect_flutter_v2/apis/core/pairing/i_pairing.dart';
-      25              : import 'package:walletconnect_flutter_v2/apis/core/store/shared_prefs_store.dart';
-      26              : import 'package:walletconnect_flutter_v2/apis/core/verify/i_verify.dart';
-      27              : import 'package:walletconnect_flutter_v2/apis/core/verify/verify.dart';
-      28              : import 'package:walletconnect_flutter_v2/apis/utils/constants.dart';
-      29              : import 'package:walletconnect_flutter_v2/apis/utils/log_level.dart';
-      30              : import 'package:walletconnect_flutter_v2/apis/utils/walletconnect_utils.dart';
-      31              : 
-      32              : class Core implements ICore {
-      33            7 :   @override
-      34              :   String get protocol => 'wc';
-      35            7 :   @override
-      36              :   String get version => '2';
-      37              : 
-      38              :   @override
-      39              :   final String projectId;
-      40              : 
-      41              :   @override
-      42              :   String relayUrl = WalletConnectConstants.DEFAULT_RELAY_URL;
-      43              : 
-      44              :   @override
-      45              :   String pushUrl = WalletConnectConstants.DEFAULT_PUSH_URL;
-      46              : 
-      47              :   @override
-      48              :   late ICrypto crypto;
-      49              : 
-      50              :   @override
-      51              :   late IRelayClient relayClient;
-      52              : 
-      53              :   @override
-      54              :   late IExpirer expirer;
-      55              : 
-      56              :   @override
-      57              :   late IPairing pairing;
-      58              : 
-      59              :   @override
-      60              :   late IEcho echo;
-      61              : 
-      62              :   @override
-      63              :   late IHeartBeat heartbeat;
-      64              : 
-      65              :   @override
-      66              :   late IVerify verify;
-      67              : 
-      68              :   Logger _logger = Logger(
-      69              :     level: Level.off,
-      70              :     printer: PrettyPrinter(),
-      71              :   );
-      72            9 :   @override
-      73            9 :   Logger get logger => _logger;
-      74              : 
-      75            0 :   @override
-      76              :   void addLogListener(LogCallback callback) {
-      77            0 :     Logger.addLogListener(callback);
-      78              :   }
-      79              : 
-      80            0 :   @override
-      81              :   bool removeLogListener(LogCallback callback) {
-      82            0 :     return Logger.removeLogListener(callback);
-      83              :   }
-      84              : 
-      85              :   @override
-      86              :   late IStore<Map<String, dynamic>> storage;
-      87              : 
-      88           10 :   Core({
-      89              :     required this.projectId,
-      90              :     this.relayUrl = WalletConnectConstants.DEFAULT_RELAY_URL,
-      91              :     this.pushUrl = WalletConnectConstants.DEFAULT_PUSH_URL,
-      92              :     bool memoryStore = false,
-      93              :     LogLevel logLevel = LogLevel.nothing,
-      94              :     IHttpClient httpClient = const HttpWrapper(),
-      95              :     IWebSocketHandler? webSocketHandler,
-      96              :   }) {
-      97           20 :     _logger = Logger(
-      98           10 :       level: logLevel.toLevel(),
-      99           10 :       printer: PrettyPrinter(methodCount: null),
-     100              :     );
-     101           20 :     heartbeat = HeartBeat();
-     102           20 :     storage = SharedPrefsStores(
-     103              :       memoryStore: memoryStore,
-     104              :     );
-     105           20 :     crypto = Crypto(
-     106              :       core: this,
-     107           10 :       keyChain: GenericStore<String>(
-     108           10 :         storage: storage,
-     109              :         context: StoreVersions.CONTEXT_KEYCHAIN,
-     110              :         version: StoreVersions.VERSION_KEYCHAIN,
-     111            0 :         fromJson: (dynamic value) => value as String,
-     112              :       ),
-     113              :     );
-     114           20 :     relayClient = RelayClient(
-     115              :       core: this,
-     116           10 :       messageTracker: MessageTracker(
-     117           10 :         storage: storage,
-     118              :         context: StoreVersions.CONTEXT_MESSAGE_TRACKER,
-     119              :         version: StoreVersions.VERSION_MESSAGE_TRACKER,
-     120            0 :         fromJson: (dynamic value) {
-     121            0 :           return WalletConnectUtils.convertMapTo<String>(value);
-     122              :         },
-     123              :       ),
-     124           10 :       topicMap: GenericStore<String>(
-     125           10 :         storage: storage,
-     126              :         context: StoreVersions.CONTEXT_TOPIC_MAP,
-     127              :         version: StoreVersions.VERSION_TOPIC_MAP,
-     128            0 :         fromJson: (dynamic value) => value as String,
-     129              :       ),
-     130              :       socketHandler: webSocketHandler,
-     131              :     );
-     132           20 :     expirer = Expirer(
-     133           10 :       storage: storage,
-     134              :       context: StoreVersions.CONTEXT_EXPIRER,
-     135              :       version: StoreVersions.VERSION_EXPIRER,
-     136            0 :       fromJson: (dynamic value) => value as int,
-     137              :     );
-     138           20 :     pairing = Pairing(
-     139              :       core: this,
-     140           10 :       pairings: PairingStore(
-     141           10 :         storage: storage,
-     142              :         context: StoreVersions.CONTEXT_PAIRINGS,
-     143              :         version: StoreVersions.VERSION_PAIRINGS,
-     144            0 :         fromJson: (dynamic value) {
-     145            0 :           return PairingInfo.fromJson(value as Map<String, dynamic>);
-     146              :         },
-     147              :       ),
-     148           10 :       history: JsonRpcHistory(
-     149           10 :         storage: storage,
-     150              :         context: StoreVersions.CONTEXT_JSON_RPC_HISTORY,
-     151              :         version: StoreVersions.VERSION_JSON_RPC_HISTORY,
-     152            0 :         fromJson: (dynamic value) => JsonRpcRecord.fromJson(value),
-     153              :       ),
-     154           10 :       topicToReceiverPublicKey: GenericStore(
-     155           10 :         storage: storage,
-     156              :         context: StoreVersions.CONTEXT_TOPIC_TO_RECEIVER_PUBLIC_KEY,
-     157              :         version: StoreVersions.VERSION_TOPIC_TO_RECEIVER_PUBLIC_KEY,
-     158            0 :         fromJson: (dynamic value) => ReceiverPublicKey.fromJson(value),
-     159              :       ),
-     160              :     );
-     161           20 :     echo = Echo(
-     162              :       core: this,
-     163           10 :       echoClient: EchoClient(
-     164           10 :         baseUrl: pushUrl,
-     165              :         httpClient: httpClient,
-     166              :       ),
-     167              :     );
-     168           20 :     verify = Verify(
-     169              :       core: this,
-     170              :       httpClient: httpClient,
-     171              :     );
-     172              :   }
-     173              : 
-     174            9 :   @override
-     175              :   Future<void> start() async {
-     176           18 :     await storage.init();
-     177           18 :     await crypto.init();
-     178           18 :     await relayClient.init();
-     179           18 :     await expirer.init();
-     180           18 :     await pairing.init();
-     181           18 :     heartbeat.init();
-     182              :   }
-     183              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/crypto/crypto.dart.func-c.html b/coverage/html/core/crypto/crypto.dart.func-c.html deleted file mode 100644 index c5f2096b..00000000 --- a/coverage/html/core/crypto/crypto.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/crypto/crypto.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/crypto - crypto.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:86.2 %8775
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/crypto/crypto.dart.func.html b/coverage/html/core/crypto/crypto.dart.func.html deleted file mode 100644 index c43d455e..00000000 --- a/coverage/html/core/crypto/crypto.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/crypto/crypto.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/crypto - crypto.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:86.2 %8775
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/crypto/crypto.dart.gcov.html b/coverage/html/core/crypto/crypto.dart.gcov.html deleted file mode 100644 index 9490ac60..00000000 --- a/coverage/html/core/crypto/crypto.dart.gcov.html +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - - LCOV - lcov.info - core/crypto/crypto.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/crypto - crypto.dartCoverageTotalHit
Test:lcov.infoLines:86.2 %8775
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:convert';
-       2              : import 'dart:typed_data';
-       3              : 
-       4              : import 'package:convert/convert.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/core/crypto/crypto_models.dart';
-       6              : import 'package:walletconnect_flutter_v2/apis/core/crypto/crypto_utils.dart';
-       7              : import 'package:walletconnect_flutter_v2/apis/core/i_core.dart';
-       8              : import 'package:walletconnect_flutter_v2/apis/core/crypto/i_crypto.dart';
-       9              : import 'package:walletconnect_flutter_v2/apis/core/crypto/i_crypto_utils.dart';
-      10              : import 'package:walletconnect_flutter_v2/apis/core/relay_auth/i_relay_auth.dart';
-      11              : import 'package:walletconnect_flutter_v2/apis/core/relay_auth/relay_auth.dart';
-      12              : import 'package:walletconnect_flutter_v2/apis/core/relay_auth/relay_auth_models.dart';
-      13              : import 'package:walletconnect_flutter_v2/apis/core/store/i_generic_store.dart';
-      14              : import 'package:walletconnect_flutter_v2/apis/utils/constants.dart';
-      15              : import 'package:walletconnect_flutter_v2/apis/utils/errors.dart';
-      16              : 
-      17              : class Crypto implements ICrypto {
-      18              :   static const cryptoContext = 'crypto';
-      19              :   static const cryptoClientSeed = 'client_ed25519_seed';
-      20              :   static const clientSeed = 'CLIENT_SEED';
-      21              : 
-      22              :   bool _initialized = false;
-      23              : 
-      24            0 :   @override
-      25              :   String get name => cryptoContext;
-      26              : 
-      27              :   final ICore core;
-      28              : 
-      29              :   @override
-      30              :   IGenericStore<String> keyChain;
-      31              : 
-      32              :   ICryptoUtils utils;
-      33              :   IRelayAuth relayAuth;
-      34              : 
-      35           10 :   Crypto({
-      36              :     required this.core,
-      37              :     required this.keyChain,
-      38              :     CryptoUtils? utils,
-      39              :     RelayAuth? relayAuth,
-      40           10 :   })  : utils = utils ?? CryptoUtils(),
-      41           10 :         relayAuth = relayAuth ?? RelayAuth();
-      42              : 
-      43           10 :   @override
-      44              :   Future<void> init() async {
-      45           10 :     if (_initialized) {
-      46              :       return;
-      47              :     }
-      48              : 
-      49           20 :     await keyChain.init();
-      50              : 
-      51           10 :     _initialized = true;
-      52              :   }
-      53              : 
-      54            0 :   @override
-      55              :   bool hasKeys(String tag) {
-      56            0 :     _checkInitialized();
-      57            0 :     return keyChain.has(tag);
-      58              :   }
-      59              : 
-      60            0 :   @override
-      61              :   Future<String> getClientId() async {
-      62            0 :     _checkInitialized();
-      63              : 
-      64              :     // If we don't have a pub key associated with the seed yet, make one
-      65            0 :     final Uint8List seed = await _getClientSeed();
-      66            0 :     final RelayAuthKeyPair keyPair = await relayAuth.generateKeyPair(seed);
-      67            0 :     return relayAuth.encodeIss(keyPair.publicKeyBytes);
-      68              :   }
-      69              : 
-      70            6 :   @override
-      71              :   Future<String> generateKeyPair() async {
-      72            6 :     _checkInitialized();
-      73              : 
-      74           12 :     CryptoKeyPair keyPair = utils.generateKeyPair();
-      75            6 :     return await _setPrivateKey(keyPair);
-      76              :   }
-      77              : 
-      78            6 :   @override
-      79              :   Future<String> generateSharedKey(
-      80              :     String selfPublicKey,
-      81              :     String peerPublicKey, {
-      82              :     String? overrideTopic,
-      83              :   }) async {
-      84            6 :     _checkInitialized();
-      85              : 
-      86            6 :     String privKey = _getPrivateKey(selfPublicKey)!;
-      87           12 :     String symKey = await utils.deriveSymKey(privKey, peerPublicKey);
-      88            6 :     return await setSymKey(symKey, overrideTopic: overrideTopic);
-      89              :   }
-      90              : 
-      91            8 :   @override
-      92              :   Future<String> setSymKey(
-      93              :     String symKey, {
-      94              :     String? overrideTopic,
-      95              :   }) async {
-      96            8 :     _checkInitialized();
-      97              : 
-      98           16 :     final String topic = overrideTopic ?? utils.hashKey(symKey);
-      99              :     // print('crypto setSymKey, symKey: $symKey, overrideTopic: $topic');
-     100           16 :     await keyChain.set(topic, symKey);
-     101              :     return topic;
-     102              :   }
-     103              : 
-     104            4 :   @override
-     105              :   Future<void> deleteKeyPair(String publicKey) async {
-     106            4 :     _checkInitialized();
-     107            8 :     await keyChain.delete(publicKey);
-     108              :   }
-     109              : 
-     110            6 :   @override
-     111              :   Future<void> deleteSymKey(String topic) async {
-     112            6 :     _checkInitialized();
-     113           12 :     await keyChain.delete(topic);
-     114              :   }
-     115              : 
-     116            7 :   @override
-     117              :   Future<String?> encode(
-     118              :     String topic,
-     119              :     Map<String, dynamic> payload, {
-     120              :     EncodeOptions? options,
-     121              :   }) async {
-     122            7 :     _checkInitialized();
-     123              : 
-     124              :     EncodingValidation params;
-     125              :     if (options == null) {
-     126           14 :       params = utils.validateEncoding();
-     127              :     } else {
-     128            4 :       params = utils.validateEncoding(
-     129            2 :         type: options.type,
-     130            2 :         senderPublicKey: options.senderPublicKey,
-     131            2 :         receiverPublicKey: options.receiverPublicKey,
-     132              :       );
-     133              :     }
-     134              : 
-     135            7 :     final String message = jsonEncode(payload);
-     136              : 
-     137           14 :     if (utils.isTypeOneEnvelope(params)) {
-     138            2 :       final String selfPublicKey = params.senderPublicKey!;
-     139            2 :       final String peerPublicKey = params.receiverPublicKey!;
-     140            2 :       topic = await generateSharedKey(selfPublicKey, peerPublicKey);
-     141              :     }
-     142              : 
-     143            7 :     final String? symKey = _getSymKey(topic);
-     144              :     if (symKey == null) {
-     145              :       return null;
-     146              :     }
-     147              : 
-     148           14 :     final String result = await utils.encrypt(
-     149              :       message,
-     150              :       symKey,
-     151            7 :       type: params.type,
-     152            7 :       senderPublicKey: params.senderPublicKey,
-     153              :     );
-     154              : 
-     155              :     return result;
-     156              :   }
-     157              : 
-     158            7 :   @override
-     159              :   Future<String?> decode(
-     160              :     String topic,
-     161              :     String encoded, {
-     162              :     DecodeOptions? options,
-     163              :   }) async {
-     164            7 :     _checkInitialized();
-     165              : 
-     166           14 :     final EncodingValidation params = utils.validateDecoding(
-     167              :       encoded,
-     168            6 :       receiverPublicKey: options?.receiverPublicKey,
-     169              :     );
-     170              : 
-     171           14 :     if (utils.isTypeOneEnvelope(params)) {
-     172            2 :       final String selfPublicKey = params.receiverPublicKey!;
-     173            2 :       final String peerPublicKey = params.senderPublicKey!;
-     174            2 :       topic = await generateSharedKey(selfPublicKey, peerPublicKey);
-     175              :     }
-     176            7 :     final String? symKey = _getSymKey(topic);
-     177              :     if (symKey == null) {
-     178              :       return null;
-     179              :     }
-     180              : 
-     181           14 :     final String message = await utils.decrypt(symKey, encoded);
-     182              : 
-     183              :     return message;
-     184              :   }
-     185              : 
-     186            9 :   @override
-     187              :   Future<String> signJWT(String aud) async {
-     188            9 :     _checkInitialized();
-     189              : 
-     190            9 :     final Uint8List seed = await _getClientSeed();
-     191           18 :     final RelayAuthKeyPair keyPair = await relayAuth.generateKeyPair(seed);
-     192           18 :     final String sub = utils.generateRandomBytes32();
-     193           18 :     final jwt = await relayAuth.signJWT(
-     194              :       sub: sub,
-     195              :       aud: aud,
-     196              :       ttl: WalletConnectConstants.ONE_DAY,
-     197              :       keyPair: keyPair,
-     198              :     );
-     199              :     return jwt;
-     200              :   }
-     201              : 
-     202            0 :   @override
-     203              :   int getPayloadType(String encoded) {
-     204            0 :     _checkInitialized();
-     205              : 
-     206            0 :     return utils.deserialize(encoded).type;
-     207              :   }
-     208              : 
-     209              :   // PRIVATE FUNCTIONS
-     210              : 
-     211            6 :   Future<String> _setPrivateKey(CryptoKeyPair keyPair) async {
-     212           24 :     await keyChain.set(keyPair.publicKey, keyPair.privateKey);
-     213            6 :     return keyPair.publicKey;
-     214              :   }
-     215              : 
-     216            6 :   String? _getPrivateKey(String publicKey) {
-     217           12 :     return keyChain.get(publicKey);
-     218              :   }
-     219              : 
-     220            7 :   String? _getSymKey(String topic) {
-     221              :     // print('crypto getSymKey: $topic');
-     222           14 :     return keyChain.get(topic);
-     223              :   }
-     224              : 
-     225              :   // Future<String> _getClientKeyFromSeed() async {
-     226              :   //   // Get the seed
-     227              :   //   String seed = await _getClientSeed();
-     228              : 
-     229              :   //   String pubKey = keyChain.get(seed);
-     230              :   //   if (pubKey == '') {
-     231              :   //     pubKey = await generateKeyPair();
-     232              :   //     await keyChain.set(seed, pubKey);
-     233              :   //   }
-     234              : 
-     235              :   //   return pubKey;
-     236              :   // }
-     237              : 
-     238            9 :   Future<Uint8List> _getClientSeed() async {
-     239           18 :     String? seed = keyChain.get(clientSeed);
-     240              :     if (seed == null) {
-     241           18 :       seed = utils.generateRandomBytes32();
-     242           18 :       await keyChain.set(clientSeed, seed);
-     243              :     }
-     244              : 
-     245           18 :     return Uint8List.fromList(hex.decode(seed));
-     246              :   }
-     247              : 
-     248           10 :   void _checkInitialized() {
-     249           10 :     if (!_initialized) {
-     250            1 :       throw Errors.getInternalError(Errors.NOT_INITIALIZED);
-     251              :     }
-     252              :   }
-     253              : 
-     254            7 :   @override
-     255              :   ICryptoUtils getUtils() {
-     256            7 :     return utils;
-     257              :   }
-     258              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/crypto/crypto_models.dart.func-c.html b/coverage/html/core/crypto/crypto_models.dart.func-c.html deleted file mode 100644 index b6a7d772..00000000 --- a/coverage/html/core/crypto/crypto_models.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/crypto/crypto_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/crypto - crypto_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:50.0 %105
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/crypto/crypto_models.dart.func.html b/coverage/html/core/crypto/crypto_models.dart.func.html deleted file mode 100644 index 44e29f08..00000000 --- a/coverage/html/core/crypto/crypto_models.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/crypto/crypto_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/crypto - crypto_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:50.0 %105
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/crypto/crypto_models.dart.gcov.html b/coverage/html/core/crypto/crypto_models.dart.gcov.html deleted file mode 100644 index 7352f6b6..00000000 --- a/coverage/html/core/crypto/crypto_models.dart.gcov.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - LCOV - lcov.info - core/crypto/crypto_models.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/crypto - crypto_models.dartCoverageTotalHit
Test:lcov.infoLines:50.0 %105
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:typed_data';
-       2              : 
-       3              : import 'package:convert/convert.dart';
-       4              : 
-       5              : class CryptoKeyPair {
-       6              :   final String privateKey;
-       7              :   final String publicKey;
-       8              : 
-       9           22 :   const CryptoKeyPair(this.privateKey, this.publicKey);
-      10              : 
-      11            0 :   Uint8List getPrivateKeyBytes() {
-      12            0 :     return Uint8List.fromList(hex.decode(privateKey));
-      13              :   }
-      14              : 
-      15            0 :   Uint8List getPublicKeyBytes() {
-      16            0 :     return Uint8List.fromList(hex.decode(publicKey));
-      17              :   }
-      18              : }
-      19              : 
-      20              : class EncryptParams {
-      21              :   String message;
-      22              :   String symKey;
-      23              :   int? type;
-      24              :   String? iv;
-      25              :   String? senderPublicKey;
-      26              : 
-      27            0 :   EncryptParams(
-      28              :     this.message,
-      29              :     this.symKey, {
-      30              :     this.type,
-      31              :     this.iv,
-      32              :     this.senderPublicKey,
-      33              :   });
-      34              : }
-      35              : 
-      36              : class EncodingParams {
-      37              :   int type;
-      38              :   Uint8List sealed;
-      39              :   Uint8List iv;
-      40              :   Uint8List ivSealed;
-      41              :   Uint8List? senderPublicKey;
-      42              : 
-      43            7 :   EncodingParams(
-      44              :     this.type,
-      45              :     this.sealed,
-      46              :     this.iv,
-      47              :     this.ivSealed, {
-      48              :     this.senderPublicKey,
-      49              :   });
-      50              : }
-      51              : 
-      52              : class EncodingValidation {
-      53              :   int type;
-      54              :   String? senderPublicKey;
-      55              :   String? receiverPublicKey;
-      56              : 
-      57            7 :   EncodingValidation(
-      58              :     this.type, {
-      59              :     this.senderPublicKey,
-      60              :     this.receiverPublicKey,
-      61              :   });
-      62              : }
-      63              : 
-      64              : class EncodeOptions {
-      65              :   static const TYPE_0 = 0;
-      66              :   static const TYPE_1 = 1;
-      67              : 
-      68              :   int? type;
-      69              :   String? senderPublicKey;
-      70              :   String? receiverPublicKey;
-      71              : 
-      72            2 :   EncodeOptions({
-      73              :     this.type,
-      74              :     this.senderPublicKey,
-      75              :     this.receiverPublicKey,
-      76              :   });
-      77              : }
-      78              : 
-      79              : class DecodeOptions {
-      80              :   String? receiverPublicKey;
-      81              : 
-      82            6 :   DecodeOptions({
-      83              :     this.receiverPublicKey,
-      84              :   });
-      85              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/crypto/crypto_utils.dart.func-c.html b/coverage/html/core/crypto/crypto_utils.dart.func-c.html deleted file mode 100644 index 964b663f..00000000 --- a/coverage/html/core/crypto/crypto_utils.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/crypto/crypto_utils.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/crypto - crypto_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %8383
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/crypto/crypto_utils.dart.func.html b/coverage/html/core/crypto/crypto_utils.dart.func.html deleted file mode 100644 index 664030ba..00000000 --- a/coverage/html/core/crypto/crypto_utils.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/crypto/crypto_utils.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/crypto - crypto_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %8383
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/crypto/crypto_utils.dart.gcov.html b/coverage/html/core/crypto/crypto_utils.dart.gcov.html deleted file mode 100644 index 93f9bb6a..00000000 --- a/coverage/html/core/crypto/crypto_utils.dart.gcov.html +++ /dev/null @@ -1,323 +0,0 @@ - - - - - - - LCOV - lcov.info - core/crypto/crypto_utils.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/crypto - crypto_utils.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %8383
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:convert';
-       2              : import 'dart:math';
-       3              : import 'dart:typed_data';
-       4              : 
-       5              : import 'package:convert/convert.dart';
-       6              : import 'package:cryptography/cryptography.dart' as dc;
-       7              : import 'package:pointycastle/digests/sha256.dart';
-       8              : import 'package:pointycastle/key_derivators/hkdf.dart';
-       9              : import 'package:pointycastle/pointycastle.dart' show HkdfParameters;
-      10              : import 'package:walletconnect_flutter_v2/apis/core/crypto/crypto_models.dart';
-      11              : import 'package:walletconnect_flutter_v2/apis/core/crypto/i_crypto_utils.dart';
-      12              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
-      13              : import 'package:x25519/x25519.dart' as x;
-      14              : 
-      15              : class CryptoUtils extends ICryptoUtils {
-      16           30 :   static final _random = Random.secure();
-      17              : 
-      18              :   static const IV_LENGTH = 12;
-      19              :   static const KEY_LENGTH = 32;
-      20              : 
-      21              :   static const TYPE_LENGTH = 1;
-      22              : 
-      23            6 :   @override
-      24              :   CryptoKeyPair generateKeyPair() {
-      25            6 :     final kp = x.generateKeyPair();
-      26              : 
-      27            6 :     return CryptoKeyPair(
-      28           12 :       hex.encode(kp.privateKey),
-      29           12 :       hex.encode(kp.publicKey),
-      30              :     );
-      31              :   }
-      32              : 
-      33           10 :   @override
-      34              :   Uint8List randomBytes(int length) {
-      35           10 :     final Uint8List random = Uint8List(length);
-      36           20 :     for (int i = 0; i < length; i++) {
-      37           30 :       random[i] = _random.nextInt(256);
-      38              :     }
-      39              :     return random;
-      40              :   }
-      41              : 
-      42           10 :   @override
-      43              :   String generateRandomBytes32() {
-      44           20 :     return hex.encode(randomBytes(32));
-      45              :   }
-      46              : 
-      47            6 :   @override
-      48              :   Future<String> deriveSymKey(String privKeyA, String pubKeyB) async {
-      49            6 :     final Uint8List sharedKey1 = x.X25519(
-      50            6 :       hex.decode(privKeyA),
-      51            6 :       hex.decode(pubKeyB),
-      52              :     );
-      53              : 
-      54            6 :     Uint8List out = Uint8List(KEY_LENGTH);
-      55              : 
-      56           12 :     final HKDFKeyDerivator hkdf = HKDFKeyDerivator(SHA256Digest());
-      57            6 :     final HkdfParameters params = HkdfParameters(
-      58              :       sharedKey1,
-      59              :       KEY_LENGTH,
-      60              :     );
-      61            6 :     hkdf.init(params);
-      62              :     // final pc.KeyParameter keyParam = hkdf.extract(null, sharedKey1);
-      63            6 :     hkdf.deriveKey(null, 0, out, 0);
-      64            6 :     return hex.encode(out);
-      65              :   }
-      66              : 
-      67            8 :   @override
-      68              :   String hashKey(String key) {
-      69            8 :     return hex.encode(
-      70           16 :       SHA256Digest().process(
-      71            8 :         Uint8List.fromList(
-      72            8 :           hex.decode(key),
-      73              :         ),
-      74              :       ),
-      75              :     );
-      76              :     // return hex.encode(Hash.sha256(hex.decode(key)));
-      77              :   }
-      78              : 
-      79            5 :   @override
-      80              :   String hashMessage(String message) {
-      81            5 :     return hex.encode(
-      82           10 :       SHA256Digest().process(
-      83            5 :         Uint8List.fromList(
-      84            5 :           utf8.encode(message),
-      85              :         ),
-      86              :       ),
-      87              :     );
-      88              :   }
-      89              : 
-      90            7 :   @override
-      91              :   Future<String> encrypt(
-      92              :     String message,
-      93              :     String symKey, {
-      94              :     int? type,
-      95              :     String? iv,
-      96              :     String? senderPublicKey,
-      97              :   }) async {
-      98              :     final int decodedType = type ?? EncodeOptions.TYPE_0;
-      99              :     // print(message);
-     100              :     // print(symKey);
-     101              : 
-     102              :     // Check for type 1 envelope, throw an error if data is invalid
-     103            7 :     if (decodedType == EncodeOptions.TYPE_1 && senderPublicKey == null) {
-     104              :       throw const WalletConnectError(
-     105              :         code: -1,
-     106              :         message: 'Missing sender public key for type 1 envelope',
-     107              :       );
-     108              :     }
-     109              : 
-     110              :     // final String senderPublicKey = senderPublicKey !=
-     111              :     final Uint8List usedIV =
-     112            8 :         (iv != null ? hex.decode(iv) : randomBytes(IV_LENGTH)) as Uint8List;
-     113              : 
-     114            7 :     final chacha = dc.Chacha20.poly1305Aead();
-     115            7 :     dc.SecretBox b = await chacha.encrypt(
-     116            7 :       utf8.encode(message),
-     117            7 :       secretKey: dc.SecretKey(
-     118            7 :         hex.decode(symKey),
-     119              :       ),
-     120              :       nonce: usedIV,
-     121              :     );
-     122              : 
-     123            7 :     return serialize(
-     124              :       decodedType,
-     125            7 :       b.concatenation(),
-     126              :       usedIV,
-     127              :       senderPublicKey: senderPublicKey != null
-     128            3 :           ? hex.decode(senderPublicKey) as Uint8List
-     129              :           : null,
-     130              :     );
-     131              :   }
-     132              : 
-     133            7 :   @override
-     134              :   Future<String> decrypt(String symKey, String encoded) async {
-     135            7 :     final chacha = dc.Chacha20.poly1305Aead();
-     136            7 :     final dc.SecretKey secretKey = dc.SecretKey(
-     137            7 :       hex.decode(symKey),
-     138              :     );
-     139            7 :     final EncodingParams encodedData = deserialize(encoded);
-     140            7 :     final dc.SecretBox b = dc.SecretBox.fromConcatenation(
-     141            7 :       encodedData.ivSealed,
-     142              :       nonceLength: 12,
-     143              :       macLength: 16,
-     144              :     );
-     145            7 :     List<int> data = await chacha.decrypt(b, secretKey: secretKey);
-     146            7 :     return utf8.decode(data);
-     147              :   }
-     148              : 
-     149            7 :   @override
-     150              :   String serialize(
-     151              :     int type,
-     152              :     Uint8List sealed,
-     153              :     Uint8List iv, {
-     154              :     Uint8List? senderPublicKey,
-     155              :   }) {
-     156            7 :     List<int> l = [type];
-     157              : 
-     158            7 :     if (type == EncodeOptions.TYPE_1) {
-     159              :       if (senderPublicKey == null) {
-     160              :         throw const WalletConnectError(
-     161              :           code: -1,
-     162              :           message: 'Missing sender public key for type 1 envelope',
-     163              :         );
-     164              :       }
-     165              : 
-     166            3 :       l.addAll(senderPublicKey);
-     167              :     }
-     168              : 
-     169              :     // l.addAll(iv);
-     170            7 :     l.addAll(sealed);
-     171              : 
-     172            7 :     return base64Encode(l);
-     173              :   }
-     174              : 
-     175            7 :   @override
-     176              :   EncodingParams deserialize(String encoded) {
-     177            7 :     final Uint8List bytes = base64Decode(encoded);
-     178            7 :     final int type = bytes[0];
-     179              : 
-     180              :     int index = TYPE_LENGTH;
-     181              :     Uint8List? senderPublicKey;
-     182            7 :     if (type == EncodeOptions.TYPE_1) {
-     183            3 :       senderPublicKey = bytes.sublist(
-     184              :         index,
-     185            3 :         index + KEY_LENGTH,
-     186              :       );
-     187            3 :       index += KEY_LENGTH;
-     188              :     }
-     189           14 :     Uint8List iv = bytes.sublist(index, index + IV_LENGTH);
-     190            7 :     Uint8List ivSealed = bytes.sublist(index);
-     191            7 :     index += IV_LENGTH;
-     192            7 :     Uint8List sealed = bytes.sublist(index);
-     193              : 
-     194            7 :     return EncodingParams(
-     195              :       type,
-     196              :       sealed,
-     197              :       iv,
-     198              :       ivSealed,
-     199              :       senderPublicKey: senderPublicKey,
-     200              :     );
-     201              :   }
-     202              : 
-     203            7 :   @override
-     204              :   EncodingValidation validateDecoding(
-     205              :     String encoded, {
-     206              :     String? receiverPublicKey,
-     207              :   }) {
-     208            7 :     final EncodingParams deserialized = deserialize(encoded);
-     209            7 :     final String? senderPublicKey = deserialized.senderPublicKey != null
-     210            6 :         ? hex.encode(deserialized.senderPublicKey!)
-     211              :         : null;
-     212            7 :     return validateEncoding(
-     213            7 :       type: deserialized.type,
-     214              :       senderPublicKey: senderPublicKey,
-     215              :       receiverPublicKey: receiverPublicKey,
-     216              :     );
-     217              :   }
-     218              : 
-     219            7 :   @override
-     220              :   EncodingValidation validateEncoding({
-     221              :     int? type,
-     222              :     String? senderPublicKey,
-     223              :     String? receiverPublicKey,
-     224              :   }) {
-     225              :     final int t = type ?? EncodeOptions.TYPE_0;
-     226            7 :     if (t == EncodeOptions.TYPE_1) {
-     227              :       if (senderPublicKey == null) {
-     228              :         throw const WalletConnectError(
-     229              :             code: -1, message: 'Missing sender public key');
-     230              :       }
-     231              :       if (receiverPublicKey == null) {
-     232              :         throw const WalletConnectError(
-     233              :             code: -1, message: 'Missing receiver public key');
-     234              :       }
-     235              :     }
-     236            7 :     return EncodingValidation(
-     237              :       t,
-     238              :       senderPublicKey: senderPublicKey,
-     239              :       receiverPublicKey: receiverPublicKey,
-     240              :     );
-     241              :   }
-     242              : 
-     243            7 :   @override
-     244              :   bool isTypeOneEnvelope(
-     245              :     EncodingValidation result,
-     246              :   ) {
-     247           14 :     return result.type == EncodeOptions.TYPE_1 &&
-     248            3 :         result.senderPublicKey != null &&
-     249            3 :         result.receiverPublicKey != null;
-     250              :   }
-     251              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/crypto/index-sort-f.html b/coverage/html/core/crypto/index-sort-f.html deleted file mode 100644 index c179cdd0..00000000 --- a/coverage/html/core/crypto/index-sort-f.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - LCOV - lcov.info - core/crypto - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/cryptoCoverageTotalHit
Test:lcov.infoLines:90.6 %180163
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
crypto.dart -
86.2%86.2%
-
86.2 %8775-
crypto_models.dart -
50.0%50.0%
-
50.0 %105-
crypto_utils.dart -
100.0%
-
100.0 %8383-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/crypto/index-sort-l.html b/coverage/html/core/crypto/index-sort-l.html deleted file mode 100644 index ab3f42b3..00000000 --- a/coverage/html/core/crypto/index-sort-l.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - LCOV - lcov.info - core/crypto - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/cryptoCoverageTotalHit
Test:lcov.infoLines:90.6 %180163
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
crypto_models.dart -
50.0%50.0%
-
50.0 %105
crypto.dart -
86.2%86.2%
-
86.2 %8775
crypto_utils.dart -
100.0%
-
100.0 %8383
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/crypto/index.html b/coverage/html/core/crypto/index.html deleted file mode 100644 index 7788838f..00000000 --- a/coverage/html/core/crypto/index.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - LCOV - lcov.info - core/crypto - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/cryptoCoverageTotalHit
Test:lcov.infoLines:90.6 %180163
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
crypto.dart -
86.2%86.2%
-
86.2 %8775
crypto_models.dart -
50.0%50.0%
-
50.0 %105
crypto_utils.dart -
100.0%
-
100.0 %8383
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/echo/echo.dart.func-c.html b/coverage/html/core/echo/echo.dart.func-c.html deleted file mode 100644 index 95be6f5e..00000000 --- a/coverage/html/core/echo/echo.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/echo/echo.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/echo - echo.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:88.2 %1715
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/echo/echo.dart.func.html b/coverage/html/core/echo/echo.dart.func.html deleted file mode 100644 index a8a531c8..00000000 --- a/coverage/html/core/echo/echo.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/echo/echo.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/echo - echo.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:88.2 %1715
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/echo/echo.dart.gcov.html b/coverage/html/core/echo/echo.dart.gcov.html deleted file mode 100644 index ccfe5963..00000000 --- a/coverage/html/core/echo/echo.dart.gcov.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - LCOV - lcov.info - core/echo/echo.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/echo - echo.dartCoverageTotalHit
Test:lcov.infoLines:88.2 %1715
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:walletconnect_flutter_v2/apis/core/echo/i_echo.dart';
-       2              : import 'package:walletconnect_flutter_v2/apis/core/echo/i_echo_client.dart';
-       3              : import 'package:walletconnect_flutter_v2/apis/core/i_core.dart';
-       4              : 
-       5              : class Echo implements IEcho {
-       6              :   static const SUCCESS_STATUS = 'SUCCESS';
-       7              :   final ICore core;
-       8              :   final IEchoClient echoClient;
-       9              : 
-      10           11 :   Echo({required this.core, required this.echoClient});
-      11              : 
-      12            1 :   @override
-      13              :   Future<void> register(String firebaseAccessToken) async {
-      14            2 :     final projectId = core.projectId;
-      15            3 :     final clientId = await core.crypto.getClientId();
-      16            2 :     final response = await echoClient.register(
-      17              :       projectId: projectId,
-      18              :       clientId: clientId,
-      19              :       firebaseAccessToken: firebaseAccessToken,
-      20              :     );
-      21              : 
-      22            2 :     if (response.status != SUCCESS_STATUS) {
-      23            3 :       if (response.errors != null && response.errors!.isNotEmpty) {
-      24            4 :         throw ArgumentError(response.errors!.first.message);
-      25              :       }
-      26              : 
-      27            0 :       throw Exception('Unknown error');
-      28              :     }
-      29              :   }
-      30              : 
-      31            1 :   @override
-      32              :   Future<void> unregister() async {
-      33            2 :     final projectId = core.projectId;
-      34            3 :     final clientId = await core.crypto.getClientId();
-      35            2 :     final response = await echoClient.unregister(
-      36              :       projectId: projectId,
-      37              :       clientId: clientId,
-      38              :     );
-      39              : 
-      40            2 :     if (response.status != SUCCESS_STATUS) {
-      41            3 :       if (response.errors != null && response.errors!.isNotEmpty) {
-      42            4 :         throw ArgumentError(response.errors!.first.message);
-      43              :       }
-      44              : 
-      45            0 :       throw Exception('Unknown error');
-      46              :     }
-      47              :   }
-      48              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/echo/echo_client.dart.func-c.html b/coverage/html/core/echo/echo_client.dart.func-c.html deleted file mode 100644 index 60067cb5..00000000 --- a/coverage/html/core/echo/echo_client.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/echo/echo_client.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/echo - echo_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %1313
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/echo/echo_client.dart.func.html b/coverage/html/core/echo/echo_client.dart.func.html deleted file mode 100644 index 941b8213..00000000 --- a/coverage/html/core/echo/echo_client.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/echo/echo_client.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/echo - echo_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %1313
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/echo/echo_client.dart.gcov.html b/coverage/html/core/echo/echo_client.dart.gcov.html deleted file mode 100644 index 59b3d006..00000000 --- a/coverage/html/core/echo/echo_client.dart.gcov.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - LCOV - lcov.info - core/echo/echo_client.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/echo - echo_client.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %1313
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:convert';
-       2              : 
-       3              : import 'package:http/http.dart' as http;
-       4              : import 'package:walletconnect_flutter_v2/apis/core/echo/i_echo_client.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/core/echo/models/echo_body.dart';
-       6              : import 'package:walletconnect_flutter_v2/apis/core/echo/models/echo_response.dart';
-       7              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/i_http_client.dart';
-       8              : 
-       9              : class EchoClient implements IEchoClient {
-      10              :   static const headers = {'Content-Type': 'application/json'};
-      11              :   final IHttpClient httpClient;
-      12              :   final String baseUrl;
-      13              : 
-      14           11 :   EchoClient({required this.baseUrl, required this.httpClient});
-      15              : 
-      16            1 :   @override
-      17              :   Future<EchoResponse> register({
-      18              :     required String projectId,
-      19              :     required String clientId,
-      20              :     required String firebaseAccessToken,
-      21              :   }) async {
-      22            1 :     final body = EchoBody(clientId: clientId, token: firebaseAccessToken);
-      23              : 
-      24            3 :     final url = Uri.parse('$baseUrl/$projectId/clients?auth=$clientId');
-      25            2 :     final http.Response response = await httpClient.post(
-      26              :       url,
-      27              :       headers: headers,
-      28            2 :       body: jsonEncode(body.toJson()),
-      29              :     );
-      30              : 
-      31            2 :     final jsonMap = json.decode(response.body);
-      32            1 :     return EchoResponse.fromJson(jsonMap);
-      33              :   }
-      34              : 
-      35            1 :   @override
-      36              :   Future<EchoResponse> unregister({
-      37              :     required String projectId,
-      38              :     required String clientId,
-      39              :   }) async {
-      40            3 :     final url = Uri.parse('$baseUrl/$projectId/clients/$clientId');
-      41              :     final http.Response response =
-      42            2 :         await httpClient.delete(url, headers: headers);
-      43              : 
-      44            2 :     final jsonMap = json.decode(response.body);
-      45            1 :     return EchoResponse.fromJson(jsonMap);
-      46              :   }
-      47              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/echo/index-sort-f.html b/coverage/html/core/echo/index-sort-f.html deleted file mode 100644 index fd52e9f6..00000000 --- a/coverage/html/core/echo/index-sort-f.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - LCOV - lcov.info - core/echo - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/echoCoverageTotalHit
Test:lcov.infoLines:93.3 %3028
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
echo.dart -
88.2%88.2%
-
88.2 %1715-
echo_client.dart -
100.0%
-
100.0 %1313-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/echo/index-sort-l.html b/coverage/html/core/echo/index-sort-l.html deleted file mode 100644 index f0cb662f..00000000 --- a/coverage/html/core/echo/index-sort-l.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - LCOV - lcov.info - core/echo - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/echoCoverageTotalHit
Test:lcov.infoLines:93.3 %3028
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
echo.dart -
88.2%88.2%
-
88.2 %1715
echo_client.dart -
100.0%
-
100.0 %1313
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/echo/index.html b/coverage/html/core/echo/index.html deleted file mode 100644 index b60e9c16..00000000 --- a/coverage/html/core/echo/index.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - LCOV - lcov.info - core/echo - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/echoCoverageTotalHit
Test:lcov.infoLines:93.3 %3028
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
echo.dart -
88.2%88.2%
-
88.2 %1715
echo_client.dart -
100.0%
-
100.0 %1313
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/echo/models/echo_body.dart.func-c.html b/coverage/html/core/echo/models/echo_body.dart.func-c.html deleted file mode 100644 index fcad873d..00000000 --- a/coverage/html/core/echo/models/echo_body.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/echo/models/echo_body.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/echo/models - echo_body.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:50.0 %42
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/echo/models/echo_body.dart.func.html b/coverage/html/core/echo/models/echo_body.dart.func.html deleted file mode 100644 index 22c00c55..00000000 --- a/coverage/html/core/echo/models/echo_body.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/echo/models/echo_body.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/echo/models - echo_body.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:50.0 %42
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/echo/models/echo_body.dart.gcov.html b/coverage/html/core/echo/models/echo_body.dart.gcov.html deleted file mode 100644 index 99b01738..00000000 --- a/coverage/html/core/echo/models/echo_body.dart.gcov.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - LCOV - lcov.info - core/echo/models/echo_body.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/echo/models - echo_body.dartCoverageTotalHit
Test:lcov.infoLines:50.0 %42
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:json_annotation/json_annotation.dart';
-       2              : 
-       3              : part 'echo_body.g.dart';
-       4              : 
-       5              : @JsonSerializable(fieldRename: FieldRename.snake)
-       6              : class EchoBody {
-       7              :   final String clientId;
-       8              :   final String token;
-       9              :   final String type;
-      10              : 
-      11            1 :   EchoBody({
-      12              :     required this.clientId,
-      13              :     required this.token,
-      14              :     this.type = 'fcm',
-      15              :   });
-      16              : 
-      17            0 :   factory EchoBody.fromJson(Map<String, dynamic> json) =>
-      18            0 :       _$EchoBodyFromJson(json);
-      19              : 
-      20            2 :   Map<String, dynamic> toJson() => _$EchoBodyToJson(this);
-      21              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/echo/models/echo_response.dart.func-c.html b/coverage/html/core/echo/models/echo_response.dart.func-c.html deleted file mode 100644 index b25c49ba..00000000 --- a/coverage/html/core/echo/models/echo_response.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/echo/models/echo_response.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/echo/models - echo_response.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:72.7 %118
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/echo/models/echo_response.dart.func.html b/coverage/html/core/echo/models/echo_response.dart.func.html deleted file mode 100644 index 4519efdd..00000000 --- a/coverage/html/core/echo/models/echo_response.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/echo/models/echo_response.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/echo/models - echo_response.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:72.7 %118
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/echo/models/echo_response.dart.gcov.html b/coverage/html/core/echo/models/echo_response.dart.gcov.html deleted file mode 100644 index 455f0318..00000000 --- a/coverage/html/core/echo/models/echo_response.dart.gcov.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - LCOV - lcov.info - core/echo/models/echo_response.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/echo/models - echo_response.dartCoverageTotalHit
Test:lcov.infoLines:72.7 %118
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:json_annotation/json_annotation.dart';
-       2              : 
-       3              : part 'echo_response.g.dart';
-       4              : 
-       5              : @JsonSerializable(fieldRename: FieldRename.snake)
-       6              : class EchoResponse {
-       7              :   final List<ResponseError>? errors;
-       8              :   final List<Field>? fields;
-       9              :   final String status;
-      10              : 
-      11            1 :   EchoResponse({
-      12              :     this.errors,
-      13              :     this.fields,
-      14              :     required this.status,
-      15              :   });
-      16              : 
-      17            1 :   factory EchoResponse.fromJson(Map<String, dynamic> json) =>
-      18            1 :       _$EchoResponseFromJson(json);
-      19              : 
-      20            0 :   Map<String, dynamic> toJson() => _$EchoResponseToJson(this);
-      21              : }
-      22              : 
-      23              : @JsonSerializable(fieldRename: FieldRename.snake)
-      24              : class ResponseError {
-      25              :   final String message;
-      26              :   final String name;
-      27              : 
-      28            1 :   ResponseError({required this.message, required this.name});
-      29              : 
-      30            1 :   factory ResponseError.fromJson(Map<String, dynamic> json) =>
-      31            1 :       _$ResponseErrorFromJson(json);
-      32              : 
-      33            0 :   Map<String, dynamic> toJson() => _$ResponseErrorToJson(this);
-      34              : }
-      35              : 
-      36              : @JsonSerializable(fieldRename: FieldRename.snake)
-      37              : class Field {
-      38              :   final String description;
-      39              :   final String field;
-      40              :   final String location;
-      41              : 
-      42            1 :   Field({
-      43              :     required this.description,
-      44              :     required this.field,
-      45              :     required this.location,
-      46              :   });
-      47              : 
-      48            2 :   factory Field.fromJson(Map<String, dynamic> json) => _$FieldFromJson(json);
-      49              : 
-      50            0 :   Map<String, dynamic> toJson() => _$FieldToJson(this);
-      51              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/echo/models/index-sort-f.html b/coverage/html/core/echo/models/index-sort-f.html deleted file mode 100644 index b9323b45..00000000 --- a/coverage/html/core/echo/models/index-sort-f.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - LCOV - lcov.info - core/echo/models - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/echo/modelsCoverageTotalHit
Test:lcov.infoLines:66.7 %1510
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
echo_body.dart -
50.0%50.0%
-
50.0 %42-
echo_response.dart -
72.7%72.7%
-
72.7 %118-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/echo/models/index-sort-l.html b/coverage/html/core/echo/models/index-sort-l.html deleted file mode 100644 index e4f3b175..00000000 --- a/coverage/html/core/echo/models/index-sort-l.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - LCOV - lcov.info - core/echo/models - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/echo/modelsCoverageTotalHit
Test:lcov.infoLines:66.7 %1510
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
echo_body.dart -
50.0%50.0%
-
50.0 %42
echo_response.dart -
72.7%72.7%
-
72.7 %118
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/echo/models/index.html b/coverage/html/core/echo/models/index.html deleted file mode 100644 index b7c8864c..00000000 --- a/coverage/html/core/echo/models/index.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - LCOV - lcov.info - core/echo/models - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/echo/modelsCoverageTotalHit
Test:lcov.infoLines:66.7 %1510
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
echo_body.dart -
50.0%50.0%
-
50.0 %42
echo_response.dart -
72.7%72.7%
-
72.7 %118
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/heartbit/heartbeat.dart.func-c.html b/coverage/html/core/heartbit/heartbeat.dart.func-c.html deleted file mode 100644 index cbdfc6b4..00000000 --- a/coverage/html/core/heartbit/heartbeat.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/heartbit/heartbeat.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/heartbit - heartbeat.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:66.7 %96
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/heartbit/heartbeat.dart.func.html b/coverage/html/core/heartbit/heartbeat.dart.func.html deleted file mode 100644 index df62e08b..00000000 --- a/coverage/html/core/heartbit/heartbeat.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/heartbit/heartbeat.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/heartbit - heartbeat.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:66.7 %96
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/heartbit/heartbeat.dart.gcov.html b/coverage/html/core/heartbit/heartbeat.dart.gcov.html deleted file mode 100644 index 6a728a27..00000000 --- a/coverage/html/core/heartbit/heartbeat.dart.gcov.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - LCOV - lcov.info - core/heartbit/heartbeat.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/heartbit - heartbeat.dartCoverageTotalHit
Test:lcov.infoLines:66.7 %96
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:async';
-       2              : 
-       3              : import 'package:event/event.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/core/heartbit/i_heartbeat.dart';
-       5              : 
-       6              : class HeartBeat implements IHeartBeat {
-       7              :   Timer? _heartbeatTimer;
-       8              : 
-       9              :   @override
-      10              :   int interval;
-      11              : 
-      12           10 :   HeartBeat({this.interval = 5});
-      13              : 
-      14            9 :   @override
-      15              :   void init() {
-      16            9 :     if (_heartbeatTimer != null) return;
-      17           18 :     _heartbeatTimer = Timer.periodic(
-      18           18 :       Duration(seconds: interval),
-      19           18 :       (timer) => onPulse.broadcast(),
-      20              :     );
-      21              :   }
-      22              : 
-      23            0 :   @override
-      24              :   void stop() {
-      25            0 :     _heartbeatTimer?.cancel();
-      26            0 :     _heartbeatTimer = null;
-      27              :   }
-      28              : 
-      29              :   @override
-      30              :   final Event<EventArgs> onPulse = Event();
-      31              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/heartbit/index-sort-f.html b/coverage/html/core/heartbit/index-sort-f.html deleted file mode 100644 index 06aa4960..00000000 --- a/coverage/html/core/heartbit/index-sort-f.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - LCOV - lcov.info - core/heartbit - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/heartbitCoverageTotalHit
Test:lcov.infoLines:66.7 %96
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
heartbeat.dart -
66.7%66.7%
-
66.7 %96-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/heartbit/index-sort-l.html b/coverage/html/core/heartbit/index-sort-l.html deleted file mode 100644 index c779ba3d..00000000 --- a/coverage/html/core/heartbit/index-sort-l.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - LCOV - lcov.info - core/heartbit - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/heartbitCoverageTotalHit
Test:lcov.infoLines:66.7 %96
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
heartbeat.dart -
66.7%66.7%
-
66.7 %96
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/heartbit/index.html b/coverage/html/core/heartbit/index.html deleted file mode 100644 index ff323e89..00000000 --- a/coverage/html/core/heartbit/index.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - LCOV - lcov.info - core/heartbit - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/heartbitCoverageTotalHit
Test:lcov.infoLines:66.7 %96
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
heartbeat.dart -
66.7%66.7%
-
66.7 %96
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/index-sort-f.html b/coverage/html/core/index-sort-f.html deleted file mode 100644 index 3e1b0180..00000000 --- a/coverage/html/core/index-sort-f.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - LCOV - lcov.info - core - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - coreCoverageTotalHit
Test:lcov.infoLines:74.5 %5138
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
core.dart -
74.5%74.5%
-
74.5 %5138-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/index-sort-l.html b/coverage/html/core/index-sort-l.html deleted file mode 100644 index 701c0090..00000000 --- a/coverage/html/core/index-sort-l.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - LCOV - lcov.info - core - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - coreCoverageTotalHit
Test:lcov.infoLines:74.5 %5138
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
core.dart -
74.5%74.5%
-
74.5 %5138
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/index.html b/coverage/html/core/index.html deleted file mode 100644 index e34b4ac2..00000000 --- a/coverage/html/core/index.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - LCOV - lcov.info - core - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - coreCoverageTotalHit
Test:lcov.infoLines:74.5 %5138
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
core.dart -
74.5%74.5%
-
74.5 %5138
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/expirer.dart.func-c.html b/coverage/html/core/pairing/expirer.dart.func-c.html deleted file mode 100644 index e3e71c0e..00000000 --- a/coverage/html/core/pairing/expirer.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing/expirer.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairing - expirer.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:76.5 %1713
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/expirer.dart.func.html b/coverage/html/core/pairing/expirer.dart.func.html deleted file mode 100644 index da3aad6f..00000000 --- a/coverage/html/core/pairing/expirer.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing/expirer.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairing - expirer.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:76.5 %1713
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/expirer.dart.gcov.html b/coverage/html/core/pairing/expirer.dart.gcov.html deleted file mode 100644 index fee3ae31..00000000 --- a/coverage/html/core/pairing/expirer.dart.gcov.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing/expirer.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairing - expirer.dartCoverageTotalHit
Test:lcov.infoLines:76.5 %1713
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:event/event.dart';
-       2              : import 'package:walletconnect_flutter_v2/apis/core/pairing/i_expirer.dart';
-       3              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/pairing_models.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/core/store/generic_store.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/utils/walletconnect_utils.dart';
-       6              : 
-       7              : class Expirer extends GenericStore<int> implements IExpirer {
-       8              :   @override
-       9              :   final Event<ExpirationEvent> onExpire = Event();
-      10              : 
-      11           10 :   Expirer({
-      12              :     required super.storage,
-      13              :     required super.context,
-      14              :     required super.version,
-      15              :     required super.fromJson,
-      16              :   });
-      17              : 
-      18            0 :   @override
-      19              :   Future<bool> checkExpiry(String key, int expiry) async {
-      20            0 :     checkInitialized();
-      21              : 
-      22            0 :     if (WalletConnectUtils.isExpired(expiry)) {
-      23            0 :       await expire(key);
-      24              :       return true;
-      25              :     }
-      26              :     return false;
-      27              :   }
-      28              : 
-      29              :   /// Checks if the key has expired and deletes it if it has
-      30              :   /// Returns true if the key was deleted
-      31              :   /// Returns false if the key was not deleted
-      32            6 :   @override
-      33              :   Future<bool> checkAndExpire(String key) async {
-      34            6 :     checkInitialized();
-      35              : 
-      36           12 :     if (data.containsKey(key)) {
-      37           12 :       int expiration = data[key]!;
-      38            6 :       if (WalletConnectUtils.isExpired(expiration)) {
-      39            4 :         await expire(key);
-      40              :         return true;
-      41              :       }
-      42              :     }
-      43              : 
-      44              :     return false;
-      45              :   }
-      46              : 
-      47            4 :   @override
-      48              :   Future<void> expire(String key) async {
-      49            4 :     checkInitialized();
-      50              : 
-      51            8 :     int? expiry = data.remove(key);
-      52              :     if (expiry == null) {
-      53              :       return;
-      54              :     }
-      55              :     // print('Expiring $key');
-      56            8 :     onExpire.broadcast(
-      57            4 :       ExpirationEvent(
-      58              :         target: key,
-      59              :         expiry: expiry,
-      60              :       ),
-      61              :     );
-      62            4 :     await persist();
-      63              :   }
-      64              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/index-sort-f.html b/coverage/html/core/pairing/index-sort-f.html deleted file mode 100644 index 9521c990..00000000 --- a/coverage/html/core/pairing/index-sort-f.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairingCoverageTotalHit
Test:lcov.infoLines:89.1 %303270
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
expirer.dart -
76.5%76.5%
-
76.5 %1713-
json_rpc_history.dart -
91.7%91.7%
-
91.7 %1211-
pairing.dart -
89.5%89.5%
-
89.5 %266238-
pairing_store.dart -
100.0%
-
100.0 %88-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/index-sort-l.html b/coverage/html/core/pairing/index-sort-l.html deleted file mode 100644 index c66716f2..00000000 --- a/coverage/html/core/pairing/index-sort-l.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairingCoverageTotalHit
Test:lcov.infoLines:89.1 %303270
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
expirer.dart -
76.5%76.5%
-
76.5 %1713
pairing.dart -
89.5%89.5%
-
89.5 %266238
json_rpc_history.dart -
91.7%91.7%
-
91.7 %1211
pairing_store.dart -
100.0%
-
100.0 %88
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/index.html b/coverage/html/core/pairing/index.html deleted file mode 100644 index f7995060..00000000 --- a/coverage/html/core/pairing/index.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairingCoverageTotalHit
Test:lcov.infoLines:89.1 %303270
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
expirer.dart -
76.5%76.5%
-
76.5 %1713
json_rpc_history.dart -
91.7%91.7%
-
91.7 %1211
pairing.dart -
89.5%89.5%
-
89.5 %266238
pairing_store.dart -
100.0%
-
100.0 %88
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/json_rpc_history.dart.func-c.html b/coverage/html/core/pairing/json_rpc_history.dart.func-c.html deleted file mode 100644 index d500c7e4..00000000 --- a/coverage/html/core/pairing/json_rpc_history.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing/json_rpc_history.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairing - json_rpc_history.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:91.7 %1211
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/json_rpc_history.dart.func.html b/coverage/html/core/pairing/json_rpc_history.dart.func.html deleted file mode 100644 index ee21ab03..00000000 --- a/coverage/html/core/pairing/json_rpc_history.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing/json_rpc_history.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairing - json_rpc_history.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:91.7 %1211
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/json_rpc_history.dart.gcov.html b/coverage/html/core/pairing/json_rpc_history.dart.gcov.html deleted file mode 100644 index 8e215e39..00000000 --- a/coverage/html/core/pairing/json_rpc_history.dart.gcov.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing/json_rpc_history.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairing - json_rpc_history.dartCoverageTotalHit
Test:lcov.infoLines:91.7 %1211
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:walletconnect_flutter_v2/apis/core/pairing/i_json_rpc_history.dart';
-       2              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/pairing_models.dart';
-       3              : import 'package:walletconnect_flutter_v2/apis/core/store/generic_store.dart';
-       4              : 
-       5              : class JsonRpcHistory extends GenericStore<JsonRpcRecord>
-       6              :     implements IJsonRpcHistory {
-       7           11 :   JsonRpcHistory({
-       8              :     required super.storage,
-       9              :     required super.context,
-      10              :     required super.version,
-      11              :     required super.fromJson,
-      12              :   });
-      13              : 
-      14            1 :   @override
-      15              :   Future<void> resolve(Map<String, dynamic> response) async {
-      16            1 :     checkInitialized();
-      17              : 
-      18              :     // If we don't have a matching id, stop
-      19            2 :     String sId = response['id'].toString();
-      20            2 :     if (!data.containsKey(sId)) {
-      21              :       return;
-      22              :     }
-      23              : 
-      24            1 :     JsonRpcRecord record = get(sId)!;
-      25              : 
-      26              :     // If we already recorded a response, stop
-      27            1 :     if (record.response != null) {
-      28              :       return;
-      29              :     }
-      30              : 
-      31            2 :     record = record.copyWith(
-      32            1 :       response: response.containsKey('result')
-      33            1 :           ? response['result']
-      34            0 :           : response['error'],
-      35              :     );
-      36            1 :     await set(sId, record);
-      37              :   }
-      38              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/pairing.dart.func-c.html b/coverage/html/core/pairing/pairing.dart.func-c.html deleted file mode 100644 index e55a9469..00000000 --- a/coverage/html/core/pairing/pairing.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing/pairing.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairing - pairing.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:89.5 %266238
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/pairing.dart.func.html b/coverage/html/core/pairing/pairing.dart.func.html deleted file mode 100644 index 9e103990..00000000 --- a/coverage/html/core/pairing/pairing.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing/pairing.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairing - pairing.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:89.5 %266238
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/pairing.dart.gcov.html b/coverage/html/core/pairing/pairing.dart.gcov.html deleted file mode 100644 index 3c04729e..00000000 --- a/coverage/html/core/pairing/pairing.dart.gcov.html +++ /dev/null @@ -1,909 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing/pairing.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairing - pairing.dartCoverageTotalHit
Test:lcov.infoLines:89.5 %266238
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:async';
-       2              : import 'dart:convert';
-       3              : 
-       4              : import 'package:event/event.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/core/pairing/i_json_rpc_history.dart';
-       6              : import 'package:walletconnect_flutter_v2/apis/core/store/i_generic_store.dart';
-       7              : import 'package:walletconnect_flutter_v2/apis/core/crypto/crypto_models.dart';
-       8              : import 'package:walletconnect_flutter_v2/apis/core/i_core.dart';
-       9              : import 'package:walletconnect_flutter_v2/apis/core/pairing/i_pairing.dart';
-      10              : import 'package:walletconnect_flutter_v2/apis/core/pairing/i_pairing_store.dart';
-      11              : import 'package:walletconnect_flutter_v2/apis/models/uri_parse_result.dart';
-      12              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/pairing_models.dart';
-      13              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/json_rpc_utils.dart';
-      14              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client_models.dart';
-      15              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_error.dart';
-      16              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_request.dart';
-      17              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_response.dart';
-      18              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
-      19              : import 'package:walletconnect_flutter_v2/apis/utils/constants.dart';
-      20              : import 'package:walletconnect_flutter_v2/apis/utils/errors.dart';
-      21              : import 'package:walletconnect_flutter_v2/apis/utils/method_constants.dart';
-      22              : import 'package:walletconnect_flutter_v2/apis/utils/walletconnect_utils.dart';
-      23              : 
-      24              : class PendingRequestResponse {
-      25              :   Completer completer;
-      26              :   dynamic response;
-      27              :   JsonRpcError? error;
-      28              : 
-      29            6 :   PendingRequestResponse({
-      30              :     required this.completer,
-      31              :     this.response,
-      32              :     this.error,
-      33              :   });
-      34              : }
-      35              : 
-      36              : class Pairing implements IPairing {
-      37              :   bool _initialized = false;
-      38              : 
-      39              :   @override
-      40              :   final Event<PairingEvent> onPairingCreate = Event<PairingEvent>();
-      41              :   @override
-      42              :   final Event<PairingActivateEvent> onPairingActivate =
-      43              :       Event<PairingActivateEvent>();
-      44              :   @override
-      45              :   final Event<PairingEvent> onPairingPing = Event<PairingEvent>();
-      46              :   @override
-      47              :   final Event<PairingInvalidEvent> onPairingInvalid =
-      48              :       Event<PairingInvalidEvent>();
-      49              :   @override
-      50              :   final Event<PairingEvent> onPairingDelete = Event<PairingEvent>();
-      51              :   @override
-      52              :   final Event<PairingEvent> onPairingExpire = Event<PairingEvent>();
-      53              : 
-      54              :   /// Stores all the pending requests
-      55              :   Map<int, PendingRequestResponse> pendingRequests = {};
-      56              : 
-      57              :   final ICore core;
-      58              :   final IPairingStore pairings;
-      59              :   final IJsonRpcHistory history;
-      60              : 
-      61              :   /// Stores the public key of Type 1 Envelopes for a topic
-      62              :   /// Once a receiver public key has been used, it is removed from the store
-      63              :   /// Thus, this store works under the assumption that a public key will only be used once
-      64              :   final IGenericStore<ReceiverPublicKey> topicToReceiverPublicKey;
-      65              : 
-      66           10 :   Pairing({
-      67              :     required this.core,
-      68              :     required this.pairings,
-      69              :     required this.history,
-      70              :     required this.topicToReceiverPublicKey,
-      71              :   });
-      72              : 
-      73            9 :   @override
-      74              :   Future<void> init() async {
-      75            9 :     if (_initialized) {
-      76              :       return;
-      77              :     }
-      78              : 
-      79            9 :     _registerRelayEvents();
-      80            9 :     _registerExpirerEvents();
-      81            9 :     _registerheartbeatSubscription();
-      82              : 
-      83           27 :     await core.expirer.init();
-      84           18 :     await pairings.init();
-      85           18 :     await history.init();
-      86           18 :     await topicToReceiverPublicKey.init();
-      87              : 
-      88            9 :     await _cleanup();
-      89              : 
-      90            9 :     await _resubscribeAll();
-      91              : 
-      92            9 :     _initialized = true;
-      93              :   }
-      94              : 
-      95            6 :   @override
-      96              :   Future<void> checkAndExpire() async {
-      97           12 :     for (var pairing in getPairings()) {
-      98           24 :       await core.expirer.checkAndExpire(pairing.topic);
-      99              :     }
-     100              :   }
-     101              : 
-     102            7 :   @override
-     103              :   Future<CreateResponse> create({List<List<String>>? methods}) async {
-     104            7 :     _checkInitialized();
-     105           28 :     final String symKey = core.crypto.getUtils().generateRandomBytes32();
-     106           21 :     final String topic = await core.crypto.setSymKey(symKey);
-     107            7 :     final int expiry = WalletConnectUtils.calculateExpiry(
-     108              :       WalletConnectConstants.FIVE_MINUTES,
-     109              :     );
-     110            7 :     final Relay relay = Relay(WalletConnectConstants.RELAYER_DEFAULT_PROTOCOL);
-     111            7 :     final PairingInfo pairing = PairingInfo(
-     112              :       topic: topic,
-     113              :       expiry: expiry,
-     114              :       relay: relay,
-     115              :       active: false,
-     116           20 :       methods: methods?.expand((e) => e).toList() ?? [],
-     117              :     );
-     118            7 :     final Uri uri = WalletConnectUtils.formatUri(
-     119           14 :       protocol: core.protocol,
-     120           14 :       version: core.version,
-     121              :       topic: topic,
-     122              :       symKey: symKey,
-     123              :       relay: relay,
-     124              :       methods: methods,
-     125              :       expiry: expiry,
-     126              :     );
-     127              : 
-     128           14 :     onPairingCreate.broadcast(
-     129            7 :       PairingEvent(
-     130              :         topic: topic,
-     131              :       ),
-     132              :     );
-     133              : 
-     134           14 :     await pairings.set(topic, pairing);
-     135           21 :     await core.relayClient.subscribe(topic: topic);
-     136           21 :     await core.expirer.set(topic, expiry);
-     137              : 
-     138            7 :     return CreateResponse(
-     139              :       topic: topic,
-     140              :       uri: uri,
-     141              :       pairingInfo: pairing,
-     142              :     );
-     143              :   }
-     144              : 
-     145            7 :   @override
-     146              :   Future<PairingInfo> pair({
-     147              :     required Uri uri,
-     148              :     bool activatePairing = false,
-     149              :   }) async {
-     150            7 :     _checkInitialized();
-     151              : 
-     152              :     // print(uri.queryParameters);
-     153            7 :     final int expiry = WalletConnectUtils.calculateExpiry(
-     154              :       WalletConnectConstants.FIVE_MINUTES,
-     155              :     );
-     156            7 :     final URIParseResult parsedUri = WalletConnectUtils.parseUri(uri);
-     157           14 :     if (parsedUri.version != URIVersion.v2) {
-     158            3 :       throw Errors.getInternalError(
-     159              :         Errors.MISSING_OR_INVALID,
-     160              :         context: 'URI is not WalletConnect version 2 URI',
-     161              :       );
-     162              :     }
-     163              : 
-     164            7 :     final String topic = parsedUri.topic;
-     165           14 :     final Relay relay = parsedUri.v2Data!.relay;
-     166           14 :     final String symKey = parsedUri.v2Data!.symKey;
-     167            7 :     final PairingInfo pairing = PairingInfo(
-     168              :       topic: topic,
-     169              :       expiry: expiry,
-     170              :       relay: relay,
-     171              :       active: false,
-     172           14 :       methods: parsedUri.v2Data!.methods,
-     173              :     );
-     174              : 
-     175              :     try {
-     176            7 :       JsonRpcUtils.validateMethods(
-     177           14 :         parsedUri.v2Data!.methods,
-     178           21 :         routerMapRequest.values.toList(),
-     179              :       );
-     180            4 :     } on WalletConnectError catch (e) {
-     181              :       // Tell people that the pairing is invalid
-     182            8 :       onPairingInvalid.broadcast(
-     183            4 :         PairingInvalidEvent(
-     184            4 :           message: e.message,
-     185              :         ),
-     186              :       );
-     187              : 
-     188              :       // Delete the pairing: "publish internally with reason"
-     189              :       // await _deletePairing(
-     190              :       //   topic,
-     191              :       //   false,
-     192              :       // );
-     193              : 
-     194              :       rethrow;
-     195              :     }
-     196              : 
-     197              :     try {
-     198           14 :       await pairings.set(topic, pairing);
-     199           21 :       await core.crypto.setSymKey(symKey, overrideTopic: topic);
-     200           28 :       await core.relayClient.subscribe(topic: topic).timeout(
-     201              :             const Duration(seconds: 15),
-     202              :           );
-     203           21 :       await core.expirer.set(topic, expiry);
-     204              : 
-     205           14 :       onPairingCreate.broadcast(
-     206            7 :         PairingEvent(
-     207              :           topic: topic,
-     208              :         ),
-     209              :       );
-     210              : 
-     211              :       if (activatePairing) {
-     212            2 :         await activate(topic: topic);
-     213              :       }
-     214              :     } catch (e) {
-     215              :       rethrow;
-     216              :     }
-     217              : 
-     218              :     return pairing;
-     219              :   }
-     220              : 
-     221            7 :   @override
-     222              :   Future<void> activate({required String topic}) async {
-     223            7 :     _checkInitialized();
-     224            7 :     final int expiry = WalletConnectUtils.calculateExpiry(
-     225              :       WalletConnectConstants.THIRTY_DAYS,
-     226              :     );
-     227              :     // print('Activating pairing with topic: $topic');
-     228              : 
-     229           14 :     onPairingActivate.broadcast(
-     230            7 :       PairingActivateEvent(
-     231              :         topic: topic,
-     232              :         expiry: expiry,
-     233              :       ),
-     234              :     );
-     235              : 
-     236           14 :     await pairings.update(
-     237              :       topic,
-     238              :       expiry: expiry,
-     239              :       active: true,
-     240              :     );
-     241           21 :     await core.expirer.set(topic, expiry);
-     242              :   }
-     243              : 
-     244            9 :   @override
-     245              :   void register({
-     246              :     required String method,
-     247              :     required Function(String, JsonRpcRequest) function,
-     248              :     required ProtocolType type,
-     249              :   }) {
-     250           18 :     if (routerMapRequest.containsKey(method)) {
-     251            6 :       final registered = routerMapRequest[method];
-     252            6 :       if (registered!.type == type) {
-     253              :         throw const WalletConnectError(
-     254              :           code: -1,
-     255              :           message: 'Method already exists',
-     256              :         );
-     257              :       }
-     258              :     }
-     259              : 
-     260           27 :     routerMapRequest[method] = RegisteredFunction(
-     261              :       method: method,
-     262              :       function: function,
-     263              :       type: type,
-     264              :     );
-     265              :   }
-     266              : 
-     267            2 :   @override
-     268              :   Future<void> setReceiverPublicKey({
-     269              :     required String topic,
-     270              :     required String publicKey,
-     271              :     int? expiry,
-     272              :   }) async {
-     273            2 :     _checkInitialized();
-     274            4 :     await topicToReceiverPublicKey.set(
-     275              :       topic,
-     276            2 :       ReceiverPublicKey(
-     277              :         topic: topic,
-     278              :         publicKey: publicKey,
-     279            2 :         expiry: WalletConnectUtils.calculateExpiry(
-     280              :           expiry ?? WalletConnectConstants.FIVE_MINUTES,
-     281              :         ),
-     282              :       ),
-     283              :     );
-     284              :   }
-     285              : 
-     286            1 :   @override
-     287              :   Future<void> updateExpiry({
-     288              :     required String topic,
-     289              :     required int expiry,
-     290              :   }) async {
-     291            1 :     _checkInitialized();
-     292              : 
-     293              :     // Validate the expiry is less than 30 days
-     294            1 :     if (expiry >
-     295            1 :         WalletConnectUtils.calculateExpiry(
-     296              :           WalletConnectConstants.THIRTY_DAYS,
-     297              :         )) {
-     298              :       throw const WalletConnectError(
-     299              :         code: -1,
-     300              :         message: 'Expiry cannot be more than 30 days away',
-     301              :       );
-     302              :     }
-     303              : 
-     304            2 :     await pairings.update(
-     305              :       topic,
-     306              :       expiry: expiry,
-     307              :     );
-     308            3 :     await core.expirer.set(
-     309              :       topic,
-     310              :       expiry,
-     311              :     );
-     312              :   }
-     313              : 
-     314            5 :   @override
-     315              :   Future<void> updateMetadata({
-     316              :     required String topic,
-     317              :     required PairingMetadata metadata,
-     318              :   }) async {
-     319            5 :     _checkInitialized();
-     320           10 :     await pairings.update(
-     321              :       topic,
-     322              :       metadata: metadata,
-     323              :     );
-     324              :   }
-     325              : 
-     326            9 :   @override
-     327              :   List<PairingInfo> getPairings() {
-     328           18 :     return pairings.getAll();
-     329              :   }
-     330              : 
-     331            4 :   @override
-     332              :   PairingInfo? getPairing({required String topic}) {
-     333            8 :     return pairings.get(topic);
-     334              :   }
-     335              : 
-     336            5 :   @override
-     337              :   Future<void> ping({required String topic}) async {
-     338            5 :     _checkInitialized();
-     339              : 
-     340            5 :     await _isValidPing(topic);
-     341              : 
-     342           10 :     if (pairings.has(topic)) {
-     343              :       // try {
-     344            5 :       final bool _ = await sendRequest(
-     345              :         topic,
-     346              :         MethodConstants.WC_PAIRING_PING,
-     347            5 :         {},
-     348              :       );
-     349              :     }
-     350              :   }
-     351              : 
-     352            4 :   @override
-     353              :   Future<void> disconnect({required String topic}) async {
-     354            4 :     _checkInitialized();
-     355              : 
-     356            4 :     await _isValidDisconnect(topic);
-     357            8 :     if (pairings.has(topic)) {
-     358              :       // Send the request to delete the pairing, we don't care if it fails
-     359              :       try {
-     360            4 :         sendRequest(
-     361              :           topic,
-     362              :           MethodConstants.WC_PAIRING_DELETE,
-     363            8 :           Errors.getSdkError(Errors.USER_DISCONNECTED).toJson(),
-     364              :         );
-     365              :       } catch (_) {}
-     366              : 
-     367              :       // Delete the pairing
-     368            8 :       await pairings.delete(topic);
-     369              : 
-     370            8 :       onPairingDelete.broadcast(
-     371            4 :         PairingEvent(
-     372              :           topic: topic,
-     373              :         ),
-     374              :       );
-     375              :     }
-     376              :   }
-     377              : 
-     378            5 :   @override
-     379              :   IPairingStore getStore() {
-     380            5 :     return pairings;
-     381              :   }
-     382              : 
-     383            6 :   @override
-     384              :   Future<void> isValidPairingTopic({required String topic}) async {
-     385           12 :     if (!pairings.has(topic)) {
-     386            4 :       throw Errors.getInternalError(
-     387              :         Errors.NO_MATCHING_KEY,
-     388            4 :         context: "pairing topic doesn't exist: $topic",
-     389              :       );
-     390              :     }
-     391              : 
-     392           18 :     if (await core.expirer.checkAndExpire(topic)) {
-     393            0 :       throw Errors.getInternalError(
-     394              :         Errors.EXPIRED,
-     395            0 :         context: 'pairing topic: $topic',
-     396              :       );
-     397              :     }
-     398              :   }
-     399              : 
-     400              :   // RELAY COMMUNICATION HELPERS
-     401              : 
-     402            6 :   @override
-     403              :   Future sendRequest(
-     404              :     String topic,
-     405              :     String method,
-     406              :     dynamic params, {
-     407              :     int? id,
-     408              :     int? ttl,
-     409              :     EncodeOptions? encodeOptions,
-     410              :   }) async {
-     411           18 :     core.logger.t(
-     412            6 :       'pairing sendRequest, id: $id topic: $topic, method: $method, params: $params, ttl: $ttl',
-     413              :     );
-     414              : 
-     415            6 :     final payload = JsonRpcUtils.formatJsonRpcRequest(
-     416              :       method,
-     417              :       params,
-     418              :       id: id,
-     419              :     );
-     420              :     // print('sending request: $payload');
-     421              : 
-     422           18 :     final message = await core.crypto.encode(
-     423              :       topic,
-     424              :       payload,
-     425              :       options: encodeOptions,
-     426              :     );
-     427              : 
-     428              :     if (message == null) {
-     429              :       return;
-     430              :     }
-     431              : 
-     432           12 :     RpcOptions opts = MethodConstants.RPC_OPTS[method]!['req']!;
-     433              :     if (ttl != null) {
-     434            4 :       opts = opts.copyWith(ttl: ttl);
-     435              :     }
-     436              : 
-     437              :     // print('adding payload to pending requests: ${payload['id']}');
-     438           12 :     final resp = PendingRequestResponse(completer: Completer());
-     439           21 :     resp.completer.future.catchError((err) {
-     440              :       // Catch the error so that it won't throw an uncaught error
-     441              :     });
-     442           18 :     pendingRequests[payload['id']] = resp;
-     443              :     // print('sent request');
-     444           18 :     await core.relayClient.publish(
-     445              :       topic: topic,
-     446              :       message: message,
-     447            6 :       ttl: opts.ttl,
-     448            6 :       tag: opts.tag,
-     449              :     );
-     450              : 
-     451              :     // Get the result from the completer, if it's an error, throw it
-     452              :     try {
-     453            6 :       if (resp.error != null) {
-     454            0 :         throw resp.error!;
-     455              :       }
-     456              : 
-     457              :       // print('checking if completed');
-     458           12 :       if (resp.completer.isCompleted) {
-     459            0 :         return resp.response;
-     460              :       }
-     461              : 
-     462           12 :       return await resp.completer.future;
-     463              :     } catch (e) {
-     464              :       rethrow;
-     465              :     }
-     466              :   }
-     467              : 
-     468            6 :   @override
-     469              :   Future<void> sendResult(
-     470              :     int id,
-     471              :     String topic,
-     472              :     String method,
-     473              :     dynamic result, {
-     474              :     EncodeOptions? encodeOptions,
-     475              :   }) async {
-     476           18 :     core.logger.t(
-     477            6 :       'pairing sendResult, id: $id topic: $topic, method: $method, result: $result',
-     478              :     );
-     479              :     final Map<String, dynamic> payload =
-     480            6 :         JsonRpcUtils.formatJsonRpcResponse<dynamic>(
-     481              :       id,
-     482              :       result,
-     483              :     );
-     484           18 :     final String? message = await core.crypto.encode(
-     485              :       topic,
-     486              :       payload,
-     487              :       options: encodeOptions,
-     488              :     );
-     489              : 
-     490              :     if (message == null) {
-     491              :       return;
-     492              :     }
-     493              : 
-     494           12 :     final RpcOptions opts = MethodConstants.RPC_OPTS[method]!['res']!;
-     495           18 :     await core.relayClient.publish(
-     496              :       topic: topic,
-     497              :       message: message,
-     498            6 :       ttl: opts.ttl,
-     499            6 :       tag: opts.tag,
-     500              :     );
-     501              :   }
-     502              : 
-     503            3 :   @override
-     504              :   Future<void> sendError(
-     505              :     int id,
-     506              :     String topic,
-     507              :     String method,
-     508              :     JsonRpcError error, {
-     509              :     EncodeOptions? encodeOptions,
-     510              :     RpcOptions? rpcOptions,
-     511              :   }) async {
-     512            9 :     core.logger.t(
-     513            3 :       'pairing sendError, id: $id topic: $topic, method: $method, error: $error',
-     514              :     );
-     515              : 
-     516            3 :     final Map<String, dynamic> payload = JsonRpcUtils.formatJsonRpcError(
-     517              :       id,
-     518              :       error,
-     519              :     );
-     520            9 :     final String? message = await core.crypto.encode(
-     521              :       topic,
-     522              :       payload,
-     523              :       options: encodeOptions,
-     524              :     );
-     525              : 
-     526              :     if (message == null) {
-     527              :       return;
-     528              :     }
-     529              : 
-     530              :     final fallbackMethod = MethodConstants.UNREGISTERED_METHOD;
-     531            3 :     final fallbackRpcOpts = MethodConstants.RPC_OPTS[method] ??
-     532            0 :         MethodConstants.RPC_OPTS[fallbackMethod]!;
-     533            6 :     final fallbackOpts = fallbackRpcOpts['reject'] ?? fallbackRpcOpts['res']!;
-     534              : 
-     535              :     final RpcOptions opts = rpcOptions ?? fallbackOpts;
-     536              : 
-     537            9 :     await core.relayClient.publish(
-     538              :       topic: topic,
-     539              :       message: message,
-     540            3 :       ttl: opts.ttl,
-     541            3 :       tag: opts.tag,
-     542              :     );
-     543              :   }
-     544              : 
-     545              :   /// ---- Private Helpers ---- ///
-     546              : 
-     547            9 :   Future<void> _resubscribeAll() async {
-     548              :     // If the relay is not active, stop here
-     549           27 :     if (!core.relayClient.isConnected) {
-     550              :       return;
-     551              :     }
-     552              : 
-     553              :     // Resubscribe to all active pairings
-     554           16 :     final List<PairingInfo> activePairings = pairings.getAll();
-     555            8 :     for (final PairingInfo pairing in activePairings) {
-     556            0 :       if (pairing.active) {
-     557              :         // print('Resubscribing to topic: ${pairing.topic}');
-     558            0 :         await core.relayClient.subscribe(topic: pairing.topic);
-     559              :       }
-     560              :     }
-     561              :   }
-     562              : 
-     563            2 :   Future<void> _deletePairing(String topic, bool expirerHasDeleted) async {
-     564            6 :     await core.relayClient.unsubscribe(topic: topic);
-     565            4 :     await pairings.delete(topic);
-     566            6 :     await core.crypto.deleteSymKey(topic);
-     567              :     if (expirerHasDeleted) {
-     568            6 :       await core.expirer.delete(topic);
-     569              :     }
-     570              :   }
-     571              : 
-     572            9 :   Future<void> _cleanup() async {
-     573            9 :     final List<PairingInfo> expiredPairings = getPairings()
-     574            9 :         .where(
-     575            3 :           (PairingInfo info) => WalletConnectUtils.isExpired(info.expiry),
-     576              :         )
-     577            9 :         .toList();
-     578           10 :     for (final PairingInfo pairing in expiredPairings) {
-     579              :       // print('deleting expired pairing: ${pairing.topic}');
-     580            2 :       await _deletePairing(pairing.topic, true);
-     581              :     }
-     582              : 
-     583              :     // Cleanup all history records
-     584            9 :     final List<JsonRpcRecord> expiredHistory = history
-     585            9 :         .getAll()
-     586            9 :         .where(
-     587            4 :           (record) => WalletConnectUtils.isExpired(record.expiry ?? -1),
-     588              :         )
-     589            9 :         .toList();
-     590              :     // Loop through the expired records and delete them
-     591           10 :     for (final JsonRpcRecord record in expiredHistory) {
-     592              :       // print('deleting expired history record: ${record.id}');
-     593            4 :       await history.delete(record.id.toString());
-     594              :     }
-     595              : 
-     596              :     // Cleanup all of the expired receiver public keys
-     597              :     final List<ReceiverPublicKey> expiredReceiverPublicKeys =
-     598            9 :         topicToReceiverPublicKey
-     599            9 :             .getAll()
-     600           12 :             .where((receiver) => WalletConnectUtils.isExpired(receiver.expiry))
-     601            9 :             .toList();
-     602              :     // Loop through the expired receiver public keys and delete them
-     603           10 :     for (final ReceiverPublicKey receiver in expiredReceiverPublicKeys) {
-     604              :       // print('deleting expired receiver public key: $receiver');
-     605            3 :       await topicToReceiverPublicKey.delete(receiver.topic);
-     606              :     }
-     607              :   }
-     608              : 
-     609            7 :   void _checkInitialized() {
-     610            7 :     if (!_initialized) {
-     611            0 :       throw Errors.getInternalError(Errors.NOT_INITIALIZED);
-     612              :     }
-     613              :   }
-     614              : 
-     615              :   /// ---- Relay Event Router ---- ///
-     616              : 
-     617              :   Map<String, RegisteredFunction> routerMapRequest = {};
-     618              : 
-     619            9 :   void _registerRelayEvents() {
-     620           45 :     core.relayClient.onRelayClientConnect.subscribe(_onRelayConnect);
-     621           45 :     core.relayClient.onRelayClientMessage.subscribe(_onMessageEvent);
-     622              : 
-     623            9 :     register(
-     624              :       method: MethodConstants.WC_PAIRING_PING,
-     625            9 :       function: _onPairingPingRequest,
-     626              :       type: ProtocolType.pair,
-     627              :     );
-     628            9 :     register(
-     629              :       method: MethodConstants.WC_PAIRING_DELETE,
-     630            9 :       function: _onPairingDeleteRequest,
-     631              :       type: ProtocolType.pair,
-     632              :     );
-     633              :   }
-     634              : 
-     635            0 :   Future<void> _onRelayConnect(EventArgs? args) async {
-     636              :     // print('Pairing: Relay connected');
-     637            0 :     await _resubscribeAll();
-     638              :   }
-     639              : 
-     640            6 :   void _onMessageEvent(MessageEvent? event) async {
-     641              :     if (event == null) {
-     642              :       return;
-     643              :     }
-     644              : 
-     645              :     // If we have a reciever public key for the topic, use it
-     646              :     ReceiverPublicKey? receiverPublicKey =
-     647           18 :         topicToReceiverPublicKey.get(event.topic);
-     648              :     // If there was a public key, delete it. One use.
-     649              :     if (receiverPublicKey != null) {
-     650            6 :       await topicToReceiverPublicKey.delete(event.topic);
-     651              :     }
-     652              : 
-     653              :     // Decode the message
-     654           18 :     String? payloadString = await core.crypto.decode(
-     655            6 :       event.topic,
-     656            6 :       event.message,
-     657            6 :       options: DecodeOptions(
-     658            2 :         receiverPublicKey: receiverPublicKey?.publicKey,
-     659              :       ),
-     660              :     );
-     661              : 
-     662              :     if (payloadString == null) {
-     663              :       return;
-     664              :     }
-     665              :     // print(payloadString);
-     666              : 
-     667            6 :     Map<String, dynamic> data = jsonDecode(payloadString);
-     668           24 :     core.logger.i('Pairing _onMessageEvent, Received data: $data');
-     669              : 
-     670              :     // If it's an rpc request, handle it
-     671              :     // print('Pairing: Received data: $data');
-     672            6 :     if (data.containsKey('method')) {
-     673            6 :       final request = JsonRpcRequest.fromJson(data);
-     674           18 :       if (routerMapRequest.containsKey(request.method)) {
-     675           36 :         routerMapRequest[request.method]!.function(event.topic, request);
-     676              :       } else {
-     677            0 :         _onUnkownRpcMethodRequest(event.topic, request);
-     678              :       }
-     679              :     }
-     680              :     // Otherwise handle it as a response
-     681              :     else {
-     682            6 :       final response = JsonRpcResponse.fromJson(data);
-     683              : 
-     684              :       // Only handle the response if we have a record of the request
-     685              :       // final JsonRpcRecord? record = history.get(response.id.toString());
-     686              :       // // print(record);
-     687              :       // if (record == null) {
-     688              :       //   return;
-     689              :       // }
-     690              : 
-     691              :       // print(
-     692              :       //   'pendingRequests: ${pendingRequests.keys} has ${response.id} is ${pendingRequests.containsKey(response.id)}',
-     693              :       // );
-     694           18 :       if (pendingRequests.containsKey(response.id)) {
-     695            6 :         if (response.error != null) {
-     696           15 :           pendingRequests[response.id]!.error = response.error;
-     697            9 :           pendingRequests[response.id]!
-     698            3 :               .completer
-     699            6 :               .completeError(response.error!);
-     700              :         } else {
-     701              :           // print(
-     702              :           //   'completing: ${response.result}',
-     703              :           // );
-     704           30 :           pendingRequests[response.id]!.response = response.result;
-     705           36 :           pendingRequests[response.id]!.completer.complete(response.result);
-     706              :         }
-     707              :       }
-     708              :     }
-     709              :   }
-     710              : 
-     711            5 :   Future<void> _onPairingPingRequest(
-     712              :     String topic,
-     713              :     JsonRpcRequest request,
-     714              :   ) async {
-     715            5 :     final int id = request.id;
-     716              :     try {
-     717              :       // print('ping req');
-     718            5 :       await _isValidPing(topic);
-     719            5 :       await sendResult(
-     720              :         id,
-     721              :         topic,
-     722            5 :         request.method,
-     723              :         true,
-     724              :       );
-     725           10 :       onPairingPing.broadcast(
-     726            5 :         PairingEvent(
-     727              :           id: id,
-     728              :           topic: topic,
-     729              :         ),
-     730              :       );
-     731            0 :     } on JsonRpcError catch (e) {
-     732              :       // print(e);
-     733            0 :       await sendError(
-     734              :         id,
-     735              :         topic,
-     736            0 :         request.method,
-     737              :         e,
-     738              :       );
-     739              :     }
-     740              :   }
-     741              : 
-     742            4 :   Future<void> _onPairingDeleteRequest(
-     743              :     String topic,
-     744              :     JsonRpcRequest request,
-     745              :   ) async {
-     746              :     // print('delete');
-     747            4 :     final int id = request.id;
-     748              :     try {
-     749            4 :       await _isValidDisconnect(topic);
-     750            4 :       await sendResult(
-     751              :         id,
-     752              :         topic,
-     753            4 :         request.method,
-     754              :         true,
-     755              :       );
-     756            8 :       await pairings.delete(topic);
-     757            8 :       onPairingDelete.broadcast(
-     758            4 :         PairingEvent(
-     759              :           id: id,
-     760              :           topic: topic,
-     761              :         ),
-     762              :       );
-     763            0 :     } on JsonRpcError catch (e) {
-     764            0 :       await sendError(
-     765              :         id,
-     766              :         topic,
-     767            0 :         request.method,
-     768              :         e,
-     769              :       );
-     770              :     }
-     771              :   }
-     772              : 
-     773            0 :   Future<void> _onUnkownRpcMethodRequest(
-     774              :     String topic,
-     775              :     JsonRpcRequest request,
-     776              :   ) async {
-     777            0 :     final int id = request.id;
-     778            0 :     final String method = request.method;
-     779              :     try {
-     780            0 :       if (routerMapRequest.containsKey(method)) {
-     781              :         return;
-     782              :       }
-     783            0 :       final String message = Errors.getSdkError(
-     784              :         Errors.WC_METHOD_UNSUPPORTED,
-     785              :         context: method,
-     786            0 :       ).message;
-     787            0 :       await sendError(
-     788              :         id,
-     789              :         topic,
-     790            0 :         request.method,
-     791            0 :         JsonRpcError.methodNotFound(message),
-     792              :       );
-     793            0 :     } on JsonRpcError catch (e) {
-     794            0 :       await sendError(id, topic, request.method, e);
-     795              :     }
-     796              :   }
-     797              : 
-     798              :   /// ---- Expirer Events ---- ///
-     799              : 
-     800            9 :   void _registerExpirerEvents() {
-     801           45 :     core.expirer.onExpire.subscribe(_onExpired);
-     802              :   }
-     803              : 
-     804            9 :   void _registerheartbeatSubscription() {
-     805           45 :     core.heartbeat.onPulse.subscribe(_heartbeatSubscription);
-     806              :   }
-     807              : 
-     808            4 :   Future<void> _onExpired(ExpirationEvent? event) async {
-     809              :     if (event == null) {
-     810              :       return;
-     811              :     }
-     812              : 
-     813           12 :     if (pairings.has(event.target)) {
-     814              :       // Clean up the pairing
-     815            2 :       await _deletePairing(event.target, true);
-     816            2 :       onPairingExpire.broadcast(
-     817            1 :         PairingEvent(
-     818            1 :           topic: event.target,
-     819              :         ),
-     820              :       );
-     821              :     }
-     822              :   }
-     823              : 
-     824            6 :   void _heartbeatSubscription(EventArgs? args) async {
-     825            6 :     await checkAndExpire();
-     826              :   }
-     827              : 
-     828              :   /// ---- Validators ---- ///
-     829              : 
-     830            5 :   Future<void> _isValidPing(String topic) async {
-     831            5 :     await isValidPairingTopic(topic: topic);
-     832              :   }
-     833              : 
-     834            4 :   Future<void> _isValidDisconnect(String topic) async {
-     835            4 :     await isValidPairingTopic(topic: topic);
-     836              :   }
-     837              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/pairing_store.dart.func-c.html b/coverage/html/core/pairing/pairing_store.dart.func-c.html deleted file mode 100644 index 0a7fb0a9..00000000 --- a/coverage/html/core/pairing/pairing_store.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing/pairing_store.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairing - pairing_store.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %88
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/pairing_store.dart.func.html b/coverage/html/core/pairing/pairing_store.dart.func.html deleted file mode 100644 index f5c265d0..00000000 --- a/coverage/html/core/pairing/pairing_store.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing/pairing_store.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairing - pairing_store.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %88
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/pairing_store.dart.gcov.html b/coverage/html/core/pairing/pairing_store.dart.gcov.html deleted file mode 100644 index c71d2c06..00000000 --- a/coverage/html/core/pairing/pairing_store.dart.gcov.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing/pairing_store.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairing - pairing_store.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %88
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:walletconnect_flutter_v2/apis/core/pairing/i_pairing_store.dart';
-       2              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/pairing_models.dart';
-       3              : import 'package:walletconnect_flutter_v2/apis/core/store/generic_store.dart';
-       4              : 
-       5              : class PairingStore extends GenericStore<PairingInfo> implements IPairingStore {
-       6           11 :   PairingStore({
-       7              :     required super.storage,
-       8              :     required super.context,
-       9              :     required super.version,
-      10              :     required super.fromJson,
-      11              :   });
-      12              : 
-      13            8 :   @override
-      14              :   Future<void> update(
-      15              :     String topic, {
-      16              :     int? expiry,
-      17              :     bool? active,
-      18              :     PairingMetadata? metadata,
-      19              :   }) async {
-      20            8 :     checkInitialized();
-      21              : 
-      22            8 :     PairingInfo? info = get(topic);
-      23              :     if (info == null) {
-      24              :       return;
-      25              :     }
-      26              : 
-      27              :     if (expiry != null) {
-      28           16 :       info = info.copyWith(expiry: expiry);
-      29              :     }
-      30              :     if (active != null) {
-      31           14 :       info = info.copyWith(active: active);
-      32              :     }
-      33              :     if (metadata != null) {
-      34           10 :       info = info.copyWith(peerMetadata: metadata);
-      35              :     }
-      36              : 
-      37            8 :     await set(topic, info);
-      38              :   }
-      39              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/utils/index-sort-f.html b/coverage/html/core/pairing/utils/index-sort-f.html deleted file mode 100644 index 9dc16bf2..00000000 --- a/coverage/html/core/pairing/utils/index-sort-f.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing/utils - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairing/utilsCoverageTotalHit
Test:lcov.infoLines:54.7 %5329
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
json_rpc_utils.dart -
100.0%
-
100.0 %2121-
pairing_models.dart -
25.0%25.0%
-
25.0 %328-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/utils/index-sort-l.html b/coverage/html/core/pairing/utils/index-sort-l.html deleted file mode 100644 index d4a6011b..00000000 --- a/coverage/html/core/pairing/utils/index-sort-l.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing/utils - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairing/utilsCoverageTotalHit
Test:lcov.infoLines:54.7 %5329
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
pairing_models.dart -
25.0%25.0%
-
25.0 %328
json_rpc_utils.dart -
100.0%
-
100.0 %2121
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/utils/index.html b/coverage/html/core/pairing/utils/index.html deleted file mode 100644 index efa9530f..00000000 --- a/coverage/html/core/pairing/utils/index.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing/utils - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairing/utilsCoverageTotalHit
Test:lcov.infoLines:54.7 %5329
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
json_rpc_utils.dart -
100.0%
-
100.0 %2121
pairing_models.dart -
25.0%25.0%
-
25.0 %328
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/utils/json_rpc_utils.dart.func-c.html b/coverage/html/core/pairing/utils/json_rpc_utils.dart.func-c.html deleted file mode 100644 index 5c1c5d15..00000000 --- a/coverage/html/core/pairing/utils/json_rpc_utils.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing/utils/json_rpc_utils.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairing/utils - json_rpc_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %2121
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/utils/json_rpc_utils.dart.func.html b/coverage/html/core/pairing/utils/json_rpc_utils.dart.func.html deleted file mode 100644 index d0099607..00000000 --- a/coverage/html/core/pairing/utils/json_rpc_utils.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing/utils/json_rpc_utils.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairing/utils - json_rpc_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %2121
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/utils/json_rpc_utils.dart.gcov.html b/coverage/html/core/pairing/utils/json_rpc_utils.dart.gcov.html deleted file mode 100644 index 0d1f7173..00000000 --- a/coverage/html/core/pairing/utils/json_rpc_utils.dart.gcov.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing/utils/json_rpc_utils.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairing/utils - json_rpc_utils.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %2121
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:math';
-       2              : 
-       3              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/pairing_models.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_error.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/utils/errors.dart';
-       6              : 
-       7              : class JsonRpcUtils {
-       8            8 :   static int payloadId({int entropy = 3}) {
-       9            8 :     int addedZeroes = (pow(10, entropy) as int);
-      10           24 :     int date = DateTime.now().millisecondsSinceEpoch * addedZeroes;
-      11           32 :     int extra = (Random().nextDouble() * addedZeroes).floor();
-      12            8 :     return date + extra;
-      13              :   }
-      14              : 
-      15            6 :   static Map<String, dynamic> formatJsonRpcRequest(
-      16              :     String method,
-      17              :     dynamic params, {
-      18              :     int? id,
-      19              :   }) {
-      20            6 :     return {
-      21            6 :       'id': id ??= payloadId(),
-      22              :       'jsonrpc': '2.0',
-      23              :       'method': method,
-      24              :       'params': params,
-      25              :     };
-      26              :   }
-      27              : 
-      28            6 :   static Map<String, dynamic> formatJsonRpcResponse<T>(
-      29              :     int id,
-      30              :     T result,
-      31              :   ) {
-      32            6 :     return {
-      33              :       'id': id,
-      34              :       'jsonrpc': '2.0',
-      35              :       'result': result,
-      36              :     };
-      37              :   }
-      38              : 
-      39            3 :   static Map<String, dynamic> formatJsonRpcError(int id, JsonRpcError error) {
-      40            3 :     return {
-      41              :       'id': id,
-      42              :       'jsonrpc': '2.0',
-      43            3 :       'error': error.toJson(),
-      44              :     };
-      45              :   }
-      46              : 
-      47            7 :   static bool validateMethods(
-      48              :     List<String> methods,
-      49              :     List<RegisteredFunction> registeredMethods,
-      50              :   ) {
-      51            7 :     List<String> unsupportedMethods = [];
-      52              : 
-      53              :     // Loop through the methods, and validate that each one exists in the registered methods
-      54           13 :     for (String method in methods) {
-      55           24 :       if (!registeredMethods.any((element) => element.method == method)) {
-      56              :         // print("Adding method: $method");
-      57            4 :         unsupportedMethods.add(method);
-      58              :       }
-      59              :     }
-      60              : 
-      61              :     // If there are any unsupported methods, throw an error
-      62            7 :     if (unsupportedMethods.isNotEmpty) {
-      63              :       // print(
-      64              :       //     'Unsupported Methods: $unsupportedMethods, Length: ${unsupportedMethods.length}');
-      65            4 :       throw Errors.getSdkError(
-      66              :         Errors.WC_METHOD_UNSUPPORTED,
-      67              :         context:
-      68            8 :             'The following methods are not registered: ${unsupportedMethods.join(', ')}.',
-      69              :       );
-      70              :     }
-      71              : 
-      72              :     return true;
-      73              :   }
-      74              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/utils/pairing_models.dart.func-c.html b/coverage/html/core/pairing/utils/pairing_models.dart.func-c.html deleted file mode 100644 index 76b6eb7b..00000000 --- a/coverage/html/core/pairing/utils/pairing_models.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing/utils/pairing_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairing/utils - pairing_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:25.0 %328
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/utils/pairing_models.dart.func.html b/coverage/html/core/pairing/utils/pairing_models.dart.func.html deleted file mode 100644 index ea8f9656..00000000 --- a/coverage/html/core/pairing/utils/pairing_models.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing/utils/pairing_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairing/utils - pairing_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:25.0 %328
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/pairing/utils/pairing_models.dart.gcov.html b/coverage/html/core/pairing/utils/pairing_models.dart.gcov.html deleted file mode 100644 index 6173aaf2..00000000 --- a/coverage/html/core/pairing/utils/pairing_models.dart.gcov.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - - - - LCOV - lcov.info - core/pairing/utils/pairing_models.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/pairing/utils - pairing_models.dartCoverageTotalHit
Test:lcov.infoLines:25.0 %328
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:event/event.dart';
-       2              : import 'package:freezed_annotation/freezed_annotation.dart';
-       3              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client_models.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_error.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_request.dart';
-       6              : 
-       7              : part 'pairing_models.g.dart';
-       8              : part 'pairing_models.freezed.dart';
-       9              : 
-      10              : enum ProtocolType {
-      11              :   pair,
-      12              :   sign,
-      13              :   auth,
-      14              : }
-      15              : 
-      16              : @freezed
-      17              : class PairingInfo with _$PairingInfo {
-      18              :   @JsonSerializable()
-      19              :   const factory PairingInfo({
-      20              :     required String topic,
-      21              :     required int expiry,
-      22              :     required Relay relay,
-      23              :     required bool active,
-      24              :     List<String>? methods,
-      25              :     PairingMetadata? peerMetadata,
-      26              :   }) = _PairingInfo;
-      27              : 
-      28            0 :   factory PairingInfo.fromJson(Map<String, dynamic> json) =>
-      29            0 :       _$PairingInfoFromJson(json);
-      30              : }
-      31              : 
-      32              : @freezed
-      33              : class PairingMetadata with _$PairingMetadata {
-      34              :   @JsonSerializable(includeIfNull: false)
-      35              :   const factory PairingMetadata({
-      36              :     required String name,
-      37              :     required String description,
-      38              :     required String url,
-      39              :     required List<String> icons,
-      40              :     String? verifyUrl,
-      41              :     Redirect? redirect,
-      42              :   }) = _PairingMetadata;
-      43              : 
-      44            0 :   factory PairingMetadata.empty() => const PairingMetadata(
-      45              :         name: '',
-      46              :         description: '',
-      47              :         url: '',
-      48              :         icons: [],
-      49              :       );
-      50              : 
-      51            5 :   factory PairingMetadata.fromJson(Map<String, dynamic> json) =>
-      52            5 :       _$PairingMetadataFromJson(json);
-      53              : }
-      54              : 
-      55              : @freezed
-      56              : class Redirect with _$Redirect {
-      57              :   @JsonSerializable()
-      58              :   const factory Redirect({
-      59              :     String? native,
-      60              :     String? universal,
-      61              :   }) = _Redirect;
-      62              : 
-      63            0 :   factory Redirect.fromJson(Map<String, dynamic> json) =>
-      64            0 :       _$RedirectFromJson(json);
-      65              : }
-      66              : 
-      67              : class CreateResponse {
-      68              :   String topic;
-      69              :   Uri uri;
-      70              :   PairingInfo pairingInfo;
-      71              : 
-      72            7 :   CreateResponse({
-      73              :     required this.topic,
-      74              :     required this.uri,
-      75              :     required this.pairingInfo,
-      76              :   });
-      77              : 
-      78            0 :   @override
-      79              :   String toString() {
-      80            0 :     return 'CreateResponse(topic: $topic, uri: $uri, pairingInfo: ${pairingInfo.toJson()})';
-      81              :   }
-      82              : }
-      83              : 
-      84              : class ExpirationEvent extends EventArgs {
-      85              :   String target;
-      86              :   int expiry;
-      87              : 
-      88            4 :   ExpirationEvent({
-      89              :     required this.target,
-      90              :     required this.expiry,
-      91              :   });
-      92              : 
-      93            0 :   @override
-      94              :   String toString() {
-      95            0 :     return 'ExpirationEvent(target: $target, expiry: $expiry)';
-      96              :   }
-      97              : }
-      98              : 
-      99              : class HistoryEvent extends EventArgs {
-     100              :   JsonRpcRecord record;
-     101              : 
-     102            0 :   HistoryEvent({required this.record});
-     103              : 
-     104            0 :   @override
-     105              :   String toString() {
-     106            0 :     return 'HistoryEvent(record: $record)';
-     107              :   }
-     108              : }
-     109              : 
-     110              : class PairingInvalidEvent extends EventArgs {
-     111              :   String message;
-     112              : 
-     113            4 :   PairingInvalidEvent({
-     114              :     required this.message,
-     115              :   });
-     116              : 
-     117            0 :   @override
-     118              :   String toString() {
-     119            0 :     return 'PairingInvalidEvent(message: $message)';
-     120              :   }
-     121              : }
-     122              : 
-     123              : class PairingEvent extends EventArgs {
-     124              :   int? id;
-     125              :   String? topic;
-     126              :   JsonRpcError? error;
-     127              : 
-     128            7 :   PairingEvent({
-     129              :     this.id,
-     130              :     this.topic,
-     131              :     this.error,
-     132              :   });
-     133              : 
-     134            0 :   @override
-     135              :   String toString() {
-     136            0 :     return 'PairingEvent(id: $id, topic: $topic, error: $error)';
-     137              :   }
-     138              : }
-     139              : 
-     140              : class PairingActivateEvent extends EventArgs {
-     141              :   String topic;
-     142              :   int expiry;
-     143              : 
-     144            7 :   PairingActivateEvent({
-     145              :     required this.topic,
-     146              :     required this.expiry,
-     147              :   });
-     148              : 
-     149            0 :   @override
-     150              :   String toString() {
-     151            0 :     return 'PairingActivateEvent(topic: $topic, expiry: $expiry)';
-     152              :   }
-     153              : }
-     154              : 
-     155              : @freezed
-     156              : class JsonRpcRecord with _$JsonRpcRecord {
-     157              :   @JsonSerializable(includeIfNull: false)
-     158              :   const factory JsonRpcRecord({
-     159              :     required int id,
-     160              :     required String topic,
-     161              :     required String method,
-     162              :     required dynamic params,
-     163              :     String? chainId,
-     164              :     int? expiry,
-     165              :     dynamic response,
-     166              :   }) = _JsonRpcRecord;
-     167              : 
-     168            0 :   factory JsonRpcRecord.fromJson(Map<String, dynamic> json) =>
-     169            0 :       _$JsonRpcRecordFromJson(json);
-     170              : }
-     171              : 
-     172              : @freezed
-     173              : class ReceiverPublicKey with _$ReceiverPublicKey {
-     174              :   @JsonSerializable(includeIfNull: false)
-     175              :   const factory ReceiverPublicKey({
-     176              :     required String topic,
-     177              :     required String publicKey,
-     178              :     required int expiry,
-     179              :   }) = _ReceiverPublicKey;
-     180              : 
-     181            0 :   factory ReceiverPublicKey.fromJson(Map<String, dynamic> json) =>
-     182            0 :       _$ReceiverPublicKeyFromJson(json);
-     183              : }
-     184              : 
-     185              : class RegisteredFunction {
-     186              :   String method;
-     187              :   Function(String, JsonRpcRequest) function;
-     188              :   ProtocolType type;
-     189              : 
-     190            9 :   RegisteredFunction({
-     191              :     required this.method,
-     192              :     required this.function,
-     193              :     required this.type,
-     194              :   });
-     195              : 
-     196            0 :   @override
-     197              :   String toString() {
-     198            0 :     return 'RegisteredFunction(method: $method, function: $function, type: $type)';
-     199              :   }
-     200              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_auth/index-sort-f.html b/coverage/html/core/relay_auth/index-sort-f.html deleted file mode 100644 index afb25eec..00000000 --- a/coverage/html/core/relay_auth/index-sort-f.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_auth - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_authCoverageTotalHit
Test:lcov.infoLines:86.5 %11196
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
relay_auth.dart -
85.6%85.6%
-
85.6 %9077-
relay_auth_models.dart -
90.5%90.5%
-
90.5 %2119-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_auth/index-sort-l.html b/coverage/html/core/relay_auth/index-sort-l.html deleted file mode 100644 index 3b4c0c97..00000000 --- a/coverage/html/core/relay_auth/index-sort-l.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_auth - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_authCoverageTotalHit
Test:lcov.infoLines:86.5 %11196
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
relay_auth.dart -
85.6%85.6%
-
85.6 %9077
relay_auth_models.dart -
90.5%90.5%
-
90.5 %2119
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_auth/index.html b/coverage/html/core/relay_auth/index.html deleted file mode 100644 index f409ad6b..00000000 --- a/coverage/html/core/relay_auth/index.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_auth - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_authCoverageTotalHit
Test:lcov.infoLines:86.5 %11196
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
relay_auth.dart -
85.6%85.6%
-
85.6 %9077
relay_auth_models.dart -
90.5%90.5%
-
90.5 %2119
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_auth/relay_auth.dart.func-c.html b/coverage/html/core/relay_auth/relay_auth.dart.func-c.html deleted file mode 100644 index 8ba3c348..00000000 --- a/coverage/html/core/relay_auth/relay_auth.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_auth/relay_auth.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_auth - relay_auth.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:85.6 %9077
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_auth/relay_auth.dart.func.html b/coverage/html/core/relay_auth/relay_auth.dart.func.html deleted file mode 100644 index 99949ba7..00000000 --- a/coverage/html/core/relay_auth/relay_auth.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_auth/relay_auth.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_auth - relay_auth.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:85.6 %9077
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_auth/relay_auth.dart.gcov.html b/coverage/html/core/relay_auth/relay_auth.dart.gcov.html deleted file mode 100644 index b75424a9..00000000 --- a/coverage/html/core/relay_auth/relay_auth.dart.gcov.html +++ /dev/null @@ -1,308 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_auth/relay_auth.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_auth - relay_auth.dartCoverageTotalHit
Test:lcov.infoLines:85.6 %9077
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:convert';
-       2              : import 'dart:typed_data';
-       3              : 
-       4              : import 'package:bs58/bs58.dart';
-       5              : import 'package:ed25519_edwards/ed25519_edwards.dart' as ed;
-       6              : import 'package:walletconnect_flutter_v2/apis/core/relay_auth/i_relay_auth.dart';
-       7              : import 'package:walletconnect_flutter_v2/apis/core/relay_auth/relay_auth_models.dart';
-       8              : 
-       9              : class RelayAuth implements IRelayAuth {
-      10              :   static const String multicodecEd25519Header = 'K36';
-      11              :   static const String multicodecEd25519Base = 'z';
-      12              :   static const int multicodecEd25519Length = 32;
-      13              : 
-      14              :   static const String JWT_DELIMITER = '.';
-      15              : 
-      16              :   static const String DID_DELIMITER = ':';
-      17              :   static const String DID_PREFIX = 'did';
-      18              :   static const String DID_METHOD = 'key';
-      19              : 
-      20            9 :   @override
-      21              :   Future<RelayAuthKeyPair> generateKeyPair([Uint8List? seed]) async {
-      22              :     ed.PrivateKey privateKey;
-      23              :     ed.PublicKey publicKey;
-      24              :     if (seed == null) {
-      25            0 :       final keyPair = ed.generateKey();
-      26            0 :       privateKey = keyPair.privateKey;
-      27            0 :       publicKey = keyPair.publicKey;
-      28              :     } else {
-      29            9 :       privateKey = ed.newKeyFromSeed(seed);
-      30            9 :       publicKey = ed.public(privateKey);
-      31              :     }
-      32              : 
-      33            9 :     return RelayAuthKeyPair(
-      34           18 :       Uint8List.fromList(privateKey.bytes),
-      35           18 :       Uint8List.fromList(publicKey.bytes),
-      36              :     );
-      37              :   }
-      38              : 
-      39           10 :   @override
-      40              :   Future<String> signJWT({
-      41              :     required String sub,
-      42              :     required String aud,
-      43              :     required int ttl,
-      44              :     required RelayAuthKeyPair keyPair,
-      45              :     int? iat,
-      46              :   }) async {
-      47           36 :     iat ??= DateTime.now().millisecondsSinceEpoch ~/ 1000 - 60;
-      48           10 :     final JWTHeader header = JWTHeader();
-      49           20 :     final String iss = encodeIss(keyPair.publicKeyBytes);
-      50           10 :     final int exp = iat + ttl;
-      51           10 :     final JWTPayload payload = JWTPayload(
-      52              :       iss,
-      53              :       sub,
-      54              :       aud,
-      55              :       iat,
-      56              :       exp,
-      57              :     );
-      58           10 :     final Uint8List data = encodeData(
-      59           10 :       JWTData(
-      60              :         header,
-      61              :         payload,
-      62              :       ),
-      63              :     );
-      64           10 :     Uint8List signature = ed.sign(
-      65           20 :       ed.PrivateKey(keyPair.privateKeyBytes),
-      66              :       data,
-      67              :     );
-      68              :     // List<int> signature = keyPair.sign(data);
-      69           20 :     return encodeJWT(JWTSigned(signature, payload));
-      70              :   }
-      71              : 
-      72            1 :   @override
-      73              :   Future<bool> verifyJWT(String jwt) async {
-      74            1 :     JWTDecoded decoded = decodeJWT(jwt);
-      75              : 
-      76              :     // Check the header
-      77            3 :     if (decoded.header.alg != JWTHeader.JWT_ALG ||
-      78            3 :         decoded.header.typ != JWTHeader.JWT_TYP) {
-      79            0 :       throw VerifyJWTError(
-      80              :         jwt,
-      81              :         'JWT must use EdDSA algorithm',
-      82              :       );
-      83              :     }
-      84              : 
-      85            3 :     final Uint8List publicKey = decodeIss(decoded.payload.iss);
-      86            1 :     return ed.verify(
-      87            1 :       ed.PublicKey(publicKey),
-      88            2 :       Uint8List.fromList(decoded.data),
-      89            2 :       Uint8List.fromList(decoded.signature),
-      90              :     );
-      91              :     // final VerifyKey vKey = VerifyKey(publicKey);
-      92              :     // final SignedMessage signedMessage = SignedMessage.fromList(
-      93              :     //   signedMessage: Uint8List.fromList(
-      94              :     //     decoded.signature,
-      95              :     //   ),
-      96              :     // );
-      97              :     // return vKey.verify(
-      98              :     //   signature: signedMessage.signature,
-      99              :     //   message: Uint8List.fromList(decoded.data),
-     100              :     // );
-     101              :   }
-     102              : 
-     103           10 :   String stripEquals(String s) {
-     104           10 :     return s.replaceAll('=', '');
-     105              :   }
-     106              : 
-     107           10 :   @override
-     108              :   String encodeJson(Map<String, dynamic> value) {
-     109           10 :     return stripEquals(
-     110           10 :       base64Url.encode(
-     111           10 :         jsonEncode(
-     112              :           value,
-     113           10 :         ).codeUnits,
-     114              :       ),
-     115              :     );
-     116              :   }
-     117              : 
-     118            1 :   @override
-     119              :   Map<String, dynamic> decodeJson(String s) {
-     120            1 :     return jsonDecode(
-     121            1 :       utf8.decode(
-     122            1 :         base64Url.decode(
-     123            1 :           base64Url.normalize(
-     124              :             s,
-     125              :           ),
-     126              :         ),
-     127              :       ),
-     128              :     );
-     129              :   }
-     130              : 
-     131              :   /// Encodes the public key into a multicodec issuer
-     132           10 :   @override
-     133              :   String encodeIss(Uint8List publicKey) {
-     134           20 :     Uint8List header = base58.decode(multicodecEd25519Header);
-     135              :     final String multicodec =
-     136           50 :         '$multicodecEd25519Base${base58.encode(Uint8List.fromList(header + publicKey))}';
-     137           10 :     return <String>[
-     138              :       DID_PREFIX,
-     139              :       DID_METHOD,
-     140              :       multicodec,
-     141           10 :     ].join(DID_DELIMITER);
-     142              :   }
-     143              : 
-     144              :   /// Gets the public key from the issuer
-     145            1 :   @override
-     146              :   Uint8List decodeIss(String issuer) {
-     147            1 :     List<String> split = issuer.split(DID_DELIMITER);
-     148            4 :     if (split[0] != DID_PREFIX || split[1] != DID_METHOD) {
-     149            0 :       throw IssuerDecodeError(issuer, 'Issuer must be a DID with method "key"');
-     150              :     }
-     151            1 :     final String multicodec = split[2];
-     152              : 
-     153              :     // Check the base
-     154            1 :     String base = multicodec[0];
-     155            1 :     if (base != multicodecEd25519Base) {
-     156            0 :       throw IssuerDecodeError(
-     157              :         issuer,
-     158              :         'Issuer must be a key in the multicodec format',
-     159              :       );
-     160              :     }
-     161              : 
-     162              :     // Decode
-     163            3 :     final Uint8List bytes = base58.decode(multicodec.substring(1));
-     164              : 
-     165              :     // Check the header
-     166            3 :     String header = base58.encode(bytes.sublist(0, 2));
-     167            1 :     if (header != multicodecEd25519Header) {
-     168            0 :       throw IssuerDecodeError(
-     169              :         issuer,
-     170              :         'Issuer must be a public key with type "Ed25519',
-     171              :       );
-     172              :     }
-     173              : 
-     174              :     // Slice off the public key and validate the length
-     175            1 :     final Uint8List publicKey = bytes.sublist(2);
-     176            2 :     if (publicKey.length != multicodecEd25519Length) {
-     177            0 :       throw IssuerDecodeError(
-     178              :         issuer,
-     179              :         'Issuer must be public key with length 32 bytes',
-     180              :       );
-     181              :     }
-     182              : 
-     183              :     return publicKey;
-     184              :   }
-     185              : 
-     186           10 :   @override
-     187              :   Uint8List encodeData(JWTData params) {
-     188           10 :     final String data = <String>[
-     189           30 :       encodeJson(params.header.toJson()),
-     190           30 :       encodeJson(params.payload.toJson()),
-     191           10 :     ].join(JWT_DELIMITER);
-     192              : 
-     193           20 :     return Uint8List.fromList(utf8.encode(data));
-     194              :   }
-     195              : 
-     196            0 :   @override
-     197              :   JWTData decodeData(Uint8List data) {
-     198            0 :     final List<String> params = utf8.decode(data).split(JWT_DELIMITER);
-     199              : 
-     200            0 :     JWTHeader header = JWTHeader.fromJson(jsonDecode(params[0]));
-     201            0 :     JWTPayload payload = JWTPayload.fromJson(jsonDecode(params[1]));
-     202              : 
-     203            0 :     return JWTData(header, payload);
-     204              :   }
-     205              : 
-     206           10 :   @override
-     207              :   String encodeSig(Uint8List bytes) {
-     208           20 :     return stripEquals(base64Url.encode(bytes));
-     209              :   }
-     210              : 
-     211            1 :   @override
-     212              :   Uint8List decodeSig(String encoded) {
-     213            3 :     return Uint8List.fromList(base64Url.decode(base64Url.normalize(encoded)));
-     214              :   }
-     215              : 
-     216           10 :   @override
-     217              :   String encodeJWT(JWTSigned params) {
-     218           10 :     return <String>[
-     219           30 :       encodeJson(params.header.toJson()),
-     220           30 :       encodeJson(params.payload.toJson()),
-     221           30 :       encodeSig(Uint8List.fromList(params.signature)),
-     222           10 :     ].join(JWT_DELIMITER);
-     223              :   }
-     224              : 
-     225            1 :   @override
-     226              :   JWTDecoded decodeJWT(String encoded) {
-     227            1 :     final List<String> params = encoded.split(JWT_DELIMITER);
-     228              : 
-     229            3 :     JWTHeader header = JWTHeader.fromJson(decodeJson(params[0]));
-     230            3 :     JWTPayload payload = JWTPayload.fromJson(decodeJson(params[1]));
-     231            2 :     Uint8List signature = decodeSig(params[2]);
-     232            3 :     List<int> data = utf8.encode(params.sublist(0, 2).join(JWT_DELIMITER));
-     233              : 
-     234            1 :     return JWTDecoded(data, signature, payload, header: header);
-     235              :   }
-     236              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_auth/relay_auth_models.dart.func-c.html b/coverage/html/core/relay_auth/relay_auth_models.dart.func-c.html deleted file mode 100644 index 2fd74161..00000000 --- a/coverage/html/core/relay_auth/relay_auth_models.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_auth/relay_auth_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_auth - relay_auth_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:90.5 %2119
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_auth/relay_auth_models.dart.func.html b/coverage/html/core/relay_auth/relay_auth_models.dart.func.html deleted file mode 100644 index 5e31e8d2..00000000 --- a/coverage/html/core/relay_auth/relay_auth_models.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_auth/relay_auth_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_auth - relay_auth_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:90.5 %2119
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_auth/relay_auth_models.dart.gcov.html b/coverage/html/core/relay_auth/relay_auth_models.dart.gcov.html deleted file mode 100644 index 6439cfe6..00000000 --- a/coverage/html/core/relay_auth/relay_auth_models.dart.gcov.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_auth/relay_auth_models.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_auth - relay_auth_models.dartCoverageTotalHit
Test:lcov.infoLines:90.5 %2119
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:typed_data';
-       2              : 
-       3              : import 'package:convert/convert.dart';
-       4              : import 'package:json_annotation/json_annotation.dart';
-       5              : 
-       6              : part 'relay_auth_models.g.dart';
-       7              : 
-       8              : class RelayAuthKeyPair {
-       9              :   final Uint8List privateKeyBytes;
-      10              :   final Uint8List publicKeyBytes;
-      11              :   final String privateKey;
-      12              :   final String publicKey;
-      13              : 
-      14            9 :   RelayAuthKeyPair(
-      15              :     this.privateKeyBytes,
-      16              :     this.publicKeyBytes,
-      17            9 :   )   : privateKey = hex.encode(privateKeyBytes),
-      18            9 :         publicKey = hex.encode(publicKeyBytes);
-      19              : 
-      20            1 :   RelayAuthKeyPair.fromStrings(
-      21              :     this.privateKey,
-      22              :     this.publicKey,
-      23            2 :   )   : privateKeyBytes = Uint8List.fromList(hex.decode(privateKey)),
-      24            2 :         publicKeyBytes = Uint8List.fromList(hex.decode(publicKey));
-      25              : }
-      26              : 
-      27              : @JsonSerializable()
-      28              : class JWTHeader {
-      29              :   static const JWT_ALG = 'EdDSA';
-      30              :   static const JWT_TYP = 'JWT';
-      31              : 
-      32              :   String alg;
-      33              :   String typ;
-      34              : 
-      35           10 :   JWTHeader({
-      36              :     this.alg = 'EdDSA',
-      37              :     this.typ = 'JWT',
-      38              :   });
-      39              : 
-      40            1 :   factory JWTHeader.fromJson(Map<String, dynamic> json) =>
-      41            1 :       _$JWTHeaderFromJson(json);
-      42              : 
-      43           20 :   Map<String, dynamic> toJson() => _$JWTHeaderToJson(this);
-      44              : }
-      45              : 
-      46              : @JsonSerializable()
-      47              : class JWTPayload {
-      48              :   String iss;
-      49              :   String sub;
-      50              :   String aud;
-      51              :   int iat;
-      52              :   int exp;
-      53              : 
-      54           10 :   JWTPayload(
-      55              :     this.iss,
-      56              :     this.sub,
-      57              :     this.aud,
-      58              :     this.iat,
-      59              :     this.exp,
-      60              :   );
-      61              : 
-      62            1 :   factory JWTPayload.fromJson(Map<String, dynamic> json) =>
-      63            1 :       _$JWTPayloadFromJson(json);
-      64              : 
-      65           20 :   Map<String, dynamic> toJson() => _$JWTPayloadToJson(this);
-      66              : }
-      67              : 
-      68              : class JWTData {
-      69              :   JWTHeader header;
-      70              :   JWTPayload payload;
-      71              : 
-      72           10 :   JWTData(this.header, this.payload);
-      73              : }
-      74              : 
-      75              : class JWTSigned extends JWTData {
-      76              :   List<int> signature;
-      77              : 
-      78           10 :   JWTSigned(
-      79              :     this.signature,
-      80              :     JWTPayload payload, {
-      81              :     JWTHeader? header,
-      82           20 :   }) : super(header ?? JWTHeader(), payload);
-      83              : }
-      84              : 
-      85              : class JWTDecoded extends JWTSigned {
-      86              :   List<int> data;
-      87              : 
-      88            1 :   JWTDecoded(
-      89              :     this.data,
-      90              :     List<int> signature,
-      91              :     JWTPayload payload, {
-      92              :     JWTHeader? header,
-      93            1 :   }) : super(signature, payload, header: header);
-      94              : }
-      95              : 
-      96              : class IssuerDecodeError {
-      97              :   String received;
-      98              :   String message;
-      99              : 
-     100            0 :   IssuerDecodeError(
-     101              :     this.received,
-     102              :     this.message,
-     103              :   );
-     104              : }
-     105              : 
-     106              : class VerifyJWTError {
-     107              :   String jwt;
-     108              :   String message;
-     109              : 
-     110            0 :   VerifyJWTError(
-     111              :     this.jwt,
-     112              :     this.message,
-     113              :   );
-     114              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/i_relay_client.dart.func-c.html b/coverage/html/core/relay_client/i_relay_client.dart.func-c.html deleted file mode 100644 index 54f8658c..00000000 --- a/coverage/html/core/relay_client/i_relay_client.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/i_relay_client.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client - i_relay_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %10
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/i_relay_client.dart.func.html b/coverage/html/core/relay_client/i_relay_client.dart.func.html deleted file mode 100644 index ee7c9d5b..00000000 --- a/coverage/html/core/relay_client/i_relay_client.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/i_relay_client.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client - i_relay_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %10
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/i_relay_client.dart.gcov.html b/coverage/html/core/relay_client/i_relay_client.dart.gcov.html deleted file mode 100644 index f6d8c43a..00000000 --- a/coverage/html/core/relay_client/i_relay_client.dart.gcov.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/i_relay_client.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client - i_relay_client.dartCoverageTotalHit
Test:lcov.infoLines:0.0 %10
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:event/event.dart';
-       2              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client_models.dart';
-       3              : 
-       4              : class PublishOptions {
-       5              :   final Relay? relay;
-       6              :   final int? ttl;
-       7              :   final bool? prompt;
-       8              :   final int? tag;
-       9              : 
-      10            0 :   PublishOptions(this.relay, this.ttl, this.prompt, this.tag);
-      11              : }
-      12              : 
-      13              : abstract class IRelayClient {
-      14              :   /// Relay Client Events
-      15              :   abstract final Event<MessageEvent> onRelayClientMessage;
-      16              :   abstract final Event onRelayClientConnect;
-      17              :   abstract final Event onRelayClientDisconnect;
-      18              :   abstract final Event<ErrorEvent> onRelayClientError;
-      19              : 
-      20              :   /// JSON RPC Events
-      21              :   // Event<EventArgs> onJsonRpcPayload();
-      22              :   // Event<EventArgs> onJsonRpcConnect();
-      23              :   // Event<EventArgs> onJsonRpcDisconnect();
-      24              :   // Event<ErrorEvent> onJsonRpcError();
-      25              : 
-      26              :   /// Subscriber Events
-      27              :   abstract final Event<SubscriptionEvent> onSubscriptionCreated;
-      28              :   abstract final Event<SubscriptionDeletionEvent> onSubscriptionDeleted;
-      29              :   // Event<EventArgs> onSubscriptionExpired();
-      30              :   // Event<EventArgs> onSubscriptionDisabled();
-      31              :   abstract final Event onSubscriptionSync;
-      32              :   abstract final Event onSubscriptionResubscribed;
-      33              : 
-      34              :   /// Returns true if the client is connected to a relay server
-      35              :   bool get isConnected;
-      36              : 
-      37              :   Future<void> init();
-      38              :   Future<void> publish({
-      39              :     required String topic,
-      40              :     required String message,
-      41              :     required int ttl,
-      42              :     required int tag,
-      43              :   });
-      44              :   Future<String> subscribe({required String topic});
-      45              :   Future<void> unsubscribe({required String topic});
-      46              :   Future<void> connect({String? relayUrl});
-      47              :   Future<void> disconnect();
-      48              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/index-sort-f.html b/coverage/html/core/relay_client/index-sort-f.html deleted file mode 100644 index 7cfdd313..00000000 --- a/coverage/html/core/relay_client/index-sort-f.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_clientCoverageTotalHit
Test:lcov.infoLines:85.6 %201172
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
i_relay_client.dart -
0.0%
-
0.0 %1-
message_tracker.dart -
100.0%
-
100.0 %1818-
relay_client.dart -
86.6%86.6%
-
86.6 %172149-
relay_client_models.dart -
50.0%50.0%
-
50.0 %105-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/index-sort-l.html b/coverage/html/core/relay_client/index-sort-l.html deleted file mode 100644 index 3026d9c7..00000000 --- a/coverage/html/core/relay_client/index-sort-l.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_clientCoverageTotalHit
Test:lcov.infoLines:85.6 %201172
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
i_relay_client.dart -
0.0%
-
0.0 %1
relay_client_models.dart -
50.0%50.0%
-
50.0 %105
relay_client.dart -
86.6%86.6%
-
86.6 %172149
message_tracker.dart -
100.0%
-
100.0 %1818
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/index.html b/coverage/html/core/relay_client/index.html deleted file mode 100644 index 46c46c2e..00000000 --- a/coverage/html/core/relay_client/index.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_clientCoverageTotalHit
Test:lcov.infoLines:85.6 %201172
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
i_relay_client.dart -
0.0%
-
0.0 %1
message_tracker.dart -
100.0%
-
100.0 %1818
relay_client.dart -
86.6%86.6%
-
86.6 %172149
relay_client_models.dart -
50.0%50.0%
-
50.0 %105
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/error_code.dart.func-c.html b/coverage/html/core/relay_client/json_rpc_2/error_code.dart.func-c.html deleted file mode 100644 index 79cbf549..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/error_code.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/error_code.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2 - error_code.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %60
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/error_code.dart.func.html b/coverage/html/core/relay_client/json_rpc_2/error_code.dart.func.html deleted file mode 100644 index c1058981..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/error_code.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/error_code.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2 - error_code.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %60
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/error_code.dart.gcov.html b/coverage/html/core/relay_client/json_rpc_2/error_code.dart.gcov.html deleted file mode 100644 index 6247e776..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/error_code.dart.gcov.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/error_code.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2 - error_code.dartCoverageTotalHit
Test:lcov.infoLines:0.0 %60
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-       2              : // for details. All rights reserved. Use of this source code is governed by a
-       3              : // BSD-style license that can be found in the LICENSE file.
-       4              : 
-       5              : // ignore_for_file: constant_identifier_names
-       6              : 
-       7              : /// Error codes defined in the [JSON-RPC 2.0 specificiation][spec].
-       8              : ///
-       9              : /// These codes are generally used for protocol-level communication. Most of
-      10              : /// them shouldn't be used by the application. Those that should have
-      11              : /// convenience constructors in [RpcException].
-      12              : ///
-      13              : /// [spec]: http://www.jsonrpc.org/specification#error_object
-      14              : /// An error code indicating that invalid JSON was received by the server.
-      15              : const PARSE_ERROR = -32700;
-      16              : 
-      17              : /// An error code indicating that the request JSON was invalid according to the
-      18              : /// JSON-RPC 2.0 spec.
-      19              : const INVALID_REQUEST = -32600;
-      20              : 
-      21              : /// An error code indicating that the requested method does not exist or is
-      22              : /// unavailable.
-      23              : const METHOD_NOT_FOUND = -32601;
-      24              : 
-      25              : /// An error code indicating that the request parameters are invalid for the
-      26              : /// requested method.
-      27              : const INVALID_PARAMS = -32602;
-      28              : 
-      29              : /// An internal JSON-RPC error.
-      30              : const INTERNAL_ERROR = -32603;
-      31              : 
-      32              : /// An unexpected error occurred on the server.
-      33              : ///
-      34              : /// The spec reserves the range from -32000 to -32099 for implementation-defined
-      35              : /// server exceptions, but for now we only use one of those values.
-      36              : const SERVER_ERROR = -32000;
-      37              : 
-      38              : /// Returns a human-readable name for [errorCode] if it's one specified by the
-      39              : /// JSON-RPC 2.0 spec.
-      40              : ///
-      41              : /// If [errorCode] isn't defined in the JSON-RPC 2.0 spec, returns null.
-      42            0 : String? name(int errorCode) {
-      43              :   switch (errorCode) {
-      44            0 :     case PARSE_ERROR:
-      45              :       return 'parse error';
-      46            0 :     case INVALID_REQUEST:
-      47              :       return 'invalid request';
-      48            0 :     case METHOD_NOT_FOUND:
-      49              :       return 'method not found';
-      50            0 :     case INVALID_PARAMS:
-      51              :       return 'invalid parameters';
-      52            0 :     case INTERNAL_ERROR:
-      53              :       return 'internal error';
-      54              :     default:
-      55              :       return null;
-      56              :   }
-      57              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/index-sort-f.html b/coverage/html/core/relay_client/json_rpc_2/index-sort-f.html deleted file mode 100644 index c449153c..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/index-sort-f.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2 - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2CoverageTotalHit
Test:lcov.infoLines:0.0 %60
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
error_code.dart -
0.0%
-
0.0 %6-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/index-sort-l.html b/coverage/html/core/relay_client/json_rpc_2/index-sort-l.html deleted file mode 100644 index 83dd21b6..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/index-sort-l.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2 - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2CoverageTotalHit
Test:lcov.infoLines:0.0 %60
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
error_code.dart -
0.0%
-
0.0 %6
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/index.html b/coverage/html/core/relay_client/json_rpc_2/index.html deleted file mode 100644 index e92c9983..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/index.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2 - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2CoverageTotalHit
Test:lcov.infoLines:0.0 %60
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
error_code.dart -
0.0%
-
0.0 %6
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/src/client.dart.func-c.html b/coverage/html/core/relay_client/json_rpc_2/src/client.dart.func-c.html deleted file mode 100644 index 8648fe37..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/src/client.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/src/client.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2/src - client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:73.1 %7857
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/src/client.dart.func.html b/coverage/html/core/relay_client/json_rpc_2/src/client.dart.func.html deleted file mode 100644 index cfc385b8..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/src/client.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/src/client.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2/src - client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:73.1 %7857
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/src/client.dart.gcov.html b/coverage/html/core/relay_client/json_rpc_2/src/client.dart.gcov.html deleted file mode 100644 index 9dd27861..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/src/client.dart.gcov.html +++ /dev/null @@ -1,316 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/src/client.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2/src - client.dartCoverageTotalHit
Test:lcov.infoLines:73.1 %7857
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-       2              : // for details. All rights reserved. Use of this source code is governed by a
-       3              : // BSD-style license that can be found in the LICENSE file.
-       4              : 
-       5              : import 'dart:async';
-       6              : 
-       7              : import 'package:stack_trace/stack_trace.dart';
-       8              : import 'package:stream_channel/stream_channel.dart';
-       9              : 
-      10              : import 'exception.dart';
-      11              : import 'utils.dart';
-      12              : 
-      13              : /// A JSON-RPC 2.0 client.
-      14              : ///
-      15              : /// A client calls methods on a server and handles the server's responses to
-      16              : /// those method calls. Methods can be called with [sendRequest], or with
-      17              : /// [sendNotification] if no response is expected.
-      18              : class Client {
-      19              :   final StreamChannel<dynamic> _channel;
-      20              : 
-      21              :   /// The next request id.
-      22              :   var _id = 0;
-      23              : 
-      24              :   /// The current batch of requests to be sent together.
-      25              :   ///
-      26              :   /// Each element is a JSON RPC spec compliant message.
-      27              :   List<Map<String, dynamic>>? _batch;
-      28              : 
-      29              :   /// The map of request ids to pending requests.
-      30              :   final _pendingRequests = <int, _Request>{};
-      31              : 
-      32              :   final _done = Completer<void>();
-      33              : 
-      34              :   /// Returns a [Future] that completes when the underlying connection is
-      35              :   /// closed.
-      36              :   ///
-      37              :   /// This is the same future that's returned by [listen] and [close]. It may
-      38              :   /// complete before [close] is called if the remote endpoint closes the
-      39              :   /// connection.
-      40           24 :   Future get done => _done.future;
-      41              : 
-      42              :   /// Whether the underlying connection is closed.
-      43              :   ///
-      44              :   /// Note that this will be `true` before [close] is called if the remote
-      45              :   /// endpoint closes the connection.
-      46           24 :   bool get isClosed => _done.isCompleted;
-      47              : 
-      48              :   /// Creates a [Client] that communicates over [channel].
-      49              :   ///
-      50              :   /// Note that the client won't begin listening to [responses] until
-      51              :   /// [Client.listen] is called.
-      52            0 :   Client(StreamChannel<String> channel)
-      53            0 :       : this.withoutJson(
-      54            0 :             jsonDocument.bind(channel).transformStream(ignoreFormatExceptions));
-      55              : 
-      56              :   /// Creates a [Client] that communicates using decoded messages over
-      57              :   /// [channel].
-      58              :   ///
-      59              :   /// Unlike [Client], this doesn't read or write JSON strings. Instead, it
-      60              :   /// reads and writes decoded maps or lists.
-      61              :   ///
-      62              :   /// Note that the client won't begin listening to [responses] until
-      63              :   /// [Client.listen] is called.
-      64            8 :   Client.withoutJson(this._channel) {
-      65           24 :     done.whenComplete(() {
-      66           21 :       for (var request in _pendingRequests.values) {
-      67           15 :         request.completer.completeError(StateError(
-      68           10 :             'The client closed with pending request "${request.method}".'));
-      69              :       }
-      70           16 :       _pendingRequests.clear();
-      71            8 :     }).catchError((_) {
-      72              :       // Avoid an unhandled error.
-      73              :     });
-      74              :   }
-      75              : 
-      76              :   /// Starts listening to the underlying stream.
-      77              :   ///
-      78              :   /// Returns a [Future] that will complete when the connection is closed or
-      79              :   /// when it has an error. This is the same as [done].
-      80              :   ///
-      81              :   /// [listen] may only be called once.
-      82            8 :   Future listen() {
-      83           32 :     _channel.stream.listen(_handleResponse, onError: (error, stackTrace) {
-      84            0 :       _done.completeError(error, stackTrace);
-      85            0 :       _channel.sink.close();
-      86            0 :     }, onDone: () {
-      87            0 :       if (!_done.isCompleted) _done.complete();
-      88            0 :       close();
-      89              :     });
-      90            8 :     return done;
-      91              :   }
-      92              : 
-      93              :   /// Closes the underlying connection.
-      94              :   ///
-      95              :   /// Returns a [Future] that completes when all resources have been released.
-      96              :   /// This is the same as [done].
-      97            8 :   Future close() {
-      98           24 :     _channel.sink.close();
-      99           32 :     if (!_done.isCompleted) _done.complete();
-     100            8 :     return done;
-     101              :   }
-     102              : 
-     103              :   /// Sends a JSON-RPC 2 request to invoke the given [method].
-     104              :   ///
-     105              :   /// If passed, [parameters] is the parameters for the method. This must be
-     106              :   /// either an [Iterable] (to pass parameters by position) or a [Map] with
-     107              :   /// [String] keys (to pass parameters by name). Either way, it must be
-     108              :   /// JSON-serializable.
-     109              :   ///
-     110              :   /// If the request succeeds, this returns the response result as a decoded
-     111              :   /// JSON-serializable object. If it fails, it throws an [RpcException]
-     112              :   /// describing the failure.
-     113              :   ///
-     114              :   /// Throws a [StateError] if the client is closed while the request is in
-     115              :   /// flight, or if the client is closed when this method is called.
-     116            8 :   Future sendRequest(String method, [parameters, int? id]) {
-     117            0 :     var idAct = id ?? _id++;
-     118            8 :     _send(method, parameters, idAct);
-     119              : 
-     120            8 :     var completer = Completer.sync();
-     121           32 :     _pendingRequests[idAct] = _Request(method, completer, Chain.current());
-     122            8 :     return completer.future;
-     123              :   }
-     124              : 
-     125              :   /// Sends a JSON-RPC 2 request to invoke the given [method] without expecting
-     126              :   /// a response.
-     127              :   ///
-     128              :   /// If passed, [parameters] is the parameters for the method. This must be
-     129              :   /// either an [Iterable] (to pass parameters by position) or a [Map] with
-     130              :   /// [String] keys (to pass parameters by name). Either way, it must be
-     131              :   /// JSON-serializable.
-     132              :   ///
-     133              :   /// Since this is just a notification to which the server isn't expected to
-     134              :   /// send a response, it has no return value.
-     135              :   ///
-     136              :   /// Throws a [StateError] if the client is closed when this method is called.
-     137            0 :   void sendNotification(String method, [parameters]) =>
-     138            0 :       _send(method, parameters);
-     139              : 
-     140              :   /// A helper method for [sendRequest] and [sendNotification].
-     141              :   ///
-     142              :   /// Sends a request to invoke [method] with [parameters]. If [id] is given,
-     143              :   /// the request uses that id.
-     144            8 :   void _send(String method, parameters, [int? id]) {
-     145            8 :     if (parameters is Iterable) parameters = parameters.toList();
-     146            8 :     if (parameters is! Map && parameters is! List && parameters != null) {
-     147            0 :       throw ArgumentError('Only maps and lists may be used as JSON-RPC '
-     148              :           'parameters, was "$parameters".');
-     149              :     }
-     150            8 :     if (isClosed) throw StateError('The client is closed.');
-     151              : 
-     152            8 :     var message = <String, dynamic>{'jsonrpc': '2.0', 'method': method};
-     153            8 :     if (id != null) message['id'] = id;
-     154            8 :     if (parameters != null) message['params'] = parameters;
-     155              : 
-     156            8 :     if (_batch != null) {
-     157            0 :       _batch!.add(message);
-     158              :     } else {
-     159           24 :       _channel.sink.add(message);
-     160              :     }
-     161              :   }
-     162              : 
-     163              :   /// Runs [callback] and batches any requests sent until it returns.
-     164              :   ///
-     165              :   /// A batch of requests is sent in a single message on the underlying stream,
-     166              :   /// and the responses are likewise sent back in a single message.
-     167              :   ///
-     168              :   /// [callback] may be synchronous or asynchronous. If it returns a [Future],
-     169              :   /// requests will be batched until that Future returns; otherwise, requests
-     170              :   /// will only be batched while synchronously executing [callback].
-     171              :   ///
-     172              :   /// If this is called in the context of another [withBatch] call, it just
-     173              :   /// invokes [callback] without creating another batch. This means that
-     174              :   /// responses are batched until the first batch ends.
-     175            0 :   void withBatch(Function() callback) {
-     176            0 :     if (_batch != null) {
-     177            0 :       callback();
-     178              :       return;
-     179              :     }
-     180              : 
-     181            0 :     _batch = [];
-     182            0 :     return tryFinally(callback, () {
-     183            0 :       _channel.sink.add(_batch);
-     184            0 :       _batch = null;
-     185              :     });
-     186              :   }
-     187              : 
-     188              :   /// Handles a decoded response from the server.
-     189            8 :   void _handleResponse(response) {
-     190            8 :     if (response is List) {
-     191            0 :       response.forEach(_handleSingleResponse);
-     192              :     } else {
-     193            8 :       _handleSingleResponse(response);
-     194              :     }
-     195              :   }
-     196              : 
-     197              :   /// Handles a decoded response from the server after batches have been
-     198              :   /// resolved.
-     199            8 :   void _handleSingleResponse(response) {
-     200            8 :     if (!_isResponseValid(response)) return;
-     201            8 :     var id = response['id'];
-     202            8 :     id = (id is String) ? int.parse(id) : id;
-     203           16 :     var request = _pendingRequests.remove(id)!;
-     204            8 :     if (response.containsKey('result')) {
-     205           21 :       request.completer.complete(response['result']);
-     206              :     } else {
-     207            8 :       request.completer.completeError(
-     208           20 :           RpcException(response['error']['code'], response['error']['message'],
-     209            8 :               data: response['error']['data']),
-     210            4 :           request.chain);
-     211              :     }
-     212              :   }
-     213              : 
-     214              :   /// Determines whether the server's response is valid per the spec.
-     215            8 :   bool _isResponseValid(response) {
-     216            8 :     if (response is! Map) return false;
-     217           16 :     if (response['jsonrpc'] != '2.0') return false;
-     218            8 :     var id = response['id'];
-     219            8 :     id = (id is String) ? int.parse(id) : id;
-     220           16 :     if (!_pendingRequests.containsKey(id)) return false;
-     221            8 :     if (response.containsKey('result')) return true;
-     222              : 
-     223            4 :     if (!response.containsKey('error')) return false;
-     224            4 :     var error = response['error'];
-     225            4 :     if (error is! Map) return false;
-     226            8 :     if (error['code'] is! int) return false;
-     227            8 :     if (error['message'] is! String) return false;
-     228              :     return true;
-     229              :   }
-     230              : }
-     231              : 
-     232              : /// A pending request to the server.
-     233              : class _Request {
-     234              :   /// THe method that was sent.
-     235              :   final String method;
-     236              : 
-     237              :   /// The completer to use to complete the response future.
-     238              :   final Completer completer;
-     239              : 
-     240              :   /// The stack chain from where the request was made.
-     241              :   final Chain chain;
-     242              : 
-     243            8 :   _Request(this.method, this.completer, this.chain);
-     244              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/src/exception.dart.func-c.html b/coverage/html/core/relay_client/json_rpc_2/src/exception.dart.func-c.html deleted file mode 100644 index c6018733..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/src/exception.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/src/exception.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2/src - exception.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:4.8 %211
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/src/exception.dart.func.html b/coverage/html/core/relay_client/json_rpc_2/src/exception.dart.func.html deleted file mode 100644 index 58967808..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/src/exception.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/src/exception.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2/src - exception.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:4.8 %211
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/src/exception.dart.gcov.html b/coverage/html/core/relay_client/json_rpc_2/src/exception.dart.gcov.html deleted file mode 100644 index c1d60b31..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/src/exception.dart.gcov.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/src/exception.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2/src - exception.dartCoverageTotalHit
Test:lcov.infoLines:4.8 %211
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-       2              : // for details. All rights reserved. Use of this source code is governed by a
-       3              : // BSD-style license that can be found in the LICENSE file.
-       4              : 
-       5              : import '../error_code.dart' as error_code;
-       6              : 
-       7              : /// An exception from a JSON-RPC server that can be translated into an error
-       8              : /// response.
-       9              : class RpcException implements Exception {
-      10              :   /// The error code.
-      11              :   ///
-      12              :   /// All non-negative error codes are available for use by application
-      13              :   /// developers.
-      14              :   final int code;
-      15              : 
-      16              :   /// The error message.
-      17              :   ///
-      18              :   /// This should be limited to a concise single sentence. Further information
-      19              :   /// should be supplied via [data].
-      20              :   final String message;
-      21              : 
-      22              :   /// Extra application-defined information about the error.
-      23              :   ///
-      24              :   /// This must be a JSON-serializable object. If it's a [Map] without a
-      25              :   /// `"request"` key, a copy of the request that caused the error will
-      26              :   /// automatically be injected.
-      27              :   final Object? data;
-      28              : 
-      29            4 :   RpcException(this.code, this.message, {this.data});
-      30              : 
-      31              :   /// An exception indicating that the method named [methodName] was not found.
-      32              :   ///
-      33              :   /// This should usually be used only by fallback handlers.
-      34            0 :   RpcException.methodNotFound(String methodName)
-      35            0 :       : this(error_code.METHOD_NOT_FOUND, 'Unknown method "$methodName".');
-      36              : 
-      37              :   /// An exception indicating that the parameters for the requested method were
-      38              :   /// invalid.
-      39              :   ///
-      40              :   /// Methods can use this to reject requests with invalid parameters.
-      41            0 :   RpcException.invalidParams(String message)
-      42            0 :       : this(error_code.INVALID_PARAMS, message);
-      43              : 
-      44              :   /// Converts this exception into a JSON-serializable object that's a valid
-      45              :   /// JSON-RPC 2.0 error response.
-      46            0 :   Map<String, dynamic> serialize(request) {
-      47              :     dynamic modifiedData;
-      48            0 :     if (data is Map && !(data as Map).containsKey('request')) {
-      49            0 :       modifiedData = Map.from(data as Map);
-      50            0 :       modifiedData['request'] = request;
-      51            0 :     } else if (data == null) {
-      52            0 :       modifiedData = {'request': request};
-      53              :     } else {
-      54            0 :       modifiedData = data;
-      55              :     }
-      56              : 
-      57            0 :     var id = request is Map ? request['id'] : null;
-      58            0 :     if (id is! String && id is! num) id = null;
-      59            0 :     return {
-      60              :       'jsonrpc': '2.0',
-      61            0 :       'error': {'code': code, 'message': message, 'data': modifiedData},
-      62              :       'id': id
-      63              :     };
-      64              :   }
-      65              : 
-      66            0 :   @override
-      67              :   String toString() {
-      68            0 :     var prefix = 'JSON-RPC error $code';
-      69            0 :     var errorName = error_code.name(code);
-      70            0 :     if (errorName != null) prefix += ' ($errorName)';
-      71            0 :     return '$prefix: $message';
-      72              :   }
-      73              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/src/index-sort-f.html b/coverage/html/core/relay_client/json_rpc_2/src/index-sort-f.html deleted file mode 100644 index ffac39ce..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/src/index-sort-f.html +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/src - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2/srcCoverageTotalHit
Test:lcov.infoLines:40.8 %360147
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
client.dart -
73.1%73.1%
-
73.1 %7857-
exception.dart -
4.8%4.8%
-
4.8 %211-
parameters.dart -
18.3%18.3%
-
18.3 %9317-
peer.dart -
59.2%59.2%
-
59.2 %4929-
server.dart -
39.2%39.2%
-
39.2 %9738-
utils.dart -
22.7%22.7%
-
22.7 %225-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/src/index-sort-l.html b/coverage/html/core/relay_client/json_rpc_2/src/index-sort-l.html deleted file mode 100644 index 9b765e9c..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/src/index-sort-l.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/src - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2/srcCoverageTotalHit
Test:lcov.infoLines:40.8 %360147
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
exception.dart -
4.8%4.8%
-
4.8 %211
parameters.dart -
18.3%18.3%
-
18.3 %9317
utils.dart -
22.7%22.7%
-
22.7 %225
server.dart -
39.2%39.2%
-
39.2 %9738
peer.dart -
59.2%59.2%
-
59.2 %4929
client.dart -
73.1%73.1%
-
73.1 %7857
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/src/index.html b/coverage/html/core/relay_client/json_rpc_2/src/index.html deleted file mode 100644 index ab6c1d41..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/src/index.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/src - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2/srcCoverageTotalHit
Test:lcov.infoLines:40.8 %360147
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
client.dart -
73.1%73.1%
-
73.1 %7857
exception.dart -
4.8%4.8%
-
4.8 %211
parameters.dart -
18.3%18.3%
-
18.3 %9317
peer.dart -
59.2%59.2%
-
59.2 %4929
server.dart -
39.2%39.2%
-
39.2 %9738
utils.dart -
22.7%22.7%
-
22.7 %225
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.func-c.html b/coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.func-c.html deleted file mode 100644 index 8f03765c..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/src/parameters.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2/src - parameters.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:18.3 %9317
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.func.html b/coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.func.html deleted file mode 100644 index 98937a45..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/src/parameters.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2/src - parameters.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:18.3 %9317
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.gcov.html b/coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.gcov.html deleted file mode 100644 index 859acf14..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/src/parameters.dart.gcov.html +++ /dev/null @@ -1,420 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/src/parameters.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2/src - parameters.dartCoverageTotalHit
Test:lcov.infoLines:18.3 %9317
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-       2              : // for details. All rights reserved. Use of this source code is governed by a
-       3              : // BSD-style license that can be found in the LICENSE file.
-       4              : 
-       5              : import 'dart:convert';
-       6              : 
-       7              : import 'exception.dart';
-       8              : 
-       9              : /// A wrapper for the parameters to a server method.
-      10              : ///
-      11              : /// JSON-RPC 2.0 allows parameters that are either a list or a map. This class
-      12              : /// provides functions that not only assert that the parameters object is the
-      13              : /// correct type, but also that the expected arguments exist and are themselves
-      14              : /// the correct type.
-      15              : ///
-      16              : /// Example usage:
-      17              : ///
-      18              : ///     server.registerMethod("subtract", (params) {
-      19              : ///       return params["minuend"].asNum - params["subtrahend"].asNum;
-      20              : ///     });
-      21              : class Parameters {
-      22              :   /// The name of the method that this request called.
-      23              :   final String method;
-      24              : 
-      25              :   /// The underlying value of the parameters object.
-      26              :   ///
-      27              :   /// If this is accessed for a [Parameter] that was not passed, the request
-      28              :   /// will be automatically rejected. To avoid this, use [Parameter.valueOr].
-      29              :   final dynamic value;
-      30              : 
-      31            7 :   Parameters(this.method, this.value);
-      32              : 
-      33              :   /// Returns a single parameter.
-      34              :   ///
-      35              :   /// If [key] is a [String], the request is expected to provide named
-      36              :   /// parameters. If it's an [int], the request is expected to provide
-      37              :   /// positional parameters. Requests that don't do so will be rejected
-      38              :   /// automatically.
-      39              :   ///
-      40              :   /// Whether or not the given parameter exists, this returns a [Parameter]
-      41              :   /// object. If a parameter's value is accessed through a getter like [value]
-      42              :   /// or [Parameter.asNum], the request will be rejected if that parameter
-      43              :   /// doesn't exist. On the other hand, if it's accessed through a method with a
-      44              :   /// default value like [Parameter.valueOr] or [Parameter.asNumOr], the default
-      45              :   /// value will be returned.
-      46            7 :   Parameter operator [](key) {
-      47            7 :     if (key is int) {
-      48            0 :       _assertPositional();
-      49            0 :       if (key < value.length) {
-      50            0 :         return Parameter._(method, value[key], this, key);
-      51              :       } else {
-      52            0 :         return _MissingParameter(method, this, key);
-      53              :       }
-      54            7 :     } else if (key is String) {
-      55            7 :       _assertNamed();
-      56           14 :       if (value.containsKey(key)) {
-      57           28 :         return Parameter._(method, value[key], this, key);
-      58              :       } else {
-      59            0 :         return _MissingParameter(method, this, key);
-      60              :       }
-      61              :     } else {
-      62            0 :       throw ArgumentError('Parameters[] only takes an int or a string, was '
-      63              :           '"$key".');
-      64              :     }
-      65              :   }
-      66              : 
-      67              :   /// Asserts that [value] exists and is a [List] and returns it.
-      68            0 :   List get asList {
-      69            0 :     _assertPositional();
-      70            0 :     return value;
-      71              :   }
-      72              : 
-      73              :   /// Asserts that [value] exists and is a [Map] and returns it.
-      74            0 :   Map get asMap {
-      75            0 :     _assertNamed();
-      76            0 :     return value;
-      77              :   }
-      78              : 
-      79              :   /// Asserts that [value] is a positional argument list.
-      80            0 :   void _assertPositional() {
-      81            0 :     if (value is List) return;
-      82            0 :     throw RpcException.invalidParams('Parameters for method "$method" '
-      83              :         'must be passed by position.');
-      84              :   }
-      85              : 
-      86              :   /// Asserts that [value] is a named argument map.
-      87            7 :   void _assertNamed() {
-      88           14 :     if (value is Map) return;
-      89            0 :     throw RpcException.invalidParams('Parameters for method "$method" '
-      90              :         'must be passed by name.');
-      91              :   }
-      92              : }
-      93              : 
-      94              : /// A wrapper for a single parameter to a server method.
-      95              : ///
-      96              : /// This provides numerous functions for asserting the type of the parameter in
-      97              : /// question. These functions each have a version that asserts that the
-      98              : /// parameter exists (for example, [asNum] and [asString]) and a version that
-      99              : /// returns a default value if the parameter doesn't exist (for example,
-     100              : /// [asNumOr] and [asStringOr]). If an assertion fails, the request is
-     101              : /// automatically rejected.
-     102              : ///
-     103              : /// This extends [Parameters] to make it easy to access nested parameters. For
-     104              : /// example:
-     105              : ///
-     106              : ///     // "params.value" is "{'scores': {'home': [5, 10, 17]}}"
-     107              : ///     params['scores']['home'][2].asInt // => 17
-     108              : class Parameter extends Parameters {
-     109              :   // The parent parameters, used to construct [_path].
-     110              :   final Parameters _parent;
-     111              : 
-     112              :   /// The key used to access [this], used to construct [_path].
-     113              :   final dynamic _key;
-     114              : 
-     115              :   /// A human-readable representation of the path of getters used to get this.
-     116              :   ///
-     117              :   /// Named parameters are represented as `.name`, whereas positional parameters
-     118              :   /// are represented as `[index]`. For example: `"foo[0].bar.baz"`. Named
-     119              :   /// parameters that contain characters that are neither alphanumeric,
-     120              :   /// underscores, or hyphens will be JSON-encoded. For example: `"foo
-     121              :   /// bar"."baz.bang"`. If quotes are used for an individual component, they
-     122              :   /// won't be used for the entire string.
-     123              :   ///
-     124              :   /// An exception is made for single-level parameters. A single-level
-     125              :   /// positional parameter is just represented by the index plus one, because
-     126              :   /// "parameter 1" is clearer than "parameter [0]". A single-level named
-     127              :   /// parameter is represented by that name in quotes.
-     128            0 :   String get _path {
-     129            0 :     if (_parent is! Parameter) {
-     130            0 :       return _key is int ? (_key + 1).toString() : jsonEncode(_key);
-     131              :     }
-     132              : 
-     133            0 :     String quoteKey(key) {
-     134            0 :       if (key.contains(RegExp(r'[^a-zA-Z0-9_-]'))) return jsonEncode(key);
-     135              :       return key;
-     136              :     }
-     137              : 
-     138            0 :     String computePath(params) {
-     139            0 :       if (params._parent is! Parameter) {
-     140            0 :         return params._key is int ? '[${params._key}]' : quoteKey(params._key);
-     141              :       }
-     142              : 
-     143            0 :       var path = computePath(params._parent);
-     144            0 :       return params._key is int
-     145            0 :           ? '$path[${params._key}]'
-     146            0 :           : '$path.${quoteKey(params._key)}';
-     147              :     }
-     148              : 
-     149            0 :     return computePath(this);
-     150              :   }
-     151              : 
-     152              :   /// Whether this parameter exists.
-     153            0 :   bool get exists => true;
-     154              : 
-     155            7 :   Parameter._(String method, value, this._parent, this._key)
-     156            7 :       : super(method, value);
-     157              : 
-     158              :   /// Returns [value], or [defaultValue] if this parameter wasn't passed.
-     159            0 :   dynamic valueOr(defaultValue) => value;
-     160              : 
-     161              :   /// Asserts that [value] exists and is a number and returns it.
-     162              :   ///
-     163              :   /// [asNumOr] may be used to provide a default value instead of rejecting the
-     164              :   /// request if [value] doesn't exist.
-     165            0 :   num get asNum => _getTyped('a number', (value) => value is num);
-     166              : 
-     167              :   /// Asserts that [value] is a number and returns it.
-     168              :   ///
-     169              :   /// If [value] doesn't exist, this returns [defaultValue].
-     170            0 :   num asNumOr(num defaultValue) => asNum;
-     171              : 
-     172              :   /// Asserts that [value] exists and is an integer and returns it.
-     173              :   ///
-     174              :   /// [asIntOr] may be used to provide a default value instead of rejecting the
-     175              :   /// request if [value] doesn't exist.
-     176              :   ///
-     177              :   /// Note that which values count as integers varies between the Dart VM and
-     178              :   /// dart2js. The value `1.0` will be considered an integer under dart2js but
-     179              :   /// not under the VM.
-     180            0 :   int get asInt => _getTyped('an integer', (value) => value is int);
-     181              : 
-     182              :   /// Asserts that [value] is an integer and returns it.
-     183              :   ///
-     184              :   /// If [value] doesn't exist, this returns [defaultValue].
-     185              :   ///
-     186              :   /// Note that which values count as integers varies between the Dart VM and
-     187              :   /// dart2js. The value `1.0` will be considered an integer under dart2js but
-     188              :   /// not under the VM.
-     189            0 :   int asIntOr(int defaultValue) => asInt;
-     190              : 
-     191              :   /// Asserts that [value] exists and is a boolean and returns it.
-     192              :   ///
-     193              :   /// [asBoolOr] may be used to provide a default value instead of rejecting the
-     194              :   /// request if [value] doesn't exist.
-     195            0 :   bool get asBool => _getTyped('a boolean', (value) => value is bool);
-     196              : 
-     197              :   /// Asserts that [value] is a boolean and returns it.
-     198              :   ///
-     199              :   /// If [value] doesn't exist, this returns [defaultValue].
-     200            0 :   bool asBoolOr(bool defaultValue) => asBool;
-     201              : 
-     202              :   /// Asserts that [value] exists and is a string and returns it.
-     203              :   ///
-     204              :   /// [asStringOr] may be used to provide a default value instead of rejecting
-     205              :   /// the request if [value] doesn't exist.
-     206            0 :   String get asString => _getTyped('a string', (value) => value is String);
-     207              : 
-     208              :   /// Asserts that [value] is a string and returns it.
-     209              :   ///
-     210              :   /// If [value] doesn't exist, this returns [defaultValue].
-     211            0 :   String asStringOr(String defaultValue) => asString;
-     212              : 
-     213              :   /// Asserts that [value] exists and is a [List] and returns it.
-     214              :   ///
-     215              :   /// [asListOr] may be used to provide a default value instead of rejecting the
-     216              :   /// request if [value] doesn't exist.
-     217            0 :   @override
-     218            0 :   List get asList => _getTyped('an Array', (value) => value is List);
-     219              : 
-     220              :   /// Asserts that [value] is a [List] and returns it.
-     221              :   ///
-     222              :   /// If [value] doesn't exist, this returns [defaultValue].
-     223            0 :   List asListOr(List defaultValue) => asList;
-     224              : 
-     225              :   /// Asserts that [value] exists and is a [Map] and returns it.
-     226              :   ///
-     227              :   /// [asMapOr] may be used to provide a default value instead of rejecting the
-     228              :   /// request if [value] doesn't exist.
-     229            7 :   @override
-     230           21 :   Map get asMap => _getTyped('an Object', (value) => value is Map);
-     231              : 
-     232              :   /// Asserts that [value] is a [Map] and returns it.
-     233              :   ///
-     234              :   /// If [value] doesn't exist, this returns [defaultValue].
-     235            0 :   Map asMapOr(Map defaultValue) => asMap;
-     236              : 
-     237              :   /// Asserts that [value] exists, is a string, and can be parsed as a
-     238              :   /// [DateTime] and returns it.
-     239              :   ///
-     240              :   /// [asDateTimeOr] may be used to provide a default value instead of rejecting
-     241              :   /// the request if [value] doesn't exist.
-     242            0 :   DateTime get asDateTime => _getParsed('date/time', DateTime.parse);
-     243              : 
-     244              :   /// Asserts that [value] exists, is a string, and can be parsed as a
-     245              :   /// [DateTime] and returns it.
-     246              :   ///
-     247              :   /// If [value] doesn't exist, this returns [defaultValue].
-     248            0 :   DateTime asDateTimeOr(DateTime defaultValue) => asDateTime;
-     249              : 
-     250              :   /// Asserts that [value] exists, is a string, and can be parsed as a
-     251              :   /// [Uri] and returns it.
-     252              :   ///
-     253              :   /// [asUriOr] may be used to provide a default value instead of rejecting the
-     254              :   /// request if [value] doesn't exist.
-     255            0 :   Uri get asUri => _getParsed('URI', Uri.parse);
-     256              : 
-     257              :   /// Asserts that [value] exists, is a string, and can be parsed as a
-     258              :   /// [Uri] and returns it.
-     259              :   ///
-     260              :   /// If [value] doesn't exist, this returns [defaultValue].
-     261            0 :   Uri asUriOr(Uri defaultValue) => asUri;
-     262              : 
-     263              :   /// Get a parameter named [named] that matches [test], or the value of calling
-     264              :   /// [orElse].
-     265              :   ///
-     266              :   /// [type] is used for the error message. It should begin with an indefinite
-     267              :   /// article.
-     268            7 :   dynamic _getTyped(String type, bool Function(dynamic) test) {
-     269           21 :     if (test(value)) return value;
-     270            0 :     throw RpcException.invalidParams('Parameter $_path for method '
-     271            0 :         '"$method" must be $type, but was ${jsonEncode(value)}.');
-     272              :   }
-     273              : 
-     274            0 :   dynamic _getParsed(String description, Function(String) parse) {
-     275            0 :     var string = asString;
-     276              :     try {
-     277            0 :       return parse(string);
-     278            0 :     } on FormatException catch (error) {
-     279              :       // DateTime.parse doesn't actually include any useful information in the
-     280              :       // FormatException, just the string that was being parsed. There's no use
-     281              :       // in including that in the RPC exception. See issue 17753.
-     282            0 :       var message = error.message;
-     283            0 :       if (message == string) {
-     284              :         message = '';
-     285              :       } else {
-     286            0 :         message = '\n$message';
-     287              :       }
-     288              : 
-     289            0 :       throw RpcException.invalidParams('Parameter $_path for method '
-     290            0 :           '"$method" must be a valid $description, but was '
-     291            0 :           '${jsonEncode(string)}.$message');
-     292              :     }
-     293              :   }
-     294              : 
-     295            0 :   @override
-     296              :   void _assertPositional() {
-     297              :     // Throw the standard exception for a mis-typed list.
-     298            0 :     asList;
-     299              :   }
-     300              : 
-     301            7 :   @override
-     302              :   void _assertNamed() {
-     303              :     // Throw the standard exception for a mis-typed map.
-     304            7 :     asMap;
-     305              :   }
-     306              : }
-     307              : 
-     308              : /// A subclass of [Parameter] representing a missing parameter.
-     309              : class _MissingParameter extends Parameter {
-     310            0 :   @override
-     311              :   dynamic get value {
-     312            0 :     throw RpcException.invalidParams('Request for method "$method" is '
-     313            0 :         'missing required parameter $_path.');
-     314              :   }
-     315              : 
-     316            0 :   @override
-     317              :   bool get exists => false;
-     318              : 
-     319            0 :   _MissingParameter(String method, Parameters parent, key)
-     320            0 :       : super._(method, null, parent, key);
-     321              : 
-     322            0 :   @override
-     323              :   dynamic valueOr(defaultValue) => defaultValue;
-     324              : 
-     325            0 :   @override
-     326              :   num asNumOr(num defaultValue) => defaultValue;
-     327              : 
-     328            0 :   @override
-     329              :   int asIntOr(int defaultValue) => defaultValue;
-     330              : 
-     331            0 :   @override
-     332              :   bool asBoolOr(bool defaultValue) => defaultValue;
-     333              : 
-     334            0 :   @override
-     335              :   String asStringOr(String defaultValue) => defaultValue;
-     336              : 
-     337            0 :   @override
-     338              :   List asListOr(List defaultValue) => defaultValue;
-     339              : 
-     340            0 :   @override
-     341              :   Map asMapOr(Map defaultValue) => defaultValue;
-     342              : 
-     343            0 :   @override
-     344              :   DateTime asDateTimeOr(DateTime defaultValue) => defaultValue;
-     345              : 
-     346            0 :   @override
-     347              :   Uri asUriOr(Uri defaultValue) => defaultValue;
-     348              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/src/peer.dart.func-c.html b/coverage/html/core/relay_client/json_rpc_2/src/peer.dart.func-c.html deleted file mode 100644 index 30a72ab9..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/src/peer.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/src/peer.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2/src - peer.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:59.2 %4929
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/src/peer.dart.func.html b/coverage/html/core/relay_client/json_rpc_2/src/peer.dart.func.html deleted file mode 100644 index 6c77c970..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/src/peer.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/src/peer.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2/src - peer.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:59.2 %4929
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/src/peer.dart.gcov.html b/coverage/html/core/relay_client/json_rpc_2/src/peer.dart.gcov.html deleted file mode 100644 index 44c451d4..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/src/peer.dart.gcov.html +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/src/peer.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2/src - peer.dartCoverageTotalHit
Test:lcov.infoLines:59.2 %4929
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-       2              : // for details. All rights reserved. Use of this source code is governed by a
-       3              : // BSD-style license that can be found in the LICENSE file.
-       4              : 
-       5              : import 'dart:async';
-       6              : 
-       7              : import 'package:stream_channel/stream_channel.dart';
-       8              : 
-       9              : import 'client.dart';
-      10              : import 'parameters.dart';
-      11              : import 'server.dart';
-      12              : import 'utils.dart';
-      13              : 
-      14              : /// A JSON-RPC 2.0 client *and* server.
-      15              : ///
-      16              : /// This supports bidirectional peer-to-peer communication with another JSON-RPC
-      17              : /// 2.0 endpoint. It sends both requests and responses across the same
-      18              : /// communication channel and expects to connect to a peer that does the same.
-      19              : class Peer implements Client, Server {
-      20              :   final StreamChannel<dynamic> _channel;
-      21              : 
-      22              :   /// The underlying client that handles request-sending and response-receiving
-      23              :   /// logic.
-      24              :   late final Client _client;
-      25              : 
-      26              :   /// The underlying server that handles request-receiving and response-sending
-      27              :   /// logic.
-      28              :   late final Server _server;
-      29              : 
-      30              :   /// A stream controller that forwards incoming messages to [_server] if
-      31              :   /// they're requests.
-      32              :   final _serverIncomingForwarder = StreamController(sync: true);
-      33              : 
-      34              :   /// A stream controller that forwards incoming messages to [_client] if
-      35              :   /// they're responses.
-      36              :   final _clientIncomingForwarder = StreamController(sync: true);
-      37              : 
-      38              :   @override
-      39           56 :   late final Future done = Future.wait([_client.done, _server.done]);
-      40              : 
-      41            8 :   @override
-      42           32 :   bool get isClosed => _client.isClosed || _server.isClosed;
-      43              : 
-      44            0 :   @override
-      45            0 :   ErrorCallback? get onUnhandledError => _server.onUnhandledError;
-      46              : 
-      47            0 :   @override
-      48            0 :   bool get strictProtocolChecks => _server.strictProtocolChecks;
-      49              : 
-      50              :   /// Creates a [Peer] that communicates over [channel].
-      51              :   ///
-      52              :   /// Note that the peer won't begin listening to [channel] until [Peer.listen]
-      53              :   /// is called.
-      54              :   ///
-      55              :   /// Unhandled exceptions in callbacks will be forwarded to [onUnhandledError].
-      56              :   /// If this is not provided, unhandled exceptions will be swallowed.
-      57              :   ///
-      58              :   /// If [strictProtocolChecks] is false, the underlying [Server] will accept
-      59              :   /// some requests which are not conformant with the JSON-RPC 2.0
-      60              :   /// specification. In particular, requests missing the `jsonrpc` parameter
-      61              :   /// will be accepted.
-      62            8 :   Peer(StreamChannel<String> channel,
-      63              :       {ErrorCallback? onUnhandledError, bool strictProtocolChecks = true})
-      64            8 :       : this.withoutJson(
-      65           32 :             jsonDocument.bind(channel).transform(respondToFormatExceptions),
-      66              :             onUnhandledError: onUnhandledError,
-      67              :             strictProtocolChecks: strictProtocolChecks);
-      68              : 
-      69              :   /// Creates a [Peer] that communicates using decoded messages over [channel].
-      70              :   ///
-      71              :   /// Unlike [Peer], this doesn't read or write JSON strings. Instead, it
-      72              :   /// reads and writes decoded maps or lists.
-      73              :   ///
-      74              :   /// Note that the peer won't begin listening to [channel] until
-      75              :   /// [Peer.listen] is called.
-      76              :   ///
-      77              :   /// Unhandled exceptions in callbacks will be forwarded to [onUnhandledError].
-      78              :   /// If this is not provided, unhandled exceptions will be swallowed.
-      79              :   ///
-      80              :   /// If [strictProtocolChecks] is false, the underlying [Server] will accept
-      81              :   /// some requests which are not conformant with the JSON-RPC 2.0
-      82              :   /// specification. In particular, requests missing the `jsonrpc` parameter
-      83              :   /// will be accepted.
-      84            8 :   Peer.withoutJson(this._channel,
-      85              :       {ErrorCallback? onUnhandledError, bool strictProtocolChecks = true}) {
-      86           16 :     _server = Server.withoutJson(
-      87           40 :         StreamChannel(_serverIncomingForwarder.stream, _channel.sink),
-      88              :         onUnhandledError: onUnhandledError,
-      89              :         strictProtocolChecks: strictProtocolChecks);
-      90           16 :     _client = Client.withoutJson(
-      91           40 :         StreamChannel(_clientIncomingForwarder.stream, _channel.sink));
-      92              :   }
-      93              : 
-      94              :   // Client methods.
-      95              : 
-      96            8 :   @override
-      97              :   Future sendRequest(String method, [parameters, int? id]) =>
-      98           16 :       _client.sendRequest(method, parameters, id);
-      99              : 
-     100            0 :   @override
-     101              :   void sendNotification(String method, [parameters]) =>
-     102            0 :       _client.sendNotification(method, parameters);
-     103              : 
-     104            0 :   @override
-     105            0 :   void withBatch(Function() callback) => _client.withBatch(callback);
-     106              : 
-     107              :   // Server methods.
-     108              : 
-     109            8 :   @override
-     110              :   void registerMethod(String name, Function callback) =>
-     111           16 :       _server.registerMethod(name, callback);
-     112              : 
-     113            0 :   @override
-     114              :   void registerFallback(Function(Parameters parameters) callback) =>
-     115            0 :       _server.registerFallback(callback);
-     116              : 
-     117              :   // Shared methods.
-     118              : 
-     119            8 :   @override
-     120              :   Future listen() {
-     121           16 :     _client.listen();
-     122           16 :     _server.listen();
-     123           32 :     _channel.stream.listen((message) {
-     124            8 :       if (message is Map) {
-     125           16 :         if (message.containsKey('result') || message.containsKey('error')) {
-     126           16 :           _clientIncomingForwarder.add(message);
-     127              :         } else {
-     128           14 :           _serverIncomingForwarder.add(message);
-     129              :         }
-     130            0 :       } else if (message is List &&
-     131            0 :           message.isNotEmpty &&
-     132            0 :           message.first is Map) {
-     133            0 :         if (message.first.containsKey('result') ||
-     134            0 :             message.first.containsKey('error')) {
-     135            0 :           _clientIncomingForwarder.add(message);
-     136              :         } else {
-     137            0 :           _serverIncomingForwarder.add(message);
-     138              :         }
-     139              :       } else {
-     140              :         // Non-Map and -List messages are ill-formed, so we pass them to the
-     141              :         // server since it knows how to send error responses.
-     142            0 :         _serverIncomingForwarder.add(message);
-     143              :       }
-     144            0 :     }, onError: (error, stackTrace) {
-     145            0 :       _serverIncomingForwarder.addError(error, stackTrace);
-     146            8 :     }, onDone: close);
-     147            8 :     return done;
-     148              :   }
-     149              : 
-     150            8 :   @override
-     151              :   Future close() {
-     152           16 :     _client.close();
-     153           16 :     _server.close();
-     154            8 :     return done;
-     155              :   }
-     156              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/src/server.dart.func-c.html b/coverage/html/core/relay_client/json_rpc_2/src/server.dart.func-c.html deleted file mode 100644 index 35e2d24a..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/src/server.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/src/server.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2/src - server.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:39.2 %9738
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/src/server.dart.func.html b/coverage/html/core/relay_client/json_rpc_2/src/server.dart.func.html deleted file mode 100644 index e8fba5e2..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/src/server.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/src/server.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2/src - server.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:39.2 %9738
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/src/server.dart.gcov.html b/coverage/html/core/relay_client/json_rpc_2/src/server.dart.gcov.html deleted file mode 100644 index 943d9e9d..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/src/server.dart.gcov.html +++ /dev/null @@ -1,391 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/src/server.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2/src - server.dartCoverageTotalHit
Test:lcov.infoLines:39.2 %9738
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-       2              : // for details. All rights reserved. Use of this source code is governed by a
-       3              : // BSD-style license that can be found in the LICENSE file.
-       4              : 
-       5              : import 'dart:async';
-       6              : import 'dart:collection';
-       7              : import 'dart:convert';
-       8              : 
-       9              : import 'package:stack_trace/stack_trace.dart';
-      10              : import 'package:stream_channel/stream_channel.dart';
-      11              : 
-      12              : import '../error_code.dart' as error_code;
-      13              : import 'exception.dart';
-      14              : import 'parameters.dart';
-      15              : import 'utils.dart';
-      16              : 
-      17              : /// A callback for unhandled exceptions.
-      18              : typedef ErrorCallback = void Function(dynamic error, dynamic stackTrace);
-      19              : 
-      20              : /// A JSON-RPC 2.0 server.
-      21              : ///
-      22              : /// A server exposes methods that are called by requests, to which it provides
-      23              : /// responses. Methods can be registered using [registerMethod] and
-      24              : /// [registerFallback]. Requests can be handled using [handleRequest] and
-      25              : /// [parseRequest].
-      26              : ///
-      27              : /// Note that since requests can arrive asynchronously and methods can run
-      28              : /// asynchronously, it's possible for multiple methods to be invoked at the same
-      29              : /// time, or even for a single method to be invoked multiple times at once.
-      30              : class Server {
-      31              :   final StreamChannel<dynamic> _channel;
-      32              : 
-      33              :   /// The methods registered for this server.
-      34              :   final _methods = <String, Function>{};
-      35              : 
-      36              :   /// The fallback methods for this server.
-      37              :   ///
-      38              :   /// These are tried in order until one of them doesn't throw a
-      39              :   /// [RpcException.methodNotFound] exception.
-      40              :   final _fallbacks = Queue<Function>();
-      41              : 
-      42              :   final _done = Completer<void>();
-      43              : 
-      44              :   /// Returns a [Future] that completes when the underlying connection is
-      45              :   /// closed.
-      46              :   ///
-      47              :   /// This is the same future that's returned by [listen] and [close]. It may
-      48              :   /// complete before [close] is called if the remote endpoint closes the
-      49              :   /// connection.
-      50           24 :   Future get done => _done.future;
-      51              : 
-      52              :   /// Whether the underlying connection is closed.
-      53              :   ///
-      54              :   /// Note that this will be `true` before [close] is called if the remote
-      55              :   /// endpoint closes the connection.
-      56           24 :   bool get isClosed => _done.isCompleted;
-      57              : 
-      58              :   /// A callback that is fired on unhandled exceptions.
-      59              :   ///
-      60              :   /// In the case where a user provided callback results in an exception that
-      61              :   /// cannot be properly routed back to the client, this handler will be
-      62              :   /// invoked. If it is not set, the exception will be swallowed.
-      63              :   final ErrorCallback? onUnhandledError;
-      64              : 
-      65              :   /// Whether to strictly enforce the JSON-RPC 2.0 specification for received
-      66              :   /// messages.
-      67              :   ///
-      68              :   /// If `false`, this [Server] will accept some requests which are not
-      69              :   /// conformant with the JSON-RPC 2.0 specification. In particular, requests
-      70              :   /// missing the `jsonrpc` parameter will be accepted.
-      71              :   final bool strictProtocolChecks;
-      72              : 
-      73              :   /// Creates a [Server] that communicates over [channel].
-      74              :   ///
-      75              :   /// Note that the server won't begin listening to [requests] until
-      76              :   /// [Server.listen] is called.
-      77              :   ///
-      78              :   /// Unhandled exceptions in callbacks will be forwarded to [onUnhandledError].
-      79              :   /// If this is not provided, unhandled exceptions will be swallowed.
-      80              :   ///
-      81              :   /// If [strictProtocolChecks] is false, this [Server] will accept some
-      82              :   /// requests which are not conformant with the JSON-RPC 2.0 specification. In
-      83              :   /// particular, requests missing the `jsonrpc` parameter will be accepted.
-      84            0 :   Server(StreamChannel<String> channel,
-      85              :       {ErrorCallback? onUnhandledError, bool strictProtocolChecks = true})
-      86            0 :       : this.withoutJson(
-      87            0 :             jsonDocument.bind(channel).transform(respondToFormatExceptions),
-      88              :             onUnhandledError: onUnhandledError,
-      89              :             strictProtocolChecks: strictProtocolChecks);
-      90              : 
-      91              :   /// Creates a [Server] that communicates using decoded messages over
-      92              :   /// [channel].
-      93              :   ///
-      94              :   /// Unlike [Server], this doesn't read or write JSON strings. Instead, it
-      95              :   /// reads and writes decoded maps or lists.
-      96              :   ///
-      97              :   /// Note that the server won't begin listening to [requests] until
-      98              :   /// [Server.listen] is called.
-      99              :   ///
-     100              :   /// Unhandled exceptions in callbacks will be forwarded to [onUnhandledError].
-     101              :   /// If this is not provided, unhandled exceptions will be swallowed.
-     102              :   ///
-     103              :   /// If [strictProtocolChecks] is false, this [Server] will accept some
-     104              :   /// requests which are not conformant with the JSON-RPC 2.0 specification. In
-     105              :   /// particular, requests missing the `jsonrpc` parameter will be accepted.
-     106            8 :   Server.withoutJson(this._channel,
-     107              :       {this.onUnhandledError, this.strictProtocolChecks = true});
-     108              : 
-     109              :   /// Starts listening to the underlying stream.
-     110              :   ///
-     111              :   /// Returns a [Future] that will complete when the connection is closed or
-     112              :   /// when it has an error. This is the same as [done].
-     113              :   ///
-     114              :   /// [listen] may only be called once.
-     115            8 :   Future listen() {
-     116           32 :     _channel.stream.listen(_handleRequest, onError: (error, stackTrace) {
-     117            0 :       _done.completeError(error, stackTrace);
-     118            0 :       _channel.sink.close();
-     119            0 :     }, onDone: () {
-     120            0 :       if (!_done.isCompleted) _done.complete();
-     121              :     });
-     122            8 :     return done;
-     123              :   }
-     124              : 
-     125              :   /// Closes the underlying connection.
-     126              :   ///
-     127              :   /// Returns a [Future] that completes when all resources have been released.
-     128              :   /// This is the same as [done].
-     129            8 :   Future close() {
-     130           24 :     _channel.sink.close();
-     131           32 :     if (!_done.isCompleted) _done.complete();
-     132            8 :     return done;
-     133              :   }
-     134              : 
-     135              :   /// Registers a method named [name] on this server.
-     136              :   ///
-     137              :   /// [callback] can take either zero or one arguments. If it takes zero, any
-     138              :   /// requests for that method that include parameters will be rejected. If it
-     139              :   /// takes one, it will be passed a [Parameters] object.
-     140              :   ///
-     141              :   /// [callback] can return either a JSON-serializable object or a Future that
-     142              :   /// completes to a JSON-serializable object. Any errors in [callback] will be
-     143              :   /// reported to the client as JSON-RPC 2.0 errors.
-     144            8 :   void registerMethod(String name, Function callback) {
-     145           16 :     if (_methods.containsKey(name)) {
-     146            0 :       throw ArgumentError('There\'s already a method named "$name".');
-     147              :     }
-     148              : 
-     149           16 :     _methods[name] = callback;
-     150              :   }
-     151              : 
-     152              :   /// Registers a fallback method on this server.
-     153              :   ///
-     154              :   /// A server may have any number of fallback methods. When a request comes in
-     155              :   /// that doesn't match any named methods, each fallback is tried in order. A
-     156              :   /// fallback can pass on handling a request by throwing a
-     157              :   /// [RpcException.methodNotFound] exception.
-     158              :   ///
-     159              :   /// [callback] can return either a JSON-serializable object or a Future that
-     160              :   /// completes to a JSON-serializable object. Any errors in [callback] will be
-     161              :   /// reported to the client as JSON-RPC 2.0 errors. [callback] may send custom
-     162              :   /// errors by throwing an [RpcException].
-     163            0 :   void registerFallback(Function(Parameters parameters) callback) {
-     164            0 :     _fallbacks.add(callback);
-     165              :   }
-     166              : 
-     167              :   /// Handle a request.
-     168              :   ///
-     169              :   /// [request] is expected to be a JSON-serializable object representing a
-     170              :   /// request sent by a client. This calls the appropriate method or methods for
-     171              :   /// handling that request and returns a JSON-serializable response, or `null`
-     172              :   /// if no response should be sent. [callback] may send custom
-     173              :   /// errors by throwing an [RpcException].
-     174            7 :   Future _handleRequest(request) async {
-     175              :     dynamic response;
-     176            7 :     if (request is List) {
-     177            0 :       if (request.isEmpty) {
-     178            0 :         response = RpcException(error_code.INVALID_REQUEST,
-     179              :                 'A batch must contain at least one request.')
-     180            0 :             .serialize(request);
-     181              :       } else {
-     182            0 :         var results = await Future.wait(request.map(_handleSingleRequest));
-     183            0 :         var nonNull = results.where((result) => result != null);
-     184            0 :         if (nonNull.isEmpty) return;
-     185            0 :         response = nonNull.toList();
-     186              :       }
-     187              :     } else {
-     188            7 :       response = await _handleSingleRequest(request);
-     189              :       if (response == null) return;
-     190              :     }
-     191              : 
-     192           28 :     if (!isClosed) _channel.sink.add(response);
-     193              :   }
-     194              : 
-     195              :   /// Handles an individual parsed request.
-     196            7 :   Future _handleSingleRequest(request) async {
-     197              :     try {
-     198            7 :       _validateRequest(request);
-     199              : 
-     200            7 :       var name = request['method'];
-     201           14 :       var method = _methods[name];
-     202            0 :       method ??= _tryFallbacks;
-     203              : 
-     204              :       Object? result;
-     205            7 :       if (method is ZeroArgumentFunction) {
-     206            0 :         if (request.containsKey('params')) {
-     207            0 :           throw RpcException.invalidParams('No parameters are allowed for '
-     208              :               'method "$name".');
-     209              :         }
-     210            0 :         result = await method();
-     211              :       } else {
-     212           21 :         result = await method(Parameters(name, request['params']));
-     213              :       }
-     214              : 
-     215              :       // A request without an id is a notification, which should not be sent a
-     216              :       // response, even if one is generated on the server.
-     217            7 :       if (!request.containsKey('id')) return null;
-     218              : 
-     219           14 :       return {'jsonrpc': '2.0', 'result': result, 'id': request['id']};
-     220              :     } catch (error, stackTrace) {
-     221            0 :       if (error is RpcException) {
-     222            0 :         if (error.code == error_code.INVALID_REQUEST ||
-     223            0 :             request.containsKey('id')) {
-     224            0 :           return error.serialize(request);
-     225              :         } else {
-     226            0 :           onUnhandledError?.call(error, stackTrace);
-     227              :           return null;
-     228              :         }
-     229            0 :       } else if (!request.containsKey('id')) {
-     230            0 :         onUnhandledError?.call(error, stackTrace);
-     231              :         return null;
-     232              :       }
-     233            0 :       final chain = Chain.forTrace(stackTrace);
-     234            0 :       return RpcException(error_code.SERVER_ERROR, getErrorMessage(error),
-     235            0 :           data: {
-     236            0 :             'full': '$error',
-     237            0 :             'stack': '$chain',
-     238            0 :           }).serialize(request);
-     239              :     }
-     240              :   }
-     241              : 
-     242              :   /// Validates that [request] matches the JSON-RPC spec.
-     243            7 :   void _validateRequest(request) {
-     244            7 :     if (request is! Map) {
-     245            0 :       throw RpcException(
-     246              :           error_code.INVALID_REQUEST,
-     247              :           'Request must be '
-     248              :           'an Array or an Object.');
-     249              :     }
-     250              : 
-     251           14 :     if (strictProtocolChecks && !request.containsKey('jsonrpc')) {
-     252            0 :       throw RpcException(
-     253              :           error_code.INVALID_REQUEST,
-     254              :           'Request must '
-     255              :           'contain a "jsonrpc" key.');
-     256              :     }
-     257              : 
-     258            7 :     if ((strictProtocolChecks || request.containsKey('jsonrpc')) &&
-     259           14 :         request['jsonrpc'] != '2.0') {
-     260            0 :       throw RpcException(
-     261            0 :           error_code.INVALID_REQUEST,
-     262              :           'Invalid JSON-RPC '
-     263            0 :           'version ${jsonEncode(request['jsonrpc'])}, expected "2.0".');
-     264              :     }
-     265              : 
-     266            7 :     if (!request.containsKey('method')) {
-     267            0 :       throw RpcException(
-     268              :           error_code.INVALID_REQUEST,
-     269              :           'Request must '
-     270              :           'contain a "method" key.');
-     271              :     }
-     272              : 
-     273            7 :     var method = request['method'];
-     274           14 :     if (request['method'] is! String) {
-     275            0 :       throw RpcException(
-     276            0 :           error_code.INVALID_REQUEST,
-     277              :           'Request method must '
-     278            0 :           'be a string, but was ${jsonEncode(method)}.');
-     279              :     }
-     280              : 
-     281            7 :     if (request.containsKey('params')) {
-     282            7 :       var params = request['params'];
-     283           14 :       if (params is! List && params is! Map) {
-     284            0 :         throw RpcException(
-     285            0 :             error_code.INVALID_REQUEST,
-     286              :             'Request params must '
-     287            0 :             'be an Array or an Object, but was ${jsonEncode(params)}.');
-     288              :       }
-     289              :     }
-     290              : 
-     291            7 :     var id = request['id'];
-     292           14 :     if (id != null && id is! String && id is! num) {
-     293            0 :       throw RpcException(
-     294            0 :           error_code.INVALID_REQUEST,
-     295              :           'Request id must be a '
-     296            0 :           'string, number, or null, but was ${jsonEncode(id)}.');
-     297              :     }
-     298              :   }
-     299              : 
-     300              :   /// Try all the fallback methods in order.
-     301            0 :   Future _tryFallbacks(Parameters params) {
-     302            0 :     var iterator = _fallbacks.toList().iterator;
-     303              : 
-     304            0 :     Future tryNext() async {
-     305            0 :       if (!iterator.moveNext()) {
-     306            0 :         throw RpcException.methodNotFound(params.method);
-     307              :       }
-     308              : 
-     309              :       try {
-     310            0 :         return await iterator.current(params);
-     311            0 :       } on RpcException catch (error) {
-     312            0 :         if (error.code != error_code.METHOD_NOT_FOUND) rethrow;
-     313            0 :         return tryNext();
-     314              :       }
-     315              :     }
-     316              : 
-     317            0 :     return tryNext();
-     318              :   }
-     319              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/src/utils.dart.func-c.html b/coverage/html/core/relay_client/json_rpc_2/src/utils.dart.func-c.html deleted file mode 100644 index e2c4c6f7..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/src/utils.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/src/utils.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2/src - utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:22.7 %225
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/src/utils.dart.func.html b/coverage/html/core/relay_client/json_rpc_2/src/utils.dart.func.html deleted file mode 100644 index 72222ef4..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/src/utils.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/src/utils.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2/src - utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:22.7 %225
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/json_rpc_2/src/utils.dart.gcov.html b/coverage/html/core/relay_client/json_rpc_2/src/utils.dart.gcov.html deleted file mode 100644 index ca94c96a..00000000 --- a/coverage/html/core/relay_client/json_rpc_2/src/utils.dart.gcov.html +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/json_rpc_2/src/utils.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/json_rpc_2/src - utils.dartCoverageTotalHit
Test:lcov.infoLines:22.7 %225
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-       2              : // for details. All rights reserved. Use of this source code is governed by a
-       3              : // BSD-style license that can be found in the LICENSE file.
-       4              : 
-       5              : import 'dart:async';
-       6              : 
-       7              : import 'package:stream_channel/stream_channel.dart';
-       8              : 
-       9              : import '../error_code.dart' as error_code;
-      10              : import 'exception.dart';
-      11              : 
-      12              : typedef ZeroArgumentFunction = Function();
-      13              : 
-      14              : /// A regular expression to match the exception prefix that some exceptions'
-      15              : /// [Object.toString] values contain.
-      16            0 : final _exceptionPrefix = RegExp(r'^([A-Z][a-zA-Z]*)?(Exception|Error): ');
-      17              : 
-      18              : /// Get a string description of an exception.
-      19              : ///
-      20              : /// Many exceptions include the exception class name at the beginning of their
-      21              : /// [toString], so we remove that if it exists.
-      22            0 : String getErrorMessage(error) =>
-      23            0 :     error.toString().replaceFirst(_exceptionPrefix, '');
-      24              : 
-      25              : /// Like `try`/`finally`, run [body] and ensure that [whenComplete] runs
-      26              : /// afterwards, regardless of whether [body] succeeded.
-      27              : ///
-      28              : /// This is synchronicity-agnostic relative to [body]. If [body] returns a
-      29              : /// [Future], this wil run asynchronously; otherwise it will run synchronously.
-      30            0 : void tryFinally(Function() body, Function() whenComplete) {
-      31              :   dynamic result;
-      32              :   try {
-      33            0 :     result = body();
-      34              :   } catch (_) {
-      35            0 :     whenComplete();
-      36              :     rethrow;
-      37              :   }
-      38              : 
-      39            0 :   if (result is! Future) {
-      40            0 :     whenComplete();
-      41              :   } else {
-      42            0 :     result.whenComplete(whenComplete);
-      43              :   }
-      44              : }
-      45              : 
-      46              : /// A transformer that silently drops [FormatException]s.
-      47            0 : final ignoreFormatExceptions = StreamTransformer<Object?, Object?>.fromHandlers(
-      48            0 :     handleError: (error, stackTrace, sink) {
-      49            0 :   if (error is FormatException) return;
-      50            0 :   sink.addError(error, stackTrace);
-      51              : });
-      52              : 
-      53              : /// A transformer that sends error responses on [FormatException]s.
-      54           16 : final StreamChannelTransformer<Object?, Object?> respondToFormatExceptions =
-      55            8 :     _RespondToFormatExceptionsTransformer();
-      56              : 
-      57              : class _RespondToFormatExceptionsTransformer
-      58              :     implements StreamChannelTransformer<Object?, Object?> {
-      59            8 :   @override
-      60              :   StreamChannel<Object?> bind(StreamChannel<Object?> channel) {
-      61           16 :     return channel.changeStream((stream) {
-      62            8 :       return stream.handleError((dynamic error) {
-      63              :         final formatException = error as FormatException;
-      64            0 :         var exception = RpcException(
-      65            0 :             error_code.PARSE_ERROR, 'Invalid JSON: ${formatException.message}');
-      66            0 :         channel.sink.add(exception.serialize(formatException.source));
-      67            0 :       }, test: (error) => error is FormatException);
-      68              :     });
-      69              :   }
-      70              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/message_tracker.dart.func-c.html b/coverage/html/core/relay_client/message_tracker.dart.func-c.html deleted file mode 100644 index 9bbe532d..00000000 --- a/coverage/html/core/relay_client/message_tracker.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/message_tracker.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client - message_tracker.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %1818
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/message_tracker.dart.func.html b/coverage/html/core/relay_client/message_tracker.dart.func.html deleted file mode 100644 index f735d54f..00000000 --- a/coverage/html/core/relay_client/message_tracker.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/message_tracker.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client - message_tracker.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %1818
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/message_tracker.dart.gcov.html b/coverage/html/core/relay_client/message_tracker.dart.gcov.html deleted file mode 100644 index 1a9f3a38..00000000 --- a/coverage/html/core/relay_client/message_tracker.dart.gcov.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/message_tracker.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client - message_tracker.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %1818
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:convert';
-       2              : import 'dart:typed_data';
-       3              : 
-       4              : import 'package:convert/convert.dart';
-       5              : import 'package:pointycastle/digests/sha256.dart';
-       6              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/i_message_tracker.dart';
-       7              : import 'package:walletconnect_flutter_v2/apis/core/store/generic_store.dart';
-       8              : import 'package:walletconnect_flutter_v2/apis/core/store/store_models.dart';
-       9              : 
-      10              : class MessageTracker extends GenericStore<Map<String, String>>
-      11              :     implements IMessageTracker {
-      12           11 :   MessageTracker({
-      13              :     required super.storage,
-      14              :     required super.context,
-      15              :     required super.version,
-      16              :     required super.fromJson,
-      17              :   });
-      18              : 
-      19            8 :   String hashMessage(String message) {
-      20            8 :     return hex.encode(
-      21           16 :       SHA256Digest().process(
-      22            8 :         Uint8List.fromList(
-      23            8 :           utf8.encode(message),
-      24              :         ),
-      25              :       ),
-      26              :     );
-      27              :   }
-      28              : 
-      29            8 :   @override
-      30              :   Future<void> recordMessageEvent(String topic, String message) async {
-      31            8 :     final String hash = hashMessage(message);
-      32              : 
-      33           16 :     onCreate.broadcast(
-      34            8 :       StoreCreateEvent(
-      35              :         topic,
-      36            8 :         {hash: message},
-      37              :       ),
-      38              :     );
-      39              : 
-      40           16 :     if (!data.containsKey(topic)) {
-      41           24 :       data[topic] = {};
-      42              :     }
-      43           24 :     data[topic]![hash] = message;
-      44            8 :     await persist();
-      45              :   }
-      46              : 
-      47            8 :   @override
-      48              :   bool messageIsRecorded(String topic, String message) {
-      49            8 :     final String hash = hashMessage(message);
-      50           40 :     return data.containsKey(topic) && data[topic]!.containsKey(hash);
-      51              :   }
-      52              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/relay_client.dart.func-c.html b/coverage/html/core/relay_client/relay_client.dart.func-c.html deleted file mode 100644 index 04c62e61..00000000 --- a/coverage/html/core/relay_client/relay_client.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/relay_client.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client - relay_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:86.6 %172149
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/relay_client.dart.func.html b/coverage/html/core/relay_client/relay_client.dart.func.html deleted file mode 100644 index da54d500..00000000 --- a/coverage/html/core/relay_client/relay_client.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/relay_client.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client - relay_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:86.6 %172149
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/relay_client.dart.gcov.html b/coverage/html/core/relay_client/relay_client.dart.gcov.html deleted file mode 100644 index 8bc73788..00000000 --- a/coverage/html/core/relay_client/relay_client.dart.gcov.html +++ /dev/null @@ -1,542 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/relay_client.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client - relay_client.dartCoverageTotalHit
Test:lcov.infoLines:86.6 %172149
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:async';
-       2              : 
-       3              : import 'package:event/event.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/core/i_core.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/json_rpc_utils.dart';
-       6              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/i_message_tracker.dart';
-       7              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/i_relay_client.dart';
-       8              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/json_rpc_2/src/parameters.dart';
-       9              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/json_rpc_2/src/peer.dart';
-      10              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/i_websocket_handler.dart';
-      11              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client_models.dart';
-      12              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/websocket_handler.dart';
-      13              : import 'package:walletconnect_flutter_v2/apis/core/store/i_generic_store.dart';
-      14              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
-      15              : import 'package:walletconnect_flutter_v2/apis/utils/constants.dart';
-      16              : import 'package:walletconnect_flutter_v2/apis/utils/errors.dart';
-      17              : import 'package:walletconnect_flutter_v2/apis/utils/walletconnect_utils.dart';
-      18              : 
-      19              : class RelayClient implements IRelayClient {
-      20              :   static const JSON_RPC_PUBLISH = 'publish';
-      21              :   static const JSON_RPC_SUBSCRIPTION = 'subscription';
-      22              :   static const JSON_RPC_SUBSCRIBE = 'subscribe';
-      23              :   static const JSON_RPC_UNSUBSCRIBE = 'unsubscribe';
-      24              : 
-      25              :   /// Events ///
-      26              :   /// Relay Client
-      27              : 
-      28              :   @override
-      29              :   final Event<EventArgs> onRelayClientConnect = Event();
-      30              : 
-      31              :   @override
-      32              :   final Event<EventArgs> onRelayClientDisconnect = Event();
-      33              : 
-      34              :   @override
-      35              :   final Event<ErrorEvent> onRelayClientError = Event<ErrorEvent>();
-      36              : 
-      37              :   @override
-      38              :   final Event<MessageEvent> onRelayClientMessage = Event<MessageEvent>();
-      39              : 
-      40              :   /// Subscriptions
-      41              :   @override
-      42              :   final Event<SubscriptionEvent> onSubscriptionCreated =
-      43              :       Event<SubscriptionEvent>();
-      44              : 
-      45              :   @override
-      46              :   final Event<SubscriptionDeletionEvent> onSubscriptionDeleted =
-      47              :       Event<SubscriptionDeletionEvent>();
-      48              : 
-      49              :   @override
-      50              :   final Event<EventArgs> onSubscriptionResubscribed = Event();
-      51              : 
-      52              :   @override
-      53              :   final Event<EventArgs> onSubscriptionSync = Event();
-      54              : 
-      55            9 :   @override
-      56           25 :   bool get isConnected => jsonRPC != null && !jsonRPC!.isClosed;
-      57              : 
-      58           20 :   bool get _relayIsClosed => jsonRPC != null && jsonRPC!.isClosed;
-      59              : 
-      60              :   bool _initialized = false;
-      61              :   bool _active = true;
-      62              :   bool _connecting = false;
-      63              :   Future _connectingFuture = Future.value();
-      64              :   bool _handledClose = false;
-      65              : 
-      66              :   // late WebSocketChannel socket;
-      67              :   // IWebSocketHandler? socket;
-      68              :   Peer? jsonRPC;
-      69              : 
-      70              :   /// Stores all the subs that haven't been completed
-      71              :   Map<String, Future<dynamic>> pendingSubscriptions = {};
-      72              : 
-      73              :   IMessageTracker messageTracker;
-      74              :   IGenericStore<String> topicMap;
-      75              :   final IWebSocketHandler socketHandler;
-      76              : 
-      77              :   ICore core;
-      78              : 
-      79              :   bool _subscribedToHeartbeat = false;
-      80              : 
-      81           10 :   RelayClient({
-      82              :     required this.core,
-      83              :     required this.messageTracker,
-      84              :     required this.topicMap,
-      85              :     IWebSocketHandler? socketHandler,
-      86           10 :   }) : socketHandler = socketHandler ?? WebSocketHandler();
-      87              : 
-      88            9 :   @override
-      89              :   Future<void> init() async {
-      90            9 :     if (_initialized) {
-      91              :       return;
-      92              :     }
-      93              : 
-      94           18 :     await messageTracker.init();
-      95           18 :     await topicMap.init();
-      96              : 
-      97              :     // Setup the json RPC server
-      98            9 :     await _connect();
-      99            9 :     _subscribeToHeartbeat();
-     100              : 
-     101            9 :     _initialized = true;
-     102              :   }
-     103              : 
-     104            7 :   @override
-     105              :   Future<void> publish({
-     106              :     required String topic,
-     107              :     required String message,
-     108              :     required int ttl,
-     109              :     required int tag,
-     110              :   }) async {
-     111            7 :     _checkInitialized();
-     112              : 
-     113            7 :     Map<String, dynamic> data = {
-     114              :       'message': message,
-     115              :       'ttl': ttl,
-     116              :       'topic': topic,
-     117              :       'tag': tag,
-     118              :     };
-     119              : 
-     120              :     try {
-     121           14 :       await messageTracker.recordMessageEvent(topic, message);
-     122            7 :       var _ = await _sendJsonRpcRequest(
-     123            7 :         _buildMethod(JSON_RPC_PUBLISH),
-     124              :         data,
-     125            7 :         JsonRpcUtils.payloadId(entropy: 6),
-     126              :       );
-     127              :     } catch (e) {
-     128              :       // print(e);
-     129           15 :       onRelayClientError.broadcast(ErrorEvent(e));
-     130              :     }
-     131              :   }
-     132              : 
-     133            7 :   @override
-     134              :   Future<String> subscribe({required String topic}) async {
-     135            7 :     _checkInitialized();
-     136              : 
-     137           21 :     pendingSubscriptions[topic] = _onSubscribe(topic);
-     138              : 
-     139           14 :     return await pendingSubscriptions[topic];
-     140              :   }
-     141              : 
-     142            5 :   @override
-     143              :   Future<void> unsubscribe({required String topic}) async {
-     144            5 :     _checkInitialized();
-     145              : 
-     146           10 :     String id = topicMap.get(topic) ?? '';
-     147              : 
-     148              :     try {
-     149            5 :       await _sendJsonRpcRequest(
-     150            5 :         _buildMethod(JSON_RPC_UNSUBSCRIBE),
-     151            5 :         {
-     152              :           'topic': topic,
-     153              :           'id': id,
-     154              :         },
-     155            5 :         JsonRpcUtils.payloadId(entropy: 6),
-     156              :       );
-     157              :     } catch (e) {
-     158           12 :       onRelayClientError.broadcast(ErrorEvent(e));
-     159              :     }
-     160              : 
-     161              :     // Remove the subscription
-     162           10 :     pendingSubscriptions.remove(topic);
-     163           10 :     await topicMap.delete(topic);
-     164              : 
-     165              :     // Delete all the messages
-     166           10 :     await messageTracker.delete(topic);
-     167              :   }
-     168              : 
-     169            0 :   @override
-     170              :   Future<void> connect({String? relayUrl}) async {
-     171            0 :     _checkInitialized();
-     172              : 
-     173            0 :     core.logger.i('RelayClient: Connecting to relay');
-     174              : 
-     175            0 :     await _connect(relayUrl: relayUrl);
-     176              :   }
-     177              : 
-     178            8 :   @override
-     179              :   Future<void> disconnect() async {
-     180            8 :     _checkInitialized();
-     181              : 
-     182           24 :     core.logger.i('RelayClient: Disconnecting from relay');
-     183              : 
-     184            8 :     await _disconnect();
-     185              :   }
-     186              : 
-     187              :   /// PRIVATE FUNCTIONS ///
-     188              : 
-     189            9 :   Future<void> _connect({String? relayUrl}) async {
-     190            9 :     if (isConnected) {
-     191              :       return;
-     192              :     }
-     193              : 
-     194           36 :     core.relayUrl = relayUrl ?? core.relayUrl;
-     195           63 :     core.logger.d('[$runtimeType] Connecting to relay ${core.relayUrl}');
-     196              : 
-     197              :     // If we have tried connecting to the relay before, disconnect
-     198            9 :     if (_active) {
-     199            9 :       await _disconnect();
-     200              :     }
-     201              : 
-     202              :     try {
-     203              :       // Connect and track the connection progress, then start the heartbeat
-     204           18 :       _connectingFuture = _createJsonRPCProvider();
-     205            9 :       await _connectingFuture;
-     206            8 :       _connecting = false;
-     207            8 :       _subscribeToHeartbeat();
-     208              :       //
-     209            2 :     } on TimeoutException catch (e) {
-     210            0 :       core.logger.d('[$runtimeType] Connect timeout: $e');
-     211            0 :       onRelayClientError.broadcast(ErrorEvent('Connection to relay timeout'));
-     212            0 :       _connecting = false;
-     213            0 :       _connect();
-     214              :     } catch (e) {
-     215           10 :       core.logger.d('[$runtimeType] Connect error: $e');
-     216            6 :       onRelayClientError.broadcast(ErrorEvent(e));
-     217            2 :       _connecting = false;
-     218              :     }
-     219              :   }
-     220              : 
-     221            9 :   Future<void> _disconnect() async {
-     222           27 :     core.logger.t('RelayClient Internal: Disconnecting from relay');
-     223            9 :     _active = false;
-     224              : 
-     225            9 :     final bool shouldBroadcastDisonnect = isConnected;
-     226              : 
-     227           17 :     await jsonRPC?.close();
-     228            9 :     jsonRPC = null;
-     229           18 :     await socketHandler.close();
-     230            9 :     _unsubscribeToHeartbeat();
-     231              : 
-     232              :     if (shouldBroadcastDisonnect) {
-     233           16 :       onRelayClientDisconnect.broadcast();
-     234              :     }
-     235              :   }
-     236              : 
-     237            9 :   Future<void> _createJsonRPCProvider() async {
-     238            9 :     _connecting = true;
-     239            9 :     _active = true;
-     240           45 :     final auth = await core.crypto.signJWT(core.relayUrl);
-     241           36 :     core.logger.t('Signed JWT: $auth');
-     242            9 :     final url = WalletConnectUtils.formatRelayRpcUrl(
-     243              :       protocol: WalletConnectConstants.CORE_PROTOCOL,
-     244              :       version: WalletConnectConstants.CORE_VERSION,
-     245           18 :       relayUrl: core.relayUrl,
-     246              :       sdkVersion: WalletConnectConstants.SDK_VERSION,
-     247              :       auth: auth,
-     248           18 :       projectId: core.projectId,
-     249            9 :       packageName: (await WalletConnectUtils.getPackageName()),
-     250              :     );
-     251              : 
-     252            9 :     if (jsonRPC != null) {
-     253            0 :       await jsonRPC!.close();
-     254            0 :       jsonRPC = null;
-     255              :     }
-     256              : 
-     257           36 :     core.logger.t('Initializing WebSocket with $url');
-     258           18 :     await socketHandler.setup(url: url);
-     259           34 :     await socketHandler.connect().timeout(Duration(seconds: 5));
-     260              : 
-     261           32 :     jsonRPC = Peer(socketHandler.channel!);
-     262              : 
-     263           16 :     jsonRPC!.registerMethod(
-     264            8 :       _buildMethod(JSON_RPC_SUBSCRIPTION),
-     265            8 :       _handleSubscription,
-     266              :     );
-     267           16 :     jsonRPC!.registerMethod(
-     268            8 :       _buildMethod(JSON_RPC_SUBSCRIBE),
-     269            8 :       _handleSubscribe,
-     270              :     );
-     271           16 :     jsonRPC!.registerMethod(
-     272            8 :       _buildMethod(JSON_RPC_UNSUBSCRIBE),
-     273            8 :       _handleUnsubscribe,
-     274              :     );
-     275              : 
-     276           16 :     if (jsonRPC!.isClosed) {
-     277              :       throw const WalletConnectError(
-     278              :         code: 0,
-     279              :         message: 'WebSocket closed',
-     280              :       );
-     281              :     }
-     282              : 
-     283           16 :     jsonRPC!.listen();
-     284              : 
-     285              :     // When jsonRPC closes, emit the event
-     286            8 :     _handledClose = false;
-     287           24 :     jsonRPC!.done.then(
-     288            8 :       (value) {
-     289            8 :         _handleRelayClose(
-     290           16 :           socketHandler.closeCode,
-     291           16 :           socketHandler.closeReason,
-     292              :         );
-     293              :       },
-     294              :     );
-     295              : 
-     296           16 :     onRelayClientConnect.broadcast();
-     297           56 :     core.logger.d('[$runtimeType] Connected to relay ${core.relayUrl}');
-     298              :   }
-     299              : 
-     300            8 :   Future<void> _handleRelayClose(int? code, String? reason) async {
-     301            8 :     if (_handledClose) {
-     302            0 :       core.logger.i('Relay close already handled');
-     303              :       return;
-     304              :     }
-     305            8 :     _handledClose = true;
-     306              : 
-     307           32 :     core.logger.i('Handling relay close, code: $code, reason: $reason');
-     308              :     // If the relay isn't active (Disconnected manually), don't do anything
-     309            8 :     if (!_active) {
-     310              :       return;
-     311              :     }
-     312              : 
-     313              :     // If the code requires reconnect, do so
-     314            1 :     final reconnectCodes = [1001, 4008, 4010, 1002, 1005, 10002];
-     315              :     if (code != null) {
-     316            1 :       if (reconnectCodes.contains(code)) {
-     317            0 :         await connect();
-     318              :       } else {
-     319            1 :         await disconnect();
-     320            1 :         final errorReason = code == 3000
-     321              :             ? reason ?? WebSocketErrors.INVALID_PROJECT_ID_OR_JWT
-     322              :             : '';
-     323            2 :         onRelayClientError.broadcast(
-     324            2 :           ErrorEvent(WalletConnectError(
-     325              :             code: code,
-     326              :             message: errorReason,
-     327              :           )),
-     328              :         );
-     329              :       }
-     330              :     }
-     331              :   }
-     332              : 
-     333            9 :   void _subscribeToHeartbeat() {
-     334            9 :     if (!_subscribedToHeartbeat) {
-     335           45 :       core.heartbeat.onPulse.subscribe(_heartbeatSubscription);
-     336            9 :       _subscribedToHeartbeat = true;
-     337              :     }
-     338              :   }
-     339              : 
-     340            9 :   void _unsubscribeToHeartbeat() {
-     341           45 :     core.heartbeat.onPulse.unsubscribe(_heartbeatSubscription);
-     342            9 :     _subscribedToHeartbeat = false;
-     343              :   }
-     344              : 
-     345            5 :   void _heartbeatSubscription(EventArgs? args) async {
-     346            5 :     if (_relayIsClosed) {
-     347            0 :       await _handleRelayClose(10002, null);
-     348              :     }
-     349              :   }
-     350              : 
-     351            8 :   String _buildMethod(String method) {
-     352            8 :     return '${WalletConnectConstants.RELAYER_DEFAULT_PROTOCOL}_$method';
-     353              :   }
-     354              : 
-     355              :   /// JSON RPC MESSAGE HANDLERS
-     356              : 
-     357            7 :   Future<bool> handlePublish(String topic, String message) async {
-     358           28 :     core.logger.t('Handling Publish Message: $topic, $message');
-     359              :     // If we want to ignore the message, stop
-     360            7 :     if (await _shouldIgnoreMessageEvent(topic, message)) {
-     361           24 :       core.logger.w('Ignoring Message: $topic, $message');
-     362              :       return false;
-     363              :     }
-     364              : 
-     365              :     // Record a message event
-     366           14 :     await messageTracker.recordMessageEvent(topic, message);
-     367              : 
-     368              :     // Broadcast the message
-     369           14 :     onRelayClientMessage.broadcast(
-     370            7 :       MessageEvent(
-     371              :         topic,
-     372              :         message,
-     373              :       ),
-     374              :     );
-     375              :     return true;
-     376              :   }
-     377              : 
-     378            7 :   Future<bool> _handleSubscription(Parameters params) async {
-     379           21 :     String topic = params['data']['topic'].value;
-     380           21 :     String message = params['data']['message'].value;
-     381            7 :     return await handlePublish(topic, message);
-     382              :   }
-     383              : 
-     384            0 :   int _handleSubscribe(Parameters params) {
-     385            0 :     return params.hashCode;
-     386              :   }
-     387              : 
-     388            0 :   void _handleUnsubscribe(Parameters params) {
-     389            0 :     core.logger.i('[$runtimeType] _handleUnsubscribe $params');
-     390              :   }
-     391              : 
-     392              :   /// MESSAGE HANDLING
-     393              : 
-     394            7 :   Future<bool> _shouldIgnoreMessageEvent(String topic, String message) async {
-     395            7 :     if (!await _isSubscribed(topic)) return true;
-     396           14 :     return messageTracker.messageIsRecorded(topic, message);
-     397              :   }
-     398              : 
-     399              :   /// SUBSCRIPTION HANDLING
-     400              : 
-     401            8 :   Future _sendJsonRpcRequest(
-     402              :     String method, [
-     403              :     dynamic parameters,
-     404              :     int? id,
-     405              :   ]) async {
-     406              :     // If we are connected and we know it send the message!
-     407            8 :     if (isConnected) {
-     408              :       // Here so we dont return null
-     409              :     }
-     410              :     // If we are connecting, then wait for the connection to establish and then send the message
-     411            5 :     else if (_connecting) {
-     412            0 :       await _connectingFuture;
-     413              :     }
-     414              :     // If we aren't connected but should be (active), try to (re)connect and then send the message
-     415           10 :     else if (!isConnected && _active) {
-     416            0 :       await connect();
-     417              :     }
-     418              :     // In all other cases return null
-     419              :     else {
-     420              :       return null;
-     421              :     }
-     422           16 :     return await jsonRPC!.sendRequest(
-     423              :       method,
-     424              :       parameters,
-     425              :       id,
-     426              :     );
-     427              :   }
-     428              : 
-     429            7 :   Future<String> _onSubscribe(String topic) async {
-     430              :     String? requestId;
-     431              :     try {
-     432            7 :       requestId = await _sendJsonRpcRequest(
-     433            7 :         _buildMethod(JSON_RPC_SUBSCRIBE),
-     434            7 :         {'topic': topic},
-     435            7 :         JsonRpcUtils.payloadId(entropy: 6),
-     436              :       );
-     437              :     } catch (e) {
-     438            4 :       core.logger.w('RelayClient, onSubscribe error. Topic: $topic, Error: $e');
-     439            3 :       onRelayClientError.broadcast(ErrorEvent(e));
-     440              :     }
-     441              : 
-     442              :     if (requestId == null) {
-     443              :       return '';
-     444              :     }
-     445              : 
-     446           21 :     await topicMap.set(topic, requestId.toString());
-     447           14 :     pendingSubscriptions.remove(topic);
-     448              : 
-     449              :     return requestId;
-     450              :   }
-     451              : 
-     452            7 :   Future<bool> _isSubscribed(String topic) async {
-     453           14 :     if (topicMap.has(topic)) {
-     454              :       return true;
-     455              :     }
-     456              : 
-     457            0 :     if (pendingSubscriptions.containsKey(topic)) {
-     458            0 :       await pendingSubscriptions[topic];
-     459            0 :       return topicMap.has(topic);
-     460              :     }
-     461              : 
-     462              :     return false;
-     463              :   }
-     464              : 
-     465            8 :   void _checkInitialized() {
-     466            8 :     if (!_initialized) {
-     467            0 :       throw Errors.getInternalError(Errors.NOT_INITIALIZED);
-     468              :     }
-     469              :   }
-     470              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/relay_client_models.dart.func-c.html b/coverage/html/core/relay_client/relay_client_models.dart.func-c.html deleted file mode 100644 index 730cbd9d..00000000 --- a/coverage/html/core/relay_client/relay_client_models.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/relay_client_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client - relay_client_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:50.0 %105
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/relay_client_models.dart.func.html b/coverage/html/core/relay_client/relay_client_models.dart.func.html deleted file mode 100644 index a077498a..00000000 --- a/coverage/html/core/relay_client/relay_client_models.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/relay_client_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client - relay_client_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:50.0 %105
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/relay_client_models.dart.gcov.html b/coverage/html/core/relay_client/relay_client_models.dart.gcov.html deleted file mode 100644 index 18cb008d..00000000 --- a/coverage/html/core/relay_client/relay_client_models.dart.gcov.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/relay_client_models.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client - relay_client_models.dartCoverageTotalHit
Test:lcov.infoLines:50.0 %105
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:event/event.dart';
-       2              : import 'package:json_annotation/json_annotation.dart';
-       3              : 
-       4              : part 'relay_client_models.g.dart';
-       5              : 
-       6              : @JsonSerializable()
-       7              : class Relay {
-       8              :   final String protocol;
-       9              :   final String? data;
-      10              : 
-      11           12 :   Relay(
-      12              :     this.protocol, {
-      13              :     this.data,
-      14              :   });
-      15              : 
-      16            8 :   factory Relay.fromJson(Map<String, dynamic> json) => _$RelayFromJson(json);
-      17              : 
-      18            8 :   Map<String, dynamic> toJson() => _$RelayToJson(this);
-      19              : }
-      20              : 
-      21              : class MessageEvent extends EventArgs {
-      22              :   String topic;
-      23              :   String message;
-      24              : 
-      25            7 :   MessageEvent(
-      26              :     this.topic,
-      27              :     this.message,
-      28              :   );
-      29              : 
-      30            0 :   @override
-      31            0 :   String toString() => 'topic: $topic, message: $message';
-      32              : }
-      33              : 
-      34              : class ErrorEvent extends EventArgs {
-      35              :   dynamic error;
-      36              : 
-      37            8 :   ErrorEvent(
-      38              :     this.error,
-      39              :   );
-      40              : }
-      41              : 
-      42              : class SubscriptionEvent extends EventArgs {
-      43              :   String id;
-      44              : 
-      45            0 :   SubscriptionEvent(
-      46              :     this.id,
-      47              :   );
-      48              : }
-      49              : 
-      50              : class SubscriptionDeletionEvent extends SubscriptionEvent {
-      51              :   String reason;
-      52              : 
-      53            0 :   SubscriptionDeletionEvent(
-      54              :     id,
-      55              :     this.reason,
-      56            0 :   ) : super(id);
-      57              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/websocket/http_client.dart.func-c.html b/coverage/html/core/relay_client/websocket/http_client.dart.func-c.html deleted file mode 100644 index 5d77f2cd..00000000 --- a/coverage/html/core/relay_client/websocket/http_client.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/websocket/http_client.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/websocket - http_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:14.3 %71
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/websocket/http_client.dart.func.html b/coverage/html/core/relay_client/websocket/http_client.dart.func.html deleted file mode 100644 index af594287..00000000 --- a/coverage/html/core/relay_client/websocket/http_client.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/websocket/http_client.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/websocket - http_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:14.3 %71
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/websocket/http_client.dart.gcov.html b/coverage/html/core/relay_client/websocket/http_client.dart.gcov.html deleted file mode 100644 index fecb7aa9..00000000 --- a/coverage/html/core/relay_client/websocket/http_client.dart.gcov.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/websocket/http_client.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/websocket - http_client.dartCoverageTotalHit
Test:lcov.infoLines:14.3 %71
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:http/http.dart' as http;
-       2              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/i_http_client.dart';
-       3              : 
-       4              : class HttpWrapper extends IHttpClient {
-       5           82 :   const HttpWrapper();
-       6              : 
-       7            0 :   @override
-       8              :   Future<http.Response> get(
-       9              :     Uri url, {
-      10              :     Map<String, String>? headers,
-      11              :   }) async {
-      12            0 :     return await http.get(url, headers: headers);
-      13              :   }
-      14              : 
-      15            0 :   @override
-      16              :   Future<http.Response> delete(Uri url, {Map<String, String>? headers}) async {
-      17            0 :     return await http.delete(url, headers: headers);
-      18              :   }
-      19              : 
-      20            0 :   @override
-      21              :   Future<http.Response> post(
-      22              :     Uri url, {
-      23              :     Map<String, String>? headers,
-      24              :     Object? body,
-      25              :   }) async {
-      26            0 :     return await http.post(url, headers: headers, body: body);
-      27              :   }
-      28              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/websocket/i_http_client.dart.func-c.html b/coverage/html/core/relay_client/websocket/i_http_client.dart.func-c.html deleted file mode 100644 index 065db477..00000000 --- a/coverage/html/core/relay_client/websocket/i_http_client.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/websocket/i_http_client.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/websocket - i_http_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %11
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/websocket/i_http_client.dart.func.html b/coverage/html/core/relay_client/websocket/i_http_client.dart.func.html deleted file mode 100644 index ada9bcaa..00000000 --- a/coverage/html/core/relay_client/websocket/i_http_client.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/websocket/i_http_client.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/websocket - i_http_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %11
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/websocket/i_http_client.dart.gcov.html b/coverage/html/core/relay_client/websocket/i_http_client.dart.gcov.html deleted file mode 100644 index e8aee9f9..00000000 --- a/coverage/html/core/relay_client/websocket/i_http_client.dart.gcov.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/websocket/i_http_client.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/websocket - i_http_client.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %11
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:http/http.dart' as http;
-       2              : 
-       3              : abstract class IHttpClient {
-       4           82 :   const IHttpClient();
-       5              : 
-       6              :   Future<http.Response> get(
-       7              :     Uri url, {
-       8              :     Map<String, String>? headers,
-       9              :   });
-      10              : 
-      11              :   Future<http.Response> post(
-      12              :     Uri url, {
-      13              :     Map<String, String>? headers,
-      14              :     Object? body,
-      15              :   });
-      16              : 
-      17              :   Future<http.Response> delete(
-      18              :     Uri url, {
-      19              :     Map<String, String>? headers,
-      20              :   });
-      21              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/websocket/index-sort-f.html b/coverage/html/core/relay_client/websocket/index-sort-f.html deleted file mode 100644 index 150716ab..00000000 --- a/coverage/html/core/relay_client/websocket/index-sort-f.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/websocket - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/websocketCoverageTotalHit
Test:lcov.infoLines:60.0 %4024
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
http_client.dart -
14.3%14.3%
-
14.3 %71-
i_http_client.dart -
100.0%
-
100.0 %11-
websocket_handler.dart -
68.8%68.8%
-
68.8 %3222-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/websocket/index-sort-l.html b/coverage/html/core/relay_client/websocket/index-sort-l.html deleted file mode 100644 index 41517308..00000000 --- a/coverage/html/core/relay_client/websocket/index-sort-l.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/websocket - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/websocketCoverageTotalHit
Test:lcov.infoLines:60.0 %4024
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
http_client.dart -
14.3%14.3%
-
14.3 %71
websocket_handler.dart -
68.8%68.8%
-
68.8 %3222
i_http_client.dart -
100.0%
-
100.0 %11
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/websocket/index.html b/coverage/html/core/relay_client/websocket/index.html deleted file mode 100644 index c199af58..00000000 --- a/coverage/html/core/relay_client/websocket/index.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/websocket - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/websocketCoverageTotalHit
Test:lcov.infoLines:60.0 %4024
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
http_client.dart -
14.3%14.3%
-
14.3 %71
i_http_client.dart -
100.0%
-
100.0 %11
websocket_handler.dart -
68.8%68.8%
-
68.8 %3222
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/websocket/websocket_handler.dart.func-c.html b/coverage/html/core/relay_client/websocket/websocket_handler.dart.func-c.html deleted file mode 100644 index 9a0650fa..00000000 --- a/coverage/html/core/relay_client/websocket/websocket_handler.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/websocket/websocket_handler.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/websocket - websocket_handler.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:68.8 %3222
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/websocket/websocket_handler.dart.func.html b/coverage/html/core/relay_client/websocket/websocket_handler.dart.func.html deleted file mode 100644 index d1963b84..00000000 --- a/coverage/html/core/relay_client/websocket/websocket_handler.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/websocket/websocket_handler.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/websocket - websocket_handler.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:68.8 %3222
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/relay_client/websocket/websocket_handler.dart.gcov.html b/coverage/html/core/relay_client/websocket/websocket_handler.dart.gcov.html deleted file mode 100644 index daa1f8e4..00000000 --- a/coverage/html/core/relay_client/websocket/websocket_handler.dart.gcov.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - LCOV - lcov.info - core/relay_client/websocket/websocket_handler.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/relay_client/websocket - websocket_handler.dartCoverageTotalHit
Test:lcov.infoLines:68.8 %3222
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:async';
-       2              : 
-       3              : import 'package:stream_channel/stream_channel.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/i_websocket_handler.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
-       6              : import 'package:web_socket_channel/web_socket_channel.dart';
-       7              : 
-       8              : class WebSocketHandler implements IWebSocketHandler {
-       9              :   String? _url;
-      10            8 :   @override
-      11            8 :   String? get url => _url;
-      12              : 
-      13              :   WebSocketChannel? _socket;
-      14              : 
-      15            8 :   @override
-      16           16 :   int? get closeCode => _socket?.closeCode;
-      17            8 :   @override
-      18           16 :   String? get closeReason => _socket?.closeReason;
-      19              : 
-      20              :   StreamChannel<String>? _channel;
-      21            8 :   @override
-      22            8 :   StreamChannel<String>? get channel => _channel;
-      23              : 
-      24            0 :   @override
-      25            0 :   Future<void> get ready => _socket!.ready;
-      26              : 
-      27              :   // const WebSocketHandler();
-      28              : 
-      29            8 :   @override
-      30              :   Future<void> setup({
-      31              :     required String url,
-      32              :   }) async {
-      33            8 :     _url = url;
-      34              : 
-      35            8 :     await close();
-      36              :   }
-      37              : 
-      38            8 :   @override
-      39              :   Future<void> connect() async {
-      40              :     // print('connecting');
-      41              :     try {
-      42           16 :       _socket = WebSocketChannel.connect(
-      43            8 :         Uri.parse(
-      44           16 :           '$url&useOnCloseEvent=true',
-      45              :         ),
-      46              :       );
-      47              :     } catch (e) {
-      48            0 :       throw WalletConnectError(
-      49            0 :         code: -1,
-      50            0 :         message: 'No internet connection: ${e.toString()}',
-      51              :       );
-      52              :     }
-      53              : 
-      54           24 :     _channel = _socket!.cast<String>();
-      55              : 
-      56            8 :     if (_channel == null) {
-      57              :       // print('Socket channel is null, waiting...');
-      58            0 :       await Future.delayed(const Duration(milliseconds: 500));
-      59            0 :       if (_channel == null) {
-      60              :         // print('Socket channel is still null, throwing ');
-      61            0 :         throw Exception('Socket channel is null');
-      62              :       }
-      63              :     }
-      64              : 
-      65           16 :     await _socket!.ready;
-      66              : 
-      67              :     // Check if the request was successful (status code 200)
-      68              :     // try {} catch (e) {
-      69              :     //   throw WalletConnectError(
-      70              :     //     code: 400,
-      71              :     //     message: 'WebSocket connection failed, missing or invalid project id.',
-      72              :     //   );
-      73              :     // }
-      74              :   }
-      75              : 
-      76            8 :   @override
-      77              :   Future<void> close() async {
-      78              :     try {
-      79            8 :       if (_socket != null) {
-      80           24 :         await _socket?.sink.close();
-      81              :       }
-      82              :     } catch (_) {}
-      83            8 :     _socket = null;
-      84              :   }
-      85              : 
-      86            0 :   @override
-      87              :   String toString() {
-      88            0 :     return 'WebSocketHandler{url: $url, _socket: $_socket, _channel: $_channel}';
-      89              :   }
-      90              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/store/generic_store.dart.func-c.html b/coverage/html/core/store/generic_store.dart.func-c.html deleted file mode 100644 index f6155c70..00000000 --- a/coverage/html/core/store/generic_store.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/store/generic_store.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/store - generic_store.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:98.1 %5453
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/store/generic_store.dart.func.html b/coverage/html/core/store/generic_store.dart.func.html deleted file mode 100644 index b996a19e..00000000 --- a/coverage/html/core/store/generic_store.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/store/generic_store.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/store - generic_store.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:98.1 %5453
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/store/generic_store.dart.gcov.html b/coverage/html/core/store/generic_store.dart.gcov.html deleted file mode 100644 index cd27193a..00000000 --- a/coverage/html/core/store/generic_store.dart.gcov.html +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - - LCOV - lcov.info - core/store/generic_store.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/store - generic_store.dartCoverageTotalHit
Test:lcov.infoLines:98.1 %5453
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:event/event.dart';
-       2              : import 'package:flutter/material.dart';
-       3              : import 'package:walletconnect_flutter_v2/apis/core/store/i_generic_store.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/core/store/i_store.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/core/store/store_models.dart';
-       6              : import 'package:walletconnect_flutter_v2/apis/utils/errors.dart';
-       7              : 
-       8              : class GenericStore<T> implements IGenericStore<T> {
-       9              :   @override
-      10              :   final String context;
-      11              :   @override
-      12              :   final String version;
-      13              : 
-      14           12 :   @override
-      15           36 :   String get storageKey => '$version//$context';
-      16              :   @override
-      17              :   final IStore storage;
-      18              : 
-      19              :   @override
-      20              :   final Event<StoreCreateEvent<T>> onCreate = Event();
-      21              :   @override
-      22              :   final Event<StoreUpdateEvent<T>> onUpdate = Event();
-      23              :   @override
-      24              :   final Event<StoreDeleteEvent<T>> onDelete = Event();
-      25              :   @override
-      26              :   final Event<StoreSyncEvent> onSync = Event();
-      27              : 
-      28              :   bool _initialized = false;
-      29              : 
-      30              :   /// Stores map of key to pairing info
-      31              :   Map<String, T> data = {};
-      32              : 
-      33              :   @override
-      34              :   final T Function(dynamic) fromJson;
-      35              : 
-      36           12 :   GenericStore({
-      37              :     required this.storage,
-      38              :     required this.context,
-      39              :     required this.version,
-      40              :     required this.fromJson,
-      41              :   });
-      42              : 
-      43           12 :   @override
-      44              :   Future<void> init() async {
-      45           12 :     if (_initialized) {
-      46              :       return;
-      47              :     }
-      48              : 
-      49           24 :     await storage.init();
-      50           12 :     await restore();
-      51              : 
-      52           12 :     _initialized = true;
-      53              :   }
-      54              : 
-      55            8 :   @override
-      56              :   bool has(String key) {
-      57            8 :     checkInitialized();
-      58           16 :     return data.containsKey(key);
-      59              :   }
-      60              : 
-      61           12 :   @override
-      62              :   T? get(String key) {
-      63           12 :     checkInitialized();
-      64           24 :     if (data.containsKey(key)) {
-      65           20 :       return data[key]!;
-      66              :     }
-      67              :     return null;
-      68              :   }
-      69              : 
-      70           10 :   @override
-      71              :   List<T> getAll() {
-      72           30 :     return data.values.toList();
-      73              :   }
-      74              : 
-      75           12 :   @override
-      76              :   Future<void> set(String key, T value) async {
-      77           12 :     checkInitialized();
-      78              : 
-      79           24 :     if (data.containsKey(key)) {
-      80           18 :       onUpdate.broadcast(
-      81            9 :         StoreUpdateEvent(
-      82              :           key,
-      83              :           value,
-      84              :         ),
-      85              :       );
-      86              :     } else {
-      87           24 :       onCreate.broadcast(
-      88           12 :         StoreCreateEvent(
-      89              :           key,
-      90              :           value,
-      91              :         ),
-      92              :       );
-      93              :     }
-      94              : 
-      95           24 :     data[key] = value;
-      96              : 
-      97           12 :     await persist();
-      98              :   }
-      99              : 
-     100            9 :   @override
-     101              :   Future<void> delete(String key) async {
-     102            9 :     checkInitialized();
-     103              : 
-     104           18 :     if (!data.containsKey(key)) {
-     105              :       return;
-     106              :     }
-     107              : 
-     108           18 :     onDelete.broadcast(
-     109            9 :       StoreDeleteEvent(
-     110              :         key,
-     111           18 :         data.remove(key) as T,
-     112              :       ),
-     113              :     );
-     114              : 
-     115            9 :     await persist();
-     116              :   }
-     117              : 
-     118           12 :   @override
-     119              :   Future<void> persist() async {
-     120           12 :     checkInitialized();
-     121              : 
-     122           24 :     onSync.broadcast(
-     123           12 :       StoreSyncEvent(),
-     124              :     );
-     125              : 
-     126           48 :     await storage.set(storageKey, data);
-     127              :   }
-     128              : 
-     129           12 :   @override
-     130              :   Future<void> restore() async {
-     131              :     // If we haven't stored our version yet, we need to store it and stop
-     132           36 :     if (!storage.has(context)) {
-     133              :       // print('Storing $context');
-     134           60 :       await storage.set(context, {'version': version});
-     135           48 :       await storage.set(storageKey, <String, dynamic>{});
-     136              :       return;
-     137              :     }
-     138              : 
-     139              :     // If we have stored our version, but it doesn't match, we need to delete the previous data,
-     140              :     // create a new version, and stop
-     141           32 :     final String storedVersion = storage.get(context)['version'];
-     142           16 :     if (storedVersion != version) {
-     143              :       // print('Updating storage from $storedVersion to $version');
-     144            4 :       await storage.delete('$storedVersion//$context');
-     145            5 :       await storage.set(context, {'version': version});
-     146            4 :       await storage.set(storageKey, <String, dynamic>{});
-     147              :       return;
-     148              :     }
-     149              : 
-     150           24 :     if (storage.has(storageKey)) {
-     151              :       // If there is invalid data, delete the stored data
-     152              :       // print('Restoring $storageKey');
-     153              :       try {
-     154           34 :         for (var entry in storage.get(storageKey).entries) {
-     155              :           // print(entry);
-     156           12 :           data[entry.key] = fromJson(entry.value);
-     157              :         }
-     158              :       } catch (e) {
-     159              :         // print('Error restoring $storageKey: $e');
-     160            2 :         await storage.delete(storedVersion);
-     161              :       }
-     162              :     }
-     163              :   }
-     164              : 
-     165           12 :   @protected
-     166              :   void checkInitialized() {
-     167           12 :     if (!_initialized) {
-     168            0 :       throw Errors.getInternalError(Errors.NOT_INITIALIZED);
-     169              :     }
-     170              :   }
-     171              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/store/index-sort-f.html b/coverage/html/core/store/index-sort-f.html deleted file mode 100644 index 18d19607..00000000 --- a/coverage/html/core/store/index-sort-f.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - LCOV - lcov.info - core/store - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/storeCoverageTotalHit
Test:lcov.infoLines:75.2 %12594
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
generic_store.dart -
98.1%98.1%
-
98.1 %5453-
shared_prefs_store.dart -
55.2%55.2%
-
55.2 %6737-
store_models.dart -
100.0%
-
100.0 %44-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/store/index-sort-l.html b/coverage/html/core/store/index-sort-l.html deleted file mode 100644 index 4bddb2d2..00000000 --- a/coverage/html/core/store/index-sort-l.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - LCOV - lcov.info - core/store - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/storeCoverageTotalHit
Test:lcov.infoLines:75.2 %12594
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
shared_prefs_store.dart -
55.2%55.2%
-
55.2 %6737
generic_store.dart -
98.1%98.1%
-
98.1 %5453
store_models.dart -
100.0%
-
100.0 %44
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/store/index.html b/coverage/html/core/store/index.html deleted file mode 100644 index 8b9b99c1..00000000 --- a/coverage/html/core/store/index.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - LCOV - lcov.info - core/store - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/storeCoverageTotalHit
Test:lcov.infoLines:75.2 %12594
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
generic_store.dart -
98.1%98.1%
-
98.1 %5453
shared_prefs_store.dart -
55.2%55.2%
-
55.2 %6737
store_models.dart -
100.0%
-
100.0 %44
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/store/shared_prefs_store.dart.func-c.html b/coverage/html/core/store/shared_prefs_store.dart.func-c.html deleted file mode 100644 index 86aff844..00000000 --- a/coverage/html/core/store/shared_prefs_store.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/store/shared_prefs_store.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/store - shared_prefs_store.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:55.2 %6737
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/store/shared_prefs_store.dart.func.html b/coverage/html/core/store/shared_prefs_store.dart.func.html deleted file mode 100644 index ac040d97..00000000 --- a/coverage/html/core/store/shared_prefs_store.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/store/shared_prefs_store.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/store - shared_prefs_store.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:55.2 %6737
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/store/shared_prefs_store.dart.gcov.html b/coverage/html/core/store/shared_prefs_store.dart.gcov.html deleted file mode 100644 index 077f0ad1..00000000 --- a/coverage/html/core/store/shared_prefs_store.dart.gcov.html +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - - LCOV - lcov.info - core/store/shared_prefs_store.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/store - shared_prefs_store.dartCoverageTotalHit
Test:lcov.infoLines:55.2 %6737
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:convert';
-       2              : 
-       3              : import 'package:shared_preferences/shared_preferences.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/core/store/i_store.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/utils/constants.dart';
-       6              : import 'package:walletconnect_flutter_v2/apis/utils/errors.dart';
-       7              : 
-       8              : class SharedPrefsStores implements IStore<Map<String, dynamic>> {
-       9              :   late SharedPreferences prefs;
-      10              :   bool _initialized = false;
-      11              : 
-      12              :   final Map<String, Map<String, dynamic>> _map;
-      13              : 
-      14            0 :   @override
-      15            0 :   Map<String, Map<String, dynamic>> get map => _map;
-      16              : 
-      17            0 :   @override
-      18            0 :   List<String> get keys => map.keys.toList();
-      19              : 
-      20            0 :   @override
-      21            0 :   List<Map<String, dynamic>> get values => map.values.toList();
-      22              : 
-      23           12 :   @override
-      24              :   String get storagePrefix => WalletConnectConstants.CORE_STORAGE_PREFIX;
-      25              : 
-      26              :   final bool memoryStore;
-      27              : 
-      28           12 :   SharedPrefsStores({
-      29              :     Map<String, Map<String, dynamic>>? defaultValue,
-      30              :     this.memoryStore = false,
-      31           12 :   }) : _map = defaultValue ?? {};
-      32              : 
-      33              :   /// Initializes the store, loading all persistent values into memory.
-      34           12 :   @override
-      35              :   Future<void> init() async {
-      36           12 :     if (_initialized) {
-      37              :       return;
-      38              :     }
-      39              : 
-      40           12 :     if (!memoryStore) {
-      41            0 :       prefs = await SharedPreferences.getInstance();
-      42              :     }
-      43              : 
-      44           12 :     _initialized = true;
-      45              :   }
-      46              : 
-      47              :   /// Gets the value of the specified key, if it hasn't been cached yet, it caches it.
-      48              :   /// If the key doesn't exist it throws an error.
-      49            8 :   @override
-      50              :   Map<String, dynamic>? get(String key) {
-      51            8 :     _checkInitialized();
-      52              : 
-      53            8 :     final String keyWithPrefix = _addPrefix(key);
-      54           16 :     if (_map.containsKey(keyWithPrefix)) {
-      55           16 :       return _map[keyWithPrefix];
-      56              :     }
-      57              : 
-      58            1 :     Map<String, dynamic>? value = _getPref(keyWithPrefix);
-      59              :     if (value != null) {
-      60            0 :       _map[keyWithPrefix] = value;
-      61              :     }
-      62              :     return value;
-      63              :   }
-      64              : 
-      65           12 :   @override
-      66              :   bool has(String key) {
-      67           12 :     final String keyWithPrefix = _addPrefix(key);
-      68           12 :     if (memoryStore) {
-      69           24 :       return _map.containsKey(keyWithPrefix);
-      70              :     }
-      71            0 :     return prefs.containsKey(keyWithPrefix);
-      72              :   }
-      73              : 
-      74              :   /// Gets all of the values of the store
-      75            0 :   @override
-      76              :   List<Map<String, dynamic>> getAll() {
-      77            0 :     _checkInitialized();
-      78            0 :     return values;
-      79              :   }
-      80              : 
-      81              :   /// Sets the value of a key within the store, overwriting the value if it exists.
-      82           12 :   @override
-      83              :   Future<void> set(String key, Map<String, dynamic> value) async {
-      84           12 :     _checkInitialized();
-      85              : 
-      86           12 :     final String keyWithPrefix = _addPrefix(key);
-      87           24 :     _map[keyWithPrefix] = value;
-      88           12 :     await _updatePref(keyWithPrefix, value);
-      89              :   }
-      90              : 
-      91              :   /// Updates the value of a key. Fails if it does not exist.
-      92            0 :   @override
-      93              :   Future<void> update(String key, Map<String, dynamic> value) async {
-      94            0 :     _checkInitialized();
-      95              : 
-      96            0 :     final String keyWithPrefix = _addPrefix(key);
-      97            0 :     if (!map.containsKey(keyWithPrefix)) {
-      98            0 :       throw Errors.getInternalError(Errors.NO_MATCHING_KEY);
-      99              :     } else {
-     100            0 :       _map[keyWithPrefix] = value;
-     101            0 :       await _updatePref(keyWithPrefix, value);
-     102              :     }
-     103              :   }
-     104              : 
-     105              :   /// Removes the key from the persistent store
-     106            1 :   @override
-     107              :   Future<void> delete(String key) async {
-     108            1 :     _checkInitialized();
-     109              : 
-     110            1 :     final String keyWithPrefix = _addPrefix(key);
-     111            2 :     _map.remove(keyWithPrefix);
-     112            1 :     await _removePref(keyWithPrefix);
-     113              :   }
-     114              : 
-     115            1 :   Map<String, dynamic>? _getPref(String key) {
-     116            1 :     if (memoryStore) {
-     117              :       return null;
-     118              :     }
-     119              : 
-     120            0 :     if (prefs.containsKey(key)) {
-     121            0 :       final value = prefs.getString(key)!;
-     122            0 :       return jsonDecode(value);
-     123              :     } else {
-     124            0 :       throw Errors.getInternalError(Errors.NO_MATCHING_KEY);
-     125              :     }
-     126              :   }
-     127              : 
-     128           12 :   Future<void> _updatePref(String key, Map<String, dynamic> value) async {
-     129           12 :     if (memoryStore) {
-     130              :       return;
-     131              :     }
-     132              : 
-     133              :     try {
-     134            0 :       final stringValue = jsonEncode(value);
-     135            0 :       await prefs.setString(key, stringValue);
-     136            0 :     } on Exception catch (e) {
-     137            0 :       throw Errors.getInternalError(
-     138              :         Errors.MISSING_OR_INVALID,
-     139            0 :         context: e.toString(),
-     140              :       );
-     141              :     }
-     142              :   }
-     143              : 
-     144            1 :   Future<void> _removePref(String key) async {
-     145            1 :     if (memoryStore) {
-     146              :       return;
-     147              :     }
-     148            0 :     await prefs.remove(key);
-     149              :   }
-     150              : 
-     151           12 :   String _addPrefix(String key) {
-     152           24 :     return '$storagePrefix$key';
-     153              :   }
-     154              : 
-     155           12 :   void _checkInitialized() {
-     156           12 :     if (!_initialized) {
-     157            0 :       throw Errors.getInternalError(Errors.NOT_INITIALIZED);
-     158              :     }
-     159              :   }
-     160              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/store/store_models.dart.func-c.html b/coverage/html/core/store/store_models.dart.func-c.html deleted file mode 100644 index 3330a52f..00000000 --- a/coverage/html/core/store/store_models.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/store/store_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/store - store_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %44
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/store/store_models.dart.func.html b/coverage/html/core/store/store_models.dart.func.html deleted file mode 100644 index 99277502..00000000 --- a/coverage/html/core/store/store_models.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/store/store_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/store - store_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %44
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/store/store_models.dart.gcov.html b/coverage/html/core/store/store_models.dart.gcov.html deleted file mode 100644 index b6a1c2fd..00000000 --- a/coverage/html/core/store/store_models.dart.gcov.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - LCOV - lcov.info - core/store/store_models.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/store - store_models.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %44
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:event/event.dart';
-       2              : 
-       3              : class StoreCreateEvent<T> extends EventArgs {
-       4              :   final String key;
-       5              :   final T value;
-       6              : 
-       7           12 :   StoreCreateEvent(
-       8              :     this.key,
-       9              :     this.value,
-      10              :   );
-      11              : }
-      12              : 
-      13              : class StoreUpdateEvent<T> extends EventArgs {
-      14              :   final String key;
-      15              :   final T value;
-      16              : 
-      17            9 :   StoreUpdateEvent(
-      18              :     this.key,
-      19              :     this.value,
-      20              :   );
-      21              : }
-      22              : 
-      23              : class StoreDeleteEvent<T> extends EventArgs {
-      24              :   final String key;
-      25              :   final T value;
-      26              : 
-      27            9 :   StoreDeleteEvent(
-      28              :     this.key,
-      29              :     this.value,
-      30              :   );
-      31              : }
-      32              : 
-      33              : class StoreSyncEvent extends EventArgs {
-      34           12 :   StoreSyncEvent();
-      35              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/verify/index-sort-f.html b/coverage/html/core/verify/index-sort-f.html deleted file mode 100644 index 05fef30b..00000000 --- a/coverage/html/core/verify/index-sort-f.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - LCOV - lcov.info - core/verify - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/verifyCoverageTotalHit
Test:lcov.infoLines:68.8 %1611
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
verify.dart -
68.8%68.8%
-
68.8 %1611-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/verify/index-sort-l.html b/coverage/html/core/verify/index-sort-l.html deleted file mode 100644 index b58f2163..00000000 --- a/coverage/html/core/verify/index-sort-l.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - LCOV - lcov.info - core/verify - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/verifyCoverageTotalHit
Test:lcov.infoLines:68.8 %1611
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
verify.dart -
68.8%68.8%
-
68.8 %1611
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/verify/index.html b/coverage/html/core/verify/index.html deleted file mode 100644 index 364763fc..00000000 --- a/coverage/html/core/verify/index.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - LCOV - lcov.info - core/verify - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/verifyCoverageTotalHit
Test:lcov.infoLines:68.8 %1611
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
verify.dart -
68.8%68.8%
-
68.8 %1611
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/verify/models/index-sort-f.html b/coverage/html/core/verify/models/index-sort-f.html deleted file mode 100644 index 8d4773bf..00000000 --- a/coverage/html/core/verify/models/index-sort-f.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - LCOV - lcov.info - core/verify/models - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/verify/modelsCoverageTotalHit
Test:lcov.infoLines:11.1 %91
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
verify_context.dart -
11.1%11.1%
-
11.1 %91-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/verify/models/index-sort-l.html b/coverage/html/core/verify/models/index-sort-l.html deleted file mode 100644 index e8f1561b..00000000 --- a/coverage/html/core/verify/models/index-sort-l.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - LCOV - lcov.info - core/verify/models - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/verify/modelsCoverageTotalHit
Test:lcov.infoLines:11.1 %91
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
verify_context.dart -
11.1%11.1%
-
11.1 %91
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/verify/models/index.html b/coverage/html/core/verify/models/index.html deleted file mode 100644 index b92f34cd..00000000 --- a/coverage/html/core/verify/models/index.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - LCOV - lcov.info - core/verify/models - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/verify/modelsCoverageTotalHit
Test:lcov.infoLines:11.1 %91
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
verify_context.dart -
11.1%11.1%
-
11.1 %91
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/verify/models/verify_context.dart.func-c.html b/coverage/html/core/verify/models/verify_context.dart.func-c.html deleted file mode 100644 index db576da9..00000000 --- a/coverage/html/core/verify/models/verify_context.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/verify/models/verify_context.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/verify/models - verify_context.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:11.1 %91
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/verify/models/verify_context.dart.func.html b/coverage/html/core/verify/models/verify_context.dart.func.html deleted file mode 100644 index 3ec78b10..00000000 --- a/coverage/html/core/verify/models/verify_context.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/verify/models/verify_context.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/verify/models - verify_context.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:11.1 %91
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/verify/models/verify_context.dart.gcov.html b/coverage/html/core/verify/models/verify_context.dart.gcov.html deleted file mode 100644 index 0aec3ceb..00000000 --- a/coverage/html/core/verify/models/verify_context.dart.gcov.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - LCOV - lcov.info - core/verify/models/verify_context.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/verify/models - verify_context.dartCoverageTotalHit
Test:lcov.infoLines:11.1 %91
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:freezed_annotation/freezed_annotation.dart';
-       2              : 
-       3              : part 'verify_context.g.dart';
-       4              : part 'verify_context.freezed.dart';
-       5              : 
-       6              : enum Validation {
-       7              :   UNKNOWN,
-       8              :   VALID,
-       9              :   INVALID,
-      10              :   SCAM;
-      11              : 
-      12            0 :   bool get invalid => this == INVALID;
-      13            0 :   bool get valid => this == VALID;
-      14            0 :   bool get unknown => this == UNKNOWN;
-      15            0 :   bool get scam => this == SCAM;
-      16              : }
-      17              : 
-      18              : @freezed
-      19              : class VerifyContext with _$VerifyContext {
-      20              :   @JsonSerializable()
-      21              :   const factory VerifyContext({
-      22              :     required String origin,
-      23              :     required Validation validation,
-      24              :     required String verifyUrl,
-      25              :     bool? isScam,
-      26              :   }) = _VerifyContext;
-      27              : 
-      28            0 :   factory VerifyContext.fromJson(Map<String, dynamic> json) =>
-      29            0 :       _$VerifyContextFromJson(json);
-      30              : }
-      31              : 
-      32              : @freezed
-      33              : class AttestationResponse with _$AttestationResponse {
-      34              :   @JsonSerializable()
-      35              :   const factory AttestationResponse({
-      36              :     required String origin,
-      37              :     required String attestationId,
-      38              :     bool? isScam,
-      39              :   }) = _AttestationResponse;
-      40              : 
-      41            0 :   factory AttestationResponse.fromJson(Map<String, dynamic> json) =>
-      42            0 :       _$AttestationResponseFromJson(json);
-      43              : }
-      44              : 
-      45              : class AttestationNotFound implements Exception {
-      46              :   int code;
-      47              :   String message;
-      48              : 
-      49            8 :   AttestationNotFound({required this.code, required this.message}) : super();
-      50              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/verify/verify.dart.func-c.html b/coverage/html/core/verify/verify.dart.func-c.html deleted file mode 100644 index 75309f44..00000000 --- a/coverage/html/core/verify/verify.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/verify/verify.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/verify - verify.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:68.8 %1611
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/verify/verify.dart.func.html b/coverage/html/core/verify/verify.dart.func.html deleted file mode 100644 index c7702288..00000000 --- a/coverage/html/core/verify/verify.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - core/verify/verify.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/verify - verify.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:68.8 %1611
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/core/verify/verify.dart.gcov.html b/coverage/html/core/verify/verify.dart.gcov.html deleted file mode 100644 index 80e3521d..00000000 --- a/coverage/html/core/verify/verify.dart.gcov.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - LCOV - lcov.info - core/verify/verify.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - core/verify - verify.dartCoverageTotalHit
Test:lcov.infoLines:68.8 %1611
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:convert';
-       2              : 
-       3              : import 'package:walletconnect_flutter_v2/apis/core/i_core.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/i_http_client.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/core/verify/i_verify.dart';
-       6              : import 'package:walletconnect_flutter_v2/apis/core/verify/models/verify_context.dart';
-       7              : import 'package:walletconnect_flutter_v2/apis/utils/constants.dart';
-       8              : 
-       9              : class Verify implements IVerify {
-      10              :   final ICore _core;
-      11              :   final IHttpClient _httpClient;
-      12              :   late String _verifyUrl;
-      13              : 
-      14           10 :   Verify({
-      15              :     required ICore core,
-      16              :     required IHttpClient httpClient,
-      17              :   })  : _core = core,
-      18              :         _httpClient = httpClient;
-      19              : 
-      20            5 :   @override
-      21              :   Future<void> init({String? verifyUrl}) async {
-      22              :     // TODO custom verifyUrl is not yet allowed.
-      23              :     // Always using walletconnect urls for now
-      24           10 :     _verifyUrl = _setVerifyUrl(verifyUrl: verifyUrl);
-      25              :   }
-      26              : 
-      27            4 :   @override
-      28              :   Future<AttestationResponse?> resolve({required String attestationId}) async {
-      29              :     try {
-      30           12 :       final uri = Uri.parse('$_verifyUrl/attestation/$attestationId');
-      31           16 :       final response = await _httpClient.get(uri).timeout(Duration(seconds: 5));
-      32           16 :       if (response.statusCode == 404 || response.body.isEmpty) {
-      33            4 :         throw AttestationNotFound(
-      34              :           code: 404,
-      35              :           message: 'Attestion for this dapp could not be found',
-      36              :         );
-      37              :       }
-      38            0 :       if (response.statusCode != 200) {
-      39            0 :         throw Exception('Attestation response error: ${response.statusCode}');
-      40              :       }
-      41            0 :       return AttestationResponse.fromJson(jsonDecode(response.body));
-      42              :     } catch (e) {
-      43           20 :       _core.logger.d('[$runtimeType] resolve $e');
-      44              :       rethrow;
-      45              :     }
-      46              :   }
-      47              : 
-      48            5 :   String _setVerifyUrl({String? verifyUrl}) {
-      49              :     String url = verifyUrl ?? WalletConnectConstants.VERIFY_SERVER;
-      50              : 
-      51            5 :     if (!WalletConnectConstants.TRUSTED_VERIFY_URLS.contains(url)) {
-      52            0 :       _core.logger.i(
-      53            0 :         '[$runtimeType] verifyUrl $url not included in trusted list, '
-      54              :         'assigning default: ${WalletConnectConstants.VERIFY_SERVER}',
-      55              :       );
-      56              :       url = WalletConnectConstants.VERIFY_SERVER;
-      57              :     }
-      58              :     return url;
-      59              :   }
-      60              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/emerald.png b/coverage/html/emerald.png deleted file mode 100644 index 38ad4f4068b935643d2486f323005fb294a9bd7e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 141 zcmeAS@N?(olHy`uVBq!ia0vp^j3CU&3?x-=hn)ga>?NMQuI!iC1^Jb!lvI6;R0X`wF(yt=9xVZRt1vCRixIA4P dLn>}1Cji+@42)0J?}79&c)I$ztaD0e0sy@GAL0N2 diff --git a/coverage/html/gcov.css b/coverage/html/gcov.css deleted file mode 100644 index 6c23ba93..00000000 --- a/coverage/html/gcov.css +++ /dev/null @@ -1,1101 +0,0 @@ -/* All views: initial background and text color */ -body -{ - color: #000000; - background-color: #ffffff; -} - -/* All views: standard link format*/ -a:link -{ - color: #284fa8; - text-decoration: underline; -} - -/* All views: standard link - visited format */ -a:visited -{ - color: #00cb40; - text-decoration: underline; -} - -/* All views: standard link - activated format */ -a:active -{ - color: #ff0040; - text-decoration: underline; -} - -/* All views: main title format */ -td.title -{ - text-align: center; - padding-bottom: 10px; - font-family: sans-serif; - font-size: 20pt; - font-style: italic; - font-weight: bold; -} -/* "Line coverage date bins" leader */ -td.subTableHeader -{ - text-align: center; - padding-bottom: 6px; - font-family: sans-serif; - font-weight: bold; - vertical-align: center; -} - -/* All views: header item format */ -td.headerItem -{ - text-align: right; - padding-right: 6px; - font-family: sans-serif; - font-weight: bold; - vertical-align: top; - white-space: nowrap; -} - -/* All views: header item value format */ -td.headerValue -{ - text-align: left; - color: #284fa8; - font-family: sans-serif; - font-weight: bold; - white-space: nowrap; -} - -/* All views: header item coverage table heading */ -td.headerCovTableHead -{ - text-align: center; - padding-right: 6px; - padding-left: 6px; - padding-bottom: 0px; - font-family: sans-serif; - white-space: nowrap; -} - -/* All views: header item coverage table entry */ -td.headerCovTableEntry -{ - text-align: right; - color: #284fa8; - font-family: sans-serif; - font-weight: bold; - white-space: nowrap; - padding-left: 12px; - padding-right: 4px; - background-color: #dae7fe; -} - -/* All views: header item coverage table entry for high coverage rate */ -td.headerCovTableEntryHi -{ - text-align: right; - color: #000000; - font-family: sans-serif; - font-weight: bold; - white-space: nowrap; - padding-left: 12px; - padding-right: 4px; - background-color: #a7fc9d; -} - -/* All views: header item coverage table entry for medium coverage rate */ -td.headerCovTableEntryMed -{ - text-align: right; - color: #000000; - font-family: sans-serif; - font-weight: bold; - white-space: nowrap; - padding-left: 12px; - padding-right: 4px; - background-color: #ffea20; -} - -/* All views: header item coverage table entry for ow coverage rate */ -td.headerCovTableEntryLo -{ - text-align: right; - color: #000000; - font-family: sans-serif; - font-weight: bold; - white-space: nowrap; - padding-left: 12px; - padding-right: 4px; - background-color: #ff0000; -} - -/* All views: header legend value for legend entry */ -td.headerValueLeg -{ - text-align: left; - color: #000000; - font-family: sans-serif; - font-size: 80%; - white-space: nowrap; - padding-top: 4px; -} - -/* All views: color of horizontal ruler */ -td.ruler -{ - background-color: #6688d4; -} - -/* All views: version string format */ -td.versionInfo -{ - text-align: center; - padding-top: 2px; - font-family: sans-serif; - font-style: italic; -} - -/* Directory view/File view (all)/Test case descriptions: - table headline format */ -td.tableHead -{ - text-align: center; - color: #ffffff; - background-color: #6688d4; - font-family: sans-serif; - font-size: 120%; - font-weight: bold; - white-space: nowrap; - padding-left: 4px; - padding-right: 4px; -} - -span.tableHeadSort -{ - padding-right: 4px; -} - -/* Directory view/File view (all): filename entry format */ -td.coverFile -{ - text-align: left; - padding-left: 10px; - padding-right: 20px; - color: #284fa8; - background-color: #dae7fe; - font-family: monospace; -} - -/* Directory view/File view (all): directory name entry format */ -td.coverDirectory -{ - text-align: left; - padding-left: 10px; - padding-right: 20px; - color: #284fa8; - background-color: #b8d0ff; - font-family: monospace; -} - -/* Directory view/File view (all): filename entry format */ -td.overallOwner -{ - text-align: center; - font-weight: bold; - font-family: sans-serif; - background-color: #dae7fe; - padding-right: 10px; - padding-left: 10px; -} - -/* Directory view/File view (all): filename entry format */ -td.ownerName -{ - text-align: right; - font-style: italic; - font-family: sans-serif; - background-color: #E5DBDB; - padding-right: 10px; - padding-left: 20px; -} - -/* Directory view/File view (all): bar-graph entry format*/ -td.coverBar -{ - padding-left: 10px; - padding-right: 10px; - background-color: #dae7fe; -} - -/* Directory view/File view (all): bar-graph entry format*/ -td.owner_coverBar -{ - padding-left: 10px; - padding-right: 10px; - background-color: #E5DBDB; -} - -/* Directory view/File view (all): bar-graph outline color */ -td.coverBarOutline -{ - background-color: #000000; -} - -/* Directory view/File view (all): percentage entry for files with - high coverage rate */ -td.coverPerHi -{ - text-align: right; - padding-left: 10px; - padding-right: 10px; - background-color: #a7fc9d; - font-weight: bold; - font-family: sans-serif; -} - -/* 'owner' entry: slightly lighter color than 'coverPerHi' */ -td.owner_coverPerHi -{ - text-align: right; - padding-left: 10px; - padding-right: 10px; - background-color: #82E0AA; - font-weight: bold; - font-family: sans-serif; -} - -/* Directory view/File view (all): line count entry */ -td.coverNumDflt -{ - text-align: right; - padding-left: 10px; - padding-right: 10px; - background-color: #dae7fe; - white-space: nowrap; - font-family: sans-serif; -} - -/* td background color and font for the 'owner' section of the table */ -td.ownerTla -{ - text-align: right; - padding-left: 10px; - padding-right: 10px; - background-color: #E5DBDB; - white-space: nowrap; - font-family: sans-serif; - font-style: italic; -} - -/* Directory view/File view (all): line count entry for files with - high coverage rate */ -td.coverNumHi -{ - text-align: right; - padding-left: 10px; - padding-right: 10px; - background-color: #a7fc9d; - white-space: nowrap; - font-family: sans-serif; -} - -td.owner_coverNumHi -{ - text-align: right; - padding-left: 10px; - padding-right: 10px; - background-color: #82E0AA; - white-space: nowrap; - font-family: sans-serif; -} - -/* Directory view/File view (all): percentage entry for files with - medium coverage rate */ -td.coverPerMed -{ - text-align: right; - padding-left: 10px; - padding-right: 10px; - background-color: #ffea20; - font-weight: bold; - font-family: sans-serif; -} - -td.owner_coverPerMed -{ - text-align: right; - padding-left: 10px; - padding-right: 10px; - background-color: #F9E79F; - font-weight: bold; - font-family: sans-serif; -} - -/* Directory view/File view (all): line count entry for files with - medium coverage rate */ -td.coverNumMed -{ - text-align: right; - padding-left: 10px; - padding-right: 10px; - background-color: #ffea20; - white-space: nowrap; - font-family: sans-serif; -} - -td.owner_coverNumMed -{ - text-align: right; - padding-left: 10px; - padding-right: 10px; - background-color: #F9E79F; - white-space: nowrap; - font-family: sans-serif; -} - -/* Directory view/File view (all): percentage entry for files with - low coverage rate */ -td.coverPerLo -{ - text-align: right; - padding-left: 10px; - padding-right: 10px; - background-color: #ff0000; - font-weight: bold; - font-family: sans-serif; -} - -td.owner_coverPerLo -{ - text-align: right; - padding-left: 10px; - padding-right: 10px; - background-color: #EC7063; - font-weight: bold; - font-family: sans-serif; -} - -/* Directory view/File view (all): line count entry for files with - low coverage rate */ -td.coverNumLo -{ - text-align: right; - padding-left: 10px; - padding-right: 10px; - background-color: #ff0000; - white-space: nowrap; - font-family: sans-serif; -} - -td.owner_coverNumLo -{ - text-align: right; - padding-left: 10px; - padding-right: 10px; - background-color: #EC7063; - white-space: nowrap; - font-family: sans-serif; -} - -/* File view (all): "show/hide details" link format */ -a.detail:link -{ - color: #b8d0ff; - font-size:80%; -} - -/* File view (all): "show/hide details" link - visited format */ -a.detail:visited -{ - color: #b8d0ff; - font-size:80%; -} - -/* File view (all): "show/hide details" link - activated format */ -a.detail:active -{ - color: #ffffff; - font-size:80%; -} - -/* File view (detail): test name entry */ -td.testName -{ - text-align: right; - padding-right: 10px; - background-color: #dae7fe; - font-family: sans-serif; -} - -/* File view (detail): test percentage entry */ -td.testPer -{ - text-align: right; - padding-left: 10px; - padding-right: 10px; - background-color: #dae7fe; - font-family: sans-serif; -} - -/* File view (detail): test lines count entry */ -td.testNum -{ - text-align: right; - padding-left: 10px; - padding-right: 10px; - background-color: #dae7fe; - font-family: sans-serif; -} - -/* Test case descriptions: test name format*/ -dt -{ - font-family: sans-serif; - font-weight: bold; -} - -/* Test case descriptions: description table body */ -td.testDescription -{ - padding-top: 10px; - padding-left: 30px; - padding-bottom: 10px; - padding-right: 30px; - background-color: #dae7fe; -} - -/* Source code view: function entry */ -td.coverFn -{ - text-align: left; - padding-left: 10px; - padding-right: 20px; - color: #284fa8; - background-color: #dae7fe; - font-family: monospace; -} - -/* Source code view: function entry zero count*/ -td.coverFnLo -{ - text-align: right; - padding-left: 10px; - padding-right: 10px; - background-color: #ff0000; - font-weight: bold; - font-family: sans-serif; -} - -/* Source code view: function entry nonzero count*/ -td.coverFnHi -{ - text-align: right; - padding-left: 10px; - padding-right: 10px; - background-color: #dae7fe; - font-weight: bold; - font-family: sans-serif; -} - -td.coverFnAlias -{ - text-align: right; - padding-left: 10px; - padding-right: 20px; - color: #284fa8; - /* make this a slightly different color than the leader - otherwise, - otherwise the alias is hard to distinguish in the table */ - background-color: #E5DBDB; /* very light pale grey/blue */ - font-family: monospace; -} - -/* Source code view: function entry zero count*/ -td.coverFnAliasLo -{ - text-align: right; - padding-left: 10px; - padding-right: 10px; - background-color: #EC7063; /* lighter red */ - font-family: sans-serif; -} - -/* Source code view: function entry nonzero count*/ -td.coverFnAliasHi -{ - text-align: right; - padding-left: 10px; - padding-right: 10px; - background-color: #dae7fe; - font-weight: bold; - font-family: sans-serif; -} - -/* Source code view: source code format */ -pre.source -{ - font-family: monospace; - white-space: pre; - margin-top: 2px; -} - -/* elided/removed code */ -span.elidedSource -{ - font-family: sans-serif; - /*font-size: 8pt; */ - font-style: italic; - background-color: lightgrey; -} - -/* Source code view: line number format */ -span.lineNum -{ - background-color: #efe383; -} - -/* Source code view: line number format when there are deleted - lines in the corresponding location */ -span.lineNumWithDelete -{ - foreground-color: #efe383; - background-color: lightgrey; -} - -/* Source code view: format for Cov legend */ -span.coverLegendCov -{ - padding-left: 10px; - padding-right: 10px; - padding-bottom: 2px; - background-color: #cad7fe; -} - -/* Source code view: format for NoCov legend */ -span.coverLegendNoCov -{ - padding-left: 10px; - padding-right: 10px; - padding-bottom: 2px; - background-color: #ff6230; -} - -/* Source code view: format for the source code heading line */ -pre.sourceHeading -{ - white-space: pre; - font-family: monospace; - font-weight: bold; - margin: 0px; -} - -/* All views: header legend value for low rate */ -td.headerValueLegL -{ - font-family: sans-serif; - text-align: center; - white-space: nowrap; - padding-left: 4px; - padding-right: 2px; - background-color: #ff0000; - font-size: 80%; -} - -/* All views: header legend value for med rate */ -td.headerValueLegM -{ - font-family: sans-serif; - text-align: center; - white-space: nowrap; - padding-left: 2px; - padding-right: 2px; - background-color: #ffea20; - font-size: 80%; -} - -/* All views: header legend value for hi rate */ -td.headerValueLegH -{ - font-family: sans-serif; - text-align: center; - white-space: nowrap; - padding-left: 2px; - padding-right: 4px; - background-color: #a7fc9d; - font-size: 80%; -} - -/* All views except source code view: legend format for low coverage */ -span.coverLegendCovLo -{ - padding-left: 10px; - padding-right: 10px; - padding-top: 2px; - background-color: #ff0000; -} - -/* All views except source code view: legend format for med coverage */ -span.coverLegendCovMed -{ - padding-left: 10px; - padding-right: 10px; - padding-top: 2px; - background-color: #ffea20; -} - -/* All views except source code view: legend format for hi coverage */ -span.coverLegendCovHi -{ - padding-left: 10px; - padding-right: 10px; - padding-top: 2px; - background-color: #a7fc9d; -} - -a.branchTla:link -{ - color: #000000; -} - -a.branchTla:visited -{ - color: #000000; -} - -/* Source code view/table entry background: format for lines classified as "Uncovered New Code (+ => 0): -Newly added code is not tested" */ -td.tlaUNC -{ - text-align: right; - background-color: #FF6230; -} -td.tlaBgUNC { - background-color: #FF6230; -} - -/* Source code view/table entry background: format for lines classified as "Uncovered New Code (+ => 0): -Newly added code is not tested" */ -span.tlaUNC -{ - text-align: left; - background-color: #FF6230; -} -span.tlaBgUNC { - background-color: #FF6230; -} -a.tlaBgUNC { - background-color: #FF6230; - color: #000000; -} - -td.headerCovTableHeadUNC { - text-align: center; - padding-right: 6px; - padding-left: 6px; - padding-bottom: 0px; - font-family: sans-serif; - white-space: nowrap; - background-color: #FF6230; -} - -/* Source code view/table entry background: format for lines classified as "Lost Baseline Coverage (1 => 0): -Unchanged code is no longer tested" */ -td.tlaLBC -{ - text-align: right; - background-color: #FF6230; -} -td.tlaBgLBC { - background-color: #FF6230; -} - -/* Source code view/table entry background: format for lines classified as "Lost Baseline Coverage (1 => 0): -Unchanged code is no longer tested" */ -span.tlaLBC -{ - text-align: left; - background-color: #FF6230; -} -span.tlaBgLBC { - background-color: #FF6230; -} -a.tlaBgLBC { - background-color: #FF6230; - color: #000000; -} - -td.headerCovTableHeadLBC { - text-align: center; - padding-right: 6px; - padding-left: 6px; - padding-bottom: 0px; - font-family: sans-serif; - white-space: nowrap; - background-color: #FF6230; -} - -/* Source code view/table entry background: format for lines classified as "Uncovered Included Code (# => 0): -Previously unused code is untested" */ -td.tlaUIC -{ - text-align: right; - background-color: #FF6230; -} -td.tlaBgUIC { - background-color: #FF6230; -} - -/* Source code view/table entry background: format for lines classified as "Uncovered Included Code (# => 0): -Previously unused code is untested" */ -span.tlaUIC -{ - text-align: left; - background-color: #FF6230; -} -span.tlaBgUIC { - background-color: #FF6230; -} -a.tlaBgUIC { - background-color: #FF6230; - color: #000000; -} - -td.headerCovTableHeadUIC { - text-align: center; - padding-right: 6px; - padding-left: 6px; - padding-bottom: 0px; - font-family: sans-serif; - white-space: nowrap; - background-color: #FF6230; -} - -/* Source code view/table entry background: format for lines classified as "Uncovered Baseline Code (0 => 0): -Unchanged code was untested before, is untested now" */ -td.tlaUBC -{ - text-align: right; - background-color: #FF6230; -} -td.tlaBgUBC { - background-color: #FF6230; -} - -/* Source code view/table entry background: format for lines classified as "Uncovered Baseline Code (0 => 0): -Unchanged code was untested before, is untested now" */ -span.tlaUBC -{ - text-align: left; - background-color: #FF6230; -} -span.tlaBgUBC { - background-color: #FF6230; -} -a.tlaBgUBC { - background-color: #FF6230; - color: #000000; -} - -td.headerCovTableHeadUBC { - text-align: center; - padding-right: 6px; - padding-left: 6px; - padding-bottom: 0px; - font-family: sans-serif; - white-space: nowrap; - background-color: #FF6230; -} - -/* Source code view/table entry background: format for lines classified as "Gained Baseline Coverage (0 => 1): -Unchanged code is tested now" */ -td.tlaGBC -{ - text-align: right; - background-color: #CAD7FE; -} -td.tlaBgGBC { - background-color: #CAD7FE; -} - -/* Source code view/table entry background: format for lines classified as "Gained Baseline Coverage (0 => 1): -Unchanged code is tested now" */ -span.tlaGBC -{ - text-align: left; - background-color: #CAD7FE; -} -span.tlaBgGBC { - background-color: #CAD7FE; -} -a.tlaBgGBC { - background-color: #CAD7FE; - color: #000000; -} - -td.headerCovTableHeadGBC { - text-align: center; - padding-right: 6px; - padding-left: 6px; - padding-bottom: 0px; - font-family: sans-serif; - white-space: nowrap; - background-color: #CAD7FE; -} - -/* Source code view/table entry background: format for lines classified as "Gained Included Coverage (# => 1): -Previously unused code is tested now" */ -td.tlaGIC -{ - text-align: right; - background-color: #CAD7FE; -} -td.tlaBgGIC { - background-color: #CAD7FE; -} - -/* Source code view/table entry background: format for lines classified as "Gained Included Coverage (# => 1): -Previously unused code is tested now" */ -span.tlaGIC -{ - text-align: left; - background-color: #CAD7FE; -} -span.tlaBgGIC { - background-color: #CAD7FE; -} -a.tlaBgGIC { - background-color: #CAD7FE; - color: #000000; -} - -td.headerCovTableHeadGIC { - text-align: center; - padding-right: 6px; - padding-left: 6px; - padding-bottom: 0px; - font-family: sans-serif; - white-space: nowrap; - background-color: #CAD7FE; -} - -/* Source code view/table entry background: format for lines classified as "Gained New Coverage (+ => 1): -Newly added code is tested" */ -td.tlaGNC -{ - text-align: right; - background-color: #CAD7FE; -} -td.tlaBgGNC { - background-color: #CAD7FE; -} - -/* Source code view/table entry background: format for lines classified as "Gained New Coverage (+ => 1): -Newly added code is tested" */ -span.tlaGNC -{ - text-align: left; - background-color: #CAD7FE; -} -span.tlaBgGNC { - background-color: #CAD7FE; -} -a.tlaBgGNC { - background-color: #CAD7FE; - color: #000000; -} - -td.headerCovTableHeadGNC { - text-align: center; - padding-right: 6px; - padding-left: 6px; - padding-bottom: 0px; - font-family: sans-serif; - white-space: nowrap; - background-color: #CAD7FE; -} - -/* Source code view/table entry background: format for lines classified as "Covered Baseline Code (1 => 1): -Unchanged code was tested before and is still tested" */ -td.tlaCBC -{ - text-align: right; - background-color: #CAD7FE; -} -td.tlaBgCBC { - background-color: #CAD7FE; -} - -/* Source code view/table entry background: format for lines classified as "Covered Baseline Code (1 => 1): -Unchanged code was tested before and is still tested" */ -span.tlaCBC -{ - text-align: left; - background-color: #CAD7FE; -} -span.tlaBgCBC { - background-color: #CAD7FE; -} -a.tlaBgCBC { - background-color: #CAD7FE; - color: #000000; -} - -td.headerCovTableHeadCBC { - text-align: center; - padding-right: 6px; - padding-left: 6px; - padding-bottom: 0px; - font-family: sans-serif; - white-space: nowrap; - background-color: #CAD7FE; -} - -/* Source code view/table entry background: format for lines classified as "Excluded Uncovered Baseline (0 => #): -Previously untested code is unused now" */ -td.tlaEUB -{ - text-align: right; - background-color: #FFFFFF; -} -td.tlaBgEUB { - background-color: #FFFFFF; -} - -/* Source code view/table entry background: format for lines classified as "Excluded Uncovered Baseline (0 => #): -Previously untested code is unused now" */ -span.tlaEUB -{ - text-align: left; - background-color: #FFFFFF; -} -span.tlaBgEUB { - background-color: #FFFFFF; -} -a.tlaBgEUB { - background-color: #FFFFFF; - color: #000000; -} - -td.headerCovTableHeadEUB { - text-align: center; - padding-right: 6px; - padding-left: 6px; - padding-bottom: 0px; - font-family: sans-serif; - white-space: nowrap; - background-color: #FFFFFF; -} - -/* Source code view/table entry background: format for lines classified as "Excluded Covered Baseline (1 => #): -Previously tested code is unused now" */ -td.tlaECB -{ - text-align: right; - background-color: #FFFFFF; -} -td.tlaBgECB { - background-color: #FFFFFF; -} - -/* Source code view/table entry background: format for lines classified as "Excluded Covered Baseline (1 => #): -Previously tested code is unused now" */ -span.tlaECB -{ - text-align: left; - background-color: #FFFFFF; -} -span.tlaBgECB { - background-color: #FFFFFF; -} -a.tlaBgECB { - background-color: #FFFFFF; - color: #000000; -} - -td.headerCovTableHeadECB { - text-align: center; - padding-right: 6px; - padding-left: 6px; - padding-bottom: 0px; - font-family: sans-serif; - white-space: nowrap; - background-color: #FFFFFF; -} - -/* Source code view/table entry background: format for lines classified as "Deleted Uncovered Baseline (0 => -): -Previously untested code has been deleted" */ -td.tlaDUB -{ - text-align: right; - background-color: #FFFFFF; -} -td.tlaBgDUB { - background-color: #FFFFFF; -} - -/* Source code view/table entry background: format for lines classified as "Deleted Uncovered Baseline (0 => -): -Previously untested code has been deleted" */ -span.tlaDUB -{ - text-align: left; - background-color: #FFFFFF; -} -span.tlaBgDUB { - background-color: #FFFFFF; -} -a.tlaBgDUB { - background-color: #FFFFFF; - color: #000000; -} - -td.headerCovTableHeadDUB { - text-align: center; - padding-right: 6px; - padding-left: 6px; - padding-bottom: 0px; - font-family: sans-serif; - white-space: nowrap; - background-color: #FFFFFF; -} - -/* Source code view/table entry background: format for lines classified as "Deleted Covered Baseline (1 => -): -Previously tested code has been deleted" */ -td.tlaDCB -{ - text-align: right; - background-color: #FFFFFF; -} -td.tlaBgDCB { - background-color: #FFFFFF; -} - -/* Source code view/table entry background: format for lines classified as "Deleted Covered Baseline (1 => -): -Previously tested code has been deleted" */ -span.tlaDCB -{ - text-align: left; - background-color: #FFFFFF; -} -span.tlaBgDCB { - background-color: #FFFFFF; -} -a.tlaBgDCB { - background-color: #FFFFFF; - color: #000000; -} - -td.headerCovTableHeadDCB { - text-align: center; - padding-right: 6px; - padding-left: 6px; - padding-bottom: 0px; - font-family: sans-serif; - white-space: nowrap; - background-color: #FFFFFF; -} - -/* Source code view: format for date/owner bin that is not hit */ -span.missBins -{ - background-color: #ff0000 /* red */ -} diff --git a/coverage/html/glass.png b/coverage/html/glass.png deleted file mode 100644 index e1abc00680a3093c49fdb775ae6bdb6764c95af2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^j3CU&3?x-=hn)gaEa{HEjtmSN`?>!lvI6;R0X`wF z|Ns97GD8ntt^-nxB|(0{3=Yq3q=7g|-tI089jvk*Kn`btM`SSr1Gf+eGhVt|_XjA* zUgGKN%6^Gmn4d%Ph(nkFP>9RZ#WAE}PI3Z}&BVayv3^M*kj3EX>gTe~DWM4f=_Dpv diff --git a/coverage/html/index-sort-f.html b/coverage/html/index-sort-f.html deleted file mode 100644 index 7312040d..00000000 --- a/coverage/html/index-sort-f.html +++ /dev/null @@ -1,393 +0,0 @@ - - - - - - - LCOV - lcov.info - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top levelCoverageTotalHit
Test:lcov.infoLines:61.2 %42152579
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Directory Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
auth_api/ -
75.5%75.5%
-
75.5 %192145-
core/ -
74.5%74.5%
-
74.5 %5138-
core/crypto/ -
90.6%90.6%
-
90.6 %180163-
core/echo/ -
93.3%93.3%
-
93.3 %3028-
core/echo/models/ -
66.7%66.7%
-
66.7 %1510-
core/heartbit/ -
66.7%66.7%
-
66.7 %96-
core/pairing/ -
89.1%89.1%
-
89.1 %303270-
core/pairing/utils/ -
54.7%54.7%
-
54.7 %5329-
core/relay_auth/ -
86.5%86.5%
-
86.5 %11196-
core/relay_client/ -
85.6%85.6%
-
85.6 %201172-
core/relay_client/json_rpc_2/ -
0.0%
-
0.0 %6-
core/relay_client/json_rpc_2/src/ -
40.8%40.8%
-
40.8 %360147-
core/relay_client/websocket/ -
60.0%60.0%
-
60.0 %4024-
core/store/ -
75.2%75.2%
-
75.2 %12594-
core/verify/ -
68.8%68.8%
-
68.8 %1611-
core/verify/models/ -
11.1%11.1%
-
11.1 %91-
models/ -
65.2%65.2%
-
65.2 %2315-
sign_api/ -
52.9%52.9%
-
52.9 %1211641-
sign_api/models/ -
45.5%45.5%
-
45.5 %9945-
sign_api/models/auth/ -
45.6%45.6%
-
45.6 %16977-
sign_api/utils/ -
80.7%80.7%
-
80.7 %11996-
sign_api/utils/auth/ -
21.9%21.9%
-
21.9 %32070-
utils/ -
71.2%71.2%
-
71.2 %319227-
web3app/ -
64.7%64.7%
-
64.7 %11675-
web3wallet/ -
71.7%71.7%
-
71.7 %13899-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/index-sort-l.html b/coverage/html/index-sort-l.html deleted file mode 100644 index 5af4387e..00000000 --- a/coverage/html/index-sort-l.html +++ /dev/null @@ -1,307 +0,0 @@ - - - - - - - LCOV - lcov.info - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top levelCoverageTotalHit
Test:lcov.infoLines:61.2 %42152579
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Directory Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
core/relay_client/json_rpc_2/ -
0.0%
-
0.0 %6
core/verify/models/ -
11.1%11.1%
-
11.1 %91
sign_api/utils/auth/ -
21.9%21.9%
-
21.9 %32070
core/relay_client/json_rpc_2/src/ -
40.8%40.8%
-
40.8 %360147
sign_api/models/ -
45.5%45.5%
-
45.5 %9945
sign_api/models/auth/ -
45.6%45.6%
-
45.6 %16977
sign_api/ -
52.9%52.9%
-
52.9 %1211641
core/pairing/utils/ -
54.7%54.7%
-
54.7 %5329
core/relay_client/websocket/ -
60.0%60.0%
-
60.0 %4024
web3app/ -
64.7%64.7%
-
64.7 %11675
models/ -
65.2%65.2%
-
65.2 %2315
core/heartbit/ -
66.7%66.7%
-
66.7 %96
core/echo/models/ -
66.7%66.7%
-
66.7 %1510
core/verify/ -
68.8%68.8%
-
68.8 %1611
utils/ -
71.2%71.2%
-
71.2 %319227
web3wallet/ -
71.7%71.7%
-
71.7 %13899
core/ -
74.5%74.5%
-
74.5 %5138
core/store/ -
75.2%75.2%
-
75.2 %12594
auth_api/ -
75.5%75.5%
-
75.5 %192145
sign_api/utils/ -
80.7%80.7%
-
80.7 %11996
core/relay_client/ -
85.6%85.6%
-
85.6 %201172
core/relay_auth/ -
86.5%86.5%
-
86.5 %11196
core/pairing/ -
89.1%89.1%
-
89.1 %303270
core/crypto/ -
90.6%90.6%
-
90.6 %180163
core/echo/ -
93.3%93.3%
-
93.3 %3028
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/index.html b/coverage/html/index.html deleted file mode 100644 index cec02a5b..00000000 --- a/coverage/html/index.html +++ /dev/null @@ -1,307 +0,0 @@ - - - - - - - LCOV - lcov.info - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top levelCoverageTotalHit
Test:lcov.infoLines:61.2 %42152579
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Directory Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
auth_api/ -
75.5%75.5%
-
75.5 %192145
core/ -
74.5%74.5%
-
74.5 %5138
core/crypto/ -
90.6%90.6%
-
90.6 %180163
core/echo/ -
93.3%93.3%
-
93.3 %3028
core/echo/models/ -
66.7%66.7%
-
66.7 %1510
core/heartbit/ -
66.7%66.7%
-
66.7 %96
core/pairing/ -
89.1%89.1%
-
89.1 %303270
core/pairing/utils/ -
54.7%54.7%
-
54.7 %5329
core/relay_auth/ -
86.5%86.5%
-
86.5 %11196
core/relay_client/ -
85.6%85.6%
-
85.6 %201172
core/relay_client/json_rpc_2/ -
0.0%
-
0.0 %6
core/relay_client/json_rpc_2/src/ -
40.8%40.8%
-
40.8 %360147
core/relay_client/websocket/ -
60.0%60.0%
-
60.0 %4024
core/store/ -
75.2%75.2%
-
75.2 %12594
core/verify/ -
68.8%68.8%
-
68.8 %1611
core/verify/models/ -
11.1%11.1%
-
11.1 %91
models/ -
65.2%65.2%
-
65.2 %2315
sign_api/ -
52.9%52.9%
-
52.9 %1211641
sign_api/models/ -
45.5%45.5%
-
45.5 %9945
sign_api/models/auth/ -
45.6%45.6%
-
45.6 %16977
sign_api/utils/ -
80.7%80.7%
-
80.7 %11996
sign_api/utils/auth/ -
21.9%21.9%
-
21.9 %32070
utils/ -
71.2%71.2%
-
71.2 %319227
web3app/ -
64.7%64.7%
-
64.7 %11675
web3wallet/ -
71.7%71.7%
-
71.7 %13899
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/models/basic_models.dart.func-c.html b/coverage/html/models/basic_models.dart.func-c.html deleted file mode 100644 index 586c9e2c..00000000 --- a/coverage/html/models/basic_models.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - models/basic_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - models - basic_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:50.0 %42
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/models/basic_models.dart.func.html b/coverage/html/models/basic_models.dart.func.html deleted file mode 100644 index bfc2014b..00000000 --- a/coverage/html/models/basic_models.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - models/basic_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - models - basic_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:50.0 %42
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/models/basic_models.dart.gcov.html b/coverage/html/models/basic_models.dart.gcov.html deleted file mode 100644 index 719519e0..00000000 --- a/coverage/html/models/basic_models.dart.gcov.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - LCOV - lcov.info - models/basic_models.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - models - basic_models.dartCoverageTotalHit
Test:lcov.infoLines:50.0 %42
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:freezed_annotation/freezed_annotation.dart';
-       2              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/pairing_models.dart';
-       3              : 
-       4              : part 'basic_models.g.dart';
-       5              : part 'basic_models.freezed.dart';
-       6              : 
-       7              : /// ERRORS
-       8              : 
-       9              : class WalletConnectErrorSilent {}
-      10              : 
-      11              : @freezed
-      12              : class WalletConnectError with _$WalletConnectError {
-      13              :   // @JsonSerializable(includeIfNull: false)
-      14              :   const factory WalletConnectError({
-      15              :     required int code,
-      16              :     required String message,
-      17              :     String? data,
-      18              :   }) = _WalletConnectError;
-      19              : 
-      20            0 :   factory WalletConnectError.fromJson(Map<String, dynamic> json) =>
-      21            0 :       _$WalletConnectErrorFromJson(json);
-      22              : }
-      23              : 
-      24              : @freezed
-      25              : class RpcOptions with _$RpcOptions {
-      26              :   // @JsonSerializable()
-      27              :   const factory RpcOptions({
-      28              :     required int ttl,
-      29              :     required bool prompt,
-      30              :     required int tag,
-      31              :   }) = _RpcOptions;
-      32              : }
-      33              : 
-      34              : @freezed
-      35              : class ConnectionMetadata with _$ConnectionMetadata {
-      36              :   // @JsonSerializable()
-      37              :   const factory ConnectionMetadata({
-      38              :     required String publicKey,
-      39              :     required PairingMetadata metadata,
-      40              :   }) = _ConnectionMetadata;
-      41              : 
-      42            5 :   factory ConnectionMetadata.fromJson(Map<String, dynamic> json) =>
-      43            5 :       _$ConnectionMetadataFromJson(json);
-      44              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/models/index-sort-f.html b/coverage/html/models/index-sort-f.html deleted file mode 100644 index 946daf35..00000000 --- a/coverage/html/models/index-sort-f.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - LCOV - lcov.info - models - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - modelsCoverageTotalHit
Test:lcov.infoLines:65.2 %2315
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
basic_models.dart -
50.0%50.0%
-
50.0 %42-
json_rpc_error.dart -
50.0%50.0%
-
50.0 %126-
json_rpc_request.dart -
100.0%
-
100.0 %22-
json_rpc_response.dart -
100.0%
-
100.0 %22-
uri_parse_result.dart -
100.0%
-
100.0 %33-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/models/index-sort-l.html b/coverage/html/models/index-sort-l.html deleted file mode 100644 index 58982d45..00000000 --- a/coverage/html/models/index-sort-l.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - LCOV - lcov.info - models - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - modelsCoverageTotalHit
Test:lcov.infoLines:65.2 %2315
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
basic_models.dart -
50.0%50.0%
-
50.0 %42
json_rpc_error.dart -
50.0%50.0%
-
50.0 %126
json_rpc_request.dart -
100.0%
-
100.0 %22
json_rpc_response.dart -
100.0%
-
100.0 %22
uri_parse_result.dart -
100.0%
-
100.0 %33
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/models/index.html b/coverage/html/models/index.html deleted file mode 100644 index f9cd7bb6..00000000 --- a/coverage/html/models/index.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - LCOV - lcov.info - models - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - modelsCoverageTotalHit
Test:lcov.infoLines:65.2 %2315
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
basic_models.dart -
50.0%50.0%
-
50.0 %42
json_rpc_error.dart -
50.0%50.0%
-
50.0 %126
json_rpc_request.dart -
100.0%
-
100.0 %22
json_rpc_response.dart -
100.0%
-
100.0 %22
uri_parse_result.dart -
100.0%
-
100.0 %33
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/models/json_rpc_error.dart.func-c.html b/coverage/html/models/json_rpc_error.dart.func-c.html deleted file mode 100644 index be8dcd4b..00000000 --- a/coverage/html/models/json_rpc_error.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - models/json_rpc_error.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - models - json_rpc_error.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:50.0 %126
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/models/json_rpc_error.dart.func.html b/coverage/html/models/json_rpc_error.dart.func.html deleted file mode 100644 index 0b444a4e..00000000 --- a/coverage/html/models/json_rpc_error.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - models/json_rpc_error.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - models - json_rpc_error.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:50.0 %126
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/models/json_rpc_error.dart.gcov.html b/coverage/html/models/json_rpc_error.dart.gcov.html deleted file mode 100644 index 64d6c799..00000000 --- a/coverage/html/models/json_rpc_error.dart.gcov.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - LCOV - lcov.info - models/json_rpc_error.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - models - json_rpc_error.dartCoverageTotalHit
Test:lcov.infoLines:50.0 %126
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:freezed_annotation/freezed_annotation.dart';
-       2              : 
-       3              : part 'json_rpc_error.g.dart';
-       4              : part 'json_rpc_error.freezed.dart';
-       5              : 
-       6              : @freezed
-       7              : class JsonRpcError with _$JsonRpcError {
-       8              :   @JsonSerializable(includeIfNull: false)
-       9              :   const factory JsonRpcError({
-      10              :     int? code,
-      11              :     String? message,
-      12              :   }) = _JsonRpcError;
-      13              : 
-      14            0 :   factory JsonRpcError.serverError(String message) =>
-      15            0 :       JsonRpcError(code: -32000, message: message);
-      16            3 :   factory JsonRpcError.invalidParams(String message) =>
-      17            6 :       JsonRpcError(code: -32602, message: message);
-      18            0 :   factory JsonRpcError.invalidRequest(String message) =>
-      19            0 :       JsonRpcError(code: -32600, message: message);
-      20            0 :   factory JsonRpcError.parseError(String message) =>
-      21            0 :       JsonRpcError(code: -32700, message: message);
-      22            3 :   factory JsonRpcError.methodNotFound(String message) =>
-      23            6 :       JsonRpcError(code: -32601, message: message);
-      24              : 
-      25            3 :   factory JsonRpcError.fromJson(Map<String, dynamic> json) =>
-      26            3 :       _$JsonRpcErrorFromJson(json);
-      27              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/models/json_rpc_request.dart.func-c.html b/coverage/html/models/json_rpc_request.dart.func-c.html deleted file mode 100644 index 126b9c9c..00000000 --- a/coverage/html/models/json_rpc_request.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - models/json_rpc_request.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - models - json_rpc_request.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %22
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/models/json_rpc_request.dart.func.html b/coverage/html/models/json_rpc_request.dart.func.html deleted file mode 100644 index d44befa1..00000000 --- a/coverage/html/models/json_rpc_request.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - models/json_rpc_request.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - models - json_rpc_request.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %22
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/models/json_rpc_request.dart.gcov.html b/coverage/html/models/json_rpc_request.dart.gcov.html deleted file mode 100644 index f2083d8c..00000000 --- a/coverage/html/models/json_rpc_request.dart.gcov.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - LCOV - lcov.info - models/json_rpc_request.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - models - json_rpc_request.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %22
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:freezed_annotation/freezed_annotation.dart';
-       2              : 
-       3              : part 'json_rpc_request.g.dart';
-       4              : part 'json_rpc_request.freezed.dart';
-       5              : 
-       6              : @freezed
-       7              : class JsonRpcRequest with _$JsonRpcRequest {
-       8              :   @JsonSerializable()
-       9              :   const factory JsonRpcRequest({
-      10              :     required int id,
-      11              :     @Default('2.0') String jsonrpc,
-      12              :     required String method,
-      13              :     dynamic params,
-      14              :   }) = _JsonRpcRequest;
-      15              : 
-      16            6 :   factory JsonRpcRequest.fromJson(Map<String, dynamic> json) =>
-      17            6 :       _$JsonRpcRequestFromJson(json);
-      18              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/models/json_rpc_response.dart.func-c.html b/coverage/html/models/json_rpc_response.dart.func-c.html deleted file mode 100644 index 076881dd..00000000 --- a/coverage/html/models/json_rpc_response.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - models/json_rpc_response.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - models - json_rpc_response.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %22
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/models/json_rpc_response.dart.func.html b/coverage/html/models/json_rpc_response.dart.func.html deleted file mode 100644 index d79d2f86..00000000 --- a/coverage/html/models/json_rpc_response.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - models/json_rpc_response.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - models - json_rpc_response.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %22
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/models/json_rpc_response.dart.gcov.html b/coverage/html/models/json_rpc_response.dart.gcov.html deleted file mode 100644 index 20e2c5f8..00000000 --- a/coverage/html/models/json_rpc_response.dart.gcov.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - LCOV - lcov.info - models/json_rpc_response.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - models - json_rpc_response.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %22
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:freezed_annotation/freezed_annotation.dart';
-       2              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_error.dart';
-       3              : 
-       4              : part 'json_rpc_response.g.dart';
-       5              : part 'json_rpc_response.freezed.dart';
-       6              : 
-       7              : @Freezed(genericArgumentFactories: true)
-       8              : class JsonRpcResponse<T> with _$JsonRpcResponse<T> {
-       9              :   // @JsonSerializable(genericArgumentFactories: true)
-      10              :   const factory JsonRpcResponse({
-      11              :     required int id,
-      12              :     @Default('2.0') String jsonrpc,
-      13              :     JsonRpcError? error,
-      14              :     T? result,
-      15              :   }) = _JsonRpcResponse<T>;
-      16              : 
-      17            6 :   factory JsonRpcResponse.fromJson(Map<String, dynamic> json) =>
-      18           12 :       _$JsonRpcResponseFromJson(json, (object) => object as T);
-      19              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/models/uri_parse_result.dart.func-c.html b/coverage/html/models/uri_parse_result.dart.func-c.html deleted file mode 100644 index 049e515b..00000000 --- a/coverage/html/models/uri_parse_result.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - models/uri_parse_result.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - models - uri_parse_result.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %33
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/models/uri_parse_result.dart.func.html b/coverage/html/models/uri_parse_result.dart.func.html deleted file mode 100644 index c6c5bee7..00000000 --- a/coverage/html/models/uri_parse_result.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - models/uri_parse_result.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - models - uri_parse_result.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %33
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/models/uri_parse_result.dart.gcov.html b/coverage/html/models/uri_parse_result.dart.gcov.html deleted file mode 100644 index dfbad25d..00000000 --- a/coverage/html/models/uri_parse_result.dart.gcov.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - LCOV - lcov.info - models/uri_parse_result.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - models - uri_parse_result.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %33
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client_models.dart';
-       2              : 
-       3              : enum URIVersion {
-       4              :   v1,
-       5              :   v2,
-       6              : }
-       7              : 
-       8              : class URIParseResult {
-       9              :   final String protocol;
-      10              :   final String topic;
-      11              :   final URIVersion? version;
-      12              :   final URIV1ParsedData? v1Data;
-      13              :   final URIV2ParsedData? v2Data;
-      14              : 
-      15            8 :   URIParseResult({
-      16              :     required this.protocol,
-      17              :     required this.version,
-      18              :     required this.topic,
-      19              :     this.v1Data,
-      20              :     this.v2Data,
-      21              :   });
-      22              : }
-      23              : 
-      24              : class URIV1ParsedData {
-      25              :   final String key;
-      26              :   final String bridge;
-      27              : 
-      28            5 :   URIV1ParsedData({
-      29              :     required this.key,
-      30              :     required this.bridge,
-      31              :   });
-      32              : }
-      33              : 
-      34              : class URIV2ParsedData {
-      35              :   final String symKey;
-      36              :   final Relay relay;
-      37              :   final List<String> methods;
-      38              : 
-      39            8 :   URIV2ParsedData({
-      40              :     required this.symKey,
-      41              :     required this.relay,
-      42              :     required this.methods,
-      43              :   });
-      44              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/ruby.png b/coverage/html/ruby.png deleted file mode 100644 index 991b6d4ec9e78be165e3ef757eed1aada287364d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 141 zcmeAS@N?(olHy`uVBq!ia0vp^j3CU&3?x-=hn)ga>?NMQuI!iC1^FceV#7`HfI^%F z9+AZi4BSE>%y{W;-5;PJOS+@4BLl<6e(pbstUx|nfKQ0)e^Y%R^MdiLxj>4`)5S5Q b;#P73kj=!v_*DHKNFRfztDnm{r-UW|iOwIS diff --git a/coverage/html/sign_api/index-sort-f.html b/coverage/html/sign_api/index-sort-f.html deleted file mode 100644 index 12426721..00000000 --- a/coverage/html/sign_api/index-sort-f.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_apiCoverageTotalHit
Test:lcov.infoLines:52.9 %1211641
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
sessions.dart -
100.0%
-
100.0 %77-
sign_client.dart -
57.6%57.6%
-
57.6 %15891-
sign_engine.dart -
51.9%51.9%
-
51.9 %1046543-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/index-sort-l.html b/coverage/html/sign_api/index-sort-l.html deleted file mode 100644 index 19b67aeb..00000000 --- a/coverage/html/sign_api/index-sort-l.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_apiCoverageTotalHit
Test:lcov.infoLines:52.9 %1211641
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
sign_engine.dart -
51.9%51.9%
-
51.9 %1046543
sign_client.dart -
57.6%57.6%
-
57.6 %15891
sessions.dart -
100.0%
-
100.0 %77
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/index.html b/coverage/html/sign_api/index.html deleted file mode 100644 index bad13f86..00000000 --- a/coverage/html/sign_api/index.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_apiCoverageTotalHit
Test:lcov.infoLines:52.9 %1211641
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
sessions.dart -
100.0%
-
100.0 %77
sign_client.dart -
57.6%57.6%
-
57.6 %15891
sign_engine.dart -
51.9%51.9%
-
51.9 %1046543
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/auth/auth_client_events.dart.func-c.html b/coverage/html/sign_api/models/auth/auth_client_events.dart.func-c.html deleted file mode 100644 index df39df89..00000000 --- a/coverage/html/sign_api/models/auth/auth_client_events.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/auth/auth_client_events.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models/auth - auth_client_events.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:16.7 %122
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/auth/auth_client_events.dart.func.html b/coverage/html/sign_api/models/auth/auth_client_events.dart.func.html deleted file mode 100644 index bc6a2b92..00000000 --- a/coverage/html/sign_api/models/auth/auth_client_events.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/auth/auth_client_events.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models/auth - auth_client_events.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:16.7 %122
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/auth/auth_client_events.dart.gcov.html b/coverage/html/sign_api/models/auth/auth_client_events.dart.gcov.html deleted file mode 100644 index 221634af..00000000 --- a/coverage/html/sign_api/models/auth/auth_client_events.dart.gcov.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/auth/auth_client_events.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models/auth - auth_client_events.dartCoverageTotalHit
Test:lcov.infoLines:16.7 %122
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:convert';
-       2              : 
-       3              : import 'package:event/event.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_error.dart';
-       6              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/auth_client_models.dart';
-       7              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/common_auth_models.dart';
-       8              : 
-       9              : class AuthRequest extends EventArgs {
-      10              :   final int id;
-      11              :   final String topic;
-      12              :   final AuthPayloadParams payloadParams;
-      13              :   final ConnectionMetadata requester;
-      14              : 
-      15            2 :   AuthRequest({
-      16              :     required this.id,
-      17              :     required this.topic,
-      18              :     required this.payloadParams,
-      19              :     required this.requester,
-      20              :   });
-      21              : 
-      22            0 :   @override
-      23              :   String toString() {
-      24            0 :     return 'AuthRequest(id: $id, topic: $topic, payloadParams: $payloadParams, requester: $requester)';
-      25              :   }
-      26              : }
-      27              : 
-      28              : class AuthResponse extends EventArgs {
-      29              :   final int id;
-      30              :   final String topic;
-      31              :   final Cacao? result;
-      32              :   final WalletConnectError? error;
-      33              :   final JsonRpcError? jsonRpcError;
-      34              : 
-      35            2 :   AuthResponse({
-      36              :     required this.id,
-      37              :     required this.topic,
-      38              :     this.result,
-      39              :     this.error,
-      40              :     this.jsonRpcError,
-      41              :   });
-      42              : 
-      43            0 :   Map<String, dynamic> toJson() => {
-      44            0 :         'id': id,
-      45            0 :         'topic': topic,
-      46            0 :         if (result != null) 'result': result?.toJson(),
-      47            0 :         if (error != null) 'error': error!.toJson(),
-      48            0 :         if (jsonRpcError != null) 'jsonRpcError': jsonRpcError!.toJson(),
-      49              :       };
-      50              : 
-      51            0 :   @override
-      52              :   String toString() {
-      53            0 :     return 'AuthResponse(${jsonEncode(toJson())})';
-      54              :   }
-      55              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/auth/auth_client_models.dart.func-c.html b/coverage/html/sign_api/models/auth/auth_client_models.dart.func-c.html deleted file mode 100644 index 1ceaec25..00000000 --- a/coverage/html/sign_api/models/auth/auth_client_models.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/auth/auth_client_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models/auth - auth_client_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:62.8 %4327
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/auth/auth_client_models.dart.func.html b/coverage/html/sign_api/models/auth/auth_client_models.dart.func.html deleted file mode 100644 index 501942af..00000000 --- a/coverage/html/sign_api/models/auth/auth_client_models.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/auth/auth_client_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models/auth - auth_client_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:62.8 %4327
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/auth/auth_client_models.dart.gcov.html b/coverage/html/sign_api/models/auth/auth_client_models.dart.gcov.html deleted file mode 100644 index ee8f1990..00000000 --- a/coverage/html/sign_api/models/auth/auth_client_models.dart.gcov.html +++ /dev/null @@ -1,238 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/auth/auth_client_models.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models/auth - auth_client_models.dartCoverageTotalHit
Test:lcov.infoLines:62.8 %4327
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:async';
-       2              : 
-       3              : import 'package:freezed_annotation/freezed_annotation.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/auth_client_events.dart';
-       6              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/common_auth_models.dart';
-       7              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/auth/auth_utils.dart';
-       8              : 
-       9              : part 'auth_client_models.g.dart';
-      10              : part 'auth_client_models.freezed.dart';
-      11              : 
-      12              : class AuthRequestResponse {
-      13              :   final int id;
-      14              :   final String pairingTopic;
-      15              :   final Completer<AuthResponse> completer;
-      16              :   final Uri? uri;
-      17              : 
-      18            2 :   AuthRequestResponse({
-      19              :     required this.id,
-      20              :     required this.pairingTopic,
-      21              :     required this.completer,
-      22              :     this.uri,
-      23              :   });
-      24              : }
-      25              : 
-      26              : class AuthRequestParams {
-      27              :   /// The Chain ID.
-      28              :   /// Examples: eip155:1 (Eth Mainnet), eip155:43114 (Avalanche)
-      29              :   final String chainId;
-      30              : 
-      31              :   /// The complete URL you are logging into.
-      32              :   /// Example: https://example.com/login
-      33              :   final String aud;
-      34              : 
-      35              :   /// The domain you are logging in to.
-      36              :   /// Example: example.com
-      37              :   final String domain;
-      38              :   final String nonce;
-      39              :   final String? type;
-      40              :   final String? nbf;
-      41              :   final String? exp;
-      42              :   final String? statement;
-      43              :   final String? requestId;
-      44              :   final List<String>? resources;
-      45              :   final int? expiry;
-      46              : 
-      47            3 :   AuthRequestParams({
-      48              :     required this.chainId,
-      49              :     required this.domain,
-      50              :     required this.aud,
-      51              :     String? nonce,
-      52              :     this.type = CacaoHeader.EIP4361,
-      53              :     this.nbf,
-      54              :     this.exp,
-      55              :     this.statement,
-      56              :     this.requestId,
-      57              :     this.resources,
-      58              :     this.expiry,
-      59            3 :   }) : nonce = nonce ?? AuthUtils.generateNonce();
-      60              : 
-      61            0 :   Map<String, dynamic> toJson() => {
-      62            0 :         'chainId': chainId,
-      63            0 :         'aud': aud,
-      64            0 :         'domain': domain,
-      65            0 :         'nonce': nonce,
-      66            0 :         if (type != null) 'type': type,
-      67            0 :         if (nbf != null) 'nbf': nbf,
-      68            0 :         if (exp != null) 'exp': exp,
-      69            0 :         if (statement != null) 'statement': statement,
-      70            0 :         if (requestId != null) 'requestId': requestId,
-      71            0 :         if (resources != null) 'resources': resources,
-      72            0 :         if (expiry != null) 'expiry': expiry,
-      73              :       };
-      74              : }
-      75              : 
-      76              : @freezed
-      77              : class AuthPayloadParams with _$AuthPayloadParams {
-      78              :   @JsonSerializable(includeIfNull: false)
-      79              :   const factory AuthPayloadParams({
-      80              :     required String chainId,
-      81              :     required String aud,
-      82              :     required String domain,
-      83              :     required String nonce,
-      84              :     required String type,
-      85              :     //
-      86              :     required String version,
-      87              :     required String iat,
-      88              :     //
-      89              :     String? nbf,
-      90              :     String? exp,
-      91              :     String? statement,
-      92              :     String? requestId,
-      93              :     List<String>? resources,
-      94              :   }) = _AuthPayloadParams;
-      95              : 
-      96            2 :   factory AuthPayloadParams.fromRequestParams(AuthRequestParams params) {
-      97            2 :     final now = DateTime.now();
-      98            2 :     return AuthPayloadParams(
-      99            2 :       type: params.type ?? CacaoHeader.EIP4361,
-     100            2 :       chainId: params.chainId,
-     101            2 :       domain: params.domain,
-     102            2 :       aud: params.aud,
-     103              :       version: '1',
-     104            2 :       nonce: params.nonce,
-     105            2 :       iat: DateTime.utc(
-     106            2 :         now.year,
-     107            2 :         now.month,
-     108            2 :         now.day,
-     109            2 :         now.hour,
-     110            2 :         now.minute,
-     111            2 :         now.second,
-     112            2 :         now.millisecond,
-     113            2 :       ).toIso8601String(),
-     114            2 :       nbf: params.nbf,
-     115            2 :       exp: params.exp,
-     116            2 :       statement: params.statement,
-     117            2 :       requestId: params.requestId,
-     118            2 :       resources: params.resources,
-     119              :     );
-     120              :   }
-     121              : 
-     122            2 :   factory AuthPayloadParams.fromJson(Map<String, dynamic> json) =>
-     123            2 :       _$AuthPayloadParamsFromJson(json);
-     124              : }
-     125              : 
-     126              : @freezed
-     127              : class PendingAuthRequest with _$PendingAuthRequest {
-     128              :   @JsonSerializable(includeIfNull: false)
-     129              :   const factory PendingAuthRequest({
-     130              :     required int id,
-     131              :     required String pairingTopic,
-     132              :     required ConnectionMetadata metadata,
-     133              :     required CacaoRequestPayload cacaoPayload,
-     134              :   }) = _PendingAuthRequest;
-     135              : 
-     136            0 :   factory PendingAuthRequest.fromJson(Map<String, dynamic> json) =>
-     137            0 :       _$PendingAuthRequestFromJson(json);
-     138              : }
-     139              : 
-     140              : class AuthRequestCompleter {
-     141              :   final int id;
-     142              :   final String pairingTopic;
-     143              :   final String responseTopic;
-     144              :   final PendingAuthRequest request;
-     145              :   final Completer<Cacao> completer;
-     146              : 
-     147            0 :   AuthRequestCompleter({
-     148              :     required this.id,
-     149              :     required this.pairingTopic,
-     150              :     required this.responseTopic,
-     151              :     required this.request,
-     152              :     required this.completer,
-     153              :   });
-     154              : }
-     155              : 
-     156              : class RespondParams {
-     157              :   final int id;
-     158              :   final CacaoSignature? signature;
-     159              :   final WalletConnectError? error;
-     160              : 
-     161            0 :   RespondParams({
-     162              :     required this.id,
-     163              :     this.signature,
-     164              :     this.error,
-     165              :   });
-     166              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/auth/common_auth_models.dart.func-c.html b/coverage/html/sign_api/models/auth/common_auth_models.dart.func-c.html deleted file mode 100644 index 1b4ebc61..00000000 --- a/coverage/html/sign_api/models/auth/common_auth_models.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/auth/common_auth_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models/auth - common_auth_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:72.7 %6648
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/auth/common_auth_models.dart.func.html b/coverage/html/sign_api/models/auth/common_auth_models.dart.func.html deleted file mode 100644 index 3999380c..00000000 --- a/coverage/html/sign_api/models/auth/common_auth_models.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/auth/common_auth_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models/auth - common_auth_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:72.7 %6648
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/auth/common_auth_models.dart.gcov.html b/coverage/html/sign_api/models/auth/common_auth_models.dart.gcov.html deleted file mode 100644 index e25fc7f2..00000000 --- a/coverage/html/sign_api/models/auth/common_auth_models.dart.gcov.html +++ /dev/null @@ -1,268 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/auth/common_auth_models.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models/auth - common_auth_models.dartCoverageTotalHit
Test:lcov.infoLines:72.7 %6648
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:freezed_annotation/freezed_annotation.dart';
-       2              : 
-       3              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/auth_client_models.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/session_auth_models.dart';
-       5              : 
-       6              : part 'common_auth_models.g.dart';
-       7              : part 'common_auth_models.freezed.dart';
-       8              : 
-       9              : @freezed
-      10              : class AuthPublicKey with _$AuthPublicKey {
-      11              :   @JsonSerializable(includeIfNull: false)
-      12              :   const factory AuthPublicKey({
-      13              :     required String publicKey,
-      14              :   }) = _AuthPublicKey;
-      15              : 
-      16            0 :   factory AuthPublicKey.fromJson(Map<String, dynamic> json) =>
-      17            0 :       _$AuthPublicKeyFromJson(json);
-      18              : }
-      19              : 
-      20              : @freezed
-      21              : class CacaoRequestPayload with _$CacaoRequestPayload {
-      22              :   @JsonSerializable(includeIfNull: false)
-      23              :   const factory CacaoRequestPayload({
-      24              :     required String domain,
-      25              :     required String aud,
-      26              :     required String version,
-      27              :     required String nonce,
-      28              :     required String iat,
-      29              :     String? nbf,
-      30              :     String? exp,
-      31              :     String? statement,
-      32              :     String? requestId,
-      33              :     List<String>? resources,
-      34              :   }) = _CacaoRequestPayload;
-      35              : 
-      36            2 :   factory CacaoRequestPayload.fromPayloadParams(AuthPayloadParams params) {
-      37            2 :     return CacaoRequestPayload(
-      38            2 :       domain: params.domain,
-      39            2 :       aud: params.aud,
-      40            2 :       version: params.version,
-      41            2 :       nonce: params.nonce,
-      42            2 :       iat: params.iat,
-      43            2 :       nbf: params.nbf,
-      44            2 :       exp: params.exp,
-      45            2 :       statement: params.statement,
-      46            2 :       requestId: params.requestId,
-      47            2 :       resources: params.resources,
-      48              :     );
-      49              :   }
-      50              : 
-      51            0 :   factory CacaoRequestPayload.fromSessionAuthPayload(
-      52              :     SessionAuthPayload params,
-      53              :   ) {
-      54            0 :     return CacaoRequestPayload(
-      55            0 :       domain: params.domain,
-      56            0 :       aud: params.aud,
-      57            0 :       version: params.version,
-      58            0 :       nonce: params.nonce,
-      59            0 :       iat: params.iat,
-      60            0 :       nbf: params.nbf,
-      61            0 :       exp: params.exp,
-      62            0 :       statement: params.statement,
-      63            0 :       requestId: params.requestId,
-      64            0 :       resources: params.resources,
-      65              :     );
-      66              :   }
-      67              : 
-      68            2 :   factory CacaoRequestPayload.fromCacaoPayload(CacaoPayload payload) {
-      69            2 :     return CacaoRequestPayload(
-      70            2 :       domain: payload.domain,
-      71            2 :       aud: payload.aud,
-      72            2 :       version: payload.version,
-      73            2 :       nonce: payload.nonce,
-      74            2 :       iat: payload.iat,
-      75            2 :       nbf: payload.nbf,
-      76            2 :       exp: payload.exp,
-      77            2 :       statement: payload.statement,
-      78            2 :       requestId: payload.requestId,
-      79            2 :       resources: payload.resources,
-      80              :     );
-      81              :   }
-      82              : 
-      83            0 :   factory CacaoRequestPayload.fromJson(Map<String, dynamic> json) =>
-      84            0 :       _$CacaoRequestPayloadFromJson(json);
-      85              : }
-      86              : 
-      87              : @freezed
-      88              : class CacaoPayload with _$CacaoPayload {
-      89              :   @JsonSerializable(includeIfNull: false)
-      90              :   const factory CacaoPayload({
-      91              :     required String iss,
-      92              :     required String domain,
-      93              :     required String aud,
-      94              :     required String version,
-      95              :     required String nonce,
-      96              :     required String iat,
-      97              :     String? nbf,
-      98              :     String? exp,
-      99              :     String? statement,
-     100              :     String? requestId,
-     101              :     List<String>? resources,
-     102              :   }) = _CacaoPayload;
-     103              : 
-     104            2 :   factory CacaoPayload.fromRequestPayload({
-     105              :     required String issuer,
-     106              :     required CacaoRequestPayload payload,
-     107              :   }) {
-     108            2 :     return CacaoPayload(
-     109              :       iss: issuer,
-     110            2 :       domain: payload.domain,
-     111            2 :       aud: payload.aud,
-     112            2 :       version: payload.version,
-     113            2 :       nonce: payload.nonce,
-     114            2 :       iat: payload.iat,
-     115            2 :       nbf: payload.nbf,
-     116            2 :       exp: payload.exp,
-     117            2 :       statement: payload.statement,
-     118            2 :       requestId: payload.requestId,
-     119            2 :       resources: payload.resources,
-     120              :     );
-     121              :   }
-     122              : 
-     123            2 :   factory CacaoPayload.fromJson(Map<String, dynamic> json) =>
-     124            2 :       _$CacaoPayloadFromJson(json);
-     125              : }
-     126              : 
-     127              : @freezed
-     128              : class CacaoHeader with _$CacaoHeader {
-     129              :   static const EIP4361 = 'eip4361';
-     130              :   static const CAIP122 = 'caip122';
-     131              : 
-     132              :   @JsonSerializable(includeIfNull: false)
-     133              :   const factory CacaoHeader({
-     134              :     @Default('eip4361') String t,
-     135              :   }) = _CacaoHeader;
-     136              : 
-     137            2 :   factory CacaoHeader.fromJson(Map<String, dynamic> json) =>
-     138            2 :       _$CacaoHeaderFromJson(json);
-     139              : }
-     140              : 
-     141              : @freezed
-     142              : class CacaoSignature with _$CacaoSignature {
-     143              :   static const EIP191 = 'eip191';
-     144              :   static const EIP1271 = 'eip1271';
-     145              : 
-     146              :   @JsonSerializable(includeIfNull: false)
-     147              :   const factory CacaoSignature({
-     148              :     required String t,
-     149              :     required String s,
-     150              :     String? m,
-     151              :   }) = _CacaoSignature;
-     152              : 
-     153            2 :   factory CacaoSignature.fromJson(Map<String, dynamic> json) =>
-     154            2 :       _$CacaoSignatureFromJson(json);
-     155              : }
-     156              : 
-     157              : @freezed
-     158              : class Cacao with _$Cacao {
-     159              :   @JsonSerializable(includeIfNull: false)
-     160              :   const factory Cacao({
-     161              :     required CacaoHeader h,
-     162              :     required CacaoPayload p,
-     163              :     required CacaoSignature s,
-     164              :   }) = _Cacao;
-     165              : 
-     166            4 :   factory Cacao.fromJson(Map<String, dynamic> json) => _$CacaoFromJson(json);
-     167              : }
-     168              : 
-     169              : @freezed
-     170              : class StoredCacao with _$StoredCacao {
-     171              :   @JsonSerializable(includeIfNull: false)
-     172              :   const factory StoredCacao({
-     173              :     required int id,
-     174              :     required String pairingTopic,
-     175              :     required CacaoHeader h,
-     176              :     required CacaoPayload p,
-     177              :     required CacaoSignature s,
-     178              :   }) = _StoredCacao;
-     179              : 
-     180            2 :   factory StoredCacao.fromCacao({
-     181              :     required int id,
-     182              :     required String pairingTopic,
-     183              :     required Cacao cacao,
-     184              :   }) {
-     185            2 :     return StoredCacao(
-     186              :       id: id,
-     187              :       pairingTopic: pairingTopic,
-     188            2 :       h: cacao.h,
-     189            2 :       p: cacao.p,
-     190            2 :       s: cacao.s,
-     191              :     );
-     192              :   }
-     193              : 
-     194            0 :   factory StoredCacao.fromJson(Map<String, dynamic> json) =>
-     195            0 :       _$StoredCacaoFromJson(json);
-     196              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/auth/index-sort-f.html b/coverage/html/sign_api/models/auth/index-sort-f.html deleted file mode 100644 index 3af50bbb..00000000 --- a/coverage/html/sign_api/models/auth/index-sort-f.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/auth - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models/authCoverageTotalHit
Test:lcov.infoLines:45.6 %16977
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
auth_client_events.dart -
16.7%16.7%
-
16.7 %122-
auth_client_models.dart -
62.8%62.8%
-
62.8 %4327-
common_auth_models.dart -
72.7%72.7%
-
72.7 %6648-
session_auth_events.dart -
0.0%
-
0.0 %19-
session_auth_models.dart -
0.0%
-
0.0 %29-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/auth/index-sort-l.html b/coverage/html/sign_api/models/auth/index-sort-l.html deleted file mode 100644 index 130f99b7..00000000 --- a/coverage/html/sign_api/models/auth/index-sort-l.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/auth - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models/authCoverageTotalHit
Test:lcov.infoLines:45.6 %16977
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
session_auth_events.dart -
0.0%
-
0.0 %19
session_auth_models.dart -
0.0%
-
0.0 %29
auth_client_events.dart -
16.7%16.7%
-
16.7 %122
auth_client_models.dart -
62.8%62.8%
-
62.8 %4327
common_auth_models.dart -
72.7%72.7%
-
72.7 %6648
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/auth/index.html b/coverage/html/sign_api/models/auth/index.html deleted file mode 100644 index 5777aa86..00000000 --- a/coverage/html/sign_api/models/auth/index.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/auth - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models/authCoverageTotalHit
Test:lcov.infoLines:45.6 %16977
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
auth_client_events.dart -
16.7%16.7%
-
16.7 %122
auth_client_models.dart -
62.8%62.8%
-
62.8 %4327
common_auth_models.dart -
72.7%72.7%
-
72.7 %6648
session_auth_events.dart -
0.0%
-
0.0 %19
session_auth_models.dart -
0.0%
-
0.0 %29
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/auth/session_auth_events.dart.func-c.html b/coverage/html/sign_api/models/auth/session_auth_events.dart.func-c.html deleted file mode 100644 index 129489ed..00000000 --- a/coverage/html/sign_api/models/auth/session_auth_events.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/auth/session_auth_events.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models/auth - session_auth_events.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %190
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/auth/session_auth_events.dart.func.html b/coverage/html/sign_api/models/auth/session_auth_events.dart.func.html deleted file mode 100644 index e50ac9bc..00000000 --- a/coverage/html/sign_api/models/auth/session_auth_events.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/auth/session_auth_events.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models/auth - session_auth_events.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %190
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/auth/session_auth_events.dart.gcov.html b/coverage/html/sign_api/models/auth/session_auth_events.dart.gcov.html deleted file mode 100644 index 2db22d45..00000000 --- a/coverage/html/sign_api/models/auth/session_auth_events.dart.gcov.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/auth/session_auth_events.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models/auth - session_auth_events.dartCoverageTotalHit
Test:lcov.infoLines:0.0 %190
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:convert';
-       2              : 
-       3              : import 'package:event/event.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/core/verify/models/verify_context.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
-       6              : import 'package:walletconnect_flutter_v2/apis/models/json_rpc_error.dart';
-       7              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/common_auth_models.dart';
-       8              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/session_models.dart';
-       9              : 
-      10              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/session_auth_models.dart';
-      11              : 
-      12              : class SessionAuthRequest extends EventArgs {
-      13              :   final int id;
-      14              :   final String topic;
-      15              :   final SessionAuthPayload authPayload;
-      16              :   final ConnectionMetadata requester;
-      17              :   final VerifyContext? verifyContext;
-      18              : 
-      19            0 :   SessionAuthRequest({
-      20              :     required this.id,
-      21              :     required this.topic,
-      22              :     required this.authPayload,
-      23              :     required this.requester,
-      24              :     this.verifyContext,
-      25              :   });
-      26              : 
-      27            0 :   Map<String, dynamic> toJson() => {
-      28            0 :         'id': id,
-      29            0 :         'topic': topic,
-      30            0 :         'authPayload': authPayload.toJson(),
-      31            0 :         'requester': requester.toJson(),
-      32            0 :         'verifyContext': verifyContext?.toJson(),
-      33              :       };
-      34              : 
-      35            0 :   @override
-      36              :   String toString() {
-      37            0 :     return 'SessionAuthRequest(${jsonEncode(toJson())})';
-      38              :   }
-      39              : }
-      40              : 
-      41              : class SessionAuthResponse extends EventArgs {
-      42              :   final int id;
-      43              :   final String topic;
-      44              :   final List<Cacao>? auths;
-      45              :   final SessionData? session;
-      46              :   final WalletConnectError? error;
-      47              :   final JsonRpcError? jsonRpcError;
-      48              : 
-      49            0 :   SessionAuthResponse({
-      50              :     required this.id,
-      51              :     required this.topic,
-      52              :     this.auths,
-      53              :     this.session,
-      54              :     this.error,
-      55              :     this.jsonRpcError,
-      56              :   });
-      57              : 
-      58            0 :   Map<String, dynamic> toJson() => {
-      59            0 :         'id': id,
-      60            0 :         'topic': topic,
-      61            0 :         if (auths != null) 'auths': auths,
-      62            0 :         if (session != null) 'session': session!.toJson(),
-      63            0 :         if (error != null) 'error': error!.toJson(),
-      64            0 :         if (jsonRpcError != null) 'jsonRpcError': jsonRpcError!.toJson(),
-      65              :       };
-      66              : 
-      67            0 :   @override
-      68              :   String toString() {
-      69            0 :     return 'SessionAuthResponse(${jsonEncode(toJson())})';
-      70              :   }
-      71              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/auth/session_auth_models.dart.func-c.html b/coverage/html/sign_api/models/auth/session_auth_models.dart.func-c.html deleted file mode 100644 index 3c595ca0..00000000 --- a/coverage/html/sign_api/models/auth/session_auth_models.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/auth/session_auth_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models/auth - session_auth_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %290
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/auth/session_auth_models.dart.func.html b/coverage/html/sign_api/models/auth/session_auth_models.dart.func.html deleted file mode 100644 index 1271183e..00000000 --- a/coverage/html/sign_api/models/auth/session_auth_models.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/auth/session_auth_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models/auth - session_auth_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %290
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/auth/session_auth_models.dart.gcov.html b/coverage/html/sign_api/models/auth/session_auth_models.dart.gcov.html deleted file mode 100644 index 11cd6682..00000000 --- a/coverage/html/sign_api/models/auth/session_auth_models.dart.gcov.html +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/auth/session_auth_models.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models/auth - session_auth_models.dartCoverageTotalHit
Test:lcov.infoLines:0.0 %290
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:async';
-       2              : 
-       3              : import 'package:freezed_annotation/freezed_annotation.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/core/verify/models/verify_context.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
-       6              : 
-       7              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/common_auth_models.dart';
-       8              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/session_auth_events.dart';
-       9              : 
-      10              : part 'session_auth_models.g.dart';
-      11              : part 'session_auth_models.freezed.dart';
-      12              : 
-      13              : // TODO this should be under sign_client_models.dart probably
-      14              : class SessionAuthRequestResponse {
-      15              :   final int id;
-      16              :   final String pairingTopic;
-      17              :   final Completer<SessionAuthResponse> completer;
-      18              :   final Uri? uri;
-      19              : 
-      20            0 :   SessionAuthRequestResponse({
-      21              :     required this.id,
-      22              :     required this.pairingTopic,
-      23              :     required this.completer,
-      24              :     this.uri,
-      25              :   });
-      26              : }
-      27              : 
-      28              : @freezed
-      29              : class SessionAuthRequestParams with _$SessionAuthRequestParams {
-      30              :   @JsonSerializable(includeIfNull: false)
-      31              :   const factory SessionAuthRequestParams({
-      32              :     required List<String> chains,
-      33              :     required String domain,
-      34              :     required String nonce,
-      35              :     required String uri,
-      36              :     //
-      37              :     CacaoHeader? type,
-      38              :     String? nbf,
-      39              :     String? exp,
-      40              :     String? statement,
-      41              :     String? requestId,
-      42              :     List<String>? resources,
-      43              :     int? expiry,
-      44              :     @Default(<String>[]) List<String>? methods,
-      45              :   }) = _SessionAuthRequestParams;
-      46              :   //
-      47            0 :   factory SessionAuthRequestParams.fromJson(Map<String, dynamic> json) =>
-      48            0 :       _$SessionAuthRequestParamsFromJson(json);
-      49              : }
-      50              : 
-      51              : @freezed
-      52              : class SessionAuthPayload with _$SessionAuthPayload {
-      53              :   @JsonSerializable(includeIfNull: false)
-      54              :   const factory SessionAuthPayload({
-      55              :     required List<String> chains,
-      56              :     required String domain,
-      57              :     required String nonce,
-      58              :     required String aud,
-      59              :     required String type,
-      60              :     //
-      61              :     required String version,
-      62              :     required String iat,
-      63              :     //
-      64              :     String? nbf,
-      65              :     String? exp,
-      66              :     String? statement,
-      67              :     String? requestId,
-      68              :     List<String>? resources,
-      69              :   }) = _SessionAuthPayload;
-      70              : 
-      71            0 :   factory SessionAuthPayload.fromRequestParams(
-      72              :     SessionAuthRequestParams params,
-      73              :   ) {
-      74            0 :     final now = DateTime.now();
-      75            0 :     return SessionAuthPayload(
-      76            0 :       chains: params.chains,
-      77            0 :       domain: params.domain,
-      78            0 :       nonce: params.nonce,
-      79            0 :       aud: params.uri,
-      80            0 :       type: params.type?.t ?? 'eip4361',
-      81              :       version: '1',
-      82            0 :       iat: DateTime.utc(
-      83            0 :         now.year,
-      84            0 :         now.month,
-      85            0 :         now.day,
-      86            0 :         now.hour,
-      87            0 :         now.minute,
-      88            0 :         now.second,
-      89            0 :         now.millisecond,
-      90            0 :       ).toIso8601String(),
-      91            0 :       nbf: params.nbf,
-      92            0 :       exp: params.exp,
-      93            0 :       statement: params.statement,
-      94            0 :       requestId: params.requestId,
-      95            0 :       resources: params.resources,
-      96              :     );
-      97              :   }
-      98              : 
-      99            0 :   factory SessionAuthPayload.fromJson(Map<String, dynamic> json) =>
-     100            0 :       _$SessionAuthPayloadFromJson(json);
-     101              : }
-     102              : 
-     103              : @freezed
-     104              : class PendingSessionAuthRequest with _$PendingSessionAuthRequest {
-     105              :   @JsonSerializable(includeIfNull: false)
-     106              :   const factory PendingSessionAuthRequest({
-     107              :     required int id,
-     108              :     required String pairingTopic,
-     109              :     required ConnectionMetadata requester,
-     110              :     required int expiryTimestamp,
-     111              :     required CacaoRequestPayload authPayload,
-     112              :     required VerifyContext verifyContext,
-     113              :   }) = _PendingSessionAuthRequest;
-     114              : 
-     115            0 :   factory PendingSessionAuthRequest.fromJson(Map<String, dynamic> json) =>
-     116            0 :       _$PendingSessionAuthRequestFromJson(json);
-     117              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/index-sort-f.html b/coverage/html/sign_api/models/index-sort-f.html deleted file mode 100644 index ecb8b3de..00000000 --- a/coverage/html/sign_api/models/index-sort-f.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/modelsCoverageTotalHit
Test:lcov.infoLines:45.5 %9945
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
json_rpc_models.dart -
64.7%64.7%
-
64.7 %3422-
proposal_models.dart -
33.3%33.3%
-
33.3 %62-
session_models.dart -
33.3%33.3%
-
33.3 %93-
sign_client_events.dart -
36.4%36.4%
-
36.4 %4416-
sign_client_models.dart -
33.3%33.3%
-
33.3 %62-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/index-sort-l.html b/coverage/html/sign_api/models/index-sort-l.html deleted file mode 100644 index 4ba99186..00000000 --- a/coverage/html/sign_api/models/index-sort-l.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/modelsCoverageTotalHit
Test:lcov.infoLines:45.5 %9945
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
proposal_models.dart -
33.3%33.3%
-
33.3 %62
sign_client_models.dart -
33.3%33.3%
-
33.3 %62
session_models.dart -
33.3%33.3%
-
33.3 %93
sign_client_events.dart -
36.4%36.4%
-
36.4 %4416
json_rpc_models.dart -
64.7%64.7%
-
64.7 %3422
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/index.html b/coverage/html/sign_api/models/index.html deleted file mode 100644 index f50fe465..00000000 --- a/coverage/html/sign_api/models/index.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/modelsCoverageTotalHit
Test:lcov.infoLines:45.5 %9945
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
json_rpc_models.dart -
64.7%64.7%
-
64.7 %3422
proposal_models.dart -
33.3%33.3%
-
33.3 %62
session_models.dart -
33.3%33.3%
-
33.3 %93
sign_client_events.dart -
36.4%36.4%
-
36.4 %4416
sign_client_models.dart -
33.3%33.3%
-
33.3 %62
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/json_rpc_models.dart.func-c.html b/coverage/html/sign_api/models/json_rpc_models.dart.func-c.html deleted file mode 100644 index 33e10dd4..00000000 --- a/coverage/html/sign_api/models/json_rpc_models.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/json_rpc_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models - json_rpc_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:64.7 %3422
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/json_rpc_models.dart.func.html b/coverage/html/sign_api/models/json_rpc_models.dart.func.html deleted file mode 100644 index 2e9d7638..00000000 --- a/coverage/html/sign_api/models/json_rpc_models.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/json_rpc_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models - json_rpc_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:64.7 %3422
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/json_rpc_models.dart.gcov.html b/coverage/html/sign_api/models/json_rpc_models.dart.gcov.html deleted file mode 100644 index 91fe7904..00000000 --- a/coverage/html/sign_api/models/json_rpc_models.dart.gcov.html +++ /dev/null @@ -1,294 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/json_rpc_models.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models - json_rpc_models.dartCoverageTotalHit
Test:lcov.infoLines:64.7 %3422
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:freezed_annotation/freezed_annotation.dart';
-       2              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client_models.dart';
-       3              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/auth_client_models.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/common_auth_models.dart';
-       6              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/session_auth_models.dart';
-       7              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/proposal_models.dart';
-       8              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/session_models.dart';
-       9              : 
-      10              : part 'json_rpc_models.g.dart';
-      11              : part 'json_rpc_models.freezed.dart';
-      12              : 
-      13              : @freezed
-      14              : class WcPairingDeleteRequest with _$WcPairingDeleteRequest {
-      15              :   @JsonSerializable()
-      16              :   const factory WcPairingDeleteRequest({
-      17              :     required int code,
-      18              :     required String message,
-      19              :   }) = _WcPairingDeleteRequest;
-      20              : 
-      21            0 :   factory WcPairingDeleteRequest.fromJson(Map<String, dynamic> json) =>
-      22            0 :       _$WcPairingDeleteRequestFromJson(json);
-      23              : }
-      24              : 
-      25              : @freezed
-      26              : class WcPairingPingRequest with _$WcPairingPingRequest {
-      27              :   @JsonSerializable()
-      28              :   const factory WcPairingPingRequest({
-      29              :     required Map<String, dynamic> data,
-      30              :   }) = _WcPairingPingRequest;
-      31              : 
-      32            0 :   factory WcPairingPingRequest.fromJson(Map<String, dynamic> json) =>
-      33            0 :       _$WcPairingPingRequestFromJson(json);
-      34              : }
-      35              : 
-      36              : @freezed
-      37              : class WcSessionProposeRequest with _$WcSessionProposeRequest {
-      38              :   @JsonSerializable(includeIfNull: false)
-      39              :   const factory WcSessionProposeRequest({
-      40              :     required List<Relay> relays,
-      41              :     required Map<String, RequiredNamespace> requiredNamespaces,
-      42              :     Map<String, RequiredNamespace>? optionalNamespaces,
-      43              :     Map<String, String>? sessionProperties,
-      44              :     required ConnectionMetadata proposer,
-      45              :   }) = _WcSessionProposeRequest;
-      46              : 
-      47            4 :   factory WcSessionProposeRequest.fromJson(Map<String, dynamic> json) =>
-      48            4 :       _$WcSessionProposeRequestFromJson(json);
-      49              : }
-      50              : 
-      51              : @freezed
-      52              : class WcSessionProposeResponse with _$WcSessionProposeResponse {
-      53              :   @JsonSerializable()
-      54              :   const factory WcSessionProposeResponse({
-      55              :     required Relay relay,
-      56              :     required String responderPublicKey,
-      57              :   }) = _WcSessionProposeResponse;
-      58              : 
-      59            0 :   factory WcSessionProposeResponse.fromJson(Map<String, dynamic> json) =>
-      60            0 :       _$WcSessionProposeResponseFromJson(json);
-      61              : }
-      62              : 
-      63              : @freezed
-      64              : class WcSessionSettleRequest with _$WcSessionSettleRequest {
-      65              :   @JsonSerializable(includeIfNull: false)
-      66              :   const factory WcSessionSettleRequest({
-      67              :     required Relay relay,
-      68              :     required Map<String, Namespace> namespaces,
-      69              :     Map<String, RequiredNamespace>? requiredNamespaces,
-      70              :     Map<String, RequiredNamespace>? optionalNamespaces,
-      71              :     Map<String, String>? sessionProperties,
-      72              :     required int expiry,
-      73              :     required ConnectionMetadata controller,
-      74              :   }) = _WcSessionSettleRequest;
-      75              : 
-      76            4 :   factory WcSessionSettleRequest.fromJson(Map<String, dynamic> json) =>
-      77            4 :       _$WcSessionSettleRequestFromJson(json);
-      78              : }
-      79              : 
-      80              : @freezed
-      81              : class WcSessionUpdateRequest with _$WcSessionUpdateRequest {
-      82              :   @JsonSerializable()
-      83              :   const factory WcSessionUpdateRequest({
-      84              :     required Map<String, Namespace> namespaces,
-      85              :   }) = _WcSessionUpdateRequest;
-      86              : 
-      87            3 :   factory WcSessionUpdateRequest.fromJson(Map<String, dynamic> json) =>
-      88            3 :       _$WcSessionUpdateRequestFromJson(json);
-      89              : }
-      90              : 
-      91              : @freezed
-      92              : class WcSessionExtendRequest with _$WcSessionExtendRequest {
-      93              :   @JsonSerializable(includeIfNull: false)
-      94              :   const factory WcSessionExtendRequest({
-      95              :     Map<String, dynamic>? data,
-      96              :   }) = _WcSessionExtendRequest;
-      97              : 
-      98            3 :   factory WcSessionExtendRequest.fromJson(Map<String, dynamic> json) =>
-      99            3 :       _$WcSessionExtendRequestFromJson(json);
-     100              : }
-     101              : 
-     102              : @freezed
-     103              : class WcSessionDeleteRequest with _$WcSessionDeleteRequest {
-     104              :   @JsonSerializable(includeIfNull: false)
-     105              :   const factory WcSessionDeleteRequest({
-     106              :     required int code,
-     107              :     required String message,
-     108              :     String? data,
-     109              :   }) = _WcSessionDeleteRequest;
-     110              : 
-     111            3 :   factory WcSessionDeleteRequest.fromJson(Map<String, dynamic> json) =>
-     112            3 :       _$WcSessionDeleteRequestFromJson(json);
-     113              : }
-     114              : 
-     115              : @freezed
-     116              : class WcSessionPingRequest with _$WcSessionPingRequest {
-     117              :   @JsonSerializable(includeIfNull: false)
-     118              :   const factory WcSessionPingRequest({
-     119              :     Map<String, dynamic>? data,
-     120              :   }) = _WcSessionPingRequest;
-     121              : 
-     122            3 :   factory WcSessionPingRequest.fromJson(Map<String, dynamic> json) =>
-     123            3 :       _$WcSessionPingRequestFromJson(json);
-     124              : }
-     125              : 
-     126              : @freezed
-     127              : class WcSessionRequestRequest with _$WcSessionRequestRequest {
-     128              :   @JsonSerializable()
-     129              :   const factory WcSessionRequestRequest({
-     130              :     required String chainId,
-     131              :     required SessionRequestParams request,
-     132              :   }) = _WcSessionRequestRequest;
-     133              : 
-     134            3 :   factory WcSessionRequestRequest.fromJson(Map<String, dynamic> json) =>
-     135            3 :       _$WcSessionRequestRequestFromJson(json);
-     136              : }
-     137              : 
-     138              : @freezed
-     139              : class SessionRequestParams with _$SessionRequestParams {
-     140              :   @JsonSerializable()
-     141              :   const factory SessionRequestParams({
-     142              :     required String method,
-     143              :     required dynamic params,
-     144              :   }) = _SessionRequestParams;
-     145              : 
-     146            3 :   factory SessionRequestParams.fromJson(Map<String, dynamic> json) =>
-     147            3 :       _$SessionRequestParamsFromJson(json);
-     148              : }
-     149              : 
-     150              : @freezed
-     151              : class WcSessionEventRequest with _$WcSessionEventRequest {
-     152              :   @JsonSerializable()
-     153              :   const factory WcSessionEventRequest({
-     154              :     required String chainId,
-     155              :     required SessionEventParams event,
-     156              :   }) = _WcSessionEventRequest;
-     157              : 
-     158            3 :   factory WcSessionEventRequest.fromJson(Map<String, dynamic> json) =>
-     159            3 :       _$WcSessionEventRequestFromJson(json);
-     160              : }
-     161              : 
-     162              : @freezed
-     163              : class SessionEventParams with _$SessionEventParams {
-     164              :   @JsonSerializable()
-     165              :   const factory SessionEventParams({
-     166              :     required String name,
-     167              :     required dynamic data,
-     168              :   }) = _SessionEventParams;
-     169              : 
-     170            3 :   factory SessionEventParams.fromJson(Map<String, dynamic> json) =>
-     171            3 :       _$SessionEventParamsFromJson(json);
-     172              : }
-     173              : 
-     174              : /* AUTHENTICATION MODELS */
-     175              : 
-     176              : @freezed
-     177              : class WcAuthRequestRequest with _$WcAuthRequestRequest {
-     178              :   @JsonSerializable()
-     179              :   const factory WcAuthRequestRequest({
-     180              :     required AuthPayloadParams payloadParams,
-     181              :     required ConnectionMetadata requester,
-     182              :   }) = _WcAuthRequestRequest;
-     183              : 
-     184            2 :   factory WcAuthRequestRequest.fromJson(Map<String, dynamic> json) =>
-     185            2 :       _$WcAuthRequestRequestFromJson(json);
-     186              : }
-     187              : 
-     188              : @freezed
-     189              : class WcAuthRequestResult with _$WcAuthRequestResult {
-     190              :   @JsonSerializable()
-     191              :   const factory WcAuthRequestResult({
-     192              :     required Cacao cacao,
-     193              :   }) = _WcAuthRequestResult;
-     194              : 
-     195            0 :   factory WcAuthRequestResult.fromJson(Map<String, dynamic> json) =>
-     196            0 :       _$WcAuthRequestResultFromJson(json);
-     197              : }
-     198              : 
-     199              : @freezed
-     200              : class WcSessionAuthRequestParams with _$WcSessionAuthRequestParams {
-     201              :   @JsonSerializable()
-     202              :   const factory WcSessionAuthRequestParams({
-     203              :     required SessionAuthPayload authPayload,
-     204              :     required ConnectionMetadata requester,
-     205              :     required int expiryTimestamp,
-     206              :   }) = _WcSessionAuthRequestParams;
-     207              : 
-     208            0 :   factory WcSessionAuthRequestParams.fromJson(Map<String, dynamic> json) =>
-     209            0 :       _$WcSessionAuthRequestParamsFromJson(json);
-     210              : }
-     211              : 
-     212              : @freezed
-     213              : class WcSessionAuthRequestResult with _$WcSessionAuthRequestResult {
-     214              :   @JsonSerializable()
-     215              :   const factory WcSessionAuthRequestResult({
-     216              :     required List<Cacao> cacaos,
-     217              :     required ConnectionMetadata responder,
-     218              :   }) = _WcSessionAuthRequestResult;
-     219              : 
-     220            0 :   factory WcSessionAuthRequestResult.fromJson(Map<String, dynamic> json) =>
-     221            0 :       _$WcSessionAuthRequestResultFromJson(json);
-     222              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/proposal_models.dart.func-c.html b/coverage/html/sign_api/models/proposal_models.dart.func-c.html deleted file mode 100644 index 0101bcda..00000000 --- a/coverage/html/sign_api/models/proposal_models.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/proposal_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models - proposal_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:33.3 %62
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/proposal_models.dart.func.html b/coverage/html/sign_api/models/proposal_models.dart.func.html deleted file mode 100644 index 9a0c0dec..00000000 --- a/coverage/html/sign_api/models/proposal_models.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/proposal_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models - proposal_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:33.3 %62
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/proposal_models.dart.gcov.html b/coverage/html/sign_api/models/proposal_models.dart.gcov.html deleted file mode 100644 index 7544f38a..00000000 --- a/coverage/html/sign_api/models/proposal_models.dart.gcov.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/proposal_models.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models - proposal_models.dartCoverageTotalHit
Test:lcov.infoLines:33.3 %62
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:freezed_annotation/freezed_annotation.dart';
-       2              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client_models.dart';
-       3              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/session_models.dart';
-       5              : 
-       6              : part 'proposal_models.g.dart';
-       7              : part 'proposal_models.freezed.dart';
-       8              : 
-       9              : @freezed
-      10              : class RequiredNamespace with _$RequiredNamespace {
-      11              :   @JsonSerializable(includeIfNull: false)
-      12              :   const factory RequiredNamespace({
-      13              :     List<String>? chains,
-      14              :     required List<String> methods,
-      15              :     required List<String> events,
-      16              :   }) = _RequiredNamespace;
-      17              : 
-      18            4 :   factory RequiredNamespace.fromJson(Map<String, dynamic> json) =>
-      19            4 :       _$RequiredNamespaceFromJson(json);
-      20              : }
-      21              : 
-      22              : @freezed
-      23              : class SessionProposal with _$SessionProposal {
-      24              :   @JsonSerializable()
-      25              :   const factory SessionProposal({
-      26              :     required int id,
-      27              :     required ProposalData params,
-      28              :   }) = _SessionProposal;
-      29              : 
-      30            0 :   factory SessionProposal.fromJson(Map<String, dynamic> json) =>
-      31            0 :       _$SessionProposalFromJson(json);
-      32              : }
-      33              : 
-      34              : @freezed
-      35              : class ProposalData with _$ProposalData {
-      36              :   @JsonSerializable(includeIfNull: false)
-      37              :   const factory ProposalData({
-      38              :     required int id,
-      39              :     required int expiry,
-      40              :     required List<Relay> relays,
-      41              :     required ConnectionMetadata proposer,
-      42              :     required Map<String, RequiredNamespace> requiredNamespaces,
-      43              :     required Map<String, RequiredNamespace> optionalNamespaces,
-      44              :     required String pairingTopic,
-      45              :     Map<String, String>? sessionProperties,
-      46              :     Map<String, Namespace>? generatedNamespaces,
-      47              :   }) = _ProposalData;
-      48              : 
-      49            0 :   factory ProposalData.fromJson(Map<String, dynamic> json) =>
-      50            0 :       _$ProposalDataFromJson(json);
-      51              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/session_models.dart.func-c.html b/coverage/html/sign_api/models/session_models.dart.func-c.html deleted file mode 100644 index 91420457..00000000 --- a/coverage/html/sign_api/models/session_models.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/session_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models - session_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:33.3 %93
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/session_models.dart.func.html b/coverage/html/sign_api/models/session_models.dart.func.html deleted file mode 100644 index 9078e316..00000000 --- a/coverage/html/sign_api/models/session_models.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/session_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models - session_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:33.3 %93
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/session_models.dart.gcov.html b/coverage/html/sign_api/models/session_models.dart.gcov.html deleted file mode 100644 index dff442db..00000000 --- a/coverage/html/sign_api/models/session_models.dart.gcov.html +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/session_models.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models - session_models.dartCoverageTotalHit
Test:lcov.infoLines:33.3 %93
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:async';
-       2              : 
-       3              : import 'package:freezed_annotation/freezed_annotation.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client_models.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/core/verify/models/verify_context.dart';
-       6              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
-       7              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/proposal_models.dart';
-       8              : 
-       9              : part 'session_models.g.dart';
-      10              : part 'session_models.freezed.dart';
-      11              : 
-      12              : class SessionProposalCompleter {
-      13              :   final int id;
-      14              :   final String selfPublicKey;
-      15              :   final String pairingTopic;
-      16              :   final Map<String, RequiredNamespace> requiredNamespaces;
-      17              :   final Map<String, RequiredNamespace> optionalNamespaces;
-      18              :   final Map<String, String>? sessionProperties;
-      19              :   final Completer completer;
-      20              : 
-      21            4 :   const SessionProposalCompleter({
-      22              :     required this.id,
-      23              :     required this.selfPublicKey,
-      24              :     required this.pairingTopic,
-      25              :     required this.requiredNamespaces,
-      26              :     required this.optionalNamespaces,
-      27              :     required this.completer,
-      28              :     this.sessionProperties,
-      29              :   });
-      30              : 
-      31            0 :   @override
-      32              :   String toString() {
-      33            0 :     return 'SessionProposalCompleter(id: $id, selfPublicKey: $selfPublicKey, pairingTopic: $pairingTopic, requiredNamespaces: $requiredNamespaces, optionalNamespaces: $optionalNamespaces, sessionProperties: $sessionProperties, completer: $completer)';
-      34              :   }
-      35              : }
-      36              : 
-      37              : @freezed
-      38              : class Namespace with _$Namespace {
-      39              :   @JsonSerializable(includeIfNull: false)
-      40              :   const factory Namespace({
-      41              :     List<String>? chains,
-      42              :     required List<String> accounts,
-      43              :     required List<String> methods,
-      44              :     required List<String> events,
-      45              :   }) = _Namespace;
-      46              : 
-      47            4 :   factory Namespace.fromJson(Map<String, dynamic> json) =>
-      48            4 :       _$NamespaceFromJson(json);
-      49              : }
-      50              : 
-      51              : @freezed
-      52              : class SessionData with _$SessionData {
-      53              :   @JsonSerializable(includeIfNull: false)
-      54              :   const factory SessionData({
-      55              :     required String topic,
-      56              :     required String pairingTopic,
-      57              :     required Relay relay,
-      58              :     required int expiry,
-      59              :     required bool acknowledged,
-      60              :     required String controller,
-      61              :     required Map<String, Namespace> namespaces,
-      62              :     Map<String, RequiredNamespace>? requiredNamespaces,
-      63              :     Map<String, RequiredNamespace>? optionalNamespaces,
-      64              :     Map<String, String>? sessionProperties,
-      65              :     required ConnectionMetadata self,
-      66              :     required ConnectionMetadata peer,
-      67              :   }) = _SessionData;
-      68              : 
-      69            0 :   factory SessionData.fromJson(Map<String, dynamic> json) =>
-      70            0 :       _$SessionDataFromJson(json);
-      71              : }
-      72              : 
-      73              : @freezed
-      74              : class SessionRequest with _$SessionRequest {
-      75              :   @JsonSerializable()
-      76              :   const factory SessionRequest({
-      77              :     required int id,
-      78              :     required String topic,
-      79              :     required String method,
-      80              :     required String chainId,
-      81              :     required dynamic params,
-      82              :     required VerifyContext verifyContext,
-      83              :   }) = _SessionRequest;
-      84              : 
-      85            0 :   factory SessionRequest.fromJson(Map<String, dynamic> json) =>
-      86            0 :       _$SessionRequestFromJson(json);
-      87              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/sign_client_events.dart.func-c.html b/coverage/html/sign_api/models/sign_client_events.dart.func-c.html deleted file mode 100644 index adb4d8e5..00000000 --- a/coverage/html/sign_api/models/sign_client_events.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/sign_client_events.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models - sign_client_events.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:36.4 %4416
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/sign_client_events.dart.func.html b/coverage/html/sign_api/models/sign_client_events.dart.func.html deleted file mode 100644 index 7c1c93ea..00000000 --- a/coverage/html/sign_api/models/sign_client_events.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/sign_client_events.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models - sign_client_events.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:36.4 %4416
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/sign_client_events.dart.gcov.html b/coverage/html/sign_api/models/sign_client_events.dart.gcov.html deleted file mode 100644 index e3a8646a..00000000 --- a/coverage/html/sign_api/models/sign_client_events.dart.gcov.html +++ /dev/null @@ -1,266 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/sign_client_events.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models - sign_client_events.dartCoverageTotalHit
Test:lcov.infoLines:36.4 %4416
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:convert';
-       2              : 
-       3              : import 'package:event/event.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/core/verify/models/verify_context.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
-       6              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/proposal_models.dart';
-       7              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/session_models.dart';
-       8              : 
-       9              : class SessionProposalEvent extends EventArgs {
-      10              :   int id;
-      11              :   ProposalData params;
-      12              :   VerifyContext? verifyContext;
-      13              : 
-      14            4 :   SessionProposalEvent(
-      15              :     this.id,
-      16              :     this.params, [
-      17              :     this.verifyContext,
-      18              :   ]);
-      19              : 
-      20            0 :   Map<String, dynamic> toJson() => {
-      21            0 :         'id': id,
-      22            0 :         'params': params.toJson(),
-      23            0 :         'verifyContext': verifyContext?.toJson(),
-      24              :       };
-      25              : 
-      26            0 :   @override
-      27              :   String toString() {
-      28            0 :     return 'SessionProposalEvent(${jsonEncode(toJson())})';
-      29              :   }
-      30              : }
-      31              : 
-      32              : class SessionProposalErrorEvent extends EventArgs {
-      33              :   int id;
-      34              :   Map<String, RequiredNamespace> requiredNamespaces;
-      35              :   Map<String, Namespace> namespaces;
-      36              :   WalletConnectError error;
-      37              : 
-      38            0 :   SessionProposalErrorEvent(
-      39              :     this.id,
-      40              :     this.requiredNamespaces,
-      41              :     this.namespaces,
-      42              :     this.error,
-      43              :   );
-      44              : 
-      45            0 :   @override
-      46              :   String toString() {
-      47            0 :     return 'SessionProposalErrorEvent(id: $id, requiredNamespaces: $requiredNamespaces, namespaces: $namespaces, error: $error)';
-      48              :   }
-      49              : }
-      50              : 
-      51              : class SessionConnect extends EventArgs {
-      52              :   SessionData session;
-      53              : 
-      54            4 :   SessionConnect(
-      55              :     this.session,
-      56              :   );
-      57              : 
-      58            0 :   @override
-      59              :   String toString() {
-      60            0 :     return 'SessionConnect(session: $session)';
-      61              :   }
-      62              : }
-      63              : 
-      64              : class SessionUpdate extends EventArgs {
-      65              :   int id;
-      66              :   String topic;
-      67              :   Map<String, Namespace> namespaces;
-      68              : 
-      69            3 :   SessionUpdate(
-      70              :     this.id,
-      71              :     this.topic,
-      72              :     this.namespaces,
-      73              :   );
-      74              : 
-      75            0 :   @override
-      76              :   String toString() {
-      77            0 :     return 'SessionUpdate(id: $id, topic: $topic, namespaces: $namespaces)';
-      78              :   }
-      79              : }
-      80              : 
-      81              : class SessionExtend extends EventArgs {
-      82              :   int id;
-      83              :   String topic;
-      84              : 
-      85            3 :   SessionExtend(this.id, this.topic);
-      86              : 
-      87            0 :   @override
-      88              :   String toString() {
-      89            0 :     return 'SessionExtend(id: $id, topic: $topic)';
-      90              :   }
-      91              : }
-      92              : 
-      93              : class SessionPing extends EventArgs {
-      94              :   int id;
-      95              :   String topic;
-      96              : 
-      97            3 :   SessionPing(this.id, this.topic);
-      98              : 
-      99            0 :   @override
-     100              :   String toString() {
-     101            0 :     return 'SessionPing(id: $id, topic: $topic)';
-     102              :   }
-     103              : }
-     104              : 
-     105              : class SessionDelete extends EventArgs {
-     106              :   String topic;
-     107              :   int? id;
-     108              : 
-     109            3 :   SessionDelete(
-     110              :     this.topic, {
-     111              :     this.id,
-     112              :   });
-     113              : 
-     114            0 :   @override
-     115              :   String toString() {
-     116            0 :     return 'SessionDelete(topic: $topic, id: $id)';
-     117              :   }
-     118              : }
-     119              : 
-     120              : class SessionExpire extends EventArgs {
-     121              :   final String topic;
-     122              : 
-     123            3 :   SessionExpire(this.topic);
-     124              : 
-     125            0 :   @override
-     126              :   String toString() {
-     127            0 :     return 'SessionExpire(topic: $topic)';
-     128              :   }
-     129              : }
-     130              : 
-     131              : class SessionRequestEvent extends EventArgs {
-     132              :   int id;
-     133              :   String topic;
-     134              :   String method;
-     135              :   String chainId;
-     136              :   dynamic params;
-     137              : 
-     138            3 :   SessionRequestEvent(
-     139              :     this.id,
-     140              :     this.topic,
-     141              :     this.method,
-     142              :     this.chainId,
-     143              :     this.params,
-     144              :   );
-     145              : 
-     146            3 :   factory SessionRequestEvent.fromSessionRequest(
-     147              :     SessionRequest request,
-     148              :   ) {
-     149            3 :     return SessionRequestEvent(
-     150            3 :       request.id,
-     151            3 :       request.topic,
-     152            3 :       request.method,
-     153            3 :       request.chainId,
-     154            3 :       request.params,
-     155              :     );
-     156              :   }
-     157              : 
-     158            0 :   @override
-     159              :   String toString() {
-     160            0 :     return 'SessionRequestEvent(id: $id, topic: $topic, method: $method, chainId: $chainId, params: $params)';
-     161              :   }
-     162              : }
-     163              : 
-     164              : class SessionEvent extends EventArgs {
-     165              :   int id;
-     166              :   String topic;
-     167              :   String name;
-     168              :   String chainId;
-     169              :   dynamic data;
-     170              : 
-     171            3 :   SessionEvent(
-     172              :     this.id,
-     173              :     this.topic,
-     174              :     this.name,
-     175              :     this.chainId,
-     176              :     this.data,
-     177              :   );
-     178              : 
-     179            0 :   @override
-     180              :   String toString() {
-     181            0 :     return 'SessionEvent(id: $id, topic: $topic, name: $name, chainId: $chainId, data: $data)';
-     182              :   }
-     183              : }
-     184              : 
-     185              : class ProposalExpire extends EventArgs {
-     186              :   final int id;
-     187              : 
-     188            0 :   ProposalExpire(this.id);
-     189              : 
-     190            0 :   @override
-     191              :   String toString() {
-     192            0 :     return 'ProposalExpire(id: $id)';
-     193              :   }
-     194              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/sign_client_models.dart.func-c.html b/coverage/html/sign_api/models/sign_client_models.dart.func-c.html deleted file mode 100644 index 21a7c2a8..00000000 --- a/coverage/html/sign_api/models/sign_client_models.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/sign_client_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models - sign_client_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:33.3 %62
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/sign_client_models.dart.func.html b/coverage/html/sign_api/models/sign_client_models.dart.func.html deleted file mode 100644 index e413369a..00000000 --- a/coverage/html/sign_api/models/sign_client_models.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/sign_client_models.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models - sign_client_models.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:33.3 %62
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/models/sign_client_models.dart.gcov.html b/coverage/html/sign_api/models/sign_client_models.dart.gcov.html deleted file mode 100644 index ccd1f124..00000000 --- a/coverage/html/sign_api/models/sign_client_models.dart.gcov.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/models/sign_client_models.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/models - sign_client_models.dartCoverageTotalHit
Test:lcov.infoLines:33.3 %62
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:async';
-       2              : 
-       3              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/session_models.dart';
-       4              : 
-       5              : class ConnectResponse {
-       6              :   final String pairingTopic;
-       7              :   final Completer<SessionData> session;
-       8              :   final Uri? uri;
-       9              : 
-      10            4 :   ConnectResponse({
-      11              :     required this.pairingTopic,
-      12              :     required this.session,
-      13              :     this.uri,
-      14              :   });
-      15              : 
-      16            0 :   @override
-      17              :   String toString() {
-      18            0 :     return 'ConnectResponse(pairingTopic: $pairingTopic, session: $session, uri: $uri)';
-      19              :   }
-      20              : }
-      21              : 
-      22              : class ApproveResponse {
-      23              :   final String topic;
-      24              :   final SessionData? session;
-      25              : 
-      26            4 :   ApproveResponse({
-      27              :     required this.topic,
-      28              :     required this.session,
-      29              :   });
-      30              : 
-      31            0 :   @override
-      32              :   String toString() {
-      33            0 :     return 'ApproveResponse(topic: $topic, session: $session)';
-      34              :   }
-      35              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/sessions.dart.func-c.html b/coverage/html/sign_api/sessions.dart.func-c.html deleted file mode 100644 index 36a2d025..00000000 --- a/coverage/html/sign_api/sessions.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/sessions.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api - sessions.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %77
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/sessions.dart.func.html b/coverage/html/sign_api/sessions.dart.func.html deleted file mode 100644 index 6b329609..00000000 --- a/coverage/html/sign_api/sessions.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/sessions.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api - sessions.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %77
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/sessions.dart.gcov.html b/coverage/html/sign_api/sessions.dart.gcov.html deleted file mode 100644 index 628e7eef..00000000 --- a/coverage/html/sign_api/sessions.dart.gcov.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/sessions.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api - sessions.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %77
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:walletconnect_flutter_v2/apis/core/store/generic_store.dart';
-       2              : 
-       3              : import 'package:walletconnect_flutter_v2/apis/sign_api/i_sessions.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/session_models.dart';
-       5              : 
-       6              : class Sessions extends GenericStore<SessionData> implements ISessions {
-       7            6 :   Sessions({
-       8              :     required super.storage,
-       9              :     required super.context,
-      10              :     required super.version,
-      11              :     required super.fromJson,
-      12              :   });
-      13              : 
-      14            5 :   @override
-      15              :   Future<void> update(
-      16              :     String topic, {
-      17              :     int? expiry,
-      18              :     Map<String, Namespace>? namespaces,
-      19              :   }) async {
-      20            5 :     checkInitialized();
-      21              : 
-      22            5 :     SessionData? info = get(topic);
-      23              :     if (info == null) {
-      24              :       return;
-      25              :     }
-      26              : 
-      27              :     if (expiry != null) {
-      28           10 :       info = info.copyWith(expiry: expiry);
-      29              :     }
-      30              :     if (namespaces != null) {
-      31            6 :       info = info.copyWith(namespaces: namespaces);
-      32              :     }
-      33              : 
-      34            5 :     await set(topic, info);
-      35              :   }
-      36              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/sign_client.dart.func-c.html b/coverage/html/sign_api/sign_client.dart.func-c.html deleted file mode 100644 index 2eccc994..00000000 --- a/coverage/html/sign_api/sign_client.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/sign_client.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api - sign_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:57.6 %15891
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/sign_client.dart.func.html b/coverage/html/sign_api/sign_client.dart.func.html deleted file mode 100644 index a200351e..00000000 --- a/coverage/html/sign_api/sign_client.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/sign_client.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api - sign_client.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:57.6 %15891
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/sign_client.dart.gcov.html b/coverage/html/sign_api/sign_client.dart.gcov.html deleted file mode 100644 index 404c9b30..00000000 --- a/coverage/html/sign_api/sign_client.dart.gcov.html +++ /dev/null @@ -1,748 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/sign_client.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api - sign_client.dartCoverageTotalHit
Test:lcov.infoLines:57.6 %15891
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:walletconnect_flutter_v2/apis/core/store/generic_store.dart';
-       2              : import 'package:walletconnect_flutter_v2/apis/core/store/i_generic_store.dart';
-       3              : import 'package:walletconnect_flutter_v2/apis/sign_api/i_sessions.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/sign_api/sign_engine.dart';
-       5              : import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart';
-       6              : 
-       7              : class SignClient implements ISignClient {
-       8              :   bool _initialized = false;
-       9              : 
-      10              :   @override
-      11              :   final String protocol = 'wc';
-      12              :   @override
-      13              :   final int version = 2;
-      14              : 
-      15            1 :   @override
-      16            2 :   Event<SessionDelete> get onSessionDelete => engine.onSessionDelete;
-      17            1 :   @override
-      18            2 :   Event<SessionConnect> get onSessionConnect => engine.onSessionConnect;
-      19            1 :   @override
-      20            2 :   Event<SessionEvent> get onSessionEvent => engine.onSessionEvent;
-      21            1 :   @override
-      22            2 :   Event<SessionExpire> get onSessionExpire => engine.onSessionExpire;
-      23            1 :   @override
-      24            2 :   Event<SessionExtend> get onSessionExtend => engine.onSessionExtend;
-      25            1 :   @override
-      26            2 :   Event<SessionPing> get onSessionPing => engine.onSessionPing;
-      27            1 :   @override
-      28            2 :   Event<SessionProposalEvent> get onSessionProposal => engine.onSessionProposal;
-      29            0 :   @override
-      30              :   Event<SessionProposalErrorEvent> get onSessionProposalError =>
-      31            0 :       engine.onSessionProposalError;
-      32            1 :   @override
-      33            2 :   Event<SessionProposalEvent> get onProposalExpire => engine.onProposalExpire;
-      34            1 :   @override
-      35            2 :   Event<SessionRequestEvent> get onSessionRequest => engine.onSessionRequest;
-      36            1 :   @override
-      37            2 :   Event<SessionUpdate> get onSessionUpdate => engine.onSessionUpdate;
-      38              : 
-      39            1 :   @override
-      40            2 :   ICore get core => engine.core;
-      41            0 :   @override
-      42            0 :   PairingMetadata get metadata => engine.metadata;
-      43            1 :   @override
-      44            2 :   IGenericStore<ProposalData> get proposals => engine.proposals;
-      45            1 :   @override
-      46            2 :   ISessions get sessions => engine.sessions;
-      47            1 :   @override
-      48            2 :   IGenericStore<SessionRequest> get pendingRequests => engine.pendingRequests;
-      49              : 
-      50              :   @override
-      51              :   late ISignEngine engine;
-      52              : 
-      53            0 :   static Future<SignClient> createInstance({
-      54              :     required String projectId,
-      55              :     String relayUrl = WalletConnectConstants.DEFAULT_RELAY_URL,
-      56              :     required PairingMetadata metadata,
-      57              :     bool memoryStore = false,
-      58              :     LogLevel logLevel = LogLevel.nothing,
-      59              :   }) async {
-      60            0 :     final client = SignClient(
-      61            0 :       core: Core(
-      62              :         projectId: projectId,
-      63              :         relayUrl: relayUrl,
-      64              :         memoryStore: memoryStore,
-      65              :         logLevel: logLevel,
-      66              :       ),
-      67              :       metadata: metadata,
-      68              :     );
-      69            0 :     await client.init();
-      70              : 
-      71              :     return client;
-      72              :   }
-      73              : 
-      74            1 :   SignClient({
-      75              :     required ICore core,
-      76              :     required PairingMetadata metadata,
-      77              :   }) {
-      78            2 :     engine = SignEngine(
-      79              :       core: core,
-      80              :       metadata: metadata,
-      81            1 :       proposals: GenericStore(
-      82            1 :         storage: core.storage,
-      83              :         context: StoreVersions.CONTEXT_PROPOSALS,
-      84              :         version: StoreVersions.VERSION_PROPOSALS,
-      85            0 :         fromJson: (dynamic value) {
-      86            0 :           return ProposalData.fromJson(value);
-      87              :         },
-      88              :       ),
-      89            1 :       sessions: Sessions(
-      90            1 :         storage: core.storage,
-      91              :         context: StoreVersions.CONTEXT_SESSIONS,
-      92              :         version: StoreVersions.VERSION_SESSIONS,
-      93            0 :         fromJson: (dynamic value) {
-      94            0 :           return SessionData.fromJson(value);
-      95              :         },
-      96              :       ),
-      97            1 :       pendingRequests: GenericStore(
-      98            1 :         storage: core.storage,
-      99              :         context: StoreVersions.CONTEXT_PENDING_REQUESTS,
-     100              :         version: StoreVersions.VERSION_PENDING_REQUESTS,
-     101            0 :         fromJson: (dynamic value) {
-     102            0 :           return SessionRequest.fromJson(value);
-     103              :         },
-     104              :       ),
-     105            1 :       authKeys: GenericStore(
-     106            1 :         storage: core.storage,
-     107              :         context: StoreVersions.CONTEXT_AUTH_KEYS,
-     108              :         version: StoreVersions.VERSION_AUTH_KEYS,
-     109            0 :         fromJson: (dynamic value) {
-     110            0 :           return AuthPublicKey.fromJson(value);
-     111              :         },
-     112              :       ),
-     113            1 :       pairingTopics: GenericStore(
-     114            1 :         storage: core.storage,
-     115              :         context: StoreVersions.CONTEXT_PAIRING_TOPICS,
-     116              :         version: StoreVersions.VERSION_PAIRING_TOPICS,
-     117            0 :         fromJson: (dynamic value) {
-     118              :           return value;
-     119              :         },
-     120              :       ),
-     121            1 :       authRequests: GenericStore(
-     122            1 :         storage: core.storage,
-     123              :         context: StoreVersions.CONTEXT_AUTH_REQUESTS,
-     124              :         version: StoreVersions.VERSION_AUTH_REQUESTS,
-     125            0 :         fromJson: (dynamic value) {
-     126            0 :           return PendingAuthRequest.fromJson(value);
-     127              :         },
-     128              :       ),
-     129            1 :       completeRequests: GenericStore(
-     130            1 :         storage: core.storage,
-     131              :         context: StoreVersions.CONTEXT_COMPLETE_REQUESTS,
-     132              :         version: StoreVersions.VERSION_COMPLETE_REQUESTS,
-     133            0 :         fromJson: (dynamic value) {
-     134            0 :           return StoredCacao.fromJson(value);
-     135              :         },
-     136              :       ),
-     137            1 :       sessionAuthRequests: GenericStore(
-     138            1 :         storage: core.storage,
-     139              :         context: StoreVersions.CONTEXT_AUTH_REQUESTS,
-     140              :         version: StoreVersions.VERSION_AUTH_REQUESTS,
-     141            0 :         fromJson: (dynamic value) {
-     142            0 :           return PendingSessionAuthRequest.fromJson(value);
-     143              :         },
-     144              :       ),
-     145              :     );
-     146              :   }
-     147              : 
-     148            1 :   @override
-     149              :   Future<void> init() async {
-     150            1 :     if (_initialized) {
-     151              :       return;
-     152              :     }
-     153              : 
-     154            2 :     await core.start();
-     155            2 :     await engine.init();
-     156              : 
-     157            1 :     _initialized = true;
-     158              :   }
-     159              : 
-     160            1 :   @override
-     161              :   Future<ConnectResponse> connect({
-     162              :     Map<String, RequiredNamespace>? requiredNamespaces,
-     163              :     Map<String, RequiredNamespace>? optionalNamespaces,
-     164              :     Map<String, String>? sessionProperties,
-     165              :     String? pairingTopic,
-     166              :     List<Relay>? relays,
-     167              :     List<List<String>>? methods = SignEngine.DEFAULT_METHODS,
-     168              :   }) async {
-     169              :     try {
-     170            2 :       return await engine.connect(
-     171              :         requiredNamespaces: requiredNamespaces,
-     172              :         optionalNamespaces: optionalNamespaces,
-     173              :         sessionProperties: sessionProperties,
-     174              :         pairingTopic: pairingTopic,
-     175              :         relays: relays,
-     176              :         methods: methods,
-     177              :       );
-     178              :     } catch (e) {
-     179              :       // print(e);
-     180              :       rethrow;
-     181              :     }
-     182              :   }
-     183              : 
-     184            1 :   @override
-     185              :   Future<PairingInfo> pair({
-     186              :     required Uri uri,
-     187              :   }) async {
-     188              :     try {
-     189            2 :       return await engine.pair(uri: uri);
-     190              :     } catch (e) {
-     191              :       rethrow;
-     192              :     }
-     193              :   }
-     194              : 
-     195            1 :   @override
-     196              :   Future<ApproveResponse> approve({
-     197              :     required int id,
-     198              :     required Map<String, Namespace> namespaces,
-     199              :     Map<String, String>? sessionProperties,
-     200              :     String? relayProtocol,
-     201              :   }) async {
-     202              :     try {
-     203            2 :       return await engine.approveSession(
-     204              :         id: id,
-     205              :         namespaces: namespaces,
-     206              :         sessionProperties: sessionProperties,
-     207              :         relayProtocol: relayProtocol,
-     208              :       );
-     209              :     } catch (e) {
-     210              :       rethrow;
-     211              :     }
-     212              :   }
-     213              : 
-     214            1 :   @override
-     215              :   Future<void> reject({
-     216              :     required int id,
-     217              :     required WalletConnectError reason,
-     218              :   }) async {
-     219              :     try {
-     220            2 :       return await engine.rejectSession(
-     221              :         id: id,
-     222              :         reason: reason,
-     223              :       );
-     224              :     } catch (e) {
-     225              :       rethrow;
-     226              :     }
-     227              :   }
-     228              : 
-     229            1 :   @override
-     230              :   Future<void> update({
-     231              :     required String topic,
-     232              :     required Map<String, Namespace> namespaces,
-     233              :   }) async {
-     234              :     try {
-     235            2 :       return await engine.updateSession(
-     236              :         topic: topic,
-     237              :         namespaces: namespaces,
-     238              :       );
-     239              :     } catch (e) {
-     240              :       // final error = e as WCError;
-     241              :       rethrow;
-     242              :     }
-     243              :   }
-     244              : 
-     245            1 :   @override
-     246              :   Future<void> extend({
-     247              :     required String topic,
-     248              :   }) async {
-     249              :     try {
-     250            2 :       return await engine.extendSession(topic: topic);
-     251              :     } catch (e) {
-     252              :       rethrow;
-     253              :     }
-     254              :   }
-     255              : 
-     256            1 :   @override
-     257              :   void registerRequestHandler({
-     258              :     required String chainId,
-     259              :     required String method,
-     260              :     void Function(String, dynamic)? handler,
-     261              :   }) {
-     262              :     try {
-     263            2 :       return engine.registerRequestHandler(
-     264              :         chainId: chainId,
-     265              :         method: method,
-     266              :         handler: handler,
-     267              :       );
-     268              :     } catch (e) {
-     269              :       rethrow;
-     270              :     }
-     271              :   }
-     272              : 
-     273            1 :   @override
-     274              :   Future<dynamic> request({
-     275              :     required String topic,
-     276              :     required String chainId,
-     277              :     required SessionRequestParams request,
-     278              :   }) async {
-     279              :     try {
-     280            2 :       return await engine.request(
-     281              :         topic: topic,
-     282              :         chainId: chainId,
-     283              :         request: request,
-     284              :       );
-     285              :     } catch (e) {
-     286              :       rethrow;
-     287              :     }
-     288              :   }
-     289              : 
-     290            0 :   @override
-     291              :   Future<List<dynamic>> requestReadContract({
-     292              :     required DeployedContract deployedContract,
-     293              :     required String functionName,
-     294              :     required String rpcUrl,
-     295              :     EthereumAddress? sender,
-     296              :     List parameters = const [],
-     297              :   }) async {
-     298              :     try {
-     299            0 :       return await engine.requestReadContract(
-     300              :         sender: sender,
-     301              :         deployedContract: deployedContract,
-     302              :         functionName: functionName,
-     303              :         rpcUrl: rpcUrl,
-     304              :         parameters: parameters,
-     305              :       );
-     306              :     } catch (e) {
-     307              :       rethrow;
-     308              :     }
-     309              :   }
-     310              : 
-     311            0 :   @override
-     312              :   Future<dynamic> requestWriteContract({
-     313              :     required String topic,
-     314              :     required String chainId,
-     315              :     required String rpcUrl,
-     316              :     required DeployedContract deployedContract,
-     317              :     required String functionName,
-     318              :     required Transaction transaction,
-     319              :     String? method,
-     320              :     List parameters = const [],
-     321              :   }) async {
-     322              :     try {
-     323            0 :       return await engine.requestWriteContract(
-     324              :         topic: topic,
-     325              :         chainId: chainId,
-     326              :         rpcUrl: rpcUrl,
-     327              :         deployedContract: deployedContract,
-     328              :         functionName: functionName,
-     329              :         transaction: transaction,
-     330              :         method: method,
-     331              :         parameters: parameters,
-     332              :       );
-     333              :     } catch (e) {
-     334              :       rethrow;
-     335              :     }
-     336              :   }
-     337              : 
-     338            1 :   @override
-     339              :   Future<void> respond({
-     340              :     required String topic,
-     341              :     required JsonRpcResponse response,
-     342              :   }) {
-     343              :     try {
-     344            2 :       return engine.respondSessionRequest(
-     345              :         topic: topic,
-     346              :         response: response,
-     347              :       );
-     348              :     } catch (e) {
-     349              :       rethrow;
-     350              :     }
-     351              :   }
-     352              : 
-     353            1 :   @override
-     354              :   void registerEventHandler({
-     355              :     required String chainId,
-     356              :     required String event,
-     357              :     dynamic Function(String, dynamic)? handler,
-     358              :   }) {
-     359              :     try {
-     360            2 :       return engine.registerEventHandler(
-     361              :         chainId: chainId,
-     362              :         event: event,
-     363              :         handler: handler,
-     364              :       );
-     365              :     } catch (e) {
-     366              :       rethrow;
-     367              :     }
-     368              :   }
-     369              : 
-     370            1 :   @override
-     371              :   void registerEventEmitter({
-     372              :     required String chainId,
-     373              :     required String event,
-     374              :   }) {
-     375              :     try {
-     376            2 :       return engine.registerEventEmitter(
-     377              :         chainId: chainId,
-     378              :         event: event,
-     379              :       );
-     380              :     } catch (e) {
-     381              :       rethrow;
-     382              :     }
-     383              :   }
-     384              : 
-     385            1 :   @override
-     386              :   void registerAccount({
-     387              :     required String chainId,
-     388              :     required String accountAddress,
-     389              :   }) {
-     390              :     try {
-     391            2 :       return engine.registerAccount(
-     392              :         chainId: chainId,
-     393              :         accountAddress: accountAddress,
-     394              :       );
-     395              :     } catch (e) {
-     396              :       rethrow;
-     397              :     }
-     398              :   }
-     399              : 
-     400            1 :   @override
-     401              :   Future<void> emit({
-     402              :     required String topic,
-     403              :     required String chainId,
-     404              :     required SessionEventParams event,
-     405              :   }) async {
-     406              :     try {
-     407            2 :       return await engine.emitSessionEvent(
-     408              :         topic: topic,
-     409              :         chainId: chainId,
-     410              :         event: event,
-     411              :       );
-     412              :     } catch (e) {
-     413              :       rethrow;
-     414              :     }
-     415              :   }
-     416              : 
-     417            1 :   @override
-     418              :   Future<void> ping({
-     419              :     required String topic,
-     420              :   }) async {
-     421              :     try {
-     422            2 :       return await engine.ping(topic: topic);
-     423              :     } catch (e) {
-     424              :       rethrow;
-     425              :     }
-     426              :   }
-     427              : 
-     428            1 :   @override
-     429              :   Future<void> disconnect({
-     430              :     required String topic,
-     431              :     required WalletConnectError reason,
-     432              :   }) async {
-     433              :     try {
-     434            2 :       return await engine.disconnectSession(
-     435              :         topic: topic,
-     436              :         reason: reason,
-     437              :       );
-     438              :     } catch (e) {
-     439              :       rethrow;
-     440              :     }
-     441              :   }
-     442              : 
-     443            1 :   @override
-     444              :   SessionData? find({
-     445              :     required Map<String, RequiredNamespace> requiredNamespaces,
-     446              :   }) {
-     447              :     try {
-     448            2 :       return engine.find(requiredNamespaces: requiredNamespaces);
-     449              :     } catch (e) {
-     450              :       rethrow;
-     451              :     }
-     452              :   }
-     453              : 
-     454            1 :   @override
-     455              :   Map<String, SessionData> getActiveSessions() {
-     456              :     try {
-     457            2 :       return engine.getActiveSessions();
-     458              :     } catch (e) {
-     459              :       rethrow;
-     460              :     }
-     461              :   }
-     462              : 
-     463            1 :   @override
-     464              :   Map<String, SessionData> getSessionsForPairing({
-     465              :     required String pairingTopic,
-     466              :   }) {
-     467              :     try {
-     468            2 :       return engine.getSessionsForPairing(
-     469              :         pairingTopic: pairingTopic,
-     470              :       );
-     471              :     } catch (e) {
-     472              :       rethrow;
-     473              :     }
-     474              :   }
-     475              : 
-     476            1 :   @override
-     477              :   Map<String, ProposalData> getPendingSessionProposals() {
-     478              :     try {
-     479            2 :       return engine.getPendingSessionProposals();
-     480              :     } catch (e) {
-     481              :       rethrow;
-     482              :     }
-     483              :   }
-     484              : 
-     485            1 :   @override
-     486              :   Map<String, SessionRequest> getPendingSessionRequests() {
-     487              :     try {
-     488            2 :       return engine.getPendingSessionRequests();
-     489              :     } catch (e) {
-     490              :       rethrow;
-     491              :     }
-     492              :   }
-     493              : 
-     494            0 :   @override
-     495            0 :   IPairingStore get pairings => core.pairing.getStore();
-     496              : 
-     497              :   // FORMER AUTH ENGINE METHODS
-     498              : 
-     499            0 :   @override
-     500            0 :   IGenericStore<PendingAuthRequest> get authRequests => engine.authRequests;
-     501              : 
-     502            0 :   @override
-     503              :   Map<int, PendingAuthRequest> getPendingAuthRequests() {
-     504              :     try {
-     505            0 :       return engine.getPendingAuthRequests();
-     506              :     } catch (e) {
-     507              :       rethrow;
-     508              :     }
-     509              :   }
-     510              : 
-     511            0 :   @override
-     512              :   Map<int, PendingSessionAuthRequest> getPendingSessionAuthRequests() {
-     513              :     try {
-     514            0 :       return engine.getPendingSessionAuthRequests();
-     515              :     } catch (e) {
-     516              :       rethrow;
-     517              :     }
-     518              :   }
-     519              : 
-     520            0 :   @override
-     521              :   IGenericStore<PendingSessionAuthRequest> get sessionAuthRequests =>
-     522            0 :       engine.sessionAuthRequests;
-     523              : 
-     524            0 :   @override
-     525            0 :   Event<AuthRequest> get onAuthRequest => engine.onAuthRequest;
-     526              : 
-     527            0 :   @override
-     528            0 :   Event<AuthResponse> get onAuthResponse => engine.onAuthResponse;
-     529              : 
-     530              :   // NEW 1-CLICK AUTH METHOD
-     531            0 :   @override
-     532              :   Event<SessionAuthResponse> get onSessionAuthResponse =>
-     533            0 :       engine.onSessionAuthResponse;
-     534              : 
-     535            0 :   @override
-     536              :   Event<SessionAuthRequest> get onSessionAuthRequest =>
-     537            0 :       engine.onSessionAuthRequest;
-     538              : 
-     539            0 :   @override
-     540              :   Future<AuthRequestResponse> requestAuth({
-     541              :     required AuthRequestParams params,
-     542              :     String? pairingTopic,
-     543              :     List<List<String>>? methods = SignEngine.DEFAULT_METHODS_AUTH,
-     544              :   }) {
-     545              :     try {
-     546            0 :       return engine.requestAuth(
-     547              :         params: params,
-     548              :         pairingTopic: pairingTopic,
-     549              :         methods: methods,
-     550              :       );
-     551              :     } catch (e) {
-     552              :       rethrow;
-     553              :     }
-     554              :   }
-     555              : 
-     556              :   // NEW ONE-CLICK AUTH METHOD FOR DAPPS
-     557            0 :   @override
-     558              :   Future<SessionAuthRequestResponse> authenticate({
-     559              :     required SessionAuthRequestParams params,
-     560              :     String? pairingTopic,
-     561              :     List<List<String>>? methods = const [
-     562              :       [MethodConstants.WC_SESSION_AUTHENTICATE]
-     563              :     ],
-     564              :   }) {
-     565              :     try {
-     566            0 :       return engine.authenticate(
-     567              :         params: params,
-     568              :         pairingTopic: pairingTopic,
-     569              :         methods: methods,
-     570              :       );
-     571              :     } catch (e) {
-     572              :       rethrow;
-     573              :     }
-     574              :   }
-     575              : 
-     576            0 :   @override
-     577              :   Future<void> respondAuthRequest({
-     578              :     required int id,
-     579              :     required String iss,
-     580              :     CacaoSignature? signature,
-     581              :     WalletConnectError? error,
-     582              :   }) {
-     583              :     try {
-     584            0 :       return engine.respondAuthRequest(
-     585              :         id: id,
-     586              :         iss: iss,
-     587              :         signature: signature,
-     588              :         error: error,
-     589              :       );
-     590              :     } catch (e) {
-     591              :       rethrow;
-     592              :     }
-     593              :   }
-     594              : 
-     595            0 :   @override
-     596              :   Future<ApproveResponse> approveSessionAuthenticate({
-     597              :     required int id,
-     598              :     List<Cacao>? auths,
-     599              :   }) {
-     600              :     try {
-     601            0 :       return engine.approveSessionAuthenticate(
-     602              :         id: id,
-     603              :         auths: auths,
-     604              :       );
-     605              :     } catch (e) {
-     606              :       rethrow;
-     607              :     }
-     608              :   }
-     609              : 
-     610            0 :   @override
-     611              :   Future<void> rejectSessionAuthenticate({
-     612              :     required int id,
-     613              :     required WalletConnectError reason,
-     614              :   }) {
-     615              :     try {
-     616            0 :       return engine.rejectSessionAuthenticate(
-     617              :         id: id,
-     618              :         reason: reason,
-     619              :       );
-     620              :     } catch (e) {
-     621              :       rethrow;
-     622              :     }
-     623              :   }
-     624              : 
-     625            0 :   @override
-     626            0 :   IGenericStore<AuthPublicKey> get authKeys => engine.authKeys;
-     627              : 
-     628            0 :   @override
-     629            0 :   IGenericStore<StoredCacao> get completeRequests => engine.completeRequests;
-     630              : 
-     631            0 :   @override
-     632              :   Future<bool> validateSignedCacao({
-     633              :     required Cacao cacao,
-     634              :     required String projectId,
-     635              :   }) {
-     636              :     try {
-     637            0 :       return engine.validateSignedCacao(
-     638              :         cacao: cacao,
-     639              :         projectId: projectId,
-     640              :       );
-     641              :     } catch (e) {
-     642              :       rethrow;
-     643              :     }
-     644              :   }
-     645              : 
-     646            0 :   @override
-     647              :   String formatAuthMessage({
-     648              :     required String iss,
-     649              :     required CacaoRequestPayload cacaoPayload,
-     650              :   }) {
-     651              :     try {
-     652            0 :       return engine.formatAuthMessage(
-     653              :         iss: iss,
-     654              :         cacaoPayload: cacaoPayload,
-     655              :       );
-     656              :     } catch (e) {
-     657              :       rethrow;
-     658              :     }
-     659              :   }
-     660              : 
-     661            0 :   @override
-     662              :   Map<int, StoredCacao> getCompletedRequestsForPairing({
-     663              :     required String pairingTopic,
-     664              :   }) {
-     665              :     try {
-     666            0 :       return engine.getCompletedRequestsForPairing(
-     667              :         pairingTopic: pairingTopic,
-     668              :       );
-     669              :     } catch (e) {
-     670              :       rethrow;
-     671              :     }
-     672              :   }
-     673              : 
-     674            0 :   @override
-     675            0 :   IGenericStore<String> get pairingTopics => engine.pairingTopics;
-     676              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/sign_engine.dart.func-c.html b/coverage/html/sign_api/sign_engine.dart.func-c.html deleted file mode 100644 index 167029cc..00000000 --- a/coverage/html/sign_api/sign_engine.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/sign_engine.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api - sign_engine.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:51.9 %1046543
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/sign_engine.dart.func.html b/coverage/html/sign_api/sign_engine.dart.func.html deleted file mode 100644 index ae549c60..00000000 --- a/coverage/html/sign_api/sign_engine.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/sign_engine.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api - sign_engine.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:51.9 %1046543
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/sign_engine.dart.gcov.html b/coverage/html/sign_api/sign_engine.dart.gcov.html deleted file mode 100644 index 7dd10db8..00000000 --- a/coverage/html/sign_api/sign_engine.dart.gcov.html +++ /dev/null @@ -1,2861 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/sign_engine.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api - sign_engine.dartCoverageTotalHit
Test:lcov.infoLines:51.9 %1046543
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:async';
-       2              : import 'dart:convert';
-       3              : import 'dart:math';
-       4              : 
-       5              : import 'package:http/http.dart' as http;
-       6              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/json_rpc_utils.dart';
-       7              : import 'package:walletconnect_flutter_v2/apis/core/store/i_generic_store.dart';
-       8              : import 'package:walletconnect_flutter_v2/apis/sign_api/i_sessions.dart';
-       9              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/custom_credentials.dart';
-      10              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/sign_api_validator_utils.dart';
-      11              : import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart';
-      12              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/auth/recaps_utils.dart';
-      13              : import 'package:walletconnect_flutter_v2/apis/core/crypto/crypto_models.dart';
-      14              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/auth/auth_constants.dart';
-      15              : 
-      16              : class SignEngine implements ISignEngine {
-      17              :   static const List<List<String>> DEFAULT_METHODS = [
-      18              :     [
-      19              :       MethodConstants.WC_SESSION_PROPOSE,
-      20              :       MethodConstants.WC_SESSION_REQUEST,
-      21              :     ],
-      22              :   ];
-      23              : 
-      24              :   static const List<List<String>> DEFAULT_METHODS_AUTH = [
-      25              :     [
-      26              :       MethodConstants.WC_AUTH_REQUEST,
-      27              :     ]
-      28              :   ];
-      29              : 
-      30              :   bool _initialized = false;
-      31              : 
-      32              :   @override
-      33              :   final Event<SessionConnect> onSessionConnect = Event<SessionConnect>();
-      34              :   @override
-      35              :   final Event<SessionProposalEvent> onSessionProposal =
-      36              :       Event<SessionProposalEvent>();
-      37              :   @override
-      38              :   final Event<SessionProposalErrorEvent> onSessionProposalError =
-      39              :       Event<SessionProposalErrorEvent>();
-      40              :   @override
-      41              :   final Event<SessionProposalEvent> onProposalExpire =
-      42              :       Event<SessionProposalEvent>();
-      43              :   @override
-      44              :   final Event<SessionUpdate> onSessionUpdate = Event<SessionUpdate>();
-      45              :   @override
-      46              :   final Event<SessionExtend> onSessionExtend = Event<SessionExtend>();
-      47              :   @override
-      48              :   final Event<SessionExpire> onSessionExpire = Event<SessionExpire>();
-      49              :   @override
-      50              :   final Event<SessionRequestEvent> onSessionRequest =
-      51              :       Event<SessionRequestEvent>();
-      52              :   @override
-      53              :   final Event<SessionEvent> onSessionEvent = Event<SessionEvent>();
-      54              :   @override
-      55              :   final Event<SessionPing> onSessionPing = Event<SessionPing>();
-      56              :   @override
-      57              :   final Event<SessionDelete> onSessionDelete = Event<SessionDelete>();
-      58              : 
-      59              :   @override
-      60              :   final ICore core;
-      61              :   @override
-      62              :   final PairingMetadata metadata;
-      63              :   @override
-      64              :   final IGenericStore<ProposalData> proposals;
-      65              :   @override
-      66              :   final ISessions sessions;
-      67              :   @override
-      68              :   final IGenericStore<SessionRequest> pendingRequests;
-      69              : 
-      70              :   List<SessionProposalCompleter> pendingProposals = [];
-      71              : 
-      72              :   // FORMER AUTH ENGINE PROPERTY
-      73              :   @override
-      74              :   late IGenericStore<AuthPublicKey> authKeys;
-      75              :   @override
-      76              :   late IGenericStore<PendingAuthRequest> authRequests;
-      77              :   @override
-      78              :   IGenericStore<StoredCacao> completeRequests;
-      79              :   @override
-      80              :   final Event<AuthRequest> onAuthRequest = Event<AuthRequest>();
-      81              :   @override
-      82              :   final Event<AuthResponse> onAuthResponse = Event<AuthResponse>();
-      83              :   @override
-      84              :   late IGenericStore<String> pairingTopics;
-      85              : 
-      86              :   // NEW 1-CA METHOD
-      87              :   @override
-      88              :   late IGenericStore<PendingSessionAuthRequest> sessionAuthRequests;
-      89              :   @override
-      90              :   final Event<SessionAuthRequest> onSessionAuthRequest =
-      91              :       Event<SessionAuthRequest>();
-      92              :   @override
-      93              :   final Event<SessionAuthResponse> onSessionAuthResponse =
-      94              :       Event<SessionAuthResponse>();
-      95              : 
-      96              :   // FORMER AUTH ENGINE PROPERTY (apparently not used before and not used now)
-      97              :   List<AuthRequestCompleter> pendingAuthRequests = [];
-      98              : 
-      99            5 :   SignEngine({
-     100              :     required this.core,
-     101              :     required this.metadata,
-     102              :     required this.proposals,
-     103              :     required this.sessions,
-     104              :     required this.pendingRequests,
-     105              :     // FORMER AUTH ENGINE PROPERTIES
-     106              :     required this.authKeys,
-     107              :     required this.pairingTopics,
-     108              :     required this.authRequests,
-     109              :     required this.completeRequests,
-     110              :     // NEW 1-CA PROPERTY
-     111              :     required this.sessionAuthRequests,
-     112              :   });
-     113              : 
-     114            5 :   @override
-     115              :   Future<void> init() async {
-     116            5 :     if (_initialized) {
-     117              :       return;
-     118              :     }
-     119              : 
-     120           15 :     await core.pairing.init();
-     121           25 :     await core.verify.init(verifyUrl: metadata.verifyUrl);
-     122           10 :     await proposals.init();
-     123           10 :     await sessions.init();
-     124           10 :     await pendingRequests.init();
-     125              : 
-     126              :     // FORMER AUTH ENGINE PROPERTIES
-     127           10 :     await authKeys.init();
-     128           10 :     await pairingTopics.init();
-     129           10 :     await authRequests.init();
-     130           10 :     await completeRequests.init();
-     131              :     // NEW 1-CA PROPERTY
-     132           10 :     await sessionAuthRequests.init();
-     133              : 
-     134            5 :     _registerInternalEvents();
-     135            5 :     _registerRelayClientFunctions();
-     136            5 :     await _cleanup();
-     137              : 
-     138            5 :     await _resubscribeAll();
-     139              : 
-     140            5 :     _initialized = true;
-     141              :   }
-     142              : 
-     143            5 :   @override
-     144              :   Future<void> checkAndExpire() async {
-     145           14 :     for (var session in sessions.getAll()) {
-     146           16 :       await core.expirer.checkAndExpire(session.topic);
-     147              :     }
-     148              :   }
-     149              : 
-     150            4 :   @override
-     151              :   Future<ConnectResponse> connect({
-     152              :     Map<String, RequiredNamespace>? requiredNamespaces,
-     153              :     Map<String, RequiredNamespace>? optionalNamespaces,
-     154              :     Map<String, String>? sessionProperties,
-     155              :     String? pairingTopic,
-     156              :     List<Relay>? relays,
-     157              :     List<List<String>>? methods = DEFAULT_METHODS,
-     158              :   }) async {
-     159            4 :     _checkInitialized();
-     160              : 
-     161            4 :     await _isValidConnect(
-     162            0 :       requiredNamespaces: requiredNamespaces ?? {},
-     163            4 :       optionalNamespaces: optionalNamespaces ?? {},
-     164              :       sessionProperties: sessionProperties,
-     165              :       pairingTopic: pairingTopic,
-     166              :       relays: relays,
-     167              :     );
-     168              :     String? pTopic = pairingTopic;
-     169              :     Uri? uri;
-     170              : 
-     171              :     if (pTopic == null) {
-     172           12 :       final CreateResponse newTopicAndUri = await core.pairing.create(
-     173              :         methods: methods,
-     174              :       );
-     175            4 :       pTopic = newTopicAndUri.topic;
-     176            4 :       uri = newTopicAndUri.uri;
-     177              :       // print('connect generated topic: $topic');
-     178              :     } else {
-     179           12 :       core.pairing.isValidPairingTopic(topic: pTopic);
-     180              :     }
-     181              : 
-     182           12 :     final publicKey = await core.crypto.generateKeyPair();
-     183            4 :     final int id = JsonRpcUtils.payloadId();
-     184              : 
-     185            4 :     final request = WcSessionProposeRequest(
-     186              :       relays:
-     187            8 :           relays ?? [Relay(WalletConnectConstants.RELAYER_DEFAULT_PROTOCOL)],
-     188            0 :       requiredNamespaces: requiredNamespaces ?? {},
-     189            4 :       optionalNamespaces: optionalNamespaces ?? {},
-     190            4 :       proposer: ConnectionMetadata(
-     191              :         publicKey: publicKey,
-     192            4 :         metadata: metadata,
-     193              :       ),
-     194              :       sessionProperties: sessionProperties,
-     195              :     );
-     196              : 
-     197            4 :     final expiry = WalletConnectUtils.calculateExpiry(
-     198              :       WalletConnectConstants.FIVE_MINUTES,
-     199              :     );
-     200            4 :     final ProposalData proposal = ProposalData(
-     201              :       id: id,
-     202              :       expiry: expiry,
-     203            4 :       relays: request.relays,
-     204            4 :       proposer: request.proposer,
-     205            4 :       requiredNamespaces: request.requiredNamespaces,
-     206            4 :       optionalNamespaces: request.optionalNamespaces ?? {},
-     207            4 :       sessionProperties: request.sessionProperties,
-     208              :       pairingTopic: pTopic,
-     209              :     );
-     210            4 :     await _setProposal(
-     211              :       id,
-     212              :       proposal,
-     213              :     );
-     214              : 
-     215            4 :     Completer<SessionData> completer = Completer();
-     216              : 
-     217            8 :     pendingProposals.add(
-     218            4 :       SessionProposalCompleter(
-     219              :         id: id,
-     220              :         selfPublicKey: publicKey,
-     221              :         pairingTopic: pTopic,
-     222            4 :         requiredNamespaces: request.requiredNamespaces,
-     223            4 :         optionalNamespaces: request.optionalNamespaces ?? {},
-     224            4 :         sessionProperties: request.sessionProperties,
-     225              :         completer: completer,
-     226              :       ),
-     227              :     );
-     228            4 :     _connectResponseHandler(
-     229              :       pTopic,
-     230              :       request,
-     231              :       id,
-     232              :     );
-     233              : 
-     234            4 :     final ConnectResponse resp = ConnectResponse(
-     235              :       pairingTopic: pTopic,
-     236              :       session: completer,
-     237              :       uri: uri,
-     238              :     );
-     239              : 
-     240              :     return resp;
-     241              :   }
-     242              : 
-     243            4 :   Future<void> _connectResponseHandler(
-     244              :     String topic,
-     245              :     WcSessionProposeRequest request,
-     246              :     int requestId,
-     247              :   ) async {
-     248              :     // print("sending proposal for $topic");
-     249              :     // print('connectResponseHandler requestId: $requestId');
-     250              :     try {
-     251           12 :       final Map<String, dynamic> response = await core.pairing.sendRequest(
-     252              :         topic,
-     253              :         MethodConstants.WC_SESSION_PROPOSE,
-     254            4 :         request.toJson(),
-     255              :         id: requestId,
-     256              :       );
-     257            4 :       final String peerPublicKey = response['responderPublicKey'];
-     258              : 
-     259            8 :       final ProposalData proposal = proposals.get(
-     260            4 :         requestId.toString(),
-     261              :       )!;
-     262           12 :       final String sessionTopic = await core.crypto.generateSharedKey(
-     263            8 :         proposal.proposer.publicKey,
-     264              :         peerPublicKey,
-     265              :       );
-     266              :       // print('connectResponseHandler session topic: $sessionTopic');
-     267              : 
-     268              :       // Delete the proposal, we are done with it
-     269            4 :       await _deleteProposal(requestId);
-     270              : 
-     271           12 :       await core.relayClient.subscribe(topic: sessionTopic);
-     272           12 :       await core.pairing.activate(topic: topic);
-     273              :     } catch (e) {
-     274              :       // Get the completer and finish it with an error
-     275           12 :       pendingProposals.removeLast().completer.completeError(e);
-     276              :     }
-     277              :   }
-     278              : 
-     279            4 :   @override
-     280              :   Future<PairingInfo> pair({
-     281              :     required Uri uri,
-     282              :   }) async {
-     283            4 :     _checkInitialized();
-     284              : 
-     285           12 :     return await core.pairing.pair(
-     286              :       uri: uri,
-     287              :     );
-     288              :   }
-     289              : 
-     290              :   /// Approves a proposal with the id provided in the parameters.
-     291              :   /// Assumes the proposal is already created.
-     292            4 :   @override
-     293              :   Future<ApproveResponse> approveSession({
-     294              :     required int id,
-     295              :     required Map<String, Namespace> namespaces,
-     296              :     Map<String, String>? sessionProperties,
-     297              :     String? relayProtocol,
-     298              :   }) async {
-     299              :     // print('sign approveSession');
-     300            4 :     _checkInitialized();
-     301              : 
-     302            4 :     await _isValidApprove(
-     303              :       id: id,
-     304              :       namespaces: namespaces,
-     305              :       sessionProperties: sessionProperties,
-     306              :       relayProtocol: relayProtocol,
-     307              :     );
-     308              : 
-     309            8 :     final ProposalData proposal = proposals.get(
-     310            4 :       id.toString(),
-     311              :     )!;
-     312              : 
-     313           12 :     final String selfPubKey = await core.crypto.generateKeyPair();
-     314            8 :     final String peerPubKey = proposal.proposer.publicKey;
-     315           12 :     final String sessionTopic = await core.crypto.generateSharedKey(
-     316              :       selfPubKey,
-     317              :       peerPubKey,
-     318              :     );
-     319              :     // print('approve session topic: $sessionTopic');
-     320              :     final protocol =
-     321              :         relayProtocol ?? WalletConnectConstants.RELAYER_DEFAULT_PROTOCOL;
-     322            4 :     final relay = Relay(protocol);
-     323              : 
-     324              :     // Respond to the proposal
-     325           12 :     await core.pairing.sendResult(
-     326              :       id,
-     327            4 :       proposal.pairingTopic,
-     328              :       MethodConstants.WC_SESSION_PROPOSE,
-     329            4 :       WcSessionProposeResponse(
-     330              :         relay: relay,
-     331              :         responderPublicKey: selfPubKey,
-     332              :       ),
-     333              :     );
-     334            4 :     await _deleteProposal(id);
-     335           16 :     await core.pairing.activate(topic: proposal.pairingTopic);
-     336              : 
-     337           12 :     await core.pairing.updateMetadata(
-     338            4 :       topic: proposal.pairingTopic,
-     339            8 :       metadata: proposal.proposer.metadata,
-     340              :     );
-     341              : 
-     342           12 :     await core.relayClient.subscribe(topic: sessionTopic);
-     343              : 
-     344            4 :     final int expiry = WalletConnectUtils.calculateExpiry(
-     345              :       WalletConnectConstants.SEVEN_DAYS,
-     346              :     );
-     347              : 
-     348            4 :     SessionData session = SessionData(
-     349              :       topic: sessionTopic,
-     350            4 :       pairingTopic: proposal.pairingTopic,
-     351              :       relay: relay,
-     352              :       expiry: expiry,
-     353              :       acknowledged: false,
-     354              :       controller: selfPubKey,
-     355              :       namespaces: namespaces,
-     356            4 :       self: ConnectionMetadata(
-     357              :         publicKey: selfPubKey,
-     358            4 :         metadata: metadata,
-     359              :       ),
-     360            4 :       peer: proposal.proposer,
-     361            4 :       sessionProperties: proposal.sessionProperties,
-     362              :     );
-     363              : 
-     364           12 :     onSessionConnect.broadcast(SessionConnect(session));
-     365              : 
-     366            8 :     await sessions.set(sessionTopic, session);
-     367            4 :     await _setSessionExpiry(sessionTopic, expiry);
-     368              : 
-     369              :     // `wc_sessionSettle` is not critical throughout the entire session.
-     370            8 :     bool acknowledged = await core.pairing
-     371            4 :         .sendRequest(
-     372              :           sessionTopic,
-     373              :           MethodConstants.WC_SESSION_SETTLE,
-     374            4 :           WcSessionSettleRequest(
-     375              :             relay: relay,
-     376              :             namespaces: namespaces,
-     377              :             sessionProperties: sessionProperties,
-     378              :             expiry: expiry,
-     379            4 :             controller: ConnectionMetadata(
-     380              :               publicKey: selfPubKey,
-     381            4 :               metadata: metadata,
-     382              :             ),
-     383              :           ),
-     384              :         )
-     385              :         // Sometimes we don't receive any response for a long time,
-     386              :         // in which case we manually time out to prevent waiting indefinitely.
-     387            4 :         .timeout(const Duration(seconds: 15))
-     388            4 :         .catchError(
-     389            0 :       (_) {
-     390              :         return false;
-     391              :       },
-     392              :     );
-     393              : 
-     394            8 :     session = session.copyWith(
-     395              :       acknowledged: acknowledged,
-     396              :     );
-     397              : 
-     398            8 :     if (acknowledged && sessions.has(sessionTopic)) {
-     399              :       // We directly update the latest value.
-     400            8 :       await sessions.set(
-     401              :         sessionTopic,
-     402              :         session,
-     403              :       );
-     404              :     }
-     405              : 
-     406            4 :     return ApproveResponse(
-     407              :       topic: sessionTopic,
-     408              :       session: session,
-     409              :     );
-     410              :   }
-     411              : 
-     412            3 :   @override
-     413              :   Future<void> rejectSession({
-     414              :     required int id,
-     415              :     required WalletConnectError reason,
-     416              :   }) async {
-     417            3 :     _checkInitialized();
-     418              : 
-     419            3 :     await _isValidReject(id, reason);
-     420              : 
-     421            9 :     ProposalData? proposal = proposals.get(id.toString());
-     422              :     if (proposal != null) {
-     423              :       // Attempt to send a response, if the pairing is not active, this will fail
-     424              :       // but we don't care
-     425              :       try {
-     426              :         final method = MethodConstants.WC_SESSION_PROPOSE;
-     427            3 :         final rpcOpts = MethodConstants.RPC_OPTS[method];
-     428            9 :         await core.pairing.sendError(
-     429              :           id,
-     430            3 :           proposal.pairingTopic,
-     431              :           method,
-     432            9 :           JsonRpcError(code: reason.code, message: reason.message),
-     433            3 :           rpcOptions: rpcOpts?['reject'],
-     434              :         );
-     435              :       } catch (_) {
-     436              :         // print('got here');
-     437              :       }
-     438              :     }
-     439            3 :     await _deleteProposal(id);
-     440              :   }
-     441              : 
-     442            3 :   @override
-     443              :   Future<void> updateSession({
-     444              :     required String topic,
-     445              :     required Map<String, Namespace> namespaces,
-     446              :   }) async {
-     447            3 :     _checkInitialized();
-     448            3 :     await _isValidUpdate(
-     449              :       topic,
-     450              :       namespaces,
-     451              :     );
-     452              : 
-     453            6 :     await sessions.update(
-     454              :       topic,
-     455              :       namespaces: namespaces,
-     456              :     );
-     457              : 
-     458            9 :     await core.pairing.sendRequest(
-     459              :       topic,
-     460              :       MethodConstants.WC_SESSION_UPDATE,
-     461            3 :       WcSessionUpdateRequest(namespaces: namespaces),
-     462              :     );
-     463              :   }
-     464              : 
-     465            3 :   @override
-     466              :   Future<void> extendSession({
-     467              :     required String topic,
-     468              :   }) async {
-     469            3 :     _checkInitialized();
-     470            3 :     await _isValidSessionTopic(topic);
-     471              : 
-     472            9 :     await core.pairing.sendRequest(
-     473              :       topic,
-     474              :       MethodConstants.WC_SESSION_EXTEND,
-     475            3 :       {},
-     476              :     );
-     477              : 
-     478            3 :     await _setSessionExpiry(
-     479              :       topic,
-     480            3 :       WalletConnectUtils.calculateExpiry(
-     481              :         WalletConnectConstants.SEVEN_DAYS,
-     482              :       ),
-     483              :     );
-     484              :   }
-     485              : 
-     486              :   /// Maps a request using chainId:method to its handler
-     487              :   final Map<String, dynamic Function(String, dynamic)?> _methodHandlers = {};
-     488              : 
-     489            3 :   @override
-     490              :   void registerRequestHandler({
-     491              :     required String chainId,
-     492              :     required String method,
-     493              :     dynamic Function(String, dynamic)? handler,
-     494              :   }) {
-     495            9 :     _methodHandlers[_getRegisterKey(chainId, method)] = handler;
-     496              :   }
-     497              : 
-     498            3 :   @override
-     499              :   Future request({
-     500              :     required String topic,
-     501              :     required String chainId,
-     502              :     required SessionRequestParams request,
-     503              :   }) async {
-     504            3 :     _checkInitialized();
-     505            3 :     await _isValidRequest(
-     506              :       topic,
-     507              :       chainId,
-     508              :       request,
-     509              :     );
-     510            9 :     return await core.pairing.sendRequest(
-     511              :       topic,
-     512              :       MethodConstants.WC_SESSION_REQUEST,
-     513            3 :       WcSessionRequestRequest(
-     514              :         chainId: chainId,
-     515              :         request: request,
-     516              :       ),
-     517              :     );
-     518              :   }
-     519              : 
-     520            0 :   @override
-     521              :   Future<List<dynamic>> requestReadContract({
-     522              :     required DeployedContract deployedContract,
-     523              :     required String functionName,
-     524              :     required String rpcUrl,
-     525              :     EthereumAddress? sender,
-     526              :     List<dynamic> parameters = const [],
-     527              :   }) async {
-     528              :     try {
-     529            0 :       final results = await Web3Client(rpcUrl, http.Client()).call(
-     530              :         sender: sender,
-     531              :         contract: deployedContract,
-     532            0 :         function: deployedContract.function(functionName),
-     533              :         params: parameters,
-     534              :       );
-     535              : 
-     536              :       return results;
-     537              :     } catch (e) {
-     538              :       rethrow;
-     539              :     }
-     540              :   }
-     541              : 
-     542            0 :   @override
-     543              :   Future<dynamic> requestWriteContract({
-     544              :     required String topic,
-     545              :     required String chainId,
-     546              :     required String rpcUrl,
-     547              :     required DeployedContract deployedContract,
-     548              :     required String functionName,
-     549              :     required Transaction transaction,
-     550              :     String? method,
-     551              :     List<dynamic> parameters = const [],
-     552              :   }) async {
-     553            0 :     if (transaction.from == null) {
-     554            0 :       throw Exception('Transaction must include `from` value');
-     555              :     }
-     556            0 :     final credentials = CustomCredentials(
-     557              :       signEngine: this,
-     558              :       topic: topic,
-     559              :       chainId: chainId,
-     560            0 :       address: transaction.from!,
-     561              :       method: method,
-     562              :     );
-     563            0 :     final trx = Transaction.callContract(
-     564              :       contract: deployedContract,
-     565            0 :       function: deployedContract.function(functionName),
-     566            0 :       from: credentials.address,
-     567            0 :       value: transaction.value,
-     568            0 :       maxGas: transaction.maxGas,
-     569            0 :       gasPrice: transaction.gasPrice,
-     570            0 :       nonce: transaction.nonce,
-     571            0 :       maxFeePerGas: transaction.maxFeePerGas,
-     572            0 :       maxPriorityFeePerGas: transaction.maxPriorityFeePerGas,
-     573              :       parameters: parameters,
-     574              :     );
-     575              : 
-     576            0 :     if (chainId.contains(':')) {
-     577            0 :       chainId = chainId.split(':').last;
-     578              :     }
-     579            0 :     return await Web3Client(rpcUrl, http.Client()).sendTransaction(
-     580              :       credentials,
-     581              :       trx,
-     582            0 :       chainId: int.parse(chainId),
-     583              :     );
-     584              :   }
-     585              : 
-     586            3 :   @override
-     587              :   Future<void> respondSessionRequest({
-     588              :     required String topic,
-     589              :     required JsonRpcResponse response,
-     590              :   }) async {
-     591            3 :     _checkInitialized();
-     592            3 :     await _isValidResponse(topic, response);
-     593              : 
-     594              :     // final SessionRequest req = pendingRequests.get(response.id.toString())!;
-     595              :     // print('respondSessionRequest: ${req.toJson()}');
-     596            3 :     if (response.result != null) {
-     597            9 :       await core.pairing.sendResult(
-     598            3 :         response.id,
-     599              :         topic,
-     600              :         MethodConstants.WC_SESSION_REQUEST,
-     601            3 :         response.result,
-     602              :       );
-     603              :     } else {
-     604            9 :       await core.pairing.sendError(
-     605            3 :         response.id,
-     606              :         topic,
-     607              :         MethodConstants.WC_SESSION_REQUEST,
-     608            3 :         response.error!,
-     609              :       );
-     610              :     }
-     611              : 
-     612            6 :     await _deletePendingRequest(response.id);
-     613              :   }
-     614              : 
-     615              :   /// Maps a request using chainId:event to its handler
-     616              :   final Map<String, dynamic Function(String, dynamic)?> _eventHandlers = {};
-     617              : 
-     618            3 :   @override
-     619              :   void registerEventHandler({
-     620              :     required String chainId,
-     621              :     required String event,
-     622              :     dynamic Function(String, dynamic)? handler,
-     623              :   }) {
-     624            3 :     _checkInitialized();
-     625            9 :     _eventHandlers[_getRegisterKey(chainId, event)] = handler;
-     626              :   }
-     627              : 
-     628            3 :   @override
-     629              :   Future<void> emitSessionEvent({
-     630              :     required String topic,
-     631              :     required String chainId,
-     632              :     required SessionEventParams event,
-     633              :   }) async {
-     634            3 :     _checkInitialized();
-     635            3 :     await _isValidEmit(
-     636              :       topic,
-     637              :       event,
-     638              :       chainId,
-     639              :     );
-     640            9 :     await core.pairing.sendRequest(
-     641              :       topic,
-     642              :       MethodConstants.WC_SESSION_EVENT,
-     643            3 :       WcSessionEventRequest(
-     644              :         chainId: chainId,
-     645              :         event: event,
-     646              :       ),
-     647              :     );
-     648              :   }
-     649              : 
-     650            3 :   @override
-     651              :   Future<void> ping({
-     652              :     required String topic,
-     653              :   }) async {
-     654            3 :     _checkInitialized();
-     655            3 :     await _isValidPing(topic);
-     656              : 
-     657            6 :     if (sessions.has(topic)) {
-     658            9 :       bool _ = await core.pairing.sendRequest(
-     659              :         topic,
-     660              :         MethodConstants.WC_SESSION_PING,
-     661            3 :         {},
-     662              :       );
-     663           12 :     } else if (core.pairing.getStore().has(topic)) {
-     664            9 :       await core.pairing.ping(topic: topic);
-     665              :     }
-     666              :   }
-     667              : 
-     668            3 :   @override
-     669              :   Future<void> disconnectSession({
-     670              :     required String topic,
-     671              :     required WalletConnectError reason,
-     672              :   }) async {
-     673            3 :     _checkInitialized();
-     674              :     try {
-     675            3 :       await _isValidDisconnect(topic);
-     676              : 
-     677            6 :       if (sessions.has(topic)) {
-     678              :         // Send the request to delete the session, we don't care if it fails
-     679              :         try {
-     680            9 :           core.pairing.sendRequest(
-     681              :             topic,
-     682              :             MethodConstants.WC_SESSION_DELETE,
-     683            3 :             WcSessionDeleteRequest(
-     684            3 :               code: reason.code,
-     685            3 :               message: reason.message,
-     686            3 :               data: reason.data,
-     687              :             ),
-     688              :           );
-     689              :         } catch (_) {}
-     690              : 
-     691            3 :         await _deleteSession(topic);
-     692              :       } else {
-     693            9 :         await core.pairing.disconnect(topic: topic);
-     694              :       }
-     695            0 :     } on WalletConnectError catch (error, s) {
-     696            0 :       core.logger.e(
-     697            0 :         '[$runtimeType] disconnectSession()',
-     698              :         error: error,
-     699              :         stackTrace: s,
-     700              :       );
-     701              :     }
-     702              :   }
-     703              : 
-     704            3 :   @override
-     705              :   SessionData? find({
-     706              :     required Map<String, RequiredNamespace> requiredNamespaces,
-     707              :   }) {
-     708            3 :     _checkInitialized();
-     709           12 :     final compatible = sessions.getAll().where((element) {
-     710            3 :       return SignApiValidatorUtils.isSessionCompatible(
-     711              :         session: element,
-     712              :         requiredNamespaces: requiredNamespaces,
-     713              :       );
-     714              :     });
-     715              : 
-     716            6 :     return compatible.isNotEmpty ? compatible.first : null;
-     717              :   }
-     718              : 
-     719            4 :   @override
-     720              :   Map<String, SessionData> getActiveSessions() {
-     721            4 :     _checkInitialized();
-     722              : 
-     723            4 :     Map<String, SessionData> activeSessions = {};
-     724           16 :     sessions.getAll().forEach((session) {
-     725            8 :       activeSessions[session.topic] = session;
-     726              :     });
-     727              : 
-     728              :     return activeSessions;
-     729              :   }
-     730              : 
-     731            3 :   @override
-     732              :   Map<String, SessionData> getSessionsForPairing({
-     733              :     required String pairingTopic,
-     734              :   }) {
-     735            3 :     _checkInitialized();
-     736              : 
-     737            3 :     Map<String, SessionData> pairingSessions = {};
-     738            3 :     sessions
-     739            3 :         .getAll()
-     740           12 :         .where((session) => session.pairingTopic == pairingTopic)
-     741            6 :         .forEach((session) {
-     742            6 :       pairingSessions[session.topic] = session;
-     743              :     });
-     744              : 
-     745              :     return pairingSessions;
-     746              :   }
-     747              : 
-     748            4 :   @override
-     749              :   Map<String, ProposalData> getPendingSessionProposals() {
-     750            4 :     _checkInitialized();
-     751              : 
-     752            4 :     Map<String, ProposalData> pendingProposals = {};
-     753           16 :     proposals.getAll().forEach((proposal) {
-     754           12 :       pendingProposals[proposal.id.toString()] = proposal;
-     755              :     });
-     756              : 
-     757              :     return pendingProposals;
-     758              :   }
-     759              : 
-     760            3 :   @override
-     761              :   Map<String, SessionRequest> getPendingSessionRequests() {
-     762            3 :     _checkInitialized();
-     763              : 
-     764            3 :     Map<String, SessionRequest> requests = {};
-     765           12 :     pendingRequests.getAll().forEach((r) {
-     766            9 :       requests[r.id.toString()] = r;
-     767              :     });
-     768              : 
-     769              :     return requests;
-     770              :   }
-     771              : 
-     772            1 :   @override
-     773            3 :   IPairingStore get pairings => core.pairing.getStore();
-     774              : 
-     775              :   final Set<String> _eventEmitters = {};
-     776              :   final Set<String> _accounts = {};
-     777              : 
-     778            3 :   @override
-     779              :   void registerEventEmitter({
-     780              :     required String chainId,
-     781              :     required String event,
-     782              :   }) {
-     783            3 :     final bool isChainId = NamespaceUtils.isValidChainId(chainId);
-     784              :     if (!isChainId) {
-     785            3 :       throw Errors.getSdkError(
-     786              :         Errors.UNSUPPORTED_CHAINS,
-     787              :         context:
-     788            3 :             'registerEventEmitter, chain $chainId should conform to "namespace:chainId" format',
-     789              :       );
-     790              :     }
-     791            3 :     final String value = _getRegisterKey(chainId, event);
-     792            3 :     SignApiValidatorUtils.isValidAccounts(
-     793            3 :       accounts: [value],
-     794              :       context: 'registerEventEmitter',
-     795              :     );
-     796            6 :     _eventEmitters.add(value);
-     797              :   }
-     798              : 
-     799            3 :   @override
-     800              :   void registerAccount({
-     801              :     required String chainId,
-     802              :     required String accountAddress,
-     803              :   }) {
-     804            3 :     final bool isChainId = NamespaceUtils.isValidChainId(chainId);
-     805              :     if (!isChainId) {
-     806            3 :       throw Errors.getSdkError(
-     807              :         Errors.UNSUPPORTED_CHAINS,
-     808              :         context:
-     809            3 :             'registerAccount, chain $chainId should conform to "namespace:chainId" format',
-     810              :       );
-     811              :     }
-     812            3 :     final String value = _getRegisterKey(chainId, accountAddress);
-     813            3 :     SignApiValidatorUtils.isValidAccounts(
-     814            3 :       accounts: [value],
-     815              :       context: 'registerAccount',
-     816              :     );
-     817            6 :     _accounts.add(value);
-     818              :   }
-     819              : 
-     820              :   /// ---- PRIVATE HELPERS ---- ////
-     821              : 
-     822            5 :   Future<void> _resubscribeAll() async {
-     823              :     // If the relay is not connected, stop here
-     824           15 :     if (!core.relayClient.isConnected) {
-     825              :       return;
-     826              :     }
-     827              : 
-     828              :     // Subscribe to all the sessions
-     829           10 :     for (final SessionData session in sessions.getAll()) {
-     830              :       // print('Session: subscribing to ${session.topic}');
-     831            0 :       await core.relayClient.subscribe(topic: session.topic);
-     832              :     }
-     833              :   }
-     834              : 
-     835            4 :   void _checkInitialized() {
-     836            4 :     if (!_initialized) {
-     837            0 :       throw Errors.getInternalError(Errors.NOT_INITIALIZED);
-     838              :     }
-     839              :   }
-     840              : 
-     841            3 :   String _getRegisterKey(String chainId, String value) {
-     842            3 :     return '$chainId:$value';
-     843              :   }
-     844              : 
-     845            3 :   Future<void> _deleteSession(
-     846              :     String topic, {
-     847              :     bool expirerHasDeleted = false,
-     848              :   }) async {
-     849              :     // print('deleting session: $topic, expirerHasDeleted: $expirerHasDeleted');
-     850            6 :     final SessionData? session = sessions.get(topic);
-     851              :     if (session == null) {
-     852              :       return;
-     853              :     }
-     854            9 :     await core.relayClient.unsubscribe(topic: topic);
-     855              : 
-     856            6 :     await sessions.delete(topic);
-     857           15 :     await core.crypto.deleteKeyPair(session.self.publicKey);
-     858            9 :     await core.crypto.deleteSymKey(topic);
-     859              :     if (expirerHasDeleted) {
-     860            9 :       await core.expirer.delete(topic);
-     861              :     }
-     862              : 
-     863            6 :     onSessionDelete.broadcast(
-     864            3 :       SessionDelete(
-     865              :         topic,
-     866              :       ),
-     867              :     );
-     868              :   }
-     869              : 
-     870            4 :   Future<void> _deleteProposal(
-     871              :     int id, {
-     872              :     bool expirerHasDeleted = false,
-     873              :   }) async {
-     874           12 :     await proposals.delete(id.toString());
-     875              :     if (expirerHasDeleted) {
-     876           12 :       await core.expirer.delete(id.toString());
-     877              :     }
-     878              :   }
-     879              : 
-     880            3 :   Future<void> _deletePendingRequest(
-     881              :     int id, {
-     882              :     bool expirerHasDeleted = false,
-     883              :   }) async {
-     884            9 :     await pendingRequests.delete(id.toString());
-     885              :     if (expirerHasDeleted) {
-     886            0 :       await core.expirer.delete(id.toString());
-     887              :     }
-     888              :   }
-     889              : 
-     890            4 :   Future<void> _setSessionExpiry(String topic, int expiry) async {
-     891            8 :     if (sessions.has(topic)) {
-     892            8 :       await sessions.update(
-     893              :         topic,
-     894              :         expiry: expiry,
-     895              :       );
-     896              :     }
-     897           12 :     await core.expirer.set(topic, expiry);
-     898              :   }
-     899              : 
-     900            4 :   Future<void> _setProposal(int id, ProposalData proposal) async {
-     901           12 :     await proposals.set(id.toString(), proposal);
-     902           20 :     core.expirer.set(id.toString(), proposal.expiry);
-     903              :   }
-     904              : 
-     905            3 :   Future<void> _setPendingRequest(int id, SessionRequest request) async {
-     906            6 :     await pendingRequests.set(
-     907            3 :       id.toString(),
-     908              :       request,
-     909              :     );
-     910            9 :     core.expirer.set(
-     911            3 :       id.toString(),
-     912            3 :       WalletConnectUtils.calculateExpiry(
-     913              :         WalletConnectConstants.FIVE_MINUTES,
-     914              :       ),
-     915              :     );
-     916              :   }
-     917              : 
-     918            5 :   Future<void> _cleanup() async {
-     919            5 :     final List<String> sessionTopics = [];
-     920            5 :     final List<int> proposalIds = [];
-     921              : 
-     922           10 :     for (final SessionData session in sessions.getAll()) {
-     923            0 :       if (WalletConnectUtils.isExpired(session.expiry)) {
-     924            0 :         sessionTopics.add(session.topic);
-     925              :       }
-     926              :     }
-     927           10 :     for (final ProposalData proposal in proposals.getAll()) {
-     928            0 :       if (WalletConnectUtils.isExpired(proposal.expiry)) {
-     929            0 :         proposalIds.add(proposal.id);
-     930              :       }
-     931              :     }
-     932              : 
-     933            5 :     sessionTopics.map((topic) async {
-     934              :       // print('deleting expired session $topic');
-     935            0 :       await _deleteSession(topic);
-     936              :     });
-     937            5 :     proposalIds.map((id) async => await _deleteProposal(id));
-     938              :   }
-     939              : 
-     940              :   /// ---- Relay Events ---- ///
-     941              : 
-     942            5 :   void _registerRelayClientFunctions() {
-     943           15 :     core.pairing.register(
-     944              :       method: MethodConstants.WC_SESSION_PROPOSE,
-     945            5 :       function: _onSessionProposeRequest,
-     946              :       type: ProtocolType.sign,
-     947              :     );
-     948           15 :     core.pairing.register(
-     949              :       method: MethodConstants.WC_SESSION_SETTLE,
-     950            5 :       function: _onSessionSettleRequest,
-     951              :       type: ProtocolType.sign,
-     952              :     );
-     953           15 :     core.pairing.register(
-     954              :       method: MethodConstants.WC_SESSION_UPDATE,
-     955            5 :       function: _onSessionUpdateRequest,
-     956              :       type: ProtocolType.sign,
-     957              :     );
-     958           15 :     core.pairing.register(
-     959              :       method: MethodConstants.WC_SESSION_EXTEND,
-     960            5 :       function: _onSessionExtendRequest,
-     961              :       type: ProtocolType.sign,
-     962              :     );
-     963           15 :     core.pairing.register(
-     964              :       method: MethodConstants.WC_SESSION_PING,
-     965            5 :       function: _onSessionPingRequest,
-     966              :       type: ProtocolType.sign,
-     967              :     );
-     968           15 :     core.pairing.register(
-     969              :       method: MethodConstants.WC_SESSION_DELETE,
-     970            5 :       function: _onSessionDeleteRequest,
-     971              :       type: ProtocolType.sign,
-     972              :     );
-     973           15 :     core.pairing.register(
-     974              :       method: MethodConstants.WC_SESSION_REQUEST,
-     975            5 :       function: _onSessionRequest,
-     976              :       type: ProtocolType.sign,
-     977              :     );
-     978           15 :     core.pairing.register(
-     979              :       method: MethodConstants.WC_SESSION_EVENT,
-     980            5 :       function: _onSessionEventRequest,
-     981              :       type: ProtocolType.sign,
-     982              :     );
-     983              :     // FORMER AUTH ENGINE PROPERTY
-     984           15 :     core.pairing.register(
-     985              :       method: MethodConstants.WC_AUTH_REQUEST,
-     986            5 :       function: _onAuthRequest,
-     987              :       type: ProtocolType.sign,
-     988              :     );
-     989           15 :     core.pairing.register(
-     990              :       method: MethodConstants.WC_SESSION_AUTHENTICATE,
-     991            5 :       function: _onSessionAuthRequest,
-     992              :       type: ProtocolType.sign,
-     993              :     );
-     994              :   }
-     995              : 
-     996            4 :   bool _shouldIgnoreSessionPropose(String topic) {
-     997           12 :     final PairingInfo? pairingInfo = core.pairing.getPairing(topic: topic);
-     998           12 :     final implementSessionAuth = onSessionAuthRequest.subscriberCount > 0;
-     999              :     final method = MethodConstants.WC_SESSION_AUTHENTICATE;
-    1000            8 :     final containsMethod = (pairingInfo?.methods ?? []).contains(method);
-    1001              : 
-    1002              :     return implementSessionAuth && containsMethod;
-    1003              :   }
-    1004              : 
-    1005            4 :   Future<void> _onSessionProposeRequest(
-    1006              :     String topic,
-    1007              :     JsonRpcRequest payload,
-    1008              :   ) async {
-    1009            4 :     if (_shouldIgnoreSessionPropose(topic)) {
-    1010            0 :       core.logger.t(
-    1011              :         'Session Propose ignored. Session Authenticate will be used instead',
-    1012              :       );
-    1013              :       return;
-    1014              :     }
-    1015              :     try {
-    1016           12 :       core.logger.t(
-    1017            4 :         '_onSessionProposeRequest, topic: $topic, payload: $payload',
-    1018              :       );
-    1019            8 :       final proposeRequest = WcSessionProposeRequest.fromJson(payload.params);
-    1020            4 :       await _isValidConnect(
-    1021            4 :         requiredNamespaces: proposeRequest.requiredNamespaces,
-    1022            4 :         optionalNamespaces: proposeRequest.optionalNamespaces,
-    1023            4 :         sessionProperties: proposeRequest.sessionProperties,
-    1024              :         pairingTopic: topic,
-    1025            4 :         relays: proposeRequest.relays,
-    1026              :       );
-    1027              : 
-    1028              :       // If there are accounts and event emitters, then handle the Namespace generate automatically
-    1029              :       Map<String, Namespace>? namespaces;
-    1030           16 :       if (_accounts.isNotEmpty || _eventEmitters.isNotEmpty) {
-    1031            3 :         namespaces = NamespaceUtils.constructNamespaces(
-    1032            3 :           availableAccounts: _accounts,
-    1033            9 :           availableMethods: _methodHandlers.keys.toSet(),
-    1034            3 :           availableEvents: _eventEmitters,
-    1035            3 :           requiredNamespaces: proposeRequest.requiredNamespaces,
-    1036            3 :           optionalNamespaces: proposeRequest.optionalNamespaces,
-    1037              :         );
-    1038              : 
-    1039              :         // Check that the namespaces are conforming
-    1040              :         try {
-    1041            3 :           SignApiValidatorUtils.isConformingNamespaces(
-    1042            3 :             requiredNamespaces: proposeRequest.requiredNamespaces,
-    1043              :             namespaces: namespaces,
-    1044              :             context: 'onSessionProposeRequest',
-    1045              :           );
-    1046            0 :         } on WalletConnectError catch (err) {
-    1047              :           // If they aren't, send an error
-    1048            0 :           core.logger.t(
-    1049            0 :             '_onSessionProposeRequest WalletConnectError: $err',
-    1050              :           );
-    1051            0 :           final rpcOpts = MethodConstants.RPC_OPTS[payload.method];
-    1052            0 :           await core.pairing.sendError(
-    1053            0 :             payload.id,
-    1054              :             topic,
-    1055            0 :             payload.method,
-    1056            0 :             JsonRpcError(code: err.code, message: err.message),
-    1057            0 :             rpcOptions: rpcOpts?['autoReject'],
-    1058              :           );
-    1059              : 
-    1060              :           // Broadcast that a session proposal error has occurred
-    1061            0 :           onSessionProposalError.broadcast(
-    1062            0 :             SessionProposalErrorEvent(
-    1063            0 :               payload.id,
-    1064            0 :               proposeRequest.requiredNamespaces,
-    1065              :               namespaces,
-    1066              :               err,
-    1067              :             ),
-    1068              :           );
-    1069              :           return;
-    1070              :         }
-    1071              :       }
-    1072              : 
-    1073            4 :       final expiry = WalletConnectUtils.calculateExpiry(
-    1074              :         WalletConnectConstants.FIVE_MINUTES,
-    1075              :       );
-    1076            4 :       final ProposalData proposal = ProposalData(
-    1077            4 :         id: payload.id,
-    1078              :         expiry: expiry,
-    1079            4 :         relays: proposeRequest.relays,
-    1080            4 :         proposer: proposeRequest.proposer,
-    1081            4 :         requiredNamespaces: proposeRequest.requiredNamespaces,
-    1082            4 :         optionalNamespaces: proposeRequest.optionalNamespaces ?? {},
-    1083            4 :         sessionProperties: proposeRequest.sessionProperties,
-    1084              :         pairingTopic: topic,
-    1085              :         generatedNamespaces: namespaces,
-    1086              :       );
-    1087              : 
-    1088            8 :       await _setProposal(payload.id, proposal);
-    1089              : 
-    1090            4 :       final verifyContext = await _getVerifyContext(
-    1091              :         payload,
-    1092            8 :         proposal.proposer.metadata,
-    1093              :       );
-    1094              : 
-    1095            8 :       onSessionProposal.broadcast(
-    1096            4 :         SessionProposalEvent(
-    1097            4 :           payload.id,
-    1098              :           proposal,
-    1099              :           verifyContext,
-    1100              :         ),
-    1101              :       );
-    1102            0 :     } on WalletConnectError catch (err) {
-    1103            0 :       core.logger.e('_onSessionProposeRequest Error: $err');
-    1104            0 :       final rpcOpts = MethodConstants.RPC_OPTS[payload.method];
-    1105            0 :       await core.pairing.sendError(
-    1106            0 :         payload.id,
-    1107              :         topic,
-    1108            0 :         payload.method,
-    1109            0 :         JsonRpcError(code: err.code, message: err.message),
-    1110            0 :         rpcOptions: rpcOpts?['autoReject'],
-    1111              :       );
-    1112              :     }
-    1113              :   }
-    1114              : 
-    1115            4 :   Future<void> _onSessionSettleRequest(
-    1116              :     String topic,
-    1117              :     JsonRpcRequest payload,
-    1118              :   ) async {
-    1119              :     // print('wc session settle');
-    1120            8 :     final request = WcSessionSettleRequest.fromJson(payload.params);
-    1121              :     try {
-    1122           12 :       await _isValidSessionSettleRequest(request.namespaces, request.expiry);
-    1123              : 
-    1124              :       final SessionProposalCompleter sProposalCompleter =
-    1125            8 :           pendingProposals.removeLast();
-    1126              :       // print(sProposalCompleter);
-    1127              : 
-    1128              :       // Create the session
-    1129            4 :       final SessionData session = SessionData(
-    1130              :         topic: topic,
-    1131            4 :         pairingTopic: sProposalCompleter.pairingTopic,
-    1132            4 :         relay: request.relay,
-    1133            4 :         expiry: request.expiry,
-    1134              :         acknowledged: true,
-    1135            8 :         controller: request.controller.publicKey,
-    1136            4 :         namespaces: request.namespaces,
-    1137            4 :         sessionProperties: request.sessionProperties,
-    1138            4 :         self: ConnectionMetadata(
-    1139            4 :           publicKey: sProposalCompleter.selfPublicKey,
-    1140            4 :           metadata: metadata,
-    1141              :         ),
-    1142            4 :         peer: request.controller,
-    1143              :       );
-    1144              : 
-    1145              :       // Update all the things: session, expiry, metadata, pairing
-    1146            8 :       sessions.set(topic, session);
-    1147            8 :       _setSessionExpiry(topic, session.expiry);
-    1148           12 :       await core.pairing.updateMetadata(
-    1149            4 :         topic: sProposalCompleter.pairingTopic,
-    1150            8 :         metadata: request.controller.metadata,
-    1151              :       );
-    1152           12 :       final pairing = core.pairing.getPairing(topic: topic);
-    1153            0 :       if (pairing != null && !pairing.active) {
-    1154            0 :         await core.pairing.activate(topic: topic);
-    1155              :       }
-    1156              : 
-    1157              :       // Send the session back to the completer
-    1158            8 :       sProposalCompleter.completer.complete(session);
-    1159              : 
-    1160              :       // Send back a success!
-    1161              :       // print('responding to session settle: acknolwedged');
-    1162           12 :       await core.pairing.sendResult(
-    1163            4 :         payload.id,
-    1164              :         topic,
-    1165              :         MethodConstants.WC_SESSION_SETTLE,
-    1166              :         true,
-    1167              :       );
-    1168            8 :       onSessionConnect.broadcast(
-    1169            4 :         SessionConnect(session),
-    1170              :       );
-    1171            0 :     } on WalletConnectError catch (err) {
-    1172            0 :       core.logger.e('_onSessionSettleRequest Error: $err');
-    1173            0 :       await core.pairing.sendError(
-    1174            0 :         payload.id,
-    1175              :         topic,
-    1176            0 :         payload.method,
-    1177            0 :         JsonRpcError.invalidParams(
-    1178            0 :           err.message,
-    1179              :         ),
-    1180              :       );
-    1181              :     }
-    1182              :   }
-    1183              : 
-    1184            3 :   Future<void> _onSessionUpdateRequest(
-    1185              :     String topic,
-    1186              :     JsonRpcRequest payload,
-    1187              :   ) async {
-    1188              :     try {
-    1189              :       // print(payload.params);
-    1190            6 :       final request = WcSessionUpdateRequest.fromJson(payload.params);
-    1191            6 :       await _isValidUpdate(topic, request.namespaces);
-    1192            6 :       await sessions.update(
-    1193              :         topic,
-    1194            3 :         namespaces: request.namespaces,
-    1195              :       );
-    1196            9 :       await core.pairing.sendResult(
-    1197            3 :         payload.id,
-    1198              :         topic,
-    1199              :         MethodConstants.WC_SESSION_UPDATE,
-    1200              :         true,
-    1201              :       );
-    1202            6 :       onSessionUpdate.broadcast(
-    1203            3 :         SessionUpdate(
-    1204            3 :           payload.id,
-    1205              :           topic,
-    1206            3 :           request.namespaces,
-    1207              :         ),
-    1208              :       );
-    1209            0 :     } on WalletConnectError catch (err) {
-    1210            0 :       core.logger.e('_onSessionUpdateRequest Error: $err');
-    1211            0 :       await core.pairing.sendError(
-    1212            0 :         payload.id,
-    1213              :         topic,
-    1214            0 :         payload.method,
-    1215            0 :         JsonRpcError.invalidParams(
-    1216            0 :           err.message,
-    1217              :         ),
-    1218              :       );
-    1219              :     }
-    1220              :   }
-    1221              : 
-    1222            3 :   Future<void> _onSessionExtendRequest(
-    1223              :     String topic,
-    1224              :     JsonRpcRequest payload,
-    1225              :   ) async {
-    1226              :     try {
-    1227            6 :       final _ = WcSessionExtendRequest.fromJson(payload.params);
-    1228            3 :       await _isValidSessionTopic(topic);
-    1229            3 :       await _setSessionExpiry(
-    1230              :         topic,
-    1231            3 :         WalletConnectUtils.calculateExpiry(
-    1232              :           WalletConnectConstants.SEVEN_DAYS,
-    1233              :         ),
-    1234              :       );
-    1235            9 :       await core.pairing.sendResult(
-    1236            3 :         payload.id,
-    1237              :         topic,
-    1238              :         MethodConstants.WC_SESSION_EXTEND,
-    1239              :         true,
-    1240              :       );
-    1241            6 :       onSessionExtend.broadcast(
-    1242            3 :         SessionExtend(
-    1243            3 :           payload.id,
-    1244              :           topic,
-    1245              :         ),
-    1246              :       );
-    1247            0 :     } on WalletConnectError catch (err) {
-    1248            0 :       await core.pairing.sendError(
-    1249            0 :         payload.id,
-    1250              :         topic,
-    1251            0 :         payload.method,
-    1252            0 :         JsonRpcError.invalidParams(
-    1253            0 :           err.message,
-    1254              :         ),
-    1255              :       );
-    1256              :     }
-    1257              :   }
-    1258              : 
-    1259            3 :   Future<void> _onSessionPingRequest(
-    1260              :     String topic,
-    1261              :     JsonRpcRequest payload,
-    1262              :   ) async {
-    1263              :     try {
-    1264            6 :       final _ = WcSessionPingRequest.fromJson(payload.params);
-    1265            3 :       await _isValidPing(topic);
-    1266            9 :       await core.pairing.sendResult(
-    1267            3 :         payload.id,
-    1268              :         topic,
-    1269              :         MethodConstants.WC_SESSION_PING,
-    1270              :         true,
-    1271              :       );
-    1272            6 :       onSessionPing.broadcast(
-    1273            3 :         SessionPing(
-    1274            3 :           payload.id,
-    1275              :           topic,
-    1276              :         ),
-    1277              :       );
-    1278            0 :     } on WalletConnectError catch (err) {
-    1279            0 :       await core.pairing.sendError(
-    1280            0 :         payload.id,
-    1281              :         topic,
-    1282            0 :         payload.method,
-    1283            0 :         JsonRpcError.invalidParams(
-    1284            0 :           err.message,
-    1285              :         ),
-    1286              :       );
-    1287              :     }
-    1288              :   }
-    1289              : 
-    1290            3 :   Future<void> _onSessionDeleteRequest(
-    1291              :     String topic,
-    1292              :     JsonRpcRequest payload,
-    1293              :   ) async {
-    1294              :     try {
-    1295            6 :       final _ = WcSessionDeleteRequest.fromJson(payload.params);
-    1296            3 :       await _isValidDisconnect(topic);
-    1297            9 :       await core.pairing.sendResult(
-    1298            3 :         payload.id,
-    1299              :         topic,
-    1300              :         MethodConstants.WC_SESSION_DELETE,
-    1301              :         true,
-    1302              :       );
-    1303            3 :       await _deleteSession(topic);
-    1304            0 :     } on WalletConnectError catch (err) {
-    1305            0 :       await core.pairing.sendError(
-    1306            0 :         payload.id,
-    1307              :         topic,
-    1308            0 :         payload.method,
-    1309            0 :         JsonRpcError.invalidParams(
-    1310            0 :           err.message,
-    1311              :         ),
-    1312              :       );
-    1313              :     }
-    1314              :   }
-    1315              : 
-    1316              :   /// Called when a session request is received
-    1317              :   /// Will attempt to find a handler for the request, if it doesn't,
-    1318              :   /// it will throw an error.
-    1319            3 :   Future<void> _onSessionRequest(String topic, JsonRpcRequest payload) async {
-    1320              :     try {
-    1321            6 :       final request = WcSessionRequestRequest.fromJson(payload.params);
-    1322            3 :       await _isValidRequest(
-    1323              :         topic,
-    1324            3 :         request.chainId,
-    1325            3 :         request.request,
-    1326              :       );
-    1327              : 
-    1328            6 :       final session = sessions.get(topic)!;
-    1329            3 :       final verifyContext = await _getVerifyContext(
-    1330              :         payload,
-    1331            6 :         session.peer.metadata,
-    1332              :       );
-    1333              : 
-    1334            3 :       final sessionRequest = SessionRequest(
-    1335            3 :         id: payload.id,
-    1336              :         topic: topic,
-    1337            6 :         method: request.request.method,
-    1338            3 :         chainId: request.chainId,
-    1339            6 :         params: request.request.params,
-    1340              :         verifyContext: verifyContext,
-    1341              :       );
-    1342              : 
-    1343              :       // print('payload id: ${payload.id}');
-    1344            3 :       await _setPendingRequest(
-    1345            3 :         payload.id,
-    1346              :         sessionRequest,
-    1347              :       );
-    1348              : 
-    1349            3 :       final methodKey = _getRegisterKey(
-    1350            3 :         request.chainId,
-    1351            6 :         request.request.method,
-    1352              :       );
-    1353            6 :       final handler = _methodHandlers[methodKey];
-    1354              :       // If a method handler has been set using registerRequestHandler we use it to process the request
-    1355              :       if (handler != null) {
-    1356              :         try {
-    1357            9 :           await handler(topic, request.request.params);
-    1358            0 :         } on WalletConnectError catch (e) {
-    1359            0 :           await core.pairing.sendError(
-    1360            0 :             payload.id,
-    1361              :             topic,
-    1362            0 :             payload.method,
-    1363            0 :             JsonRpcError.fromJson(
-    1364            0 :               e.toJson(),
-    1365              :             ),
-    1366              :           );
-    1367            0 :           await _deletePendingRequest(payload.id);
-    1368            0 :         } on WalletConnectErrorSilent catch (_) {
-    1369              :           // Do nothing on silent error
-    1370            0 :           await _deletePendingRequest(payload.id);
-    1371              :         } catch (err) {
-    1372            0 :           await core.pairing.sendError(
-    1373            0 :             payload.id,
-    1374              :             topic,
-    1375            0 :             payload.method,
-    1376            0 :             JsonRpcError.invalidParams(
-    1377            0 :               err.toString(),
-    1378              :             ),
-    1379              :           );
-    1380            0 :           await _deletePendingRequest(payload.id);
-    1381              :         }
-    1382              :       } else {
-    1383              :         // Otherwise we send onSessionRequest event
-    1384            6 :         onSessionRequest.broadcast(
-    1385            3 :           SessionRequestEvent.fromSessionRequest(
-    1386              :             sessionRequest,
-    1387              :           ),
-    1388              :         );
-    1389              :       }
-    1390            0 :     } on WalletConnectError catch (err) {
-    1391            0 :       await core.pairing.sendError(
-    1392            0 :         payload.id,
-    1393              :         topic,
-    1394            0 :         payload.method,
-    1395            0 :         JsonRpcError.invalidParams(
-    1396            0 :           err.message,
-    1397              :         ),
-    1398              :       );
-    1399              :     }
-    1400              :   }
-    1401              : 
-    1402            3 :   Future<void> _onSessionEventRequest(
-    1403              :     String topic,
-    1404              :     JsonRpcRequest payload,
-    1405              :   ) async {
-    1406              :     try {
-    1407            6 :       final request = WcSessionEventRequest.fromJson(payload.params);
-    1408            3 :       final SessionEventParams event = request.event;
-    1409            3 :       await _isValidEmit(
-    1410              :         topic,
-    1411              :         event,
-    1412            3 :         request.chainId,
-    1413              :       );
-    1414              : 
-    1415            3 :       final String eventKey = _getRegisterKey(
-    1416            3 :         request.chainId,
-    1417            6 :         request.event.name,
-    1418              :       );
-    1419            6 :       if (_eventHandlers.containsKey(eventKey)) {
-    1420            6 :         final handler = _methodHandlers[eventKey];
-    1421              :         if (handler != null) {
-    1422            0 :           final handler = _eventHandlers[eventKey]!;
-    1423              :           try {
-    1424            0 :             await handler(
-    1425              :               topic,
-    1426            0 :               event.data,
-    1427              :             );
-    1428              :           } catch (err) {
-    1429            0 :             await core.pairing.sendError(
-    1430            0 :               payload.id,
-    1431              :               topic,
-    1432            0 :               payload.method,
-    1433            0 :               JsonRpcError.invalidParams(
-    1434            0 :                 err.toString(),
-    1435              :               ),
-    1436              :             );
-    1437              :           }
-    1438              :         }
-    1439              : 
-    1440            9 :         await core.pairing.sendResult(
-    1441            3 :           payload.id,
-    1442              :           topic,
-    1443              :           MethodConstants.WC_SESSION_REQUEST,
-    1444              :           true,
-    1445              :         );
-    1446              : 
-    1447            6 :         onSessionEvent.broadcast(
-    1448            3 :           SessionEvent(
-    1449            3 :             payload.id,
-    1450              :             topic,
-    1451            3 :             event.name,
-    1452            3 :             request.chainId,
-    1453            3 :             event.data,
-    1454              :           ),
-    1455              :         );
-    1456              :       } else {
-    1457            9 :         await core.pairing.sendError(
-    1458            3 :           payload.id,
-    1459              :           topic,
-    1460            3 :           payload.method,
-    1461            3 :           JsonRpcError.methodNotFound(
-    1462            3 :             'No handler found for chainId:event -> $eventKey',
-    1463              :           ),
-    1464              :         );
-    1465              :       }
-    1466            0 :     } on WalletConnectError catch (err) {
-    1467            0 :       await core.pairing.sendError(
-    1468            0 :         payload.id,
-    1469              :         topic,
-    1470            0 :         payload.method,
-    1471            0 :         JsonRpcError.invalidParams(
-    1472            0 :           err.message,
-    1473              :         ),
-    1474              :       );
-    1475              :     }
-    1476              :   }
-    1477              : 
-    1478              :   /// ---- Event Registers ---- ///
-    1479              : 
-    1480            5 :   void _registerInternalEvents() {
-    1481           25 :     core.relayClient.onRelayClientConnect.subscribe(_onRelayConnect);
-    1482           25 :     core.expirer.onExpire.subscribe(_onExpired);
-    1483           25 :     core.pairing.onPairingDelete.subscribe(_onPairingDelete);
-    1484           25 :     core.pairing.onPairingExpire.subscribe(_onPairingDelete);
-    1485           25 :     core.heartbeat.onPulse.subscribe(_heartbeatSubscription);
-    1486              :   }
-    1487              : 
-    1488            0 :   Future<void> _onRelayConnect(EventArgs? args) async {
-    1489              :     // print('Session: relay connected');
-    1490            0 :     await _resubscribeAll();
-    1491              :   }
-    1492              : 
-    1493            3 :   Future<void> _onPairingDelete(PairingEvent? event) async {
-    1494              :     // Delete all the sessions associated with the pairing
-    1495              :     if (event == null) {
-    1496              :       return;
-    1497              :     }
-    1498              : 
-    1499              :     // Delete the proposals
-    1500            3 :     final List<ProposalData> proposalsToDelete = proposals
-    1501            3 :         .getAll()
-    1502           15 :         .where((proposal) => proposal.pairingTopic == event.topic)
-    1503            3 :         .toList();
-    1504              : 
-    1505            6 :     for (final proposal in proposalsToDelete) {
-    1506            3 :       await _deleteProposal(
-    1507            3 :         proposal.id,
-    1508              :       );
-    1509              :     }
-    1510              : 
-    1511              :     // Delete the sessions
-    1512            3 :     final List<SessionData> sessionsToDelete = sessions
-    1513            3 :         .getAll()
-    1514           15 :         .where((session) => session.pairingTopic == event.topic)
-    1515            3 :         .toList();
-    1516              : 
-    1517            6 :     for (final session in sessionsToDelete) {
-    1518            3 :       await _deleteSession(
-    1519            3 :         session.topic,
-    1520              :       );
-    1521              :     }
-    1522              :   }
-    1523              : 
-    1524            3 :   Future<void> _onExpired(ExpirationEvent? event) async {
-    1525              :     if (event == null) {
-    1526              :       return;
-    1527              :     }
-    1528              : 
-    1529            9 :     if (sessions.has(event.target)) {
-    1530            3 :       await _deleteSession(
-    1531            3 :         event.target,
-    1532              :         expirerHasDeleted: true,
-    1533              :       );
-    1534            6 :       onSessionExpire.broadcast(
-    1535            3 :         SessionExpire(
-    1536            3 :           event.target,
-    1537              :         ),
-    1538              :       );
-    1539            9 :     } else if (proposals.has(event.target)) {
-    1540            9 :       ProposalData proposal = proposals.get(event.target)!;
-    1541            3 :       await _deleteProposal(
-    1542            6 :         int.parse(event.target),
-    1543              :         expirerHasDeleted: true,
-    1544              :       );
-    1545            6 :       onProposalExpire.broadcast(
-    1546            3 :         SessionProposalEvent(
-    1547            6 :           int.parse(event.target),
-    1548              :           proposal,
-    1549              :         ),
-    1550              :       );
-    1551            0 :     } else if (pendingRequests.has(event.target)) {
-    1552            0 :       await _deletePendingRequest(
-    1553            0 :         int.parse(event.target),
-    1554              :         expirerHasDeleted: true,
-    1555              :       );
-    1556              :       return;
-    1557              :     }
-    1558              :   }
-    1559              : 
-    1560            5 :   void _heartbeatSubscription(EventArgs? args) async {
-    1561            5 :     await checkAndExpire();
-    1562              :   }
-    1563              : 
-    1564              :   /// ---- Validation Helpers ---- ///
-    1565              : 
-    1566            3 :   Future<bool> _isValidSessionTopic(String topic) async {
-    1567            6 :     if (!sessions.has(topic)) {
-    1568            3 :       throw Errors.getInternalError(
-    1569              :         Errors.NO_MATCHING_KEY,
-    1570            3 :         context: "session topic doesn't exist: $topic",
-    1571              :       );
-    1572              :     }
-    1573              : 
-    1574            9 :     if (await core.expirer.checkAndExpire(topic)) {
-    1575            3 :       throw Errors.getInternalError(
-    1576              :         Errors.EXPIRED,
-    1577            3 :         context: 'session topic: $topic',
-    1578              :       );
-    1579              :     }
-    1580              : 
-    1581              :     return true;
-    1582              :   }
-    1583              : 
-    1584            3 :   Future<bool> _isValidSessionOrPairingTopic(String topic) async {
-    1585            6 :     if (sessions.has(topic)) {
-    1586            3 :       await _isValidSessionTopic(topic);
-    1587           12 :     } else if (core.pairing.getStore().has(topic)) {
-    1588            9 :       await core.pairing.isValidPairingTopic(topic: topic);
-    1589              :     } else {
-    1590            3 :       throw Errors.getInternalError(
-    1591              :         Errors.NO_MATCHING_KEY,
-    1592            3 :         context: "session or pairing topic doesn't exist: $topic",
-    1593              :       );
-    1594              :     }
-    1595              : 
-    1596              :     return true;
-    1597              :   }
-    1598              : 
-    1599            4 :   Future<bool> _isValidProposalId(int id) async {
-    1600           12 :     if (!proposals.has(id.toString())) {
-    1601            3 :       throw Errors.getInternalError(
-    1602              :         Errors.NO_MATCHING_KEY,
-    1603            3 :         context: "proposal id doesn't exist: $id",
-    1604              :       );
-    1605              :     }
-    1606              : 
-    1607           16 :     if (await core.expirer.checkAndExpire(id.toString())) {
-    1608            3 :       throw Errors.getInternalError(
-    1609              :         Errors.EXPIRED,
-    1610            3 :         context: 'proposal id: $id',
-    1611              :       );
-    1612              :     }
-    1613              : 
-    1614              :     return true;
-    1615              :   }
-    1616              : 
-    1617            3 :   Future<bool> _isValidPendingRequest(int id) async {
-    1618            9 :     if (!pendingRequests.has(id.toString())) {
-    1619            0 :       throw Errors.getInternalError(
-    1620              :         Errors.NO_MATCHING_KEY,
-    1621            0 :         context: "proposal id doesn't exist: $id",
-    1622              :       );
-    1623              :     }
-    1624              : 
-    1625           12 :     if (await core.expirer.checkAndExpire(id.toString())) {
-    1626            0 :       throw Errors.getInternalError(
-    1627              :         Errors.EXPIRED,
-    1628            0 :         context: 'pending request id: $id',
-    1629              :       );
-    1630              :     }
-    1631              : 
-    1632              :     return true;
-    1633              :   }
-    1634              : 
-    1635              :   /// ---- Validations ---- ///
-    1636              : 
-    1637            4 :   Future<bool> _isValidConnect({
-    1638              :     Map<String, RequiredNamespace>? requiredNamespaces,
-    1639              :     Map<String, RequiredNamespace>? optionalNamespaces,
-    1640              :     Map<String, String>? sessionProperties,
-    1641              :     String? pairingTopic,
-    1642              :     List<Relay>? relays,
-    1643              :   }) async {
-    1644              :     // No need to validate sessionProperties. Strict typing enforces Strings are valid
-    1645              :     // No need to see if the relays are a valid array and whatnot. Strict typing enforces that.
-    1646              :     if (pairingTopic != null) {
-    1647           12 :       await core.pairing.isValidPairingTopic(
-    1648              :         topic: pairingTopic,
-    1649              :       );
-    1650              :     }
-    1651              : 
-    1652              :     if (requiredNamespaces != null) {
-    1653            4 :       SignApiValidatorUtils.isValidRequiredNamespaces(
-    1654              :         requiredNamespaces: requiredNamespaces,
-    1655              :         context: 'connect() check requiredNamespaces.',
-    1656              :       );
-    1657              :     }
-    1658              : 
-    1659              :     if (optionalNamespaces != null) {
-    1660            4 :       SignApiValidatorUtils.isValidRequiredNamespaces(
-    1661              :         requiredNamespaces: optionalNamespaces,
-    1662              :         context: 'connect() check optionalNamespaces.',
-    1663              :       );
-    1664              :     }
-    1665              : 
-    1666              :     return true;
-    1667              :   }
-    1668              : 
-    1669            4 :   Future<bool> _isValidApprove({
-    1670              :     required int id,
-    1671              :     required Map<String, Namespace> namespaces,
-    1672              :     Map<String, String>? sessionProperties,
-    1673              :     String? relayProtocol,
-    1674              :   }) async {
-    1675              :     // No need to validate sessionProperties. Strict typing enforces Strings are valid
-    1676            4 :     await _isValidProposalId(id);
-    1677           12 :     final ProposalData proposal = proposals.get(id.toString())!;
-    1678              : 
-    1679              :     // Validate the namespaces
-    1680            4 :     SignApiValidatorUtils.isValidNamespaces(
-    1681              :       namespaces: namespaces,
-    1682              :       context: 'approve()',
-    1683              :     );
-    1684              : 
-    1685              :     // Validate the required and optional namespaces
-    1686            4 :     SignApiValidatorUtils.isValidRequiredNamespaces(
-    1687            4 :       requiredNamespaces: proposal.requiredNamespaces,
-    1688              :       context: 'approve() check requiredNamespaces.',
-    1689              :     );
-    1690            4 :     SignApiValidatorUtils.isValidRequiredNamespaces(
-    1691            4 :       requiredNamespaces: proposal.optionalNamespaces,
-    1692              :       context: 'approve() check optionalNamespaces.',
-    1693              :     );
-    1694              : 
-    1695              :     // Make sure the provided namespaces conforms with the required
-    1696            4 :     SignApiValidatorUtils.isConformingNamespaces(
-    1697            4 :       requiredNamespaces: proposal.requiredNamespaces,
-    1698              :       namespaces: namespaces,
-    1699              :       context: 'approve()',
-    1700              :     );
-    1701              : 
-    1702              :     return true;
-    1703              :   }
-    1704              : 
-    1705            3 :   Future<bool> _isValidReject(int id, WalletConnectError reason) async {
-    1706              :     // No need to validate reason. Strict typing enforces ErrorResponse is valid
-    1707            3 :     await _isValidProposalId(id);
-    1708              :     return true;
-    1709              :   }
-    1710              : 
-    1711            4 :   Future<bool> _isValidSessionSettleRequest(
-    1712              :     Map<String, Namespace> namespaces,
-    1713              :     int expiry,
-    1714              :   ) async {
-    1715            4 :     SignApiValidatorUtils.isValidNamespaces(
-    1716              :       namespaces: namespaces,
-    1717              :       context: 'onSessionSettleRequest()',
-    1718              :     );
-    1719              : 
-    1720            4 :     if (WalletConnectUtils.isExpired(expiry)) {
-    1721            0 :       throw Errors.getInternalError(
-    1722              :         Errors.EXPIRED,
-    1723              :         context: 'onSessionSettleRequest()',
-    1724              :       );
-    1725              :     }
-    1726              : 
-    1727              :     return true;
-    1728              :   }
-    1729              : 
-    1730            3 :   Future<bool> _isValidUpdate(
-    1731              :     String topic,
-    1732              :     Map<String, Namespace> namespaces,
-    1733              :   ) async {
-    1734            3 :     await _isValidSessionTopic(topic);
-    1735            3 :     SignApiValidatorUtils.isValidNamespaces(
-    1736              :       namespaces: namespaces,
-    1737              :       context: 'update()',
-    1738              :     );
-    1739            6 :     final SessionData session = sessions.get(topic)!;
-    1740              : 
-    1741            3 :     SignApiValidatorUtils.isConformingNamespaces(
-    1742            6 :       requiredNamespaces: session.requiredNamespaces ?? {},
-    1743              :       namespaces: namespaces,
-    1744              :       context: 'update()',
-    1745              :     );
-    1746              : 
-    1747              :     return true;
-    1748              :   }
-    1749              : 
-    1750            3 :   Future<bool> _isValidRequest(
-    1751              :     String topic,
-    1752              :     String chainId,
-    1753              :     SessionRequestParams request,
-    1754              :   ) async {
-    1755            3 :     await _isValidSessionTopic(topic);
-    1756            6 :     final SessionData session = sessions.get(topic)!;
-    1757            3 :     SignApiValidatorUtils.isValidNamespacesChainId(
-    1758            3 :       namespaces: session.namespaces,
-    1759              :       chainId: chainId,
-    1760              :     );
-    1761            3 :     SignApiValidatorUtils.isValidNamespacesRequest(
-    1762            3 :       namespaces: session.namespaces,
-    1763              :       chainId: chainId,
-    1764            3 :       method: request.method,
-    1765              :     );
-    1766              : 
-    1767              :     return true;
-    1768              :   }
-    1769              : 
-    1770            3 :   Future<bool> _isValidResponse(
-    1771              :     String topic,
-    1772              :     JsonRpcResponse response,
-    1773              :   ) async {
-    1774            3 :     await _isValidSessionTopic(topic);
-    1775              : 
-    1776            6 :     if (response.result == null && response.error == null) {
-    1777            0 :       throw Errors.getInternalError(
-    1778              :         Errors.MISSING_OR_INVALID,
-    1779              :         context: 'JSON-RPC response and error cannot both be null',
-    1780              :       );
-    1781              :     }
-    1782              : 
-    1783            6 :     await _isValidPendingRequest(response.id);
-    1784              : 
-    1785              :     return true;
-    1786              :   }
-    1787              : 
-    1788            3 :   Future<bool> _isValidPing(
-    1789              :     String topic,
-    1790              :   ) async {
-    1791            3 :     await _isValidSessionOrPairingTopic(topic);
-    1792              : 
-    1793              :     return true;
-    1794              :   }
-    1795              : 
-    1796            3 :   Future<bool> _isValidEmit(
-    1797              :     String topic,
-    1798              :     SessionEventParams event,
-    1799              :     String chainId,
-    1800              :   ) async {
-    1801            3 :     await _isValidSessionTopic(topic);
-    1802            6 :     final SessionData session = sessions.get(topic)!;
-    1803            3 :     SignApiValidatorUtils.isValidNamespacesChainId(
-    1804            3 :       namespaces: session.namespaces,
-    1805              :       chainId: chainId,
-    1806              :     );
-    1807            3 :     SignApiValidatorUtils.isValidNamespacesEvent(
-    1808            3 :       namespaces: session.namespaces,
-    1809              :       chainId: chainId,
-    1810            3 :       eventName: event.name,
-    1811              :     );
-    1812              : 
-    1813              :     return true;
-    1814              :   }
-    1815              : 
-    1816            3 :   Future<bool> _isValidDisconnect(String topic) async {
-    1817            3 :     await _isValidSessionOrPairingTopic(topic);
-    1818              : 
-    1819              :     return true;
-    1820              :   }
-    1821              : 
-    1822            4 :   Future<VerifyContext> _getVerifyContext(
-    1823              :     JsonRpcRequest payload,
-    1824              :     PairingMetadata proposerMetada,
-    1825              :   ) async {
-    1826              :     try {
-    1827            8 :       final jsonStringify = jsonEncode(payload.toJson());
-    1828           16 :       final hash = core.crypto.getUtils().hashMessage(jsonStringify);
-    1829              : 
-    1830           12 :       final result = await core.verify.resolve(attestationId: hash);
-    1831            0 :       final validation = result?.origin == Uri.parse(proposerMetada.url).origin
-    1832              :           ? Validation.VALID
-    1833              :           : Validation.INVALID;
-    1834              : 
-    1835            0 :       return VerifyContext(
-    1836            0 :         origin: result?.origin ?? proposerMetada.url,
-    1837            0 :         verifyUrl: proposerMetada.verifyUrl ?? '',
-    1838            0 :         validation: result?.isScam == true ? Validation.SCAM : validation,
-    1839            0 :         isScam: result?.isScam,
-    1840              :       );
-    1841              :     } catch (e, s) {
-    1842            4 :       if (e is! AttestationNotFound) {
-    1843            0 :         core.logger.e('[$runtimeType] verify error', error: e, stackTrace: s);
-    1844              :       }
-    1845            4 :       return VerifyContext(
-    1846            4 :         origin: proposerMetada.url,
-    1847            4 :         verifyUrl: proposerMetada.verifyUrl ?? '',
-    1848              :         validation: Validation.UNKNOWN,
-    1849              :       );
-    1850              :     }
-    1851              :   }
-    1852              : 
-    1853              :   // NEW 1-CA METHOD (Should this be private?)
-    1854              : 
-    1855            0 :   @override
-    1856              :   Future<bool> validateSignedCacao({
-    1857              :     required Cacao cacao,
-    1858              :     required String projectId,
-    1859              :   }) async {
-    1860            0 :     final CacaoSignature signature = cacao.s;
-    1861            0 :     final CacaoPayload payload = cacao.p;
-    1862              : 
-    1863            0 :     final reconstructed = formatAuthMessage(
-    1864            0 :       iss: payload.iss,
-    1865            0 :       cacaoPayload: CacaoRequestPayload.fromCacaoPayload(payload),
-    1866              :     );
-    1867              : 
-    1868            0 :     final walletAddress = AddressUtils.getDidAddress(payload.iss);
-    1869            0 :     final chainId = AddressUtils.getDidChainId(payload.iss);
-    1870              : 
-    1871            0 :     final isValid = await AuthSignature.verifySignature(
-    1872              :       walletAddress,
-    1873              :       reconstructed,
-    1874              :       signature,
-    1875              :       chainId,
-    1876              :       projectId,
-    1877              :     );
-    1878              : 
-    1879              :     return isValid;
-    1880              :   }
-    1881              : 
-    1882              :   // FORMER AUTH ENGINE PROPERTY
-    1883            0 :   @override
-    1884              :   String formatAuthMessage({
-    1885              :     required String iss,
-    1886              :     required CacaoRequestPayload cacaoPayload,
-    1887              :   }) {
-    1888              :     final header =
-    1889            0 :         '${cacaoPayload.domain} wants you to sign in with your Ethereum account:';
-    1890            0 :     final walletAddress = AddressUtils.getDidAddress(iss);
-    1891              : 
-    1892            0 :     if (cacaoPayload.aud.isEmpty) {
-    1893            0 :       throw WalletConnectError(code: -1, message: 'aud is required');
-    1894              :     }
-    1895              : 
-    1896            0 :     String statement = cacaoPayload.statement ?? '';
-    1897            0 :     final uri = 'URI: ${cacaoPayload.aud}';
-    1898            0 :     final version = 'Version: ${cacaoPayload.version}';
-    1899            0 :     final chainId = 'Chain ID: ${AddressUtils.getDidChainId(iss)}';
-    1900            0 :     final nonce = 'Nonce: ${cacaoPayload.nonce}';
-    1901            0 :     final issuedAt = 'Issued At: ${cacaoPayload.iat}';
-    1902            0 :     final expirationTime = (cacaoPayload.exp != null)
-    1903            0 :         ? 'Expiration Time: ${cacaoPayload.exp}'
-    1904            0 :         : null;
-    1905              :     final notBefore =
-    1906            0 :         (cacaoPayload.nbf != null) ? 'Not Before: ${cacaoPayload.nbf}' : null;
-    1907            0 :     final requestId = (cacaoPayload.requestId != null)
-    1908            0 :         ? 'Request ID: ${cacaoPayload.requestId}'
-    1909            0 :         : null;
-    1910            0 :     final resources = cacaoPayload.resources != null &&
-    1911            0 :             cacaoPayload.resources!.isNotEmpty
-    1912            0 :         ? 'Resources:\n${cacaoPayload.resources!.map((resource) => '- $resource').join('\n')}'
-    1913            0 :         : null;
-    1914            0 :     final recap = ReCapsUtils.getRecapFromResources(
-    1915            0 :       resources: cacaoPayload.resources,
-    1916              :     );
-    1917              :     if (recap != null) {
-    1918            0 :       final decoded = ReCapsUtils.decodeRecap(recap);
-    1919            0 :       statement = ReCapsUtils.formatStatementFromRecap(
-    1920              :         statement: statement,
-    1921              :         recap: decoded,
-    1922              :       );
-    1923              :     }
-    1924              : 
-    1925            0 :     final message = [
-    1926              :       header,
-    1927              :       walletAddress,
-    1928              :       '',
-    1929              :       statement,
-    1930              :       '',
-    1931              :       uri,
-    1932              :       version,
-    1933              :       chainId,
-    1934              :       nonce,
-    1935              :       issuedAt,
-    1936              :       expirationTime,
-    1937              :       notBefore,
-    1938              :       requestId,
-    1939              :       resources,
-    1940            0 :     ].where((element) => element != null).join('\n');
-    1941              : 
-    1942              :     return message;
-    1943              :   }
-    1944              : 
-    1945              :   // FORMER AUTH ENGINE PROPERTY
-    1946            0 :   @override
-    1947              :   Map<int, StoredCacao> getCompletedRequestsForPairing({
-    1948              :     required String pairingTopic,
-    1949              :   }) {
-    1950            0 :     Map<int, StoredCacao> completedRequests = {};
-    1951            0 :     completeRequests
-    1952            0 :         .getAll()
-    1953            0 :         .where(
-    1954            0 :           (e) => e.pairingTopic == pairingTopic,
-    1955              :         )
-    1956            0 :         .forEach((key) {
-    1957            0 :       completedRequests[key.id] = key;
-    1958              :     });
-    1959              :     return completedRequests;
-    1960              :   }
-    1961              : 
-    1962              :   // FORMER AUTH ENGINE PROPERTY
-    1963            0 :   @override
-    1964              :   Map<int, PendingAuthRequest> getPendingAuthRequests() {
-    1965            0 :     Map<int, PendingAuthRequest> pendingRequests = {};
-    1966            0 :     authRequests.getAll().forEach((key) {
-    1967            0 :       pendingRequests[key.id] = key;
-    1968              :     });
-    1969              :     return pendingRequests;
-    1970              :   }
-    1971              : 
-    1972              :   // FORMER AUTH ENGINE PROPERTY
-    1973            0 :   @override
-    1974              :   Future<AuthRequestResponse> requestAuth({
-    1975              :     required AuthRequestParams params,
-    1976              :     String? pairingTopic,
-    1977              :     List<List<String>>? methods = DEFAULT_METHODS_AUTH,
-    1978              :   }) async {
-    1979            0 :     _checkInitialized();
-    1980              : 
-    1981            0 :     AuthApiValidators.isValidRequest(params);
-    1982              :     String? pTopic = pairingTopic;
-    1983              :     Uri? uri;
-    1984              : 
-    1985              :     if (pTopic == null) {
-    1986            0 :       final CreateResponse newTopicAndUri = await core.pairing.create(
-    1987              :         methods: methods,
-    1988              :       );
-    1989            0 :       pTopic = newTopicAndUri.topic;
-    1990            0 :       uri = newTopicAndUri.uri;
-    1991              :     } else {
-    1992              :       // TODO this should be used when pairingTopic is passed (existent pairing topic case)
-    1993              :       // but it does not seems right
-    1994            0 :       core.pairing.isValidPairingTopic(topic: pTopic);
-    1995              :     }
-    1996              : 
-    1997            0 :     final publicKey = await core.crypto.generateKeyPair();
-    1998              :     // print('requestAuth, publicKey: $publicKey');
-    1999            0 :     final String responseTopic = core.crypto.getUtils().hashKey(publicKey);
-    2000            0 :     final int id = JsonRpcUtils.payloadId();
-    2001              : 
-    2002            0 :     final request = WcAuthRequestRequest(
-    2003            0 :       payloadParams: AuthPayloadParams.fromRequestParams(
-    2004              :         params,
-    2005              :       ),
-    2006            0 :       requester: ConnectionMetadata(
-    2007              :         publicKey: publicKey,
-    2008            0 :         metadata: metadata,
-    2009              :       ),
-    2010              :     );
-    2011              : 
-    2012            0 :     final int expiry = params.expiry ?? WalletConnectConstants.FIVE_MINUTES;
-    2013              : 
-    2014            0 :     await authKeys.set(
-    2015              :       AuthConstants.AUTH_CLIENT_PUBLIC_KEY_NAME,
-    2016            0 :       AuthPublicKey(publicKey: publicKey),
-    2017              :     );
-    2018              : 
-    2019            0 :     await pairingTopics.set(
-    2020              :       responseTopic,
-    2021              :       pTopic,
-    2022              :     );
-    2023              : 
-    2024              :     // Set the one time use receiver public key for decoding the Type 1 envelope
-    2025            0 :     await core.pairing.setReceiverPublicKey(
-    2026              :       topic: responseTopic,
-    2027              :       publicKey: publicKey,
-    2028              :       expiry: expiry,
-    2029              :     );
-    2030              : 
-    2031            0 :     Completer<AuthResponse> completer = Completer();
-    2032              : 
-    2033            0 :     _requestAuthResponseHandler(
-    2034              :       pairingTopic: pTopic,
-    2035              :       responseTopic: responseTopic,
-    2036              :       request: request,
-    2037              :       id: id,
-    2038              :       expiry: expiry,
-    2039              :       completer: completer,
-    2040              :     );
-    2041              : 
-    2042            0 :     return AuthRequestResponse(
-    2043              :       id: id,
-    2044              :       pairingTopic: pTopic,
-    2045              :       completer: completer,
-    2046              :       uri: uri,
-    2047              :     );
-    2048              :   }
-    2049              : 
-    2050              :   // FORMER AUTH ENGINE PROPERTY
-    2051            0 :   Future<void> _requestAuthResponseHandler({
-    2052              :     required String pairingTopic,
-    2053              :     required String responseTopic,
-    2054              :     required WcAuthRequestRequest request,
-    2055              :     required int id,
-    2056              :     required int expiry,
-    2057              :     required Completer<AuthResponse> completer,
-    2058              :   }) async {
-    2059              :     // Subscribe to the responseTopic because we expect the response to use this topic
-    2060            0 :     await core.relayClient.subscribe(topic: responseTopic);
-    2061              : 
-    2062              :     late WcAuthRequestResult result;
-    2063              :     try {
-    2064            0 :       final Map<String, dynamic> response = await core.pairing.sendRequest(
-    2065              :         pairingTopic,
-    2066              :         MethodConstants.WC_AUTH_REQUEST,
-    2067            0 :         request.toJson(),
-    2068              :         id: id,
-    2069              :         ttl: expiry,
-    2070              :       );
-    2071            0 :       result = WcAuthRequestResult.fromJson({'cacao': response});
-    2072              :     } catch (error) {
-    2073            0 :       final response = AuthResponse(
-    2074              :         id: id,
-    2075              :         topic: responseTopic,
-    2076            0 :         jsonRpcError: (error is JsonRpcError) ? error : null,
-    2077            0 :         error: (error is! JsonRpcError)
-    2078            0 :             ? WalletConnectError(
-    2079            0 :                 code: -1,
-    2080            0 :                 message: error.toString(),
-    2081              :               )
-    2082              :             : null,
-    2083              :       );
-    2084            0 :       onAuthResponse.broadcast(response);
-    2085            0 :       completer.complete(response);
-    2086              :       return;
-    2087              :     }
-    2088              : 
-    2089            0 :     await core.pairing.activate(topic: pairingTopic);
-    2090              : 
-    2091            0 :     final Cacao cacao = result.cacao;
-    2092            0 :     await completeRequests.set(
-    2093            0 :       id.toString(),
-    2094            0 :       StoredCacao.fromCacao(
-    2095              :         id: id,
-    2096              :         pairingTopic: pairingTopic,
-    2097              :         cacao: cacao,
-    2098              :       ),
-    2099              :     );
-    2100              : 
-    2101            0 :     final isValid = await validateSignedCacao(
-    2102              :       cacao: cacao,
-    2103            0 :       projectId: core.projectId,
-    2104              :     );
-    2105              : 
-    2106              :     if (!isValid) {
-    2107            0 :       final resp = AuthResponse(
-    2108              :         id: id,
-    2109              :         topic: responseTopic,
-    2110              :         error: const WalletConnectError(
-    2111              :           code: -1,
-    2112              :           message: 'Invalid signature',
-    2113              :         ),
-    2114              :       );
-    2115            0 :       onAuthResponse.broadcast(resp);
-    2116            0 :       completer.complete(resp);
-    2117              :     } else {
-    2118            0 :       final resp = AuthResponse(
-    2119              :         id: id,
-    2120              :         topic: responseTopic,
-    2121              :         result: cacao,
-    2122              :       );
-    2123            0 :       onAuthResponse.broadcast(resp);
-    2124            0 :       completer.complete(resp);
-    2125              :     }
-    2126              :   }
-    2127              : 
-    2128              :   // NEW ONE-CLICK AUTH METHOD FOR DAPPS
-    2129            0 :   @override
-    2130              :   Map<int, PendingSessionAuthRequest> getPendingSessionAuthRequests() {
-    2131            0 :     Map<int, PendingSessionAuthRequest> pendingRequests = {};
-    2132            0 :     sessionAuthRequests.getAll().forEach((key) {
-    2133            0 :       pendingRequests[key.id] = key;
-    2134              :     });
-    2135              :     return pendingRequests;
-    2136              :   }
-    2137              : 
-    2138            0 :   @override
-    2139              :   Future<SessionAuthRequestResponse> authenticate({
-    2140              :     required SessionAuthRequestParams params,
-    2141              :     String? pairingTopic,
-    2142              :     List<List<String>>? methods = const [
-    2143              :       [MethodConstants.WC_SESSION_AUTHENTICATE]
-    2144              :     ],
-    2145              :   }) async {
-    2146            0 :     _checkInitialized();
-    2147              : 
-    2148            0 :     AuthApiValidators.isValidAuthenticate(params);
-    2149              : 
-    2150            0 :     final chains = params.chains;
-    2151            0 :     final resources = params.resources ?? [];
-    2152            0 :     final requestMethods = params.methods ?? [];
-    2153              : 
-    2154              :     String? pTopic = pairingTopic;
-    2155              :     Uri? connectionUri;
-    2156              : 
-    2157              :     if (pTopic == null) {
-    2158            0 :       final CreateResponse pairing = await core.pairing.create(
-    2159              :         methods: methods,
-    2160              :       );
-    2161            0 :       pTopic = pairing.topic;
-    2162            0 :       connectionUri = pairing.uri;
-    2163              :     } else {
-    2164            0 :       core.pairing.isValidPairingTopic(topic: pTopic);
-    2165              :     }
-    2166              : 
-    2167            0 :     final publicKey = await core.crypto.generateKeyPair();
-    2168            0 :     final responseTopic = core.crypto.getUtils().hashKey(publicKey);
-    2169              : 
-    2170            0 :     await Future.wait([
-    2171            0 :       authKeys.set(
-    2172              :         AuthConstants.OCAUTH_CLIENT_PUBLIC_KEY_NAME,
-    2173            0 :         AuthPublicKey(publicKey: publicKey),
-    2174              :       ),
-    2175            0 :       pairingTopics.set(responseTopic, pTopic),
-    2176              :     ]);
-    2177              : 
-    2178            0 :     if (requestMethods.isNotEmpty) {
-    2179            0 :       final namespace = NamespaceUtils.getNamespaceFromChain(chains.first);
-    2180            0 :       String recap = ReCapsUtils.createEncodedRecap(
-    2181              :         namespace,
-    2182              :         'request',
-    2183              :         requestMethods,
-    2184              :       );
-    2185            0 :       final existingRecap = ReCapsUtils.getRecapFromResources(
-    2186              :         resources: resources,
-    2187              :       );
-    2188              :       if (existingRecap != null) {
-    2189              :         // per Recaps spec, recap must occupy the last position in the resources array
-    2190              :         // using .removeLast() to remove the element given we already checked it's a recap and will replace it
-    2191            0 :         recap = ReCapsUtils.mergeEncodedRecaps(recap, resources.removeLast());
-    2192              :       }
-    2193            0 :       resources.add(recap);
-    2194              :     }
-    2195              : 
-    2196              :     // Subscribe to the responseTopic because we expect the response to use this topic
-    2197            0 :     await core.relayClient.subscribe(topic: responseTopic);
-    2198              : 
-    2199            0 :     final id = JsonRpcUtils.payloadId();
-    2200            0 :     final proposalId = JsonRpcUtils.payloadId();
-    2201              : 
-    2202              :     // Ensure the expiry is greater than the minimum required for the request - currently 1h
-    2203              :     final method = MethodConstants.WC_SESSION_AUTHENTICATE;
-    2204            0 :     final opts = MethodConstants.RPC_OPTS[method]!['req']!;
-    2205            0 :     final authRequestExpiry = max((params.expiry ?? 0), opts.ttl);
-    2206            0 :     final expiryTimestamp = DateTime.now().add(
-    2207            0 :       Duration(seconds: authRequestExpiry),
-    2208              :     );
-    2209              : 
-    2210            0 :     final request = WcSessionAuthRequestParams(
-    2211            0 :       authPayload: SessionAuthPayload.fromRequestParams(params).copyWith(
-    2212              :         resources: resources,
-    2213              :       ),
-    2214            0 :       requester: ConnectionMetadata(
-    2215              :         publicKey: publicKey,
-    2216            0 :         metadata: metadata,
-    2217              :       ),
-    2218            0 :       expiryTimestamp: expiryTimestamp.millisecondsSinceEpoch,
-    2219              :     );
-    2220              : 
-    2221              :     // Set the one time use receiver public key for decoding the Type 1 envelope
-    2222            0 :     await core.pairing.setReceiverPublicKey(
-    2223              :       topic: responseTopic,
-    2224              :       publicKey: publicKey,
-    2225              :       expiry: authRequestExpiry,
-    2226              :     );
-    2227              : 
-    2228            0 :     Completer<SessionAuthResponse> completer = Completer();
-    2229              : 
-    2230              :     // ----- build fallback session proposal request ----- //
-    2231              : 
-    2232              :     final fallbackMethod = MethodConstants.WC_SESSION_PROPOSE;
-    2233            0 :     final fallbackOpts = MethodConstants.RPC_OPTS[fallbackMethod]!['req']!;
-    2234            0 :     final fallbackExpiryTimestamp = DateTime.now().add(
-    2235            0 :       Duration(seconds: fallbackOpts.ttl),
-    2236              :     );
-    2237            0 :     final proposalData = ProposalData(
-    2238              :       id: proposalId,
-    2239            0 :       requiredNamespaces: {},
-    2240            0 :       optionalNamespaces: {
-    2241            0 :         'eip155': RequiredNamespace(
-    2242              :           chains: chains,
-    2243            0 :           methods: {'personal_sign', ...requestMethods}.toList(),
-    2244              :           events: EventsConstants.requiredEvents,
-    2245              :         ),
-    2246              :       },
-    2247            0 :       relays: [Relay(WalletConnectConstants.RELAYER_DEFAULT_PROTOCOL)],
-    2248            0 :       expiry: fallbackExpiryTimestamp.millisecondsSinceEpoch,
-    2249            0 :       proposer: ConnectionMetadata(
-    2250              :         publicKey: publicKey,
-    2251            0 :         metadata: metadata,
-    2252              :       ),
-    2253              :       pairingTopic: pTopic,
-    2254              :     );
-    2255            0 :     final proposeRequest = WcSessionProposeRequest(
-    2256            0 :       relays: proposalData.relays,
-    2257            0 :       requiredNamespaces: proposalData.requiredNamespaces,
-    2258            0 :       optionalNamespaces: proposalData.optionalNamespaces,
-    2259            0 :       proposer: proposalData.proposer,
-    2260              :     );
-    2261            0 :     await _setProposal(proposalData.id, proposalData);
-    2262              : 
-    2263            0 :     Completer<SessionData> completerFallback = Completer();
-    2264              : 
-    2265            0 :     pendingProposals.add(
-    2266            0 :       SessionProposalCompleter(
-    2267            0 :         id: proposalData.id,
-    2268            0 :         selfPublicKey: proposalData.proposer.publicKey,
-    2269            0 :         pairingTopic: proposalData.pairingTopic,
-    2270            0 :         requiredNamespaces: proposalData.requiredNamespaces,
-    2271            0 :         optionalNamespaces: proposalData.optionalNamespaces,
-    2272              :         completer: completerFallback,
-    2273              :       ),
-    2274              :     );
-    2275              : 
-    2276              :     // ------------------------------------------------------- //
-    2277              : 
-    2278              :     // Send One-Click Auth request
-    2279            0 :     _sessionAuthResponseHandler(
-    2280              :       id: id,
-    2281              :       publicKey: publicKey,
-    2282              :       pairingTopic: pTopic,
-    2283              :       responseTopic: responseTopic,
-    2284              :       request: request,
-    2285              :       expiry: authRequestExpiry,
-    2286              :       completer: completer,
-    2287              :     );
-    2288              : 
-    2289              :     // Send Session Proposal request
-    2290            0 :     _connectResponseHandler(
-    2291              :       pTopic,
-    2292              :       proposeRequest,
-    2293            0 :       proposalData.id,
-    2294              :     );
-    2295              : 
-    2296            0 :     return SessionAuthRequestResponse(
-    2297              :       id: id,
-    2298              :       pairingTopic: pTopic,
-    2299              :       completer: completer,
-    2300              :       uri: connectionUri,
-    2301              :     );
-    2302              :   }
-    2303              : 
-    2304            0 :   Future<void> _sessionAuthResponseHandler({
-    2305              :     required int id,
-    2306              :     required String publicKey,
-    2307              :     required String pairingTopic,
-    2308              :     required String responseTopic,
-    2309              :     required int expiry,
-    2310              :     required WcSessionAuthRequestParams request,
-    2311              :     required Completer<SessionAuthResponse> completer,
-    2312              :   }) async {
-    2313              :     //
-    2314              :     late WcSessionAuthRequestResult result;
-    2315              :     try {
-    2316            0 :       final Map<String, dynamic> response = await core.pairing.sendRequest(
-    2317              :         pairingTopic,
-    2318              :         MethodConstants.WC_SESSION_AUTHENTICATE,
-    2319            0 :         request.toJson(),
-    2320              :         id: id,
-    2321              :         ttl: expiry,
-    2322              :       );
-    2323            0 :       result = WcSessionAuthRequestResult.fromJson(response);
-    2324              :     } catch (error) {
-    2325            0 :       final response = SessionAuthResponse(
-    2326              :         id: id,
-    2327              :         topic: responseTopic,
-    2328            0 :         jsonRpcError: (error is JsonRpcError) ? error : null,
-    2329            0 :         error: (error is! JsonRpcError)
-    2330            0 :             ? WalletConnectError(
-    2331            0 :                 code: -1,
-    2332            0 :                 message: error.toString(),
-    2333              :               )
-    2334              :             : null,
-    2335              :       );
-    2336            0 :       onSessionAuthResponse.broadcast(response);
-    2337            0 :       completer.complete(response);
-    2338              :       return;
-    2339              :     }
-    2340              : 
-    2341            0 :     await core.pairing.activate(topic: pairingTopic);
-    2342              : 
-    2343            0 :     final List<Cacao> cacaos = result.cacaos;
-    2344            0 :     final ConnectionMetadata responder = result.responder;
-    2345              : 
-    2346              :     final approvedMethods = <String>{};
-    2347              :     final approvedAccounts = <String>{};
-    2348              : 
-    2349              :     try {
-    2350            0 :       for (final Cacao cacao in cacaos) {
-    2351            0 :         final isValid = await validateSignedCacao(
-    2352              :           cacao: cacao,
-    2353            0 :           projectId: core.projectId,
-    2354              :         );
-    2355              :         if (!isValid) {
-    2356            0 :           throw Errors.getSdkError(
-    2357              :             Errors.SIGNATURE_VERIFICATION_FAILED,
-    2358              :             context: 'Invalid signature',
-    2359              :           );
-    2360              :         }
-    2361              : 
-    2362              :         // This is used on Auth request, would it be needed on 1-CA?
-    2363              :         // await completeRequests.set(
-    2364              :         //   id.toString(),
-    2365              :         //   StoredCacao.fromCacao(
-    2366              :         //     id: id,
-    2367              :         //     pairingTopic: pairingTopic,
-    2368              :         //     cacao: cacao,
-    2369              :         //   ),
-    2370              :         // );
-    2371              : 
-    2372            0 :         final CacaoPayload payload = cacao.p;
-    2373            0 :         final chainId = AddressUtils.getDidChainId(payload.iss);
-    2374            0 :         final approvedChains = ['eip155:$chainId'];
-    2375              : 
-    2376            0 :         final recap = ReCapsUtils.getRecapFromResources(
-    2377            0 :           resources: payload.resources,
-    2378              :         );
-    2379              :         if (recap != null) {
-    2380            0 :           final methodsfromRecap = ReCapsUtils.getMethodsFromRecap(recap);
-    2381            0 :           final chainsFromRecap = ReCapsUtils.getChainsFromRecap(recap);
-    2382            0 :           approvedMethods.addAll(methodsfromRecap);
-    2383            0 :           approvedChains.addAll(chainsFromRecap);
-    2384              :         }
-    2385              : 
-    2386            0 :         final parsedAddress = AddressUtils.getDidAddress(payload.iss);
-    2387            0 :         for (var chain in approvedChains.toSet()) {
-    2388            0 :           approvedAccounts.add('$chain:$parsedAddress');
-    2389              :         }
-    2390              :       }
-    2391            0 :     } on WalletConnectError catch (e) {
-    2392            0 :       final resp = SessionAuthResponse(
-    2393              :         id: id,
-    2394              :         topic: responseTopic,
-    2395            0 :         error: WalletConnectError(
-    2396            0 :           code: e.code,
-    2397            0 :           message: e.message,
-    2398              :         ),
-    2399              :       );
-    2400            0 :       onSessionAuthResponse.broadcast(resp);
-    2401            0 :       completer.complete(resp);
-    2402              :       return;
-    2403              :     }
-    2404              : 
-    2405            0 :     final sessionTopic = await core.crypto.generateSharedKey(
-    2406              :       publicKey,
-    2407            0 :       responder.publicKey,
-    2408              :     );
-    2409              : 
-    2410              :     SessionData? session;
-    2411            0 :     if (approvedMethods.isNotEmpty) {
-    2412            0 :       session = SessionData(
-    2413              :         topic: sessionTopic,
-    2414              :         acknowledged: true,
-    2415            0 :         self: ConnectionMetadata(
-    2416              :           publicKey: publicKey,
-    2417            0 :           metadata: metadata,
-    2418              :         ),
-    2419              :         peer: responder,
-    2420              :         controller: publicKey,
-    2421            0 :         expiry: WalletConnectUtils.calculateExpiry(
-    2422              :           WalletConnectConstants.SEVEN_DAYS,
-    2423              :         ),
-    2424            0 :         relay: Relay(WalletConnectConstants.RELAYER_DEFAULT_PROTOCOL),
-    2425              :         pairingTopic: pairingTopic,
-    2426            0 :         namespaces: NamespaceUtils.buildNamespacesFromAuth(
-    2427              :           accounts: approvedAccounts,
-    2428              :           methods: approvedMethods,
-    2429              :         ),
-    2430              :       );
-    2431              : 
-    2432            0 :       await core.relayClient.subscribe(topic: sessionTopic);
-    2433            0 :       await sessions.set(sessionTopic, session);
-    2434              : 
-    2435            0 :       await core.pairing.updateMetadata(
-    2436              :         topic: pairingTopic,
-    2437            0 :         metadata: responder.metadata,
-    2438              :       );
-    2439              : 
-    2440            0 :       session = sessions.get(sessionTopic);
-    2441              :     }
-    2442              : 
-    2443            0 :     final resp = SessionAuthResponse(
-    2444              :       id: id,
-    2445              :       topic: responseTopic,
-    2446              :       auths: cacaos,
-    2447              :       session: session,
-    2448              :     );
-    2449            0 :     onSessionAuthResponse.broadcast(resp);
-    2450            0 :     completer.complete(resp);
-    2451              :   }
-    2452              : 
-    2453              :   // FORMER AUTH ENGINE PROPERTY
-    2454            0 :   @override
-    2455              :   Future<void> respondAuthRequest({
-    2456              :     required int id,
-    2457              :     required String iss,
-    2458              :     CacaoSignature? signature,
-    2459              :     WalletConnectError? error,
-    2460              :   }) async {
-    2461            0 :     _checkInitialized();
-    2462              : 
-    2463            0 :     Map<int, PendingAuthRequest> pendingRequests = getPendingAuthRequests();
-    2464            0 :     AuthApiValidators.isValidRespond(
-    2465              :       id: id,
-    2466              :       pendingRequests: pendingRequests,
-    2467              :       signature: signature,
-    2468              :       error: error,
-    2469              :     );
-    2470              : 
-    2471            0 :     final PendingAuthRequest pendingRequest = pendingRequests[id]!;
-    2472            0 :     final String receiverPublicKey = pendingRequest.metadata.publicKey;
-    2473            0 :     final String senderPublicKey = await core.crypto.generateKeyPair();
-    2474            0 :     final String responseTopic = core.crypto.getUtils().hashKey(
-    2475              :           receiverPublicKey,
-    2476              :         );
-    2477            0 :     final EncodeOptions encodeOpts = EncodeOptions(
-    2478              :       type: EncodeOptions.TYPE_1,
-    2479              :       receiverPublicKey: receiverPublicKey,
-    2480              :       senderPublicKey: senderPublicKey,
-    2481              :     );
-    2482              : 
-    2483              :     if (error != null) {
-    2484            0 :       await core.pairing.sendError(
-    2485              :         id,
-    2486              :         responseTopic,
-    2487              :         MethodConstants.WC_AUTH_REQUEST,
-    2488            0 :         JsonRpcError.serverError(error.message),
-    2489              :         encodeOptions: encodeOpts,
-    2490              :       );
-    2491              :     } else {
-    2492            0 :       final Cacao cacao = Cacao(
-    2493              :         h: const CacaoHeader(),
-    2494            0 :         p: CacaoPayload.fromRequestPayload(
-    2495              :           issuer: iss,
-    2496            0 :           payload: pendingRequest.cacaoPayload,
-    2497              :         ),
-    2498              :         s: signature!,
-    2499              :       );
-    2500              : 
-    2501              :       // print('auth res id: $id');
-    2502            0 :       await core.pairing.sendResult(
-    2503              :         id,
-    2504              :         responseTopic,
-    2505              :         MethodConstants.WC_AUTH_REQUEST,
-    2506            0 :         cacao.toJson(),
-    2507              :         encodeOptions: encodeOpts,
-    2508              :       );
-    2509              : 
-    2510            0 :       await authRequests.delete(id.toString());
-    2511              : 
-    2512            0 :       await completeRequests.set(
-    2513            0 :         id.toString(),
-    2514            0 :         StoredCacao.fromCacao(
-    2515              :           id: id,
-    2516            0 :           pairingTopic: pendingRequest.pairingTopic,
-    2517              :           cacao: cacao,
-    2518              :         ),
-    2519              :       );
-    2520              :     }
-    2521              :   }
-    2522              : 
-    2523            0 :   @override
-    2524              :   Future<ApproveResponse> approveSessionAuthenticate({
-    2525              :     required int id,
-    2526              :     List<Cacao>? auths,
-    2527              :   }) async {
-    2528            0 :     _checkInitialized();
-    2529              : 
-    2530            0 :     final pendingRequests = getPendingSessionAuthRequests();
-    2531              : 
-    2532            0 :     AuthApiValidators.isValidRespondAuthenticate(
-    2533              :       id: id,
-    2534              :       pendingRequests: pendingRequests,
-    2535              :       auths: auths,
-    2536              :     );
-    2537              : 
-    2538            0 :     final PendingSessionAuthRequest pendingRequest = pendingRequests[id]!;
-    2539            0 :     final receiverPublicKey = pendingRequest.requester.publicKey;
-    2540            0 :     final senderPublicKey = await core.crypto.generateKeyPair();
-    2541            0 :     final responseTopic = core.crypto.getUtils().hashKey(receiverPublicKey);
-    2542              : 
-    2543            0 :     final encodeOpts = EncodeOptions(
-    2544              :       type: EncodeOptions.TYPE_1,
-    2545              :       receiverPublicKey: receiverPublicKey,
-    2546              :       senderPublicKey: senderPublicKey,
-    2547              :     );
-    2548              : 
-    2549              :     final approvedMethods = <String>{};
-    2550              :     final approvedAccounts = <String>{};
-    2551            0 :     for (final Cacao cacao in auths!) {
-    2552            0 :       final isValid = await validateSignedCacao(
-    2553              :         cacao: cacao,
-    2554            0 :         projectId: core.projectId,
-    2555              :       );
-    2556              :       if (!isValid) {
-    2557            0 :         final error = Errors.getSdkError(
-    2558              :           Errors.SIGNATURE_VERIFICATION_FAILED,
-    2559              :           context: 'Signature verification failed',
-    2560              :         );
-    2561            0 :         await core.pairing.sendError(
-    2562              :           id,
-    2563              :           responseTopic,
-    2564              :           MethodConstants.WC_SESSION_AUTHENTICATE,
-    2565            0 :           JsonRpcError(code: error.code, message: error.message),
-    2566              :           encodeOptions: encodeOpts,
-    2567              :         );
-    2568              :         throw error;
-    2569              :       }
-    2570              : 
-    2571            0 :       final CacaoPayload payload = cacao.p;
-    2572            0 :       final chainId = AddressUtils.getDidChainId(payload.iss);
-    2573            0 :       final approvedChains = ['eip155:$chainId'];
-    2574              : 
-    2575            0 :       final recap = ReCapsUtils.getRecapFromResources(
-    2576            0 :         resources: payload.resources,
-    2577              :       );
-    2578              :       if (recap != null) {
-    2579            0 :         final methodsfromRecap = ReCapsUtils.getMethodsFromRecap(recap);
-    2580            0 :         final chainsFromRecap = ReCapsUtils.getChainsFromRecap(recap);
-    2581            0 :         approvedMethods.addAll(methodsfromRecap);
-    2582            0 :         approvedChains.addAll(chainsFromRecap);
-    2583              :       }
-    2584              : 
-    2585            0 :       final parsedAddress = AddressUtils.getDidAddress(payload.iss);
-    2586            0 :       for (var chain in approvedChains.toSet()) {
-    2587            0 :         approvedAccounts.add('$chain:$parsedAddress');
-    2588              :       }
-    2589              :     }
-    2590              : 
-    2591            0 :     final sessionTopic = await core.crypto.generateSharedKey(
-    2592              :       senderPublicKey,
-    2593              :       receiverPublicKey,
-    2594              :     );
-    2595              : 
-    2596              :     SessionData? session;
-    2597            0 :     if (approvedMethods.isNotEmpty) {
-    2598            0 :       session = SessionData(
-    2599              :         topic: sessionTopic,
-    2600              :         acknowledged: true,
-    2601            0 :         self: ConnectionMetadata(
-    2602              :           publicKey: senderPublicKey,
-    2603            0 :           metadata: metadata,
-    2604              :         ),
-    2605            0 :         peer: pendingRequest.requester,
-    2606              :         controller: receiverPublicKey,
-    2607            0 :         expiry: WalletConnectUtils.calculateExpiry(
-    2608              :           WalletConnectConstants.SEVEN_DAYS,
-    2609              :         ),
-    2610            0 :         relay: Relay(WalletConnectConstants.RELAYER_DEFAULT_PROTOCOL),
-    2611            0 :         pairingTopic: pendingRequest.pairingTopic,
-    2612            0 :         namespaces: NamespaceUtils.buildNamespacesFromAuth(
-    2613              :           accounts: approvedAccounts,
-    2614              :           methods: approvedMethods,
-    2615              :         ),
-    2616              :       );
-    2617              : 
-    2618            0 :       await core.relayClient.subscribe(topic: sessionTopic);
-    2619            0 :       await sessions.set(sessionTopic, session);
-    2620              : 
-    2621            0 :       session = sessions.get(sessionTopic);
-    2622              :     }
-    2623              : 
-    2624            0 :     final result = WcSessionAuthRequestResult(
-    2625              :       cacaos: auths,
-    2626            0 :       responder: ConnectionMetadata(
-    2627              :         publicKey: senderPublicKey,
-    2628            0 :         metadata: metadata,
-    2629              :       ),
-    2630              :     );
-    2631            0 :     await core.pairing.sendResult(
-    2632              :       id,
-    2633              :       responseTopic,
-    2634              :       MethodConstants.WC_SESSION_AUTHENTICATE,
-    2635            0 :       result.toJson(),
-    2636              :       encodeOptions: encodeOpts,
-    2637              :     );
-    2638              : 
-    2639            0 :     await sessionAuthRequests.delete(id.toString());
-    2640            0 :     await core.pairing.activate(topic: pendingRequest.pairingTopic);
-    2641            0 :     await core.pairing.updateMetadata(
-    2642            0 :       topic: pendingRequest.pairingTopic,
-    2643            0 :       metadata: pendingRequest.requester.metadata,
-    2644              :     );
-    2645              : 
-    2646            0 :     return ApproveResponse(
-    2647              :       topic: sessionTopic,
-    2648              :       session: session,
-    2649              :     );
-    2650              :   }
-    2651              : 
-    2652            0 :   @override
-    2653              :   Future<void> rejectSessionAuthenticate({
-    2654              :     required int id,
-    2655              :     required WalletConnectError reason,
-    2656              :   }) async {
-    2657            0 :     _checkInitialized();
-    2658              : 
-    2659            0 :     final pendingRequests = getPendingSessionAuthRequests();
-    2660              : 
-    2661            0 :     if (!pendingRequests.containsKey(id)) {
-    2662            0 :       throw Errors.getInternalError(
-    2663              :         Errors.MISSING_OR_INVALID,
-    2664              :         context:
-    2665            0 :             'rejectSessionAuthenticate() Could not find pending auth request with id $id',
-    2666              :       );
-    2667              :     }
-    2668              : 
-    2669            0 :     final PendingSessionAuthRequest pendingRequest = pendingRequests[id]!;
-    2670            0 :     final receiverPublicKey = pendingRequest.requester.publicKey;
-    2671            0 :     final senderPublicKey = await core.crypto.generateKeyPair();
-    2672            0 :     final responseTopic = core.crypto.getUtils().hashKey(receiverPublicKey);
-    2673              : 
-    2674            0 :     final encodeOpts = EncodeOptions(
-    2675              :       type: EncodeOptions.TYPE_1,
-    2676              :       receiverPublicKey: receiverPublicKey,
-    2677              :       senderPublicKey: senderPublicKey,
-    2678              :     );
-    2679              : 
-    2680              :     final method = MethodConstants.WC_SESSION_AUTHENTICATE;
-    2681            0 :     final rpcOpts = MethodConstants.RPC_OPTS[method];
-    2682            0 :     await core.pairing.sendError(
-    2683              :       id,
-    2684              :       responseTopic,
-    2685              :       method,
-    2686            0 :       JsonRpcError(code: reason.code, message: reason.message),
-    2687              :       encodeOptions: encodeOpts,
-    2688            0 :       rpcOptions: rpcOpts?['reject'],
-    2689              :     );
-    2690              : 
-    2691            0 :     await sessionAuthRequests.delete(id.toString());
-    2692            0 :     await _deleteProposal(id);
-    2693              :   }
-    2694              : 
-    2695              :   // FORMER AUTH ENGINE PROPERTY
-    2696            0 :   void _onAuthRequest(String topic, JsonRpcRequest payload) async {
-    2697              :     try {
-    2698            0 :       final request = WcAuthRequestRequest.fromJson(payload.params);
-    2699              : 
-    2700              :       final CacaoRequestPayload cacaoPayload =
-    2701            0 :           CacaoRequestPayload.fromPayloadParams(
-    2702            0 :         request.payloadParams,
-    2703              :       );
-    2704              : 
-    2705            0 :       authRequests.set(
-    2706            0 :         payload.id.toString(),
-    2707            0 :         PendingAuthRequest(
-    2708            0 :           id: payload.id,
-    2709              :           pairingTopic: topic,
-    2710            0 :           metadata: request.requester,
-    2711              :           cacaoPayload: cacaoPayload,
-    2712              :         ),
-    2713              :       );
-    2714              : 
-    2715            0 :       onAuthRequest.broadcast(
-    2716            0 :         AuthRequest(
-    2717            0 :           id: payload.id,
-    2718              :           topic: topic,
-    2719            0 :           requester: request.requester,
-    2720            0 :           payloadParams: request.payloadParams,
-    2721              :         ),
-    2722              :       );
-    2723            0 :     } on WalletConnectError catch (err) {
-    2724            0 :       await core.pairing.sendError(
-    2725            0 :         payload.id,
-    2726              :         topic,
-    2727            0 :         payload.method,
-    2728            0 :         JsonRpcError.invalidParams(
-    2729            0 :           err.message,
-    2730              :         ),
-    2731              :       );
-    2732              :     }
-    2733              :   }
-    2734              : 
-    2735            0 :   void _onSessionAuthRequest(String topic, JsonRpcRequest payload) async {
-    2736            0 :     core.logger.t('_onSessionAuthRequest, topic: $topic, payload: $payload');
-    2737              : 
-    2738            0 :     final sessionAuthRequest = WcSessionAuthRequestParams.fromJson(
-    2739            0 :       payload.params,
-    2740              :     );
-    2741              :     try {
-    2742            0 :       final cacaoPayload = CacaoRequestPayload.fromSessionAuthPayload(
-    2743            0 :         sessionAuthRequest.authPayload,
-    2744              :       );
-    2745              : 
-    2746            0 :       final verifyContext = await _getVerifyContext(payload, metadata);
-    2747              : 
-    2748            0 :       sessionAuthRequests.set(
-    2749            0 :         payload.id.toString(),
-    2750            0 :         PendingSessionAuthRequest(
-    2751            0 :           id: payload.id,
-    2752              :           pairingTopic: topic,
-    2753            0 :           requester: sessionAuthRequest.requester,
-    2754              :           authPayload: cacaoPayload,
-    2755            0 :           expiryTimestamp: sessionAuthRequest.expiryTimestamp,
-    2756              :           verifyContext: verifyContext,
-    2757              :         ),
-    2758              :       );
-    2759              : 
-    2760            0 :       onSessionAuthRequest.broadcast(
-    2761            0 :         SessionAuthRequest(
-    2762            0 :           id: payload.id,
-    2763              :           topic: topic,
-    2764            0 :           requester: sessionAuthRequest.requester,
-    2765            0 :           authPayload: sessionAuthRequest.authPayload,
-    2766              :           verifyContext: verifyContext,
-    2767              :         ),
-    2768              :       );
-    2769            0 :     } on WalletConnectError catch (err) {
-    2770            0 :       final receiverPublicKey = sessionAuthRequest.requester.publicKey;
-    2771            0 :       final senderPublicKey = await core.crypto.generateKeyPair();
-    2772              : 
-    2773            0 :       final encodeOpts = EncodeOptions(
-    2774              :         type: EncodeOptions.TYPE_1,
-    2775              :         receiverPublicKey: receiverPublicKey,
-    2776              :         senderPublicKey: senderPublicKey,
-    2777              :       );
-    2778            0 :       final rpcOpts = MethodConstants.RPC_OPTS[payload.method];
-    2779            0 :       await core.pairing.sendError(
-    2780            0 :         payload.id,
-    2781              :         topic,
-    2782            0 :         payload.method,
-    2783            0 :         JsonRpcError.invalidParams(err.message),
-    2784              :         encodeOptions: encodeOpts,
-    2785            0 :         rpcOptions: rpcOpts?['autoReject'],
-    2786              :       );
-    2787              :     }
-    2788              :   }
-    2789              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/auth/address_utils.dart.func-c.html b/coverage/html/sign_api/utils/auth/address_utils.dart.func-c.html deleted file mode 100644 index ab48e819..00000000 --- a/coverage/html/sign_api/utils/auth/address_utils.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/auth/address_utils.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils/auth - address_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:66.7 %64
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/auth/address_utils.dart.func.html b/coverage/html/sign_api/utils/auth/address_utils.dart.func.html deleted file mode 100644 index 1e89e6e2..00000000 --- a/coverage/html/sign_api/utils/auth/address_utils.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/auth/address_utils.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils/auth - address_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:66.7 %64
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/auth/address_utils.dart.gcov.html b/coverage/html/sign_api/utils/auth/address_utils.dart.gcov.html deleted file mode 100644 index c5e4f729..00000000 --- a/coverage/html/sign_api/utils/auth/address_utils.dart.gcov.html +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/auth/address_utils.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils/auth - address_utils.dartCoverageTotalHit
Test:lcov.infoLines:66.7 %64
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : class AddressUtils {
-       2            3 :   static String getDidAddress(String iss) {
-       3            6 :     return iss.split(':').last;
-       4              :   }
-       5              : 
-       6            3 :   static String getDidChainId(String iss) {
-       7            6 :     return iss.split(':')[3];
-       8              :   }
-       9              : 
-      10            0 :   static String getNamespaceDidChainId(String iss) {
-      11            0 :     return iss.substring(iss.indexOf(RegExp(r':')) + 1);
-      12              :   }
-      13              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/auth/auth_api_validators.dart.func-c.html b/coverage/html/sign_api/utils/auth/auth_api_validators.dart.func-c.html deleted file mode 100644 index 63277826..00000000 --- a/coverage/html/sign_api/utils/auth/auth_api_validators.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/auth/auth_api_validators.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils/auth - auth_api_validators.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:45.5 %4420
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/auth/auth_api_validators.dart.func.html b/coverage/html/sign_api/utils/auth/auth_api_validators.dart.func.html deleted file mode 100644 index b3c2eaff..00000000 --- a/coverage/html/sign_api/utils/auth/auth_api_validators.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/auth/auth_api_validators.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils/auth - auth_api_validators.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:45.5 %4420
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/auth/auth_api_validators.dart.gcov.html b/coverage/html/sign_api/utils/auth/auth_api_validators.dart.gcov.html deleted file mode 100644 index 486eb5bb..00000000 --- a/coverage/html/sign_api/utils/auth/auth_api_validators.dart.gcov.html +++ /dev/null @@ -1,218 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/auth/auth_api_validators.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils/auth - auth_api_validators.dartCoverageTotalHit
Test:lcov.infoLines:45.5 %4420
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/auth/auth_constants.dart';
-       2              : import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart';
-       3              : 
-       4              : class AuthApiValidators {
-       5            1 :   static bool isValidRequestExpiry(int expiry) {
-       6            1 :     return AuthConstants.AUTH_REQUEST_EXPIRY_MIN <= expiry &&
-       7            1 :         expiry <= AuthConstants.AUTH_REQUEST_EXPIRY_MAX;
-       8              :   }
-       9              : 
-      10            3 :   static bool isValidRequest(AuthRequestParams params) {
-      11            6 :     if (!NamespaceUtils.isValidUrl(params.aud)) {
-      12            2 :       throw Errors.getInternalError(
-      13              :         Errors.MISSING_OR_INVALID,
-      14              :         context:
-      15            4 :             'requestAuth() invalid aud: ${params.aud}. Must be a valid url.',
-      16              :       );
-      17              :     }
-      18              : 
-      19            6 :     if (params.nonce.isEmpty) {
-      20            1 :       throw Errors.getInternalError(
-      21              :         Errors.MISSING_OR_INVALID,
-      22              :         context: 'requestAuth() nonce must be nonempty.',
-      23              :       );
-      24              :     }
-      25              : 
-      26              :     // params.type == null || params.type == CacaoHeader.EIP4361
-      27            9 :     if (params.type != null && params.type != CacaoHeader.EIP4361) {
-      28            1 :       throw Errors.getInternalError(
-      29              :         Errors.MISSING_OR_INVALID,
-      30              :         context: 'requestAuth() type must null or ${CacaoHeader.EIP4361}.',
-      31              :       );
-      32              :     }
-      33              : 
-      34            3 :     final expiry = params.expiry;
-      35            1 :     if (expiry != null && !isValidRequestExpiry(expiry)) {
-      36            1 :       throw Errors.getInternalError(
-      37              :         Errors.MISSING_OR_INVALID,
-      38              :         context:
-      39            1 :             'requestAuth() expiry: $expiry. Expiry must be a number (in seconds) between ${AuthConstants.AUTH_REQUEST_EXPIRY_MIN} and ${AuthConstants.AUTH_REQUEST_EXPIRY_MAX}',
-      40              :       );
-      41              :     }
-      42              : 
-      43              :     return true;
-      44              :   }
-      45              : 
-      46            3 :   static bool isValidRespond({
-      47              :     required int id,
-      48              :     required Map<int, PendingAuthRequest> pendingRequests,
-      49              :     CacaoSignature? signature,
-      50              :     WalletConnectError? error,
-      51              :   }) {
-      52            3 :     if (!pendingRequests.containsKey(id)) {
-      53            2 :       throw Errors.getInternalError(
-      54              :         Errors.MISSING_OR_INVALID,
-      55            2 :         context: 'respondAuth() invalid id: $id. No pending request found.',
-      56              :       );
-      57              :     }
-      58              : 
-      59              :     if (signature == null && error == null) {
-      60            1 :       throw Errors.getInternalError(
-      61              :         Errors.MISSING_OR_INVALID,
-      62              :         context:
-      63              :             'respondAuth() invalid response. Must contain either signature or error.',
-      64              :       );
-      65              :     }
-      66              : 
-      67              :     return true;
-      68              :   }
-      69              : 
-      70            0 :   static bool isValidAuthenticate(SessionAuthRequestParams params) {
-      71            0 :     if (params.chains.isEmpty) {
-      72            0 :       throw Errors.getInternalError(
-      73              :         Errors.MISSING_OR_INVALID,
-      74              :         context: 'authenticate() invalid chains: Must not be emtpy.',
-      75              :       );
-      76              :     }
-      77              : 
-      78            0 :     if (!NamespaceUtils.isValidUrl(params.uri)) {
-      79            0 :       throw Errors.getInternalError(
-      80              :         Errors.MISSING_OR_INVALID,
-      81              :         context:
-      82            0 :             'authenticate() invalid uri: ${params.uri}. Must be a valid url.',
-      83              :       );
-      84              :     }
-      85              : 
-      86            0 :     if (params.nonce.isEmpty) {
-      87            0 :       throw Errors.getInternalError(
-      88              :         Errors.MISSING_OR_INVALID,
-      89              :         context: 'authenticate() nonce must be nonempty.',
-      90              :       );
-      91              :     }
-      92              : 
-      93            0 :     if (params.type != null && params.type!.t != CacaoHeader.EIP4361) {
-      94            0 :       throw Errors.getInternalError(
-      95              :         Errors.MISSING_OR_INVALID,
-      96              :         context: 'authenticate() type must null or ${CacaoHeader.EIP4361}.',
-      97              :       );
-      98              :     }
-      99              : 
-     100            0 :     final uniqueNamespaces = params.chains.map((chain) {
-     101            0 :       return NamespaceUtils.getNamespaceFromChain(chain);
-     102            0 :     }).toSet();
-     103            0 :     if (uniqueNamespaces.length > 1) {
-     104            0 :       throw Errors.getInternalError(
-     105              :         Errors.NON_CONFORMING_NAMESPACES,
-     106              :         context:
-     107              :             'authenticate() Multi-namespace requests are not supported. Please request single namespace only.',
-     108              :       );
-     109              :     }
-     110              : 
-     111            0 :     final namespace = NamespaceUtils.getNamespaceFromChain(params.chains.first);
-     112            0 :     if (namespace != 'eip155') {
-     113            0 :       throw Errors.getInternalError(
-     114              :         Errors.NON_CONFORMING_NAMESPACES,
-     115              :         context:
-     116              :             'authenticate() Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.',
-     117              :       );
-     118              :     }
-     119              : 
-     120              :     return true;
-     121              :   }
-     122              : 
-     123            0 :   static bool isValidRespondAuthenticate({
-     124              :     required int id,
-     125              :     required Map<int, PendingSessionAuthRequest> pendingRequests,
-     126              :     List<Cacao>? auths,
-     127              :   }) {
-     128            0 :     if (!pendingRequests.containsKey(id)) {
-     129            0 :       throw Errors.getInternalError(
-     130              :         Errors.MISSING_OR_INVALID,
-     131              :         context:
-     132            0 :             'approveSessionAuthenticate() Could not find pending auth request with id $id',
-     133              :       );
-     134              :     }
-     135              : 
-     136            0 :     if (auths == null || auths.isEmpty) {
-     137            0 :       throw Errors.getInternalError(
-     138              :         Errors.MISSING_OR_INVALID,
-     139              :         context:
-     140              :             'approveSessionAuthenticate() invalid response. Must contain Cacao signatures.',
-     141              :       );
-     142              :     }
-     143              : 
-     144              :     return true;
-     145              :   }
-     146              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/auth/auth_signature.dart.func-c.html b/coverage/html/sign_api/utils/auth/auth_signature.dart.func-c.html deleted file mode 100644 index cafb4812..00000000 --- a/coverage/html/sign_api/utils/auth/auth_signature.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/auth/auth_signature.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils/auth - auth_signature.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:44.4 %9944
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/auth/auth_signature.dart.func.html b/coverage/html/sign_api/utils/auth/auth_signature.dart.func.html deleted file mode 100644 index 01e3c1fe..00000000 --- a/coverage/html/sign_api/utils/auth/auth_signature.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/auth/auth_signature.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils/auth - auth_signature.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:44.4 %9944
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/auth/auth_signature.dart.gcov.html b/coverage/html/sign_api/utils/auth/auth_signature.dart.gcov.html deleted file mode 100644 index eef1f8b8..00000000 --- a/coverage/html/sign_api/utils/auth/auth_signature.dart.gcov.html +++ /dev/null @@ -1,375 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/auth/auth_signature.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils/auth - auth_signature.dartCoverageTotalHit
Test:lcov.infoLines:44.4 %9944
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:convert';
-       2              : import 'dart:typed_data';
-       3              : import 'package:convert/convert.dart';
-       4              : import 'package:http/http.dart' as http;
-       5              : 
-       6              : import 'package:pointycastle/digests/keccak.dart';
-       7              : import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/json_rpc_utils.dart';
-       8              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
-       9              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/common_auth_models.dart';
-      10              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/auth/session_auth_models.dart';
-      11              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/auth/auth_constants.dart';
-      12              : import 'package:walletconnect_flutter_v2/apis/sign_api/utils/auth/recaps_utils.dart';
-      13              : import 'package:web3dart/crypto.dart' as crypto;
-      14              : 
-      15              : class AuthSignature {
-      16            9 :   static final KeccakDigest keccakDigest = KeccakDigest(256);
-      17            3 :   static Uint8List keccak256(Uint8List input) {
-      18            6 :     keccakDigest.reset();
-      19            6 :     return keccakDigest.process(input);
-      20              :   }
-      21              : 
-      22            3 :   static Uint8List hashMessage(String message) {
-      23            3 :     return keccak256(
-      24            3 :       Uint8List.fromList(
-      25            3 :         utf8.encode(
-      26            3 :           [
-      27              :             '\x19Ethereum Signed Message:\n',
-      28            6 :             message.length.toString(),
-      29              :             message,
-      30            3 :           ].join(),
-      31              :         ),
-      32              :       ),
-      33              :     );
-      34              :   }
-      35              : 
-      36            3 :   static int getNormalizedV(int v) {
-      37            6 :     if (v == 0 || v == 27) {
-      38              :       return 27;
-      39              :     }
-      40            6 :     if (v == 1 || v == 28) {
-      41              :       return 28;
-      42              :     }
-      43            0 :     return v & 1 == 1 ? 27 : 28;
-      44              :   }
-      45              : 
-      46            3 :   static bool isValidEip191Signature(
-      47              :     String address,
-      48              :     String message,
-      49              :     String sig,
-      50              :   ) {
-      51              :     // Get the sig bytes
-      52              :     // print(sig);
-      53            3 :     final sigBytes = Uint8List.fromList(
-      54            6 :       hex.decode(sig.substring(2)),
-      55              :     );
-      56              : 
-      57              :     // If the sig bytes aren't 65 bytes long, throw an error
-      58            6 :     if (sigBytes.length != 65) {
-      59            0 :       throw Exception('Invalid signature length');
-      60              :     }
-      61              : 
-      62              :     // Get the r and s values from the sig bytes
-      63            3 :     final r = BigInt.parse(
-      64            6 :       hex.encode(sigBytes.sublist(0, 32)),
-      65              :       radix: 16,
-      66              :     );
-      67            3 :     final s = BigInt.parse(
-      68            6 :       hex.encode(sigBytes.sublist(32, 64)),
-      69              :       radix: 16,
-      70              :     );
-      71              :     // print(sigBytes[64]);
-      72            6 :     final v = getNormalizedV(sigBytes[64]);
-      73              :     // print(r);
-      74              :     // print(s);
-      75              :     // print(v);
-      76              : 
-      77              :     // // Recover the public key from the signature
-      78              :     // Uint8List? publicKeyBytes = AuthSecp256k1.recoverPublicKeyFromSignature(
-      79              :     //   v - 27,
-      80              :     //   r,
-      81              :     //   s,
-      82              :     //   hashMessage(message),
-      83              :     // );
-      84              : 
-      85              :     // // If the public key is null, return false
-      86              :     // if (publicKeyBytes == null) {
-      87              :     //   print('Could not derive publicKey');
-      88              :     //   return false;
-      89              :     // }
-      90              : 
-      91              :     // Convert the public key to an address
-      92            3 :     final publicKeyBytes = crypto.ecRecover(
-      93            3 :       hashMessage(message),
-      94            3 :       crypto.MsgSignature(r, s, v),
-      95              :     );
-      96              :     // print(hex.encode(publicKeyBytes));
-      97            3 :     final hashedPubKeyBytes = keccak256(publicKeyBytes);
-      98            3 :     final addressBytes = hashedPubKeyBytes.sublist(12, 32);
-      99            6 :     final recoveredAddress = '0x${hex.encode(addressBytes)}';
-     100              : 
-     101              :     // final String recoveredAddress = EthSigUtil.recoverSignature(
-     102              :     //   signature: sig,
-     103              :     //   message: hashMessage(message),
-     104              :     //   //  Uint8List.fromList(
-     105              :     //   //   ascii.encode(message),
-     106              :     //   // ),
-     107              :     // );
-     108              : 
-     109              :     // print(recoveredAddress.toLowerCase());
-     110              :     // print(address.toLowerCase());
-     111              : 
-     112            9 :     return recoveredAddress.toLowerCase() == address.toLowerCase();
-     113              :   }
-     114              : 
-     115            0 :   static Future<bool> isValidEip1271Signature(
-     116              :     String address,
-     117              :     String reconstructedMessage,
-     118              :     String cacaoSignature,
-     119              :     String chainId,
-     120              :     String projectId,
-     121              :   ) async {
-     122              :     try {
-     123              :       const String eip1271MagicValue = '0x1626ba7e';
-     124              :       const String dynamicTypeOffset =
-     125              :           '0000000000000000000000000000000000000000000000000000000000000040';
-     126              :       const String dynamicTypeLength =
-     127              :           '0000000000000000000000000000000000000000000000000000000000000041';
-     128            0 :       final String nonPrefixedSignature = cacaoSignature.substring(2);
-     129              :       final String nonPrefixedHashedMessage =
-     130            0 :           hex.encode(hashMessage(reconstructedMessage)).substring(2);
-     131              : 
-     132            0 :       final String data = eip1271MagicValue +
-     133            0 :           nonPrefixedHashedMessage +
-     134            0 :           dynamicTypeOffset +
-     135            0 :           dynamicTypeLength +
-     136              :           nonPrefixedSignature;
-     137              : 
-     138            0 :       final Uri url = Uri.parse(
-     139            0 :         '${AuthConstants.AUTH_DEFAULT_URL}/?chainId=$chainId&projectId=$projectId',
-     140              :       );
-     141            0 :       final Map<String, dynamic> body = JsonRpcUtils.formatJsonRpcRequest(
-     142              :         'eth_call',
-     143            0 :         {
-     144              :           'to': address,
-     145              :           'data': data,
-     146              :         },
-     147              :       );
-     148              : 
-     149            0 :       final http.Response response = await http.post(
-     150              :         url,
-     151              :         body: body,
-     152              :       );
-     153              : 
-     154              :       // print(response.body);
-     155              :       // final jsonBody = jsonDecode(response.body);
-     156              :       final String recoveredValue =
-     157            0 :           response.body.substring(0, eip1271MagicValue.length);
-     158            0 :       return recoveredValue.toLowerCase() == eip1271MagicValue.toLowerCase();
-     159              :     } catch (e) {
-     160              :       return false;
-     161              :     }
-     162              :   }
-     163              : 
-     164              :   // verifies CACAO signature
-     165              :   // Used by the wallet after formatting the message
-     166            3 :   static Future<bool> verifySignature(
-     167              :     String address,
-     168              :     String reconstructedMessage,
-     169              :     CacaoSignature cacaoSignature,
-     170              :     String chainId,
-     171              :     String projectId,
-     172              :   ) async {
-     173            6 :     if (cacaoSignature.t == 'eip191') {
-     174            3 :       return isValidEip191Signature(
-     175              :         address,
-     176              :         reconstructedMessage,
-     177            3 :         cacaoSignature.s,
-     178              :       );
-     179            0 :     } else if (cacaoSignature.t == 'eip1271') {
-     180            0 :       return await isValidEip1271Signature(
-     181              :         address,
-     182              :         reconstructedMessage,
-     183            0 :         cacaoSignature.s,
-     184              :         chainId,
-     185              :         projectId,
-     186              :       );
-     187              :     } else {
-     188            0 :       throw Exception(
-     189            0 :         'verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${cacaoSignature.t}',
-     190              :       );
-     191              :     }
-     192              :   }
-     193              : 
-     194            0 :   static Cacao buildAuthObject({
-     195              :     required CacaoRequestPayload requestPayload,
-     196              :     required CacaoSignature signature,
-     197              :     required String iss,
-     198              :   }) {
-     199            0 :     if (!iss.contains('did:pkh:')) {
-     200            0 :       iss = 'did:pkh:$iss';
-     201              :     }
-     202            0 :     return Cacao(
-     203              :       h: const CacaoHeader(t: CacaoHeader.CAIP122),
-     204            0 :       p: CacaoPayload.fromRequestPayload(
-     205              :         issuer: iss,
-     206              :         payload: requestPayload,
-     207              :       ),
-     208              :       s: signature,
-     209              :     );
-     210              :   }
-     211              : 
-     212            0 :   static SessionAuthPayload populateAuthPayload({
-     213              :     required SessionAuthPayload authPayload,
-     214              :     required List<String> chains,
-     215              :     required List<String> methods,
-     216              :   }) {
-     217            0 :     final statement = authPayload.statement ?? '';
-     218              : 
-     219            0 :     if (chains.isEmpty) return authPayload;
-     220              : 
-     221            0 :     final requested = authPayload.chains;
-     222              :     final supported = chains;
-     223              : 
-     224              :     final approvedChains =
-     225            0 :         supported.where((value) => requested.contains(value)).toList();
-     226            0 :     if (approvedChains.isEmpty) {
-     227            0 :       throw WalletConnectError(code: -1, message: 'No supported chains');
-     228              :     }
-     229              : 
-     230            0 :     final requestedRecaps = ReCapsUtils.getDecodedRecapFromResources(
-     231            0 :       resources: authPayload.resources,
-     232              :     );
-     233              :     if (requestedRecaps == null) return authPayload;
-     234              : 
-     235            0 :     ReCapsUtils.isValidRecap(requestedRecaps);
-     236              : 
-     237            0 :     final resource = ReCapsUtils.getRecapResource(
-     238              :       recap: requestedRecaps,
-     239              :       resource: 'eip155',
-     240              :     );
-     241            0 :     List<String> updatedResources = authPayload.resources ?? [];
-     242              : 
-     243            0 :     if (resource.isNotEmpty) {
-     244            0 :       final actions = ReCapsUtils.getReCapActions(abilities: resource);
-     245              :       final approvedActions =
-     246            0 :           actions.where((value) => methods.contains(value)).toList();
-     247            0 :       if (approvedActions.isEmpty) {
-     248            0 :         throw WalletConnectError(
-     249            0 :           code: -1,
-     250            0 :           message: 'Supported methods don\'t satisfy the requested: $actions, '
-     251              :               'supported: $methods',
-     252              :         );
-     253              :       }
-     254            0 :       final formattedActions = ReCapsUtils.assignAbilityToActions(
-     255              :         'request',
-     256              :         approvedActions,
-     257            0 :         limits: {'chains': approvedChains},
-     258              :       );
-     259            0 :       final updatedRecap = ReCapsUtils.addResourceToRecap(
-     260              :         recap: requestedRecaps,
-     261              :         resource: 'eip155',
-     262              :         actions: formattedActions,
-     263              :       );
-     264              :       // remove recap from resources as we will add the updated one
-     265            0 :       updatedResources = List<String>.from((authPayload.resources ?? []))
-     266            0 :         ..removeLast();
-     267            0 :       updatedResources.add(ReCapsUtils.encodeRecap(updatedRecap));
-     268              :     }
-     269              :     //
-     270            0 :     return SessionAuthPayload.fromJson(authPayload.toJson()).copyWith(
-     271            0 :       statement: ReCapsUtils.buildRecapStatement(
-     272              :         statement,
-     273            0 :         ReCapsUtils.getRecapFromResources(resources: updatedResources),
-     274              :       ),
-     275              :       chains: approvedChains,
-     276            0 :       resources: updatedResources.isNotEmpty ? updatedResources : null,
-     277              :     );
-     278              :   }
-     279              : 
-     280            1 :   static String getAddressFromMessage(String message) {
-     281              :     try {
-     282            1 :       final regexp = RegExp('0x[a-fA-F0-9]{40}');
-     283            1 :       final matches = regexp.allMatches(message);
-     284            2 :       for (final Match m in matches) {
-     285            1 :         return m[0]!;
-     286              :       }
-     287              :       return '';
-     288              :     } catch (_) {}
-     289              :     return '';
-     290              :   }
-     291              : 
-     292            1 :   static String getChainIdFromMessage(String message) {
-     293              :     try {
-     294              :       final pattern = 'Chain ID: ';
-     295            2 :       final regexp = RegExp('$pattern(?<temp1>\\d+)');
-     296            1 :       final matches = regexp.allMatches(message);
-     297            2 :       for (final Match m in matches) {
-     298            3 :         return m[0]!.toString().replaceAll(pattern, '');
-     299              :       }
-     300              :     } catch (_) {}
-     301              :     return '';
-     302              :   }
-     303              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/auth/auth_utils.dart.func-c.html b/coverage/html/sign_api/utils/auth/auth_utils.dart.func-c.html deleted file mode 100644 index 18d315ed..00000000 --- a/coverage/html/sign_api/utils/auth/auth_utils.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/auth/auth_utils.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils/auth - auth_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %22
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/auth/auth_utils.dart.func.html b/coverage/html/sign_api/utils/auth/auth_utils.dart.func.html deleted file mode 100644 index 08898c58..00000000 --- a/coverage/html/sign_api/utils/auth/auth_utils.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/auth/auth_utils.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils/auth - auth_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %22
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/auth/auth_utils.dart.gcov.html b/coverage/html/sign_api/utils/auth/auth_utils.dart.gcov.html deleted file mode 100644 index e42ee3a1..00000000 --- a/coverage/html/sign_api/utils/auth/auth_utils.dart.gcov.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/auth/auth_utils.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils/auth - auth_utils.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %22
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : class AuthUtils {
-       2            3 :   static String generateNonce() {
-       3            9 :     return DateTime.now().millisecondsSinceEpoch.toString();
-       4              :   }
-       5              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/auth/index-sort-f.html b/coverage/html/sign_api/utils/auth/index-sort-f.html deleted file mode 100644 index c98322d5..00000000 --- a/coverage/html/sign_api/utils/auth/index-sort-f.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/auth - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils/authCoverageTotalHit
Test:lcov.infoLines:21.9 %32070
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
address_utils.dart -
66.7%66.7%
-
66.7 %64-
auth_api_validators.dart -
45.5%45.5%
-
45.5 %4420-
auth_signature.dart -
44.4%44.4%
-
44.4 %9944-
auth_utils.dart -
100.0%
-
100.0 %22-
recaps_utils.dart -
0.0%
-
0.0 %169-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/auth/index-sort-l.html b/coverage/html/sign_api/utils/auth/index-sort-l.html deleted file mode 100644 index 87f2a26b..00000000 --- a/coverage/html/sign_api/utils/auth/index-sort-l.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/auth - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils/authCoverageTotalHit
Test:lcov.infoLines:21.9 %32070
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
recaps_utils.dart -
0.0%
-
0.0 %169
auth_signature.dart -
44.4%44.4%
-
44.4 %9944
auth_api_validators.dart -
45.5%45.5%
-
45.5 %4420
address_utils.dart -
66.7%66.7%
-
66.7 %64
auth_utils.dart -
100.0%
-
100.0 %22
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/auth/index.html b/coverage/html/sign_api/utils/auth/index.html deleted file mode 100644 index 40a1bb06..00000000 --- a/coverage/html/sign_api/utils/auth/index.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/auth - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils/authCoverageTotalHit
Test:lcov.infoLines:21.9 %32070
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
address_utils.dart -
66.7%66.7%
-
66.7 %64
auth_api_validators.dart -
45.5%45.5%
-
45.5 %4420
auth_signature.dart -
44.4%44.4%
-
44.4 %9944
auth_utils.dart -
100.0%
-
100.0 %22
recaps_utils.dart -
0.0%
-
0.0 %169
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/auth/recaps_utils.dart.func-c.html b/coverage/html/sign_api/utils/auth/recaps_utils.dart.func-c.html deleted file mode 100644 index 12c1e693..00000000 --- a/coverage/html/sign_api/utils/auth/recaps_utils.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/auth/recaps_utils.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils/auth - recaps_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %1690
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/auth/recaps_utils.dart.func.html b/coverage/html/sign_api/utils/auth/recaps_utils.dart.func.html deleted file mode 100644 index 07179f7f..00000000 --- a/coverage/html/sign_api/utils/auth/recaps_utils.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/auth/recaps_utils.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils/auth - recaps_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %1690
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/auth/recaps_utils.dart.gcov.html b/coverage/html/sign_api/utils/auth/recaps_utils.dart.gcov.html deleted file mode 100644 index 801ed432..00000000 --- a/coverage/html/sign_api/utils/auth/recaps_utils.dart.gcov.html +++ /dev/null @@ -1,420 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/auth/recaps_utils.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils/auth - recaps_utils.dartCoverageTotalHit
Test:lcov.infoLines:0.0 %1690
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:convert';
-       2              : 
-       3              : import 'package:flutter/foundation.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/utils/errors.dart';
-       5              : 
-       6              : class ReCapsUtils {
-       7              :   //
-       8            0 :   static String? getRecapFromResources({List<String>? resources}) {
-       9            0 :     final resourcesList = resources ?? [];
-      10            0 :     if (resourcesList.isEmpty) return null;
-      11              :     // per spec, recap is always the last resource
-      12            0 :     final recap = resourcesList.last;
-      13            0 :     return isRecap(recap) ? recap : null;
-      14              :   }
-      15              : 
-      16            0 :   static bool isRecap(String resource) {
-      17            0 :     return resource.contains('urn:recap:');
-      18              :   }
-      19              : 
-      20            0 :   static List<String> getMethodsFromRecap(String recap) {
-      21            0 :     final decodedRecap = decodeRecap(recap);
-      22            0 :     if (!isValidRecap(decodedRecap)) return [];
-      23              : 
-      24              :     try {
-      25              :       // methods are only available for eip155 as per the current implementation
-      26            0 :       final resource = decodedRecap['att']?['eip155'] as Map<String, dynamic>?;
-      27            0 :       if (resource == null) return [];
-      28              : 
-      29            0 :       return resource.keys.map((k) => k.split('/').last).toList();
-      30              :     } catch (e) {
-      31            0 :       return [];
-      32              :     }
-      33              :   }
-      34              : 
-      35            0 :   static List<String> getChainsFromRecap(String recap) {
-      36            0 :     final decodedRecap = decodeRecap(recap);
-      37            0 :     if (!isValidRecap(decodedRecap)) return [];
-      38              : 
-      39            0 :     final List<dynamic> recapChains = [];
-      40              :     try {
-      41              :       final att =
-      42            0 :           decodedRecap['att'] as Map<String, dynamic>? ?? <String, dynamic>{};
-      43              : 
-      44            0 :       for (var resources in att.values) {
-      45              :         final resourcesMap = resources as Map<String, dynamic>;
-      46            0 :         final resourcesValues = resourcesMap.values.first as List;
-      47            0 :         for (var value in resourcesValues) {
-      48              :           final chainValues = value as Map<String, dynamic>;
-      49            0 :           final chains = chainValues['chains'] as List;
-      50            0 :           recapChains.addAll(chains);
-      51              :         }
-      52              :       }
-      53            0 :       return recapChains.map((e) => e.toString()).toSet().toList();
-      54              :     } catch (e) {
-      55            0 :       return [];
-      56              :     }
-      57              :   }
-      58              : 
-      59            0 :   static Map<String, dynamic> decodeRecap(String recap) {
-      60              :     // Add the padding that was removed during encoding
-      61            0 :     String paddedRecap = recap.replaceAll('urn:recap:', '');
-      62            0 :     final padding = paddedRecap.length % 4;
-      63            0 :     if (padding > 0) {
-      64            0 :       paddedRecap += '=' * (4 - padding);
-      65              :     }
-      66              : 
-      67            0 :     final decoded = utf8.decode(base64.decode(paddedRecap));
-      68            0 :     final decodedRecap = jsonDecode(decoded) as Map<String, dynamic>;
-      69            0 :     isValidRecap(decodedRecap);
-      70              :     return decodedRecap;
-      71              :   }
-      72              : 
-      73            0 :   static bool isValidRecap(Map<String, dynamic> recap) {
-      74            0 :     final att = recap['att'] as Map<String, dynamic>?;
-      75              :     if (att == null) {
-      76            0 :       throw Errors.getInternalError(
-      77              :         Errors.MISSING_OR_INVALID,
-      78              :         context: 'Invalid ReCap. No `att` property found',
-      79              :       );
-      80              :     }
-      81              :     //
-      82            0 :     final resources = att.keys;
-      83            0 :     if (resources.isEmpty) {
-      84            0 :       throw Errors.getInternalError(
-      85              :         Errors.MISSING_OR_INVALID,
-      86              :         context: 'Invalid ReCap. No resources found in `att` property',
-      87              :       );
-      88              :     }
-      89              :     //
-      90            0 :     for (var resource in resources) {
-      91            0 :       final abilities = att[resource];
-      92            0 :       if (abilities is! Map) {
-      93            0 :         throw Errors.getInternalError(
-      94              :           Errors.MISSING_OR_INVALID,
-      95            0 :           context: 'Invalid ReCap. Resource must be an object: $resource',
-      96              :         );
-      97              :       }
-      98            0 :       final resourceAbilities = (abilities as Map<String, dynamic>).keys;
-      99            0 :       if (resourceAbilities.isEmpty) {
-     100            0 :         throw Errors.getInternalError(
-     101              :           Errors.MISSING_OR_INVALID,
-     102            0 :           context: 'Invalid ReCap. Resource object is empty: $resource',
-     103              :         );
-     104              :       }
-     105              :       //
-     106            0 :       for (var ability in resourceAbilities) {
-     107            0 :         final limits = abilities[ability];
-     108            0 :         if (limits is! List) {
-     109            0 :           throw Errors.getInternalError(
-     110              :             Errors.MISSING_OR_INVALID,
-     111            0 :             context: 'Invalid ReCap. Ability limits $ability must be an array '
-     112              :                 'of objects, found: $limits',
-     113              :           );
-     114              :         }
-     115            0 :         if ((limits).isEmpty) {
-     116            0 :           throw Errors.getInternalError(
-     117              :             Errors.MISSING_OR_INVALID,
-     118            0 :             context: 'Invalid ReCap. Value of $ability is empty array, must be '
-     119              :                 'an array with objects',
-     120              :           );
-     121              :         }
-     122              :         //
-     123            0 :         for (var limit in limits) {
-     124            0 :           if (limit is! Map) {
-     125            0 :             throw Errors.getInternalError(
-     126              :               Errors.MISSING_OR_INVALID,
-     127            0 :               context:
-     128              :                   'Invalid ReCap. Ability limits ($ability) must be an array '
-     129              :                   'of objects, found: $limit',
-     130              :             );
-     131              :           }
-     132              :         }
-     133              :       }
-     134              :     }
-     135              : 
-     136              :     return true;
-     137              :   }
-     138              : 
-     139            0 :   static String createEncodedRecap(
-     140              :     String namespace,
-     141              :     String ability,
-     142              :     List<String> methods,
-     143              :   ) {
-     144            0 :     final recap = createRecap(namespace, ability, methods);
-     145            0 :     return encodeRecap(recap);
-     146              :   }
-     147              : 
-     148            0 :   static String encodeRecap(Map<String, dynamic> recap) {
-     149            0 :     isValidRecap(recap);
-     150            0 :     final jsonRecap = jsonEncode(recap);
-     151            0 :     final bytes = utf8.encode(jsonRecap).toList();
-     152              :     // remove the padding from the base64 string as per recap spec
-     153            0 :     return 'urn:recap:${base64.encode(bytes).replaceAll('=', '')}';
-     154              :   }
-     155              : 
-     156            0 :   static Map<String, dynamic> createRecap(
-     157              :     String namespace,
-     158              :     String ability,
-     159              :     List<String> methods, {
-     160              :     Map limits = const {},
-     161              :   }) {
-     162              :     try {
-     163            0 :       final sortedMethods = List<String>.from(methods)
-     164            0 :         ..sort((a, b) => a.compareTo(b));
-     165              : 
-     166            0 :       Map<String, dynamic> abilities = {};
-     167            0 :       for (var method in sortedMethods) {
-     168            0 :         abilities['$ability/$method'] = [
-     169            0 :           ...(abilities['$ability/$method'] ?? []),
-     170            0 :           limits,
-     171              :         ];
-     172              :       }
-     173              : 
-     174            0 :       return {
-     175            0 :         'att': {
-     176            0 :           namespace: Map<String, dynamic>.fromEntries(abilities.entries),
-     177              :         }
-     178              :       };
-     179              :     } catch (e) {
-     180              :       rethrow;
-     181              :     }
-     182              :   }
-     183              : 
-     184            0 :   static String mergeEncodedRecaps(String recap1, String recap2) {
-     185            0 :     final decoded1 = decodeRecap(recap1);
-     186            0 :     final decoded2 = decodeRecap(recap2);
-     187            0 :     final merged = mergeRecaps(decoded1, decoded2);
-     188            0 :     return encodeRecap(merged);
-     189              :   }
-     190              : 
-     191            0 :   static Map<String, dynamic> mergeRecaps(
-     192              :     Map<String, dynamic> recap1,
-     193              :     Map<String, dynamic> recap2,
-     194              :   ) {
-     195            0 :     isValidRecap(recap1);
-     196            0 :     isValidRecap(recap2);
-     197            0 :     final att1 = recap1['att'] as Map<String, dynamic>;
-     198            0 :     final att2 = recap2['att'] as Map<String, dynamic>;
-     199            0 :     final keys = [...att1.keys, ...att2.keys]..sort(
-     200            0 :         (a, b) => a.compareTo(b),
-     201              :       );
-     202            0 :     final mergedRecap = {'att': {}};
-     203              : 
-     204            0 :     for (var key in keys) {
-     205            0 :       final actions1 = att1[key] as Map<String, dynamic>? ?? {};
-     206            0 :       final actions1Keys = actions1.keys;
-     207            0 :       final actions2 = att2[key] as Map<String, dynamic>? ?? {};
-     208            0 :       final actions2Keys = actions2.keys;
-     209            0 :       final actions = [...actions1Keys, ...actions2Keys]..sort(
-     210            0 :           (a, b) => a.compareTo(b),
-     211              :         );
-     212              : 
-     213            0 :       for (var action in actions) {
-     214            0 :         mergedRecap['att']![key] = {
-     215            0 :           ...mergedRecap['att']?[key],
-     216            0 :           [action]: recap1['att'][key]?[action] || recap2['att'][key]?[action],
-     217              :         };
-     218              :       }
-     219              :     }
-     220              : 
-     221              :     return mergedRecap;
-     222              :   }
-     223              : 
-     224            0 :   static Map<String, dynamic>? getDecodedRecapFromResources({
-     225              :     List<String>? resources,
-     226              :   }) {
-     227            0 :     final resource = getRecapFromResources(resources: resources);
-     228              :     if (resource == null) return null;
-     229            0 :     if (!isRecap(resource)) return null;
-     230            0 :     return decodeRecap(resource);
-     231              :   }
-     232              : 
-     233            0 :   static String formatStatementFromRecap({
-     234              :     String statement = '',
-     235              :     Map<String, dynamic> recap = const {},
-     236              :   }) {
-     237            0 :     isValidRecap(recap);
-     238              :     //
-     239              :     final baseStatement =
-     240              :         'I further authorize the stated URI to perform the following actions on my behalf: ';
-     241            0 :     if (statement.contains(baseStatement)) return statement;
-     242              :     //
-     243            0 :     final List<String> statementForRecap = <String>[];
-     244              :     int currentCounter = 0;
-     245            0 :     final att = recap['att'] as Map<String, dynamic>;
-     246            0 :     final resources = att.keys;
-     247            0 :     for (var resource in resources) {
-     248            0 :       final abilities = att[resource];
-     249            0 :       final resourceAbilities = (abilities as Map<String, dynamic>).keys;
-     250            0 :       final actions = resourceAbilities.map((ability) {
-     251            0 :         return {
-     252            0 :           'ability': ability.split('/')[0],
-     253            0 :           'action': ability.split('/')[1],
-     254              :         };
-     255            0 :       }).toList();
-     256            0 :       actions.sort((a, b) => a['action']!.compareTo(b['action']!));
-     257              :       //
-     258            0 :       final uniqueAbilities = <String, dynamic>{};
-     259            0 :       for (var actionMap in actions) {
-     260            0 :         final ability = actionMap['ability']!;
-     261            0 :         final action = actionMap['action']!;
-     262            0 :         if (uniqueAbilities[ability] == null) {
-     263            0 :           uniqueAbilities[ability] = [];
-     264              :         }
-     265            0 :         uniqueAbilities[ability].add(action);
-     266              :       }
-     267              :       //
-     268            0 :       final abilitiesStatements = uniqueAbilities.keys.map((ability) {
-     269            0 :         currentCounter++;
-     270            0 :         final abilities = (uniqueAbilities[ability] as List).join('\', \'');
-     271            0 :         return '($currentCounter) \'$ability\': \'$abilities\' for \'$resource\'.';
-     272            0 :       }).toList();
-     273              : 
-     274            0 :       statementForRecap.add(
-     275            0 :         abilitiesStatements.join(', ').replaceAll('.,', '.'),
-     276              :       );
-     277              :     }
-     278              :     //
-     279            0 :     final recapStatemet = statementForRecap.join(' ');
-     280            0 :     final recapStatement = '$baseStatement$recapStatemet';
-     281              :     // add a space if there is a statement
-     282            0 :     return '${statement.isNotEmpty ? "$statement " : ""}$recapStatement';
-     283              :   }
-     284              : 
-     285            0 :   static List<String> getRecapResource({
-     286              :     required Map<String, dynamic> recap,
-     287              :     required String resource,
-     288              :   }) {
-     289              :     try {
-     290            0 :       final att = recap['att'] as Map<String, dynamic>?;
-     291            0 :       final abilities = att?[resource] as Map<String, dynamic>?;
-     292              :       if (abilities != null) {
-     293            0 :         return abilities.keys.toList();
-     294              :       }
-     295              :     } catch (e) {
-     296            0 :       debugPrint(e.toString());
-     297              :     }
-     298            0 :     return [];
-     299              :   }
-     300              : 
-     301            0 :   static List<String> getReCapActions({required List<String> abilities}) {
-     302              :     try {
-     303            0 :       return abilities.map((ability) => ability.split('/')[1]).toList();
-     304              :     } catch (e) {
-     305            0 :       debugPrint(e.toString());
-     306              :     }
-     307            0 :     return [];
-     308              :   }
-     309              : 
-     310            0 :   static Map<String, dynamic> assignAbilityToActions(
-     311              :     String ability,
-     312              :     List<String> actions, {
-     313              :     Map limits = const {},
-     314              :   }) {
-     315            0 :     final sortedActions = List<String>.from(actions)
-     316            0 :       ..sort((a, b) => a.compareTo(b));
-     317              : 
-     318            0 :     Map<String, dynamic> abilities = {};
-     319            0 :     for (var method in sortedActions) {
-     320            0 :       abilities['$ability/$method'] = [
-     321            0 :         ...(abilities['$ability/$method'] ?? []),
-     322            0 :         limits,
-     323              :       ];
-     324              :     }
-     325              : 
-     326            0 :     return Map<String, dynamic>.fromEntries(abilities.entries);
-     327              :   }
-     328              : 
-     329            0 :   static Map<String, dynamic> addResourceToRecap({
-     330              :     required Map<String, dynamic> recap,
-     331              :     required String resource,
-     332              :     required Map<String, dynamic> actions,
-     333              :   }) {
-     334              :     //
-     335            0 :     final sortedRecap = Map<String, dynamic>.from(recap);
-     336            0 :     sortedRecap['att']![resource] = actions;
-     337            0 :     sortedRecap.keys.toList().sort((a, b) => a.compareTo(b));
-     338            0 :     isValidRecap(sortedRecap);
-     339              :     return sortedRecap;
-     340              :   }
-     341              : 
-     342            0 :   static String buildRecapStatement(String statement, String? recap) {
-     343            0 :     if ((recap ?? '').isEmpty) return statement;
-     344            0 :     final decoded = decodeRecap(recap!);
-     345            0 :     isValidRecap(decoded);
-     346            0 :     return formatStatementFromRecap(statement: statement, recap: decoded);
-     347              :   }
-     348              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/custom_credentials.dart.func-c.html b/coverage/html/sign_api/utils/custom_credentials.dart.func-c.html deleted file mode 100644 index fff10874..00000000 --- a/coverage/html/sign_api/utils/custom_credentials.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/custom_credentials.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils - custom_credentials.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %230
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/custom_credentials.dart.func.html b/coverage/html/sign_api/utils/custom_credentials.dart.func.html deleted file mode 100644 index f0561ad3..00000000 --- a/coverage/html/sign_api/utils/custom_credentials.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/custom_credentials.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils - custom_credentials.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %230
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/custom_credentials.dart.gcov.html b/coverage/html/sign_api/utils/custom_credentials.dart.gcov.html deleted file mode 100644 index 2dd62329..00000000 --- a/coverage/html/sign_api/utils/custom_credentials.dart.gcov.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/custom_credentials.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils - custom_credentials.dartCoverageTotalHit
Test:lcov.infoLines:0.0 %230
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:convert';
-       2              : import 'dart:typed_data';
-       3              : 
-       4              : import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart';
-       5              : import 'package:web3dart/crypto.dart' as crypto;
-       6              : 
-       7              : class CustomCredentials extends CustomTransactionSender {
-       8            0 :   CustomCredentials({
-       9              :     required ISignEngine signEngine,
-      10              :     required String topic,
-      11              :     required String chainId,
-      12              :     required EthereumAddress address,
-      13              :     String? method,
-      14              :   })  : _signEngine = signEngine,
-      15              :         _topic = topic,
-      16              :         _chainId = chainId,
-      17              :         _address = address,
-      18              :         _method = method;
-      19              : 
-      20              :   final ISignEngine _signEngine;
-      21              :   final String _topic;
-      22              :   final String _chainId;
-      23              :   final EthereumAddress _address;
-      24              :   final String? _method;
-      25              : 
-      26            0 :   @override
-      27            0 :   EthereumAddress get address => _address;
-      28              : 
-      29            0 :   @override
-      30              :   Future<String> sendTransaction(Transaction transaction) async {
-      31            0 :     final result = await _sendTransaction(transaction);
-      32            0 :     if (result is Map) {
-      33            0 :       return jsonEncode(result);
-      34              :     }
-      35            0 :     return result.toString();
-      36              :   }
-      37              : 
-      38            0 :   Future<dynamic> _sendTransaction(Transaction transaction) async {
-      39            0 :     final sessionRequestParams = SessionRequestParams(
-      40            0 :       method: _method ?? MethodsConstants.ethSendTransaction,
-      41            0 :       params: [
-      42            0 :         transaction.toJson(),
-      43              :       ],
-      44              :     );
-      45              : 
-      46            0 :     final result = await _signEngine.request(
-      47            0 :       topic: _topic,
-      48            0 :       chainId: _chainId,
-      49              :       request: sessionRequestParams,
-      50              :     );
-      51              :     return result;
-      52              :   }
-      53              : 
-      54            0 :   @override
-      55            0 :   Future<EthereumAddress> extractAddress() => Future.value(_address);
-      56              : 
-      57            0 :   @override
-      58              :   Future<crypto.MsgSignature> signToSignature(
-      59              :     Uint8List payload, {
-      60              :     int? chainId,
-      61              :     bool isEIP1559 = false,
-      62              :   }) {
-      63            0 :     final signature = signToEcSignature(
-      64              :       payload,
-      65              :       chainId: chainId,
-      66              :       isEIP1559: isEIP1559,
-      67              :     );
-      68            0 :     return Future.value(signature);
-      69              :   }
-      70              : 
-      71            0 :   @override
-      72              :   crypto.MsgSignature signToEcSignature(
-      73              :     Uint8List payload, {
-      74              :     int? chainId,
-      75              :     bool isEIP1559 = false,
-      76              :   }) {
-      77              :     // TODO: implement signToEcSignature
-      78            0 :     throw UnimplementedError();
-      79              :   }
-      80              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/index-sort-f.html b/coverage/html/sign_api/utils/index-sort-f.html deleted file mode 100644 index a9e826ab..00000000 --- a/coverage/html/sign_api/utils/index-sort-f.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utilsCoverageTotalHit
Test:lcov.infoLines:80.7 %11996
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
custom_credentials.dart -
0.0%
-
0.0 %23-
sign_api_validator_utils.dart -
100.0%
-
100.0 %9696-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/index-sort-l.html b/coverage/html/sign_api/utils/index-sort-l.html deleted file mode 100644 index 6943d71d..00000000 --- a/coverage/html/sign_api/utils/index-sort-l.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utilsCoverageTotalHit
Test:lcov.infoLines:80.7 %11996
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
custom_credentials.dart -
0.0%
-
0.0 %23
sign_api_validator_utils.dart -
100.0%
-
100.0 %9696
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/index.html b/coverage/html/sign_api/utils/index.html deleted file mode 100644 index b11ed9f3..00000000 --- a/coverage/html/sign_api/utils/index.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utilsCoverageTotalHit
Test:lcov.infoLines:80.7 %11996
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
custom_credentials.dart -
0.0%
-
0.0 %23
sign_api_validator_utils.dart -
100.0%
-
100.0 %9696
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/sign_api_validator_utils.dart.func-c.html b/coverage/html/sign_api/utils/sign_api_validator_utils.dart.func-c.html deleted file mode 100644 index 9b4a7023..00000000 --- a/coverage/html/sign_api/utils/sign_api_validator_utils.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/sign_api_validator_utils.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils - sign_api_validator_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %9696
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/sign_api_validator_utils.dart.func.html b/coverage/html/sign_api/utils/sign_api_validator_utils.dart.func.html deleted file mode 100644 index 82c1a14c..00000000 --- a/coverage/html/sign_api/utils/sign_api_validator_utils.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/sign_api_validator_utils.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils - sign_api_validator_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %9696
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/sign_api/utils/sign_api_validator_utils.dart.gcov.html b/coverage/html/sign_api/utils/sign_api_validator_utils.dart.gcov.html deleted file mode 100644 index a53abd39..00000000 --- a/coverage/html/sign_api/utils/sign_api_validator_utils.dart.gcov.html +++ /dev/null @@ -1,396 +0,0 @@ - - - - - - - LCOV - lcov.info - sign_api/utils/sign_api_validator_utils.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - sign_api/utils - sign_api_validator_utils.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %9696
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/proposal_models.dart';
-       2              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/session_models.dart';
-       3              : import 'package:walletconnect_flutter_v2/apis/utils/namespace_utils.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/utils/errors.dart';
-       5              : 
-       6              : class SignApiValidatorUtils {
-       7            6 :   static bool isContainedIn({
-       8              :     required List<dynamic> container,
-       9              :     required List<dynamic> contained,
-      10              :   }) {
-      11              :     List<dynamic> matches = contained
-      12            6 :         .where(
-      13           12 :           (x) => container.contains(x),
-      14              :         )
-      15            6 :         .toList();
-      16           18 :     return matches.length == contained.length;
-      17              :   }
-      18              : 
-      19              :   /// This function will throw an error if
-      20              :   /// 1. the nsOrChainId parameter is a chainId, and the chains param exists
-      21              :   /// 2. The list of chains contains an invalid chainId
-      22            5 :   static bool isValidChains({
-      23              :     required String nsOrChainId,
-      24              :     List<String>? chains,
-      25              :     required String context,
-      26              :   }) {
-      27              :     // If the key is a valid chain Id, then the chains should be empty
-      28            5 :     final bool isChainId = NamespaceUtils.isValidChainId(nsOrChainId);
-      29              :     if (isChainId) {
-      30            4 :       if (chains != null && chains.isNotEmpty) {
-      31            4 :         throw Errors.getSdkError(
-      32              :           Errors.UNSUPPORTED_CHAINS,
-      33            4 :           context: '$context, namespace is a chainId, but chains is not empty',
-      34              :         );
-      35              :       }
-      36              :     } else {
-      37           10 :       for (String c in chains!) {
-      38            5 :         if (!NamespaceUtils.isValidChainId(c)) {
-      39            1 :           throw Errors.getSdkError(
-      40              :             Errors.UNSUPPORTED_CHAINS,
-      41              :             context:
-      42            1 :                 '$context, chain $c should conform to "namespace:chainId" format',
-      43              :           );
-      44              :         }
-      45              :       }
-      46              :     }
-      47              : 
-      48              :     return true;
-      49              :   }
-      50              : 
-      51              :   /// Validates the data of the Required Namespaces, ensuring it conforms to CAIP-25
-      52            5 :   static bool isValidRequiredNamespaces({
-      53              :     required Map<String, RequiredNamespace> requiredNamespaces,
-      54              :     required String context,
-      55              :   }) {
-      56           10 :     requiredNamespaces.forEach((key, namespace) {
-      57            5 :       isValidChains(
-      58              :         nsOrChainId: key,
-      59            5 :         chains: namespace.chains,
-      60            5 :         context: '$context requiredNamespace',
-      61              :       );
-      62              :     });
-      63              : 
-      64              :     return true;
-      65              :   }
-      66              : 
-      67              :   /// Loops through each account, and validates it
-      68              :   /// Context is used to provide more information in the error message
-      69            5 :   static bool isValidAccounts({
-      70              :     required List<String> accounts,
-      71              :     required String context,
-      72              :   }) {
-      73           10 :     for (String account in accounts) {
-      74            5 :       if (!NamespaceUtils.isValidAccount(account)) {
-      75            4 :         throw Errors.getSdkError(
-      76              :           Errors.UNSUPPORTED_ACCOUNTS,
-      77              :           context:
-      78            4 :               '$context, account $account should conform to "namespace:chainId:address" format',
-      79              :         );
-      80              :       }
-      81              :     }
-      82              : 
-      83              :     return true;
-      84              :   }
-      85              : 
-      86              :   /// Validates the data of the Namespaces, ensuring it conforms to CAIP-25
-      87            5 :   static bool isValidNamespaces({
-      88              :     required Map<String, Namespace> namespaces,
-      89              :     required String context,
-      90              :   }) {
-      91           10 :     namespaces.forEach((key, namespace) {
-      92            5 :       isValidAccounts(
-      93            5 :         accounts: namespace.accounts,
-      94            5 :         context: '$context namespace',
-      95              :       );
-      96              :     });
-      97              : 
-      98              :     return true;
-      99              :   }
-     100              : 
-     101              :   /// Validates the provided chainId, then ensures that the chainId is contained
-     102              :   /// in the namespaces
-     103            4 :   static bool isValidNamespacesChainId({
-     104              :     required Map<String, Namespace> namespaces,
-     105              :     required String chainId,
-     106              :   }) {
-     107              :     // Validate the chainId
-     108            4 :     if (!NamespaceUtils.isValidChainId(chainId)) {
-     109            1 :       throw Errors.getSdkError(
-     110              :         Errors.UNSUPPORTED_CHAINS,
-     111            1 :         context: 'chain $chainId should conform to "namespace:chainId" format',
-     112              :       );
-     113              :     }
-     114              : 
-     115              :     // Validate the namespaces
-     116            4 :     isValidNamespaces(
-     117              :       namespaces: namespaces,
-     118              :       context: 'isValidNamespacesChainId',
-     119              :     );
-     120              : 
-     121              :     // Get the chains from the namespaces and
-     122            4 :     List<String> chains = NamespaceUtils.getChainIdsFromNamespaces(
-     123              :       namespaces: namespaces,
-     124              :     );
-     125              : 
-     126            4 :     if (!chains.contains(chainId)) {
-     127            4 :       throw Errors.getSdkError(
-     128              :         Errors.UNSUPPORTED_CHAINS,
-     129            4 :         context: 'The chain $chainId is not supported',
-     130              :       );
-     131              :     }
-     132              : 
-     133              :     return true;
-     134              :   }
-     135              : 
-     136              :   /// Validates the provided chainId, then gets the methods for that chainId
-     137              :   /// and ensures that the method request is contained in the methods
-     138            4 :   static bool isValidNamespacesRequest({
-     139              :     required Map<String, Namespace> namespaces,
-     140              :     required String chainId,
-     141              :     required String method,
-     142              :   }) {
-     143              :     // Validate the chainId
-     144            4 :     if (!NamespaceUtils.isValidChainId(chainId)) {
-     145            1 :       throw Errors.getSdkError(
-     146              :         Errors.UNSUPPORTED_CHAINS,
-     147            1 :         context: 'chain $chainId should conform to "namespace:chainId" format',
-     148              :       );
-     149              :     }
-     150              : 
-     151              :     // Validate the namespaces
-     152            4 :     isValidNamespaces(
-     153              :       namespaces: namespaces,
-     154              :       context: 'isValidNamespacesRequest',
-     155              :     );
-     156              : 
-     157            4 :     List<dynamic> methods = NamespaceUtils.getNamespacesMethodsForChainId(
-     158              :       namespaces: namespaces,
-     159              :       chainId: chainId,
-     160              :     );
-     161              : 
-     162            4 :     if (!methods.contains(method)) {
-     163            4 :       throw Errors.getSdkError(
-     164              :         Errors.UNSUPPORTED_METHODS,
-     165            4 :         context: 'The method $method is not supported',
-     166              :       );
-     167              :     }
-     168              : 
-     169              :     return true;
-     170              :   }
-     171              : 
-     172              :   /// Validates the provided chainId, then gets the events for that chainId
-     173              :   /// and ensures that the event request is contained in the events
-     174            4 :   static bool isValidNamespacesEvent({
-     175              :     required Map<String, Namespace> namespaces,
-     176              :     required String chainId,
-     177              :     required String eventName,
-     178              :   }) {
-     179              :     // Validate the chainId
-     180            4 :     if (!NamespaceUtils.isValidChainId(chainId)) {
-     181            1 :       throw Errors.getSdkError(
-     182              :         Errors.UNSUPPORTED_CHAINS,
-     183            1 :         context: 'chain $chainId should conform to "namespace:chainId" format',
-     184              :       );
-     185              :     }
-     186              : 
-     187              :     // Validate the namespaces
-     188            4 :     isValidNamespaces(
-     189              :       namespaces: namespaces,
-     190              :       context: 'isValidNamespacesEvent',
-     191              :     );
-     192              : 
-     193            4 :     List<dynamic> events = NamespaceUtils.getNamespacesEventsForChain(
-     194              :       namespaces: namespaces,
-     195              :       chainId: chainId,
-     196              :     );
-     197              : 
-     198            4 :     if (!events.contains(eventName)) {
-     199            4 :       throw Errors.getSdkError(
-     200              :         Errors.UNSUPPORTED_EVENTS,
-     201            4 :         context: 'The event $eventName is not supported',
-     202              :       );
-     203              :     }
-     204              : 
-     205              :     return true;
-     206              :   }
-     207              : 
-     208              :   /// Makes sure that the chains, methods and events of the required namespaces
-     209              :   /// are contained in the namespaces
-     210            6 :   static bool isConformingNamespaces({
-     211              :     required Map<String, RequiredNamespace> requiredNamespaces,
-     212              :     required Map<String, Namespace> namespaces,
-     213              :     required String context,
-     214              :   }) {
-     215           12 :     List<String> requiredNamespaceKeys = requiredNamespaces.keys.toList();
-     216           12 :     List<String> namespaceKeys = namespaces.keys.toList();
-     217              : 
-     218              :     // If the namespaces doesn't have the correct keys, we can fail automatically
-     219            6 :     if (!isContainedIn(
-     220              :         container: namespaceKeys, contained: requiredNamespaceKeys)) {
-     221            4 :       throw Errors.getSdkError(
-     222              :         Errors.UNSUPPORTED_NAMESPACE_KEY,
-     223            4 :         context: "$context namespaces keys don't satisfy requiredNamespaces",
-     224              :       );
-     225              :     } else {
-     226           12 :       for (var key in requiredNamespaceKeys) {
-     227              :         List<String> requiredNamespaceChains =
-     228            6 :             NamespaceUtils.getChainsFromRequiredNamespace(
-     229              :           nsOrChainId: key,
-     230            6 :           requiredNamespace: requiredNamespaces[key]!,
-     231              :         );
-     232            6 :         List<String> namespaceChains = NamespaceUtils.getChainIdsFromNamespace(
-     233              :           nsOrChainId: key,
-     234            6 :           namespace: namespaces[key]!,
-     235              :         );
-     236              : 
-     237              :         // Check the chains, methods and events for overlaps.
-     238              :         // If any of them don't have it, we fail.
-     239            6 :         final bool chainsOverlap = isContainedIn(
-     240              :           container: namespaceChains,
-     241              :           contained: requiredNamespaceChains,
-     242              :         );
-     243            6 :         final bool methodsOverlap = isContainedIn(
-     244           12 :           container: namespaces[key]!.methods,
-     245           12 :           contained: requiredNamespaces[key]!.methods,
-     246              :         );
-     247            6 :         final bool eventsOverlap = isContainedIn(
-     248           12 :           container: namespaces[key]!.events,
-     249           12 :           contained: requiredNamespaces[key]!.events,
-     250              :         );
-     251              : 
-     252              :         if (!chainsOverlap) {
-     253            5 :           throw Errors.getSdkError(
-     254              :             Errors.UNSUPPORTED_CHAINS,
-     255              :             context:
-     256            5 :                 "$context namespaces chains don't satisfy requiredNamespaces chains for $key. Requested: $requiredNamespaceChains, Supported: $namespaceChains",
-     257              :           );
-     258              :         } else if (!methodsOverlap) {
-     259            2 :           throw Errors.getSdkError(
-     260              :             Errors.UNSUPPORTED_METHODS,
-     261              :             context:
-     262           10 :                 "$context namespaces methods don't satisfy requiredNamespaces methods for $key. Requested: ${requiredNamespaces[key]!.methods}, Supported: ${namespaces[key]!.methods}",
-     263              :           );
-     264              :         } else if (!eventsOverlap) {
-     265            2 :           throw Errors.getSdkError(
-     266              :             Errors.UNSUPPORTED_EVENTS,
-     267              :             context:
-     268           10 :                 "$context namespaces events don't satisfy requiredNamespaces events for $key. Requested: ${requiredNamespaces[key]!.events}, Supported: ${namespaces[key]!.events}",
-     269              :           );
-     270              :         }
-     271              :       }
-     272              :     }
-     273              : 
-     274              :     return true;
-     275              :   }
-     276              : 
-     277            4 :   static bool isSessionCompatible({
-     278              :     required SessionData session,
-     279              :     required Map<String, RequiredNamespace> requiredNamespaces,
-     280              :   }) {
-     281           12 :     List<String> sessionKeys = session.namespaces.keys.toList();
-     282            8 :     List<String> paramsKeys = requiredNamespaces.keys.toList();
-     283              :     bool compatible = true;
-     284              : 
-     285            4 :     if (!isContainedIn(container: sessionKeys, contained: paramsKeys)) {
-     286              :       return false;
-     287              :     }
-     288              : 
-     289            8 :     for (var key in sessionKeys) {
-     290            8 :       Namespace namespace = session.namespaces[key]!;
-     291            4 :       RequiredNamespace requiredNamespace = requiredNamespaces[key]!;
-     292              :       List<String> requiredNamespaceChains =
-     293            4 :           NamespaceUtils.getChainsFromRequiredNamespace(
-     294              :         nsOrChainId: key,
-     295              :         requiredNamespace: requiredNamespace,
-     296              :       );
-     297            4 :       List<String> namespaceChains = NamespaceUtils.getChainIdsFromNamespace(
-     298              :         nsOrChainId: key,
-     299              :         namespace: namespace,
-     300              :       );
-     301              : 
-     302              :       // Check the chains, methods and events for overlaps.
-     303              :       // If any of them don't have it, we fail.
-     304            4 :       final bool chainsOverlap = isContainedIn(
-     305              :         container: namespaceChains,
-     306              :         contained: requiredNamespaceChains,
-     307              :       );
-     308            4 :       final bool methodsOverlap = isContainedIn(
-     309            4 :         container: namespace.methods,
-     310            8 :         contained: requiredNamespaces[key]!.methods,
-     311              :       );
-     312            4 :       final bool eventsOverlap = isContainedIn(
-     313            4 :         container: namespace.events,
-     314            8 :         contained: requiredNamespaces[key]!.events,
-     315              :       );
-     316              : 
-     317              :       if (!chainsOverlap || !methodsOverlap || !eventsOverlap) {
-     318              :         compatible = false;
-     319              :       }
-     320              :     }
-     321              : 
-     322              :     return compatible;
-     323              :   }
-     324              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/snow.png b/coverage/html/snow.png deleted file mode 100644 index 2cdae107fceec6e7f02ac7acb4a34a82a540caa5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 141 zcmeAS@N?(olHy`uVBq!ia0vp^j3CU&3?x-=hn)ga>?NMQuI!iC1^MM!lvI6;R0X`wF|Ns97GD8ntt^-nBo-U3d c6}OTTfNUlP#;5A{K>8RwUHx3vIVCg!071?oo&W#< diff --git a/coverage/html/updown.png b/coverage/html/updown.png deleted file mode 100644 index aa56a238b3e6c435265250f9266cd1b8caba0f20..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 117 zcmeAS@N?(olHy`uVBq!ia0vp^AT}Qd8;}%R+`Ae`*?77*hG?8mPH5^{)z4*}Q$iB}huR`+ diff --git a/coverage/html/utils/errors.dart.func-c.html b/coverage/html/utils/errors.dart.func-c.html deleted file mode 100644 index d443337b..00000000 --- a/coverage/html/utils/errors.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - utils/errors.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - utils - errors.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %1414
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/utils/errors.dart.func.html b/coverage/html/utils/errors.dart.func.html deleted file mode 100644 index a063dfc4..00000000 --- a/coverage/html/utils/errors.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - utils/errors.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - utils - errors.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %1414
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/utils/errors.dart.gcov.html b/coverage/html/utils/errors.dart.gcov.html deleted file mode 100644 index 147acfa7..00000000 --- a/coverage/html/utils/errors.dart.gcov.html +++ /dev/null @@ -1,349 +0,0 @@ - - - - - - - LCOV - lcov.info - utils/errors.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - utils - errors.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %1414
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:walletconnect_flutter_v2/apis/models/basic_models.dart';
-       2              : 
-       3              : class Errors {
-       4              :   static const INVALID_METHOD = 'INVALID_METHOD';
-       5              :   static const INVALID_EVENT = 'INVALID_EVENT';
-       6              :   static const INVALID_UPDATE_REQUEST = 'INVALID_UPDATE_REQUEST';
-       7              :   static const INVALID_EXTEND_REQUEST = 'INVALID_EXTEND_REQUEST';
-       8              :   static const INVALID_SESSION_SETTLE_REQUEST =
-       9              :       'INVALID_SESSION_SETTLE_REQUEST';
-      10              :   static const UNAUTHORIZED_METHOD = 'UNAUTHORIZED_METHOD';
-      11              :   static const UNAUTHORIZED_EVENT = 'UNAUTHORIZED_EVENT';
-      12              :   static const UNAUTHORIZED_UPDATE_REQUEST = 'UNAUTHORIZED_UPDATE_REQUEST';
-      13              :   static const UNAUTHORIZED_EXTEND_REQUEST = 'UNAUTHORIZED_EXTEND_REQUEST';
-      14              :   static const USER_REJECTED_SIGN = 'USER_REJECTED_SIGN';
-      15              :   static const USER_REJECTED = 'USER_REJECTED';
-      16              :   static const USER_REJECTED_CHAINS = 'USER_REJECTED_CHAINS';
-      17              :   static const USER_REJECTED_METHODS = 'USER_REJECTED_METHODS';
-      18              :   static const USER_REJECTED_EVENTS = 'USER_REJECTED_EVENTS';
-      19              :   static const UNSUPPORTED_CHAINS = 'UNSUPPORTED_CHAINS';
-      20              :   static const UNSUPPORTED_METHODS = 'UNSUPPORTED_METHODS';
-      21              :   static const UNSUPPORTED_EVENTS = 'UNSUPPORTED_EVENTS';
-      22              :   static const UNSUPPORTED_ACCOUNTS = 'UNSUPPORTED_ACCOUNTS';
-      23              :   static const UNSUPPORTED_NAMESPACE_KEY = 'UNSUPPORTED_NAMESPACE_KEY';
-      24              :   static const USER_DISCONNECTED = 'USER_DISCONNECTED';
-      25              :   static const SESSION_SETTLEMENT_FAILED = 'SESSION_SETTLEMENT_FAILED';
-      26              :   static const NO_SESSION_FOR_TOPIC = 'NO_SESSION_FOR_TOPIC';
-      27              :   static const REQUEST_EXPIRED_SESSION = 'SESSION_REQUEST_EXPIRED';
-      28              :   static const WC_METHOD_UNSUPPORTED = 'WC_METHOD_UNSUPPORTED';
-      29              : 
-      30              :   // AUTH
-      31              :   static const MALFORMED_RESPONSE_PARAMS = 'MALFORMED_RESPONSE_PARAMS';
-      32              :   static const MALFORMED_REQUEST_PARAMS = 'MALFORMED_REQUEST_PARAMS';
-      33              :   static const MESSAGE_COMPROMISED = 'MESSAGE_COMPROMISED';
-      34              :   static const SIGNATURE_VERIFICATION_FAILED = 'SIGNATURE_VERIFICATION_FAILED';
-      35              :   static const REQUEST_EXPIRED_AUTH = 'AUTH_REQUEST_EXPIRED';
-      36              :   static const MISSING_ISSUER_AUTH = 'AUTH_MISSING_ISSUER';
-      37              :   static const USER_REJECTED_AUTH = 'AUTH_USER_REJECTED';
-      38              :   static const USER_DISCONNECTED_AUTH = 'AUTH_USER_DISCONNECTED';
-      39              : 
-      40              :   static const SDK_ERRORS = {
-      41              :     /* ----- INVALID (1xxx) ----- */
-      42              :     INVALID_METHOD: {
-      43              :       'message': 'Invalid method.',
-      44              :       'code': 1001,
-      45              :     },
-      46              :     INVALID_EVENT: {
-      47              :       'message': 'Invalid event.',
-      48              :       'code': 1002,
-      49              :     },
-      50              :     INVALID_UPDATE_REQUEST: {
-      51              :       'message': 'Invalid update request.',
-      52              :       'code': 1003,
-      53              :     },
-      54              :     INVALID_EXTEND_REQUEST: {
-      55              :       'message': 'Invalid extend request.',
-      56              :       'code': 1004,
-      57              :     },
-      58              :     INVALID_SESSION_SETTLE_REQUEST: {
-      59              :       'message': 'Invalid session settle request.',
-      60              :       'code': 1005,
-      61              :     },
-      62              :     /* ----- UNAUTHORIZED (3xxx) ----- */
-      63              :     UNAUTHORIZED_METHOD: {
-      64              :       'message': 'Unauthorized method.',
-      65              :       'code': 3001,
-      66              :     },
-      67              :     UNAUTHORIZED_EVENT: {
-      68              :       'message': 'Unauthorized event.',
-      69              :       'code': 3002,
-      70              :     },
-      71              :     UNAUTHORIZED_UPDATE_REQUEST: {
-      72              :       'message': 'Unauthorized update request.',
-      73              :       'code': 3003,
-      74              :     },
-      75              :     UNAUTHORIZED_EXTEND_REQUEST: {
-      76              :       'message': 'Unauthorized extend request.',
-      77              :       'code': 3004,
-      78              :     },
-      79              :     /* ----- REJECTED (5xxx) ----- */
-      80              :     USER_REJECTED_SIGN: {
-      81              :       'message': 'User rejected.',
-      82              :       'code': 4001,
-      83              :     },
-      84              :     /* ----- REJECTED (5xxx) ----- */
-      85              :     USER_REJECTED: {
-      86              :       'message': 'User rejected.',
-      87              :       'code': 5000,
-      88              :     },
-      89              :     USER_REJECTED_CHAINS: {
-      90              :       'message': 'User rejected chains.',
-      91              :       'code': 5001,
-      92              :     },
-      93              :     USER_REJECTED_METHODS: {
-      94              :       'message': 'User rejected methods.',
-      95              :       'code': 5002,
-      96              :     },
-      97              :     USER_REJECTED_EVENTS: {
-      98              :       'message': 'User rejected events.',
-      99              :       'code': 5003,
-     100              :     },
-     101              :     UNSUPPORTED_CHAINS: {
-     102              :       'message': 'Unsupported chains.',
-     103              :       'code': 5100,
-     104              :     },
-     105              :     UNSUPPORTED_METHODS: {
-     106              :       'message': 'Unsupported methods.',
-     107              :       'code': 5101,
-     108              :     },
-     109              :     UNSUPPORTED_EVENTS: {
-     110              :       'message': 'Unsupported events.',
-     111              :       'code': 5102,
-     112              :     },
-     113              :     UNSUPPORTED_ACCOUNTS: {
-     114              :       'message': 'Unsupported accounts.',
-     115              :       'code': 5103,
-     116              :     },
-     117              :     UNSUPPORTED_NAMESPACE_KEY: {
-     118              :       'message': 'Unsupported namespace key.',
-     119              :       'code': 5104,
-     120              :     },
-     121              :     /* ----- REASON (6xxx) ----- */
-     122              :     USER_DISCONNECTED: {
-     123              :       'message': 'User disconnected.',
-     124              :       'code': 6000,
-     125              :     },
-     126              :     /* ----- FAILURE (7xxx) ----- */
-     127              :     SESSION_SETTLEMENT_FAILED: {
-     128              :       'message': 'Session settlement failed.',
-     129              :       'code': 7000,
-     130              :     },
-     131              :     NO_SESSION_FOR_TOPIC: {
-     132              :       'message': 'No session for topic.',
-     133              :       'code': 7001,
-     134              :     },
-     135              :     /* ----- FAILURE (8xxx) ----- */
-     136              :     REQUEST_EXPIRED_SESSION: {
-     137              :       'message': 'Session request expired.',
-     138              :       'code': 8000,
-     139              :     },
-     140              :     /* ----- PAIRING (10xxx) ----- */
-     141              :     WC_METHOD_UNSUPPORTED: {
-     142              :       'message': 'Unsupported wc_ method.',
-     143              :       'code': 10001,
-     144              :     },
-     145              :     /* ----- AUTH VALIDATION (11xxx) ----- */
-     146              :     MALFORMED_RESPONSE_PARAMS: {
-     147              :       'message': 'Malformed response parameters.',
-     148              :       'code': 11001,
-     149              :     },
-     150              :     MALFORMED_REQUEST_PARAMS: {
-     151              :       'message': 'Malformed request parameters.',
-     152              :       'code': 11002,
-     153              :     },
-     154              :     MESSAGE_COMPROMISED: {
-     155              :       'message': 'Message compromised.',
-     156              :       'code': 11003,
-     157              :     },
-     158              :     SIGNATURE_VERIFICATION_FAILED: {
-     159              :       'message': 'Signature verification failed.',
-     160              :       'code': 11004,
-     161              :     },
-     162              :     REQUEST_EXPIRED_AUTH: {
-     163              :       'message': 'Auth request expired.',
-     164              :       'code': 11005,
-     165              :     },
-     166              :     MISSING_ISSUER_AUTH: {
-     167              :       'message': 'Missing Issuer.',
-     168              :       'code': 11006,
-     169              :     },
-     170              :     /* ----- AUTH REJECTED (12xxx) ----- */
-     171              :     USER_REJECTED_AUTH: {
-     172              :       'message': 'User rejected auth request.',
-     173              :       'code': 12001,
-     174              :     },
-     175              :     USER_DISCONNECTED_AUTH: {
-     176              :       'message': 'User disconnect auth.',
-     177              :       'code': 12002,
-     178              :     },
-     179              :   };
-     180              : 
-     181              :   static const NOT_INITIALIZED = 'NOT_INITIALIZED';
-     182              :   static const NO_MATCHING_KEY = 'NO_MATCHING_KEY';
-     183              :   static const RESTORE_WILL_OVERRIDE = 'RESTORE_WILL_OVERRIDE';
-     184              :   static const RESUBSCRIBED = 'RESUBSCRIBED';
-     185              :   static const MISSING_OR_INVALID = 'MISSING_OR_INVALID';
-     186              :   static const EXPIRED = 'EXPIRED';
-     187              :   static const UNKNOWN_TYPE = 'UNKNOWN_TYPE';
-     188              :   static const MISMATCHED_TOPIC = 'MISMATCHED_TOPIC';
-     189              :   static const NON_CONFORMING_NAMESPACES = 'NON_CONFORMING_NAMESPACES';
-     190              : 
-     191              :   static const INTERNAL_ERRORS = {
-     192              :     NOT_INITIALIZED: {
-     193              :       'message': 'Not initialized.',
-     194              :       'code': 1,
-     195              :     },
-     196              :     NO_MATCHING_KEY: {
-     197              :       'message': 'No matching key.',
-     198              :       'code': 2,
-     199              :     },
-     200              :     RESTORE_WILL_OVERRIDE: {
-     201              :       'message': 'Restore will override.',
-     202              :       'code': 3,
-     203              :     },
-     204              :     RESUBSCRIBED: {
-     205              :       'message': 'Resubscribed.',
-     206              :       'code': 4,
-     207              :     },
-     208              :     MISSING_OR_INVALID: {
-     209              :       'message': 'Missing or invalid.',
-     210              :       'code': 5,
-     211              :     },
-     212              :     EXPIRED: {
-     213              :       'message': 'Expired.',
-     214              :       'code': 6,
-     215              :     },
-     216              :     UNKNOWN_TYPE: {
-     217              :       'message': 'Unknown type.',
-     218              :       'code': 7,
-     219              :     },
-     220              :     MISMATCHED_TOPIC: {
-     221              :       'message': 'Mismatched topic.',
-     222              :       'code': 8,
-     223              :     },
-     224              :     NON_CONFORMING_NAMESPACES: {
-     225              :       'message': 'Non conforming namespaces.',
-     226              :       'code': 9,
-     227              :     },
-     228              :   };
-     229              : 
-     230            7 :   static WalletConnectError getInternalError(
-     231              :     String key, {
-     232              :     String context = '',
-     233              :   }) {
-     234            7 :     if (INTERNAL_ERRORS.containsKey(key)) {
-     235            7 :       return WalletConnectError(
-     236           14 :         code: INTERNAL_ERRORS[key]!['code']! as int,
-     237            7 :         message: context != ''
-     238           12 :             ? "${INTERNAL_ERRORS[key]!['message']! as String} $context"
-     239            8 :             : INTERNAL_ERRORS[key]!['message']! as String,
-     240              :       );
-     241              :     }
-     242              :     return const WalletConnectError(
-     243              :         code: -1, message: 'UNKNOWN INTERNAL ERROR');
-     244              :   }
-     245              : 
-     246            6 :   static WalletConnectError getSdkError(
-     247              :     String key, {
-     248              :     String context = '',
-     249              :   }) {
-     250            6 :     if (SDK_ERRORS.containsKey(key)) {
-     251            6 :       return WalletConnectError(
-     252           12 :         code: SDK_ERRORS[key]!['code']! as int,
-     253            6 :         message: context != ''
-     254           12 :             ? "${SDK_ERRORS[key]!['message']! as String} $context"
-     255           14 :             : SDK_ERRORS[key]!['message']! as String,
-     256              :       );
-     257              :     }
-     258              :     return const WalletConnectError(code: -1, message: 'UNKNOWN SDK ERROR');
-     259              :   }
-     260              : }
-     261              : 
-     262              : class WebSocketErrors {
-     263              :   static const int PROJECT_ID_NOT_FOUND = 401;
-     264              :   static const int INVALID_PROJECT_ID = 403;
-     265              :   static const int TOO_MANY_REQUESTS = 1013;
-     266              :   static const String INVALID_PROJECT_ID_OR_JWT =
-     267              :       'Invalid project ID or JWT Token';
-     268              :   static const String INVALID_PROJECT_ID_MESSAGE =
-     269              :       'Invalid project id. Please check your project id.';
-     270              :   static const String PROJECT_ID_NOT_FOUND_MESSAGE = 'Project id not found.';
-     271              :   static const String TOO_MANY_REQUESTS_MESSAGE =
-     272              :       'Too many requests. Please try again later.';
-     273              : 
-     274              :   static const int SERVER_TERMINATING = 1001;
-     275              :   static const int CLIENT_STALE = 4008;
-     276              :   static const int LOAD_REBALANCING = 4010;
-     277              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/utils/extensions.dart.func-c.html b/coverage/html/utils/extensions.dart.func-c.html deleted file mode 100644 index be64b2eb..00000000 --- a/coverage/html/utils/extensions.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - utils/extensions.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - utils - extensions.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %400
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/utils/extensions.dart.func.html b/coverage/html/utils/extensions.dart.func.html deleted file mode 100644 index 9d6d0e10..00000000 --- a/coverage/html/utils/extensions.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - utils/extensions.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - utils - extensions.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:0.0 %400
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/utils/extensions.dart.gcov.html b/coverage/html/utils/extensions.dart.gcov.html deleted file mode 100644 index 2eb02495..00000000 --- a/coverage/html/utils/extensions.dart.gcov.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - LCOV - lcov.info - utils/extensions.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - utils - extensions.dartCoverageTotalHit
Test:lcov.infoLines:0.0 %400
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:typed_data';
-       2              : 
-       3              : import 'package:convert/convert.dart';
-       4              : import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart';
-       5              : import 'package:web3dart/crypto.dart' as crypto;
-       6              : 
-       7              : extension TransactionExtension on Transaction {
-       8            0 :   Map<String, dynamic> toJson() {
-       9            0 :     return {
-      10            0 :       if (from != null) 'from': from!.hex,
-      11            0 :       if (to != null) 'to': to!.hex,
-      12            0 :       if (maxGas != null) 'gas': '0x${maxGas!.toRadixString(16)}',
-      13            0 :       if (gasPrice != null)
-      14            0 :         'gasPrice': '0x${gasPrice!.getInWei.toRadixString(16)}',
-      15            0 :       if (value != null) 'value': '0x${value!.getInWei.toRadixString(16)}',
-      16            0 :       if (data != null) 'data': crypto.bytesToHex(data!),
-      17            0 :       if (nonce != null) 'nonce': nonce,
-      18            0 :       if (maxFeePerGas != null)
-      19            0 :         'maxFeePerGas': '0x${maxFeePerGas!.getInWei.toRadixString(16)}',
-      20            0 :       if (maxPriorityFeePerGas != null)
-      21            0 :         'maxPriorityFeePerGas':
-      22            0 :             '0x${maxPriorityFeePerGas!.getInWei.toRadixString(16)}',
-      23              :     };
-      24              :   }
-      25              : }
-      26              : 
-      27              : extension TransactionExtension2 on Map<String, dynamic> {
-      28            0 :   Transaction toTransaction() {
-      29            0 :     return Transaction(
-      30            0 :       from: EthereumAddress.fromHex(this['from']),
-      31            0 :       to: EthereumAddress.fromHex(this['to']),
-      32            0 :       value: (this['value'] as String?).toEthereAmount(),
-      33            0 :       gasPrice: (this['gasPrice'] as String?).toEthereAmount(),
-      34            0 :       maxFeePerGas: (this['maxFeePerGas'] as String?).toEthereAmount(),
-      35              :       maxPriorityFeePerGas:
-      36            0 :           (this['maxPriorityFeePerGas'] as String?).toEthereAmount(),
-      37            0 :       maxGas: (this['maxGas'] as String?).toIntFromHex(),
-      38            0 :       nonce: this['nonce']?.toInt(),
-      39            0 :       data: _parseTransactionData(this['data']),
-      40              :     );
-      41              :   }
-      42              : }
-      43              : 
-      44            0 : Uint8List? _parseTransactionData(dynamic data) {
-      45            0 :   if (data != null && data != '0x') {
-      46            0 :     if (data.startsWith('0x')) {
-      47            0 :       return Uint8List.fromList(hex.decode(data.substring(2)));
-      48              :     }
-      49            0 :     return Uint8List.fromList(hex.decode(data));
-      50              :   }
-      51              :   return null;
-      52              : }
-      53              : 
-      54              : extension EtheraAmountExtension on String? {
-      55            0 :   EtherAmount? toEthereAmount() {
-      56              :     if (this != null) {
-      57            0 :       final hexValue = this!.replaceFirst('0x', '');
-      58            0 :       return EtherAmount.fromBigInt(
-      59              :         EtherUnit.wei,
-      60            0 :         BigInt.from(int.parse(hexValue, radix: 16)),
-      61              :       );
-      62              :     }
-      63              :     return null;
-      64              :   }
-      65              : 
-      66            0 :   int? toIntFromHex() {
-      67              :     if (this != null) {
-      68            0 :       final hexValue = this!.replaceFirst('0x', '');
-      69            0 :       return int.parse(hexValue, radix: 16);
-      70              :     }
-      71              :     return null;
-      72              :   }
-      73              : 
-      74            0 :   int? toInt() {
-      75              :     if (this != null) {
-      76            0 :       return int.tryParse(this!);
-      77              :     }
-      78              :     return null;
-      79              :   }
-      80              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/utils/index-sort-f.html b/coverage/html/utils/index-sort-f.html deleted file mode 100644 index 1185ae09..00000000 --- a/coverage/html/utils/index-sort-f.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - LCOV - lcov.info - utils - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - utilsCoverageTotalHit
Test:lcov.infoLines:71.2 %319227
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
errors.dart -
100.0%
-
100.0 %1414-
extensions.dart -
0.0%
-
0.0 %40-
log_level.dart -
100.0%
-
100.0 %77-
namespace_utils.dart -
76.2%76.2%
-
76.2 %168128-
walletconnect_utils.dart -
86.7%86.7%
-
86.7 %9078-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/utils/index-sort-l.html b/coverage/html/utils/index-sort-l.html deleted file mode 100644 index 1bd04649..00000000 --- a/coverage/html/utils/index-sort-l.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - LCOV - lcov.info - utils - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - utilsCoverageTotalHit
Test:lcov.infoLines:71.2 %319227
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
extensions.dart -
0.0%
-
0.0 %40
namespace_utils.dart -
76.2%76.2%
-
76.2 %168128
walletconnect_utils.dart -
86.7%86.7%
-
86.7 %9078
log_level.dart -
100.0%
-
100.0 %77
errors.dart -
100.0%
-
100.0 %1414
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/utils/index.html b/coverage/html/utils/index.html deleted file mode 100644 index a7edd2ee..00000000 --- a/coverage/html/utils/index.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - LCOV - lcov.info - utils - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - utilsCoverageTotalHit
Test:lcov.infoLines:71.2 %319227
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
errors.dart -
100.0%
-
100.0 %1414
extensions.dart -
0.0%
-
0.0 %40
log_level.dart -
100.0%
-
100.0 %77
namespace_utils.dart -
76.2%76.2%
-
76.2 %168128
walletconnect_utils.dart -
86.7%86.7%
-
86.7 %9078
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/utils/log_level.dart.func-c.html b/coverage/html/utils/log_level.dart.func-c.html deleted file mode 100644 index 36dea479..00000000 --- a/coverage/html/utils/log_level.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - utils/log_level.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - utils - log_level.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %77
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/utils/log_level.dart.func.html b/coverage/html/utils/log_level.dart.func.html deleted file mode 100644 index 6305a1d9..00000000 --- a/coverage/html/utils/log_level.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - utils/log_level.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - utils - log_level.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:100.0 %77
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/utils/log_level.dart.gcov.html b/coverage/html/utils/log_level.dart.gcov.html deleted file mode 100644 index de0219dc..00000000 --- a/coverage/html/utils/log_level.dart.gcov.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - LCOV - lcov.info - utils/log_level.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - utils - log_level.dartCoverageTotalHit
Test:lcov.infoLines:100.0 %77
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:logger/logger.dart';
-       2              : 
-       3              : enum LogLevel {
-       4              :   verbose,
-       5              :   debug,
-       6              :   info,
-       7              :   warning,
-       8              :   error,
-       9              :   wtf,
-      10              :   nothing;
-      11              : 
-      12           10 :   Level toLevel() {
-      13              :     switch (this) {
-      14           10 :       case LogLevel.verbose:
-      15              :         return Level.trace;
-      16           10 :       case LogLevel.debug:
-      17              :         return Level.debug;
-      18           10 :       case LogLevel.info:
-      19              :         return Level.info;
-      20            6 :       case LogLevel.warning:
-      21              :         return Level.warning;
-      22            6 :       case LogLevel.error:
-      23              :         return Level.error;
-      24            6 :       case LogLevel.wtf:
-      25              :         return Level.fatal;
-      26              :       default:
-      27              :         return Level.off;
-      28              :     }
-      29              :   }
-      30              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/utils/namespace_utils.dart.func-c.html b/coverage/html/utils/namespace_utils.dart.func-c.html deleted file mode 100644 index 11a15ec7..00000000 --- a/coverage/html/utils/namespace_utils.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - utils/namespace_utils.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - utils - namespace_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:76.2 %168128
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/utils/namespace_utils.dart.func.html b/coverage/html/utils/namespace_utils.dart.func.html deleted file mode 100644 index 0d1b2b48..00000000 --- a/coverage/html/utils/namespace_utils.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - utils/namespace_utils.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - utils - namespace_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:76.2 %168128
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/utils/namespace_utils.dart.gcov.html b/coverage/html/utils/namespace_utils.dart.gcov.html deleted file mode 100644 index 39745484..00000000 --- a/coverage/html/utils/namespace_utils.dart.gcov.html +++ /dev/null @@ -1,515 +0,0 @@ - - - - - - - LCOV - lcov.info - utils/namespace_utils.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - utils - namespace_utils.dartCoverageTotalHit
Test:lcov.infoLines:76.2 %168128
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/proposal_models.dart';
-       2              : import 'package:walletconnect_flutter_v2/apis/sign_api/models/session_models.dart';
-       3              : import 'package:walletconnect_flutter_v2/apis/utils/constants.dart';
-       4              : 
-       5              : class NamespaceUtils {
-       6              :   /// Checks if the string is a chain
-       7            6 :   static bool isValidChainId(String value) {
-       8            6 :     if (value.contains(':')) {
-       9            6 :       List<String> split = value.split(':');
-      10           12 :       return split.length == 2;
-      11              :     }
-      12              :     return false;
-      13              :   }
-      14              : 
-      15              :   /// Checks if the string is an account
-      16            6 :   static bool isValidAccount(String value) {
-      17            6 :     if (value.contains(':')) {
-      18            6 :       List<String> split = value.split(':');
-      19           12 :       if (split.length == 3) {
-      20           18 :         String chainId = '${split[0]}:${split[1]}';
-      21           18 :         return split.length >= 2 && isValidChainId(chainId);
-      22              :       }
-      23              :     }
-      24              :     return false;
-      25              :   }
-      26              : 
-      27            4 :   static bool isValidUrl(String value) {
-      28              :     try {
-      29            4 :       Uri.parse(value);
-      30              :       return true;
-      31              :     } catch (e) {
-      32              :       return false;
-      33              :     }
-      34              :   }
-      35              : 
-      36            1 :   static String getAccount(String namespaceAccount) {
-      37            1 :     if (isValidAccount(namespaceAccount)) {
-      38            2 :       return namespaceAccount.split(':')[2];
-      39              :     }
-      40              :     return namespaceAccount;
-      41              :   }
-      42              : 
-      43            6 :   static String getChainFromAccount(String account) {
-      44            6 :     if (isValidAccount(account)) {
-      45            6 :       List<String> parts = account.split(':');
-      46            6 :       String namespace = parts[0];
-      47            6 :       String reference = parts[1];
-      48            6 :       return '$namespace:$reference';
-      49              :     }
-      50              :     return account;
-      51              :   }
-      52              : 
-      53              :   /// Gets all unique chains from the provided list of accounts
-      54              :   /// This function assumes that all accounts are valid
-      55            6 :   static List<String> getChainsFromAccounts(List<String> accounts) {
-      56              :     Set<String> chains = {};
-      57           12 :     for (var account in accounts) {
-      58            6 :       chains.add(
-      59            6 :         getChainFromAccount(
-      60              :           account,
-      61              :         ),
-      62              :       );
-      63              :     }
-      64              : 
-      65            6 :     return chains.toList();
-      66              :   }
-      67              : 
-      68              :   /// Gets the namespace string id from the chainId
-      69              :   /// If the chain id is not valid, then it returns the chain id
-      70            1 :   static String getNamespaceFromChain(String chainId) {
-      71            1 :     if (isValidChainId(chainId)) {
-      72            2 :       return chainId.split(':')[0];
-      73              :     }
-      74              :     return chainId;
-      75              :   }
-      76              : 
-      77              :   /// Gets all unique namespaces from the provided list of accounts
-      78              :   /// This function assumes that all accounts are valid
-      79            0 :   static Map<String, Namespace> getNamespacesFromAccounts(
-      80              :     List<String> accounts,
-      81              :   ) {
-      82            0 :     Map<String, Namespace> namespaces = {};
-      83            0 :     for (var account in accounts) {
-      84            0 :       final ns = account.split(':')[0];
-      85            0 :       final cid = account.split(':')[1];
-      86            0 :       if (namespaces[ns] == null) {
-      87            0 :         namespaces[ns] = Namespace(
-      88            0 :           accounts: [],
-      89            0 :           methods: [],
-      90            0 :           events: [],
-      91              :         );
-      92              :       }
-      93            0 :       namespaces[ns] = namespaces[ns]!.copyWith(
-      94            0 :         accounts: [
-      95            0 :           ...namespaces[ns]!.accounts,
-      96            0 :           account,
-      97              :         ],
-      98            0 :         chains: [
-      99            0 :           ...(namespaces[ns]?.chains ?? []),
-     100            0 :           '$ns:$cid',
-     101              :         ],
-     102              :       );
-     103              :     }
-     104              : 
-     105              :     return namespaces;
-     106              :   }
-     107              : 
-     108              :   /// Gets the chains from the namespace.
-     109              :   /// If the namespace is a chain, then it returns the chain.
-     110              :   /// Otherwise it gets the chains from the accounts in the namespace.
-     111            6 :   static List<String> getChainIdsFromNamespace({
-     112              :     required String nsOrChainId,
-     113              :     required Namespace namespace,
-     114              :   }) {
-     115            6 :     if (isValidChainId(nsOrChainId)) {
-     116            6 :       return [nsOrChainId];
-     117              :     }
-     118              : 
-     119           12 :     return getChainsFromAccounts(namespace.accounts);
-     120              :   }
-     121              : 
-     122              :   /// Gets the chainIds from the namespace.
-     123            5 :   static List<String> getChainIdsFromNamespaces({
-     124              :     required Map<String, Namespace> namespaces,
-     125              :   }) {
-     126              :     Set<String> chainIds = {};
-     127              : 
-     128           10 :     namespaces.forEach((String ns, Namespace namespace) {
-     129            5 :       chainIds.addAll(
-     130            5 :         getChainIdsFromNamespace(
-     131              :           nsOrChainId: ns,
-     132              :           namespace: namespace,
-     133              :         ),
-     134              :       );
-     135              :     });
-     136              : 
-     137            5 :     return chainIds.toList();
-     138              :   }
-     139              : 
-     140              :   /// Gets the methods from a namespace map for the given chain
-     141            5 :   static List<String> getNamespacesMethodsForChainId({
-     142              :     required String chainId,
-     143              :     required Map<String, Namespace> namespaces,
-     144              :   }) {
-     145            5 :     List<String> methods = [];
-     146           10 :     namespaces.forEach((String nsOrChain, Namespace namespace) {
-     147            5 :       if (nsOrChain == chainId) {
-     148            2 :         methods.addAll(namespace.methods);
-     149              :       } else {
-     150           10 :         List<String> chains = getChainsFromAccounts(namespace.accounts);
-     151            5 :         if (chains.contains(chainId)) {
-     152           10 :           methods.addAll(namespace.methods);
-     153              :         }
-     154              :       }
-     155              :     });
-     156              : 
-     157              :     return methods;
-     158              :   }
-     159              : 
-     160              :   /// Gets the optional methods from a namespace map for the given chain
-     161            0 :   static List<String> getOptionalMethodsForChainId({
-     162              :     required String chainId,
-     163              :     required Map<String, RequiredNamespace> optionalNamespaces,
-     164              :   }) {
-     165            0 :     List<String> methods = [];
-     166            0 :     optionalNamespaces.forEach((String nsOrChain, RequiredNamespace rns) {
-     167            0 :       if (nsOrChain == chainId) {
-     168            0 :         methods.addAll(rns.methods);
-     169              :       } else {
-     170            0 :         if ((rns.chains ?? []).contains('$nsOrChain:$chainId')) {
-     171            0 :           methods.addAll(rns.methods);
-     172              :         }
-     173              :       }
-     174              :     });
-     175              : 
-     176              :     return methods;
-     177              :   }
-     178              : 
-     179              :   /// Gets the methods from a namespace map for the given chain id
-     180            5 :   static List<String> getNamespacesEventsForChain({
-     181              :     required String chainId,
-     182              :     required Map<String, Namespace> namespaces,
-     183              :   }) {
-     184            5 :     List<String> events = [];
-     185           10 :     namespaces.forEach((String nsOrChain, Namespace namespace) {
-     186            5 :       if (nsOrChain == chainId) {
-     187            2 :         events.addAll(namespace.events);
-     188              :       } else {
-     189           10 :         List<String> chains = getChainsFromAccounts(namespace.accounts);
-     190            5 :         if (chains.contains(chainId)) {
-     191           10 :           events.addAll(namespace.events);
-     192              :         }
-     193              :       }
-     194              :     });
-     195              : 
-     196              :     return events;
-     197              :   }
-     198              : 
-     199              :   /// If the namespace is a chain, add it to the list and return it
-     200              :   /// Otherwise, get the chains from the required namespaces
-     201            6 :   static List<String> getChainsFromRequiredNamespace({
-     202              :     required String nsOrChainId,
-     203              :     required RequiredNamespace requiredNamespace,
-     204              :   }) {
-     205            6 :     List<String> chains = [];
-     206            6 :     if (isValidChainId(nsOrChainId)) {
-     207            6 :       chains.add(nsOrChainId);
-     208            6 :     } else if (requiredNamespace.chains != null) {
-     209              :       // We are assuming that the namespace is a chain
-     210              :       // Validate the requiredNamespace before it is sent here
-     211           12 :       chains.addAll(requiredNamespace.chains!);
-     212              :     }
-     213              : 
-     214              :     return chains;
-     215              :   }
-     216              : 
-     217              :   /// Gets the chains from the required namespaces
-     218              :   /// If keys value is provided, it will only get the chains for the provided keys
-     219            1 :   static List<String> getChainIdsFromRequiredNamespaces({
-     220              :     required Map<String, RequiredNamespace> requiredNamespaces,
-     221              :   }) {
-     222              :     Set<String> chainIds = {};
-     223              : 
-     224              :     // Loop through the required namespaces
-     225            2 :     requiredNamespaces.forEach((String ns, RequiredNamespace value) {
-     226            1 :       chainIds.addAll(
-     227            1 :         getChainsFromRequiredNamespace(
-     228              :           nsOrChainId: ns,
-     229              :           requiredNamespace: value,
-     230              :         ),
-     231              :       );
-     232              :     });
-     233              : 
-     234            1 :     return chainIds.toList();
-     235              :   }
-     236              : 
-     237              :   /// Using the availabe accounts, methods, and events, construct the namespaces
-     238              :   /// If optional namespaces are provided, then they will be added to the namespaces as well
-     239            4 :   static Map<String, Namespace> constructNamespaces({
-     240              :     required Set<String> availableAccounts,
-     241              :     required Set<String> availableMethods,
-     242              :     required Set<String> availableEvents,
-     243              :     required Map<String, RequiredNamespace> requiredNamespaces,
-     244              :     Map<String, RequiredNamespace>? optionalNamespaces,
-     245              :   }) {
-     246            4 :     final Map<String, Namespace> namespaces = _constructNamespaces(
-     247              :       availableAccounts: availableAccounts,
-     248              :       availableMethods: availableMethods,
-     249              :       availableEvents: availableEvents,
-     250              :       namespacesMap: requiredNamespaces,
-     251              :     );
-     252            4 :     final Map<String, Namespace> optionals = _constructNamespaces(
-     253              :       availableAccounts: availableAccounts,
-     254              :       availableMethods: availableMethods,
-     255              :       availableEvents: availableEvents,
-     256            1 :       namespacesMap: optionalNamespaces ?? {},
-     257              :     );
-     258              : 
-     259              :     // Loop through the optional keys and if they exist in the namespaces, then merge them and delete them from optional
-     260            8 :     List<String> keys = optionals.keys.toList();
-     261            9 :     for (int i = 0; i < keys.length; i++) {
-     262            1 :       String key = keys[i];
-     263            1 :       if (namespaces.containsKey(key)) {
-     264            2 :         namespaces[key] = Namespace(
-     265            1 :           accounts: namespaces[key]!
-     266            1 :               .accounts
-     267            1 :               .toSet()
-     268            4 :               .union(optionals[key]!.accounts.toSet())
-     269            1 :               .toList(),
-     270            1 :           methods: namespaces[key]!
-     271            1 :               .methods
-     272            1 :               .toSet()
-     273            4 :               .union(optionals[key]!.methods.toSet())
-     274            1 :               .toList(),
-     275            1 :           events: namespaces[key]!
-     276            1 :               .events
-     277            1 :               .toSet()
-     278            4 :               .union(optionals[key]!.events.toSet())
-     279            1 :               .toList(),
-     280              :         );
-     281            1 :         optionals.remove(key);
-     282              :       }
-     283              :     }
-     284              : 
-     285            4 :     return {
-     286              :       ...namespaces,
-     287            4 :       ...optionals,
-     288              :     };
-     289              :   }
-     290              : 
-     291            0 :   static Map<String, Namespace> buildNamespacesFromAuth({
-     292              :     required Set<String> methods,
-     293              :     required Set<String> accounts,
-     294              :   }) {
-     295            0 :     final parsedAccounts = accounts.map(
-     296            0 :       (account) => account.replaceAll('did:pkh:', ''),
-     297              :     );
-     298              : 
-     299            0 :     final namespaces = getNamespacesFromAccounts(parsedAccounts.toList());
-     300              : 
-     301            0 :     final entries = namespaces.entries.map((e) {
-     302            0 :       return MapEntry(
-     303            0 :         e.key,
-     304            0 :         Namespace.fromJson(e.value.toJson()).copyWith(
-     305            0 :           methods: methods.toList(),
-     306              :           events: EventsConstants.allEvents,
-     307              :         ),
-     308              :       );
-     309              :     });
-     310              : 
-     311            0 :     return Map<String, Namespace>.fromEntries(entries);
-     312              :   }
-     313              : 
-     314              :   /// Gets the matching items from the available items using the chainId
-     315              :   /// This function assumes that each element in the available items is in the format of chainId:itemId
-     316            4 :   static Set<String> _getMatching({
-     317              :     required String namespaceOrChainId,
-     318              :     required Set<String> available,
-     319              :     Set<String>? requested,
-     320              :     bool takeLast = true,
-     321              :   }) {
-     322              :     Set<String> matching = {};
-     323              :     // Loop through the available items, and if it starts with the chainId,
-     324              :     // and is in the requested items, add it to the matching items
-     325            8 :     for (var item in available) {
-     326            8 :       if (item.startsWith('$namespaceOrChainId:')) {
-     327           12 :         matching.add(takeLast ? item.split(':').last : item);
-     328              :       }
-     329              :     }
-     330              : 
-     331              :     if (requested != null) {
-     332            4 :       matching = matching.intersection(requested);
-     333              :     }
-     334              : 
-     335              :     return matching;
-     336              :   }
-     337              : 
-     338            4 :   static Map<String, Namespace> _constructNamespaces({
-     339              :     required Set<String> availableAccounts,
-     340              :     required Set<String> availableMethods,
-     341              :     required Set<String> availableEvents,
-     342              :     required Map<String, RequiredNamespace> namespacesMap,
-     343              :   }) {
-     344            4 :     Map<String, Namespace> namespaces = {};
-     345              : 
-     346              :     // Loop through the required namespaces
-     347            8 :     for (final String namespaceOrChainId in namespacesMap.keys) {
-     348              :       // If the key is a chain, add all of the chain specific events, keys, and methods first
-     349            4 :       final List<String> accounts = [];
-     350            4 :       final List<String> events = [];
-     351            4 :       final List<String> methods = [];
-     352            4 :       final namespace = namespacesMap[namespaceOrChainId]!;
-     353            8 :       final chains = namespace.chains ?? [];
-     354            8 :       if (NamespaceUtils.isValidChainId(namespaceOrChainId) || chains.isEmpty) {
-     355              :         // Add the chain specific availableAccounts
-     356            4 :         accounts.addAll(
-     357            4 :           _getMatching(
-     358              :             namespaceOrChainId: namespaceOrChainId,
-     359              :             available: availableAccounts,
-     360              :             takeLast: false,
-     361              :           ),
-     362              :         );
-     363              :         // Add the chain specific events
-     364            4 :         events.addAll(
-     365            4 :           _getMatching(
-     366              :             namespaceOrChainId: namespaceOrChainId,
-     367              :             available: availableEvents,
-     368            8 :             requested: namespace.events.toSet(),
-     369              :           ),
-     370              :         );
-     371              :         // Add the chain specific methods
-     372            4 :         methods.addAll(
-     373            4 :           _getMatching(
-     374              :             namespaceOrChainId: namespaceOrChainId,
-     375              :             available: availableMethods,
-     376            8 :             requested: namespace.methods.toSet(),
-     377              :           ),
-     378              :         );
-     379              :       } else {
-     380              :         // Loop through all of the chains
-     381            8 :         for (final String chainId in chains) {
-     382              :           // Add the chain specific availableAccounts
-     383            4 :           accounts.addAll(
-     384            4 :             _getMatching(
-     385              :               namespaceOrChainId: chainId,
-     386              :               available: availableAccounts,
-     387           12 :             ).map((e) => '$chainId:$e'),
-     388              :           );
-     389              :           // Add the chain specific events
-     390            4 :           events.addAll(
-     391            4 :             _getMatching(
-     392              :               namespaceOrChainId: chainId,
-     393              :               available: availableEvents,
-     394            8 :               requested: namespace.events.toSet(),
-     395              :             ),
-     396              :           );
-     397              :           // Add the chain specific methods
-     398            4 :           methods.addAll(
-     399            4 :             _getMatching(
-     400              :               namespaceOrChainId: chainId,
-     401              :               available: availableMethods,
-     402            8 :               requested: namespace.methods.toSet(),
-     403              :             ),
-     404              :           );
-     405              :         }
-     406              :       }
-     407              : 
-     408              :       // Add the namespace to the list
-     409            8 :       namespaces[namespaceOrChainId] = Namespace(
-     410            8 :         accounts: accounts.toSet().toList(),
-     411            8 :         events: events.toSet().toList(),
-     412            8 :         methods: methods.toSet().toList(),
-     413              :       );
-     414              :     }
-     415              : 
-     416              :     return namespaces;
-     417              :   }
-     418              : 
-     419              :   /// To be used by Wallet to regenerate already generatedNamespaces but adding `chains` parameter
-     420              :   ///
-     421              :   /// Example usage on onSessionProposal(SessionProposalEvent? event)
-     422              :   ///
-     423              :   /// await _web3Wallet!.approveSession(
-     424              :   ///   id: event.id,
-     425              :   ///   namespaces: NamespaceUtils.regenerateNamespacesWithChains(
-     426              :   ///     event.params.generatedNamespaces!,
-     427              :   ///   ),
-     428              :   ///   sessionProperties: event.params.sessionProperties,
-     429              :   /// );
-     430              : 
-     431            0 :   static Map<String, Namespace> regenerateNamespacesWithChains(
-     432              :     Map<String, Namespace> generatedNamespaces,
-     433              :   ) {
-     434            0 :     Map<String, Namespace> regeneratedNamespaces = {};
-     435            0 :     for (var key in generatedNamespaces.keys) {
-     436            0 :       final namespace = generatedNamespaces[key]!.copyWith(
-     437            0 :         chains: getChainsFromAccounts(generatedNamespaces[key]!.accounts),
-     438              :       );
-     439            0 :       regeneratedNamespaces[key] = namespace;
-     440              :     }
-     441              :     return regeneratedNamespaces;
-     442              :   }
-     443              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/utils/walletconnect_utils.dart.func-c.html b/coverage/html/utils/walletconnect_utils.dart.func-c.html deleted file mode 100644 index 16648e77..00000000 --- a/coverage/html/utils/walletconnect_utils.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - utils/walletconnect_utils.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - utils - walletconnect_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:86.7 %9078
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/utils/walletconnect_utils.dart.func.html b/coverage/html/utils/walletconnect_utils.dart.func.html deleted file mode 100644 index 5c9e25dd..00000000 --- a/coverage/html/utils/walletconnect_utils.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - utils/walletconnect_utils.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - utils - walletconnect_utils.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:86.7 %9078
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/utils/walletconnect_utils.dart.gcov.html b/coverage/html/utils/walletconnect_utils.dart.gcov.html deleted file mode 100644 index 11a6ee07..00000000 --- a/coverage/html/utils/walletconnect_utils.dart.gcov.html +++ /dev/null @@ -1,302 +0,0 @@ - - - - - - - LCOV - lcov.info - utils/walletconnect_utils.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - utils - walletconnect_utils.dartCoverageTotalHit
Test:lcov.infoLines:86.7 %9078
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'dart:convert';
-       2              : import 'dart:io';
-       3              : 
-       4              : import 'package:package_info_plus/package_info_plus.dart';
-       5              : import 'package:flutter/foundation.dart' show kIsWeb;
-       6              : import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart';
-       7              : 
-       8              : class WalletConnectUtils {
-       9            7 :   static bool isExpired(int expiry) {
-      10           21 :     return DateTime.now().toUtc().compareTo(
-      11            7 :               DateTime.fromMillisecondsSinceEpoch(
-      12            7 :                 toMilliseconds(expiry),
-      13              :               ),
-      14            7 :             ) >=
-      15              :         0;
-      16              :   }
-      17              : 
-      18            0 :   static DateTime expiryToDateTime(int expiry) {
-      19            0 :     final milliseconds = expiry * 1000;
-      20            0 :     return DateTime.fromMillisecondsSinceEpoch(milliseconds);
-      21              :   }
-      22              : 
-      23            7 :   static int toMilliseconds(int seconds) {
-      24            7 :     return seconds * 1000;
-      25              :   }
-      26              : 
-      27            7 :   static int calculateExpiry(int offset) {
-      28           35 :     return DateTime.now().toUtc().millisecondsSinceEpoch ~/ 1000 + offset;
-      29              :   }
-      30              : 
-      31            9 :   static String getOS() {
-      32              :     if (kIsWeb) {
-      33              :       // TODO change this into an actual value
-      34              :       return 'web-browser';
-      35              :     } else {
-      36           27 :       return <String>[Platform.operatingSystem, Platform.operatingSystemVersion]
-      37            9 :           .join('-');
-      38              :     }
-      39              :   }
-      40              : 
-      41            9 :   static Future<String> getPackageName() async {
-      42            9 :     final packageInfo = await PackageInfo.fromPlatform();
-      43            9 :     return packageInfo.packageName;
-      44              :   }
-      45              : 
-      46            9 :   static String getId() {
-      47              :     if (kIsWeb) {
-      48              :       return 'web';
-      49              :     } else {
-      50            9 :       if (Platform.isAndroid) {
-      51              :         return 'android';
-      52            9 :       } else if (Platform.isIOS) {
-      53              :         return 'ios';
-      54            9 :       } else if (Platform.isLinux) {
-      55              :         return 'linux';
-      56            9 :       } else if (Platform.isMacOS) {
-      57              :         return 'macos';
-      58            0 :       } else if (Platform.isWindows) {
-      59              :         return 'windows';
-      60              :       } else {
-      61              :         return 'unknown';
-      62              :       }
-      63              :     }
-      64              :   }
-      65              : 
-      66            9 :   static String formatUA(
-      67              :     String protocol,
-      68              :     int version,
-      69              :     String sdkVersion,
-      70              :   ) {
-      71            9 :     String os = getOS();
-      72            9 :     String id = getId();
-      73            9 :     return <String>[
-      74           18 :       [protocol, version].join('-'),
-      75           18 :       <String>['Flutter', sdkVersion].join('-'),
-      76              :       os,
-      77              :       id,
-      78            9 :     ].join('/');
-      79              :   }
-      80              : 
-      81            9 :   static String formatRelayRpcUrl({
-      82              :     required String protocol,
-      83              :     required int version,
-      84              :     required String relayUrl,
-      85              :     required String sdkVersion,
-      86              :     required String auth,
-      87              :     String? projectId,
-      88              :     String? packageName,
-      89              :   }) {
-      90            9 :     final Uri uri = Uri.parse(relayUrl);
-      91           18 :     final Map<String, String> queryParams = Uri.splitQueryString(uri.query);
-      92            9 :     final userAgent = formatUA(protocol, version, sdkVersion);
-      93              : 
-      94              :     // Add basic query params
-      95            9 :     final Map<String, String> relayParams = {
-      96              :       'auth': auth,
-      97              :       'ua': userAgent,
-      98              :     };
-      99              : 
-     100              :     // Add projectId query param
-     101            9 :     if ((projectId ?? '').isNotEmpty) {
-     102            9 :       relayParams['projectId'] = projectId!;
-     103              :     }
-     104              : 
-     105              :     // Add bundleId, packageName or origin query param based on platform
-     106            9 :     if ((packageName ?? '').isNotEmpty) {
-     107            9 :       final platform = getId();
-     108            9 :       if (platform == 'ios') {
-     109            0 :         relayParams['bundleId'] = packageName!;
-     110            9 :       } else if (platform == 'android') {
-     111            0 :         relayParams['packageName'] = packageName!;
-     112              :       } else {
-     113            9 :         relayParams['origin'] = packageName!;
-     114              :       }
-     115              :     }
-     116              : 
-     117            9 :     queryParams.addAll(relayParams);
-     118           18 :     return uri.replace(queryParameters: queryParams).toString();
-     119              :   }
-     120              : 
-     121              :   /// ---- URI HANDLING --- ///
-     122              : 
-     123            8 :   static URIParseResult parseUri(Uri uri) {
-     124            8 :     String protocol = uri.scheme;
-     125            8 :     String path = uri.path;
-     126            8 :     final List<String> splitParams = path.split('@');
-     127           16 :     if (splitParams.length == 1) {
-     128              :       throw const WalletConnectError(
-     129              :         code: 0,
-     130              :         message: 'Invalid URI: Missing @',
-     131              :       );
-     132              :     }
-     133           16 :     List<String> methods = (uri.queryParameters['methods'] ?? '')
-     134              :         // Replace all the square brackets with empty string, split by comma
-     135           16 :         .replaceAll(RegExp(r'[\[\]"]+'), '')
-     136            8 :         .split(',');
-     137           30 :     if (methods.length == 1 && methods[0].isEmpty) {
-     138            7 :       methods = [];
-     139              :     }
-     140              :     final URIVersion? version;
-     141            8 :     switch (splitParams[1]) {
-     142            8 :       case '1':
-     143              :         version = URIVersion.v1;
-     144              :         break;
-     145            8 :       case '2':
-     146              :         version = URIVersion.v2;
-     147              :         break;
-     148              :       default:
-     149              :         version = null;
-     150              :     }
-     151              :     final URIV1ParsedData? v1Data;
-     152              :     final URIV2ParsedData? v2Data;
-     153            8 :     if (version == URIVersion.v1) {
-     154            5 :       v1Data = URIV1ParsedData(
-     155           10 :         key: uri.queryParameters['key']!,
-     156           10 :         bridge: uri.queryParameters['bridge']!,
-     157              :       );
-     158              :       v2Data = null;
-     159              :     } else {
-     160              :       v1Data = null;
-     161            8 :       v2Data = URIV2ParsedData(
-     162           16 :         symKey: uri.queryParameters['symKey']!,
-     163            8 :         relay: Relay(
-     164           16 :           uri.queryParameters['relay-protocol']!,
-     165           16 :           data: uri.queryParameters.containsKey('relay-data')
-     166            0 :               ? uri.queryParameters['relay-data']
-     167              :               : null,
-     168              :         ),
-     169              :         methods: methods,
-     170              :       );
-     171              :     }
-     172              : 
-     173            8 :     URIParseResult ret = URIParseResult(
-     174              :       protocol: protocol,
-     175              :       version: version,
-     176            8 :       topic: splitParams[0],
-     177              :       v1Data: v1Data,
-     178              :       v2Data: v2Data,
-     179              :     );
-     180              :     return ret;
-     181              :   }
-     182              : 
-     183            7 :   static Map<String, String> formatRelayParams(
-     184              :     Relay relay, {
-     185              :     String delimiter = '-',
-     186              :   }) {
-     187            7 :     Map<String, String> params = {};
-     188           28 :     params[['relay', 'protocol'].join(delimiter)] = relay.protocol;
-     189            7 :     if (relay.data != null) {
-     190            0 :       params[['relay', 'data'].join(delimiter)] = relay.data!;
-     191              :     }
-     192              :     return params;
-     193              :   }
-     194              : 
-     195            7 :   static Uri formatUri({
-     196              :     required String protocol,
-     197              :     required String version,
-     198              :     required String topic,
-     199              :     required String symKey,
-     200              :     required Relay relay,
-     201              :     required List<List<String>>? methods,
-     202              :     int? expiry,
-     203              :   }) {
-     204            7 :     Map<String, String> params = formatRelayParams(relay);
-     205            7 :     params['symKey'] = symKey;
-     206              :     if (methods != null) {
-     207           18 :       final uriMethods = methods.expand((e) => e).toList();
-     208            6 :       params['methods'] =
-     209           30 :           uriMethods.map((e) => jsonEncode(e)).join(',').replaceAll('"', '');
-     210              :     }
-     211              : 
-     212              :     if (expiry != null) {
-     213           14 :       params['expiryTimestamp'] = expiry.toString();
-     214              :     }
-     215              : 
-     216            7 :     return Uri(
-     217              :       scheme: protocol,
-     218            7 :       path: '$topic@$version',
-     219              :       queryParameters: params,
-     220              :     );
-     221              :   }
-     222              : 
-     223            0 :   static Map<String, T> convertMapTo<T>(Map<String, dynamic> inMap) {
-     224            0 :     Map<String, T> m = {};
-     225            0 :     for (var entry in inMap.entries) {
-     226            0 :       m[entry.key] = entry.value as T;
-     227              :     }
-     228              :     return m;
-     229              :   }
-     230              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/web3app/index-sort-f.html b/coverage/html/web3app/index-sort-f.html deleted file mode 100644 index e47e2032..00000000 --- a/coverage/html/web3app/index-sort-f.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - LCOV - lcov.info - web3app - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - web3appCoverageTotalHit
Test:lcov.infoLines:64.7 %11675
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
web3app.dart -
64.7%64.7%
-
64.7 %11675-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/web3app/index-sort-l.html b/coverage/html/web3app/index-sort-l.html deleted file mode 100644 index 461ff737..00000000 --- a/coverage/html/web3app/index-sort-l.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - LCOV - lcov.info - web3app - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - web3appCoverageTotalHit
Test:lcov.infoLines:64.7 %11675
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
web3app.dart -
64.7%64.7%
-
64.7 %11675
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/web3app/index.html b/coverage/html/web3app/index.html deleted file mode 100644 index e2fb5e12..00000000 --- a/coverage/html/web3app/index.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - LCOV - lcov.info - web3app - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - web3appCoverageTotalHit
Test:lcov.infoLines:64.7 %11675
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
web3app.dart -
64.7%64.7%
-
64.7 %11675
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/web3app/web3app.dart.func-c.html b/coverage/html/web3app/web3app.dart.func-c.html deleted file mode 100644 index 94575476..00000000 --- a/coverage/html/web3app/web3app.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - web3app/web3app.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - web3app - web3app.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:64.7 %11675
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/web3app/web3app.dart.func.html b/coverage/html/web3app/web3app.dart.func.html deleted file mode 100644 index 3ca32b9f..00000000 --- a/coverage/html/web3app/web3app.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - web3app/web3app.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - web3app - web3app.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:64.7 %11675
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/web3app/web3app.dart.gcov.html b/coverage/html/web3app/web3app.dart.gcov.html deleted file mode 100644 index b2fbb284..00000000 --- a/coverage/html/web3app/web3app.dart.gcov.html +++ /dev/null @@ -1,526 +0,0 @@ - - - - - - - LCOV - lcov.info - web3app/web3app.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - web3app - web3app.dartCoverageTotalHit
Test:lcov.infoLines:64.7 %11675
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:walletconnect_flutter_v2/apis/auth_api/auth_engine.dart';
-       2              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/http_client.dart';
-       3              : import 'package:walletconnect_flutter_v2/apis/core/store/generic_store.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/core/store/i_generic_store.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/sign_api/i_sessions.dart';
-       6              : import 'package:walletconnect_flutter_v2/apis/sign_api/sign_engine.dart';
-       7              : import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart';
-       8              : 
-       9              : class Web3App implements IWeb3App {
-      10              :   static const List<List<String>> DEFAULT_METHODS = [
-      11              :     [
-      12              :       MethodConstants.WC_SESSION_PROPOSE,
-      13              :       MethodConstants.WC_SESSION_REQUEST,
-      14              :     ],
-      15              :     [
-      16              :       MethodConstants.WC_AUTH_REQUEST,
-      17              :     ]
-      18              :   ];
-      19              : 
-      20              :   bool _initialized = false;
-      21              : 
-      22            2 :   static Future<Web3App> createInstance({
-      23              :     required String projectId,
-      24              :     String relayUrl = WalletConnectConstants.DEFAULT_RELAY_URL,
-      25              :     required PairingMetadata metadata,
-      26              :     bool memoryStore = false,
-      27              :     LogLevel logLevel = LogLevel.nothing,
-      28              :     HttpWrapper httpClient = const HttpWrapper(),
-      29              :   }) async {
-      30            2 :     final client = Web3App(
-      31            2 :       core: Core(
-      32              :         projectId: projectId,
-      33              :         relayUrl: relayUrl,
-      34              :         memoryStore: memoryStore,
-      35              :         logLevel: logLevel,
-      36              :         httpClient: httpClient,
-      37              :       ),
-      38              :       metadata: metadata,
-      39              :     );
-      40            2 :     await client.init();
-      41              : 
-      42              :     return client;
-      43              :   }
-      44              : 
-      45              :   ///---------- GENERIC ----------///
-      46              : 
-      47              :   @override
-      48              :   final String protocol = 'wc';
-      49              :   @override
-      50              :   final int version = 2;
-      51              : 
-      52              :   @override
-      53              :   final ICore core;
-      54              :   @override
-      55              :   final PairingMetadata metadata;
-      56              : 
-      57            2 :   Web3App({
-      58              :     required this.core,
-      59              :     required this.metadata,
-      60              :   }) {
-      61            4 :     signEngine = SignEngine(
-      62            2 :       core: core,
-      63            2 :       metadata: metadata,
-      64            2 :       proposals: GenericStore(
-      65            4 :         storage: core.storage,
-      66              :         context: StoreVersions.CONTEXT_PROPOSALS,
-      67              :         version: StoreVersions.VERSION_PROPOSALS,
-      68            0 :         fromJson: (dynamic value) {
-      69            0 :           return ProposalData.fromJson(value);
-      70              :         },
-      71              :       ),
-      72            2 :       sessions: Sessions(
-      73            4 :         storage: core.storage,
-      74              :         context: StoreVersions.CONTEXT_SESSIONS,
-      75              :         version: StoreVersions.VERSION_SESSIONS,
-      76            0 :         fromJson: (dynamic value) {
-      77            0 :           return SessionData.fromJson(value);
-      78              :         },
-      79              :       ),
-      80            2 :       pendingRequests: GenericStore(
-      81            4 :         storage: core.storage,
-      82              :         context: StoreVersions.CONTEXT_PENDING_REQUESTS,
-      83              :         version: StoreVersions.VERSION_PENDING_REQUESTS,
-      84            0 :         fromJson: (dynamic value) {
-      85            0 :           return SessionRequest.fromJson(value);
-      86              :         },
-      87              :       ),
-      88            2 :       authKeys: GenericStore(
-      89            4 :         storage: core.storage,
-      90              :         context: StoreVersions.CONTEXT_AUTH_KEYS,
-      91              :         version: StoreVersions.VERSION_AUTH_KEYS,
-      92            0 :         fromJson: (dynamic value) {
-      93            0 :           return AuthPublicKey.fromJson(value);
-      94              :         },
-      95              :       ),
-      96            2 :       pairingTopics: GenericStore(
-      97            4 :         storage: core.storage,
-      98              :         context: StoreVersions.CONTEXT_PAIRING_TOPICS,
-      99              :         version: StoreVersions.VERSION_PAIRING_TOPICS,
-     100            0 :         fromJson: (dynamic value) {
-     101              :           return value;
-     102              :         },
-     103              :       ),
-     104            2 :       authRequests: GenericStore(
-     105            4 :         storage: core.storage,
-     106              :         context: StoreVersions.CONTEXT_AUTH_REQUESTS,
-     107              :         version: StoreVersions.VERSION_AUTH_REQUESTS,
-     108            0 :         fromJson: (dynamic value) {
-     109            0 :           return PendingAuthRequest.fromJson(value);
-     110              :         },
-     111              :       ),
-     112            2 :       completeRequests: GenericStore(
-     113            4 :         storage: core.storage,
-     114              :         context: StoreVersions.CONTEXT_COMPLETE_REQUESTS,
-     115              :         version: StoreVersions.VERSION_COMPLETE_REQUESTS,
-     116            0 :         fromJson: (dynamic value) {
-     117            0 :           return StoredCacao.fromJson(value);
-     118              :         },
-     119              :       ),
-     120            2 :       sessionAuthRequests: GenericStore(
-     121            4 :         storage: core.storage,
-     122              :         context: StoreVersions.CONTEXT_AUTH_REQUESTS,
-     123              :         version: StoreVersions.VERSION_AUTH_REQUESTS,
-     124            0 :         fromJson: (dynamic value) {
-     125            0 :           return PendingSessionAuthRequest.fromJson(value);
-     126              :         },
-     127              :       ),
-     128              :     );
-     129              : 
-     130            4 :     authEngine = AuthEngine(
-     131            2 :       core: core,
-     132            2 :       metadata: metadata,
-     133            4 :       authKeys: signEngine.authKeys,
-     134            4 :       pairingTopics: signEngine.pairingTopics,
-     135            4 :       authRequests: signEngine.authRequests,
-     136            4 :       completeRequests: signEngine.completeRequests,
-     137              :     );
-     138              :   }
-     139              : 
-     140            2 :   @override
-     141              :   Future<void> init() async {
-     142            2 :     if (_initialized) {
-     143              :       return;
-     144              :     }
-     145              : 
-     146            4 :     await core.start();
-     147            4 :     await signEngine.init();
-     148            4 :     await authEngine.init();
-     149              : 
-     150            2 :     _initialized = true;
-     151              :   }
-     152              : 
-     153              :   ///---------- SIGN ENGINE ----------///
-     154              : 
-     155            2 :   @override
-     156            4 :   Event<SessionConnect> get onSessionConnect => signEngine.onSessionConnect;
-     157            1 :   @override
-     158            2 :   Event<SessionEvent> get onSessionEvent => signEngine.onSessionEvent;
-     159            1 :   @override
-     160            2 :   Event<SessionExpire> get onSessionExpire => signEngine.onSessionExpire;
-     161            0 :   @override
-     162              :   Event<SessionProposalEvent> get onProposalExpire =>
-     163            0 :       signEngine.onProposalExpire;
-     164            1 :   @override
-     165            2 :   Event<SessionExtend> get onSessionExtend => signEngine.onSessionExtend;
-     166            1 :   @override
-     167            2 :   Event<SessionPing> get onSessionPing => signEngine.onSessionPing;
-     168            1 :   @override
-     169            2 :   Event<SessionUpdate> get onSessionUpdate => signEngine.onSessionUpdate;
-     170            1 :   @override
-     171            2 :   Event<SessionDelete> get onSessionDelete => signEngine.onSessionDelete;
-     172              : 
-     173            1 :   @override
-     174            2 :   IGenericStore<ProposalData> get proposals => signEngine.proposals;
-     175            1 :   @override
-     176            2 :   ISessions get sessions => signEngine.sessions;
-     177            0 :   @override
-     178              :   IGenericStore<SessionRequest> get pendingRequests =>
-     179            0 :       signEngine.pendingRequests;
-     180              : 
-     181              :   @override
-     182              :   late ISignEngine signEngine;
-     183              : 
-     184            2 :   @override
-     185              :   Future<ConnectResponse> connect({
-     186              :     Map<String, RequiredNamespace>? requiredNamespaces,
-     187              :     Map<String, RequiredNamespace>? optionalNamespaces,
-     188              :     Map<String, String>? sessionProperties,
-     189              :     String? pairingTopic,
-     190              :     List<Relay>? relays,
-     191              :     List<List<String>>? methods = DEFAULT_METHODS,
-     192              :   }) async {
-     193              :     try {
-     194            4 :       return await signEngine.connect(
-     195              :         requiredNamespaces: requiredNamespaces,
-     196              :         optionalNamespaces: optionalNamespaces,
-     197              :         sessionProperties: sessionProperties,
-     198              :         pairingTopic: pairingTopic,
-     199              :         relays: relays,
-     200              :         methods: methods,
-     201              :       );
-     202              :     } catch (e) {
-     203              :       // print(e);
-     204              :       rethrow;
-     205              :     }
-     206              :   }
-     207              : 
-     208            1 :   @override
-     209              :   Future<dynamic> request({
-     210              :     required String topic,
-     211              :     required String chainId,
-     212              :     required SessionRequestParams request,
-     213              :   }) async {
-     214              :     try {
-     215            2 :       return await signEngine.request(
-     216              :         topic: topic,
-     217              :         chainId: chainId,
-     218              :         request: request,
-     219              :       );
-     220              :     } catch (e) {
-     221              :       rethrow;
-     222              :     }
-     223              :   }
-     224              : 
-     225            0 :   @override
-     226              :   Future<List<dynamic>> requestReadContract({
-     227              :     required DeployedContract deployedContract,
-     228              :     required String functionName,
-     229              :     required String rpcUrl,
-     230              :     EthereumAddress? sender,
-     231              :     List parameters = const [],
-     232              :   }) async {
-     233              :     try {
-     234            0 :       return await signEngine.requestReadContract(
-     235              :         sender: sender,
-     236              :         deployedContract: deployedContract,
-     237              :         functionName: functionName,
-     238              :         rpcUrl: rpcUrl,
-     239              :         parameters: parameters,
-     240              :       );
-     241              :     } catch (e) {
-     242              :       rethrow;
-     243              :     }
-     244              :   }
-     245              : 
-     246            0 :   @override
-     247              :   Future<dynamic> requestWriteContract({
-     248              :     required String topic,
-     249              :     required String chainId,
-     250              :     required String rpcUrl,
-     251              :     required DeployedContract deployedContract,
-     252              :     required String functionName,
-     253              :     required Transaction transaction,
-     254              :     String? method,
-     255              :     List parameters = const [],
-     256              :   }) async {
-     257              :     try {
-     258            0 :       return await signEngine.requestWriteContract(
-     259              :         topic: topic,
-     260              :         chainId: chainId,
-     261              :         rpcUrl: rpcUrl,
-     262              :         deployedContract: deployedContract,
-     263              :         functionName: functionName,
-     264              :         transaction: transaction,
-     265              :         method: method,
-     266              :         parameters: parameters,
-     267              :       );
-     268              :     } catch (e) {
-     269              :       rethrow;
-     270              :     }
-     271              :   }
-     272              : 
-     273            1 :   @override
-     274              :   void registerEventHandler({
-     275              :     required String chainId,
-     276              :     required String event,
-     277              :     void Function(String, dynamic)? handler,
-     278              :   }) {
-     279              :     try {
-     280            2 :       return signEngine.registerEventHandler(
-     281              :         chainId: chainId,
-     282              :         event: event,
-     283              :         handler: handler,
-     284              :       );
-     285              :     } catch (e) {
-     286              :       rethrow;
-     287              :     }
-     288              :   }
-     289              : 
-     290            1 :   @override
-     291              :   Future<void> ping({
-     292              :     required String topic,
-     293              :   }) async {
-     294              :     try {
-     295            2 :       return await signEngine.ping(topic: topic);
-     296              :     } catch (e) {
-     297              :       rethrow;
-     298              :     }
-     299              :   }
-     300              : 
-     301            1 :   @override
-     302              :   Future<void> disconnectSession({
-     303              :     required String topic,
-     304              :     required WalletConnectError reason,
-     305              :   }) async {
-     306              :     try {
-     307            2 :       return await signEngine.disconnectSession(
-     308              :         topic: topic,
-     309              :         reason: reason,
-     310              :       );
-     311              :     } catch (e) {
-     312              :       rethrow;
-     313              :     }
-     314              :   }
-     315              : 
-     316            2 :   @override
-     317              :   Map<String, SessionData> getActiveSessions() {
-     318              :     try {
-     319            4 :       return signEngine.getActiveSessions();
-     320              :     } catch (e) {
-     321              :       rethrow;
-     322              :     }
-     323              :   }
-     324              : 
-     325            1 :   @override
-     326              :   Map<String, SessionData> getSessionsForPairing({
-     327              :     required String pairingTopic,
-     328              :   }) {
-     329              :     try {
-     330            2 :       return signEngine.getSessionsForPairing(
-     331              :         pairingTopic: pairingTopic,
-     332              :       );
-     333              :     } catch (e) {
-     334              :       rethrow;
-     335              :     }
-     336              :   }
-     337              : 
-     338            1 :   @override
-     339              :   Map<String, ProposalData> getPendingSessionProposals() {
-     340              :     try {
-     341            2 :       return signEngine.getPendingSessionProposals();
-     342              :     } catch (e) {
-     343              :       rethrow;
-     344              :     }
-     345              :   }
-     346              : 
-     347            2 :   @override
-     348            6 :   IPairingStore get pairings => core.pairing.getStore();
-     349              : 
-     350              :   ///---------- (DEPRECATED) AUTH ENGINE ----------///
-     351              : 
-     352            0 :   @override
-     353            0 :   Event<AuthResponse> get onAuthResponse => authEngine.onAuthResponse;
-     354              : 
-     355            0 :   @override
-     356            0 :   IGenericStore<AuthPublicKey> get authKeys => authEngine.authKeys;
-     357            0 :   @override
-     358            0 :   IGenericStore<String> get pairingTopics => authEngine.pairingTopics;
-     359            0 :   @override
-     360              :   IGenericStore<StoredCacao> get completeRequests =>
-     361            0 :       authEngine.completeRequests;
-     362              : 
-     363              :   @Deprecated(
-     364              :     'AuthEngine/AuthClient is deprecated and will be removed soon.\n'
-     365              :     'Please use authentication methods from SignEngine/SignClient instead',
-     366              :   )
-     367              :   @override
-     368              :   late IAuthEngine authEngine;
-     369              : 
-     370            1 :   @override
-     371              :   Future<AuthRequestResponse> requestAuth({
-     372              :     required AuthRequestParams params,
-     373              :     String? pairingTopic,
-     374              :     List<List<String>>? methods = DEFAULT_METHODS,
-     375              :   }) async {
-     376              :     try {
-     377            2 :       return authEngine.requestAuth(
-     378              :         params: params,
-     379              :         pairingTopic: pairingTopic,
-     380              :         methods: methods,
-     381              :       );
-     382              :     } catch (e) {
-     383              :       rethrow;
-     384              :     }
-     385              :   }
-     386              : 
-     387            0 :   @override
-     388              :   Map<int, StoredCacao> getCompletedRequestsForPairing({
-     389              :     required String pairingTopic,
-     390              :   }) {
-     391              :     try {
-     392            0 :       return authEngine.getCompletedRequestsForPairing(
-     393              :         pairingTopic: pairingTopic,
-     394              :       );
-     395              :     } catch (e) {
-     396              :       rethrow;
-     397              :     }
-     398              :   }
-     399              : 
-     400              :   ///---------- ONE-CLICK AUTH SIGN ENGINE ----------///
-     401              : 
-     402            0 :   @override
-     403              :   Event<SessionAuthResponse> get onSessionAuthResponse =>
-     404            0 :       signEngine.onSessionAuthResponse;
-     405              : 
-     406            0 :   @override
-     407              :   Future<SessionAuthRequestResponse> authenticate({
-     408              :     required SessionAuthRequestParams params,
-     409              :     String? pairingTopic,
-     410              :     List<List<String>>? methods = const [
-     411              :       [MethodConstants.WC_SESSION_AUTHENTICATE]
-     412              :     ],
-     413              :   }) async {
-     414              :     try {
-     415            0 :       return signEngine.authenticate(
-     416              :         params: params,
-     417              :         pairingTopic: pairingTopic,
-     418              :         methods: methods,
-     419              :       );
-     420              :     } catch (e) {
-     421              :       rethrow;
-     422              :     }
-     423              :   }
-     424              : 
-     425            0 :   @override
-     426              :   Future<bool> validateSignedCacao({
-     427              :     required Cacao cacao,
-     428              :     required String projectId,
-     429              :   }) {
-     430              :     try {
-     431            0 :       return signEngine.validateSignedCacao(
-     432              :         cacao: cacao,
-     433              :         projectId: projectId,
-     434              :       );
-     435              :     } catch (e) {
-     436              :       rethrow;
-     437              :     }
-     438              :   }
-     439              : 
-     440            0 :   @override
-     441              :   String formatAuthMessage({
-     442              :     required String iss,
-     443              :     required CacaoRequestPayload cacaoPayload,
-     444              :   }) {
-     445              :     try {
-     446            0 :       return signEngine.formatAuthMessage(
-     447              :         iss: iss,
-     448              :         cacaoPayload: cacaoPayload,
-     449              :       );
-     450              :     } catch (e) {
-     451              :       rethrow;
-     452              :     }
-     453              :   }
-     454              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/web3wallet/index-sort-f.html b/coverage/html/web3wallet/index-sort-f.html deleted file mode 100644 index 79586ac9..00000000 --- a/coverage/html/web3wallet/index-sort-f.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - LCOV - lcov.info - web3wallet - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - web3walletCoverageTotalHit
Test:lcov.infoLines:71.7 %13899
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverageFunction Coverage Sort by function coverage
Rate Total Hit Rate Total Hit
web3wallet.dart -
71.7%71.7%
-
71.7 %13899-
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/web3wallet/index-sort-l.html b/coverage/html/web3wallet/index-sort-l.html deleted file mode 100644 index 6ae5355a..00000000 --- a/coverage/html/web3wallet/index-sort-l.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - LCOV - lcov.info - web3wallet - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - web3walletCoverageTotalHit
Test:lcov.infoLines:71.7 %13899
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
web3wallet.dart -
71.7%71.7%
-
71.7 %13899
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/web3wallet/index.html b/coverage/html/web3wallet/index.html deleted file mode 100644 index e84954e3..00000000 --- a/coverage/html/web3wallet/index.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - LCOV - lcov.info - web3wallet - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - web3walletCoverageTotalHit
Test:lcov.infoLines:71.7 %13899
Test Date:2024-07-25 14:52:52
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - -

File Sort by file nameLine Coverage Sort by line coverage
Rate Total Hit
web3wallet.dart -
71.7%71.7%
-
71.7 %13899
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/web3wallet/web3wallet.dart.func-c.html b/coverage/html/web3wallet/web3wallet.dart.func-c.html deleted file mode 100644 index 35b071fe..00000000 --- a/coverage/html/web3wallet/web3wallet.dart.func-c.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - web3wallet/web3wallet.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - web3wallet - web3wallet.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:71.7 %13899
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/web3wallet/web3wallet.dart.func.html b/coverage/html/web3wallet/web3wallet.dart.func.html deleted file mode 100644 index edd605f9..00000000 --- a/coverage/html/web3wallet/web3wallet.dart.func.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - LCOV - lcov.info - web3wallet/web3wallet.dart - functions - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - web3wallet - web3wallet.dart (source / functions)CoverageTotalHit
Test:lcov.infoLines:71.7 %13899
Test Date:2024-07-25 14:51:04Functions:-00
-
- -
- - - - - - - - - -

Function Name Sort by function nameHit count Sort by function hit count
-
-
- - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/html/web3wallet/web3wallet.dart.gcov.html b/coverage/html/web3wallet/web3wallet.dart.gcov.html deleted file mode 100644 index 6cea2e08..00000000 --- a/coverage/html/web3wallet/web3wallet.dart.gcov.html +++ /dev/null @@ -1,612 +0,0 @@ - - - - - - - LCOV - lcov.info - web3wallet/web3wallet.dart - - - - - - - - - - - - - - -
LCOV - code coverage report
- - - - - - - - - - - - - - - - - - - - - - - - - -
Current view:top level - web3wallet - web3wallet.dartCoverageTotalHit
Test:lcov.infoLines:71.7 %13899
Test Date:2024-07-25 14:52:52
-
- - - - - - - - -

-
            Line data    Source code
-
-       1              : import 'package:walletconnect_flutter_v2/apis/auth_api/auth_engine.dart';
-       2              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/http_client.dart';
-       3              : import 'package:walletconnect_flutter_v2/apis/core/relay_client/websocket/i_http_client.dart';
-       4              : import 'package:walletconnect_flutter_v2/apis/core/store/generic_store.dart';
-       5              : import 'package:walletconnect_flutter_v2/apis/core/store/i_generic_store.dart';
-       6              : import 'package:walletconnect_flutter_v2/apis/sign_api/i_sessions.dart';
-       7              : import 'package:walletconnect_flutter_v2/apis/sign_api/sign_engine.dart';
-       8              : import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart';
-       9              : 
-      10              : class Web3Wallet implements IWeb3Wallet {
-      11              :   bool _initialized = false;
-      12              : 
-      13            3 :   static Future<Web3Wallet> createInstance({
-      14              :     required String projectId,
-      15              :     String relayUrl = WalletConnectConstants.DEFAULT_RELAY_URL,
-      16              :     String pushUrl = WalletConnectConstants.DEFAULT_PUSH_URL,
-      17              :     required PairingMetadata metadata,
-      18              :     bool memoryStore = false,
-      19              :     LogLevel logLevel = LogLevel.nothing,
-      20              :     IHttpClient httpClient = const HttpWrapper(),
-      21              :   }) async {
-      22            3 :     final client = Web3Wallet(
-      23            3 :       core: Core(
-      24              :         projectId: projectId,
-      25              :         relayUrl: relayUrl,
-      26              :         pushUrl: pushUrl,
-      27              :         memoryStore: memoryStore,
-      28              :         logLevel: logLevel,
-      29              :         httpClient: httpClient,
-      30              :       ),
-      31              :       metadata: metadata,
-      32              :     );
-      33            3 :     await client.init();
-      34              : 
-      35              :     return client;
-      36              :   }
-      37              : 
-      38              :   ///---------- GENERIC ----------///
-      39              : 
-      40              :   @override
-      41              :   final String protocol = 'wc';
-      42              :   @override
-      43              :   final int version = 2;
-      44              : 
-      45              :   @override
-      46              :   final ICore core;
-      47              :   @override
-      48              :   final PairingMetadata metadata;
-      49              : 
-      50            3 :   Web3Wallet({
-      51              :     required this.core,
-      52              :     required this.metadata,
-      53              :   }) {
-      54            6 :     signEngine = SignEngine(
-      55            3 :       core: core,
-      56            3 :       metadata: metadata,
-      57            3 :       proposals: GenericStore(
-      58            6 :         storage: core.storage,
-      59              :         context: StoreVersions.CONTEXT_PROPOSALS,
-      60              :         version: StoreVersions.VERSION_PROPOSALS,
-      61            0 :         fromJson: (dynamic value) {
-      62            0 :           return ProposalData.fromJson(value);
-      63              :         },
-      64              :       ),
-      65            3 :       sessions: Sessions(
-      66            6 :         storage: core.storage,
-      67              :         context: StoreVersions.CONTEXT_SESSIONS,
-      68              :         version: StoreVersions.VERSION_SESSIONS,
-      69            0 :         fromJson: (dynamic value) {
-      70            0 :           return SessionData.fromJson(value);
-      71              :         },
-      72              :       ),
-      73            3 :       pendingRequests: GenericStore(
-      74            6 :         storage: core.storage,
-      75              :         context: StoreVersions.CONTEXT_PENDING_REQUESTS,
-      76              :         version: StoreVersions.VERSION_PENDING_REQUESTS,
-      77            0 :         fromJson: (dynamic value) {
-      78            0 :           return SessionRequest.fromJson(value);
-      79              :         },
-      80              :       ),
-      81            3 :       authKeys: GenericStore(
-      82            6 :         storage: core.storage,
-      83              :         context: StoreVersions.CONTEXT_AUTH_KEYS,
-      84              :         version: StoreVersions.VERSION_AUTH_KEYS,
-      85            0 :         fromJson: (dynamic value) {
-      86            0 :           return AuthPublicKey.fromJson(value);
-      87              :         },
-      88              :       ),
-      89            3 :       pairingTopics: GenericStore(
-      90            6 :         storage: core.storage,
-      91              :         context: StoreVersions.CONTEXT_PAIRING_TOPICS,
-      92              :         version: StoreVersions.VERSION_PAIRING_TOPICS,
-      93            0 :         fromJson: (dynamic value) {
-      94              :           return value;
-      95              :         },
-      96              :       ),
-      97            3 :       authRequests: GenericStore(
-      98            6 :         storage: core.storage,
-      99              :         context: StoreVersions.CONTEXT_AUTH_REQUESTS,
-     100              :         version: StoreVersions.VERSION_AUTH_REQUESTS,
-     101            0 :         fromJson: (dynamic value) {
-     102            0 :           return PendingAuthRequest.fromJson(value);
-     103              :         },
-     104              :       ),
-     105            3 :       completeRequests: GenericStore(
-     106            6 :         storage: core.storage,
-     107              :         context: StoreVersions.CONTEXT_COMPLETE_REQUESTS,
-     108              :         version: StoreVersions.VERSION_COMPLETE_REQUESTS,
-     109            0 :         fromJson: (dynamic value) {
-     110            0 :           return StoredCacao.fromJson(value);
-     111              :         },
-     112              :       ),
-     113            3 :       sessionAuthRequests: GenericStore(
-     114            6 :         storage: core.storage,
-     115              :         context: StoreVersions.CONTEXT_AUTH_REQUESTS,
-     116              :         version: StoreVersions.VERSION_AUTH_REQUESTS,
-     117            0 :         fromJson: (dynamic value) {
-     118            0 :           return PendingSessionAuthRequest.fromJson(value);
-     119              :         },
-     120              :       ),
-     121              :     );
-     122              : 
-     123            6 :     authEngine = AuthEngine(
-     124            3 :       core: core,
-     125            3 :       metadata: metadata,
-     126            6 :       authKeys: signEngine.authKeys,
-     127            6 :       pairingTopics: signEngine.pairingTopics,
-     128            6 :       authRequests: signEngine.authRequests,
-     129            6 :       completeRequests: signEngine.completeRequests,
-     130              :     );
-     131              :   }
-     132              : 
-     133            3 :   @override
-     134              :   Future<void> init() async {
-     135            3 :     if (_initialized) {
-     136              :       return;
-     137              :     }
-     138              : 
-     139            6 :     await core.start();
-     140            6 :     await signEngine.init();
-     141            6 :     await authEngine.init();
-     142              : 
-     143            3 :     _initialized = true;
-     144              :   }
-     145              : 
-     146            2 :   @override
-     147              :   Future<PairingInfo> pair({
-     148              :     required Uri uri,
-     149              :   }) async {
-     150              :     try {
-     151            4 :       return await signEngine.pair(uri: uri);
-     152              :     } catch (e) {
-     153              :       rethrow;
-     154              :     }
-     155              :   }
-     156              : 
-     157              :   ///---------- SIGN ENGINE ----------///
-     158              : 
-     159            1 :   @override
-     160            2 :   Event<SessionConnect> get onSessionConnect => signEngine.onSessionConnect;
-     161            1 :   @override
-     162            2 :   Event<SessionDelete> get onSessionDelete => signEngine.onSessionDelete;
-     163            1 :   @override
-     164            2 :   Event<SessionExpire> get onSessionExpire => signEngine.onSessionExpire;
-     165            2 :   @override
-     166              :   Event<SessionProposalEvent> get onSessionProposal =>
-     167            4 :       signEngine.onSessionProposal;
-     168            0 :   @override
-     169              :   Event<SessionProposalErrorEvent> get onSessionProposalError =>
-     170            0 :       signEngine.onSessionProposalError;
-     171            1 :   @override
-     172              :   Event<SessionProposalEvent> get onProposalExpire =>
-     173            2 :       signEngine.onProposalExpire;
-     174            1 :   @override
-     175              :   Event<SessionRequestEvent> get onSessionRequest =>
-     176            2 :       signEngine.onSessionRequest;
-     177            1 :   @override
-     178            2 :   Event<SessionPing> get onSessionPing => signEngine.onSessionPing;
-     179              : 
-     180            1 :   @override
-     181            2 :   IGenericStore<ProposalData> get proposals => signEngine.proposals;
-     182            1 :   @override
-     183            2 :   ISessions get sessions => signEngine.sessions;
-     184            1 :   @override
-     185              :   IGenericStore<SessionRequest> get pendingRequests =>
-     186            2 :       signEngine.pendingRequests;
-     187              : 
-     188              :   @override
-     189              :   late ISignEngine signEngine;
-     190              : 
-     191            2 :   @override
-     192              :   Future<ApproveResponse> approveSession({
-     193              :     required int id,
-     194              :     required Map<String, Namespace> namespaces,
-     195              :     Map<String, String>? sessionProperties,
-     196              :     String? relayProtocol,
-     197              :   }) async {
-     198              :     try {
-     199            4 :       return await signEngine.approveSession(
-     200              :         id: id,
-     201              :         namespaces: namespaces,
-     202              :         sessionProperties: sessionProperties,
-     203              :         relayProtocol: relayProtocol,
-     204              :       );
-     205              :     } catch (e) {
-     206              :       rethrow;
-     207              :     }
-     208              :   }
-     209              : 
-     210            1 :   @override
-     211              :   Future<void> rejectSession({
-     212              :     required int id,
-     213              :     required WalletConnectError reason,
-     214              :   }) async {
-     215              :     try {
-     216            2 :       return await signEngine.rejectSession(
-     217              :         id: id,
-     218              :         reason: reason,
-     219              :       );
-     220              :     } catch (e) {
-     221              :       rethrow;
-     222              :     }
-     223              :   }
-     224              : 
-     225            1 :   @override
-     226              :   Future<void> updateSession({
-     227              :     required String topic,
-     228              :     required Map<String, Namespace> namespaces,
-     229              :   }) async {
-     230              :     try {
-     231            2 :       return await signEngine.updateSession(
-     232              :         topic: topic,
-     233              :         namespaces: namespaces,
-     234              :       );
-     235              :     } catch (e) {
-     236              :       // final error = e as WCError;
-     237              :       rethrow;
-     238              :     }
-     239              :   }
-     240              : 
-     241            1 :   @override
-     242              :   Future<void> extendSession({
-     243              :     required String topic,
-     244              :   }) async {
-     245              :     try {
-     246            2 :       return await signEngine.extendSession(topic: topic);
-     247              :     } catch (e) {
-     248              :       rethrow;
-     249              :     }
-     250              :   }
-     251              : 
-     252            1 :   @override
-     253              :   void registerRequestHandler({
-     254              :     required String chainId,
-     255              :     required String method,
-     256              :     dynamic Function(String, dynamic)? handler,
-     257              :   }) {
-     258              :     try {
-     259            2 :       return signEngine.registerRequestHandler(
-     260              :         chainId: chainId,
-     261              :         method: method,
-     262              :         handler: handler,
-     263              :       );
-     264              :     } catch (e) {
-     265              :       rethrow;
-     266              :     }
-     267              :   }
-     268              : 
-     269            1 :   @override
-     270              :   Future<void> respondSessionRequest({
-     271              :     required String topic,
-     272              :     required JsonRpcResponse response,
-     273              :   }) {
-     274              :     try {
-     275            2 :       return signEngine.respondSessionRequest(
-     276              :         topic: topic,
-     277              :         response: response,
-     278              :       );
-     279              :     } catch (e) {
-     280              :       rethrow;
-     281              :     }
-     282              :   }
-     283              : 
-     284            1 :   @override
-     285              :   void registerEventEmitter({
-     286              :     required String chainId,
-     287              :     required String event,
-     288              :   }) {
-     289              :     try {
-     290            2 :       return signEngine.registerEventEmitter(
-     291              :         chainId: chainId,
-     292              :         event: event,
-     293              :       );
-     294              :     } catch (e) {
-     295              :       rethrow;
-     296              :     }
-     297              :   }
-     298              : 
-     299            1 :   @override
-     300              :   void registerAccount({
-     301              :     required String chainId,
-     302              :     required String accountAddress,
-     303              :   }) {
-     304              :     try {
-     305            2 :       return signEngine.registerAccount(
-     306              :         chainId: chainId,
-     307              :         accountAddress: accountAddress,
-     308              :       );
-     309              :     } catch (e) {
-     310              :       rethrow;
-     311              :     }
-     312              :   }
-     313              : 
-     314            1 :   @override
-     315              :   Future<void> emitSessionEvent({
-     316              :     required String topic,
-     317              :     required String chainId,
-     318              :     required SessionEventParams event,
-     319              :   }) async {
-     320              :     try {
-     321            2 :       return await signEngine.emitSessionEvent(
-     322              :         topic: topic,
-     323              :         chainId: chainId,
-     324              :         event: event,
-     325              :       );
-     326              :     } catch (e) {
-     327              :       rethrow;
-     328              :     }
-     329              :   }
-     330              : 
-     331            1 :   @override
-     332              :   Future<void> disconnectSession({
-     333              :     required String topic,
-     334              :     required WalletConnectError reason,
-     335              :   }) async {
-     336              :     try {
-     337            2 :       return await signEngine.disconnectSession(
-     338              :         topic: topic,
-     339              :         reason: reason,
-     340              :       );
-     341              :     } catch (e) {
-     342              :       rethrow;
-     343              :     }
-     344              :   }
-     345              : 
-     346            1 :   @override
-     347              :   SessionData? find({
-     348              :     required Map<String, RequiredNamespace> requiredNamespaces,
-     349              :   }) {
-     350              :     try {
-     351            2 :       return signEngine.find(requiredNamespaces: requiredNamespaces);
-     352              :     } catch (e) {
-     353              :       rethrow;
-     354              :     }
-     355              :   }
-     356              : 
-     357            2 :   @override
-     358              :   Map<String, SessionData> getActiveSessions() {
-     359              :     try {
-     360            4 :       return signEngine.getActiveSessions();
-     361              :     } catch (e) {
-     362              :       rethrow;
-     363              :     }
-     364              :   }
-     365              : 
-     366            1 :   @override
-     367              :   Map<String, SessionData> getSessionsForPairing({
-     368              :     required String pairingTopic,
-     369              :   }) {
-     370              :     try {
-     371            2 :       return signEngine.getSessionsForPairing(
-     372              :         pairingTopic: pairingTopic,
-     373              :       );
-     374              :     } catch (e) {
-     375              :       rethrow;
-     376              :     }
-     377              :   }
-     378              : 
-     379            2 :   @override
-     380              :   Map<String, ProposalData> getPendingSessionProposals() {
-     381              :     try {
-     382            4 :       return signEngine.getPendingSessionProposals();
-     383              :     } catch (e) {
-     384              :       rethrow;
-     385              :     }
-     386              :   }
-     387              : 
-     388            1 :   @override
-     389              :   Map<String, SessionRequest> getPendingSessionRequests() {
-     390              :     try {
-     391            2 :       return signEngine.getPendingSessionRequests();
-     392              :     } catch (e) {
-     393              :       rethrow;
-     394              :     }
-     395              :   }
-     396              : 
-     397            2 :   @override
-     398            6 :   IPairingStore get pairings => core.pairing.getStore();
-     399              : 
-     400              :   ///---------- (DEPRECATED) AUTH ENGINE ----------///
-     401              : 
-     402            2 :   @override
-     403            4 :   Event<AuthRequest> get onAuthRequest => authEngine.onAuthRequest;
-     404              : 
-     405            0 :   @override
-     406            0 :   IGenericStore<AuthPublicKey> get authKeys => authEngine.authKeys;
-     407            0 :   @override
-     408            0 :   IGenericStore<String> get pairingTopics => authEngine.pairingTopics;
-     409            0 :   @override
-     410            0 :   IGenericStore<PendingAuthRequest> get authRequests => authEngine.authRequests;
-     411            0 :   @override
-     412              :   IGenericStore<StoredCacao> get completeRequests =>
-     413            0 :       authEngine.completeRequests;
-     414              : 
-     415              :   @Deprecated(
-     416              :     'AuthEngine/AuthClient is deprecated and will be removed soon.\n'
-     417              :     'Please use authentication methods from SignEngine/SignClient instead',
-     418              :   )
-     419              :   @override
-     420              :   late IAuthEngine authEngine;
-     421              : 
-     422            2 :   @override
-     423              :   Future<void> respondAuthRequest({
-     424              :     required int id,
-     425              :     required String iss,
-     426              :     CacaoSignature? signature,
-     427              :     WalletConnectError? error,
-     428              :   }) {
-     429              :     try {
-     430            4 :       return authEngine.respondAuthRequest(
-     431              :         id: id,
-     432              :         iss: iss,
-     433              :         signature: signature,
-     434              :         error: error,
-     435              :       );
-     436              :     } catch (e) {
-     437              :       rethrow;
-     438              :     }
-     439              :   }
-     440              : 
-     441            2 :   @override
-     442              :   Map<int, PendingAuthRequest> getPendingAuthRequests() {
-     443              :     try {
-     444            4 :       return authEngine.getPendingAuthRequests();
-     445              :     } catch (e) {
-     446              :       rethrow;
-     447              :     }
-     448              :   }
-     449              : 
-     450            1 :   @override
-     451              :   Map<int, StoredCacao> getCompletedRequestsForPairing({
-     452              :     required String pairingTopic,
-     453              :   }) {
-     454              :     try {
-     455            2 :       return authEngine.getCompletedRequestsForPairing(
-     456              :         pairingTopic: pairingTopic,
-     457              :       );
-     458              :     } catch (e) {
-     459              :       rethrow;
-     460              :     }
-     461              :   }
-     462              : 
-     463              :   ///---------- ONE-CLICK AUTH SIGN ENGINE ----------///
-     464              : 
-     465            0 :   @override
-     466              :   IGenericStore<PendingSessionAuthRequest> get sessionAuthRequests =>
-     467            0 :       signEngine.sessionAuthRequests;
-     468            0 :   @override
-     469              :   Event<SessionAuthRequest> get onSessionAuthRequest =>
-     470            0 :       signEngine.onSessionAuthRequest;
-     471              : 
-     472            0 :   @override
-     473              :   Future<ApproveResponse> approveSessionAuthenticate({
-     474              :     required int id,
-     475              :     List<Cacao>? auths,
-     476              :   }) {
-     477              :     try {
-     478            0 :       return signEngine.approveSessionAuthenticate(
-     479              :         id: id,
-     480              :         auths: auths,
-     481              :       );
-     482              :     } catch (e) {
-     483              :       rethrow;
-     484              :     }
-     485              :   }
-     486              : 
-     487            0 :   @override
-     488              :   Future<void> rejectSessionAuthenticate({
-     489              :     required int id,
-     490              :     required WalletConnectError reason,
-     491              :   }) {
-     492              :     try {
-     493            0 :       return signEngine.rejectSessionAuthenticate(
-     494              :         id: id,
-     495              :         reason: reason,
-     496              :       );
-     497              :     } catch (e) {
-     498              :       rethrow;
-     499              :     }
-     500              :   }
-     501              : 
-     502            0 :   @override
-     503              :   Map<int, PendingSessionAuthRequest> getPendingSessionAuthRequests() {
-     504              :     try {
-     505            0 :       return signEngine.getPendingSessionAuthRequests();
-     506              :     } catch (e) {
-     507              :       rethrow;
-     508              :     }
-     509              :   }
-     510              : 
-     511            0 :   @override
-     512              :   String formatAuthMessage({
-     513              :     required String iss,
-     514              :     required CacaoRequestPayload cacaoPayload,
-     515              :   }) {
-     516              :     try {
-     517            0 :       return signEngine.formatAuthMessage(
-     518              :         iss: iss,
-     519              :         cacaoPayload: cacaoPayload,
-     520              :       );
-     521              :     } catch (e) {
-     522              :       rethrow;
-     523              :     }
-     524              :   }
-     525              : 
-     526            0 :   @override
-     527              :   Future<bool> validateSignedCacao({
-     528              :     required Cacao cacao,
-     529              :     required String projectId,
-     530              :   }) {
-     531              :     try {
-     532            0 :       return signEngine.validateSignedCacao(
-     533              :         cacao: cacao,
-     534              :         projectId: projectId,
-     535              :       );
-     536              :     } catch (e) {
-     537              :       rethrow;
-     538              :     }
-     539              :   }
-     540              : }
-        
-
-
- - - - -
Generated by: LCOV version 2.1-1
-
- - - diff --git a/coverage/lcov.info b/coverage/lcov.info deleted file mode 100644 index e0eef0de..00000000 --- a/coverage/lcov.info +++ /dev/null @@ -1,4705 +0,0 @@ -TN: -SF:lib/apis/auth_api/auth_client.dart -FNF:0 -FNH:0 -DA:22,0 -DA:25,0 -DA:28,0 -DA:29,0 -DA:30,1 -DA:31,2 -DA:33,1 -DA:34,2 -DA:35,0 -DA:36,0 -DA:37,0 -DA:38,0 -DA:39,0 -DA:40,0 -DA:41,0 -DA:42,0 -DA:43,0 -DA:44,0 -DA:49,0 -DA:57,0 -DA:58,0 -DA:67,0 -DA:72,1 -DA:76,2 -DA:79,1 -DA:80,1 -DA:83,0 -DA:84,0 -DA:87,1 -DA:88,1 -DA:91,0 -DA:95,1 -DA:96,1 -DA:99,0 -DA:100,0 -DA:103,1 -DA:104,1 -DA:107,0 -DA:108,0 -DA:114,1 -DA:116,1 -DA:120,2 -DA:121,2 -DA:123,1 -DA:126,1 -DA:133,2 -DA:143,0 -DA:151,0 -DA:162,0 -DA:165,0 -DA:171,1 -DA:176,2 -DA:184,1 -DA:190,2 -LF:54 -LH:25 -end_of_record -TN: -SF:lib/apis/auth_api/auth_engine.dart -FNF:0 -FNH:0 -DA:54,3 -DA:63,3 -DA:65,3 -DA:69,9 -DA:70,6 -DA:71,6 -DA:72,6 -DA:73,6 -DA:75,3 -DA:77,3 -DA:80,2 -DA:86,2 -DA:88,2 -DA:93,3 -DA:96,1 -DA:97,1 -DA:99,6 -DA:102,6 -DA:104,8 -DA:105,2 -DA:107,2 -DA:108,2 -DA:111,2 -DA:113,2 -DA:117,2 -DA:119,4 -DA:121,2 -DA:124,4 -DA:130,6 -DA:136,2 -DA:138,2 -DA:147,2 -DA:155,2 -DA:167,6 -DA:170,6 -DA:173,2 -DA:177,0 -DA:178,0 -DA:183,0 -DA:184,0 -DA:188,6 -DA:190,2 -DA:191,2 -DA:192,2 -DA:193,4 -DA:194,2 -DA:195,2 -DA:202,2 -DA:203,2 -DA:204,2 -DA:207,4 -DA:208,4 -DA:210,2 -DA:211,0 -DA:216,2 -DA:217,0 -DA:223,2 -DA:228,4 -DA:232,0 -DA:240,0 -DA:241,0 -DA:243,2 -DA:248,4 -DA:249,2 -DA:253,2 -DA:260,2 -DA:262,2 -DA:263,2 -DA:270,2 -DA:271,4 -DA:272,6 -DA:273,8 -DA:276,2 -DA:283,0 -DA:287,0 -DA:291,2 -DA:293,2 -DA:295,2 -DA:301,6 -DA:305,2 -DA:309,6 -DA:311,4 -DA:312,2 -DA:313,2 -DA:315,2 -DA:322,2 -DA:324,2 -DA:325,8 -DA:326,4 -DA:331,1 -DA:335,1 -DA:336,1 -DA:337,1 -DA:338,1 -DA:339,3 -DA:341,2 -DA:342,2 -DA:347,2 -DA:353,4 -DA:354,2 -DA:355,4 -DA:356,4 -DA:357,4 -DA:358,4 -DA:359,4 -DA:360,2 -DA:361,2 -DA:362,5 -DA:363,1 -DA:365,2 -DA:369,2 -DA:377,6 -DA:384,2 -DA:385,2 -DA:386,0 -DA:392,3 -DA:393,9 -DA:395,3 -DA:400,2 -DA:405,4 -DA:408,2 -DA:409,2 -DA:412,4 -DA:413,4 -DA:414,2 -DA:415,2 -DA:417,2 -DA:422,4 -DA:423,2 -DA:424,2 -DA:426,2 -DA:427,2 -DA:430,0 -DA:431,0 -DA:432,0 -DA:434,0 -DA:435,0 -DA:436,0 -LF:138 -LH:120 -end_of_record -TN: -SF:lib/apis/core/core.dart -FNF:0 -FNH:0 -DA:33,7 -DA:35,7 -DA:72,9 -DA:73,9 -DA:75,0 -DA:77,0 -DA:80,0 -DA:82,0 -DA:88,10 -DA:97,20 -DA:98,10 -DA:99,10 -DA:101,20 -DA:102,20 -DA:105,20 -DA:107,10 -DA:108,10 -DA:111,0 -DA:114,20 -DA:116,10 -DA:117,10 -DA:120,0 -DA:121,0 -DA:124,10 -DA:125,10 -DA:128,0 -DA:132,20 -DA:133,10 -DA:136,0 -DA:138,20 -DA:140,10 -DA:141,10 -DA:144,0 -DA:145,0 -DA:148,10 -DA:149,10 -DA:152,0 -DA:154,10 -DA:155,10 -DA:158,0 -DA:161,20 -DA:163,10 -DA:164,10 -DA:168,20 -DA:174,9 -DA:176,18 -DA:177,18 -DA:178,18 -DA:179,18 -DA:180,18 -DA:181,18 -LF:51 -LH:38 -end_of_record -TN: -SF:lib/apis/core/crypto/crypto.dart -FNF:0 -FNH:0 -DA:24,0 -DA:35,10 -DA:40,10 -DA:41,10 -DA:43,10 -DA:45,10 -DA:49,20 -DA:51,10 -DA:54,0 -DA:56,0 -DA:57,0 -DA:60,0 -DA:62,0 -DA:65,0 -DA:66,0 -DA:67,0 -DA:70,6 -DA:72,6 -DA:74,12 -DA:75,6 -DA:78,6 -DA:84,6 -DA:86,6 -DA:87,12 -DA:88,6 -DA:91,8 -DA:96,8 -DA:98,16 -DA:100,16 -DA:104,4 -DA:106,4 -DA:107,8 -DA:110,6 -DA:112,6 -DA:113,12 -DA:116,7 -DA:122,7 -DA:126,14 -DA:128,4 -DA:129,2 -DA:130,2 -DA:131,2 -DA:135,7 -DA:137,14 -DA:138,2 -DA:139,2 -DA:140,2 -DA:143,7 -DA:148,14 -DA:151,7 -DA:152,7 -DA:158,7 -DA:164,7 -DA:166,14 -DA:168,6 -DA:171,14 -DA:172,2 -DA:173,2 -DA:174,2 -DA:176,7 -DA:181,14 -DA:186,9 -DA:188,9 -DA:190,9 -DA:191,18 -DA:192,18 -DA:193,18 -DA:202,0 -DA:204,0 -DA:206,0 -DA:211,6 -DA:212,24 -DA:213,6 -DA:216,6 -DA:217,12 -DA:220,7 -DA:222,14 -DA:238,9 -DA:239,18 -DA:241,18 -DA:242,18 -DA:245,18 -DA:248,10 -DA:249,10 -DA:250,1 -DA:254,7 -DA:256,7 -LF:87 -LH:75 -end_of_record -TN: -SF:lib/apis/core/crypto/crypto_models.dart -FNF:0 -FNH:0 -DA:9,22 -DA:11,0 -DA:12,0 -DA:15,0 -DA:16,0 -DA:27,0 -DA:43,7 -DA:57,7 -DA:72,2 -DA:82,6 -LF:10 -LH:5 -end_of_record -TN: -SF:lib/apis/core/crypto/crypto_utils.dart -FNF:0 -FNH:0 -DA:16,30 -DA:23,6 -DA:25,6 -DA:27,6 -DA:28,12 -DA:29,12 -DA:33,10 -DA:35,10 -DA:36,20 -DA:37,30 -DA:42,10 -DA:44,20 -DA:47,6 -DA:49,6 -DA:50,6 -DA:51,6 -DA:54,6 -DA:56,12 -DA:57,6 -DA:61,6 -DA:63,6 -DA:64,6 -DA:67,8 -DA:69,8 -DA:70,16 -DA:71,8 -DA:72,8 -DA:79,5 -DA:81,5 -DA:82,10 -DA:83,5 -DA:84,5 -DA:90,7 -DA:103,7 -DA:112,8 -DA:114,7 -DA:115,7 -DA:116,7 -DA:117,7 -DA:118,7 -DA:123,7 -DA:125,7 -DA:128,3 -DA:133,7 -DA:135,7 -DA:136,7 -DA:137,7 -DA:139,7 -DA:140,7 -DA:141,7 -DA:145,7 -DA:146,7 -DA:149,7 -DA:156,7 -DA:158,7 -DA:166,3 -DA:170,7 -DA:172,7 -DA:175,7 -DA:177,7 -DA:178,7 -DA:182,7 -DA:183,3 -DA:185,3 -DA:187,3 -DA:189,14 -DA:190,7 -DA:191,7 -DA:192,7 -DA:194,7 -DA:203,7 -DA:208,7 -DA:209,7 -DA:210,6 -DA:212,7 -DA:213,7 -DA:219,7 -DA:226,7 -DA:236,7 -DA:243,7 -DA:247,14 -DA:248,3 -DA:249,3 -LF:83 -LH:83 -end_of_record -TN: -SF:lib/apis/core/echo/echo.dart -FNF:0 -FNH:0 -DA:10,11 -DA:12,1 -DA:14,2 -DA:15,3 -DA:16,2 -DA:22,2 -DA:23,3 -DA:24,4 -DA:27,0 -DA:31,1 -DA:33,2 -DA:34,3 -DA:35,2 -DA:40,2 -DA:41,3 -DA:42,4 -DA:45,0 -LF:17 -LH:15 -end_of_record -TN: -SF:lib/apis/core/echo/echo_client.dart -FNF:0 -FNH:0 -DA:14,11 -DA:16,1 -DA:22,1 -DA:24,3 -DA:25,2 -DA:28,2 -DA:31,2 -DA:32,1 -DA:35,1 -DA:40,3 -DA:42,2 -DA:44,2 -DA:45,1 -LF:13 -LH:13 -end_of_record -TN: -SF:lib/apis/core/echo/models/echo_body.dart -FNF:0 -FNH:0 -DA:11,1 -DA:17,0 -DA:18,0 -DA:20,2 -LF:4 -LH:2 -end_of_record -TN: -SF:lib/apis/core/echo/models/echo_response.dart -FNF:0 -FNH:0 -DA:11,1 -DA:17,1 -DA:18,1 -DA:20,0 -DA:28,1 -DA:30,1 -DA:31,1 -DA:33,0 -DA:42,1 -DA:48,2 -DA:50,0 -LF:11 -LH:8 -end_of_record -TN: -SF:lib/apis/core/heartbit/heartbeat.dart -FNF:0 -FNH:0 -DA:12,10 -DA:14,9 -DA:16,9 -DA:17,18 -DA:18,18 -DA:19,18 -DA:23,0 -DA:25,0 -DA:26,0 -LF:9 -LH:6 -end_of_record -TN: -SF:lib/apis/core/pairing/expirer.dart -FNF:0 -FNH:0 -DA:11,10 -DA:18,0 -DA:20,0 -DA:22,0 -DA:23,0 -DA:32,6 -DA:34,6 -DA:36,12 -DA:37,12 -DA:38,6 -DA:39,4 -DA:47,4 -DA:49,4 -DA:51,8 -DA:56,8 -DA:57,4 -DA:62,4 -LF:17 -LH:13 -end_of_record -TN: -SF:lib/apis/core/pairing/json_rpc_history.dart -FNF:0 -FNH:0 -DA:7,11 -DA:14,1 -DA:16,1 -DA:19,2 -DA:20,2 -DA:24,1 -DA:27,1 -DA:31,2 -DA:32,1 -DA:33,1 -DA:34,0 -DA:36,1 -LF:12 -LH:11 -end_of_record -TN: -SF:lib/apis/core/pairing/pairing.dart -FNF:0 -FNH:0 -DA:29,6 -DA:66,10 -DA:73,9 -DA:75,9 -DA:79,9 -DA:80,9 -DA:81,9 -DA:83,27 -DA:84,18 -DA:85,18 -DA:86,18 -DA:88,9 -DA:90,9 -DA:92,9 -DA:95,6 -DA:97,12 -DA:98,24 -DA:102,7 -DA:104,7 -DA:105,28 -DA:106,21 -DA:107,7 -DA:110,7 -DA:111,7 -DA:116,20 -DA:118,7 -DA:119,14 -DA:120,14 -DA:128,14 -DA:129,7 -DA:134,14 -DA:135,21 -DA:136,21 -DA:138,7 -DA:145,7 -DA:150,7 -DA:153,7 -DA:156,7 -DA:157,14 -DA:158,3 -DA:164,7 -DA:165,14 -DA:166,14 -DA:167,7 -DA:172,14 -DA:176,7 -DA:177,14 -DA:178,21 -DA:180,4 -DA:182,8 -DA:183,4 -DA:184,4 -DA:198,14 -DA:199,21 -DA:200,28 -DA:203,21 -DA:205,14 -DA:206,7 -DA:212,2 -DA:221,7 -DA:223,7 -DA:224,7 -DA:229,14 -DA:230,7 -DA:236,14 -DA:241,21 -DA:244,9 -DA:250,18 -DA:251,6 -DA:252,6 -DA:260,27 -DA:267,2 -DA:273,2 -DA:274,4 -DA:276,2 -DA:279,2 -DA:286,1 -DA:291,1 -DA:294,1 -DA:295,1 -DA:304,2 -DA:308,3 -DA:314,5 -DA:319,5 -DA:320,10 -DA:326,9 -DA:328,18 -DA:331,4 -DA:333,8 -DA:336,5 -DA:338,5 -DA:340,5 -DA:342,10 -DA:344,5 -DA:347,5 -DA:352,4 -DA:354,4 -DA:356,4 -DA:357,8 -DA:360,4 -DA:363,8 -DA:368,8 -DA:370,8 -DA:371,4 -DA:378,5 -DA:380,5 -DA:383,6 -DA:385,12 -DA:386,4 -DA:388,4 -DA:392,18 -DA:393,0 -DA:395,0 -DA:402,6 -DA:411,18 -DA:412,6 -DA:415,6 -DA:422,18 -DA:432,12 -DA:434,4 -DA:438,12 -DA:439,21 -DA:442,18 -DA:444,18 -DA:447,6 -DA:448,6 -DA:453,6 -DA:454,0 -DA:458,12 -DA:459,0 -DA:462,12 -DA:468,6 -DA:476,18 -DA:477,6 -DA:480,6 -DA:484,18 -DA:494,12 -DA:495,18 -DA:498,6 -DA:499,6 -DA:503,3 -DA:512,9 -DA:513,3 -DA:516,3 -DA:520,9 -DA:531,3 -DA:532,0 -DA:533,6 -DA:537,9 -DA:540,3 -DA:541,3 -DA:547,9 -DA:549,27 -DA:554,16 -DA:555,8 -DA:556,0 -DA:558,0 -DA:563,2 -DA:564,6 -DA:565,4 -DA:566,6 -DA:568,6 -DA:572,9 -DA:573,9 -DA:574,9 -DA:575,3 -DA:577,9 -DA:578,10 -DA:580,2 -DA:584,9 -DA:585,9 -DA:586,9 -DA:587,4 -DA:589,9 -DA:591,10 -DA:593,4 -DA:598,9 -DA:599,9 -DA:600,12 -DA:601,9 -DA:603,10 -DA:605,3 -DA:609,7 -DA:610,7 -DA:611,0 -DA:619,9 -DA:620,45 -DA:621,45 -DA:623,9 -DA:625,9 -DA:628,9 -DA:630,9 -DA:635,0 -DA:637,0 -DA:640,6 -DA:647,18 -DA:650,6 -DA:654,18 -DA:655,6 -DA:656,6 -DA:657,6 -DA:658,2 -DA:667,6 -DA:668,24 -DA:672,6 -DA:673,6 -DA:674,18 -DA:675,36 -DA:677,0 -DA:682,6 -DA:694,18 -DA:695,6 -DA:696,15 -DA:697,9 -DA:698,3 -DA:699,6 -DA:704,30 -DA:705,36 -DA:711,5 -DA:715,5 -DA:718,5 -DA:719,5 -DA:722,5 -DA:725,10 -DA:726,5 -DA:731,0 -DA:733,0 -DA:736,0 -DA:742,4 -DA:747,4 -DA:749,4 -DA:750,4 -DA:753,4 -DA:756,8 -DA:757,8 -DA:758,4 -DA:763,0 -DA:764,0 -DA:767,0 -DA:773,0 -DA:777,0 -DA:778,0 -DA:780,0 -DA:783,0 -DA:786,0 -DA:787,0 -DA:790,0 -DA:791,0 -DA:793,0 -DA:794,0 -DA:800,9 -DA:801,45 -DA:804,9 -DA:805,45 -DA:808,4 -DA:813,12 -DA:815,2 -DA:816,2 -DA:817,1 -DA:818,1 -DA:824,6 -DA:825,6 -DA:830,5 -DA:831,5 -DA:834,4 -DA:835,4 -LF:266 -LH:238 -end_of_record -TN: -SF:lib/apis/core/pairing/pairing_store.dart -FNF:0 -FNH:0 -DA:6,11 -DA:13,8 -DA:20,8 -DA:22,8 -DA:28,16 -DA:31,14 -DA:34,10 -DA:37,8 -LF:8 -LH:8 -end_of_record -TN: -SF:lib/apis/core/pairing/utils/json_rpc_utils.dart -FNF:0 -FNH:0 -DA:8,8 -DA:9,8 -DA:10,24 -DA:11,32 -DA:12,8 -DA:15,6 -DA:20,6 -DA:21,6 -DA:28,6 -DA:32,6 -DA:39,3 -DA:40,3 -DA:43,3 -DA:47,7 -DA:51,7 -DA:54,13 -DA:55,24 -DA:57,4 -DA:62,7 -DA:65,4 -DA:68,8 -LF:21 -LH:21 -end_of_record -TN: -SF:lib/apis/core/pairing/utils/pairing_models.dart -FNF:0 -FNH:0 -DA:28,0 -DA:29,0 -DA:44,0 -DA:51,5 -DA:52,5 -DA:63,0 -DA:64,0 -DA:72,7 -DA:78,0 -DA:80,0 -DA:88,4 -DA:93,0 -DA:95,0 -DA:102,0 -DA:104,0 -DA:106,0 -DA:113,4 -DA:117,0 -DA:119,0 -DA:128,7 -DA:134,0 -DA:136,0 -DA:144,7 -DA:149,0 -DA:151,0 -DA:168,0 -DA:169,0 -DA:181,0 -DA:182,0 -DA:190,9 -DA:196,0 -DA:198,0 -LF:32 -LH:8 -end_of_record -TN: -SF:lib/apis/core/relay_auth/relay_auth.dart -FNF:0 -FNH:0 -DA:20,9 -DA:25,0 -DA:26,0 -DA:27,0 -DA:29,9 -DA:30,9 -DA:33,9 -DA:34,18 -DA:35,18 -DA:39,10 -DA:47,36 -DA:48,10 -DA:49,20 -DA:50,10 -DA:51,10 -DA:58,10 -DA:59,10 -DA:64,10 -DA:65,20 -DA:69,20 -DA:72,1 -DA:74,1 -DA:77,3 -DA:78,3 -DA:79,0 -DA:85,3 -DA:86,1 -DA:87,1 -DA:88,2 -DA:89,2 -DA:103,10 -DA:104,10 -DA:107,10 -DA:109,10 -DA:110,10 -DA:111,10 -DA:113,10 -DA:118,1 -DA:120,1 -DA:121,1 -DA:122,1 -DA:123,1 -DA:132,10 -DA:134,20 -DA:136,50 -DA:137,10 -DA:141,10 -DA:145,1 -DA:147,1 -DA:148,4 -DA:149,0 -DA:151,1 -DA:154,1 -DA:155,1 -DA:156,0 -DA:163,3 -DA:166,3 -DA:167,1 -DA:168,0 -DA:175,1 -DA:176,2 -DA:177,0 -DA:186,10 -DA:188,10 -DA:189,30 -DA:190,30 -DA:191,10 -DA:193,20 -DA:196,0 -DA:198,0 -DA:200,0 -DA:201,0 -DA:203,0 -DA:206,10 -DA:208,20 -DA:211,1 -DA:213,3 -DA:216,10 -DA:218,10 -DA:219,30 -DA:220,30 -DA:221,30 -DA:222,10 -DA:225,1 -DA:227,1 -DA:229,3 -DA:230,3 -DA:231,2 -DA:232,3 -DA:234,1 -LF:90 -LH:77 -end_of_record -TN: -SF:lib/apis/core/relay_auth/relay_auth_models.dart -FNF:0 -FNH:0 -DA:14,9 -DA:17,9 -DA:18,9 -DA:20,1 -DA:23,2 -DA:24,2 -DA:35,10 -DA:40,1 -DA:41,1 -DA:43,20 -DA:54,10 -DA:62,1 -DA:63,1 -DA:65,20 -DA:72,10 -DA:78,10 -DA:82,20 -DA:88,1 -DA:93,1 -DA:100,0 -DA:110,0 -LF:21 -LH:19 -end_of_record -TN: -SF:lib/apis/core/relay_client/i_relay_client.dart -FNF:0 -FNH:0 -DA:10,0 -LF:1 -LH:0 -end_of_record -TN: -SF:lib/apis/core/relay_client/json_rpc_2/error_code.dart -FNF:0 -FNH:0 -DA:42,0 -DA:44,0 -DA:46,0 -DA:48,0 -DA:50,0 -DA:52,0 -LF:6 -LH:0 -end_of_record -TN: -SF:lib/apis/core/relay_client/json_rpc_2/src/client.dart -FNF:0 -FNH:0 -DA:40,24 -DA:46,24 -DA:52,0 -DA:53,0 -DA:54,0 -DA:64,8 -DA:65,24 -DA:66,21 -DA:67,15 -DA:68,10 -DA:70,16 -DA:71,8 -DA:82,8 -DA:83,32 -DA:84,0 -DA:85,0 -DA:86,0 -DA:87,0 -DA:88,0 -DA:90,8 -DA:97,8 -DA:98,24 -DA:99,32 -DA:100,8 -DA:116,8 -DA:117,0 -DA:118,8 -DA:120,8 -DA:121,32 -DA:122,8 -DA:137,0 -DA:138,0 -DA:144,8 -DA:145,8 -DA:146,8 -DA:147,0 -DA:150,8 -DA:152,8 -DA:153,8 -DA:154,8 -DA:156,8 -DA:157,0 -DA:159,24 -DA:175,0 -DA:176,0 -DA:177,0 -DA:181,0 -DA:182,0 -DA:183,0 -DA:184,0 -DA:189,8 -DA:190,8 -DA:191,0 -DA:193,8 -DA:199,8 -DA:200,8 -DA:201,8 -DA:202,8 -DA:203,16 -DA:204,8 -DA:205,21 -DA:207,8 -DA:208,20 -DA:209,8 -DA:210,4 -DA:215,8 -DA:216,8 -DA:217,16 -DA:218,8 -DA:219,8 -DA:220,16 -DA:221,8 -DA:223,4 -DA:224,4 -DA:225,4 -DA:226,8 -DA:227,8 -DA:243,8 -LF:78 -LH:57 -end_of_record -TN: -SF:lib/apis/core/relay_client/json_rpc_2/src/exception.dart -FNF:0 -FNH:0 -DA:29,4 -DA:34,0 -DA:35,0 -DA:41,0 -DA:42,0 -DA:46,0 -DA:48,0 -DA:49,0 -DA:50,0 -DA:51,0 -DA:52,0 -DA:54,0 -DA:57,0 -DA:58,0 -DA:59,0 -DA:61,0 -DA:66,0 -DA:68,0 -DA:69,0 -DA:70,0 -DA:71,0 -LF:21 -LH:1 -end_of_record -TN: -SF:lib/apis/core/relay_client/json_rpc_2/src/parameters.dart -FNF:0 -FNH:0 -DA:31,7 -DA:46,7 -DA:47,7 -DA:48,0 -DA:49,0 -DA:50,0 -DA:52,0 -DA:54,7 -DA:55,7 -DA:56,14 -DA:57,28 -DA:59,0 -DA:62,0 -DA:68,0 -DA:69,0 -DA:70,0 -DA:74,0 -DA:75,0 -DA:76,0 -DA:80,0 -DA:81,0 -DA:82,0 -DA:87,7 -DA:88,14 -DA:89,0 -DA:128,0 -DA:129,0 -DA:130,0 -DA:133,0 -DA:134,0 -DA:138,0 -DA:139,0 -DA:140,0 -DA:143,0 -DA:144,0 -DA:145,0 -DA:146,0 -DA:149,0 -DA:153,0 -DA:155,7 -DA:156,7 -DA:159,0 -DA:165,0 -DA:170,0 -DA:180,0 -DA:189,0 -DA:195,0 -DA:200,0 -DA:206,0 -DA:211,0 -DA:217,0 -DA:218,0 -DA:223,0 -DA:229,7 -DA:230,21 -DA:235,0 -DA:242,0 -DA:248,0 -DA:255,0 -DA:261,0 -DA:268,7 -DA:269,21 -DA:270,0 -DA:271,0 -DA:274,0 -DA:275,0 -DA:277,0 -DA:278,0 -DA:282,0 -DA:283,0 -DA:286,0 -DA:289,0 -DA:290,0 -DA:291,0 -DA:295,0 -DA:298,0 -DA:301,7 -DA:304,7 -DA:310,0 -DA:312,0 -DA:313,0 -DA:316,0 -DA:319,0 -DA:320,0 -DA:322,0 -DA:325,0 -DA:328,0 -DA:331,0 -DA:334,0 -DA:337,0 -DA:340,0 -DA:343,0 -DA:346,0 -LF:93 -LH:17 -end_of_record -TN: -SF:lib/apis/core/relay_client/json_rpc_2/src/peer.dart -FNF:0 -FNH:0 -DA:39,56 -DA:41,8 -DA:42,32 -DA:44,0 -DA:45,0 -DA:47,0 -DA:48,0 -DA:62,8 -DA:64,8 -DA:65,32 -DA:84,8 -DA:86,16 -DA:87,40 -DA:90,16 -DA:91,40 -DA:96,8 -DA:98,16 -DA:100,0 -DA:102,0 -DA:104,0 -DA:105,0 -DA:109,8 -DA:111,16 -DA:113,0 -DA:115,0 -DA:119,8 -DA:121,16 -DA:122,16 -DA:123,32 -DA:124,8 -DA:125,16 -DA:126,16 -DA:128,14 -DA:130,0 -DA:131,0 -DA:132,0 -DA:133,0 -DA:134,0 -DA:135,0 -DA:137,0 -DA:142,0 -DA:144,0 -DA:145,0 -DA:146,8 -DA:147,8 -DA:150,8 -DA:152,16 -DA:153,16 -DA:154,8 -LF:49 -LH:29 -end_of_record -TN: -SF:lib/apis/core/relay_client/json_rpc_2/src/server.dart -FNF:0 -FNH:0 -DA:50,24 -DA:56,24 -DA:84,0 -DA:86,0 -DA:87,0 -DA:106,8 -DA:115,8 -DA:116,32 -DA:117,0 -DA:118,0 -DA:119,0 -DA:120,0 -DA:122,8 -DA:129,8 -DA:130,24 -DA:131,32 -DA:132,8 -DA:144,8 -DA:145,16 -DA:146,0 -DA:149,16 -DA:163,0 -DA:164,0 -DA:174,7 -DA:176,7 -DA:177,0 -DA:178,0 -DA:180,0 -DA:182,0 -DA:183,0 -DA:184,0 -DA:185,0 -DA:188,7 -DA:192,28 -DA:196,7 -DA:198,7 -DA:200,7 -DA:201,14 -DA:202,0 -DA:205,7 -DA:206,0 -DA:207,0 -DA:210,0 -DA:212,21 -DA:217,7 -DA:219,14 -DA:221,0 -DA:222,0 -DA:223,0 -DA:224,0 -DA:226,0 -DA:229,0 -DA:230,0 -DA:233,0 -DA:234,0 -DA:235,0 -DA:236,0 -DA:237,0 -DA:238,0 -DA:243,7 -DA:244,7 -DA:245,0 -DA:251,14 -DA:252,0 -DA:258,7 -DA:259,14 -DA:260,0 -DA:261,0 -DA:263,0 -DA:266,7 -DA:267,0 -DA:273,7 -DA:274,14 -DA:275,0 -DA:276,0 -DA:278,0 -DA:281,7 -DA:282,7 -DA:283,14 -DA:284,0 -DA:285,0 -DA:287,0 -DA:291,7 -DA:292,14 -DA:293,0 -DA:294,0 -DA:296,0 -DA:301,0 -DA:302,0 -DA:304,0 -DA:305,0 -DA:306,0 -DA:310,0 -DA:311,0 -DA:312,0 -DA:313,0 -DA:317,0 -LF:97 -LH:38 -end_of_record -TN: -SF:lib/apis/core/relay_client/json_rpc_2/src/utils.dart -FNF:0 -FNH:0 -DA:16,0 -DA:22,0 -DA:23,0 -DA:30,0 -DA:33,0 -DA:35,0 -DA:39,0 -DA:40,0 -DA:42,0 -DA:47,0 -DA:48,0 -DA:49,0 -DA:50,0 -DA:54,16 -DA:55,8 -DA:59,8 -DA:61,16 -DA:62,8 -DA:64,0 -DA:65,0 -DA:66,0 -DA:67,0 -LF:22 -LH:5 -end_of_record -TN: -SF:lib/apis/core/relay_client/message_tracker.dart -FNF:0 -FNH:0 -DA:12,11 -DA:19,8 -DA:20,8 -DA:21,16 -DA:22,8 -DA:23,8 -DA:29,8 -DA:31,8 -DA:33,16 -DA:34,8 -DA:36,8 -DA:40,16 -DA:41,24 -DA:43,24 -DA:44,8 -DA:47,8 -DA:49,8 -DA:50,40 -LF:18 -LH:18 -end_of_record -TN: -SF:lib/apis/core/relay_client/relay_client.dart -FNF:0 -FNH:0 -DA:55,9 -DA:56,25 -DA:58,20 -DA:81,10 -DA:86,10 -DA:88,9 -DA:90,9 -DA:94,18 -DA:95,18 -DA:98,9 -DA:99,9 -DA:101,9 -DA:104,7 -DA:111,7 -DA:113,7 -DA:121,14 -DA:122,7 -DA:123,7 -DA:125,7 -DA:129,15 -DA:133,7 -DA:135,7 -DA:137,21 -DA:139,14 -DA:142,5 -DA:144,5 -DA:146,10 -DA:149,5 -DA:150,5 -DA:151,5 -DA:155,5 -DA:158,12 -DA:162,10 -DA:163,10 -DA:166,10 -DA:169,0 -DA:171,0 -DA:173,0 -DA:175,0 -DA:178,8 -DA:180,8 -DA:182,24 -DA:184,8 -DA:189,9 -DA:190,9 -DA:194,36 -DA:195,63 -DA:198,9 -DA:199,9 -DA:204,18 -DA:205,9 -DA:206,8 -DA:207,8 -DA:209,2 -DA:210,0 -DA:211,0 -DA:212,0 -DA:213,0 -DA:215,10 -DA:216,6 -DA:217,2 -DA:221,9 -DA:222,27 -DA:223,9 -DA:225,9 -DA:227,17 -DA:228,9 -DA:229,18 -DA:230,9 -DA:233,16 -DA:237,9 -DA:238,9 -DA:239,9 -DA:240,45 -DA:241,36 -DA:242,9 -DA:245,18 -DA:248,18 -DA:249,9 -DA:252,9 -DA:253,0 -DA:254,0 -DA:257,36 -DA:258,18 -DA:259,34 -DA:261,32 -DA:263,16 -DA:264,8 -DA:265,8 -DA:267,16 -DA:268,8 -DA:269,8 -DA:271,16 -DA:272,8 -DA:273,8 -DA:276,16 -DA:283,16 -DA:286,8 -DA:287,24 -DA:288,8 -DA:289,8 -DA:290,16 -DA:291,16 -DA:296,16 -DA:297,56 -DA:300,8 -DA:301,8 -DA:302,0 -DA:305,8 -DA:307,32 -DA:309,8 -DA:314,1 -DA:316,1 -DA:317,0 -DA:319,1 -DA:320,1 -DA:323,2 -DA:324,2 -DA:333,9 -DA:334,9 -DA:335,45 -DA:336,9 -DA:340,9 -DA:341,45 -DA:342,9 -DA:345,5 -DA:346,5 -DA:347,0 -DA:351,8 -DA:352,8 -DA:357,7 -DA:358,28 -DA:360,7 -DA:361,24 -DA:366,14 -DA:369,14 -DA:370,7 -DA:378,7 -DA:379,21 -DA:380,21 -DA:381,7 -DA:384,0 -DA:385,0 -DA:388,0 -DA:389,0 -DA:394,7 -DA:395,7 -DA:396,14 -DA:401,8 -DA:407,8 -DA:411,5 -DA:412,0 -DA:415,10 -DA:416,0 -DA:422,16 -DA:429,7 -DA:432,7 -DA:433,7 -DA:434,7 -DA:435,7 -DA:438,4 -DA:439,3 -DA:446,21 -DA:447,14 -DA:452,7 -DA:453,14 -DA:457,0 -DA:458,0 -DA:459,0 -DA:465,8 -DA:466,8 -DA:467,0 -LF:172 -LH:149 -end_of_record -TN: -SF:lib/apis/core/relay_client/relay_client_models.dart -FNF:0 -FNH:0 -DA:11,12 -DA:16,8 -DA:18,8 -DA:25,7 -DA:30,0 -DA:31,0 -DA:37,8 -DA:45,0 -DA:53,0 -DA:56,0 -LF:10 -LH:5 -end_of_record -TN: -SF:lib/apis/core/relay_client/websocket/http_client.dart -FNF:0 -FNH:0 -DA:5,82 -DA:7,0 -DA:12,0 -DA:15,0 -DA:17,0 -DA:20,0 -DA:26,0 -LF:7 -LH:1 -end_of_record -TN: -SF:lib/apis/core/relay_client/websocket/i_http_client.dart -FNF:0 -FNH:0 -DA:4,82 -LF:1 -LH:1 -end_of_record -TN: -SF:lib/apis/core/relay_client/websocket/websocket_handler.dart -FNF:0 -FNH:0 -DA:10,8 -DA:11,8 -DA:15,8 -DA:16,16 -DA:17,8 -DA:18,16 -DA:21,8 -DA:22,8 -DA:24,0 -DA:25,0 -DA:29,8 -DA:33,8 -DA:35,8 -DA:38,8 -DA:42,16 -DA:43,8 -DA:44,16 -DA:48,0 -DA:49,0 -DA:50,0 -DA:54,24 -DA:56,8 -DA:58,0 -DA:59,0 -DA:61,0 -DA:65,16 -DA:76,8 -DA:79,8 -DA:80,24 -DA:83,8 -DA:86,0 -DA:88,0 -LF:32 -LH:22 -end_of_record -TN: -SF:lib/apis/core/store/generic_store.dart -FNF:0 -FNH:0 -DA:14,12 -DA:15,36 -DA:36,12 -DA:43,12 -DA:45,12 -DA:49,24 -DA:50,12 -DA:52,12 -DA:55,8 -DA:57,8 -DA:58,16 -DA:61,12 -DA:63,12 -DA:64,24 -DA:65,20 -DA:70,10 -DA:72,30 -DA:75,12 -DA:77,12 -DA:79,24 -DA:80,18 -DA:81,9 -DA:87,24 -DA:88,12 -DA:95,24 -DA:97,12 -DA:100,9 -DA:102,9 -DA:104,18 -DA:108,18 -DA:109,9 -DA:111,18 -DA:115,9 -DA:118,12 -DA:120,12 -DA:122,24 -DA:123,12 -DA:126,48 -DA:129,12 -DA:132,36 -DA:134,60 -DA:135,48 -DA:141,32 -DA:142,16 -DA:144,4 -DA:145,5 -DA:146,4 -DA:150,24 -DA:154,34 -DA:156,12 -DA:160,2 -DA:165,12 -DA:167,12 -DA:168,0 -LF:54 -LH:53 -end_of_record -TN: -SF:lib/apis/core/store/shared_prefs_store.dart -FNF:0 -FNH:0 -DA:14,0 -DA:15,0 -DA:17,0 -DA:18,0 -DA:20,0 -DA:21,0 -DA:23,12 -DA:28,12 -DA:31,12 -DA:34,12 -DA:36,12 -DA:40,12 -DA:41,0 -DA:44,12 -DA:49,8 -DA:51,8 -DA:53,8 -DA:54,16 -DA:55,16 -DA:58,1 -DA:60,0 -DA:65,12 -DA:67,12 -DA:68,12 -DA:69,24 -DA:71,0 -DA:75,0 -DA:77,0 -DA:78,0 -DA:82,12 -DA:84,12 -DA:86,12 -DA:87,24 -DA:88,12 -DA:92,0 -DA:94,0 -DA:96,0 -DA:97,0 -DA:98,0 -DA:100,0 -DA:101,0 -DA:106,1 -DA:108,1 -DA:110,1 -DA:111,2 -DA:112,1 -DA:115,1 -DA:116,1 -DA:120,0 -DA:121,0 -DA:122,0 -DA:124,0 -DA:128,12 -DA:129,12 -DA:134,0 -DA:135,0 -DA:136,0 -DA:137,0 -DA:139,0 -DA:144,1 -DA:145,1 -DA:148,0 -DA:151,12 -DA:152,24 -DA:155,12 -DA:156,12 -DA:157,0 -LF:67 -LH:37 -end_of_record -TN: -SF:lib/apis/core/store/store_models.dart -FNF:0 -FNH:0 -DA:7,12 -DA:17,9 -DA:27,9 -DA:34,12 -LF:4 -LH:4 -end_of_record -TN: -SF:lib/apis/core/verify/models/verify_context.dart -FNF:0 -FNH:0 -DA:12,0 -DA:13,0 -DA:14,0 -DA:15,0 -DA:28,0 -DA:29,0 -DA:41,0 -DA:42,0 -DA:49,8 -LF:9 -LH:1 -end_of_record -TN: -SF:lib/apis/core/verify/verify.dart -FNF:0 -FNH:0 -DA:14,10 -DA:20,5 -DA:24,10 -DA:27,4 -DA:30,12 -DA:31,16 -DA:32,16 -DA:33,4 -DA:38,0 -DA:39,0 -DA:41,0 -DA:43,20 -DA:48,5 -DA:51,5 -DA:52,0 -DA:53,0 -LF:16 -LH:11 -end_of_record -TN: -SF:lib/apis/models/basic_models.dart -FNF:0 -FNH:0 -DA:20,0 -DA:21,0 -DA:42,5 -DA:43,5 -LF:4 -LH:2 -end_of_record -TN: -SF:lib/apis/models/json_rpc_error.dart -FNF:0 -FNH:0 -DA:14,0 -DA:15,0 -DA:16,3 -DA:17,6 -DA:18,0 -DA:19,0 -DA:20,0 -DA:21,0 -DA:22,3 -DA:23,6 -DA:25,3 -DA:26,3 -LF:12 -LH:6 -end_of_record -TN: -SF:lib/apis/models/json_rpc_request.dart -FNF:0 -FNH:0 -DA:16,6 -DA:17,6 -LF:2 -LH:2 -end_of_record -TN: -SF:lib/apis/models/json_rpc_response.dart -FNF:0 -FNH:0 -DA:17,6 -DA:18,12 -LF:2 -LH:2 -end_of_record -TN: -SF:lib/apis/models/uri_parse_result.dart -FNF:0 -FNH:0 -DA:15,8 -DA:28,5 -DA:39,8 -LF:3 -LH:3 -end_of_record -TN: -SF:lib/apis/sign_api/models/auth/auth_client_events.dart -FNF:0 -FNH:0 -DA:15,2 -DA:22,0 -DA:24,0 -DA:35,2 -DA:43,0 -DA:44,0 -DA:45,0 -DA:46,0 -DA:47,0 -DA:48,0 -DA:51,0 -DA:53,0 -LF:12 -LH:2 -end_of_record -TN: -SF:lib/apis/sign_api/models/auth/auth_client_models.dart -FNF:0 -FNH:0 -DA:18,2 -DA:47,3 -DA:59,3 -DA:61,0 -DA:62,0 -DA:63,0 -DA:64,0 -DA:65,0 -DA:66,0 -DA:67,0 -DA:68,0 -DA:69,0 -DA:70,0 -DA:71,0 -DA:72,0 -DA:96,2 -DA:97,2 -DA:98,2 -DA:99,2 -DA:100,2 -DA:101,2 -DA:102,2 -DA:104,2 -DA:105,2 -DA:106,2 -DA:107,2 -DA:108,2 -DA:109,2 -DA:110,2 -DA:111,2 -DA:112,2 -DA:113,2 -DA:114,2 -DA:115,2 -DA:116,2 -DA:117,2 -DA:118,2 -DA:122,2 -DA:123,2 -DA:136,0 -DA:137,0 -DA:147,0 -DA:161,0 -LF:43 -LH:27 -end_of_record -TN: -SF:lib/apis/sign_api/models/auth/common_auth_models.dart -FNF:0 -FNH:0 -DA:16,0 -DA:17,0 -DA:36,2 -DA:37,2 -DA:38,2 -DA:39,2 -DA:40,2 -DA:41,2 -DA:42,2 -DA:43,2 -DA:44,2 -DA:45,2 -DA:46,2 -DA:47,2 -DA:51,0 -DA:54,0 -DA:55,0 -DA:56,0 -DA:57,0 -DA:58,0 -DA:59,0 -DA:60,0 -DA:61,0 -DA:62,0 -DA:63,0 -DA:64,0 -DA:68,2 -DA:69,2 -DA:70,2 -DA:71,2 -DA:72,2 -DA:73,2 -DA:74,2 -DA:75,2 -DA:76,2 -DA:77,2 -DA:78,2 -DA:79,2 -DA:83,0 -DA:84,0 -DA:104,2 -DA:108,2 -DA:110,2 -DA:111,2 -DA:112,2 -DA:113,2 -DA:114,2 -DA:115,2 -DA:116,2 -DA:117,2 -DA:118,2 -DA:119,2 -DA:123,2 -DA:124,2 -DA:137,2 -DA:138,2 -DA:153,2 -DA:154,2 -DA:166,4 -DA:180,2 -DA:185,2 -DA:188,2 -DA:189,2 -DA:190,2 -DA:194,0 -DA:195,0 -LF:66 -LH:48 -end_of_record -TN: -SF:lib/apis/sign_api/models/auth/session_auth_events.dart -FNF:0 -FNH:0 -DA:19,0 -DA:27,0 -DA:28,0 -DA:29,0 -DA:30,0 -DA:31,0 -DA:32,0 -DA:35,0 -DA:37,0 -DA:49,0 -DA:58,0 -DA:59,0 -DA:60,0 -DA:61,0 -DA:62,0 -DA:63,0 -DA:64,0 -DA:67,0 -DA:69,0 -LF:19 -LH:0 -end_of_record -TN: -SF:lib/apis/sign_api/models/auth/session_auth_models.dart -FNF:0 -FNH:0 -DA:20,0 -DA:47,0 -DA:48,0 -DA:71,0 -DA:74,0 -DA:75,0 -DA:76,0 -DA:77,0 -DA:78,0 -DA:79,0 -DA:80,0 -DA:82,0 -DA:83,0 -DA:84,0 -DA:85,0 -DA:86,0 -DA:87,0 -DA:88,0 -DA:89,0 -DA:90,0 -DA:91,0 -DA:92,0 -DA:93,0 -DA:94,0 -DA:95,0 -DA:99,0 -DA:100,0 -DA:115,0 -DA:116,0 -LF:29 -LH:0 -end_of_record -TN: -SF:lib/apis/sign_api/models/json_rpc_models.dart -FNF:0 -FNH:0 -DA:21,0 -DA:22,0 -DA:32,0 -DA:33,0 -DA:47,4 -DA:48,4 -DA:59,0 -DA:60,0 -DA:76,4 -DA:77,4 -DA:87,3 -DA:88,3 -DA:98,3 -DA:99,3 -DA:111,3 -DA:112,3 -DA:122,3 -DA:123,3 -DA:134,3 -DA:135,3 -DA:146,3 -DA:147,3 -DA:158,3 -DA:159,3 -DA:170,3 -DA:171,3 -DA:184,2 -DA:185,2 -DA:195,0 -DA:196,0 -DA:208,0 -DA:209,0 -DA:220,0 -DA:221,0 -LF:34 -LH:22 -end_of_record -TN: -SF:lib/apis/sign_api/models/proposal_models.dart -FNF:0 -FNH:0 -DA:18,4 -DA:19,4 -DA:30,0 -DA:31,0 -DA:49,0 -DA:50,0 -LF:6 -LH:2 -end_of_record -TN: -SF:lib/apis/sign_api/models/session_models.dart -FNF:0 -FNH:0 -DA:21,4 -DA:31,0 -DA:33,0 -DA:47,4 -DA:48,4 -DA:69,0 -DA:70,0 -DA:85,0 -DA:86,0 -LF:9 -LH:3 -end_of_record -TN: -SF:lib/apis/sign_api/models/sign_client_events.dart -FNF:0 -FNH:0 -DA:14,4 -DA:20,0 -DA:21,0 -DA:22,0 -DA:23,0 -DA:26,0 -DA:28,0 -DA:38,0 -DA:45,0 -DA:47,0 -DA:54,4 -DA:58,0 -DA:60,0 -DA:69,3 -DA:75,0 -DA:77,0 -DA:85,3 -DA:87,0 -DA:89,0 -DA:97,3 -DA:99,0 -DA:101,0 -DA:109,3 -DA:114,0 -DA:116,0 -DA:123,3 -DA:125,0 -DA:127,0 -DA:138,3 -DA:146,3 -DA:149,3 -DA:150,3 -DA:151,3 -DA:152,3 -DA:153,3 -DA:154,3 -DA:158,0 -DA:160,0 -DA:171,3 -DA:179,0 -DA:181,0 -DA:188,0 -DA:190,0 -DA:192,0 -LF:44 -LH:16 -end_of_record -TN: -SF:lib/apis/sign_api/models/sign_client_models.dart -FNF:0 -FNH:0 -DA:10,4 -DA:16,0 -DA:18,0 -DA:26,4 -DA:31,0 -DA:33,0 -LF:6 -LH:2 -end_of_record -TN: -SF:lib/apis/sign_api/sessions.dart -FNF:0 -FNH:0 -DA:7,6 -DA:14,5 -DA:20,5 -DA:22,5 -DA:28,10 -DA:31,6 -DA:34,5 -LF:7 -LH:7 -end_of_record -TN: -SF:lib/apis/sign_api/sign_client.dart -FNF:0 -FNH:0 -DA:15,1 -DA:16,2 -DA:17,1 -DA:18,2 -DA:19,1 -DA:20,2 -DA:21,1 -DA:22,2 -DA:23,1 -DA:24,2 -DA:25,1 -DA:26,2 -DA:27,1 -DA:28,2 -DA:29,0 -DA:31,0 -DA:32,1 -DA:33,2 -DA:34,1 -DA:35,2 -DA:36,1 -DA:37,2 -DA:39,1 -DA:40,2 -DA:41,0 -DA:42,0 -DA:43,1 -DA:44,2 -DA:45,1 -DA:46,2 -DA:47,1 -DA:48,2 -DA:53,0 -DA:60,0 -DA:61,0 -DA:69,0 -DA:74,1 -DA:78,2 -DA:81,1 -DA:82,1 -DA:85,0 -DA:86,0 -DA:89,1 -DA:90,1 -DA:93,0 -DA:94,0 -DA:97,1 -DA:98,1 -DA:101,0 -DA:102,0 -DA:105,1 -DA:106,1 -DA:109,0 -DA:110,0 -DA:113,1 -DA:114,1 -DA:117,0 -DA:121,1 -DA:122,1 -DA:125,0 -DA:126,0 -DA:129,1 -DA:130,1 -DA:133,0 -DA:134,0 -DA:137,1 -DA:138,1 -DA:141,0 -DA:142,0 -DA:148,1 -DA:150,1 -DA:154,2 -DA:155,2 -DA:157,1 -DA:160,1 -DA:170,2 -DA:184,1 -DA:189,2 -DA:195,1 -DA:203,2 -DA:214,1 -DA:220,2 -DA:229,1 -DA:235,2 -DA:245,1 -DA:250,2 -DA:256,1 -DA:263,2 -DA:273,1 -DA:280,2 -DA:290,0 -DA:299,0 -DA:311,0 -DA:323,0 -DA:338,1 -DA:344,2 -DA:353,1 -DA:360,2 -DA:370,1 -DA:376,2 -DA:385,1 -DA:391,2 -DA:400,1 -DA:407,2 -DA:417,1 -DA:422,2 -DA:428,1 -DA:434,2 -DA:443,1 -DA:448,2 -DA:454,1 -DA:457,2 -DA:463,1 -DA:468,2 -DA:476,1 -DA:479,2 -DA:485,1 -DA:488,2 -DA:494,0 -DA:495,0 -DA:499,0 -DA:500,0 -DA:502,0 -DA:505,0 -DA:511,0 -DA:514,0 -DA:520,0 -DA:522,0 -DA:524,0 -DA:525,0 -DA:527,0 -DA:528,0 -DA:531,0 -DA:533,0 -DA:535,0 -DA:537,0 -DA:539,0 -DA:546,0 -DA:557,0 -DA:566,0 -DA:576,0 -DA:584,0 -DA:595,0 -DA:601,0 -DA:610,0 -DA:616,0 -DA:625,0 -DA:626,0 -DA:628,0 -DA:629,0 -DA:631,0 -DA:637,0 -DA:646,0 -DA:652,0 -DA:661,0 -DA:666,0 -DA:674,0 -DA:675,0 -LF:158 -LH:91 -end_of_record -TN: -SF:lib/apis/sign_api/sign_engine.dart -FNF:0 -FNH:0 -DA:99,5 -DA:114,5 -DA:116,5 -DA:120,15 -DA:121,25 -DA:122,10 -DA:123,10 -DA:124,10 -DA:127,10 -DA:128,10 -DA:129,10 -DA:130,10 -DA:132,10 -DA:134,5 -DA:135,5 -DA:136,5 -DA:138,5 -DA:140,5 -DA:143,5 -DA:145,14 -DA:146,16 -DA:150,4 -DA:159,4 -DA:161,4 -DA:162,0 -DA:163,4 -DA:172,12 -DA:175,4 -DA:176,4 -DA:179,12 -DA:182,12 -DA:183,4 -DA:185,4 -DA:187,8 -DA:188,0 -DA:189,4 -DA:190,4 -DA:192,4 -DA:197,4 -DA:200,4 -DA:203,4 -DA:204,4 -DA:205,4 -DA:206,4 -DA:207,4 -DA:210,4 -DA:215,4 -DA:217,8 -DA:218,4 -DA:222,4 -DA:223,4 -DA:224,4 -DA:228,4 -DA:234,4 -DA:243,4 -DA:251,12 -DA:254,4 -DA:257,4 -DA:259,8 -DA:260,4 -DA:262,12 -DA:263,8 -DA:269,4 -DA:271,12 -DA:272,12 -DA:275,12 -DA:279,4 -DA:283,4 -DA:285,12 -DA:292,4 -DA:300,4 -DA:302,4 -DA:309,8 -DA:310,4 -DA:313,12 -DA:314,8 -DA:315,12 -DA:322,4 -DA:325,12 -DA:327,4 -DA:329,4 -DA:334,4 -DA:335,16 -DA:337,12 -DA:338,4 -DA:339,8 -DA:342,12 -DA:344,4 -DA:348,4 -DA:350,4 -DA:356,4 -DA:358,4 -DA:360,4 -DA:361,4 -DA:364,12 -DA:366,8 -DA:367,4 -DA:370,8 -DA:371,4 -DA:374,4 -DA:379,4 -DA:381,4 -DA:387,4 -DA:388,4 -DA:389,0 -DA:394,8 -DA:398,8 -DA:400,8 -DA:406,4 -DA:412,3 -DA:417,3 -DA:419,3 -DA:421,9 -DA:427,3 -DA:428,9 -DA:430,3 -DA:432,9 -DA:433,3 -DA:439,3 -DA:442,3 -DA:447,3 -DA:448,3 -DA:453,6 -DA:458,9 -DA:461,3 -DA:465,3 -DA:469,3 -DA:470,3 -DA:472,9 -DA:475,3 -DA:478,3 -DA:480,3 -DA:489,3 -DA:495,9 -DA:498,3 -DA:504,3 -DA:505,3 -DA:510,9 -DA:513,3 -DA:520,0 -DA:529,0 -DA:532,0 -DA:542,0 -DA:553,0 -DA:554,0 -DA:556,0 -DA:560,0 -DA:563,0 -DA:565,0 -DA:566,0 -DA:567,0 -DA:568,0 -DA:569,0 -DA:570,0 -DA:571,0 -DA:572,0 -DA:576,0 -DA:577,0 -DA:579,0 -DA:582,0 -DA:586,3 -DA:591,3 -DA:592,3 -DA:596,3 -DA:597,9 -DA:598,3 -DA:601,3 -DA:604,9 -DA:605,3 -DA:608,3 -DA:612,6 -DA:618,3 -DA:624,3 -DA:625,9 -DA:628,3 -DA:634,3 -DA:635,3 -DA:640,9 -DA:643,3 -DA:650,3 -DA:654,3 -DA:655,3 -DA:657,6 -DA:658,9 -DA:661,3 -DA:663,12 -DA:664,9 -DA:668,3 -DA:673,3 -DA:675,3 -DA:677,6 -DA:680,9 -DA:683,3 -DA:684,3 -DA:685,3 -DA:686,3 -DA:691,3 -DA:693,9 -DA:695,0 -DA:696,0 -DA:697,0 -DA:704,3 -DA:708,3 -DA:709,12 -DA:710,3 -DA:716,6 -DA:719,4 -DA:721,4 -DA:723,4 -DA:724,16 -DA:725,8 -DA:731,3 -DA:735,3 -DA:737,3 -DA:738,3 -DA:739,3 -DA:740,12 -DA:741,6 -DA:742,6 -DA:748,4 -DA:750,4 -DA:752,4 -DA:753,16 -DA:754,12 -DA:760,3 -DA:762,3 -DA:764,3 -DA:765,12 -DA:766,9 -DA:772,1 -DA:773,3 -DA:778,3 -DA:783,3 -DA:785,3 -DA:788,3 -DA:791,3 -DA:792,3 -DA:793,3 -DA:796,6 -DA:799,3 -DA:804,3 -DA:806,3 -DA:809,3 -DA:812,3 -DA:813,3 -DA:814,3 -DA:817,6 -DA:822,5 -DA:824,15 -DA:829,10 -DA:831,0 -DA:835,4 -DA:836,4 -DA:837,0 -DA:841,3 -DA:842,3 -DA:845,3 -DA:850,6 -DA:854,9 -DA:856,6 -DA:857,15 -DA:858,9 -DA:860,9 -DA:863,6 -DA:864,3 -DA:870,4 -DA:874,12 -DA:876,12 -DA:880,3 -DA:884,9 -DA:886,0 -DA:890,4 -DA:891,8 -DA:892,8 -DA:897,12 -DA:900,4 -DA:901,12 -DA:902,20 -DA:905,3 -DA:906,6 -DA:907,3 -DA:910,9 -DA:911,3 -DA:912,3 -DA:918,5 -DA:919,5 -DA:920,5 -DA:922,10 -DA:923,0 -DA:924,0 -DA:927,10 -DA:928,0 -DA:929,0 -DA:933,5 -DA:935,0 -DA:937,5 -DA:942,5 -DA:943,15 -DA:945,5 -DA:948,15 -DA:950,5 -DA:953,15 -DA:955,5 -DA:958,15 -DA:960,5 -DA:963,15 -DA:965,5 -DA:968,15 -DA:970,5 -DA:973,15 -DA:975,5 -DA:978,15 -DA:980,5 -DA:984,15 -DA:986,5 -DA:989,15 -DA:991,5 -DA:996,4 -DA:997,12 -DA:998,12 -DA:1000,8 -DA:1005,4 -DA:1009,4 -DA:1010,0 -DA:1016,12 -DA:1017,4 -DA:1019,8 -DA:1020,4 -DA:1021,4 -DA:1022,4 -DA:1023,4 -DA:1025,4 -DA:1030,16 -DA:1031,3 -DA:1032,3 -DA:1033,9 -DA:1034,3 -DA:1035,3 -DA:1036,3 -DA:1041,3 -DA:1042,3 -DA:1046,0 -DA:1048,0 -DA:1049,0 -DA:1051,0 -DA:1052,0 -DA:1053,0 -DA:1055,0 -DA:1056,0 -DA:1057,0 -DA:1061,0 -DA:1062,0 -DA:1063,0 -DA:1064,0 -DA:1073,4 -DA:1076,4 -DA:1077,4 -DA:1079,4 -DA:1080,4 -DA:1081,4 -DA:1082,4 -DA:1083,4 -DA:1088,8 -DA:1090,4 -DA:1092,8 -DA:1095,8 -DA:1096,4 -DA:1097,4 -DA:1102,0 -DA:1103,0 -DA:1104,0 -DA:1105,0 -DA:1106,0 -DA:1108,0 -DA:1109,0 -DA:1110,0 -DA:1115,4 -DA:1120,8 -DA:1122,12 -DA:1125,8 -DA:1129,4 -DA:1131,4 -DA:1132,4 -DA:1133,4 -DA:1135,8 -DA:1136,4 -DA:1137,4 -DA:1138,4 -DA:1139,4 -DA:1140,4 -DA:1142,4 -DA:1146,8 -DA:1147,8 -DA:1148,12 -DA:1149,4 -DA:1150,8 -DA:1152,12 -DA:1153,0 -DA:1154,0 -DA:1158,8 -DA:1162,12 -DA:1163,4 -DA:1168,8 -DA:1169,4 -DA:1171,0 -DA:1172,0 -DA:1173,0 -DA:1174,0 -DA:1176,0 -DA:1177,0 -DA:1178,0 -DA:1184,3 -DA:1190,6 -DA:1191,6 -DA:1192,6 -DA:1194,3 -DA:1196,9 -DA:1197,3 -DA:1202,6 -DA:1203,3 -DA:1204,3 -DA:1206,3 -DA:1209,0 -DA:1210,0 -DA:1211,0 -DA:1212,0 -DA:1214,0 -DA:1215,0 -DA:1216,0 -DA:1222,3 -DA:1227,6 -DA:1228,3 -DA:1229,3 -DA:1231,3 -DA:1235,9 -DA:1236,3 -DA:1241,6 -DA:1242,3 -DA:1243,3 -DA:1247,0 -DA:1248,0 -DA:1249,0 -DA:1251,0 -DA:1252,0 -DA:1253,0 -DA:1259,3 -DA:1264,6 -DA:1265,3 -DA:1266,9 -DA:1267,3 -DA:1272,6 -DA:1273,3 -DA:1274,3 -DA:1278,0 -DA:1279,0 -DA:1280,0 -DA:1282,0 -DA:1283,0 -DA:1284,0 -DA:1290,3 -DA:1295,6 -DA:1296,3 -DA:1297,9 -DA:1298,3 -DA:1303,3 -DA:1304,0 -DA:1305,0 -DA:1306,0 -DA:1308,0 -DA:1309,0 -DA:1310,0 -DA:1319,3 -DA:1321,6 -DA:1322,3 -DA:1324,3 -DA:1325,3 -DA:1328,6 -DA:1329,3 -DA:1331,6 -DA:1334,3 -DA:1335,3 -DA:1337,6 -DA:1338,3 -DA:1339,6 -DA:1344,3 -DA:1345,3 -DA:1349,3 -DA:1350,3 -DA:1351,6 -DA:1353,6 -DA:1357,9 -DA:1358,0 -DA:1359,0 -DA:1360,0 -DA:1362,0 -DA:1363,0 -DA:1364,0 -DA:1367,0 -DA:1368,0 -DA:1370,0 -DA:1372,0 -DA:1373,0 -DA:1375,0 -DA:1376,0 -DA:1377,0 -DA:1380,0 -DA:1384,6 -DA:1385,3 -DA:1390,0 -DA:1391,0 -DA:1392,0 -DA:1394,0 -DA:1395,0 -DA:1396,0 -DA:1402,3 -DA:1407,6 -DA:1408,3 -DA:1409,3 -DA:1412,3 -DA:1415,3 -DA:1416,3 -DA:1417,6 -DA:1419,6 -DA:1420,6 -DA:1422,0 -DA:1424,0 -DA:1426,0 -DA:1429,0 -DA:1430,0 -DA:1432,0 -DA:1433,0 -DA:1434,0 -DA:1440,9 -DA:1441,3 -DA:1447,6 -DA:1448,3 -DA:1449,3 -DA:1451,3 -DA:1452,3 -DA:1453,3 -DA:1457,9 -DA:1458,3 -DA:1460,3 -DA:1461,3 -DA:1462,3 -DA:1466,0 -DA:1467,0 -DA:1468,0 -DA:1470,0 -DA:1471,0 -DA:1472,0 -DA:1480,5 -DA:1481,25 -DA:1482,25 -DA:1483,25 -DA:1484,25 -DA:1485,25 -DA:1488,0 -DA:1490,0 -DA:1493,3 -DA:1500,3 -DA:1501,3 -DA:1502,15 -DA:1503,3 -DA:1505,6 -DA:1506,3 -DA:1507,3 -DA:1512,3 -DA:1513,3 -DA:1514,15 -DA:1515,3 -DA:1517,6 -DA:1518,3 -DA:1519,3 -DA:1524,3 -DA:1529,9 -DA:1530,3 -DA:1531,3 -DA:1534,6 -DA:1535,3 -DA:1536,3 -DA:1539,9 -DA:1540,9 -DA:1541,3 -DA:1542,6 -DA:1545,6 -DA:1546,3 -DA:1547,6 -DA:1551,0 -DA:1552,0 -DA:1553,0 -DA:1560,5 -DA:1561,5 -DA:1566,3 -DA:1567,6 -DA:1568,3 -DA:1570,3 -DA:1574,9 -DA:1575,3 -DA:1577,3 -DA:1584,3 -DA:1585,6 -DA:1586,3 -DA:1587,12 -DA:1588,9 -DA:1590,3 -DA:1592,3 -DA:1599,4 -DA:1600,12 -DA:1601,3 -DA:1603,3 -DA:1607,16 -DA:1608,3 -DA:1610,3 -DA:1617,3 -DA:1618,9 -DA:1619,0 -DA:1621,0 -DA:1625,12 -DA:1626,0 -DA:1628,0 -DA:1637,4 -DA:1647,12 -DA:1653,4 -DA:1660,4 -DA:1669,4 -DA:1676,4 -DA:1677,12 -DA:1680,4 -DA:1686,4 -DA:1687,4 -DA:1690,4 -DA:1691,4 -DA:1696,4 -DA:1697,4 -DA:1705,3 -DA:1707,3 -DA:1711,4 -DA:1715,4 -DA:1720,4 -DA:1721,0 -DA:1730,3 -DA:1734,3 -DA:1735,3 -DA:1739,6 -DA:1741,3 -DA:1742,6 -DA:1750,3 -DA:1755,3 -DA:1756,6 -DA:1757,3 -DA:1758,3 -DA:1761,3 -DA:1762,3 -DA:1764,3 -DA:1770,3 -DA:1774,3 -DA:1776,6 -DA:1777,0 -DA:1783,6 -DA:1788,3 -DA:1791,3 -DA:1796,3 -DA:1801,3 -DA:1802,6 -DA:1803,3 -DA:1804,3 -DA:1807,3 -DA:1808,3 -DA:1810,3 -DA:1816,3 -DA:1817,3 -DA:1822,4 -DA:1827,8 -DA:1828,16 -DA:1830,12 -DA:1831,0 -DA:1835,0 -DA:1836,0 -DA:1837,0 -DA:1838,0 -DA:1839,0 -DA:1842,4 -DA:1843,0 -DA:1845,4 -DA:1846,4 -DA:1847,4 -DA:1855,0 -DA:1860,0 -DA:1861,0 -DA:1863,0 -DA:1864,0 -DA:1865,0 -DA:1868,0 -DA:1869,0 -DA:1871,0 -DA:1883,0 -DA:1889,0 -DA:1890,0 -DA:1892,0 -DA:1893,0 -DA:1896,0 -DA:1897,0 -DA:1898,0 -DA:1899,0 -DA:1900,0 -DA:1901,0 -DA:1902,0 -DA:1903,0 -DA:1904,0 -DA:1906,0 -DA:1907,0 -DA:1908,0 -DA:1909,0 -DA:1910,0 -DA:1911,0 -DA:1912,0 -DA:1913,0 -DA:1914,0 -DA:1915,0 -DA:1918,0 -DA:1919,0 -DA:1925,0 -DA:1940,0 -DA:1946,0 -DA:1950,0 -DA:1951,0 -DA:1952,0 -DA:1953,0 -DA:1954,0 -DA:1956,0 -DA:1957,0 -DA:1963,0 -DA:1965,0 -DA:1966,0 -DA:1967,0 -DA:1973,0 -DA:1979,0 -DA:1981,0 -DA:1986,0 -DA:1989,0 -DA:1990,0 -DA:1994,0 -DA:1997,0 -DA:1999,0 -DA:2000,0 -DA:2002,0 -DA:2003,0 -DA:2006,0 -DA:2008,0 -DA:2012,0 -DA:2014,0 -DA:2016,0 -DA:2019,0 -DA:2025,0 -DA:2031,0 -DA:2033,0 -DA:2042,0 -DA:2051,0 -DA:2060,0 -DA:2064,0 -DA:2067,0 -DA:2071,0 -DA:2073,0 -DA:2076,0 -DA:2077,0 -DA:2078,0 -DA:2079,0 -DA:2080,0 -DA:2084,0 -DA:2085,0 -DA:2089,0 -DA:2091,0 -DA:2092,0 -DA:2093,0 -DA:2094,0 -DA:2101,0 -DA:2103,0 -DA:2107,0 -DA:2115,0 -DA:2116,0 -DA:2118,0 -DA:2123,0 -DA:2124,0 -DA:2129,0 -DA:2131,0 -DA:2132,0 -DA:2133,0 -DA:2138,0 -DA:2146,0 -DA:2148,0 -DA:2150,0 -DA:2151,0 -DA:2152,0 -DA:2158,0 -DA:2161,0 -DA:2162,0 -DA:2164,0 -DA:2167,0 -DA:2168,0 -DA:2170,0 -DA:2171,0 -DA:2173,0 -DA:2175,0 -DA:2178,0 -DA:2179,0 -DA:2180,0 -DA:2185,0 -DA:2191,0 -DA:2193,0 -DA:2197,0 -DA:2199,0 -DA:2200,0 -DA:2204,0 -DA:2205,0 -DA:2206,0 -DA:2207,0 -DA:2210,0 -DA:2211,0 -DA:2214,0 -DA:2216,0 -DA:2218,0 -DA:2222,0 -DA:2228,0 -DA:2233,0 -DA:2234,0 -DA:2235,0 -DA:2237,0 -DA:2239,0 -DA:2240,0 -DA:2241,0 -DA:2243,0 -DA:2247,0 -DA:2248,0 -DA:2249,0 -DA:2251,0 -DA:2255,0 -DA:2256,0 -DA:2257,0 -DA:2258,0 -DA:2259,0 -DA:2261,0 -DA:2263,0 -DA:2265,0 -DA:2266,0 -DA:2267,0 -DA:2268,0 -DA:2269,0 -DA:2270,0 -DA:2271,0 -DA:2279,0 -DA:2290,0 -DA:2293,0 -DA:2296,0 -DA:2304,0 -DA:2316,0 -DA:2319,0 -DA:2323,0 -DA:2325,0 -DA:2328,0 -DA:2329,0 -DA:2330,0 -DA:2331,0 -DA:2332,0 -DA:2336,0 -DA:2337,0 -DA:2341,0 -DA:2343,0 -DA:2344,0 -DA:2350,0 -DA:2351,0 -DA:2353,0 -DA:2356,0 -DA:2372,0 -DA:2373,0 -DA:2374,0 -DA:2376,0 -DA:2377,0 -DA:2380,0 -DA:2381,0 -DA:2382,0 -DA:2383,0 -DA:2386,0 -DA:2387,0 -DA:2388,0 -DA:2391,0 -DA:2392,0 -DA:2395,0 -DA:2396,0 -DA:2397,0 -DA:2400,0 -DA:2401,0 -DA:2405,0 -DA:2407,0 -DA:2411,0 -DA:2412,0 -DA:2415,0 -DA:2417,0 -DA:2421,0 -DA:2424,0 -DA:2426,0 -DA:2432,0 -DA:2433,0 -DA:2435,0 -DA:2437,0 -DA:2440,0 -DA:2443,0 -DA:2449,0 -DA:2450,0 -DA:2454,0 -DA:2461,0 -DA:2463,0 -DA:2464,0 -DA:2471,0 -DA:2472,0 -DA:2473,0 -DA:2474,0 -DA:2477,0 -DA:2484,0 -DA:2488,0 -DA:2492,0 -DA:2494,0 -DA:2496,0 -DA:2502,0 -DA:2506,0 -DA:2510,0 -DA:2512,0 -DA:2513,0 -DA:2514,0 -DA:2516,0 -DA:2523,0 -DA:2528,0 -DA:2530,0 -DA:2532,0 -DA:2538,0 -DA:2539,0 -DA:2540,0 -DA:2541,0 -DA:2543,0 -DA:2551,0 -DA:2552,0 -DA:2554,0 -DA:2557,0 -DA:2561,0 -DA:2565,0 -DA:2571,0 -DA:2572,0 -DA:2573,0 -DA:2575,0 -DA:2576,0 -DA:2579,0 -DA:2580,0 -DA:2581,0 -DA:2582,0 -DA:2585,0 -DA:2586,0 -DA:2587,0 -DA:2591,0 -DA:2597,0 -DA:2598,0 -DA:2601,0 -DA:2603,0 -DA:2605,0 -DA:2607,0 -DA:2610,0 -DA:2611,0 -DA:2612,0 -DA:2618,0 -DA:2619,0 -DA:2621,0 -DA:2624,0 -DA:2626,0 -DA:2628,0 -DA:2631,0 -DA:2635,0 -DA:2639,0 -DA:2640,0 -DA:2641,0 -DA:2642,0 -DA:2643,0 -DA:2646,0 -DA:2652,0 -DA:2657,0 -DA:2659,0 -DA:2661,0 -DA:2662,0 -DA:2665,0 -DA:2669,0 -DA:2670,0 -DA:2671,0 -DA:2672,0 -DA:2674,0 -DA:2681,0 -DA:2682,0 -DA:2686,0 -DA:2688,0 -DA:2691,0 -DA:2692,0 -DA:2696,0 -DA:2698,0 -DA:2701,0 -DA:2702,0 -DA:2705,0 -DA:2706,0 -DA:2707,0 -DA:2708,0 -DA:2710,0 -DA:2715,0 -DA:2716,0 -DA:2717,0 -DA:2719,0 -DA:2720,0 -DA:2723,0 -DA:2724,0 -DA:2725,0 -DA:2727,0 -DA:2728,0 -DA:2729,0 -DA:2735,0 -DA:2736,0 -DA:2738,0 -DA:2739,0 -DA:2742,0 -DA:2743,0 -DA:2746,0 -DA:2748,0 -DA:2749,0 -DA:2750,0 -DA:2751,0 -DA:2753,0 -DA:2755,0 -DA:2760,0 -DA:2761,0 -DA:2762,0 -DA:2764,0 -DA:2765,0 -DA:2769,0 -DA:2770,0 -DA:2771,0 -DA:2773,0 -DA:2778,0 -DA:2779,0 -DA:2780,0 -DA:2782,0 -DA:2783,0 -DA:2785,0 -LF:1046 -LH:543 -end_of_record -TN: -SF:lib/apis/sign_api/utils/auth/address_utils.dart -FNF:0 -FNH:0 -DA:2,3 -DA:3,6 -DA:6,3 -DA:7,6 -DA:10,0 -DA:11,0 -LF:6 -LH:4 -end_of_record -TN: -SF:lib/apis/sign_api/utils/auth/auth_api_validators.dart -FNF:0 -FNH:0 -DA:5,1 -DA:6,1 -DA:7,1 -DA:10,3 -DA:11,6 -DA:12,2 -DA:15,4 -DA:19,6 -DA:20,1 -DA:27,9 -DA:28,1 -DA:34,3 -DA:35,1 -DA:36,1 -DA:39,1 -DA:46,3 -DA:52,3 -DA:53,2 -DA:55,2 -DA:60,1 -DA:70,0 -DA:71,0 -DA:72,0 -DA:78,0 -DA:79,0 -DA:82,0 -DA:86,0 -DA:87,0 -DA:93,0 -DA:94,0 -DA:100,0 -DA:101,0 -DA:102,0 -DA:103,0 -DA:104,0 -DA:111,0 -DA:112,0 -DA:113,0 -DA:123,0 -DA:128,0 -DA:129,0 -DA:132,0 -DA:136,0 -DA:137,0 -LF:44 -LH:20 -end_of_record -TN: -SF:lib/apis/sign_api/utils/auth/auth_signature.dart -FNF:0 -FNH:0 -DA:16,9 -DA:17,3 -DA:18,6 -DA:19,6 -DA:22,3 -DA:23,3 -DA:24,3 -DA:25,3 -DA:26,3 -DA:28,6 -DA:30,3 -DA:36,3 -DA:37,6 -DA:40,6 -DA:43,0 -DA:46,3 -DA:53,3 -DA:54,6 -DA:58,6 -DA:59,0 -DA:63,3 -DA:64,6 -DA:67,3 -DA:68,6 -DA:72,6 -DA:92,3 -DA:93,3 -DA:94,3 -DA:97,3 -DA:98,3 -DA:99,6 -DA:112,9 -DA:115,0 -DA:128,0 -DA:130,0 -DA:132,0 -DA:133,0 -DA:134,0 -DA:135,0 -DA:138,0 -DA:139,0 -DA:141,0 -DA:143,0 -DA:149,0 -DA:157,0 -DA:158,0 -DA:166,3 -DA:173,6 -DA:174,3 -DA:177,3 -DA:179,0 -DA:180,0 -DA:183,0 -DA:188,0 -DA:189,0 -DA:194,0 -DA:199,0 -DA:200,0 -DA:202,0 -DA:204,0 -DA:212,0 -DA:217,0 -DA:219,0 -DA:221,0 -DA:225,0 -DA:226,0 -DA:227,0 -DA:230,0 -DA:231,0 -DA:235,0 -DA:237,0 -DA:241,0 -DA:243,0 -DA:244,0 -DA:246,0 -DA:247,0 -DA:248,0 -DA:249,0 -DA:250,0 -DA:254,0 -DA:257,0 -DA:259,0 -DA:265,0 -DA:266,0 -DA:267,0 -DA:270,0 -DA:271,0 -DA:273,0 -DA:276,0 -DA:280,1 -DA:282,1 -DA:283,1 -DA:284,2 -DA:285,1 -DA:292,1 -DA:295,2 -DA:296,1 -DA:297,2 -DA:298,3 -LF:99 -LH:44 -end_of_record -TN: -SF:lib/apis/sign_api/utils/auth/auth_utils.dart -FNF:0 -FNH:0 -DA:2,3 -DA:3,9 -LF:2 -LH:2 -end_of_record -TN: -SF:lib/apis/sign_api/utils/auth/recaps_utils.dart -FNF:0 -FNH:0 -DA:8,0 -DA:9,0 -DA:10,0 -DA:12,0 -DA:13,0 -DA:16,0 -DA:17,0 -DA:20,0 -DA:21,0 -DA:22,0 -DA:26,0 -DA:27,0 -DA:29,0 -DA:31,0 -DA:35,0 -DA:36,0 -DA:37,0 -DA:39,0 -DA:42,0 -DA:44,0 -DA:46,0 -DA:47,0 -DA:49,0 -DA:50,0 -DA:53,0 -DA:55,0 -DA:59,0 -DA:61,0 -DA:62,0 -DA:63,0 -DA:64,0 -DA:67,0 -DA:68,0 -DA:69,0 -DA:73,0 -DA:74,0 -DA:76,0 -DA:82,0 -DA:83,0 -DA:84,0 -DA:90,0 -DA:91,0 -DA:92,0 -DA:93,0 -DA:95,0 -DA:98,0 -DA:99,0 -DA:100,0 -DA:102,0 -DA:106,0 -DA:107,0 -DA:108,0 -DA:109,0 -DA:111,0 -DA:115,0 -DA:116,0 -DA:118,0 -DA:123,0 -DA:124,0 -DA:125,0 -DA:127,0 -DA:139,0 -DA:144,0 -DA:145,0 -DA:148,0 -DA:149,0 -DA:150,0 -DA:151,0 -DA:153,0 -DA:156,0 -DA:163,0 -DA:164,0 -DA:166,0 -DA:167,0 -DA:168,0 -DA:169,0 -DA:170,0 -DA:174,0 -DA:175,0 -DA:176,0 -DA:184,0 -DA:185,0 -DA:186,0 -DA:187,0 -DA:188,0 -DA:191,0 -DA:195,0 -DA:196,0 -DA:197,0 -DA:198,0 -DA:199,0 -DA:200,0 -DA:202,0 -DA:204,0 -DA:205,0 -DA:206,0 -DA:207,0 -DA:208,0 -DA:209,0 -DA:210,0 -DA:213,0 -DA:214,0 -DA:215,0 -DA:216,0 -DA:224,0 -DA:227,0 -DA:229,0 -DA:230,0 -DA:233,0 -DA:237,0 -DA:241,0 -DA:243,0 -DA:245,0 -DA:246,0 -DA:247,0 -DA:248,0 -DA:249,0 -DA:250,0 -DA:251,0 -DA:252,0 -DA:253,0 -DA:255,0 -DA:256,0 -DA:258,0 -DA:259,0 -DA:260,0 -DA:261,0 -DA:262,0 -DA:263,0 -DA:265,0 -DA:268,0 -DA:269,0 -DA:270,0 -DA:271,0 -DA:272,0 -DA:274,0 -DA:275,0 -DA:279,0 -DA:280,0 -DA:282,0 -DA:285,0 -DA:290,0 -DA:291,0 -DA:293,0 -DA:296,0 -DA:298,0 -DA:301,0 -DA:303,0 -DA:305,0 -DA:307,0 -DA:310,0 -DA:315,0 -DA:316,0 -DA:318,0 -DA:319,0 -DA:320,0 -DA:321,0 -DA:322,0 -DA:326,0 -DA:329,0 -DA:335,0 -DA:336,0 -DA:337,0 -DA:338,0 -DA:342,0 -DA:343,0 -DA:344,0 -DA:345,0 -DA:346,0 -LF:169 -LH:0 -end_of_record -TN: -SF:lib/apis/sign_api/utils/custom_credentials.dart -FNF:0 -FNH:0 -DA:8,0 -DA:26,0 -DA:27,0 -DA:29,0 -DA:31,0 -DA:32,0 -DA:33,0 -DA:35,0 -DA:38,0 -DA:39,0 -DA:40,0 -DA:41,0 -DA:42,0 -DA:46,0 -DA:47,0 -DA:48,0 -DA:54,0 -DA:55,0 -DA:57,0 -DA:63,0 -DA:68,0 -DA:71,0 -DA:78,0 -LF:23 -LH:0 -end_of_record -TN: -SF:lib/apis/sign_api/utils/sign_api_validator_utils.dart -FNF:0 -FNH:0 -DA:7,6 -DA:12,6 -DA:13,12 -DA:15,6 -DA:16,18 -DA:22,5 -DA:28,5 -DA:30,4 -DA:31,4 -DA:33,4 -DA:37,10 -DA:38,5 -DA:39,1 -DA:42,1 -DA:52,5 -DA:56,10 -DA:57,5 -DA:59,5 -DA:60,5 -DA:69,5 -DA:73,10 -DA:74,5 -DA:75,4 -DA:78,4 -DA:87,5 -DA:91,10 -DA:92,5 -DA:93,5 -DA:94,5 -DA:103,4 -DA:108,4 -DA:109,1 -DA:111,1 -DA:116,4 -DA:122,4 -DA:126,4 -DA:127,4 -DA:129,4 -DA:138,4 -DA:144,4 -DA:145,1 -DA:147,1 -DA:152,4 -DA:157,4 -DA:162,4 -DA:163,4 -DA:165,4 -DA:174,4 -DA:180,4 -DA:181,1 -DA:183,1 -DA:188,4 -DA:193,4 -DA:198,4 -DA:199,4 -DA:201,4 -DA:210,6 -DA:215,12 -DA:216,12 -DA:219,6 -DA:221,4 -DA:223,4 -DA:226,12 -DA:228,6 -DA:230,6 -DA:232,6 -DA:234,6 -DA:239,6 -DA:243,6 -DA:244,12 -DA:245,12 -DA:247,6 -DA:248,12 -DA:249,12 -DA:253,5 -DA:256,5 -DA:259,2 -DA:262,10 -DA:265,2 -DA:268,10 -DA:277,4 -DA:281,12 -DA:282,8 -DA:285,4 -DA:289,8 -DA:290,8 -DA:291,4 -DA:293,4 -DA:297,4 -DA:304,4 -DA:308,4 -DA:309,4 -DA:310,8 -DA:312,4 -DA:313,4 -DA:314,8 -LF:96 -LH:96 -end_of_record -TN: -SF:lib/apis/utils/errors.dart -FNF:0 -FNH:0 -DA:230,7 -DA:234,7 -DA:235,7 -DA:236,14 -DA:237,7 -DA:238,12 -DA:239,8 -DA:246,6 -DA:250,6 -DA:251,6 -DA:252,12 -DA:253,6 -DA:254,12 -DA:255,14 -LF:14 -LH:14 -end_of_record -TN: -SF:lib/apis/utils/extensions.dart -FNF:0 -FNH:0 -DA:8,0 -DA:9,0 -DA:10,0 -DA:11,0 -DA:12,0 -DA:13,0 -DA:14,0 -DA:15,0 -DA:16,0 -DA:17,0 -DA:18,0 -DA:19,0 -DA:20,0 -DA:21,0 -DA:22,0 -DA:28,0 -DA:29,0 -DA:30,0 -DA:31,0 -DA:32,0 -DA:33,0 -DA:34,0 -DA:36,0 -DA:37,0 -DA:38,0 -DA:39,0 -DA:44,0 -DA:45,0 -DA:46,0 -DA:47,0 -DA:49,0 -DA:55,0 -DA:57,0 -DA:58,0 -DA:60,0 -DA:66,0 -DA:68,0 -DA:69,0 -DA:74,0 -DA:76,0 -LF:40 -LH:0 -end_of_record -TN: -SF:lib/apis/utils/log_level.dart -FNF:0 -FNH:0 -DA:12,10 -DA:14,10 -DA:16,10 -DA:18,10 -DA:20,6 -DA:22,6 -DA:24,6 -LF:7 -LH:7 -end_of_record -TN: -SF:lib/apis/utils/namespace_utils.dart -FNF:0 -FNH:0 -DA:7,6 -DA:8,6 -DA:9,6 -DA:10,12 -DA:16,6 -DA:17,6 -DA:18,6 -DA:19,12 -DA:20,18 -DA:21,18 -DA:27,4 -DA:29,4 -DA:36,1 -DA:37,1 -DA:38,2 -DA:43,6 -DA:44,6 -DA:45,6 -DA:46,6 -DA:47,6 -DA:48,6 -DA:55,6 -DA:57,12 -DA:58,6 -DA:59,6 -DA:65,6 -DA:70,1 -DA:71,1 -DA:72,2 -DA:79,0 -DA:82,0 -DA:83,0 -DA:84,0 -DA:85,0 -DA:86,0 -DA:87,0 -DA:88,0 -DA:89,0 -DA:90,0 -DA:93,0 -DA:94,0 -DA:95,0 -DA:96,0 -DA:98,0 -DA:99,0 -DA:100,0 -DA:111,6 -DA:115,6 -DA:116,6 -DA:119,12 -DA:123,5 -DA:128,10 -DA:129,5 -DA:130,5 -DA:137,5 -DA:141,5 -DA:145,5 -DA:146,10 -DA:147,5 -DA:148,2 -DA:150,10 -DA:151,5 -DA:152,10 -DA:161,0 -DA:165,0 -DA:166,0 -DA:167,0 -DA:168,0 -DA:170,0 -DA:171,0 -DA:180,5 -DA:184,5 -DA:185,10 -DA:186,5 -DA:187,2 -DA:189,10 -DA:190,5 -DA:191,10 -DA:201,6 -DA:205,6 -DA:206,6 -DA:207,6 -DA:208,6 -DA:211,12 -DA:219,1 -DA:225,2 -DA:226,1 -DA:227,1 -DA:234,1 -DA:239,4 -DA:246,4 -DA:252,4 -DA:256,1 -DA:260,8 -DA:261,9 -DA:262,1 -DA:263,1 -DA:264,2 -DA:265,1 -DA:266,1 -DA:267,1 -DA:268,4 -DA:269,1 -DA:270,1 -DA:271,1 -DA:272,1 -DA:273,4 -DA:274,1 -DA:275,1 -DA:276,1 -DA:277,1 -DA:278,4 -DA:279,1 -DA:281,1 -DA:285,4 -DA:287,4 -DA:291,0 -DA:295,0 -DA:296,0 -DA:299,0 -DA:301,0 -DA:302,0 -DA:303,0 -DA:304,0 -DA:305,0 -DA:311,0 -DA:316,4 -DA:325,8 -DA:326,8 -DA:327,12 -DA:332,4 -DA:338,4 -DA:344,4 -DA:347,8 -DA:349,4 -DA:350,4 -DA:351,4 -DA:352,4 -DA:353,8 -DA:354,8 -DA:356,4 -DA:357,4 -DA:364,4 -DA:365,4 -DA:368,8 -DA:372,4 -DA:373,4 -DA:376,8 -DA:381,8 -DA:383,4 -DA:384,4 -DA:387,12 -DA:390,4 -DA:391,4 -DA:394,8 -DA:398,4 -DA:399,4 -DA:402,8 -DA:409,8 -DA:410,8 -DA:411,8 -DA:412,8 -DA:431,0 -DA:434,0 -DA:435,0 -DA:436,0 -DA:437,0 -DA:439,0 -LF:168 -LH:128 -end_of_record -TN: -SF:lib/apis/utils/walletconnect_utils.dart -FNF:0 -FNH:0 -DA:9,7 -DA:10,21 -DA:11,7 -DA:12,7 -DA:14,7 -DA:18,0 -DA:19,0 -DA:20,0 -DA:23,7 -DA:24,7 -DA:27,7 -DA:28,35 -DA:31,9 -DA:36,27 -DA:37,9 -DA:41,9 -DA:42,9 -DA:43,9 -DA:46,9 -DA:50,9 -DA:52,9 -DA:54,9 -DA:56,9 -DA:58,0 -DA:66,9 -DA:71,9 -DA:72,9 -DA:73,9 -DA:74,18 -DA:75,18 -DA:78,9 -DA:81,9 -DA:90,9 -DA:91,18 -DA:92,9 -DA:95,9 -DA:101,9 -DA:102,9 -DA:106,9 -DA:107,9 -DA:108,9 -DA:109,0 -DA:110,9 -DA:111,0 -DA:113,9 -DA:117,9 -DA:118,18 -DA:123,8 -DA:124,8 -DA:125,8 -DA:126,8 -DA:127,16 -DA:133,16 -DA:135,16 -DA:136,8 -DA:137,30 -DA:138,7 -DA:141,8 -DA:142,8 -DA:145,8 -DA:153,8 -DA:154,5 -DA:155,10 -DA:156,10 -DA:161,8 -DA:162,16 -DA:163,8 -DA:164,16 -DA:165,16 -DA:166,0 -DA:173,8 -DA:176,8 -DA:183,7 -DA:187,7 -DA:188,28 -DA:189,7 -DA:190,0 -DA:195,7 -DA:204,7 -DA:205,7 -DA:207,18 -DA:208,6 -DA:209,30 -DA:213,14 -DA:216,7 -DA:218,7 -DA:223,0 -DA:224,0 -DA:225,0 -DA:226,0 -LF:90 -LH:78 -end_of_record -TN: -SF:lib/apis/web3app/web3app.dart -FNF:0 -FNH:0 -DA:22,2 -DA:30,2 -DA:31,2 -DA:40,2 -DA:57,2 -DA:61,4 -DA:62,2 -DA:63,2 -DA:64,2 -DA:65,4 -DA:68,0 -DA:69,0 -DA:72,2 -DA:73,4 -DA:76,0 -DA:77,0 -DA:80,2 -DA:81,4 -DA:84,0 -DA:85,0 -DA:88,2 -DA:89,4 -DA:92,0 -DA:93,0 -DA:96,2 -DA:97,4 -DA:100,0 -DA:104,2 -DA:105,4 -DA:108,0 -DA:109,0 -DA:112,2 -DA:113,4 -DA:116,0 -DA:117,0 -DA:120,2 -DA:121,4 -DA:124,0 -DA:125,0 -DA:130,4 -DA:131,2 -DA:132,2 -DA:133,4 -DA:134,4 -DA:135,4 -DA:136,4 -DA:140,2 -DA:142,2 -DA:146,4 -DA:147,4 -DA:148,4 -DA:150,2 -DA:155,2 -DA:156,4 -DA:157,1 -DA:158,2 -DA:159,1 -DA:160,2 -DA:161,0 -DA:163,0 -DA:164,1 -DA:165,2 -DA:166,1 -DA:167,2 -DA:168,1 -DA:169,2 -DA:170,1 -DA:171,2 -DA:173,1 -DA:174,2 -DA:175,1 -DA:176,2 -DA:177,0 -DA:179,0 -DA:184,2 -DA:194,4 -DA:208,1 -DA:215,2 -DA:225,0 -DA:234,0 -DA:246,0 -DA:258,0 -DA:273,1 -DA:280,2 -DA:290,1 -DA:295,2 -DA:301,1 -DA:307,2 -DA:316,2 -DA:319,4 -DA:325,1 -DA:330,2 -DA:338,1 -DA:341,2 -DA:347,2 -DA:348,6 -DA:352,0 -DA:353,0 -DA:355,0 -DA:356,0 -DA:357,0 -DA:358,0 -DA:359,0 -DA:361,0 -DA:370,1 -DA:377,2 -DA:387,0 -DA:392,0 -DA:402,0 -DA:404,0 -DA:406,0 -DA:415,0 -DA:425,0 -DA:431,0 -DA:440,0 -DA:446,0 -LF:116 -LH:75 -end_of_record -TN: -SF:lib/apis/web3wallet/web3wallet.dart -FNF:0 -FNH:0 -DA:13,3 -DA:22,3 -DA:23,3 -DA:33,3 -DA:50,3 -DA:54,6 -DA:55,3 -DA:56,3 -DA:57,3 -DA:58,6 -DA:61,0 -DA:62,0 -DA:65,3 -DA:66,6 -DA:69,0 -DA:70,0 -DA:73,3 -DA:74,6 -DA:77,0 -DA:78,0 -DA:81,3 -DA:82,6 -DA:85,0 -DA:86,0 -DA:89,3 -DA:90,6 -DA:93,0 -DA:97,3 -DA:98,6 -DA:101,0 -DA:102,0 -DA:105,3 -DA:106,6 -DA:109,0 -DA:110,0 -DA:113,3 -DA:114,6 -DA:117,0 -DA:118,0 -DA:123,6 -DA:124,3 -DA:125,3 -DA:126,6 -DA:127,6 -DA:128,6 -DA:129,6 -DA:133,3 -DA:135,3 -DA:139,6 -DA:140,6 -DA:141,6 -DA:143,3 -DA:146,2 -DA:151,4 -DA:159,1 -DA:160,2 -DA:161,1 -DA:162,2 -DA:163,1 -DA:164,2 -DA:165,2 -DA:167,4 -DA:168,0 -DA:170,0 -DA:171,1 -DA:173,2 -DA:174,1 -DA:176,2 -DA:177,1 -DA:178,2 -DA:180,1 -DA:181,2 -DA:182,1 -DA:183,2 -DA:184,1 -DA:186,2 -DA:191,2 -DA:199,4 -DA:210,1 -DA:216,2 -DA:225,1 -DA:231,2 -DA:241,1 -DA:246,2 -DA:252,1 -DA:259,2 -DA:269,1 -DA:275,2 -DA:284,1 -DA:290,2 -DA:299,1 -DA:305,2 -DA:314,1 -DA:321,2 -DA:331,1 -DA:337,2 -DA:346,1 -DA:351,2 -DA:357,2 -DA:360,4 -DA:366,1 -DA:371,2 -DA:379,2 -DA:382,4 -DA:388,1 -DA:391,2 -DA:397,2 -DA:398,6 -DA:402,2 -DA:403,4 -DA:405,0 -DA:406,0 -DA:407,0 -DA:408,0 -DA:409,0 -DA:410,0 -DA:411,0 -DA:413,0 -DA:422,2 -DA:430,4 -DA:441,2 -DA:444,4 -DA:450,1 -DA:455,2 -DA:465,0 -DA:467,0 -DA:468,0 -DA:470,0 -DA:472,0 -DA:478,0 -DA:487,0 -DA:493,0 -DA:502,0 -DA:505,0 -DA:511,0 -DA:517,0 -DA:526,0 -DA:532,0 -LF:138 -LH:99 -end_of_record