updateUser method
Implementation
Future<String> updateUser({
required String userId,
required String operator,
String? defaultCurrency,
String? contextId,
List<AccountRef> accounts = const [],
}) async {
final dynamic builder = DocumentUpdate(AccountSet());
builder.id(Uuid.parse(userId));
if (defaultCurrency != null) {
builder.defaultCurrency(defaultCurrency);
}
if (accounts.isNotEmpty) {
builder.accounts(accounts);
}
final request = AccountSetExt.updateRequest(builder);
final client = getServiceClient(operator);
final envelop = await requestEnvelope(
request: request,
contextId: contextId != null ? hex.decode(contextId) : null,
);
await client.tx.createTransaction(envelop);
return userId;
}