prediction-market-agent-tooling 0.69.10.dev1120__py3-none-any.whl → 0.69.11.dev1122__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.
Potentially problematic release.
This version of prediction-market-agent-tooling might be problematic. Click here for more details.
- prediction_market_agent_tooling/tools/caches/serializers.py +7 -1
- {prediction_market_agent_tooling-0.69.10.dev1120.dist-info → prediction_market_agent_tooling-0.69.11.dev1122.dist-info}/METADATA +1 -1
- {prediction_market_agent_tooling-0.69.10.dev1120.dist-info → prediction_market_agent_tooling-0.69.11.dev1122.dist-info}/RECORD +6 -6
- {prediction_market_agent_tooling-0.69.10.dev1120.dist-info → prediction_market_agent_tooling-0.69.11.dev1122.dist-info}/WHEEL +0 -0
- {prediction_market_agent_tooling-0.69.10.dev1120.dist-info → prediction_market_agent_tooling-0.69.11.dev1122.dist-info}/entry_points.txt +0 -0
- {prediction_market_agent_tooling-0.69.10.dev1120.dist-info → prediction_market_agent_tooling-0.69.11.dev1122.dist-info}/licenses/LICENSE +0 -0
|
@@ -4,6 +4,7 @@ from datetime import date, timedelta
|
|
|
4
4
|
|
|
5
5
|
from pydantic import BaseModel
|
|
6
6
|
|
|
7
|
+
from prediction_market_agent_tooling.gtypes import HexBytes
|
|
7
8
|
from prediction_market_agent_tooling.tools.datetime_utc import DatetimeUTC
|
|
8
9
|
|
|
9
10
|
|
|
@@ -12,7 +13,7 @@ def json_serializer(x: t.Any) -> str:
|
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
def json_serializer_default_fn(
|
|
15
|
-
y: DatetimeUTC | timedelta | date | BaseModel,
|
|
16
|
+
y: DatetimeUTC | timedelta | date | HexBytes | BaseModel,
|
|
16
17
|
) -> str | dict[str, t.Any]:
|
|
17
18
|
"""
|
|
18
19
|
Used to serialize objects that don't support it by default into a specific string that can be deserialized out later.
|
|
@@ -25,6 +26,8 @@ def json_serializer_default_fn(
|
|
|
25
26
|
return f"timedelta::{y.total_seconds()}"
|
|
26
27
|
elif isinstance(y, date):
|
|
27
28
|
return f"date::{y.isoformat()}"
|
|
29
|
+
elif isinstance(y, HexBytes):
|
|
30
|
+
return f"HexBytes::{y.to_0x_hex()}"
|
|
28
31
|
elif isinstance(y, BaseModel):
|
|
29
32
|
return y.model_dump()
|
|
30
33
|
raise TypeError(
|
|
@@ -51,6 +54,9 @@ def replace_custom_stringified_objects(obj: t.Any) -> t.Any:
|
|
|
51
54
|
elif obj.startswith("date::"):
|
|
52
55
|
iso_str = obj[len("date::") :]
|
|
53
56
|
return date.fromisoformat(iso_str)
|
|
57
|
+
elif obj.startswith("HexBytes::"):
|
|
58
|
+
hex_str = obj[len("HexBytes::") :]
|
|
59
|
+
return HexBytes(hex_str)
|
|
54
60
|
else:
|
|
55
61
|
return obj
|
|
56
62
|
elif isinstance(obj, dict):
|
|
@@ -91,7 +91,7 @@ prediction_market_agent_tooling/tools/betting_strategies/stretch_bet_between.py,
|
|
|
91
91
|
prediction_market_agent_tooling/tools/betting_strategies/utils.py,sha256=MpS3FOMn0C7nbmbQRUT9QwSh3UzzsgGczP91iSMr9wo,261
|
|
92
92
|
prediction_market_agent_tooling/tools/caches/db_cache.py,sha256=V6o6UdesjkKzSJMhqkUtD76cJGPaNhuwA4OL2chIYSI,13801
|
|
93
93
|
prediction_market_agent_tooling/tools/caches/inmemory_cache.py,sha256=ZW5iI5rmjqeAebu5T7ftRnlkxiL02IC-MxCfDB80x7w,1506
|
|
94
|
-
prediction_market_agent_tooling/tools/caches/serializers.py,sha256=
|
|
94
|
+
prediction_market_agent_tooling/tools/caches/serializers.py,sha256=fwyIHUsL7u9NY7ZihTcUdqsvl2psatcbTfgWHTSez3U,2427
|
|
95
95
|
prediction_market_agent_tooling/tools/contract.py,sha256=BzpAFcbKl_KqwgAlaXx63Fg8jzr0EO3qEeOs1K11CPA,33905
|
|
96
96
|
prediction_market_agent_tooling/tools/contract_utils.py,sha256=9X9raICUZkPDShilt02aYzS_ILZ62u0vG5081uWLdqk,2152
|
|
97
97
|
prediction_market_agent_tooling/tools/costs.py,sha256=EaAJ7v9laD4VEV3d8B44M4u3_oEO_H16jRVCdoZ93Uw,954
|
|
@@ -137,8 +137,8 @@ prediction_market_agent_tooling/tools/tokens/usd.py,sha256=DPO-4HBTy1-TZHKL_9CnH
|
|
|
137
137
|
prediction_market_agent_tooling/tools/transaction_cache.py,sha256=K5YKNL2_tR10Iw2TD9fuP-CTGpBbZtNdgbd0B_R7pjg,1814
|
|
138
138
|
prediction_market_agent_tooling/tools/utils.py,sha256=ruq6P5TFs8CBHxeBLj1Plpx7kuNFPpDgMsJGQgDiRNs,8785
|
|
139
139
|
prediction_market_agent_tooling/tools/web3_utils.py,sha256=CDbaidlLeQ4VHzSg150L7QNfHfGveljSePGuDVFEYqc,13963
|
|
140
|
-
prediction_market_agent_tooling-0.69.
|
|
141
|
-
prediction_market_agent_tooling-0.69.
|
|
142
|
-
prediction_market_agent_tooling-0.69.
|
|
143
|
-
prediction_market_agent_tooling-0.69.
|
|
144
|
-
prediction_market_agent_tooling-0.69.
|
|
140
|
+
prediction_market_agent_tooling-0.69.11.dev1122.dist-info/METADATA,sha256=--DwjAkzPXoeCKFir_GnmfydDWkx3NObybMpINRJrKE,8899
|
|
141
|
+
prediction_market_agent_tooling-0.69.11.dev1122.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
142
|
+
prediction_market_agent_tooling-0.69.11.dev1122.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
|
|
143
|
+
prediction_market_agent_tooling-0.69.11.dev1122.dist-info/licenses/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
|
|
144
|
+
prediction_market_agent_tooling-0.69.11.dev1122.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|