prediction-market-agent-tooling 0.57.11.dev258__py3-none-any.whl → 0.57.11.dev260__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/abis/ownable.abi.json +76 -0
- prediction_market_agent_tooling/tools/contract.py +24 -1
- {prediction_market_agent_tooling-0.57.11.dev258.dist-info → prediction_market_agent_tooling-0.57.11.dev260.dist-info}/METADATA +1 -1
- {prediction_market_agent_tooling-0.57.11.dev258.dist-info → prediction_market_agent_tooling-0.57.11.dev260.dist-info}/RECORD +7 -6
- {prediction_market_agent_tooling-0.57.11.dev258.dist-info → prediction_market_agent_tooling-0.57.11.dev260.dist-info}/LICENSE +0 -0
- {prediction_market_agent_tooling-0.57.11.dev258.dist-info → prediction_market_agent_tooling-0.57.11.dev260.dist-info}/WHEEL +0 -0
- {prediction_market_agent_tooling-0.57.11.dev258.dist-info → prediction_market_agent_tooling-0.57.11.dev260.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,76 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"type": "function",
|
4
|
+
"name": "owner",
|
5
|
+
"inputs": [],
|
6
|
+
"outputs": [
|
7
|
+
{
|
8
|
+
"name": "",
|
9
|
+
"type": "address",
|
10
|
+
"internalType": "address"
|
11
|
+
}
|
12
|
+
],
|
13
|
+
"stateMutability": "view"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"type": "function",
|
17
|
+
"name": "renounceOwnership",
|
18
|
+
"inputs": [],
|
19
|
+
"outputs": [],
|
20
|
+
"stateMutability": "nonpayable"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"type": "function",
|
24
|
+
"name": "transferOwnership",
|
25
|
+
"inputs": [
|
26
|
+
{
|
27
|
+
"name": "newOwner",
|
28
|
+
"type": "address",
|
29
|
+
"internalType": "address"
|
30
|
+
}
|
31
|
+
],
|
32
|
+
"outputs": [],
|
33
|
+
"stateMutability": "nonpayable"
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"type": "event",
|
37
|
+
"name": "OwnershipTransferred",
|
38
|
+
"inputs": [
|
39
|
+
{
|
40
|
+
"name": "previousOwner",
|
41
|
+
"type": "address",
|
42
|
+
"indexed": true,
|
43
|
+
"internalType": "address"
|
44
|
+
},
|
45
|
+
{
|
46
|
+
"name": "newOwner",
|
47
|
+
"type": "address",
|
48
|
+
"indexed": true,
|
49
|
+
"internalType": "address"
|
50
|
+
}
|
51
|
+
],
|
52
|
+
"anonymous": false
|
53
|
+
},
|
54
|
+
{
|
55
|
+
"type": "error",
|
56
|
+
"name": "OwnableInvalidOwner",
|
57
|
+
"inputs": [
|
58
|
+
{
|
59
|
+
"name": "owner",
|
60
|
+
"type": "address",
|
61
|
+
"internalType": "address"
|
62
|
+
}
|
63
|
+
]
|
64
|
+
},
|
65
|
+
{
|
66
|
+
"type": "error",
|
67
|
+
"name": "OwnableUnauthorizedAccount",
|
68
|
+
"inputs": [
|
69
|
+
{
|
70
|
+
"name": "account",
|
71
|
+
"type": "address",
|
72
|
+
"internalType": "address"
|
73
|
+
}
|
74
|
+
]
|
75
|
+
}
|
76
|
+
]
|
@@ -6,6 +6,7 @@ from contextlib import contextmanager
|
|
6
6
|
|
7
7
|
from pydantic import BaseModel, field_validator
|
8
8
|
from web3 import Web3
|
9
|
+
from web3.constants import CHECKSUM_ADDRESSS_ZERO
|
9
10
|
from web3.contract.contract import Contract as Web3Contract
|
10
11
|
|
11
12
|
from prediction_market_agent_tooling.config import APIKeys, RPCConfig
|
@@ -78,6 +79,13 @@ class ContractBaseClass(BaseModel):
|
|
78
79
|
{}
|
79
80
|
) # Can be used to hold values that aren't going to change after getting them for the first time, as for example `symbol` of an ERC-20 token.
|
80
81
|
|
82
|
+
@classmethod
|
83
|
+
def merge_contract_abis(cls, contracts: list["ContractBaseClass"]) -> ABI:
|
84
|
+
merged_abi: list[dict[t.Any, t.Any]] = sum(
|
85
|
+
(json.loads(contract.abi) for contract in contracts), []
|
86
|
+
)
|
87
|
+
return abi_field_validator(json.dumps(merged_abi))
|
88
|
+
|
81
89
|
def get_web3_contract(self, web3: Web3 | None = None) -> Web3Contract:
|
82
90
|
web3 = web3 or self.get_web3()
|
83
91
|
return web3.eth.contract(address=self.address, abi=self.abi)
|
@@ -391,6 +399,13 @@ class ContractERC4626BaseClass(ContractERC20BaseClass):
|
|
391
399
|
|
392
400
|
|
393
401
|
class OwnableContract(ContractBaseClass):
|
402
|
+
abi: ABI = abi_field_validator(
|
403
|
+
os.path.join(
|
404
|
+
os.path.dirname(os.path.realpath(__file__)),
|
405
|
+
"../abis/ownable.abi.json",
|
406
|
+
)
|
407
|
+
)
|
408
|
+
|
394
409
|
def owner(self, web3: Web3 | None = None) -> ChecksumAddress:
|
395
410
|
owner = Web3.to_checksum_address(self.call("owner", web3=web3))
|
396
411
|
return owner
|
@@ -458,7 +473,13 @@ class ContractERC721BaseClass(ContractBaseClass):
|
|
458
473
|
|
459
474
|
|
460
475
|
class ContractOwnableERC721BaseClass(ContractERC721BaseClass, OwnableContract):
|
461
|
-
|
476
|
+
# We add dummy addresses below so that we can reference .abi later.
|
477
|
+
abi: ABI = ContractBaseClass.merge_contract_abis(
|
478
|
+
[
|
479
|
+
ContractERC721BaseClass(address=ChecksumAddress(CHECKSUM_ADDRESSS_ZERO)),
|
480
|
+
OwnableContract(address=ChecksumAddress(CHECKSUM_ADDRESSS_ZERO)),
|
481
|
+
]
|
482
|
+
)
|
462
483
|
|
463
484
|
|
464
485
|
class ContractOnGnosisChain(ContractBaseClass):
|
@@ -571,11 +592,13 @@ class SimpleTreasuryContract(ContractOnGnosisChain, OwnableContract):
|
|
571
592
|
def set_required_nft_balance(
|
572
593
|
self,
|
573
594
|
api_keys: APIKeys,
|
595
|
+
new_required_balance: int,
|
574
596
|
web3: Web3 | None = None,
|
575
597
|
) -> TxReceipt:
|
576
598
|
return self.send(
|
577
599
|
api_keys=api_keys,
|
578
600
|
function_name="setRequiredNFTBalance",
|
601
|
+
function_params=[new_required_balance],
|
579
602
|
web3=web3,
|
580
603
|
)
|
581
604
|
|
@@ -13,6 +13,7 @@ prediction_market_agent_tooling/abis/omen_kleros.abi.json,sha256=QPMXrYA5UCo_wVU
|
|
13
13
|
prediction_market_agent_tooling/abis/omen_oracle.abi.json,sha256=YPZ-FLvd4PA9pYd6d5mQI1TD11JnsE0LGxH4XcZZFCA,1775
|
14
14
|
prediction_market_agent_tooling/abis/omen_realitio.abi.json,sha256=7HmFkBF_rq83UTaH2kRRsEfc_WZuf4n-qvkB4nhvweo,15953
|
15
15
|
prediction_market_agent_tooling/abis/omen_thumbnailmapping.abi.json,sha256=u1-3B8FB3Ys9KVJCH-lw9ArkicdxbNMf34dV-VEGMMU,930
|
16
|
+
prediction_market_agent_tooling/abis/ownable.abi.json,sha256=DeTy_7VmsMhFl7jwI8MIlmjy2jORauYxrGm7wC_Alxw,1528
|
16
17
|
prediction_market_agent_tooling/abis/ownable_erc721.abi.json,sha256=9sxm588MAQmqCV_S0D3eYC7l9grbeALsd0Da_AHxdEI,8506
|
17
18
|
prediction_market_agent_tooling/abis/proxy.abi.json,sha256=h24GXZ6Q0bSZlwh7zOv0EiDvbqUz_PHtWfKHTyPJ1w4,644
|
18
19
|
prediction_market_agent_tooling/abis/simpletreasury.abi.json,sha256=7-l7rntLkcFKkoN8hXywO0-h-mUZxOZlyQg1Jk7yTB0,2877
|
@@ -79,7 +80,7 @@ prediction_market_agent_tooling/tools/betting_strategies/utils.py,sha256=kpIb-ci
|
|
79
80
|
prediction_market_agent_tooling/tools/caches/db_cache.py,sha256=aafau_n_AUbLIwkyIRiTPgKB0dmM0767mSqyPDLF2A4,10576
|
80
81
|
prediction_market_agent_tooling/tools/caches/inmemory_cache.py,sha256=ZW5iI5rmjqeAebu5T7ftRnlkxiL02IC-MxCfDB80x7w,1506
|
81
82
|
prediction_market_agent_tooling/tools/caches/serializers.py,sha256=upSXN5__rmRlzJ6tv1h7FodKzJu9eCkFrN_zeuwroJM,2151
|
82
|
-
prediction_market_agent_tooling/tools/contract.py,sha256=
|
83
|
+
prediction_market_agent_tooling/tools/contract.py,sha256=glnPQr9B0WmhLcdifD892zLPaHS5f0fZZ3dKLOUB6pI,29559
|
83
84
|
prediction_market_agent_tooling/tools/costs.py,sha256=EaAJ7v9laD4VEV3d8B44M4u3_oEO_H16jRVCdoZ93Uw,954
|
84
85
|
prediction_market_agent_tooling/tools/custom_exceptions.py,sha256=Fh8z1fbwONvP4-j7AmV_PuEcoqb6-QXa9PJ9m7guMcM,93
|
85
86
|
prediction_market_agent_tooling/tools/data_models.py,sha256=jDQ7FU0QQhXlcgJh5VZZGwDTYP2OPAqKPHZFewCPAUY,732
|
@@ -108,8 +109,8 @@ prediction_market_agent_tooling/tools/tavily/tavily_search.py,sha256=Kw2mXNkMTYT
|
|
108
109
|
prediction_market_agent_tooling/tools/transaction_cache.py,sha256=K5YKNL2_tR10Iw2TD9fuP-CTGpBbZtNdgbd0B_R7pjg,1814
|
109
110
|
prediction_market_agent_tooling/tools/utils.py,sha256=WvuUCHgMCiMq8_wMm5PHNwvLhcdDk2zGKaAM8OUC-qY,6438
|
110
111
|
prediction_market_agent_tooling/tools/web3_utils.py,sha256=wqUDCed3iNrn1Wao1iwGN6tzIrhpzrTRj319wlveJEo,12275
|
111
|
-
prediction_market_agent_tooling-0.57.11.
|
112
|
-
prediction_market_agent_tooling-0.57.11.
|
113
|
-
prediction_market_agent_tooling-0.57.11.
|
114
|
-
prediction_market_agent_tooling-0.57.11.
|
115
|
-
prediction_market_agent_tooling-0.57.11.
|
112
|
+
prediction_market_agent_tooling-0.57.11.dev260.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
|
113
|
+
prediction_market_agent_tooling-0.57.11.dev260.dist-info/METADATA,sha256=UwIBMbs6cJebVZKvmQSaqueRxMRBqBqSihSofJu3e8U,8247
|
114
|
+
prediction_market_agent_tooling-0.57.11.dev260.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
115
|
+
prediction_market_agent_tooling-0.57.11.dev260.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
|
116
|
+
prediction_market_agent_tooling-0.57.11.dev260.dist-info/RECORD,,
|
File without changes
|
File without changes
|