requestAccount method

Future<List<String>> requestAccount()

Request/Enable the accounts from the current environment.

Returns List of accounts the node controls.

This method will only work if you’re using the injected provider from a application like Metamask, Status or TrustWallet.

It doesn’t work if you’re connected to a node with a default Web3.js provider (WebsocketProvider, HttpProvidder and IpcProvider).

Implementation

Future<List<String>> requestAccount() async =>
    (await request<List<dynamic>>('eth_requestAccounts'))
        .map((e) => e.toString())
        .toList();