authenticateIfNeeded method

void authenticateIfNeeded(
  1. String relayUrl,
  2. List<Account> accounts
)

Opens the bound connections a subscription will need, so the re-route on auth-required does not have to open a socket first.

Implementation

void authenticateIfNeeded(String relayUrl, List<Account> accounts) {
  for (final account in accounts.where((a) => a.signer.canSign())) {
    unawaited(openConnectionAs(relayUrl, account));
  }
}