olas-operate-middleware 0.10.15__py3-none-any.whl → 0.10.17__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: olas-operate-middleware
3
- Version: 0.10.15
3
+ Version: 0.10.17
4
4
  Summary:
5
5
  License-File: LICENSE
6
6
  Author: David Vilela
@@ -14,7 +14,7 @@ Requires-Dist: aiohttp (==3.9.5)
14
14
  Requires-Dist: argon2-cffi (==23.1.0)
15
15
  Requires-Dist: clea (==0.1.0rc4)
16
16
  Requires-Dist: cytoolz (==0.12.3)
17
- Requires-Dist: deepdiff (>=8.0.1,<9.0.0)
17
+ Requires-Dist: deepdiff (>=8.6.1,<9.0.0)
18
18
  Requires-Dist: docker (==6.1.2)
19
19
  Requires-Dist: eth-abi (==4.0.0)
20
20
  Requires-Dist: eth-account (==0.8.0)
@@ -6,7 +6,7 @@ operate/bridge/providers/lifi_provider.py,sha256=FpAlBAA_gOt-oOHKhGaOQhhTZIL-hgY
6
6
  operate/bridge/providers/native_bridge_provider.py,sha256=gG8bSyxUoAVEF6_J9tn1qKRv1PnXuMJdMwUAVJ4GJz8,24647
7
7
  operate/bridge/providers/provider.py,sha256=i54RL7m4wMSADM_D_V_quQump_ipPTmByUc-c-AOLPQ,19687
8
8
  operate/bridge/providers/relay_provider.py,sha256=L7D-PKepsuBadarJmrNneZk0bsrh88u05uD6_2MSss4,17341
9
- operate/cli.py,sha256=eijw4jzmqHpXqYk5wTgigkgmWfp16ZhY9XQVun9RU7s,56135
9
+ operate/cli.py,sha256=szRqOnL3xCj7MmNcjY-zQCymJ5TGjqEUUN4j-noPNL4,56983
10
10
  operate/constants.py,sha256=p_kYu4YyMnoZKHVrhhSjJlCCjWxRdSIzWfvQQeO8Ud4,3030
11
11
  operate/data/README.md,sha256=jGPyZTvg2LCGdllvmYxmFMkkkiXb6YWatbqIkcX3kv4,879
12
12
  operate/data/__init__.py,sha256=ttC51Yqk9c4ehpIgs1Qbe7aJvzkrbbdZ1ClaCxJYByE,864
@@ -60,7 +60,7 @@ operate/data/contracts/uniswap_v2_erc20/tests/test_contract.py,sha256=FzZbw9OTcr
60
60
  operate/keys.py,sha256=mPZ2KZujPjHZ1RNVD2vkLzK_3q6J32o9q0WCB6Raxs4,5237
61
61
  operate/ledger/__init__.py,sha256=hGTrWaPBRCodIFYUKVzfx_t_kpDa7SYyFjat8OhNRqA,3026
62
62
  operate/ledger/profiles.py,sha256=LaYPyz-1Cy-KRRuXk60W0ZXQJ2cwoWmDxYrL_psIdKo,11993
63
- operate/migration.py,sha256=mh921s8FG48XMfDu63ojrdhU7j_RZsdl5E2BvxsbkWE,16937
63
+ operate/migration.py,sha256=TJhztfHUVhZ2buKHx10vXeVo1rRAORdbqGE8fLHL15I,17305
64
64
  operate/operate_http/__init__.py,sha256=dxCIVSUos23M4R-PFZZG6k5QrOlEiK0SxhCYSFNxh7U,4711
65
65
  operate/operate_http/exceptions.py,sha256=4UFzrn-GyDD71RhkaOyFPBynL6TrrtP3eywaaU3o4fc,1339
66
66
  operate/operate_types.py,sha256=oVOzd6K_CTbmAe1pbSFr4LCajNJ_n0y6J5Wwdf_6ev8,8102
@@ -81,7 +81,7 @@ operate/services/deployment_runner.py,sha256=Su73o7cdH6fkQfj468K77J04a_TWiokJwbM
81
81
  operate/services/health_checker.py,sha256=MuGZ0pQ7zyJVbNU9FJR5gR8zTE7z7kCH1h5Ampv9IC0,9837
82
82
  operate/services/manage.py,sha256=FxhL2Zm46DOuCBnp8C1_i9dCwq4x9Jpo0QFsEeLDcU0,118436
83
83
  operate/services/protocol.py,sha256=FoJmHz5nukI01-VYtReMsIl3JT5RgZZSLX-mf9EXQ90,62903
84
- operate/services/service.py,sha256=-XM4BLNsgoTG8wgw5QsfvvC6TJfiZW-gC-Ela2HGx6g,39327
84
+ operate/services/service.py,sha256=9UVscczt6GnDGGZtKix5-cg28fknD9MJdoi_-fyFLRw,39514
85
85
  operate/services/utils/__init__.py,sha256=TvioaZ1mfTRUSCtrQoLNAp4WMVXyqEJqFJM4PxSQCRU,24
86
86
  operate/services/utils/mech.py,sha256=W2x4dqodivNKXjWU-Brp40QhoUHsIMyNAO7-caMoR0Q,3821
87
87
  operate/services/utils/tendermint.py,sha256=3h9nDb2Z89T0RwUr_AaVjqtymQmsu3u6DAVCfL_k1U0,25591
@@ -89,10 +89,10 @@ operate/utils/__init__.py,sha256=DZNUgg0V9yfNfDrUynp10PErSieJkoxU0AKvsEFIhAw,467
89
89
  operate/utils/gnosis.py,sha256=CS07ZqvrO7uelkFe09VMyPBcLzKONUI1ZqFvi41BDhc,17924
90
90
  operate/utils/ssl.py,sha256=O5DrDoZD4T4qQuHP8GLwWUVxQ-1qXeefGp6uDJiF2lM,4308
91
91
  operate/wallet/__init__.py,sha256=NGiozD3XhvkBi7_FaOWQ8x1thZPK4uGpokJaeDY_o2w,813
92
- operate/wallet/master.py,sha256=jLFLcRgO6ADok2DigpK59PFJ4mnc_0H9a4RRioYzlvw,30811
92
+ operate/wallet/master.py,sha256=l5YLP08dBTBaiIV6Hj5Xe8WIvxuncMckzEG0y_thUUU,30924
93
93
  operate/wallet/wallet_recovery_manager.py,sha256=sXEZyvFMePxQKf9NJg4HT90mPg4-7ZcTbvggMnKKzhA,7795
94
- olas_operate_middleware-0.10.15.dist-info/METADATA,sha256=Z8j_Lc1n0BzYOBbZubAlPJ_ibninNGogZjrTeT2WHaY,2058
95
- olas_operate_middleware-0.10.15.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
96
- olas_operate_middleware-0.10.15.dist-info/entry_points.txt,sha256=dM1g2I7ODApKQFcgl5J4NGA7pfBTo6qsUTXM-j2OLlw,44
97
- olas_operate_middleware-0.10.15.dist-info/licenses/LICENSE,sha256=mdBDB-mWKV5Cz4ejBzBiKqan6Z8zVLAh9xwM64O2FW4,11339
98
- olas_operate_middleware-0.10.15.dist-info/RECORD,,
94
+ olas_operate_middleware-0.10.17.dist-info/METADATA,sha256=R44AbuIMD_pHN3ufyVx7ZQNCtYtNggBd_VFdPC_KkiQ,2058
95
+ olas_operate_middleware-0.10.17.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
96
+ olas_operate_middleware-0.10.17.dist-info/entry_points.txt,sha256=dM1g2I7ODApKQFcgl5J4NGA7pfBTo6qsUTXM-j2OLlw,44
97
+ olas_operate_middleware-0.10.17.dist-info/licenses/LICENSE,sha256=mdBDB-mWKV5Cz4ejBzBiKqan6Z8zVLAh9xwM64O2FW4,11339
98
+ olas_operate_middleware-0.10.17.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.2.0
2
+ Generator: poetry-core 2.2.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
operate/cli.py CHANGED
@@ -751,7 +751,7 @@ def create_app( # pylint: disable=too-many-locals, unused-argument, too-many-st
751
751
  )[wallet.address]
752
752
  initial_funds = subtract_dicts(balances, DEFAULT_MASTER_EOA_FUNDS[chain])
753
753
 
754
- logger.info(f"POST /api/wallet/safe Computed {initial_funds=}")
754
+ logger.info(f"_create_safe Computed {initial_funds=}")
755
755
 
756
756
  try:
757
757
  create_tx = wallet.create_safe( # pylint: disable=no-member
@@ -763,6 +763,9 @@ def create_app( # pylint: disable=too-many-locals, unused-argument, too-many-st
763
763
 
764
764
  transfer_txs = {}
765
765
  for asset, amount in initial_funds.items():
766
+ logger.info(
767
+ f"_create_safe Transfer to={safe_address} {amount=} {chain} {asset=}"
768
+ )
766
769
  tx_hash = wallet.transfer_asset(
767
770
  to=safe_address,
768
771
  amount=int(amount),
@@ -862,6 +865,19 @@ def create_app( # pylint: disable=too-many-locals, unused-argument, too-many-st
862
865
  content={service_id: service_id in _services for service_id in service_ids}
863
866
  )
864
867
 
868
+ @app.get("/api/v2/services/deployment")
869
+ @with_retries
870
+ async def _get_services_deployment(request: Request) -> JSONResponse:
871
+ """Get a service deployment."""
872
+ service_manager = operate.service_manager()
873
+ output = {}
874
+ for service in service_manager.get_all_services()[0]:
875
+ deployment_json = service.deployment.json
876
+ deployment_json["healthcheck"] = service.get_latest_healthcheck()
877
+ output[service.service_config_id] = deployment_json
878
+
879
+ return JSONResponse(content=output)
880
+
865
881
  @app.get("/api/v2/service/{service_config_id}")
866
882
  @with_retries
867
883
  async def _get_service(request: Request) -> JSONResponse:
@@ -1380,8 +1396,12 @@ def qs_start(
1380
1396
  @_operate.command(name="quickstop")
1381
1397
  def qs_stop(
1382
1398
  config: Annotated[str, params.String(help="Quickstart config file path")],
1399
+ attended: Annotated[
1400
+ str, params.String(help="Run in attended/unattended mode (default: true")
1401
+ ] = "true",
1383
1402
  ) -> None:
1384
- """Quickstart."""
1403
+ """Quickstop."""
1404
+ os.environ["ATTENDED"] = attended.lower()
1385
1405
  operate = OperateApp()
1386
1406
  operate.setup()
1387
1407
  stop_service(operate=operate, config_path=config)
operate/migration.py CHANGED
@@ -348,6 +348,14 @@ class MigrationManager:
348
348
  del data["keys"]
349
349
 
350
350
  if version < 8:
351
+ for _, chain_data in data.get("chain_configs", {}).items():
352
+ if chain_data["chain_data"]["multisig"] == "0xm":
353
+ chain_data["chain_data"]["multisig"] = NON_EXISTENT_MULTISIG
354
+
355
+ if "keys" in data:
356
+ data["agent_addresses"] = [key["address"] for key in data["keys"]]
357
+ del data["keys"]
358
+
351
359
  if data["home_chain"] == "optimistic":
352
360
  data["home_chain"] = Chain.OPTIMISM.value
353
361
 
@@ -736,6 +736,13 @@ class Service(LocalResource):
736
736
 
737
737
  _file = CONFIG_JSON
738
738
 
739
+ @property
740
+ def json(self) -> t.Dict:
741
+ """To dictionary object."""
742
+ obj = super().json
743
+ obj["service_public_id"] = self.service_public_id()
744
+ return obj
745
+
739
746
  @staticmethod
740
747
  def determine_agent_id(service_name: str) -> int:
741
748
  """Determine the appropriate agent ID based on service name."""
operate/wallet/master.py CHANGED
@@ -352,7 +352,8 @@ class EthereumMasterWallet(MasterWallet):
352
352
  {
353
353
  "from": wallet_address,
354
354
  "gas": 1,
355
- "gasPrice": ledger_api.api.eth.gas_price,
355
+ "maxFeePerGas": 1,
356
+ "maxPriorityFeePerGas": 1,
356
357
  "nonce": ledger_api.api.eth.get_transaction_count(wallet_address),
357
358
  }
358
359
  )
@@ -362,7 +363,12 @@ class EthereumMasterWallet(MasterWallet):
362
363
  )
363
364
 
364
365
  setattr(tx_settler, "build", _build_transfer_tx) # noqa: B010
365
- tx_receipt = tx_settler.transact(lambda x: x, "", kwargs={})
366
+ tx_receipt = tx_settler.transact(
367
+ method=lambda: {},
368
+ contract="",
369
+ kwargs={},
370
+ dry_run=False,
371
+ )
366
372
  tx_hash = tx_receipt.get("transactionHash", "").hex()
367
373
  return tx_hash
368
374