prediction-market-agent-tooling 0.57.4__py3-none-any.whl → 0.57.5.dev213__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.
@@ -33,7 +33,7 @@ class DBManager:
33
33
  sqlalchemy_db_url.get_secret_value(),
34
34
  json_serializer=json_serializer,
35
35
  json_deserializer=json_deserializer,
36
- pool_size=20,
36
+ pool_size=10,
37
37
  pool_recycle=3600,
38
38
  echo=True,
39
39
  )
@@ -52,7 +52,6 @@ class DBManager:
52
52
  def create_tables(
53
53
  self, sqlmodel_tables: Sequence[type[SQLModel]] | None = None
54
54
  ) -> None:
55
- # Determine tables to create
56
55
  if sqlmodel_tables is not None:
57
56
  tables_to_create = []
58
57
  for sqlmodel_table in sqlmodel_tables:
@@ -68,7 +67,9 @@ class DBManager:
68
67
  tables_to_create = None
69
68
 
70
69
  # Create tables in the database
71
- SQLModel.metadata.create_all(self._engine, tables=tables_to_create)
70
+ with self.get_connection() as connection:
71
+ SQLModel.metadata.create_all(connection, tables=tables_to_create)
72
+ connection.commit()
72
73
 
73
74
  # Update cache to mark tables as initialized
74
75
  if tables_to_create:
@@ -153,6 +153,9 @@ def _prepare_tx_params(
153
153
  from_checksummed = Web3.to_checksum_address(tx_params_new["from"])
154
154
  tx_params_new["nonce"] = web3.eth.get_transaction_count(from_checksummed)
155
155
 
156
+ if not tx_params_new.get("chainId"):
157
+ tx_params_new["chainId"] = web3.eth.chain_id
158
+
156
159
  if access_list is not None:
157
160
  tx_params_new["accessList"] = access_list
158
161
 
@@ -297,7 +300,7 @@ def send_xdai_to(
297
300
  from_private_key: PrivateKey,
298
301
  to_address: ChecksumAddress,
299
302
  value: Wei,
300
- data_text: Optional[str] = None,
303
+ data_text: Optional[str | bytes] = None,
301
304
  tx_params: Optional[TxParams] = None,
302
305
  timeout: int = 180,
303
306
  ) -> TxReceipt:
@@ -305,7 +308,11 @@ def send_xdai_to(
305
308
 
306
309
  tx_params_new: TxParams = {"value": value, "to": to_address}
307
310
  if data_text is not None:
308
- tx_params_new["data"] = Web3.to_bytes(text=data_text)
311
+ tx_params_new["data"] = (
312
+ Web3.to_bytes(text=data_text)
313
+ if not isinstance(data_text, bytes)
314
+ else data_text
315
+ )
309
316
  if tx_params:
310
317
  tx_params_new.update(tx_params)
311
318
  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.4
3
+ Version: 0.57.5.dev213
4
4
  Summary: Tools to benchmark, deploy and monitor prediction market agents.
5
5
  Author: Gnosis
6
6
  Requires-Python: >=3.10,<3.12
@@ -79,7 +79,7 @@ prediction_market_agent_tooling/tools/contract.py,sha256=Um_nQlpYJRBy4MnNR1CPKES
79
79
  prediction_market_agent_tooling/tools/costs.py,sha256=EaAJ7v9laD4VEV3d8B44M4u3_oEO_H16jRVCdoZ93Uw,954
80
80
  prediction_market_agent_tooling/tools/custom_exceptions.py,sha256=Fh8z1fbwONvP4-j7AmV_PuEcoqb6-QXa9PJ9m7guMcM,93
81
81
  prediction_market_agent_tooling/tools/datetime_utc.py,sha256=2JSWF7AXQnv04_D_cu9Vmdkq0TWmGJ1QcK9AeqrA-U8,2765
82
- prediction_market_agent_tooling/tools/db/db_manager.py,sha256=-WGYY-ZyqPveXb642gw4-Zh-RicMrBFgx7uqCB8TuDg,2801
82
+ prediction_market_agent_tooling/tools/db/db_manager.py,sha256=vOF2qwX9yj1dm0Vo_D4oAEuoHnXEP12lG1VymYLWxGU,2848
83
83
  prediction_market_agent_tooling/tools/google_utils.py,sha256=t3_UEEvKX3L0biSIQ560GdRbllQ6eprhK_upE243A-0,3185
84
84
  prediction_market_agent_tooling/tools/hexbytes_custom.py,sha256=Bp94qgPjvjWf1Vb4lNzGFDXRdThw1rJ91vL6r2PWq5E,2096
85
85
  prediction_market_agent_tooling/tools/httpx_cached_client.py,sha256=RxD-hwtZCMctnMwfzy8t51W9Z9gxFGtDYxBIMChazpc,406
@@ -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=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,,
105
+ prediction_market_agent_tooling/tools/web3_utils.py,sha256=wqUDCed3iNrn1Wao1iwGN6tzIrhpzrTRj319wlveJEo,12275
106
+ prediction_market_agent_tooling-0.57.5.dev213.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
107
+ prediction_market_agent_tooling-0.57.5.dev213.dist-info/METADATA,sha256=SV_yPrcJ5z8QBoxQYdc5VKhDc-uEaBP4ukTAEzMXmmQ,8195
108
+ prediction_market_agent_tooling-0.57.5.dev213.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
109
+ prediction_market_agent_tooling-0.57.5.dev213.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
110
+ prediction_market_agent_tooling-0.57.5.dev213.dist-info/RECORD,,