mech-client 0.2.19__py3-none-any.whl → 0.2.20__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 CHANGED
@@ -1,3 +1,3 @@
1
1
  """Mech client."""
2
2
 
3
- __version__ = "0.2.19"
3
+ __version__ = "0.2.20"
@@ -58,8 +58,9 @@
58
58
  "default_gas_price_strategy": "eip1559",
59
59
  "is_gas_estimation_enabled": false
60
60
  },
61
- "gas_limit": 100000,
62
- "contract_abi_url": "https://api.basescan.org/api?module=contract&action=getabi&address={contract_address}",
61
+ "gas_limit": 250000,
62
+ "price": 3000000000000,
63
+ "contract_abi_url": "https://api.basescan.org/api?module=contract&action=getabi&address={contract_address}&apikey={api_key}",
63
64
  "transaction_url": "https://basescan.org/tx/{transaction_digest}",
64
65
  "subgraph_url": ""
65
66
  },
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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mech-client
3
- Version: 0.2.19
3
+ Version: 0.2.20
4
4
  Summary: Basic client to interact with a mech
5
5
  License: Apache-2.0
6
6
  Author: David Minarsch
@@ -1,7 +1,7 @@
1
- mech_client/__init__.py,sha256=2OIY2Ajb_pzPPnptauTqSi8S5jCYECPnMXEccSZuQu0,43
1
+ mech_client/__init__.py,sha256=6ZlYth9KUJ4ggF4ils-PYiNlfi1t9IEU3eh1BfYDJBk,43
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=IABnne1lWi62l84Hzqh3XrP659uPKme2k32yAI0HBrg,4488
4
+ mech_client/configs/mechs.json,sha256=kU7Xtn-hMi5dAPYYts_eGKnEd82FIomthbq9tt0nhtc,4537
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=nptUovTRJl7TxLjDW3sLIVMdGQfdBfQGMrW0Vh4XgO8,20879
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=4vY6QFyUVs15gS0SvanJbvAxb3aie07IuxQnfMMnStc,4931
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.19.dist-info/LICENSE,sha256=mdBDB-mWKV5Cz4ejBzBiKqan6Z8zVLAh9xwM64O2FW4,11339
41
- mech_client-0.2.19.dist-info/METADATA,sha256=8jIJGTtV9RoWG59SPZw5nFGs0PkmPQLi2ULZC7DoaHc,17682
42
- mech_client-0.2.19.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
43
- mech_client-0.2.19.dist-info/entry_points.txt,sha256=SbRMRsayzD8XfNXhgwPuXEqQsdZ5Bw9XDPnUuaDExyY,45
44
- mech_client-0.2.19.dist-info/RECORD,,
40
+ mech_client-0.2.20.dist-info/LICENSE,sha256=mdBDB-mWKV5Cz4ejBzBiKqan6Z8zVLAh9xwM64O2FW4,11339
41
+ mech_client-0.2.20.dist-info/METADATA,sha256=brf8uL73_2E6QkCW1jRhVPZpmXOIvgsj5o8ELNeCX3o,17682
42
+ mech_client-0.2.20.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
43
+ mech_client-0.2.20.dist-info/entry_points.txt,sha256=SbRMRsayzD8XfNXhgwPuXEqQsdZ5Bw9XDPnUuaDExyY,45
44
+ mech_client-0.2.20.dist-info/RECORD,,