code: def process_agreement_events_consumer(publisher_address, agreement_id, did, service_agreement,
                                        price, consumer_account, condition_ids,
                                        consume_callback):
      
      conditions_dict = service_agreement.condition_by_name
      events_manager = EventsManager.get_instance(Keeper.get_instance())
      events_manager.watch_agreement_created_event(
          agreement_id,
          lock_reward_condition.fulfillLockRewardCondition,
          None,
          (agreement_id, price, consumer_account),
          EVENT_WAIT_TIMEOUT,
      )
  
      if consume_callback:
          def _refund_callback(_price, _publisher_address, _condition_ids):
              def do_refund(_event, _agreement_id, _did, _service_agreement, _consumer_account, *_):
                  escrow_reward_condition.refund_reward(
                      _event, _agreement_id, _did, _service_agreement, _price,
                      _consumer_account, _publisher_address, _condition_ids
                  )
  
              return do_refund
  
          events_manager.watch_access_event(
              agreement_id,
              escrow_reward_condition.consume_asset,
              _refund_callback(price, publisher_address, condition_ids),
              (agreement_id, did, service_agreement, consumer_account, consume_callback),
              conditions_dict['accessSecretStore'].timeout
          )
docs: Process the agreement events during the register of the service agreement for the consumer side.
  
      :param publisher_address: ethereum account address of publisher, hex str
      :param agreement_id: id of the agreement, hex str
      :param did: DID, str
      :param service_agreement: ServiceAgreement instance
      :param price: Asset price, int
      :param consumer_account: Account instance of the consumer
      :param condition_ids: is a list of bytes32 content-addressed Condition IDs, bytes32
      :param consume_callback:
      :return: