changeName method

Future<KeyPairData> changeName(
  1. Keyring keyring,
  2. String name
)

change name of account

Implementation

Future<KeyPairData> changeName(Keyring keyring, String name) async {
  final json = keyring.current.toJson();
  // update json meta data
  service!.updateKeyPairMetaData(json, name);
  // update keyPair date in storage
  keyring.store.updateAccount(json);
  return KeyPairData.fromJson(json);
}