pub fn write_optional_bool( writer: &mut impl Write, v: Option<bool>, ) -> Result<(), WalletError>
Write an optional bool: 0x00=false, 0x01=true, 0xFF=none.