prediction-market-agent-tooling 0.60.3__py3-none-any.whl → 0.60.5__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.
- prediction_market_agent_tooling/tools/balances.py +2 -0
- prediction_market_agent_tooling/tools/web3_utils.py +6 -0
- {prediction_market_agent_tooling-0.60.3.dist-info → prediction_market_agent_tooling-0.60.5.dist-info}/METADATA +1 -1
- {prediction_market_agent_tooling-0.60.3.dist-info → prediction_market_agent_tooling-0.60.5.dist-info}/RECORD +7 -7
- {prediction_market_agent_tooling-0.60.3.dist-info → prediction_market_agent_tooling-0.60.5.dist-info}/LICENSE +0 -0
- {prediction_market_agent_tooling-0.60.3.dist-info → prediction_market_agent_tooling-0.60.5.dist-info}/WHEEL +0 -0
- {prediction_market_agent_tooling-0.60.3.dist-info → prediction_market_agent_tooling-0.60.5.dist-info}/entry_points.txt +0 -0
@@ -1,4 +1,5 @@
|
|
1
1
|
from pydantic import BaseModel
|
2
|
+
from tenacity import retry, stop_after_attempt, wait_fixed
|
2
3
|
from web3 import Web3
|
3
4
|
from web3.types import Wei
|
4
5
|
|
@@ -20,6 +21,7 @@ class Balances(BaseModel):
|
|
20
21
|
return xDai(self.xdai + self.wxdai + self.sdai)
|
21
22
|
|
22
23
|
|
24
|
+
@retry(stop=stop_after_attempt(3), wait=wait_fixed(1))
|
23
25
|
def get_balances(address: ChecksumAddress, web3: Web3 | None = None) -> Balances:
|
24
26
|
if not web3:
|
25
27
|
web3 = WrappedxDaiContract().get_web3()
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import binascii
|
2
|
+
import secrets
|
2
3
|
from typing import Any, Optional, TypeVar
|
3
4
|
|
4
5
|
import base58
|
@@ -20,6 +21,7 @@ from prediction_market_agent_tooling.gtypes import (
|
|
20
21
|
HexStr,
|
21
22
|
IPFSCIDVersion0,
|
22
23
|
PrivateKey,
|
24
|
+
private_key_type,
|
23
25
|
xDai,
|
24
26
|
xdai_type,
|
25
27
|
)
|
@@ -31,6 +33,10 @@ ZERO_BYTES = HexBytes(HASH_ZERO)
|
|
31
33
|
NOT_REVERTED_ICASE_REGEX_PATTERN = "(?i)(?!.*reverted.*)"
|
32
34
|
|
33
35
|
|
36
|
+
def generate_private_key() -> PrivateKey:
|
37
|
+
return private_key_type("0x" + secrets.token_hex(32))
|
38
|
+
|
39
|
+
|
34
40
|
def private_key_to_public_key(private_key: SecretStr) -> ChecksumAddress:
|
35
41
|
account = Account.from_key(private_key.get_secret_value())
|
36
42
|
return verify_address(account.address)
|
@@ -74,7 +74,7 @@ prediction_market_agent_tooling/monitor/monitor.py,sha256=4jw_1aDUoWi9kTET8usy_k
|
|
74
74
|
prediction_market_agent_tooling/monitor/monitor_app.py,sha256=-_6w_ZvQ-Ad5qaeuo7NKTXUOOZ_6OrR8jMe25BGOY4k,4615
|
75
75
|
prediction_market_agent_tooling/monitor/monitor_settings.py,sha256=Xiozs3AsufuJ04JOe1vjUri-IAMWHjjmc2ugGGiHNH4,947
|
76
76
|
prediction_market_agent_tooling/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
77
|
-
prediction_market_agent_tooling/tools/balances.py,sha256=
|
77
|
+
prediction_market_agent_tooling/tools/balances.py,sha256=7lenJ0XEdZQHRJA89vdeLNhzCPJJA4x_Id2CS3IjIv0,1076
|
78
78
|
prediction_market_agent_tooling/tools/betting_strategies/kelly_criterion.py,sha256=TKVF8qZhxgz-4TTEHr7iVLfpurIhuji38qLc8CYaiXA,4662
|
79
79
|
prediction_market_agent_tooling/tools/betting_strategies/market_moving.py,sha256=Ej2s9fiG_iLWvgj1o5rtxN7NR4jmq8Y9syP5PCGIx6U,5270
|
80
80
|
prediction_market_agent_tooling/tools/betting_strategies/minimum_bet_to_win.py,sha256=-FUSuQQgjcWSSnoFxnlAyTeilY6raJABJVM2QKkFqAY,438
|
@@ -116,9 +116,9 @@ prediction_market_agent_tooling/tools/tokens/auto_withdraw.py,sha256=25Y0H1p0hSD
|
|
116
116
|
prediction_market_agent_tooling/tools/tokens/main_token.py,sha256=7JPgVF4RbiFzLDQVBkBuC--eUoM1AYOcJ4VygbmK5yo,822
|
117
117
|
prediction_market_agent_tooling/tools/transaction_cache.py,sha256=K5YKNL2_tR10Iw2TD9fuP-CTGpBbZtNdgbd0B_R7pjg,1814
|
118
118
|
prediction_market_agent_tooling/tools/utils.py,sha256=jLG4nbEoIzzJiZ4RgMx4Q969Zdl0p0s63p8uET_0Fuw,6440
|
119
|
-
prediction_market_agent_tooling/tools/web3_utils.py,sha256=
|
120
|
-
prediction_market_agent_tooling-0.60.
|
121
|
-
prediction_market_agent_tooling-0.60.
|
122
|
-
prediction_market_agent_tooling-0.60.
|
123
|
-
prediction_market_agent_tooling-0.60.
|
124
|
-
prediction_market_agent_tooling-0.60.
|
119
|
+
prediction_market_agent_tooling/tools/web3_utils.py,sha256=3wfqNxvMn44ivweFRoeKNVb9QRtFd7kFtp7VUY5juEE,12862
|
120
|
+
prediction_market_agent_tooling-0.60.5.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
|
121
|
+
prediction_market_agent_tooling-0.60.5.dist-info/METADATA,sha256=Mx8hYXaIMNmbl5cRGcdZDhBeosJAmKHqfKL3xhElrZg,8629
|
122
|
+
prediction_market_agent_tooling-0.60.5.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
123
|
+
prediction_market_agent_tooling-0.60.5.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
|
124
|
+
prediction_market_agent_tooling-0.60.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|