connect method

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

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

Future<Map<String, dynamic>> connect({
  final bool? onlyIfTrusted,
}) => _send(request(ProviderRequest(
    method: 'connect',
    params: ConnectParams(
      onlyIfTrusted: onlyIfTrusted ?? false,
    ),
  )));