diff --git a/prediction_market_agent_tooling/tools/contract.py b/prediction_market_agent_tooling/tools/contract.py index 117b99d6..2f905c68 100644 --- a/prediction_market_agent_tooling/tools/contract.py +++ b/prediction_market_agent_tooling/tools/contract.py @@ -17,14 +17,20 @@ TxParams, TxReceipt, Wei, + xDai, ) from prediction_market_agent_tooling.tools.data_models import MessageContainer from prediction_market_agent_tooling.tools.hexbytes_custom import HexBytes -from prediction_market_agent_tooling.tools.utils import DatetimeUTC, should_not_happen +from prediction_market_agent_tooling.tools.utils import ( + BPS_CONSTANT, + DatetimeUTC, + should_not_happen, +) from prediction_market_agent_tooling.tools.web3_utils import ( call_function_on_contract, send_function_on_contract_tx, send_function_on_contract_tx_using_safe, + wei_to_xdai, ) @@ -548,6 +554,14 @@ class AgentCommunicationContract(ContractOnGnosisChain): "0xd422e0059ed819e8d792af936da206878188e34f" ) + def minimum_message_value(self, web3: Web3 | None = None) -> xDai: + value: Wei = self.call("minimumValueForSendingMessageInWei", web3=web3) + return wei_to_xdai(value) + + def ratio_given_to_treasury(self, web3: Web3 | None = None) -> float: + bps: int = self.call("pctToTreasuryInBasisPoints", web3=web3) + return bps / BPS_CONSTANT + def count_unseen_messages( self, agent_address: ChecksumAddress, diff --git a/pyproject.toml b/pyproject.toml index d422d10b..a8fd1d23 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "prediction-market-agent-tooling" -version = "0.57.9" +version = "0.57.10" description = "Tools to benchmark, deploy and monitor prediction market agents." authors = ["Gnosis"] readme = "README.md"