deriveAccountId method

String deriveAccountId(
  1. String owner
)

The owner's canonical ACCOUNT id — a different derived object from the wrapper. The session grants hang off this one, so this is what deriveSessionsFieldId and decodeSessions work from.

Implementation

String deriveAccountId(String owner) {
  // `AccountKey(owner)` is a one-field positional struct: 32 bytes.
  final key = Uint8List.fromList(
      account_registry.AccountKey.serialize([owner]).toBytes());
  return deriveObjectID(
    _config.accountRegistry,
    '${_config.accountPackageId}::account_registry::AccountKey',
    key,
  );
}