getSysvarRentDecoder function
Returns a fixed-size decoder for the SysvarRent sysvar.
Implementation
FixedSizeDecoder<SysvarRent> getSysvarRentDecoder() {
final structDecoder =
getStructDecoder([
('lamportsPerByteYear', getDefaultLamportsDecoder()),
('exemptionThreshold', getF64Decoder()),
('burnPercent', getU8Decoder()),
])
as FixedSizeDecoder<Map<String, Object?>>;
return FixedSizeDecoder<SysvarRent>(
fixedSize: sysvarRentSize,
read: (bytes, offset) {
final (map, newOffset) = structDecoder.read(bytes, offset);
return (
SysvarRent(
lamportsPerByteYear: map['lamportsPerByteYear']! as Lamports,
exemptionThreshold: map['exemptionThreshold']! as double,
burnPercent: map['burnPercent']! as int,
),
newOffset,
);
},
);
}