prediction-market-agent-tooling 0.69.10.dev1119__py3-none-any.whl → 0.69.10.dev1120__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.
@@ -1,6 +1,6 @@
1
1
  import typing as t
2
2
  from decimal import Decimal
3
- from typing import NewType
3
+ from typing import Annotated, NewType, TypeAlias
4
4
 
5
5
  from eth_typing.evm import ( # noqa: F401 # Import for the sake of easy importing with others from here.
6
6
  Address,
@@ -8,6 +8,7 @@ from eth_typing.evm import ( # noqa: F401 # Import for the sake of easy import
8
8
  HexAddress,
9
9
  HexStr,
10
10
  )
11
+ from pydantic import BeforeValidator
11
12
  from pydantic.types import SecretStr
12
13
  from pydantic.v1.types import SecretStr as SecretStrV1
13
14
  from web3 import Web3
@@ -18,6 +19,7 @@ from web3.types import ( # noqa: F401 # Import for the sake of easy importing
18
19
  )
19
20
  from web3.types import Wei as Web3Wei
20
21
 
22
+ from prediction_market_agent_tooling.gtypes import ChecksumAddress
21
23
  from prediction_market_agent_tooling.tools._generic_value import _GenericValue
22
24
  from prediction_market_agent_tooling.tools.datetime_utc import ( # noqa: F401 # Import for the sake of easy importing with others from here.
23
25
  DatetimeUTC,
@@ -26,6 +28,14 @@ from prediction_market_agent_tooling.tools.hexbytes_custom import ( # noqa: F40
26
28
  HexBytes,
27
29
  )
28
30
 
31
+ VerifiedChecksumAddress: TypeAlias = Annotated[
32
+ ChecksumAddress, BeforeValidator(Web3.to_checksum_address)
33
+ ]
34
+ VerifiedChecksumAddressOrNone: TypeAlias = Annotated[
35
+ ChecksumAddress | None,
36
+ BeforeValidator(lambda x: Web3.to_checksum_address(x) if x is not None else None),
37
+ ]
38
+
29
39
 
30
40
  class CollateralToken(_GenericValue[int | float | str | Decimal, float], parser=float):
31
41
  """
@@ -1,18 +1,22 @@
1
1
  from enum import Enum
2
- from typing import Annotated, Optional
2
+ from typing import Optional
3
3
 
4
- from pydantic import BaseModel, BeforeValidator, ConfigDict
4
+ from pydantic import BaseModel, ConfigDict
5
5
  from sqlmodel import Field, SQLModel
6
- from web3 import Web3
7
6
 
8
- from prediction_market_agent_tooling.gtypes import ChecksumAddress, HexBytes, Wei
7
+ from prediction_market_agent_tooling.gtypes import (
8
+ HexBytes,
9
+ VerifiedChecksumAddress,
10
+ VerifiedChecksumAddressOrNone,
11
+ Wei,
12
+ )
9
13
  from prediction_market_agent_tooling.tools.datetime_utc import DatetimeUTC
10
14
  from prediction_market_agent_tooling.tools.utils import utcnow
11
15
 
12
16
 
13
17
  class MinimalisticTrade(BaseModel):
14
- sellToken: Annotated[ChecksumAddress, BeforeValidator(Web3.to_checksum_address)]
15
- buyToken: Annotated[ChecksumAddress, BeforeValidator(Web3.to_checksum_address)]
18
+ sellToken: VerifiedChecksumAddress
19
+ buyToken: VerifiedChecksumAddress
16
20
  orderUid: HexBytes
17
21
  txHash: HexBytes
18
22
 
@@ -29,7 +33,7 @@ class PlacementError(str, Enum):
29
33
 
30
34
 
31
35
  class OnchainOrderData(BaseModel):
32
- sender: Annotated[ChecksumAddress, BeforeValidator(Web3.to_checksum_address)]
36
+ sender: VerifiedChecksumAddress
33
37
  placementError: Optional[PlacementError]
34
38
 
35
39
 
@@ -77,15 +81,10 @@ class Order(BaseModel):
77
81
  quoteId: int | None = None
78
82
  validTo: int
79
83
  sellAmount: Wei
80
- sellToken: Annotated[ChecksumAddress, BeforeValidator(Web3.to_checksum_address)]
84
+ sellToken: VerifiedChecksumAddress
81
85
  buyAmount: Wei
82
- buyToken: Annotated[ChecksumAddress, BeforeValidator(Web3.to_checksum_address)]
83
- receiver: Annotated[
84
- ChecksumAddress | None,
85
- BeforeValidator(
86
- lambda x: Web3.to_checksum_address(x) if x is not None else None
87
- ),
88
- ]
86
+ buyToken: VerifiedChecksumAddress
87
+ receiver: VerifiedChecksumAddressOrNone
89
88
  feeAmount: Wei
90
89
  creationDate: DatetimeUTC
91
90
  kind: OrderKind
@@ -94,17 +93,12 @@ class Order(BaseModel):
94
93
  buyTokenBalance: BuyTokenBalance | None
95
94
  signingScheme: SigningScheme
96
95
  signature: HexBytes
97
- from_: Annotated[
98
- ChecksumAddress | None,
99
- BeforeValidator(
100
- lambda x: Web3.to_checksum_address(x) if x is not None else None
101
- ),
102
- ] = Field(None, alias="from")
96
+ from_: VerifiedChecksumAddressOrNone = Field(None, alias="from")
103
97
  appData: str
104
98
  fullAppData: str | None
105
99
  appDataHash: HexBytes | None = None
106
100
  class_: str = Field(None, alias="class")
107
- owner: Annotated[ChecksumAddress, BeforeValidator(Web3.to_checksum_address)]
101
+ owner: VerifiedChecksumAddress
108
102
  executedSellAmount: Wei
109
103
  executedSellAmountBeforeFees: Wei
110
104
  executedBuyAmount: Wei
@@ -113,19 +107,9 @@ class Order(BaseModel):
113
107
  status: str
114
108
  isLiquidityOrder: bool | None
115
109
  ethflowData: EthFlowData | None = None
116
- onchainUser: Annotated[
117
- ChecksumAddress | None,
118
- BeforeValidator(
119
- lambda x: Web3.to_checksum_address(x) if x is not None else None
120
- ),
121
- ] = None
110
+ onchainUser: VerifiedChecksumAddressOrNone = None
122
111
  executedFee: Wei
123
- executedFeeToken: Annotated[
124
- ChecksumAddress | None,
125
- BeforeValidator(
126
- lambda x: Web3.to_checksum_address(x) if x is not None else None
127
- ),
128
- ]
112
+ executedFeeToken: VerifiedChecksumAddressOrNone
129
113
 
130
114
 
131
115
  class RateLimit(SQLModel, table=True):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prediction-market-agent-tooling
3
- Version: 0.69.10.dev1119
3
+ Version: 0.69.10.dev1120
4
4
  Summary: Tools to benchmark, deploy and monitor prediction market agents.
5
5
  License-File: LICENSE
6
6
  Author: Gnosis
@@ -36,7 +36,7 @@ prediction_market_agent_tooling/deploy/gcp/deploy.py,sha256=CYUgnfy-9XVk04kkxA_5
36
36
  prediction_market_agent_tooling/deploy/gcp/kubernetes_models.py,sha256=OsPboCFGiZKsvGyntGZHwdqPlLTthITkNF5rJFvGgU8,2582
37
37
  prediction_market_agent_tooling/deploy/gcp/utils.py,sha256=WI2ycX1X-IlTRoNoG4ggFlRwPL28kwM9VGDFD2fePLo,5699
38
38
  prediction_market_agent_tooling/deploy/trade_interval.py,sha256=Xk9j45alQ_vrasGvsNyuW70XHIQ7wfvjoxNR3F6HYCw,1155
39
- prediction_market_agent_tooling/gtypes.py,sha256=bUIZfZIGvIi3aiZNu5rVE9kRevw8sfMa4bcze6QeBg8,6058
39
+ prediction_market_agent_tooling/gtypes.py,sha256=tHXMBjh0iAEJEcBywFvwzwPqDkBUpjEyeb7ynh7fOKc,6469
40
40
  prediction_market_agent_tooling/jobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
41
  prediction_market_agent_tooling/jobs/jobs_models.py,sha256=4KZ0iaKZx5zEZBBiEo9CHk0OpX3bKjoYA0wmptR0Wyk,2455
42
42
  prediction_market_agent_tooling/jobs/omen/omen_jobs.py,sha256=CojpgghRs0lFEf5wl-oWhGaQozG616YD0cXdlmFO-U0,5116
@@ -96,7 +96,7 @@ prediction_market_agent_tooling/tools/contract.py,sha256=BzpAFcbKl_KqwgAlaXx63Fg
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
98
98
  prediction_market_agent_tooling/tools/cow/cow_order.py,sha256=DN_8cPrr4jWVpXdS4D0j1QB19nB8fxDoSheo2BFMc8M,14523
99
- prediction_market_agent_tooling/tools/cow/models.py,sha256=y_zsPEw7sG-OV6ooycQ9mx75GtnG3SuwXc6xuxL_o3I,3799
99
+ prediction_market_agent_tooling/tools/cow/models.py,sha256=EpCziNs4sGmN7ZvPKpqdqjhVd_-zPZHsJVeVfFu4Y60,3005
100
100
  prediction_market_agent_tooling/tools/cow/semaphore.py,sha256=LPB-4wNQf7El7dgBD4Tmol6vr5j1CP9qMeDm8dcs6RI,3741
101
101
  prediction_market_agent_tooling/tools/custom_exceptions.py,sha256=Fh8z1fbwONvP4-j7AmV_PuEcoqb6-QXa9PJ9m7guMcM,93
102
102
  prediction_market_agent_tooling/tools/datetime_utc.py,sha256=_oO6mMc28C9aSmQfrG-S7UQy5uMHVEQqia8arnscVCk,3213
@@ -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.10.dev1119.dist-info/METADATA,sha256=4cM7-CJ3tpEUsBYQasv-387chs1IoRw0L1l5Xs7CqIU,8899
141
- prediction_market_agent_tooling-0.69.10.dev1119.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
142
- prediction_market_agent_tooling-0.69.10.dev1119.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
143
- prediction_market_agent_tooling-0.69.10.dev1119.dist-info/licenses/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
144
- prediction_market_agent_tooling-0.69.10.dev1119.dist-info/RECORD,,
140
+ prediction_market_agent_tooling-0.69.10.dev1120.dist-info/METADATA,sha256=_zBgziT22Ha55DnWQSUlO2ITl7W1-zIXoNY19nKoGqs,8899
141
+ prediction_market_agent_tooling-0.69.10.dev1120.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
142
+ prediction_market_agent_tooling-0.69.10.dev1120.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
143
+ prediction_market_agent_tooling-0.69.10.dev1120.dist-info/licenses/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
144
+ prediction_market_agent_tooling-0.69.10.dev1120.dist-info/RECORD,,