connect method

  1. @override
Future<Map<String, dynamic>> connect({
  1. bool? onlyIfTrusted,
})
override

Makes a request to connect the wallet provider.

After a web application connects to Phantom for the first time, it becomes trusted. Once trusted, it's possible for the application to automatically connect to Phantom on subsequent visits or page refreshes, without prompting the user for permission. This is referred to as "eagerly connecting". To implement this, applications should pass an onlyIfTrusted option into the connect() call.

Implementation

@override
Future<Map<String, dynamic>> connect({final bool? onlyIfTrusted}) async {
  await super.connect(onlyIfTrusted: onlyIfTrusted);
  final key = DesktopBrowserSession.pubkeyKey;
  return { key: object()?[key] };
}