signWitnessRequest method

Signed<WitnessRequest> signWitnessRequest(
  1. KeyId id,
  2. WitnessRequest request
)

Implementation

Ssi.Signed<Ssi.WitnessRequest> signWitnessRequest(
    KeyId id, Ssi.WitnessRequest request) {
  final requestString = json.encode(request.toJson());
  final nativeRequest = requestString.toNativeUtf8();
  try {
    final signedFfi = DartApi.native.morpheusPrivate
        .signWitnessRequest(_ffi, id.ffi, nativeRequest)
        .extract((resp) => resp.asPointer<Void>());
    return _toSsiSignedTyped(signedFfi, request);
  } finally {
    calloc.free(nativeRequest);
  }
}