mech-client 0.2.19__py3-none-any.whl → 0.2.20.post1__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.
- mech_client/__init__.py +1 -1
- mech_client/configs/mechs.json +9 -3
- mech_client/interact.py +10 -0
- mech_client/subgraph.py +4 -0
- {mech_client-0.2.19.dist-info → mech_client-0.2.20.post1.dist-info}/METADATA +1 -1
- {mech_client-0.2.19.dist-info → mech_client-0.2.20.post1.dist-info}/RECORD +9 -9
- {mech_client-0.2.19.dist-info → mech_client-0.2.20.post1.dist-info}/LICENSE +0 -0
- {mech_client-0.2.19.dist-info → mech_client-0.2.20.post1.dist-info}/WHEEL +0 -0
- {mech_client-0.2.19.dist-info → mech_client-0.2.20.post1.dist-info}/entry_points.txt +0 -0
mech_client/__init__.py
CHANGED
mech_client/configs/mechs.json
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"is_gas_estimation_enabled": false
|
|
12
12
|
},
|
|
13
13
|
"gas_limit": 100000,
|
|
14
|
+
"price": 10000000000000000,
|
|
14
15
|
"contract_abi_url": "https://gnosis.blockscout.com/api/v2/smart-contracts/{contract_address}",
|
|
15
16
|
"transaction_url": "https://gnosisscan.io/tx/{transaction_digest}",
|
|
16
17
|
"subgraph_url": "https://api.studio.thegraph.com/query/57238/mech/version/latest"
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
"is_gas_estimation_enabled": false
|
|
28
29
|
},
|
|
29
30
|
"gas_limit": 100000,
|
|
31
|
+
"price": 3000000000000,
|
|
30
32
|
"contract_abi_url": "https://api.arbiscan.io/api?module=contract&action=getabi&address={contract_address}",
|
|
31
33
|
"transaction_url": "https://arbiscan.io/tx/{transaction_digest}",
|
|
32
34
|
"subgraph_url": ""
|
|
@@ -43,6 +45,7 @@
|
|
|
43
45
|
"is_gas_estimation_enabled": false
|
|
44
46
|
},
|
|
45
47
|
"gas_limit": 100000,
|
|
48
|
+
"price": 10000000000000000,
|
|
46
49
|
"contract_abi_url": "https://api.polygonscan.com/api?module=contract&action=getabi&address={contract_address}",
|
|
47
50
|
"transaction_url": "https://polygonscan.com/tx/{transaction_digest}",
|
|
48
51
|
"subgraph_url": ""
|
|
@@ -58,8 +61,9 @@
|
|
|
58
61
|
"default_gas_price_strategy": "eip1559",
|
|
59
62
|
"is_gas_estimation_enabled": false
|
|
60
63
|
},
|
|
61
|
-
"gas_limit":
|
|
62
|
-
"
|
|
64
|
+
"gas_limit": 250000,
|
|
65
|
+
"price": 3000000000000,
|
|
66
|
+
"contract_abi_url": "https://api.basescan.org/api?module=contract&action=getabi&address={contract_address}&apikey={api_key}",
|
|
63
67
|
"transaction_url": "https://basescan.org/tx/{transaction_digest}",
|
|
64
68
|
"subgraph_url": ""
|
|
65
69
|
},
|
|
@@ -75,6 +79,7 @@
|
|
|
75
79
|
"is_gas_estimation_enabled": false
|
|
76
80
|
},
|
|
77
81
|
"gas_limit": 250000,
|
|
82
|
+
"price": 10000000000000000,
|
|
78
83
|
"contract_abi_url": "https://api.celoscan.io/api?module=contract&action=getabi&address={contract_address}",
|
|
79
84
|
"transaction_url": "https://celoscan.io/tx/{transaction_digest}",
|
|
80
85
|
"subgraph_url": ""
|
|
@@ -91,8 +96,9 @@
|
|
|
91
96
|
"is_gas_estimation_enabled": false
|
|
92
97
|
},
|
|
93
98
|
"gas_limit": 100000,
|
|
99
|
+
"price": 3000000000000,
|
|
94
100
|
"contract_abi_url": "https://api-optimistic.etherscan.io/api?module=contract&action=getabi&address={contract_address}",
|
|
95
101
|
"transaction_url": "https://optimistic.etherscan.io/tx/{transaction_digest}",
|
|
96
102
|
"subgraph_url": ""
|
|
97
103
|
}
|
|
98
|
-
}
|
|
104
|
+
}
|
mech_client/interact.py
CHANGED
|
@@ -112,6 +112,7 @@ class MechConfig: # pylint: disable=too-many-instance-attributes
|
|
|
112
112
|
contract_abi_url: str
|
|
113
113
|
transaction_url: str
|
|
114
114
|
subgraph_url: str
|
|
115
|
+
price: int
|
|
115
116
|
|
|
116
117
|
def __post_init__(self) -> None:
|
|
117
118
|
"""Post initialization to override with environment variables."""
|
|
@@ -143,6 +144,13 @@ class MechConfig: # pylint: disable=too-many-instance-attributes
|
|
|
143
144
|
if subgraph_url:
|
|
144
145
|
self.subgraph_url = subgraph_url
|
|
145
146
|
|
|
147
|
+
api_key = os.getenv("MECHX_API_KEY")
|
|
148
|
+
if api_key:
|
|
149
|
+
updated_contract_abi_url = self.contract_abi_url.replace(
|
|
150
|
+
"{api_key}", api_key
|
|
151
|
+
)
|
|
152
|
+
self.contract_abi_url = updated_contract_abi_url
|
|
153
|
+
|
|
146
154
|
|
|
147
155
|
class ConfirmationType(Enum):
|
|
148
156
|
"""Verification type."""
|
|
@@ -587,11 +595,13 @@ def interact( # pylint: disable=too-many-arguments,too-many-locals
|
|
|
587
595
|
deliver_signature=deliver_event_signature,
|
|
588
596
|
)
|
|
589
597
|
print("Sending Mech request...")
|
|
598
|
+
price = mech_config.price or 10_000_000_000_000_000
|
|
590
599
|
transaction_digest = send_request(
|
|
591
600
|
crypto=crypto,
|
|
592
601
|
ledger_api=ledger_api,
|
|
593
602
|
mech_contract=mech_contract,
|
|
594
603
|
gas_limit=mech_config.gas_limit,
|
|
604
|
+
price=price,
|
|
595
605
|
prompt=prompt,
|
|
596
606
|
tool=tool,
|
|
597
607
|
extra_attributes=extra_attributes,
|
mech_client/subgraph.py
CHANGED
|
@@ -70,8 +70,12 @@ def query_agent_address( # pylint: disable=too-many-return-statements
|
|
|
70
70
|
:rtype: Optional[str]
|
|
71
71
|
"""
|
|
72
72
|
# temporary hard coded until subgraph present
|
|
73
|
+
if chain_config == "base" and agent_id == 1:
|
|
74
|
+
return "0x37C484cc34408d0F827DB4d7B6e54b8837Bf8BDA"
|
|
73
75
|
if chain_config == "base" and agent_id == 2:
|
|
74
76
|
return "0x111D7DB1B752AB4D2cC0286983D9bd73a49bac6c"
|
|
77
|
+
if chain_config == "base" and agent_id == 3:
|
|
78
|
+
return "0x111D7DB1B752AB4D2cC0286983D9bd73a49bac6c"
|
|
75
79
|
if chain_config == "arbitrum" and agent_id == 2:
|
|
76
80
|
return "0x1FDAD3a5af5E96e5a64Fc0662B1814458F114597"
|
|
77
81
|
if chain_config == "polygon" and agent_id == 2:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
mech_client/__init__.py,sha256=
|
|
1
|
+
mech_client/__init__.py,sha256=unKWt7hYne025u4WE7q0eCw1MSIqB76NEs2C6eh3NHw,49
|
|
2
2
|
mech_client/acn.py,sha256=Rj_jLPvJ5loDQfGbu3a_O24cJC4SwIErLceSz_zVYS8,5356
|
|
3
3
|
mech_client/cli.py,sha256=cJ3QAP29QsbsyITVZbCVxZ7378ql2VPaEjar9Iotj0U,9555
|
|
4
|
-
mech_client/configs/mechs.json,sha256=
|
|
4
|
+
mech_client/configs/mechs.json,sha256=vtDLYZSP8urQrkAyTx9G1R1tF4kZaHEv-sgUXzvwhgA,4710
|
|
5
5
|
mech_client/helpers/__init__.py,sha256=f13zpwGDaKQUjML-5Iq66rRfzg8IS5UNK5I8gBr7w54,1028
|
|
6
6
|
mech_client/helpers/acn/README.md,sha256=WMXR2Lk0IpWjr3vpZ8cxcTHk4gwsx4wC06UPkwj9dbQ,1641
|
|
7
7
|
mech_client/helpers/acn/__init__.py,sha256=3Yd1hUTcrtp0Kb1VmnOTC3_r-_69ozhzMqLlkNC6MkU,1141
|
|
@@ -30,15 +30,15 @@ mech_client/helpers/p2p_libp2p_client/README.md,sha256=6x9s6P7TdKkcvAS1wMFHXRz4a
|
|
|
30
30
|
mech_client/helpers/p2p_libp2p_client/__init__.py,sha256=-GOP3D_JnmXTDomrMLCbnRk7vRQmihIqTYvyIPzx-q4,879
|
|
31
31
|
mech_client/helpers/p2p_libp2p_client/connection.py,sha256=b5jfcUeSoNrUw8DOSTCbK4DTi-N8bf2_pdogUOz0ep0,28606
|
|
32
32
|
mech_client/helpers/p2p_libp2p_client/connection.yaml,sha256=nMiHnU_dv9EFjVNqZ-0SAnoATfadJSad-JsbDvk97Mk,1790
|
|
33
|
-
mech_client/interact.py,sha256=
|
|
33
|
+
mech_client/interact.py,sha256=Paf8kne8sQbvEiCsiN9qC6sZWNqZqD1npVaOfT9vR6k,21219
|
|
34
34
|
mech_client/mech_tool_management.py,sha256=XWQDcFStTK66-3ZzOwKtMo5c66KDjvbeDsIXHIP4SuU,7810
|
|
35
35
|
mech_client/prompt_to_ipfs.py,sha256=XqSIBko15MEkpWOQNT97fRI6jNxMF5EDBDEPOJFdhyk,2533
|
|
36
36
|
mech_client/push_to_ipfs.py,sha256=IfvgaPU79N_ZmCPF9d7sPCYz2uduZH0KjT_HQ2LHXoQ,2059
|
|
37
|
-
mech_client/subgraph.py,sha256=
|
|
37
|
+
mech_client/subgraph.py,sha256=6hkF8l0qxWRJ0UcdxfML6JnjYBu5BuBA6EHsHJ2nHVI,5149
|
|
38
38
|
mech_client/to_png.py,sha256=pjUcFJ63MJj_r73eqnfqCWMtlpsrj6H4ZmgvIEmRcFw,2581
|
|
39
39
|
mech_client/wss.py,sha256=hRInQjjsyOrs8dmgBb2VpJvpNt6Tx0aEiY3OhOPQvIs,6600
|
|
40
|
-
mech_client-0.2.
|
|
41
|
-
mech_client-0.2.
|
|
42
|
-
mech_client-0.2.
|
|
43
|
-
mech_client-0.2.
|
|
44
|
-
mech_client-0.2.
|
|
40
|
+
mech_client-0.2.20.post1.dist-info/LICENSE,sha256=mdBDB-mWKV5Cz4ejBzBiKqan6Z8zVLAh9xwM64O2FW4,11339
|
|
41
|
+
mech_client-0.2.20.post1.dist-info/METADATA,sha256=6tTi3LFi7P4gRhk5aS2rtfU3FFUWFk0l-LTn9kprl1o,17688
|
|
42
|
+
mech_client-0.2.20.post1.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
|
|
43
|
+
mech_client-0.2.20.post1.dist-info/entry_points.txt,sha256=SbRMRsayzD8XfNXhgwPuXEqQsdZ5Bw9XDPnUuaDExyY,45
|
|
44
|
+
mech_client-0.2.20.post1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|