MorpheusOperationBuilder.create constructor

MorpheusOperationBuilder.create(
  1. Did did,
  2. String? lastTxId
)

Implementation

factory MorpheusOperationBuilder.create(Did did, String? lastTxId) {
  final nativeTxId = lastTxId != null ? lastTxId.toNativeUtf8() : nullptr;
  try {
    final builder = DartApi.native.morpheusOperationBuilder
        .create(did.ffi, nativeTxId)
        .extract((res) => res.asPointer<Void>());
    return MorpheusOperationBuilder(builder, true);
  } finally {
    if (nativeTxId != nullptr) {
      calloc.free(nativeTxId);
    }
  }
}