signWitnessStatement method

Signed<WitnessStatement> signWitnessStatement(
  1. KeyId id,
  2. WitnessStatement statement
)

Implementation

Ssi.Signed<Ssi.WitnessStatement> signWitnessStatement(
    KeyId id, Ssi.WitnessStatement statement) {
  final statementString = json.encode(statement.toJson());
  final nativeStatement = statementString.toNativeUtf8();
  try {
    final signedFfi = DartApi.native.morpheusPrivate
        .signWitnessStatement(_ffi, id.ffi, nativeStatement)
        .extract((resp) => resp.asPointer<Void>());
    return _toSsiSignedTyped(signedFfi, statement);
  } finally {
    calloc.free(nativeStatement);
  }
}