fromArkPassphrase static method

SecpPrivateKey fromArkPassphrase(
  1. String passphrase
)

Implementation

static SecpPrivateKey fromArkPassphrase(String passphrase) {
  final nativePassphrase = passphrase.toNativeUtf8();
  try {
    final ffiSk = DartApi.native.secpPrivateKey
        .fromArkPassphrase(nativePassphrase)
        .extract((resp) => resp.asPointer<Void>());
    return SecpPrivateKey(ffiSk, true);
  } finally {
    calloc.free(nativePassphrase);
  }
}