AuthClient.fromJson constructor

AuthClient.fromJson(
  1. String scheme,
  2. AuthFunction authFunction,
  3. Map<String, dynamic> map,
  4. Uri? authUri,
)

Implementation

factory AuthClient.fromJson(
  String scheme,
  AuthFunction authFunction,
  Map<String, dynamic> map,
  Uri? authUri,
) {
  final fromStorageResult = AuthClient.fromStorage(jsonEncode(map));
  final Identity? identity = fromStorageResult.delegationIdentity;

  return AuthClient(
    scheme: scheme,
    authFunction: authFunction,
    identity: identity ?? const AnonymousIdentity(),
    key: fromStorageResult.signIdentity,
    chain: fromStorageResult.delegationChain,
    authUri: authUri,
  );
}