prediction-market-agent-tooling 0.57.2__py3-none-any.whl → 0.57.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -594,7 +594,7 @@ class RealityQuestion(BaseModel):
594
594
  updatedTimestamp: int
595
595
  contentHash: HexBytes
596
596
  questionId: HexBytes # This is the `id` on question from omen subgraph.
597
- answerFinalizedTimestamp: int
597
+ answerFinalizedTimestamp: int | None
598
598
  currentScheduledFinalizationTimestamp: int
599
599
 
600
600
  @property
@@ -602,8 +602,12 @@ class RealityQuestion(BaseModel):
602
602
  return DatetimeUTC.to_datetime_utc(self.updatedTimestamp)
603
603
 
604
604
  @property
605
- def answer_finalized_datetime(self) -> DatetimeUTC:
606
- return DatetimeUTC.to_datetime_utc(self.answerFinalizedTimestamp)
605
+ def answer_finalized_datetime(self) -> DatetimeUTC | None:
606
+ return (
607
+ DatetimeUTC.to_datetime_utc(self.answerFinalizedTimestamp)
608
+ if self.answerFinalizedTimestamp is not None
609
+ else None
610
+ )
607
611
 
608
612
  @property
609
613
  def current_scheduled_finalization_datetime(self) -> DatetimeUTC:
@@ -565,13 +565,18 @@ class OmenAgentMarket(AgentMarket):
565
565
  omen_markets: dict[HexBytes, OmenMarket] = {
566
566
  m.condition.id: m
567
567
  for m in sgh.get_omen_binary_markets(
568
- limit=sys.maxsize,
568
+ limit=None,
569
569
  condition_id_in=list(omen_positions_dict.keys()),
570
570
  )
571
571
  }
572
+
572
573
  if len(omen_markets) != len(omen_positions_dict):
574
+ missing_conditions_ids = set(
575
+ omen_position.position.condition_id for omen_position in omen_positions
576
+ ) - set(market.condition.id for market in omen_markets.values())
573
577
  raise ValueError(
574
- f"Number of condition ids for markets {len(omen_markets)} and positions {len(omen_positions_dict)} are not equal."
578
+ f"Number of condition ids for markets {len(omen_markets)} and positions {len(omen_positions_dict)} are not equal. "
579
+ f"Missing condition ids: {missing_conditions_ids}"
575
580
  )
576
581
 
577
582
  positions = []
@@ -214,6 +214,7 @@ class OmenSubgraphHandler(BaseSubgraphHandler):
214
214
  question_finalized_before: DatetimeUTC | None,
215
215
  question_finalized_after: DatetimeUTC | None,
216
216
  question_with_answers: bool | None,
217
+ question_pending_arbitration: bool | None,
217
218
  question_id: HexBytes | None,
218
219
  question_id_in: list[HexBytes] | None,
219
220
  question_current_answer_before: DatetimeUTC | None,
@@ -226,7 +227,6 @@ class OmenSubgraphHandler(BaseSubgraphHandler):
226
227
  category: str | None,
227
228
  ) -> dict[str, t.Any]:
