UserOperation.register constructor
UserOperation.register(
- String domainName,
- PublicKey owner,
- SubtreePolicies subtreePolicies,
- String data,
- int expiresAtHeight,
Implementation
factory UserOperation.register(
String domainName,
PublicKey owner,
SubtreePolicies subtreePolicies,
String data,
int expiresAtHeight,
) {
final nativeDomainName = domainName.toNativeUtf8();
final nativeOwner = owner.toString().toNativeUtf8();
final nativeData = data.toNativeUtf8();
try {
final op = DartApi.native.coeusUserOperation
.opRegister(nativeDomainName, nativeOwner, subtreePolicies._ffi,
nativeData, expiresAtHeight)
.extract((res) => res.asPointer<Void>());
return UserOperation(op, true);
} finally {
calloc.free(nativeData);
calloc.free(nativeOwner);
calloc.free(nativeDomainName);
}
}