getConstantInfo method
Get constant metadata information
Returns information about a constant without decoding its value
Implementation
ConstantInfo? getConstantInfo(String palletName, String constantName) {
final pallet = registry.palletByName(palletName);
if (pallet == null) return null;
final constant = pallet.constants.firstWhere(
(c) => c.name == constantName,
orElse: () =>
throw MetadataException('Constant $constantName not found in pallet $palletName'),
);
final type = registry.typeById(constant.type);
return ConstantInfo(
name: constant.name,
type: type,
typeId: constant.type,
value: Uint8List.fromList(constant.value),
docs: constant.docs,
palletName: palletName,
);
}