code: def to_dict(self) -> Dict:
          
          if not self.non_closing_signature:
              raise ValueError('onchain_balance_proof needs to be signed')
          if not self.reward_proof_signature:
              raise ValueError('monitoring request needs to be signed')
          return {
              'type': self.__class__.__name__,
              'onchain_balance_proof': self.balance_proof.to_dict(),
              'reward_amount': str(self.reward_amount),
              'non_closing_signature': encode_hex(self.non_closing_signature),
              'reward_proof_signature': encode_hex(self.reward_proof_signature),
          }
docs: Message format according to monitoring service spec