loadKeys method

Future<Either<Exception, KeyPair>> loadKeys(
  1. String keyfile,
  2. String password
)

Implementation

Future<Either<Exception, KeyPair>> loadKeys(
    String keyfile, String password) async {
  try {
    final wallet = await readInputFile(keyfile);
    if (wallet.isLeft) {
      return Either.left(wallet.left);
    }
    final keyPair =
        walletApi.extractMainKey(wallet.get(), utf8.encode(password));
    return keyPair;
  } catch (e) {
    return Either.left(
        WalletApiFailure.failedToLoadWallet(context: e.toString()));
  }
}