diff --git a/packages/reown_appkit/CHANGELOG.md b/packages/reown_appkit/CHANGELOG.md
index 2b6d35a4..00743554 100644
--- a/packages/reown_appkit/CHANGELOG.md
+++ b/packages/reown_appkit/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 1.1.0-beta01
+
+- Social Logins
+
## 1.0.1
- Updated Coinbase Wallet SDK to support Android Gradle Plugin 8
diff --git a/packages/reown_appkit/analysis_options.yaml b/packages/reown_appkit/analysis_options.yaml
index b677fc6a..3e16fe1d 100644
--- a/packages/reown_appkit/analysis_options.yaml
+++ b/packages/reown_appkit/analysis_options.yaml
@@ -29,6 +29,7 @@ linter:
sort_pub_dependencies: true
avoid_unnecessary_containers: true
cancel_subscriptions: true
+ public_member_api_docs: false
analyzer:
exclude:
diff --git a/packages/reown_appkit/dart_dependency_validator.yaml b/packages/reown_appkit/dart_dependency_validator.yaml
new file mode 100644
index 00000000..46c10a3d
--- /dev/null
+++ b/packages/reown_appkit/dart_dependency_validator.yaml
@@ -0,0 +1,10 @@
+# dart_dependency_validator.yaml
+
+# Set true if you allow pinned packages in your project.
+# allow_pins: true
+# Exclude one or more paths from being scanned. Supports glob syntax.
+exclude:
+ - 'example/**' # Glob's are supported
+# Ignore one or more packages.
+# ignore:
+# - analyzer
\ No newline at end of file
diff --git a/packages/reown_appkit/example/base/android/app/src/main/AndroidManifest.xml b/packages/reown_appkit/example/base/android/app/src/main/AndroidManifest.xml
index fe850f89..a464976e 100644
--- a/packages/reown_appkit/example/base/android/app/src/main/AndroidManifest.xml
+++ b/packages/reown_appkit/example/base/android/app/src/main/AndroidManifest.xml
@@ -52,8 +52,8 @@
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/packages/reown_appkit/example/base/lib/main.dart b/packages/reown_appkit/example/base/lib/main.dart
index c22e52a5..1a4c7f2f 100644
--- a/packages/reown_appkit/example/base/lib/main.dart
+++ b/packages/reown_appkit/example/base/lib/main.dart
@@ -124,11 +124,40 @@ class _MyHomePageState extends State {
_appKit!.onSessionConnect.subscribe(_onSessionConnect);
_appKit!.onSessionAuthResponse.subscribe(_onSessionAuthResponse);
+ // See https://docs.reown.com/appkit/flutter/core/custom-chains
+ final testNetworks = ReownAppKitModalNetworks.test['eip155'] ?? [];
+ ReownAppKitModalNetworks.addNetworks('eip155', testNetworks);
+
_appKitModal = ReownAppKitModal(
context: context,
appKit: _appKit,
siweConfig: _siweConfig(),
- enableEmail: true,
+ enableAnalytics: true,
+ featuresConfig: FeaturesConfig(
+ email: true,
+ socials: [
+ AppKitSocialOption.Farcaster,
+ AppKitSocialOption.X,
+ AppKitSocialOption.Apple,
+ AppKitSocialOption.Discord,
+ ],
+ showMainWallets: false,
+ ),
+ // requiredNamespaces: {},
+ // optionalNamespaces: {},
+ // includedWalletIds: {},
+ featuredWalletIds: {
+ 'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa', // Coinbase
+ '18450873727504ae9315a084fa7624b5297d2fe5880f0982979c17345a138277', // Kraken Wallet
+ 'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96', // Metamask
+ '1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369', // Rainbow
+ 'c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a', // Uniswap
+ '38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662', // Bitget
+ },
+ // excludedWalletIds: {
+ // 'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa', // Coinbase
+ // },
+ // MORE WALLETS https://explorer.walletconnect.com/?type=wallet&chains=eip155%3A1
);
_appKitModal!.onModalConnect.subscribe(_onModalConnect);
@@ -162,12 +191,12 @@ class _MyHomePageState extends State {
icon: Icons.home,
),
PageData(
- page: PairingsPage(appKit: _appKit!),
+ page: PairingsPage(appKitModal: _appKitModal!),
title: StringConstants.pairingsPageTitle,
icon: Icons.vertical_align_center_rounded,
),
PageData(
- page: SessionsPage(appKit: _appKit!),
+ page: SessionsPage(appKitModal: _appKitModal!),
title: StringConstants.sessionsPageTitle,
icon: Icons.workspaces_filled,
),
@@ -249,8 +278,9 @@ class _MyHomePageState extends State {
super.dispose();
}
- void _logListener(LogEvent event) {
- if (event.level == Level.debug) {
+ void _logListener(event) {
+ if ('${event.level}' == 'Level.debug' ||
+ '${event.level}' == 'Level.error') {
// TODO send to mixpanel
log('${event.message}');
} else {
@@ -462,11 +492,12 @@ class _MyHomePageState extends State {
);
void _onModalConnect(ModalConnect? event) async {
- setState(() {});
debugPrint('[ExampleApp] _onModalConnect ${event?.session.toJson()}');
+ setState(() {});
}
void _onModalUpdate(ModalConnect? event) {
+ debugPrint('[ExampleApp] _onModalUpdate ${event?.session.toJson()}');
setState(() {});
}
diff --git a/packages/reown_appkit/example/base/lib/pages/connect_page.dart b/packages/reown_appkit/example/base/lib/pages/connect_page.dart
index c7dff84c..70903424 100644
--- a/packages/reown_appkit/example/base/lib/pages/connect_page.dart
+++ b/packages/reown_appkit/example/base/lib/pages/connect_page.dart
@@ -16,6 +16,7 @@ import 'package:reown_appkit_dapp/utils/crypto/solana.dart';
import 'package:reown_appkit_dapp/utils/sample_wallets.dart';
import 'package:reown_appkit_dapp/utils/string_constants.dart';
import 'package:reown_appkit_dapp/widgets/chain_button.dart';
+import 'package:reown_appkit_dapp/widgets/method_dialog.dart';
class ConnectPage extends StatefulWidget {
const ConnectPage({
@@ -36,6 +37,12 @@ class ConnectPageState extends State {
@override
void initState() {
super.initState();
+ widget.appKitModal.onModalConnect.subscribe(_onModalConnect);
+ widget.appKitModal.onModalUpdate.subscribe(_onModalUpdate);
+ widget.appKitModal.onModalNetworkChange.subscribe(_onModalNetworkChange);
+ widget.appKitModal.onModalDisconnect.subscribe(_onModalDisconnect);
+ widget.appKitModal.onModalError.subscribe(_onModalError);
+ //
widget.appKitModal.appKit!.onSessionConnect.subscribe(
_onSessionConnect,
);
@@ -49,6 +56,11 @@ class ConnectPageState extends State {
@override
void dispose() {
+ widget.appKitModal.onModalConnect.unsubscribe(_onModalConnect);
+ widget.appKitModal.onModalUpdate.unsubscribe(_onModalUpdate);
+ widget.appKitModal.onModalNetworkChange.unsubscribe(_onModalNetworkChange);
+ widget.appKitModal.onModalDisconnect.unsubscribe(_onModalDisconnect);
+ widget.appKitModal.onModalError.unsubscribe(_onModalError);
widget.appKitModal.onModalDisconnect.unsubscribe(
_onModalDisconnect,
);
@@ -192,8 +204,14 @@ class ConnectPageState extends State {
const SizedBox(height: StyleConstants.linear8),
Visibility(
visible: widget.appKitModal.isConnected,
- child: AppKitModalAccountButton(
- appKit: widget.appKitModal,
+ child: Column(
+ children: [
+ AppKitModalAccountButton(
+ appKit: widget.appKitModal,
+ ),
+ const SizedBox.square(dimension: 8.0),
+ ...(_buildRequestButtons()),
+ ],
),
),
const SizedBox(height: StyleConstants.linear8),
@@ -408,6 +426,38 @@ class ConnectPageState extends State {
);
}
+ List _buildRequestButtons() {
+ return widget.appKitModal.getApprovedMethods()?.map((method) {
+ final topic = widget.appKitModal.session!.topic ?? '';
+ final chainId = widget.appKitModal.selectedChain!.chainId;
+ final address = widget.appKitModal.session!.address!;
+ final requestParams = EIP155.getParams(method, address);
+ final enabled = requestParams != null;
+ return Container(
+ height: 40.0,
+ width: double.infinity,
+ margin: const EdgeInsets.symmetric(
+ vertical: StyleConstants.linear8,
+ ),
+ child: ElevatedButton(
+ onPressed: enabled
+ ? () {
+ widget.appKitModal.launchConnectedWallet();
+ final future = widget.appKitModal.request(
+ topic: topic,
+ chainId: chainId,
+ request: requestParams,
+ );
+ MethodDialog.show(context, method, future);
+ }
+ : null,
+ child: Text(method),
+ ),
+ );
+ }).toList() ??
+ [];
+ }
+
Future _onConnect({
required String nativeLink,
VoidCallback? closeModal,
@@ -559,10 +609,26 @@ class ConnectPageState extends State {
}
}
+ void _onModalConnect(ModalConnect? event) async {
+ setState(() {});
+ }
+
+ void _onModalUpdate(ModalConnect? event) {
+ setState(() {});
+ }
+
+ void _onModalNetworkChange(ModalNetworkChange? event) {
+ setState(() {});
+ }
+
void _onModalDisconnect(ModalDisconnect? event) {
setState(() {});
}
+ void _onModalError(ModalError? event) {
+ setState(() {});
+ }
+
ButtonStyle get _buttonStyle => ButtonStyle(
backgroundColor: MaterialStateProperty.resolveWith(
(states) {
diff --git a/packages/reown_appkit/example/base/lib/pages/pairings_page.dart b/packages/reown_appkit/example/base/lib/pages/pairings_page.dart
index a3db3e02..46f05178 100644
--- a/packages/reown_appkit/example/base/lib/pages/pairings_page.dart
+++ b/packages/reown_appkit/example/base/lib/pages/pairings_page.dart
@@ -8,10 +8,10 @@ import 'package:reown_appkit_dapp/widgets/pairing_item.dart';
class PairingsPage extends StatefulWidget {
const PairingsPage({
super.key,
- required this.appKit,
+ required this.appKitModal,
});
- final ReownAppKit appKit;
+ final ReownAppKitModal appKitModal;
@override
PairingsPageState createState() => PairingsPageState();
@@ -19,26 +19,31 @@ class PairingsPage extends StatefulWidget {
class PairingsPageState extends State {
List _pairings = [];
+ late IReownAppKit _appKit;
@override
void initState() {
- _pairings = widget.appKit.pairings.getAll();
- // widget.appKit.onSessionDelete.subscribe(_onSessionDelete);
- widget.appKit.core.pairing.onPairingDelete.subscribe(_onPairingDelete);
- widget.appKit.core.pairing.onPairingExpire.subscribe(_onPairingDelete);
+ _appKit = widget.appKitModal.appKit!;
+ _pairings = _appKit.pairings.getAll();
+ _appKit.core.pairing.onPairingDelete.subscribe(_onPairingDelete);
+ _appKit.core.pairing.onPairingExpire.subscribe(_onPairingDelete);
super.initState();
}
@override
void dispose() {
- // widget.appKit.onSessionDelete.unsubscribe(_onSessionDelete);
- widget.appKit.core.pairing.onPairingDelete.unsubscribe(_onPairingDelete);
- widget.appKit.core.pairing.onPairingExpire.unsubscribe(_onPairingDelete);
+ _appKit.core.pairing.onPairingDelete.unsubscribe(_onPairingDelete);
+ _appKit.core.pairing.onPairingExpire.unsubscribe(_onPairingDelete);
super.dispose();
}
@override
Widget build(BuildContext context) {
+ if (_pairings.isEmpty) {
+ return Center(
+ child: Text('No relay pairings'),
+ );
+ }
final List pairingItems = _pairings
.map(
(PairingInfo pairing) => PairingItem(
@@ -71,7 +76,7 @@ class PairingsPageState extends State {
),
onPressed: () async {
try {
- widget.appKit.core.pairing.disconnect(
+ _appKit.core.pairing.disconnect(
topic: pairing.topic,
);
Navigator.of(context).pop();
@@ -104,7 +109,7 @@ class PairingsPageState extends State {
void _onPairingDelete(PairingEvent? event) {
setState(() {
- _pairings = widget.appKit.pairings.getAll();
+ _pairings = _appKit.pairings.getAll();
});
}
}
diff --git a/packages/reown_appkit/example/base/lib/pages/sessions_page.dart b/packages/reown_appkit/example/base/lib/pages/sessions_page.dart
index 3b23b9d7..412e318e 100644
--- a/packages/reown_appkit/example/base/lib/pages/sessions_page.dart
+++ b/packages/reown_appkit/example/base/lib/pages/sessions_page.dart
@@ -9,37 +9,44 @@ import 'package:reown_appkit_dapp/widgets/session_widget.dart';
class SessionsPage extends StatefulWidget {
const SessionsPage({
super.key,
- required this.appKit,
+ required this.appKitModal,
});
- final ReownAppKit appKit;
+ final ReownAppKitModal appKitModal;
@override
SessionsPageState createState() => SessionsPageState();
}
class SessionsPageState extends State {
+ late IReownAppKit _appKit;
Map _activeSessions = {};
- String _selectedSession = '';
+ String _selectedTopic = '';
@override
void initState() {
- _activeSessions = widget.appKit.getActiveSessions();
- widget.appKit.onSessionDelete.subscribe(_onSessionDelete);
- widget.appKit.onSessionExpire.subscribe(_onSessionExpire);
+ _appKit = widget.appKitModal.appKit!;
+ _activeSessions = _appKit.getActiveSessions();
+ _appKit.onSessionDelete.subscribe(_onSessionDelete);
+ _appKit.onSessionExpire.subscribe(_onSessionExpire);
super.initState();
}
@override
void dispose() {
- widget.appKit.onSessionDelete.unsubscribe(_onSessionDelete);
- widget.appKit.onSessionExpire.unsubscribe(_onSessionExpire);
+ _appKit.onSessionDelete.unsubscribe(_onSessionDelete);
+ _appKit.onSessionExpire.unsubscribe(_onSessionExpire);
super.dispose();
}
@override
Widget build(BuildContext context) {
final List sessions = _activeSessions.values.toList();
+ if (sessions.isEmpty) {
+ return Center(
+ child: Text('No relay sessions'),
+ );
+ }
return Center(
child: Container(
constraints: const BoxConstraints(
@@ -53,14 +60,14 @@ class SessionsPageState extends State {
materialGapSize: 0.0,
expansionCallback: (int index, bool isExpanded) {
setState(() {
- _selectedSession = !isExpanded ? '' : sessions[index].topic;
+ _selectedTopic = !isExpanded ? '' : sessions[index].topic;
});
},
children: sessions
.map(
(session) => ExpansionPanel(
canTapOnHeader: true,
- isExpanded: _selectedSession == session.topic,
+ isExpanded: _selectedTopic == session.topic,
backgroundColor: Colors.blue.withOpacity(0.2),
headerBuilder: (context, isExpanded) {
return SessionItem(
@@ -84,7 +91,7 @@ class SessionsPageState extends State {
}
Widget _buildSessionView() {
- if (_selectedSession == '') {
+ if (_selectedTopic == '') {
return const Center(
child: Text(
StringConstants.noSessionSelected,
@@ -93,29 +100,27 @@ class SessionsPageState extends State {
);
}
- final SessionData session = _activeSessions[_selectedSession]!;
-
return SessionWidget(
- appKit: widget.appKit,
- session: session,
+ appKitModal: widget.appKitModal,
+ sessionTopic: _selectedTopic,
);
}
void _onSessionDelete(SessionDelete? event) {
setState(() {
- if (event!.topic == _selectedSession) {
- _selectedSession = '';
+ if (event!.topic == _selectedTopic) {
+ _selectedTopic = '';
}
- _activeSessions = widget.appKit.getActiveSessions();
+ _activeSessions = _appKit.getActiveSessions();
});
}
void _onSessionExpire(SessionExpire? event) {
setState(() {
- if (event!.topic == _selectedSession) {
- _selectedSession = '';
+ if (event!.topic == _selectedTopic) {
+ _selectedTopic = '';
}
- _activeSessions = widget.appKit.getActiveSessions();
+ _activeSessions = _appKit.getActiveSessions();
});
}
}
diff --git a/packages/reown_appkit/example/base/lib/utils/crypto/eip155.dart b/packages/reown_appkit/example/base/lib/utils/crypto/eip155.dart
index 0556792c..5cfde85a 100644
--- a/packages/reown_appkit/example/base/lib/utils/crypto/eip155.dart
+++ b/packages/reown_appkit/example/base/lib/utils/crypto/eip155.dart
@@ -36,7 +36,7 @@ class EIP155 {
};
static Future callMethod({
- required ReownAppKit appKit,
+ required IReownAppKit appKit,
required String topic,
required String method,
required ChainMetadata chainData,
@@ -49,7 +49,6 @@ class EIP155 {
topic: topic,
chainId: chainData.chainId,
address: address,
- message: testSignData,
);
case 'eth_sign':
return ethSign(
@@ -57,7 +56,6 @@ class EIP155 {
topic: topic,
chainId: chainData.chainId,
address: address,
- message: testSignData,
);
case 'eth_signTypedData':
return ethSignTypedData(
@@ -65,33 +63,18 @@ class EIP155 {
topic: topic,
chainId: chainData.chainId,
address: address,
- data: typedData,
);
case 'eth_signTransaction':
return ethSignTransaction(
appKit: appKit,
topic: topic,
chainId: chainData.chainId,
- transaction: Transaction(
- from: EthereumAddress.fromHex(address),
- to: EthereumAddress.fromHex(
- '0x59e2f66C0E96803206B6486cDb39029abAE834c0',
- ),
- value: EtherAmount.fromInt(EtherUnit.finney, 12), // == 0.012
- ),
);
case 'eth_sendTransaction':
return ethSendTransaction(
appKit: appKit,
topic: topic,
chainId: chainData.chainId,
- transaction: Transaction(
- from: EthereumAddress.fromHex(address),
- to: EthereumAddress.fromHex(
- '0x59e2f66C0E96803206B6486cDb39029abAE834c0',
- ),
- value: EtherAmount.fromInt(EtherUnit.finney, 11), // == 0.011
- ),
);
default:
throw 'Method unimplemented';
@@ -99,7 +82,7 @@ class EIP155 {
}
static Future callSmartContract({
- required ReownAppKit appKit,
+ required IReownAppKit appKit,
required String topic,
required String address,
required String action,
@@ -148,93 +131,70 @@ class EIP155 {
}
static Future personalSign({
- required ReownAppKit appKit,
+ required IReownAppKit appKit,
required String topic,
required String chainId,
required String address,
- required String message,
}) async {
- final bytes = utf8.encode(message);
- final encoded = bytesToHex(bytes);
-
return await appKit.request(
topic: topic,
chainId: chainId,
- request: SessionRequestParams(
- method: methods[EIP155Methods.personalSign]!,
- params: [encoded, address],
- ),
+ request: getParams('personal_sign', address)!,
);
}
static Future ethSign({
- required ReownAppKit appKit,
+ required IReownAppKit appKit,
required String topic,
required String chainId,
required String address,
- required String message,
}) async {
return await appKit.request(
topic: topic,
chainId: chainId,
- request: SessionRequestParams(
- method: methods[EIP155Methods.ethSign]!,
- params: [address, message],
- ),
+ request: getParams('eth_sign', address)!,
);
}
static Future ethSignTypedData({
- required ReownAppKit appKit,
+ required IReownAppKit appKit,
required String topic,
required String chainId,
required String address,
- required String data,
}) async {
return await appKit.request(
topic: topic,
chainId: chainId,
- request: SessionRequestParams(
- method: methods[EIP155Methods.ethSignTypedData]!,
- params: [address, data],
- ),
+ request: getParams('eth_signTypedData', address)!,
);
}
static Future ethSignTransaction({
- required ReownAppKit appKit,
+ required IReownAppKit appKit,
required String topic,
required String chainId,
- required Transaction transaction,
}) async {
return await appKit.request(
topic: topic,
chainId: chainId,
- request: SessionRequestParams(
- method: methods[EIP155Methods.ethSignTransaction]!,
- params: [transaction.toJson()],
- ),
+ request: getParams('eth_signTransaction', '')!,
);
}
static Future ethSendTransaction({
- required ReownAppKit appKit,
+ required IReownAppKit appKit,
required String topic,
required String chainId,
- required Transaction transaction,
}) async {
return await appKit.request(
topic: topic,
chainId: chainId,
- request: SessionRequestParams(
- method: methods[EIP155Methods.ethSendTransaction]!,
- params: [transaction.toJson()],
- ),
+ request: getParams('eth_sendTransaction', '')!,
);
}
static Future readSmartContract({
- required ReownAppKit appKit,
+ required IReownAppKit appKit,
required String rpcUrl,
required String address,
required DeployedContract contract,
@@ -274,4 +234,54 @@ class EIP155 {
'balance': oCcy.format(balance),
};
}
+
+ static SessionRequestParams? getParams(String method, String address) {
+ switch (method) {
+ case 'personal_sign':
+ final bytes = utf8.encode(testSignData);
+ final encoded = bytesToHex(bytes, include0x: true);
+ return SessionRequestParams(
+ method: methods[EIP155Methods.personalSign]!,
+ params: [encoded, address],
+ );
+ case 'eth_sign':
+ return SessionRequestParams(
+ method: methods[EIP155Methods.ethSign]!,
+ params: [address, testSignData],
+ );
+ case 'eth_signTypedData':
+ return SessionRequestParams(
+ method: methods[EIP155Methods.ethSignTypedData]!,
+ params: [address, typedData],
+ );
+ case 'eth_signTransaction':
+ return SessionRequestParams(
+ method: methods[EIP155Methods.ethSignTransaction]!,
+ params: [
+ Transaction(
+ from: EthereumAddress.fromHex(address),
+ to: EthereumAddress.fromHex(
+ '0x59e2f66C0E96803206B6486cDb39029abAE834c0',
+ ),
+ value: EtherAmount.fromInt(EtherUnit.finney, 12), // == 0.012
+ ).toJson(),
+ ],
+ );
+ case 'eth_sendTransaction':
+ return SessionRequestParams(
+ method: methods[EIP155Methods.ethSendTransaction]!,
+ params: [
+ Transaction(
+ from: EthereumAddress.fromHex(address),
+ to: EthereumAddress.fromHex(
+ '0x59e2f66C0E96803206B6486cDb39029abAE834c0',
+ ),
+ value: EtherAmount.fromInt(EtherUnit.finney, 12), // == 0.012
+ ).toJson(),
+ ],
+ );
+ default:
+ return null;
+ }
+ }
}
diff --git a/packages/reown_appkit/example/base/lib/utils/crypto/polkadot.dart b/packages/reown_appkit/example/base/lib/utils/crypto/polkadot.dart
index 27eec4f9..02d770bc 100644
--- a/packages/reown_appkit/example/base/lib/utils/crypto/polkadot.dart
+++ b/packages/reown_appkit/example/base/lib/utils/crypto/polkadot.dart
@@ -1,4 +1,5 @@
import 'package:reown_appkit/reown_appkit.dart';
+import 'package:reown_appkit_dapp/models/chain_metadata.dart';
enum PolkadotMethods {
polkadotSignTransaction,
@@ -18,17 +19,17 @@ class Polkadot {
static final Map events = {};
static Future callMethod({
- required ReownAppKit appKit,
+ required IReownAppKit appKit,
required String topic,
required String method,
- required String chainId,
+ required ChainMetadata chainData,
required String address,
}) {
switch (method) {
case 'polkadot_signMessage':
return appKit.request(
topic: topic,
- chainId: chainId,
+ chainId: chainData.chainId,
request: SessionRequestParams(
method: method,
params: {
@@ -41,7 +42,7 @@ class Polkadot {
case 'polkadot_signTransaction':
return appKit.request(
topic: topic,
- chainId: chainId,
+ chainId: chainData.chainId,
request: SessionRequestParams(
method: method,
params: {
diff --git a/packages/reown_appkit/example/base/lib/utils/crypto/solana.dart b/packages/reown_appkit/example/base/lib/utils/crypto/solana.dart
index 329d83ce..f060d5b3 100644
--- a/packages/reown_appkit/example/base/lib/utils/crypto/solana.dart
+++ b/packages/reown_appkit/example/base/lib/utils/crypto/solana.dart
@@ -1,9 +1,7 @@
import 'dart:convert';
import 'package:bs58/bs58.dart';
import 'package:solana_web3/solana_web3.dart' as solana;
-
import 'package:reown_appkit/reown_appkit.dart';
-
import 'package:reown_appkit_dapp/models/chain_metadata.dart';
enum SolanaMethods {
@@ -24,12 +22,11 @@ class Solana {
static final Map events = {};
static Future callMethod({
- required ReownAppKit appKit,
+ required IReownAppKit appKit,
required String topic,
required String method,
required ChainMetadata chainData,
required String address,
- bool isV0 = false,
}) async {
switch (method) {
case 'solana_signMessage':
diff --git a/packages/reown_appkit/example/base/lib/utils/deep_link_handler.dart b/packages/reown_appkit/example/base/lib/utils/deep_link_handler.dart
index 7e225155..ccf15e91 100644
--- a/packages/reown_appkit/example/base/lib/utils/deep_link_handler.dart
+++ b/packages/reown_appkit/example/base/lib/utils/deep_link_handler.dart
@@ -20,7 +20,7 @@ class DeepLinkHandler {
onError: _onError,
);
} catch (e) {
- debugPrint('[SampleWallet] [DeepLinkHandler] checkInitialLink $e');
+ debugPrint('[SampleDapp] checkInitialLink $e');
}
}
@@ -34,7 +34,7 @@ class DeepLinkHandler {
try {
_methodChannel.invokeMethod('initialLink');
} catch (e) {
- debugPrint('[SampleWallet] [DeepLinkHandler] checkInitialLink $e');
+ debugPrint('[SampleDapp] checkInitialLink $e');
}
}
diff --git a/packages/reown_appkit/example/base/lib/utils/sample_wallets.dart b/packages/reown_appkit/example/base/lib/utils/sample_wallets.dart
index 885e8e5d..24b43c33 100644
--- a/packages/reown_appkit/example/base/lib/utils/sample_wallets.dart
+++ b/packages/reown_appkit/example/base/lib/utils/sample_wallets.dart
@@ -32,9 +32,8 @@ class WCSampleWallets {
'platform': ['android'],
'id': '123456789012345678901234567894',
'schema': 'kotlin-web3wallet://wc',
- 'bundleId': 'com.walletconnect.sample.wallet.internal',
- 'universal':
- 'https://web3modal-laboratory-git-chore-kotlin-assetlinks-walletconnect1.vercel.app/wallet_internal',
+ 'bundleId': 'com.reown.sample.wallet.internal',
+ 'universal': 'https://appkit-lab.reown.com/wallet_internal',
},
];
@@ -68,9 +67,8 @@ class WCSampleWallets {
'platform': ['android'],
'id': '123456789012345678901234567893',
'schema': 'kotlin-web3wallet://wc',
- 'bundleId': 'com.walletconnect.sample.wallet',
- 'universal':
- 'https://web3modal-laboratory-git-chore-kotlin-assetlinks-walletconnect1.vercel.app/wallet_release',
+ 'bundleId': 'com.reown.sample.wallet',
+ 'universal': 'https://appkit-lab.reown.com/wallet_release',
},
];
diff --git a/packages/reown_appkit/example/base/lib/utils/smart_contracts.dart b/packages/reown_appkit/example/base/lib/utils/smart_contracts.dart
index 9b20505e..594d8a19 100644
--- a/packages/reown_appkit/example/base/lib/utils/smart_contracts.dart
+++ b/packages/reown_appkit/example/base/lib/utils/smart_contracts.dart
@@ -277,3 +277,783 @@ class SepoliaTestContract {
}
];
}
+
+class AAVESepoliaContract {
+ // AAVE on Sepolia
+ // https://sepolia.etherscan.io/token/0x88541670E55cC00bEEFD87eB59EDd1b7C511AC9a
+ static const contractAddress = '0x88541670E55cC00bEEFD87eB59EDd1b7C511AC9a';
+
+ static const contractABI = [
+ {
+ 'inputs': [
+ {'internalType': 'string', 'name': 'name', 'type': 'string'},
+ {'internalType': 'string', 'name': 'symbol', 'type': 'string'},
+ {'internalType': 'uint8', 'name': 'decimals', 'type': 'uint8'},
+ {'internalType': 'address', 'name': 'owner', 'type': 'address'}
+ ],
+ 'stateMutability': 'nonpayable',
+ 'type': 'constructor'
+ },
+ {
+ 'anonymous': false,
+ 'inputs': [
+ {
+ 'indexed': true,
+ 'internalType': 'address',
+ 'name': 'owner',
+ 'type': 'address'
+ },
+ {
+ 'indexed': true,
+ 'internalType': 'address',
+ 'name': 'spender',
+ 'type': 'address'
+ },
+ {
+ 'indexed': false,
+ 'internalType': 'uint256',
+ 'name': 'value',
+ 'type': 'uint256'
+ }
+ ],
+ 'name': 'Approval',
+ 'type': 'event'
+ },
+ {
+ 'anonymous': false,
+ 'inputs': [
+ {
+ 'indexed': true,
+ 'internalType': 'address',
+ 'name': 'previousOwner',
+ 'type': 'address'
+ },
+ {
+ 'indexed': true,
+ 'internalType': 'address',
+ 'name': 'newOwner',
+ 'type': 'address'
+ }
+ ],
+ 'name': 'OwnershipTransferred',
+ 'type': 'event'
+ },
+ {
+ 'anonymous': false,
+ 'inputs': [
+ {
+ 'indexed': true,
+ 'internalType': 'address',
+ 'name': 'from',
+ 'type': 'address'
+ },
+ {
+ 'indexed': true,
+ 'internalType': 'address',
+ 'name': 'to',
+ 'type': 'address'
+ },
+ {
+ 'indexed': false,
+ 'internalType': 'uint256',
+ 'name': 'value',
+ 'type': 'uint256'
+ }
+ ],
+ 'name': 'Transfer',
+ 'type': 'event'
+ },
+ {
+ 'inputs': [],
+ 'name': 'DOMAIN_SEPARATOR',
+ 'outputs': [
+ {'internalType': 'bytes32', 'name': '', 'type': 'bytes32'}
+ ],
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'inputs': [],
+ 'name': 'EIP712_REVISION',
+ 'outputs': [
+ {'internalType': 'bytes', 'name': '', 'type': 'bytes'}
+ ],
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'inputs': [],
+ 'name': 'PERMIT_TYPEHASH',
+ 'outputs': [
+ {'internalType': 'bytes32', 'name': '', 'type': 'bytes32'}
+ ],
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'inputs': [
+ {'internalType': 'address', 'name': 'owner', 'type': 'address'},
+ {'internalType': 'address', 'name': 'spender', 'type': 'address'}
+ ],
+ 'name': 'allowance',
+ 'outputs': [
+ {'internalType': 'uint256', 'name': '', 'type': 'uint256'}
+ ],
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'inputs': [
+ {'internalType': 'address', 'name': 'spender', 'type': 'address'},
+ {'internalType': 'uint256', 'name': 'amount', 'type': 'uint256'}
+ ],
+ 'name': 'approve',
+ 'outputs': [
+ {'internalType': 'bool', 'name': '', 'type': 'bool'}
+ ],
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'inputs': [
+ {'internalType': 'address', 'name': 'account', 'type': 'address'}
+ ],
+ 'name': 'balanceOf',
+ 'outputs': [
+ {'internalType': 'uint256', 'name': '', 'type': 'uint256'}
+ ],
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'inputs': [],
+ 'name': 'decimals',
+ 'outputs': [
+ {'internalType': 'uint8', 'name': '', 'type': 'uint8'}
+ ],
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'inputs': [
+ {'internalType': 'address', 'name': 'spender', 'type': 'address'},
+ {
+ 'internalType': 'uint256',
+ 'name': 'subtractedValue',
+ 'type': 'uint256'
+ }
+ ],
+ 'name': 'decreaseAllowance',
+ 'outputs': [
+ {'internalType': 'bool', 'name': '', 'type': 'bool'}
+ ],
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'inputs': [
+ {'internalType': 'address', 'name': 'spender', 'type': 'address'},
+ {'internalType': 'uint256', 'name': 'addedValue', 'type': 'uint256'}
+ ],
+ 'name': 'increaseAllowance',
+ 'outputs': [
+ {'internalType': 'bool', 'name': '', 'type': 'bool'}
+ ],
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'inputs': [
+ {'internalType': 'address', 'name': 'account', 'type': 'address'},
+ {'internalType': 'uint256', 'name': 'value', 'type': 'uint256'}
+ ],
+ 'name': 'mint',
+ 'outputs': [
+ {'internalType': 'bool', 'name': '', 'type': 'bool'}
+ ],
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'inputs': [
+ {'internalType': 'uint256', 'name': 'value', 'type': 'uint256'}
+ ],
+ 'name': 'mint',
+ 'outputs': [
+ {'internalType': 'bool', 'name': '', 'type': 'bool'}
+ ],
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'inputs': [],
+ 'name': 'name',
+ 'outputs': [
+ {'internalType': 'string', 'name': '', 'type': 'string'}
+ ],
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'inputs': [
+ {'internalType': 'address', 'name': 'owner', 'type': 'address'}
+ ],
+ 'name': 'nonces',
+ 'outputs': [
+ {'internalType': 'uint256', 'name': '', 'type': 'uint256'}
+ ],
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'inputs': [],
+ 'name': 'owner',
+ 'outputs': [
+ {'internalType': 'address', 'name': '', 'type': 'address'}
+ ],
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'inputs': [
+ {'internalType': 'address', 'name': 'owner', 'type': 'address'},
+ {'internalType': 'address', 'name': 'spender', 'type': 'address'},
+ {'internalType': 'uint256', 'name': 'value', 'type': 'uint256'},
+ {'internalType': 'uint256', 'name': 'deadline', 'type': 'uint256'},
+ {'internalType': 'uint8', 'name': 'v', 'type': 'uint8'},
+ {'internalType': 'bytes32', 'name': 'r', 'type': 'bytes32'},
+ {'internalType': 'bytes32', 'name': 's', 'type': 'bytes32'}
+ ],
+ 'name': 'permit',
+ 'outputs': [],
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'inputs': [],
+ 'name': 'renounceOwnership',
+ 'outputs': [],
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'inputs': [],
+ 'name': 'symbol',
+ 'outputs': [
+ {'internalType': 'string', 'name': '', 'type': 'string'}
+ ],
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'inputs': [],
+ 'name': 'totalSupply',
+ 'outputs': [
+ {'internalType': 'uint256', 'name': '', 'type': 'uint256'}
+ ],
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'inputs': [
+ {'internalType': 'address', 'name': 'recipient', 'type': 'address'},
+ {'internalType': 'uint256', 'name': 'amount', 'type': 'uint256'}
+ ],
+ 'name': 'transfer',
+ 'outputs': [
+ {'internalType': 'bool', 'name': '', 'type': 'bool'}
+ ],
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'inputs': [
+ {'internalType': 'address', 'name': 'sender', 'type': 'address'},
+ {'internalType': 'address', 'name': 'recipient', 'type': 'address'},
+ {'internalType': 'uint256', 'name': 'amount', 'type': 'uint256'}
+ ],
+ 'name': 'transferFrom',
+ 'outputs': [
+ {'internalType': 'bool', 'name': '', 'type': 'bool'}
+ ],
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'inputs': [
+ {'internalType': 'address', 'name': 'newOwner', 'type': 'address'}
+ ],
+ 'name': 'transferOwnership',
+ 'outputs': [],
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ }
+ ];
+}
+
+class USDTContract {
+ // USDT-ERC20
+ // https://etherscan.io/token/0xdac17f958d2ee523a2206206994597c13d831ec7
+ static const contractAddress = '0xdAC17F958D2ee523a2206206994597C13D831ec7';
+
+ static const contractABI = [
+ {
+ 'constant': true,
+ 'inputs': [],
+ 'name': 'name',
+ 'outputs': [
+ {'name': '', 'type': 'string'}
+ ],
+ 'payable': false,
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'constant': false,
+ 'inputs': [
+ {'name': '_upgradedAddress', 'type': 'address'}
+ ],
+ 'name': 'deprecate',
+ 'outputs': [],
+ 'payable': false,
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'constant': false,
+ 'inputs': [
+ {'name': '_spender', 'type': 'address'},
+ {'name': '_value', 'type': 'uint256'}
+ ],
+ 'name': 'approve',
+ 'outputs': [],
+ 'payable': false,
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'constant': true,
+ 'inputs': [],
+ 'name': 'deprecated',
+ 'outputs': [
+ {'name': '', 'type': 'bool'}
+ ],
+ 'payable': false,
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'constant': false,
+ 'inputs': [
+ {'name': '_evilUser', 'type': 'address'}
+ ],
+ 'name': 'addBlackList',
+ 'outputs': [],
+ 'payable': false,
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'constant': true,
+ 'inputs': [],
+ 'name': 'totalSupply',
+ 'outputs': [
+ {'name': '', 'type': 'uint256'}
+ ],
+ 'payable': false,
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'constant': false,
+ 'inputs': [
+ {'name': '_from', 'type': 'address'},
+ {'name': '_to', 'type': 'address'},
+ {'name': '_value', 'type': 'uint256'}
+ ],
+ 'name': 'transferFrom',
+ 'outputs': [],
+ 'payable': false,
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'constant': true,
+ 'inputs': [],
+ 'name': 'upgradedAddress',
+ 'outputs': [
+ {'name': '', 'type': 'address'}
+ ],
+ 'payable': false,
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'constant': true,
+ 'inputs': [
+ {'name': '', 'type': 'address'}
+ ],
+ 'name': 'balances',
+ 'outputs': [
+ {'name': '', 'type': 'uint256'}
+ ],
+ 'payable': false,
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'constant': true,
+ 'inputs': [],
+ 'name': 'decimals',
+ 'outputs': [
+ {'name': '', 'type': 'uint256'}
+ ],
+ 'payable': false,
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'constant': true,
+ 'inputs': [],
+ 'name': 'maximumFee',
+ 'outputs': [
+ {'name': '', 'type': 'uint256'}
+ ],
+ 'payable': false,
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'constant': true,
+ 'inputs': [],
+ 'name': '_totalSupply',
+ 'outputs': [
+ {'name': '', 'type': 'uint256'}
+ ],
+ 'payable': false,
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'constant': false,
+ 'inputs': [],
+ 'name': 'unpause',
+ 'outputs': [],
+ 'payable': false,
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'constant': true,
+ 'inputs': [
+ {'name': '_maker', 'type': 'address'}
+ ],
+ 'name': 'getBlackListStatus',
+ 'outputs': [
+ {'name': '', 'type': 'bool'}
+ ],
+ 'payable': false,
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'constant': true,
+ 'inputs': [
+ {'name': '', 'type': 'address'},
+ {'name': '', 'type': 'address'}
+ ],
+ 'name': 'allowed',
+ 'outputs': [
+ {'name': '', 'type': 'uint256'}
+ ],
+ 'payable': false,
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'constant': true,
+ 'inputs': [],
+ 'name': 'paused',
+ 'outputs': [
+ {'name': '', 'type': 'bool'}
+ ],
+ 'payable': false,
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'constant': true,
+ 'inputs': [
+ {'name': 'who', 'type': 'address'}
+ ],
+ 'name': 'balanceOf',
+ 'outputs': [
+ {'name': '', 'type': 'uint256'}
+ ],
+ 'payable': false,
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'constant': false,
+ 'inputs': [],
+ 'name': 'pause',
+ 'outputs': [],
+ 'payable': false,
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'constant': true,
+ 'inputs': [],
+ 'name': 'getOwner',
+ 'outputs': [
+ {'name': '', 'type': 'address'}
+ ],
+ 'payable': false,
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'constant': true,
+ 'inputs': [],
+ 'name': 'owner',
+ 'outputs': [
+ {'name': '', 'type': 'address'}
+ ],
+ 'payable': false,
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'constant': true,
+ 'inputs': [],
+ 'name': 'symbol',
+ 'outputs': [
+ {'name': '', 'type': 'string'}
+ ],
+ 'payable': false,
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'constant': false,
+ 'inputs': [
+ {'name': '_to', 'type': 'address'},
+ {'name': '_value', 'type': 'uint256'}
+ ],
+ 'name': 'transfer',
+ 'outputs': [],
+ 'payable': false,
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'constant': false,
+ 'inputs': [
+ {'name': 'newBasisPoints', 'type': 'uint256'},
+ {'name': 'newMaxFee', 'type': 'uint256'}
+ ],
+ 'name': 'setParams',
+ 'outputs': [],
+ 'payable': false,
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'constant': false,
+ 'inputs': [
+ {'name': 'amount', 'type': 'uint256'}
+ ],
+ 'name': 'issue',
+ 'outputs': [],
+ 'payable': false,
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'constant': false,
+ 'inputs': [
+ {'name': 'amount', 'type': 'uint256'}
+ ],
+ 'name': 'redeem',
+ 'outputs': [],
+ 'payable': false,
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'constant': true,
+ 'inputs': [
+ {'name': '_owner', 'type': 'address'},
+ {'name': '_spender', 'type': 'address'}
+ ],
+ 'name': 'allowance',
+ 'outputs': [
+ {'name': 'remaining', 'type': 'uint256'}
+ ],
+ 'payable': false,
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'constant': true,
+ 'inputs': [],
+ 'name': 'basisPointsRate',
+ 'outputs': [
+ {'name': '', 'type': 'uint256'}
+ ],
+ 'payable': false,
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'constant': true,
+ 'inputs': [
+ {'name': '', 'type': 'address'}
+ ],
+ 'name': 'isBlackListed',
+ 'outputs': [
+ {'name': '', 'type': 'bool'}
+ ],
+ 'payable': false,
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'constant': false,
+ 'inputs': [
+ {'name': '_clearedUser', 'type': 'address'}
+ ],
+ 'name': 'removeBlackList',
+ 'outputs': [],
+ 'payable': false,
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'constant': true,
+ 'inputs': [],
+ 'name': 'MAX_UINT',
+ 'outputs': [
+ {'name': '', 'type': 'uint256'}
+ ],
+ 'payable': false,
+ 'stateMutability': 'view',
+ 'type': 'function'
+ },
+ {
+ 'constant': false,
+ 'inputs': [
+ {'name': 'newOwner', 'type': 'address'}
+ ],
+ 'name': 'transferOwnership',
+ 'outputs': [],
+ 'payable': false,
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'constant': false,
+ 'inputs': [
+ {'name': '_blackListedUser', 'type': 'address'}
+ ],
+ 'name': 'destroyBlackFunds',
+ 'outputs': [],
+ 'payable': false,
+ 'stateMutability': 'nonpayable',
+ 'type': 'function'
+ },
+ {
+ 'inputs': [
+ {'name': '_initialSupply', 'type': 'uint256'},
+ {'name': '_name', 'type': 'string'},
+ {'name': '_symbol', 'type': 'string'},
+ {'name': '_decimals', 'type': 'uint256'}
+ ],
+ 'payable': false,
+ 'stateMutability': 'nonpayable',
+ 'type': 'constructor'
+ },
+ {
+ 'anonymous': false,
+ 'inputs': [
+ {'indexed': false, 'name': 'amount', 'type': 'uint256'}
+ ],
+ 'name': 'Issue',
+ 'type': 'event'
+ },
+ {
+ 'anonymous': false,
+ 'inputs': [
+ {'indexed': false, 'name': 'amount', 'type': 'uint256'}
+ ],
+ 'name': 'Redeem',
+ 'type': 'event'
+ },
+ {
+ 'anonymous': false,
+ 'inputs': [
+ {'indexed': false, 'name': 'newAddress', 'type': 'address'}
+ ],
+ 'name': 'Deprecate',
+ 'type': 'event'
+ },
+ {
+ 'anonymous': false,
+ 'inputs': [
+ {'indexed': false, 'name': 'feeBasisPoints', 'type': 'uint256'},
+ {'indexed': false, 'name': 'maxFee', 'type': 'uint256'}
+ ],
+ 'name': 'Params',
+ 'type': 'event'
+ },
+ {
+ 'anonymous': false,
+ 'inputs': [
+ {'indexed': false, 'name': '_blackListedUser', 'type': 'address'},
+ {'indexed': false, 'name': '_balance', 'type': 'uint256'}
+ ],
+ 'name': 'DestroyedBlackFunds',
+ 'type': 'event'
+ },
+ {
+ 'anonymous': false,
+ 'inputs': [
+ {'indexed': false, 'name': '_user', 'type': 'address'}
+ ],
+ 'name': 'AddedBlackList',
+ 'type': 'event'
+ },
+ {
+ 'anonymous': false,
+ 'inputs': [
+ {'indexed': false, 'name': '_user', 'type': 'address'}
+ ],
+ 'name': 'RemovedBlackList',
+ 'type': 'event'
+ },
+ {
+ 'anonymous': false,
+ 'inputs': [
+ {'indexed': true, 'name': 'owner', 'type': 'address'},
+ {'indexed': true, 'name': 'spender', 'type': 'address'},
+ {'indexed': false, 'name': 'value', 'type': 'uint256'}
+ ],
+ 'name': 'Approval',
+ 'type': 'event'
+ },
+ {
+ 'anonymous': false,
+ 'inputs': [
+ {'indexed': true, 'name': 'from', 'type': 'address'},
+ {'indexed': true, 'name': 'to', 'type': 'address'},
+ {'indexed': false, 'name': 'value', 'type': 'uint256'}
+ ],
+ 'name': 'Transfer',
+ 'type': 'event'
+ },
+ {'anonymous': false, 'inputs': [], 'name': 'Pause', 'type': 'event'},
+ {'anonymous': false, 'inputs': [], 'name': 'Unpause', 'type': 'event'}
+ ];
+}
diff --git a/packages/reown_appkit/example/base/lib/utils/test_data.dart b/packages/reown_appkit/example/base/lib/utils/test_data.dart
index cb78e1d3..636ea9ac 100644
--- a/packages/reown_appkit/example/base/lib/utils/test_data.dart
+++ b/packages/reown_appkit/example/base/lib/utils/test_data.dart
@@ -36,6 +36,166 @@ String testSignTypedData(String address) => jsonEncode(
const typedData =
r'''{"types":{"EIP712Domain":[{"type":"string","name":"name"},{"type":"string","name":"version"},{"type":"uint256","name":"chainId"},{"type":"address","name":"verifyingContract"}],"Part":[{"name":"account","type":"address"},{"name":"value","type":"uint96"}],"Mint721":[{"name":"tokenId","type":"uint256"},{"name":"tokenURI","type":"string"},{"name":"creators","type":"Part[]"},{"name":"royalties","type":"Part[]"}]},"domain":{"name":"Mint721","version":"1","chainId":4,"verifyingContract":"0x2547760120aed692eb19d22a5d9ccfe0f7872fce"},"primaryType":"Mint721","message":{"@type":"ERC721","contract":"0x2547760120aed692eb19d22a5d9ccfe0f7872fce","tokenId":"1","uri":"ipfs://ipfs/hash","creators":[{"account":"0xc5eac3488524d577a1495492599e8013b1f91efa","value":10000}],"royalties":[],"tokenURI":"ipfs://ipfs/hash"}}''';
+Map typeDataV3(int chainId) => {
+ 'types': {
+ 'EIP712Domain': [
+ {'name': 'name', 'type': 'string'},
+ {'name': 'version', 'type': 'string'},
+ {'name': 'chainId', 'type': 'uint256'},
+ {'name': 'verifyingContract', 'type': 'address'}
+ ],
+ 'Person': [
+ {'name': 'name', 'type': 'string'},
+ {'name': 'wallet', 'type': 'address'}
+ ],
+ 'Mail': [
+ {'name': 'from', 'type': 'Person'},
+ {'name': 'to', 'type': 'Person'},
+ {'name': 'contents', 'type': 'string'}
+ ]
+ },
+ 'primaryType': 'Mail',
+ 'domain': {
+ 'name': 'Ether Mail',
+ 'version': '1',
+ 'chainId': chainId,
+ 'verifyingContract': '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC'
+ },
+ 'message': {
+ 'from': {
+ 'name': 'Cow',
+ 'wallet': '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826'
+ },
+ 'to': {
+ 'name': 'Bob',
+ 'wallet': '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB'
+ },
+ 'contents': 'Hello, Bob!'
+ }
+ };
+
+Map typeDataV4(int chainId) => {
+ 'types': {
+ 'EIP712Domain': [
+ {'type': 'string', 'name': 'name'},
+ {'type': 'string', 'name': 'version'},
+ {'type': 'uint256', 'name': 'chainId'},
+ {'type': 'address', 'name': 'verifyingContract'}
+ ],
+ 'Part': [
+ {'name': 'account', 'type': 'address'},
+ {'name': 'value', 'type': 'uint96'}
+ ],
+ 'Mint721': [
+ {'name': 'tokenId', 'type': 'uint256'},
+ {'name': 'tokenURI', 'type': 'string'},
+ {'name': 'creators', 'type': 'Part[]'},
+ {'name': 'royalties', 'type': 'Part[]'}
+ ]
+ },
+ 'domain': {
+ 'name': 'Mint721',
+ 'version': '1',
+ 'chainId': chainId,
+ 'verifyingContract': '0x2547760120aed692eb19d22a5d9ccfe0f7872fce'
+ },
+ 'primaryType': 'Mint721',
+ 'message': {
+ '@type': 'ERC721',
+ 'contract': '0x2547760120aed692eb19d22a5d9ccfe0f7872fce',
+ 'tokenId': '1',
+ 'uri': 'ipfs://ipfs/hash',
+ 'creators': [
+ {
+ 'account': '0xc5eac3488524d577a1495492599e8013b1f91efa',
+ 'value': 10000
+ }
+ ],
+ 'royalties': [],
+ 'tokenURI': 'ipfs://ipfs/hash'
+ }
+ };
+
+/// KADENA ///
+
+// SignRequest createSignRequest({
+// required String networkId,
+// required String signingPubKey,
+// required String sender,
+// String code = '"hello"',
+// Map? data,
+// List caps = const [],
+// String chainId = '1',
+// int gasLimit = 2000,
+// double gasPrice = 1e-8,
+// int ttl = 600,
+// }) =>
+// SignRequest(
+// code: code,
+// data: data ?? {},
+// sender: sender,
+// networkId: networkId,
+// chainId: chainId,
+// gasLimit: gasLimit,
+// gasPrice: gasPrice,
+// signingPubKey: signingPubKey,
+// ttl: ttl,
+// caps: caps,
+// );
+
+// PactCommandPayload createPactCommandPayload({
+// required String networkId,
+// required String sender,
+// String code = '"hello"',
+// Map? data,
+// List signerCaps = const [],
+// String chainId = '1',
+// int gasLimit = 2000,
+// double gasPrice = 1e-8,
+// int ttl = 600,
+// }) =>
+// PactCommandPayload(
+// networkId: networkId,
+// payload: CommandPayload(
+// exec: ExecMessage(
+// code: code,
+// data: data ?? {},
+// ),
+// ),
+// signers: signerCaps,
+// meta: CommandMetadata(
+// chainId: chainId,
+// gasLimit: gasLimit,
+// gasPrice: gasPrice,
+// ttl: ttl,
+// sender: sender,
+// ),
+// );
+
+// QuicksignRequest createQuicksignRequest({
+// required String cmd,
+// List sigs = const [],
+// }) =>
+// QuicksignRequest(
+// commandSigDatas: [
+// CommandSigData(
+// cmd: cmd,
+// sigs: sigs,
+// ),
+// ],
+// );
+
+// GetAccountsRequest createGetAccountsRequest({
+// required String account,
+// }) =>
+// GetAccountsRequest(
+// accounts: [
+// AccountRequest(
+// account: account,
+// ),
+// ],
+// );
+
/// KADENA ///
// SignRequest createSignRequest({
diff --git a/packages/reown_appkit/example/base/lib/widgets/session_widget.dart b/packages/reown_appkit/example/base/lib/widgets/session_widget.dart
index 93e09893..88b53997 100644
--- a/packages/reown_appkit/example/base/lib/widgets/session_widget.dart
+++ b/packages/reown_appkit/example/base/lib/widgets/session_widget.dart
@@ -14,23 +14,33 @@ import 'package:reown_appkit_dapp/widgets/method_dialog.dart';
class SessionWidget extends StatefulWidget {
const SessionWidget({
super.key,
- required this.session,
- required this.appKit,
+ required this.sessionTopic,
+ required this.appKitModal,
});
- final SessionData session;
- final ReownAppKit appKit;
+ final String sessionTopic;
+ final ReownAppKitModal appKitModal;
@override
SessionWidgetState createState() => SessionWidgetState();
}
class SessionWidgetState extends State {
+ late IReownAppKit _appKit;
+ late SessionData _session;
+
+ @override
+ void initState() {
+ super.initState();
+ _appKit = widget.appKitModal.appKit!;
+ _session = _appKit.sessions.get(widget.sessionTopic)!;
+ }
+
@override
Widget build(BuildContext context) {
final List children = [
Text(
- '${StringConstants.sessionTopic}${widget.session.topic}',
+ '${StringConstants.sessionTopic}${_session.topic}',
),
];
@@ -38,7 +48,7 @@ class SessionWidgetState extends State {
final List namespaceAccounts = [];
// Loop through the namespaces, and get the accounts
- for (final Namespace namespace in widget.session.namespaces.values) {
+ for (final Namespace namespace in _session.namespaces.values) {
namespaceAccounts.addAll(namespace.accounts);
}
@@ -61,8 +71,8 @@ class SessionWidgetState extends State {
),
child: ElevatedButton(
onPressed: () async {
- await widget.appKit.disconnectSession(
- topic: widget.session.topic,
+ await _appKit.disconnectSession(
+ topic: _session.topic,
reason: Errors.getSdkError(
Errors.USER_DISCONNECTED,
).toSignError(),
@@ -170,7 +180,7 @@ class SessionWidgetState extends State {
final List buttons = [];
// Add Methods
for (final String method in getChainMethods(chainMetadata.type)) {
- final namespaces = widget.session.namespaces[chainMetadata.type.name];
+ final namespaces = _session.namespaces[chainMetadata.type.name];
final supported = namespaces?.methods.contains(method) ?? false;
buttons.add(
Container(
@@ -226,33 +236,32 @@ class SessionWidgetState extends State {
switch (chainMetadata.type) {
case ChainType.eip155:
return EIP155.callMethod(
- appKit: widget.appKit,
- topic: widget.session.topic,
+ appKit: _appKit,
+ topic: _session.topic,
method: method,
chainData: chainMetadata,
address: address,
);
case ChainType.polkadot:
return Polkadot.callMethod(
- appKit: widget.appKit,
- topic: widget.session.topic,
+ appKit: _appKit,
+ topic: _session.topic,
method: method,
- chainId: chainMetadata.chainId,
+ chainData: chainMetadata,
address: address,
);
case ChainType.solana:
return Solana.callMethod(
- appKit: widget.appKit,
- topic: widget.session.topic,
+ appKit: _appKit,
+ topic: _session.topic,
method: method,
chainData: chainMetadata,
address: address,
- isV0: true,
);
// case ChainType.kadena:
// return Kadena.callMethod(
- // appKit: widget.appKit,
- // topic: widget.session.topic,
+ // appKit: _appKit,
+ // topic: _session.topic,
// method: method.toKadenaMethod()!,
// chainId: chainMetadata.chainId,
// address: address.toLowerCase(),
@@ -264,9 +273,9 @@ class SessionWidgetState extends State {
void _launchWallet() {
if (kIsWeb) return;
- widget.appKit.redirectToWallet(
- topic: widget.session.topic,
- redirect: widget.session.peer.metadata.redirect,
+ _appKit.redirectToWallet(
+ topic: _session.topic,
+ redirect: _session.peer.metadata.redirect,
);
}
@@ -284,8 +293,8 @@ class SessionWidgetState extends State {
onPressed: enabled
? () async {
final future = EIP155.callSmartContract(
- appKit: widget.appKit,
- topic: widget.session.topic,
+ appKit: _appKit,
+ topic: _session.topic,
address: address,
action: 'read',
);
@@ -326,8 +335,8 @@ class SessionWidgetState extends State {
onPressed: enabled
? () async {
final future = EIP155.callSmartContract(
- appKit: widget.appKit,
- topic: widget.session.topic,
+ appKit: _appKit,
+ topic: _session.topic,
address: address,
action: 'write',
);
diff --git a/packages/reown_appkit/example/base/pubspec.yaml b/packages/reown_appkit/example/base/pubspec.yaml
index 1934ff9b..f928b0e4 100644
--- a/packages/reown_appkit/example/base/pubspec.yaml
+++ b/packages/reown_appkit/example/base/pubspec.yaml
@@ -17,7 +17,7 @@ dependencies:
sdk: flutter
intl: ^0.19.0
json_annotation: ^4.8.1
- package_info_plus: ^7.0.0
+ package_info_plus: ^8.0.2
qr_flutter: ^4.0.0
reown_appkit:
path: ../..
diff --git a/packages/reown_appkit/example/modal/android/app/src/main/AndroidManifest.xml b/packages/reown_appkit/example/modal/android/app/src/main/AndroidManifest.xml
index a56e8f21..09087a0e 100644
--- a/packages/reown_appkit/example/modal/android/app/src/main/AndroidManifest.xml
+++ b/packages/reown_appkit/example/modal/android/app/src/main/AndroidManifest.xml
@@ -52,8 +52,8 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/reown_appkit/example/modal/android/app/src/main/kotlin/com/example/sign/MainActivity.kt b/packages/reown_appkit/example/modal/android/app/src/main/kotlin/com/example/sign/MainActivity.kt
index 4094c0c7..877b2caa 100644
--- a/packages/reown_appkit/example/modal/android/app/src/main/kotlin/com/example/sign/MainActivity.kt
+++ b/packages/reown_appkit/example/modal/android/app/src/main/kotlin/com/example/sign/MainActivity.kt
@@ -1,6 +1,65 @@
package com.web3modal.flutterExample
import io.flutter.embedding.android.FlutterActivity
+import android.content.BroadcastReceiver
+import android.content.Context
+import android.content.Intent
+import android.net.Uri
+import android.os.Bundle
+import androidx.annotation.NonNull
+
+import io.flutter.embedding.engine.FlutterEngine
+import io.flutter.plugin.common.EventChannel
+import io.flutter.plugin.common.MethodCall
+import io.flutter.plugin.common.MethodChannel
class MainActivity: FlutterActivity() {
+ private val eventsChannel = "com.web3modal.flutterExample/events"
+ private val methodsChannel = "com.web3modal.flutterExample/methods"
+
+ private var initialLink: String? = null
+ private var linksReceiver: BroadcastReceiver? = null
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ val intent: Intent? = intent
+ initialLink = intent?.data?.toString()
+
+ EventChannel(flutterEngine?.dartExecutor?.binaryMessenger, eventsChannel).setStreamHandler(
+ object : EventChannel.StreamHandler {
+ override fun onListen(args: Any?, events: EventChannel.EventSink) {
+ linksReceiver = createChangeReceiver(events)
+ }
+ override fun onCancel(args: Any?) {
+ linksReceiver = null
+ }
+ }
+ )
+
+ MethodChannel(flutterEngine!!.dartExecutor.binaryMessenger, methodsChannel).setMethodCallHandler { call, result ->
+ if (call.method == "initialLink") {
+ if (initialLink != null) {
+ result.success(initialLink)
+ }
+ }
+ }
+ }
+
+ override fun onNewIntent(intent: Intent) {
+ super.onNewIntent(intent)
+ if (intent.action === Intent.ACTION_VIEW) {
+ linksReceiver?.onReceive(this.applicationContext, intent)
+ }
+ }
+
+ fun createChangeReceiver(events: EventChannel.EventSink): BroadcastReceiver? {
+ return object : BroadcastReceiver() {
+ override fun onReceive(context: Context, intent: Intent) {
+ val dataString = intent.dataString ?:
+ events.error("UNAVAILABLE", "Link unavailable", null)
+ events.success(dataString)
+ }
+ }
+ }
}
diff --git a/packages/reown_appkit/example/modal/ios/Podfile b/packages/reown_appkit/example/modal/ios/Podfile
index 3e44f9c6..9a3af86b 100644
--- a/packages/reown_appkit/example/modal/ios/Podfile
+++ b/packages/reown_appkit/example/modal/ios/Podfile
@@ -40,5 +40,8 @@ end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
+ target.build_configurations.each do |config|
+ config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
+ end
end
end
diff --git a/packages/reown_appkit/example/modal/ios/Podfile.lock b/packages/reown_appkit/example/modal/ios/Podfile.lock
index 35be0e97..0d8a4669 100644
--- a/packages/reown_appkit/example/modal/ios/Podfile.lock
+++ b/packages/reown_appkit/example/modal/ios/Podfile.lock
@@ -84,6 +84,6 @@ SPEC CHECKSUMS:
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
webview_flutter_wkwebview: 2a23822e9039b7b1bc52e5add778e5d89ad488d1
-PODFILE CHECKSUM: a57f30d18f102dd3ce366b1d62a55ecbef2158e5
+PODFILE CHECKSUM: 0a7d5b7d0e53420cb0284f7b2f171f93843b94d2
COCOAPODS: 1.15.2
diff --git a/packages/reown_appkit/example/modal/ios/Runner/AppDelegate.swift b/packages/reown_appkit/example/modal/ios/Runner/AppDelegate.swift
index 81aa14a0..242bf151 100644
--- a/packages/reown_appkit/example/modal/ios/Runner/AppDelegate.swift
+++ b/packages/reown_appkit/example/modal/ios/Runner/AppDelegate.swift
@@ -4,11 +4,47 @@ import CoinbaseWalletSDK
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
- override func application(
- _ application: UIApplication,
- didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
- ) -> Bool {
+
+ private static let EVENTS_CHANNEL = "com.web3modal.flutterExample/events"
+ private static let METHODS_CHANNEL = "com.web3modal.flutterExample/methods"
+
+ private var eventsChannel: FlutterEventChannel?
+ private var methodsChannel: FlutterMethodChannel?
+ var initialLink: String?
+
+ private let linkStreamHandler = LinkStreamHandler()
+
+ override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
GeneratedPluginRegistrant.register(with: self)
+
+ let controller = window.rootViewController as! FlutterViewController
+ eventsChannel = FlutterEventChannel(name: AppDelegate.EVENTS_CHANNEL, binaryMessenger: controller.binaryMessenger)
+ eventsChannel?.setStreamHandler(linkStreamHandler)
+
+ methodsChannel = FlutterMethodChannel(name: AppDelegate.METHODS_CHANNEL, binaryMessenger: controller.binaryMessenger)
+ methodsChannel?.setMethodCallHandler({ [weak self] (call: FlutterMethodCall, result: FlutterResult) -> Void in
+ if (call.method == "initialLink") {
+ if let link = self?.initialLink {
+ let handled = self?.linkStreamHandler.handleLink(link)
+ if (handled == true) {
+ self?.initialLink = nil
+ }
+ }
+ }
+ })
+
+ // Add your deep link handling logic here
+ if let url = launchOptions?[.url] as? URL {
+ self.initialLink = url.absoluteString
+ }
+
+ if let userActivityDictionary = launchOptions?[.userActivityDictionary] as? [String: Any],
+ let userActivity = userActivityDictionary["UIApplicationLaunchOptionsUserActivityKey"] as? NSUserActivity,
+ userActivity.activityType == NSUserActivityTypeBrowsingWeb {
+
+ handleIncomingUniversalLink(userActivity: userActivity)
+ }
+
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
@@ -21,19 +57,60 @@ import CoinbaseWalletSDK
}
}
- return super.application(app, open: url, options: options)
+ return linkStreamHandler.handleLink(url.absoluteString)
}
override func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
if #available(iOS 13.0, *) {
if (CoinbaseWalletSDK.isConfigured == true) {
- if let url = userActivity.webpageURL,
- (try? CoinbaseWalletSDK.shared.handleResponse(url)) == true {
+ if let url = userActivity.webpageURL, (try? CoinbaseWalletSDK.shared.handleResponse(url)) == true {
return true
}
}
}
- return super.application(application, continue: userActivity, restorationHandler: restorationHandler)
+ if userActivity.activityType == NSUserActivityTypeBrowsingWeb {
+ handleIncomingUniversalLink(userActivity: userActivity)
+ return true
+ }
+
+ return false
+ }
+
+ private func handleIncomingUniversalLink(userActivity: NSUserActivity) {
+ if let url = userActivity.webpageURL {
+ // Handle the URL, navigate to appropriate screen
+ print("App launched with Universal Link: \(url.absoluteString)")
+ let handled = linkStreamHandler.handleLink(url.absoluteString)
+ if (!handled){
+ self.initialLink = url.absoluteString
+ }
+ }
}
}
+
+class LinkStreamHandler: NSObject, FlutterStreamHandler {
+ var eventSink: FlutterEventSink?
+ var queuedLinks = [String]()
+
+ func onListen(withArguments arguments: Any?, eventSink events: @escaping FlutterEventSink) -> FlutterError? {
+ self.eventSink = events
+ queuedLinks.forEach({ events($0) })
+ queuedLinks.removeAll()
+ return nil
+ }
+
+ func onCancel(withArguments arguments: Any?) -> FlutterError? {
+ self.eventSink = nil
+ return nil
+ }
+
+ func handleLink(_ link: String) -> Bool {
+ guard let eventSink = eventSink else {
+ queuedLinks.append(link)
+ return false
+ }
+ eventSink(link)
+ return true
+ }
+}
\ No newline at end of file
diff --git a/packages/reown_appkit/example/modal/ios/Runner/Runner.entitlements b/packages/reown_appkit/example/modal/ios/Runner/Runner.entitlements
index 903def2a..bfe855c1 100644
--- a/packages/reown_appkit/example/modal/ios/Runner/Runner.entitlements
+++ b/packages/reown_appkit/example/modal/ios/Runner/Runner.entitlements
@@ -2,7 +2,9 @@
- aps-environment
- development
+ com.apple.developer.associated-domains
+
+ applinks:appkit-lab.reown.com
+
diff --git a/packages/reown_appkit/example/modal/lib/home_page.dart b/packages/reown_appkit/example/modal/lib/home_page.dart
index a6744596..a2a44907 100644
--- a/packages/reown_appkit/example/modal/lib/home_page.dart
+++ b/packages/reown_appkit/example/modal/lib/home_page.dart
@@ -3,6 +3,7 @@ import 'dart:developer';
import 'package:fl_toast/fl_toast.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
+import 'package:reown_appkit_example/services/deep_link_handler.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:reown_appkit/reown_appkit.dart';
@@ -58,15 +59,14 @@ class _MyHomePageState extends State {
final internal = widget.bundleId.endsWith('.internal');
final debug = widget.bundleId.endsWith('.debug');
if (internal || debug || kDebugMode) {
- return 'internal';
+ return '-internal';
}
return '';
}
String _universalLink() {
- // TODO change /flutter_appkit to something else
- Uri link = Uri.parse('https://appkit-lab.reown.com/flutter_appkit');
- if (_flavor.isNotEmpty) {
+ Uri link = Uri.parse('https://appkit-lab.reown.com/flutter_appkit_modal');
+ if (_flavor.isNotEmpty && !kDebugMode) {
return link.replace(path: '${link.path}_internal').toString();
}
return link.toString();
@@ -88,7 +88,7 @@ class _MyHomePageState extends State {
description: StringConstants.pageTitle,
url: _universalLink(),
icons: [
- 'https://docs.walletconnect.com/assets/images/web3modalLogo-2cee77e07851ba0a710b56d03d4d09dd.png'
+ 'https://raw.githubusercontent.com/reown-com/reown_flutter/refs/heads/develop/assets/appkit_logo.png',
],
redirect: _constructRedirect(),
);
@@ -218,7 +218,16 @@ class _MyHomePageState extends State {
metadata: _pairingMetadata(),
siweConfig: _siweConfig(siweAuthValue),
enableAnalytics: analyticsValue, // OPTIONAL - null by default
- enableEmail: emailWalletValue, // OPTIONAL - false by default
+ featuresConfig: FeaturesConfig(
+ email: emailWalletValue,
+ socials: [
+ AppKitSocialOption.Farcaster,
+ AppKitSocialOption.X,
+ AppKitSocialOption.Apple,
+ AppKitSocialOption.Discord,
+ ],
+ showMainWallets: true, // OPTIONAL - true by default
+ ),
// requiredNamespaces: {},
// optionalNamespaces: {},
// includedWalletIds: {},
@@ -263,11 +272,16 @@ class _MyHomePageState extends State {
_appKitModal.appKit!.core.addLogListener(_logListener);
//
await _appKitModal.init();
+
+ DeepLinkHandler.init(_appKitModal);
+ DeepLinkHandler.checkInitialLink();
+
setState(() {});
}
- void _logListener(LogEvent event) {
- if (event.level == Level.debug || event.level == Level.error) {
+ void _logListener(event) {
+ if ('${event.level}' == 'Level.debug' ||
+ '${event.level}' == 'Level.error') {
// TODO send to mixpanel
log('${event.message}');
} else {
@@ -367,6 +381,9 @@ class _MyHomePageState extends State {
@override
Widget build(BuildContext context) {
+ if (!_initialized) {
+ return SizedBox.shrink();
+ }
return Scaffold(
backgroundColor: ReownAppKitModalTheme.colorsOf(context).background125,
appBar: AppBar(
@@ -396,6 +413,7 @@ class _MyHomePageState extends State {
toggleOverlay: _toggleOverlay,
toggleBrightness: widget.toggleBrightness,
toggleTheme: widget.toggleTheme,
+ appKitModal: _appKitModal,
),
),
onEndDrawerChanged: (isOpen) {
@@ -496,6 +514,20 @@ class _ConnectedView extends StatelessWidget {
// },
// ),
),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ AppKitModalBalanceButton(
+ appKitModal: appKit,
+ onTap: appKit.openModalView,
+ ),
+ const SizedBox.square(dimension: 8.0),
+ AppKitModalAddressButton(
+ appKitModal: appKit,
+ onTap: appKit.openModalView,
+ ),
+ ],
+ ),
SessionWidget(appKit: appKit),
const SizedBox.square(dimension: 12.0),
],
diff --git a/packages/reown_appkit/example/modal/lib/main.dart b/packages/reown_appkit/example/modal/lib/main.dart
index f4d292da..7142b461 100644
--- a/packages/reown_appkit/example/modal/lib/main.dart
+++ b/packages/reown_appkit/example/modal/lib/main.dart
@@ -1,10 +1,13 @@
import 'package:flutter/material.dart';
import 'package:reown_appkit_example/home_page.dart';
+import 'package:reown_appkit_example/services/deep_link_handler.dart';
import 'package:reown_appkit_example/utils/constants.dart';
import 'package:reown_appkit/reown_appkit.dart';
import 'package:shared_preferences/shared_preferences.dart';
void main() {
+ WidgetsFlutterBinding.ensureInitialized();
+ DeepLinkHandler.initListener();
runApp(const MyApp());
}
diff --git a/packages/reown_appkit/example/modal/lib/services/deep_link_handler.dart b/packages/reown_appkit/example/modal/lib/services/deep_link_handler.dart
new file mode 100644
index 00000000..afcc105c
--- /dev/null
+++ b/packages/reown_appkit/example/modal/lib/services/deep_link_handler.dart
@@ -0,0 +1,60 @@
+import 'package:flutter/foundation.dart';
+import 'package:flutter/services.dart';
+import 'package:reown_appkit/modal/i_appkit_modal_impl.dart';
+
+class DeepLinkHandler {
+ static const _methodChannel = MethodChannel(
+ 'com.web3modal.flutterExample/methods',
+ );
+ static const _eventChannel = EventChannel(
+ 'com.web3modal.flutterExample/events',
+ );
+ static final waiting = ValueNotifier(false);
+ static late IReownAppKitModal _appKitModal;
+
+ static void initListener() {
+ if (kIsWeb) return;
+ try {
+ _eventChannel.receiveBroadcastStream().listen(
+ _onLink,
+ onError: _onError,
+ );
+ } catch (e) {
+ debugPrint('[SampleModal] initListener $e');
+ }
+ }
+
+ static void init(IReownAppKitModal appKitModal) {
+ if (kIsWeb) return;
+ _appKitModal = appKitModal;
+ }
+
+ static void checkInitialLink() async {
+ if (kIsWeb) return;
+ try {
+ _methodChannel.invokeMethod('initialLink');
+ } catch (e) {
+ debugPrint('[SampleModal] checkInitialLink $e');
+ }
+ }
+
+ static Uri get nativeUri =>
+ Uri.parse(_appKitModal.appKit!.metadata.redirect?.native ?? '');
+ static Uri get universalUri =>
+ Uri.parse(_appKitModal.appKit!.metadata.redirect?.universal ?? '');
+ static String get host => universalUri.host;
+
+ static void _onLink(dynamic link) async {
+ debugPrint('[SampleModal] _onLink $link');
+ if (link == null) return;
+ final handled = await _appKitModal.dispatchEnvelope(link);
+ if (!handled) {
+ debugPrint('[SampleModal] _onLink not handled by AppKit');
+ }
+ }
+
+ static void _onError(dynamic error) {
+ debugPrint('[SampleModal] _onError $error');
+ waiting.value = false;
+ }
+}
diff --git a/packages/reown_appkit/example/modal/lib/services/eip155_service.dart b/packages/reown_appkit/example/modal/lib/services/eip155_service.dart
index 4fd8c3b1..bcc1a3ae 100644
--- a/packages/reown_appkit/example/modal/lib/services/eip155_service.dart
+++ b/packages/reown_appkit/example/modal/lib/services/eip155_service.dart
@@ -66,7 +66,7 @@ class EIP155 {
}
static Future callMethod({
- required ReownAppKitModal appKit,
+ required ReownAppKitModal appKitModal,
required String topic,
required EIP155UIMethods method,
required String chainId,
@@ -76,32 +76,32 @@ class EIP155 {
switch (method) {
case EIP155UIMethods.requestAccounts:
return requestAccounts(
- appKit: appKit,
+ appKitModal: appKitModal,
);
case EIP155UIMethods.personalSign:
return personalSign(
- appKit: appKit,
+ appKitModal: appKitModal,
message: testSignData,
);
case EIP155UIMethods.ethSignTypedDataV3:
return ethSignTypedDataV3(
- appKit: appKit,
+ appKitModal: appKitModal,
data: jsonEncode(typeDataV3(cid)),
);
case EIP155UIMethods.ethSignTypedData:
return ethSignTypedData(
- appKit: appKit,
+ appKitModal: appKitModal,
data: jsonEncode(typedData()),
);
case EIP155UIMethods.ethSignTypedDataV4:
return ethSignTypedDataV4(
- appKit: appKit,
+ appKitModal: appKitModal,
data: jsonEncode(typeDataV4(cid)),
);
case EIP155UIMethods.ethSignTransaction:
case EIP155UIMethods.ethSendTransaction:
return ethSendOrSignTransaction(
- appKit: appKit,
+ appKitModal: appKitModal,
method: method,
transaction: Transaction(
from: EthereumAddress.fromHex(address),
@@ -114,17 +114,17 @@ class EIP155 {
);
case EIP155UIMethods.walletWatchAsset:
return walletWatchAsset(
- appKit: appKit,
+ appKitModal: appKitModal,
);
}
}
static Future requestAccounts({
- required ReownAppKitModal appKit,
+ required ReownAppKitModal appKitModal,
}) async {
- return await appKit.request(
- topic: appKit.session!.topic,
- chainId: appKit.selectedChain!.chainId,
+ return await appKitModal.request(
+ topic: appKitModal.session!.topic,
+ chainId: appKitModal.selectedChain!.chainId,
request: SessionRequestParams(
method: EIP155UIMethods.requestAccounts.name,
params: [],
@@ -133,84 +133,84 @@ class EIP155 {
}
static Future personalSign({
- required ReownAppKitModal appKit,
+ required ReownAppKitModal appKitModal,
required String message,
}) async {
final bytes = utf8.encode(message);
final encoded = hex.encode(bytes);
- return await appKit.request(
- topic: appKit.session!.topic,
- chainId: appKit.selectedChain!.chainId,
+ return await appKitModal.request(
+ topic: appKitModal.session!.topic,
+ chainId: appKitModal.selectedChain!.chainId,
request: SessionRequestParams(
method: EIP155UIMethods.personalSign.name,
params: [
'0x$encoded',
- appKit.session!.address!,
+ appKitModal.session!.address!,
],
),
);
}
static Future ethSignTypedData({
- required ReownAppKitModal appKit,
+ required ReownAppKitModal appKitModal,
required String data,
}) async {
- return await appKit.request(
- topic: appKit.session!.topic,
- chainId: appKit.selectedChain!.chainId,
+ return await appKitModal.request(
+ topic: appKitModal.session!.topic,
+ chainId: appKitModal.selectedChain!.chainId,
request: SessionRequestParams(
method: EIP155UIMethods.ethSignTypedData.name,
params: [
data,
- appKit.session!.address!,
+ appKitModal.session!.address!,
],
),
);
}
static Future ethSignTypedDataV3({
- required ReownAppKitModal appKit,
+ required ReownAppKitModal appKitModal,
required String data,
}) async {
- return await appKit.request(
- topic: appKit.session!.topic,
- chainId: appKit.selectedChain!.chainId,
+ return await appKitModal.request(
+ topic: appKitModal.session!.topic,
+ chainId: appKitModal.selectedChain!.chainId,
request: SessionRequestParams(
method: EIP155UIMethods.ethSignTypedDataV3.name,
params: [
data,
- appKit.session!.address!,
+ appKitModal.session!.address!,
],
),
);
}
static Future ethSignTypedDataV4({
- required ReownAppKitModal appKit,
+ required ReownAppKitModal appKitModal,
required String data,
}) async {
- return await appKit.request(
- topic: appKit.session!.topic,
- chainId: appKit.selectedChain!.chainId,
+ return await appKitModal.request(
+ topic: appKitModal.session!.topic,
+ chainId: appKitModal.selectedChain!.chainId,
request: SessionRequestParams(
method: EIP155UIMethods.ethSignTypedDataV4.name,
params: [
data,
- appKit.session!.address!,
+ appKitModal.session!.address!,
],
),
);
}
static Future ethSendOrSignTransaction({
- required ReownAppKitModal appKit,
+ required ReownAppKitModal appKitModal,
required Transaction transaction,
required EIP155UIMethods method,
}) async {
- return await appKit.request(
- topic: appKit.session!.topic,
- chainId: appKit.selectedChain!.chainId,
+ return await appKitModal.request(
+ topic: appKitModal.session!.topic,
+ chainId: appKitModal.selectedChain!.chainId,
request: SessionRequestParams(
method: method.name,
params: [
@@ -221,11 +221,11 @@ class EIP155 {
}
static Future walletWatchAsset({
- required ReownAppKitModal appKit,
+ required ReownAppKitModal appKitModal,
}) async {
- return await appKit.request(
- topic: appKit.session!.topic,
- chainId: appKit.selectedChain!.chainId,
+ return await appKitModal.request(
+ topic: appKitModal.session!.topic,
+ chainId: appKitModal.selectedChain!.chainId,
request: SessionRequestParams(
method: EIP155UIMethods.walletWatchAsset.name,
params: {
@@ -244,7 +244,7 @@ class EIP155 {
// Example of calling `transfer` function from AAVE token Smart Contract
static Future callTestSmartContract({
- required ReownAppKitModal appKit,
+ required ReownAppKitModal appKitModal,
required String action,
}) async {
// Create DeployedContract object using contract's ABI and address
@@ -259,7 +259,7 @@ class EIP155 {
switch (action) {
case 'read':
return _readSmartContract(
- appKit: appKit,
+ appKitModal: appKitModal,
contract: deployedContract,
);
case 'write':
@@ -276,22 +276,22 @@ class EIP155 {
// );
// we first call `decimals` function, which is a read function,
// to check how much decimal we need to use to parse the amount value
- final decimals = await appKit.requestReadContract(
- topic: appKit.session!.topic,
- chainId: appKit.selectedChain!.chainId,
+ final decimals = await appKitModal.requestReadContract(
+ topic: appKitModal.session!.topic,
+ chainId: appKitModal.selectedChain!.chainId,
deployedContract: deployedContract,
functionName: 'decimals',
);
final d = (decimals.first as BigInt);
final requestValue = _formatValue(0.01, decimals: d);
// now we call `transfer` write function with the parsed value.
- return appKit.requestWriteContract(
- topic: appKit.session!.topic,
- chainId: appKit.selectedChain!.chainId,
+ return appKitModal.requestWriteContract(
+ topic: appKitModal.session!.topic,
+ chainId: appKitModal.selectedChain!.chainId,
deployedContract: deployedContract,
functionName: 'transfer',
transaction: Transaction(
- from: EthereumAddress.fromHex(appKit.session!.address!),
+ from: EthereumAddress.fromHex(appKitModal.session!.address!),
),
parameters: [
EthereumAddress.fromHex(
@@ -327,7 +327,7 @@ class EIP155 {
// Example of calling `transfer` function from USDT token Smart Contract
static Future callUSDTSmartContract({
- required ReownAppKitModal appKit,
+ required ReownAppKitModal appKitModal,
required String action,
}) async {
// Create DeployedContract object using contract's ABI and address
@@ -342,28 +342,28 @@ class EIP155 {
switch (action) {
case 'read':
return _readSmartContract(
- appKit: appKit,
+ appKitModal: appKitModal,
contract: deployedContract,
);
case 'write':
// we first call `decimals` function, which is a read function,
// to check how much decimal we need to use to parse the amount value
- final decimals = await appKit.requestReadContract(
- topic: appKit.session!.topic,
- chainId: appKit.selectedChain!.chainId,
+ final decimals = await appKitModal.requestReadContract(
+ topic: appKitModal.session!.topic,
+ chainId: appKitModal.selectedChain!.chainId,
deployedContract: deployedContract,
functionName: 'decimals',
);
final d = (decimals.first as BigInt);
final requestValue = _formatValue(0.23, decimals: d);
// now we call `transfer` write function with the parsed value.
- return appKit.requestWriteContract(
- topic: appKit.session!.topic,
- chainId: appKit.selectedChain!.chainId,
+ return appKitModal.requestWriteContract(
+ topic: appKitModal.session!.topic,
+ chainId: appKitModal.selectedChain!.chainId,
deployedContract: deployedContract,
functionName: 'transfer',
transaction: Transaction(
- from: EthereumAddress.fromHex(appKit.session!.address!),
+ from: EthereumAddress.fromHex(appKitModal.session!.address!),
),
parameters: [
EthereumAddress.fromHex(
@@ -378,38 +378,38 @@ class EIP155 {
}
static Future _readSmartContract({
- required ReownAppKitModal appKit,
+ required ReownAppKitModal appKitModal,
required DeployedContract contract,
}) async {
final results = await Future.wait([
// results[0]
- appKit.requestReadContract(
- topic: appKit.session!.topic,
- chainId: appKit.selectedChain!.chainId,
+ appKitModal.requestReadContract(
+ topic: appKitModal.session!.topic,
+ chainId: appKitModal.selectedChain!.chainId,
deployedContract: contract,
functionName: 'name',
),
// results[1]
- appKit.requestReadContract(
- topic: appKit.session!.topic,
- chainId: appKit.selectedChain!.chainId,
+ appKitModal.requestReadContract(
+ topic: appKitModal.session!.topic,
+ chainId: appKitModal.selectedChain!.chainId,
deployedContract: contract,
functionName: 'totalSupply',
),
// results[2]
- appKit.requestReadContract(
- topic: appKit.session!.topic,
- chainId: appKit.selectedChain!.chainId,
+ appKitModal.requestReadContract(
+ topic: appKitModal.session!.topic,
+ chainId: appKitModal.selectedChain!.chainId,
deployedContract: contract,
functionName: 'balanceOf',
parameters: [
- EthereumAddress.fromHex(appKit.session!.address!),
+ EthereumAddress.fromHex(appKitModal.session!.address!),
],
),
// results[4]
- appKit.requestReadContract(
- topic: appKit.session!.topic,
- chainId: appKit.selectedChain!.chainId,
+ appKitModal.requestReadContract(
+ topic: appKitModal.session!.topic,
+ chainId: appKitModal.selectedChain!.chainId,
deployedContract: contract,
functionName: 'decimals',
),
diff --git a/packages/reown_appkit/example/modal/lib/widgets/debug_drawer.dart b/packages/reown_appkit/example/modal/lib/widgets/debug_drawer.dart
index 4cc98f10..7db646ee 100644
--- a/packages/reown_appkit/example/modal/lib/widgets/debug_drawer.dart
+++ b/packages/reown_appkit/example/modal/lib/widgets/debug_drawer.dart
@@ -1,24 +1,32 @@
+// ignore_for_file: depend_on_referenced_packages
+
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-// ignore: depend_on_referenced_packages
+
import 'package:package_info_plus/package_info_plus.dart';
import 'package:shared_preferences/shared_preferences.dart';
-import 'package:reown_appkit/version.dart' as apkt;
import 'package:reown_appkit/reown_appkit.dart';
+import 'package:reown_appkit/version.dart' as apkt_v;
+
+import 'package:reown_sign/version.dart' as sign_v;
+import 'package:reown_core/version.dart' as core_v;
+
class DebugDrawer extends StatefulWidget {
const DebugDrawer({
super.key,
required this.toggleOverlay,
required this.toggleBrightness,
required this.toggleTheme,
+ required this.appKitModal,
});
final VoidCallback toggleOverlay;
final VoidCallback toggleBrightness;
final VoidCallback toggleTheme;
+ final ReownAppKitModal appKitModal;
@override
State createState() => _DebugDrawerState();
@@ -234,32 +242,105 @@ class _DebugDrawerState extends State with WidgetsBindingObserver {
],
),
),
- FutureBuilder(
- future: PackageInfo.fromPlatform(),
- builder: (context, snapshot) {
- return InkWell(
- onTap: () {
- Clipboard.setData(
- ClipboardData(
- text:
- '${snapshot.data?.packageName} v${snapshot.data?.version ?? ''} (${snapshot.data?.buildNumber})\n'
- 'AppKit v${apkt.packageVersion}\n'
- 'Core v$packageVersion',
- ),
- );
- },
- child: Text(
- '${snapshot.data?.packageName} v${snapshot.data?.version ?? ''} (${snapshot.data?.buildNumber})\n'
- 'AppKit v${apkt.packageVersion}\n'
- 'Core v$packageVersion',
+ const SizedBox(height: 16.0),
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 12.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ const Text(
+ 'Redirect:',
+ textAlign: TextAlign.left,
style: TextStyle(
fontSize: 12.0,
- color:
- ReownAppKitModalTheme.colorsOf(context).foreground100,
+ fontWeight: FontWeight.bold,
),
),
- );
- },
+ Row(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ const Text(
+ 'Native: ',
+ style: TextStyle(fontSize: 12.0),
+ ),
+ Expanded(
+ child: Text(
+ '${widget.appKitModal.appKit!.metadata.redirect?.native}',
+ style: TextStyle(
+ fontSize: 12.0,
+ fontWeight: FontWeight.bold,
+ color: ReownAppKitModalTheme.colorsOf(context)
+ .foreground100,
+ ),
+ ),
+ ),
+ ],
+ ),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ const Text(
+ 'Universal: ',
+ style: TextStyle(fontSize: 12.0),
+ ),
+ Expanded(
+ child: Text(
+ '${widget.appKitModal.appKit!.metadata.redirect?.universal}',
+ style: TextStyle(
+ fontSize: 12.0,
+ fontWeight: FontWeight.bold,
+ color: ReownAppKitModalTheme.colorsOf(context)
+ .foreground100,
+ ),
+ ),
+ ),
+ ],
+ ),
+ Row(
+ children: [
+ const Text(
+ 'Link Mode: ',
+ style: TextStyle(fontSize: 12.0),
+ ),
+ Text(
+ '${widget.appKitModal.appKit!.metadata.redirect?.linkMode}',
+ style: TextStyle(
+ fontSize: 12.0,
+ fontWeight: FontWeight.bold,
+ color: ReownAppKitModalTheme.colorsOf(context)
+ .foreground100,
+ ),
+ ),
+ ],
+ ),
+ const Divider(height: 10.0),
+ FutureBuilder(
+ future: PackageInfo.fromPlatform(),
+ builder: (context, snapshot) {
+ final versionText =
+ '${snapshot.data?.packageName} v${snapshot.data?.version ?? ''} (${snapshot.data?.buildNumber})\n'
+ 'AppKit v${apkt_v.packageVersion}\n'
+ 'Sign v${sign_v.packageVersion}\n'
+ 'Core v${core_v.packageVersion}';
+ return InkWell(
+ onTap: () => Clipboard.setData(ClipboardData(
+ text: versionText,
+ )),
+ child: Text(
+ versionText,
+ style: TextStyle(
+ fontSize: 12.0,
+ color: ReownAppKitModalTheme.colorsOf(context)
+ .foreground100,
+ ),
+ ),
+ );
+ },
+ ),
+ ],
+ ),
),
const SizedBox.square(dimension: 10.0),
const Divider(height: 1.0, indent: 12.0, endIndent: 12.0),
diff --git a/packages/reown_appkit/example/modal/lib/widgets/session_widget.dart b/packages/reown_appkit/example/modal/lib/widgets/session_widget.dart
index ed8fb458..10728f2e 100644
--- a/packages/reown_appkit/example/modal/lib/widgets/session_widget.dart
+++ b/packages/reown_appkit/example/modal/lib/widgets/session_widget.dart
@@ -165,15 +165,8 @@ class SessionWidgetState extends State {
}
Widget _buildAccountWidget(String account) {
- // final chainId = NamespaceUtils.getChainFromAccount(account);
- // final chainMetadata = ChainDataWrapper.getChainMetadataFromChain(
- // chainId.split(':').first,
- // chainId.split(':').last,
- // );
-
final List children = [
Text(
- // chainMetadata.appKitNetworkInfo.name,
widget.appKit.selectedChain?.name ?? 'Unsupported chain',
style: ReownAppKitModalTheme.getDataOf(context)
.textStyles
@@ -271,12 +264,9 @@ class SessionWidgetState extends State {
onPressed: implemented
? () async {
widget.appKit.launchConnectedWallet();
- final future = callChainMethod(
- // chainMetadata.type,
- EIP155.methodFromName(method)
- // chainMetadata,
- // address,
- );
+ final future = callChainMethod(EIP155.methodFromName(
+ method,
+ ));
MethodDialog.show(context, method, future);
}
: null,
@@ -315,7 +305,7 @@ class SessionWidgetState extends State {
onPressed: onSepolia
? () async {
final future = EIP155.callTestSmartContract(
- appKit: widget.appKit,
+ appKitModal: widget.appKit,
action: 'read',
);
MethodDialog.show(
@@ -327,7 +317,7 @@ class SessionWidgetState extends State {
: onMainnet
? () async {
final future = EIP155.callUSDTSmartContract(
- appKit: widget.appKit,
+ appKitModal: widget.appKit,
action: 'read',
);
MethodDialog.show(
@@ -352,7 +342,7 @@ class SessionWidgetState extends State {
? () async {
widget.appKit.launchConnectedWallet();
final future = EIP155.callTestSmartContract(
- appKit: widget.appKit,
+ appKitModal: widget.appKit,
action: 'write',
);
MethodDialog.show(context, 'Test Contract (Write)', future);
@@ -361,7 +351,7 @@ class SessionWidgetState extends State {
? () async {
widget.appKit.launchConnectedWallet();
final future = EIP155.callUSDTSmartContract(
- appKit: widget.appKit,
+ appKitModal: widget.appKit,
action: 'write',
);
MethodDialog.show(
@@ -457,15 +447,10 @@ class SessionWidgetState extends State {
);
}
- Future callChainMethod(
- // ChainType type,
- EIP155UIMethods method,
- // ChainMetadata chainMetadata,
- // String address,
- ) {
+ Future callChainMethod(EIP155UIMethods method) {
final session = widget.appKit.session!;
return EIP155.callMethod(
- appKit: widget.appKit,
+ appKitModal: widget.appKit,
topic: session.topic ?? '',
method: method,
chainId: widget.appKit.selectedChain!.chainId,
diff --git a/packages/reown_appkit/generate_files.sh b/packages/reown_appkit/generate_files.sh
index 2356ead3..b1b02877 100644
--- a/packages/reown_appkit/generate_files.sh
+++ b/packages/reown_appkit/generate_files.sh
@@ -20,6 +20,7 @@ dart run dependency_validator
cd ios
+# rm Podfile.lock
# pod deintegrate
# pod cache clean -all
pod install
@@ -42,6 +43,7 @@ dart run dependency_validator
cd ios
+# rm Podfile.lock
# pod deintegrate
# pod cache clean -all
pod install
diff --git a/packages/reown_appkit/lib/appkit_modal.dart b/packages/reown_appkit/lib/appkit_modal.dart
index 04bc6714..b9f37fb7 100644
--- a/packages/reown_appkit/lib/appkit_modal.dart
+++ b/packages/reown_appkit/lib/appkit_modal.dart
@@ -5,20 +5,20 @@
// platforms in the `pubspec.yaml` at
// https://flutter.dev/docs/development/packages-and-plugins/developing-packages#plugin-platforms.
-/// Models
+// Models
export 'modal/models/public/appkit_modal_models.dart';
-/// Theme
+// Theme
export 'modal/theme/public/appkit_modal_theme.dart';
-/// Utils
+// Utils
export 'modal/utils/public/appkit_modal_utils.dart';
-/// Widgets
+// Widgets
export 'modal/widgets/public/appkit_modal_widgets.dart';
-/// Pages
+// Pages
export 'modal/pages/public/appkit_modal_pages.dart';
-/// Services
+// Services
export 'modal/appkit_modal_impl.dart';
diff --git a/packages/reown_appkit/lib/base/appkit_base_impl.dart b/packages/reown_appkit/lib/base/appkit_base_impl.dart
index fba8eedb..a4ce1eca 100644
--- a/packages/reown_appkit/lib/base/appkit_base_impl.dart
+++ b/packages/reown_appkit/lib/base/appkit_base_impl.dart
@@ -3,7 +3,9 @@ import 'package:reown_core/relay_client/websocket/http_client.dart';
import 'package:reown_core/store/generic_store.dart';
import 'package:reown_core/store/i_generic_store.dart';
+/// Base class that containes Core and SIgn used dapps developers to create UI-less interaction with WalletConnect protocol
class ReownAppKit implements IReownAppKit {
+ ///
static const List> DEFAULT_METHODS = [
[
MethodConstants.WC_SESSION_PROPOSE,
@@ -17,6 +19,7 @@ class ReownAppKit implements IReownAppKit {
bool _initialized = false;
+ /// Creates a instance of ReownAppKit to be used alone or to pass to ReownAppKitModal
static Future createInstance({
required String projectId,
String relayUrl = ReownConstants.DEFAULT_RELAY_URL,
@@ -54,6 +57,7 @@ class ReownAppKit implements IReownAppKit {
@override
final PairingMetadata metadata;
+ ///
ReownAppKit({
required this.core,
required this.metadata,
diff --git a/packages/reown_appkit/lib/base/i_appkit_base_impl.dart b/packages/reown_appkit/lib/base/i_appkit_base_impl.dart
index 929e00af..9bfb963c 100644
--- a/packages/reown_appkit/lib/base/i_appkit_base_impl.dart
+++ b/packages/reown_appkit/lib/base/i_appkit_base_impl.dart
@@ -1,9 +1,14 @@
import 'package:reown_sign/i_sign_dapp.dart';
import 'package:reown_sign/reown_sign.dart';
+///
abstract class IReownAppKit implements IReownSignDapp {
+ ///
final String protocol = 'wc';
+
+ ///
final int version = 2;
+ ///
abstract final IReownSign reOwnSign;
}
diff --git a/packages/reown_appkit/lib/modal/appkit_modal_impl.dart b/packages/reown_appkit/lib/modal/appkit_modal_impl.dart
index 32b6fbb4..1395a06f 100644
--- a/packages/reown_appkit/lib/modal/appkit_modal_impl.dart
+++ b/packages/reown_appkit/lib/modal/appkit_modal_impl.dart
@@ -1,21 +1,21 @@
import 'dart:async';
import 'dart:convert';
import 'dart:math';
-import 'dart:developer' as dev;
import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
+import 'package:get_it/get_it.dart';
+import 'package:reown_appkit/modal/services/magic_service/i_magic_service.dart';
+import 'package:reown_core/store/i_store.dart';
+
+import 'package:reown_appkit/reown_appkit.dart';
import 'package:reown_appkit/modal/services/uri_service/launch_url_exception.dart';
import 'package:reown_appkit/modal/services/uri_service/url_utils.dart';
import 'package:reown_appkit/modal/services/uri_service/url_utils_singleton.dart';
import 'package:reown_appkit/modal/utils/core_utils.dart';
import 'package:reown_appkit/modal/utils/platform_utils.dart';
-import 'package:reown_appkit/reown_appkit.dart';
-import 'package:reown_core/store/i_store.dart';
-import 'package:url_launcher/url_launcher.dart';
import 'package:reown_appkit/modal/constants/key_constants.dart';
-
import 'package:reown_appkit/modal/constants/string_constants.dart';
import 'package:reown_appkit/modal/pages/account_page.dart';
import 'package:reown_appkit/modal/pages/approve_magic_request_page.dart';
@@ -32,7 +32,6 @@ import 'package:reown_appkit/modal/services/explorer_service/explorer_service.da
import 'package:reown_appkit/modal/services/explorer_service/explorer_service_singleton.dart';
import 'package:reown_appkit/modal/services/explorer_service/models/redirect.dart';
import 'package:reown_appkit/modal/services/magic_service/magic_service.dart';
-import 'package:reown_appkit/modal/services/magic_service/magic_service_singleton.dart';
import 'package:reown_appkit/modal/services/magic_service/models/magic_data.dart';
import 'package:reown_appkit/modal/services/magic_service/models/magic_events.dart';
import 'package:reown_appkit/modal/services/siwe_service/siwe_service.dart';
@@ -55,6 +54,7 @@ class ReownAppKitModal with ChangeNotifier implements IReownAppKitModal {
Map _optionalNamespaces = {};
String? _lastChainEmitted;
bool _supportsOneClickAuth = false;
+ bool _serviceInitialized = false;
ReownAppKitModalStatus _status = ReownAppKitModalStatus.idle;
@override
@@ -93,10 +93,9 @@ class ReownAppKitModal with ChangeNotifier implements IReownAppKitModal {
String? get avatarUrl => _avatarUrl;
double? _chainBalance;
+ @Deprecated('Use balanceNotifier')
@override
- String get chainBalance {
- return CoreUtils.formatChainBalance(_chainBalance);
- }
+ String get chainBalance => CoreUtils.formatChainBalance(_chainBalance);
@override
final balanceNotifier = ValueNotifier('-.--');
@@ -113,8 +112,6 @@ class ReownAppKitModal with ChangeNotifier implements IReownAppKitModal {
@override
ReownAppKitModalSession? get session => _currentSession;
- Logger get _logger => _appKit.core.logger;
-
IStore