Implementation
createAccount({required String password, HandleKeysCallback? onKeysGenerated}) async {
// Set status to loading
change(null, status: RxStatus.loading());
_stopwatch.start();
Timer.periodic(const Duration(milliseconds: 125), _handleTimer);
// Create account
try {
final res = await MotorFlutter.to.createAccount(password, onKeysGenerated: onKeysGenerated);
// Set account address
_closeTimer();
accountAddress(res.owner);
change(res, status: RxStatus.success());
} catch (e) {
_closeTimer();
change(null, status: RxStatus.error("Internal Error - Failed to create account"));
return;
}
}