228
229
  where_stms: dict[str, t.Any] = {
229
- "isPendingArbitration": False,
230
230
  "outcomes": outcomes,
231
231
  "title_not": None,
232
232
  "condition_": {},
@@ -239,6 +239,7 @@ class OmenSubgraphHandler(BaseSubgraphHandler):
239
239
  finalized_before=question_finalized_before,
240
240
  finalized_after=question_finalized_after,
241
241
  with_answers=question_with_answers,
242
+ pending_arbitration=question_pending_arbitration,
242
243
  current_answer_before=question_current_answer_before,
243
244
  question_id_in=question_id_in,
244
245
  excluded_titles=question_excluded_titles,
@@ -377,6 +378,7 @@ class OmenSubgraphHandler(BaseSubgraphHandler):
377
378
  question_finalized_before: DatetimeUTC | None = None,
378
379
  question_finalized_after: DatetimeUTC | None = None,
379
380
  question_with_answers: bool | None = None,
381
+ question_pending_arbitration: bool | None = None,
380
382
  question_id: HexBytes | None = None,
381
383
  question_id_in: list[HexBytes] | None = None,
382
384
  question_current_answer_before: DatetimeUTC | None = None,
@@ -406,6 +408,7 @@ class OmenSubgraphHandler(BaseSubgraphHandler):
406
408
  question_finalized_before=question_finalized_before,
407
409
  question_finalized_after=question_finalized_after,
408
410
  question_with_answers=question_with_answers,
411
+ question_pending_arbitration=question_pending_arbitration,
409
412
  question_id=question_id,
410
413
  question_id_in=question_id_in,
411
414
  question_current_answer_before=question_current_answer_before,
@@ -654,6 +657,7 @@ class OmenSubgraphHandler(BaseSubgraphHandler):
654
657
  finalized_before: DatetimeUTC | None,
655
658
  finalized_after: DatetimeUTC | None,
656
659
  with_answers: bool | None,
660
+ pending_arbitration: bool | None,
657
661
  question_id: HexBytes | None,
658
662
  question_id_in: list[HexBytes] | None,
659
663
  opened_before: t.Optional[DatetimeUTC],
@@ -700,9 +704,12 @@ class OmenSubgraphHandler(BaseSubgraphHandler):
700
704
 
701
705
  if with_answers is not None:
702
706
  if with_answers:
703
- where_stms["answerFinalizedTimestamp_not"] = None
707
+ where_stms["currentAnswer_not"] = None
704
708
  else:
705
- where_stms["answerFinalizedTimestamp"] = None
709
+ where_stms["currentAnswer"] = None
710
+
711
+ if pending_arbitration is not None:
712
+ where_stms["isPendingArbitration"] = pending_arbitration
706
713
 
707
714
  if question_id_in is not None:
708
715
  # Be aware: On Omen subgraph, question's `id` represents `questionId` on reality subgraph. And `id` on reality subraph is just a weird concat of multiple things from the question.
@@ -720,6 +727,7 @@ class OmenSubgraphHandler(BaseSubgraphHandler):
720
727
  finalized_before: DatetimeUTC | None,
721
728
  finalized_after: DatetimeUTC | None,
722
729
  with_answers: bool | None,
730
+ pending_arbitration: bool | None,
723
731
  question_id: HexBytes | None,
724
732
  question_id_in: list[HexBytes] | None,
725
733
  opened_before: t.Optional[DatetimeUTC],
@@ -732,7 +740,7 @@ class OmenSubgraphHandler(BaseSubgraphHandler):
732
740
  where_stms: dict[str, t.Any] = {}
733
741
 
734
742
  if question_id is not None:
735
- where_stms["questionId"] = question_id.hex()
743
+ where_stms["id"] = question_id.hex()
736
744
 
737
745
  if current_answer_before is not None:
738
746
  where_stms["currentAnswerTimestamp_lt"] = to_int_timestamp(
@@ -757,9 +765,12 @@ class OmenSubgraphHandler(BaseSubgraphHandler):
757
765
 
758
766
  if with_answers is not None:
759
767
  if with_answers:
760
- where_stms["answerFinalizedTimestamp_not"] = None
768
+ where_stms["currentAnswer_not"] = None
761
769
  else:
762
- where_stms["answerFinalizedTimestamp"] = None
770
+ where_stms["currentAnswer"] = None
771
+
772
+ if pending_arbitration is not None:
773
+ where_stms["isPendingArbitration"] = pending_arbitration
763
774
 
764
775
  if question_id_in is not None:
765
776
  # Be aware: On Omen subgraph, question's `id` represents `questionId` on reality subgraph. And `id` on reality subraph is just a weird concat of multiple things from the question.
@@ -780,6 +791,7 @@ class OmenSubgraphHandler(BaseSubgraphHandler):
780
791
  finalized_before: DatetimeUTC | None = None,
781
792
  finalized_after: DatetimeUTC | None = None,
782
793
  with_answers: bool | None = None,
794
+ pending_arbitration: bool | None = None,
783
795
  question_id_in: list[HexBytes] | None = None,
784
796
  question_id: HexBytes | None = None,
785
797
  opened_before: DatetimeUTC | None = None,
@@ -792,6 +804,7 @@ class OmenSubgraphHandler(BaseSubgraphHandler):
792
804
  finalized_before=finalized_before,
793
805
  finalized_after=finalized_after,
794
806
  with_answers=with_answers,
807
+ pending_arbitration=pending_arbitration,
795
808
  current_answer_before=current_answer_before,
796
809
  question_id_in=question_id_in,
797
810
  question_id=question_id,
@@ -834,6 +847,7 @@ class OmenSubgraphHandler(BaseSubgraphHandler):
834
847
  question_finalized_before: t.Optional[DatetimeUTC] = None,
835
848
  question_finalized_after: t.Optional[DatetimeUTC] = None,
836
849
  question_with_answers: bool | None = None,
850
+ question_pending_arbitration: bool | None = None,
837
851
  question_id: HexBytes | None = None,
838
852
  question_id_in: list[HexBytes] | None = None,
839
853
  question_current_answer_before: DatetimeUTC | None = None,
@@ -853,6 +867,7 @@ class OmenSubgraphHandler(BaseSubgraphHandler):
853
867
  finalized_before=question_finalized_before,
854
868
  finalized_after=question_finalized_after,
855
869
  with_answers=question_with_answers,
870
+ pending_arbitration=question_pending_arbitration,
856
871
  current_answer_before=question_current_answer_before,
857
872
  question_id_in=question_id_in,
858
873
  excluded_titles=question_excluded_titles,
@@ -297,12 +297,15 @@ def send_xdai_to(
297
297
  from_private_key: PrivateKey,
298
298
  to_address: ChecksumAddress,
299
299
  value: Wei,
300
+ data_text: Optional[str] = None,
300
301
  tx_params: Optional[TxParams] = None,
301
302
  timeout: int = 180,
302
303
  ) -> TxReceipt:
303
304
  from_address = private_key_to_public_key(from_private_key)
304
305
 
305
306
  tx_params_new: TxParams = {"value": value, "to": to_address}
307
+ if data_text is not None:
308
+ tx_params_new["data"] = Web3.to_bytes(text=data_text)
306
309
  if tx_params:
307
310
  tx_params_new.update(tx_params)
308
311
  tx_params_new = _prepare_tx_params(web3, from_address, tx_params=tx_params_new)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prediction-market-agent-tooling
3
- Version: 0.57.2
3
+ Version: 0.57.4
4
4
  Summary: Tools to benchmark, deploy and monitor prediction market agents.
5
5
  Author: Gnosis
6
6
  Requires-Python: >=3.10,<3.12
@@ -45,11 +45,11 @@ prediction_market_agent_tooling/markets/metaculus/api.py,sha256=4TRPGytQQbSdf42D
45
45
  prediction_market_agent_tooling/markets/metaculus/data_models.py,sha256=Suxa7xELdYuFNKqvGvFh8qyfVtAg79E-vaQ6dqNZOtA,3261
46
46
  prediction_market_agent_tooling/markets/metaculus/metaculus.py,sha256=86TIx6cavEWc8Cv4KpZxSvwiSw9oFybXE3YB49pg-CA,4377
47
47
  prediction_market_agent_tooling/markets/omen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
- prediction_market_agent_tooling/markets/omen/data_models.py,sha256=MBaWnUDGjYzbnDOHKPGrhAn0CP7iETVmsulRPqTf00I,28270
49
- prediction_market_agent_tooling/markets/omen/omen.py,sha256=jrpfeMk8SUwk1p5QWCOm3Qt9HOHsux7DIBm77WRHqW4,51582
48
+ prediction_market_agent_tooling/markets/omen/data_models.py,sha256=javEACWZL-9y-BaFpyXu-Rl0tQJxMlOWu_vZ89nqK8w,28387
49
+ prediction_market_agent_tooling/markets/omen/omen.py,sha256=zmERtzp1JNsd-8Bo-chnj30MDJX3rfLc3JPEHObaFFY,51851
50
50
  prediction_market_agent_tooling/markets/omen/omen_contracts.py,sha256=baXJwk-jSI3-FV-k239oCNOA4oKz6LT47juX8AKpW3A,28297
51
51
  prediction_market_agent_tooling/markets/omen/omen_resolving.py,sha256=iDWdjICGkt968exwCjY-6nsnQyrrNAg3YjnDdP430GQ,9415
52
- prediction_market_agent_tooling/markets/omen/omen_subgraph_handler.py,sha256=IsnWiVSmaR5I82D49MpJpRu7uE-wkMEgubsLzt0qZVI,38125
52
+ prediction_market_agent_tooling/markets/omen/omen_subgraph_handler.py,sha256=mZ0CgKfHj0gLFq9plNpBhNqMuclb8V3qNagWfLYcpUc,38806
53
53
  prediction_market_agent_tooling/markets/polymarket/api.py,sha256=UZ4_TG8ceb9Y-qgsOKs8Qiv8zDt957QkT8IX2c83yqo,4800
54
54
  prediction_market_agent_tooling/markets/polymarket/data_models.py,sha256=Fd5PI5y3mJM8VHExBhWFWEnuuIKxQmIAXgBuoPDvNjw,4341
55
55
  prediction_market_agent_tooling/markets/polymarket/data_models_web.py,sha256=VZhVccTApygSKMmy6Au2G02JCJOKJnR_oVeKlaesuSg,12548
@@ -102,9 +102,9 @@ prediction_market_agent_tooling/tools/tavily/tavily_models.py,sha256=5ldQs1pZe6u
102
102
  prediction_market_agent_tooling/tools/tavily/tavily_search.py,sha256=Kw2mXNkMTYTEe1MBSTqhQmLoeXtgb6CkmHlcAJvhtqE,3809
103
103
  prediction_market_agent_tooling/tools/transaction_cache.py,sha256=K5YKNL2_tR10Iw2TD9fuP-CTGpBbZtNdgbd0B_R7pjg,1814
104
104
  prediction_market_agent_tooling/tools/utils.py,sha256=WvuUCHgMCiMq8_wMm5PHNwvLhcdDk2zGKaAM8OUC-qY,6438
105
- prediction_market_agent_tooling/tools/web3_utils.py,sha256=hWDa7D-jP-iW647t0ATPyiUgKbAq25iH97KUnha25SQ,11944
106
- prediction_market_agent_tooling-0.57.2.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
107
- prediction_market_agent_tooling-0.57.2.dist-info/METADATA,sha256=tzVRrpZtV9Jty0w9XLwxGagZiC3scgqPP6d2cBhqp1A,8188
108
- prediction_market_agent_tooling-0.57.2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
109
- prediction_market_agent_tooling-0.57.2.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
110
- prediction_market_agent_tooling-0.57.2.dist-info/RECORD,,
105
+ prediction_market_agent_tooling/tools/web3_utils.py,sha256=UgD0gfsvkrh59e5si7YjE9NzGxtJo5Rk5gNoRfQ6KDE,12073
106
+ prediction_market_agent_tooling-0.57.4.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
107
+ prediction_market_agent_tooling-0.57.4.dist-info/METADATA,sha256=9EOjgKRas5k5LUo8vPMLdTuZQNIDtqcmM-FprXOYPFo,8188
108
+ prediction_market_agent_tooling-0.57.4.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
109
+ prediction_market_agent_tooling-0.57.4.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
110
+ prediction_market_agent_tooling-0.57.4.dist-info/RECORD,,