createFromKeys static method

Future<Client> createFromKeys(
  1. Api api,
  2. PrivateKeyBundle keys, {
  3. List<Codec<Object>> customCodecs = const [],
})

This creates a new Client using the saved keys from a previously successful authentication.

Implementation

static Future<Client> createFromKeys(
  Api api,
  xmtp.PrivateKeyBundle keys, {
  List<Codec> customCodecs = const [],
}) async {
  var address = keys.wallet;
  var client = await _createUninitialized(api, address, customCodecs);
  await client._auth.authenticateWithKeys(keys);
  await client._contacts.ensureSavedContact(client._auth.keys);
  return client;
}