mech-client 0.2.19__tar.gz → 0.2.20.post1__tar.gz

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.
Files changed (44) hide show
  1. {mech_client-0.2.19 → mech_client-0.2.20.post1}/PKG-INFO +1 -1
  2. mech_client-0.2.20.post1/mech_client/__init__.py +3 -0
  3. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/configs/mechs.json +9 -3
  4. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/interact.py +10 -0
  5. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/subgraph.py +4 -0
  6. {mech_client-0.2.19 → mech_client-0.2.20.post1}/pyproject.toml +1 -1
  7. mech_client-0.2.19/mech_client/__init__.py +0 -3
  8. {mech_client-0.2.19 → mech_client-0.2.20.post1}/LICENSE +0 -0
  9. {mech_client-0.2.19 → mech_client-0.2.20.post1}/README.md +0 -0
  10. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/acn.py +0 -0
  11. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/cli.py +0 -0
  12. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/__init__.py +0 -0
  13. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn/README.md +0 -0
  14. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn/__init__.py +0 -0
  15. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn/acn.proto +0 -0
  16. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn/acn_pb2.py +0 -0
  17. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn/custom_types.py +0 -0
  18. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn/dialogues.py +0 -0
  19. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn/message.py +0 -0
  20. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn/protocol.yaml +0 -0
  21. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn/serialization.py +0 -0
  22. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn/tests/__init__.py +0 -0
  23. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn/tests/test_acn.py +0 -0
  24. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn/tests/test_acn_dialogues.py +0 -0
  25. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn/tests/test_acn_messages.py +0 -0
  26. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn_data_share/README.md +0 -0
  27. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn_data_share/__init__.py +0 -0
  28. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn_data_share/acn_data_share.proto +0 -0
  29. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn_data_share/acn_data_share_pb2.py +0 -0
  30. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn_data_share/dialogues.py +0 -0
  31. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn_data_share/message.py +0 -0
  32. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn_data_share/protocol.yaml +0 -0
  33. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn_data_share/serialization.py +0 -0
  34. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn_data_share/tests/test_acn_data_share_dialogues.py +0 -0
  35. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/acn_data_share/tests/test_acn_data_share_messages.py +0 -0
  36. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/p2p_libp2p_client/README.md +0 -0
  37. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/p2p_libp2p_client/__init__.py +0 -0
  38. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/p2p_libp2p_client/connection.py +0 -0
  39. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/helpers/p2p_libp2p_client/connection.yaml +0 -0
  40. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/mech_tool_management.py +0 -0
  41. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/prompt_to_ipfs.py +0 -0
  42. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/push_to_ipfs.py +0 -0
  43. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/to_png.py +0 -0
  44. {mech_client-0.2.19 → mech_client-0.2.20.post1}/mech_client/wss.py +0 -0
@@ -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.post1
4
4
  Summary: Basic client to interact with a mech
5
5
  License: Apache-2.0
6
6
  Author: David Minarsch
@@ -0,0 +1,3 @@
1
+ """Mech client."""
2
+
3
+ __version__ = "0.2.20.post1"
@@ -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": 100000,
62
- "contract_abi_url": "https://api.basescan.org/api?module=contract&action=getabi&address={contract_address}",
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
+ }
@@ -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,
@@ -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
  [tool.poetry]
2
2
  name = "mech-client"
3
- version = "0.2.19"
3
+ version = "0.2.20.post1"
4
4
  description = "Basic client to interact with a mech"
5
5
  authors = ["David Minarsch <david.minarsch@googlemail.com>"]
6
6
  readme = "README.md"
@@ -1,3 +0,0 @@
1
- """Mech client."""
2
-
3
- __version__ = "0.2.19"
File without changes