addAccount method

  1. @override
Future<void> addAccount(
  1. Uint8List newAccountPrivateKey, {
  2. bool allowReassignInboxId = false,
})
override

Add a new account to the inbox

Implementation

@override
Future<void> addAccount(Uint8List newAccountPrivateKey, {bool allowReassignInboxId = false}) async {
  try {
    final params = <String, dynamic>{
      'newAccountPrivateKey': newAccountPrivateKey.toList(),
      'allowReassignInboxId': allowReassignInboxId,
    }.jsify() as JSObject;

    await _promiseToFuture(
      _clientManager.addAccount(params),
    );
  } catch (e) {
    throw Exception('Failed to add account: $e');
  }
}