olas-operate-middleware 0.1.0rc59__py3-none-any.whl → 0.13.2__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.
- olas_operate_middleware-0.13.2.dist-info/METADATA +75 -0
- olas_operate_middleware-0.13.2.dist-info/RECORD +101 -0
- {olas_operate_middleware-0.1.0rc59.dist-info → olas_operate_middleware-0.13.2.dist-info}/WHEEL +1 -1
- operate/__init__.py +17 -0
- operate/account/user.py +35 -9
- operate/bridge/bridge_manager.py +470 -0
- operate/bridge/providers/lifi_provider.py +377 -0
- operate/bridge/providers/native_bridge_provider.py +677 -0
- operate/bridge/providers/provider.py +469 -0
- operate/bridge/providers/relay_provider.py +457 -0
- operate/cli.py +1565 -417
- operate/constants.py +60 -12
- operate/data/README.md +19 -0
- operate/data/contracts/{service_staking_token → dual_staking_token}/__init__.py +2 -2
- operate/data/contracts/dual_staking_token/build/DualStakingToken.json +443 -0
- operate/data/contracts/dual_staking_token/contract.py +132 -0
- operate/data/contracts/dual_staking_token/contract.yaml +23 -0
- operate/{ledger/base.py → data/contracts/foreign_omnibridge/__init__.py} +2 -19
- operate/data/contracts/foreign_omnibridge/build/ForeignOmnibridge.json +1372 -0
- operate/data/contracts/foreign_omnibridge/contract.py +130 -0
- operate/data/contracts/foreign_omnibridge/contract.yaml +23 -0
- operate/{ledger/solana.py → data/contracts/home_omnibridge/__init__.py} +2 -20
- operate/data/contracts/home_omnibridge/build/HomeOmnibridge.json +1421 -0
- operate/data/contracts/home_omnibridge/contract.py +80 -0
- operate/data/contracts/home_omnibridge/contract.yaml +23 -0
- operate/data/contracts/l1_standard_bridge/__init__.py +20 -0
- operate/data/contracts/l1_standard_bridge/build/L1StandardBridge.json +831 -0
- operate/data/contracts/l1_standard_bridge/contract.py +158 -0
- operate/data/contracts/l1_standard_bridge/contract.yaml +23 -0
- operate/data/contracts/l2_standard_bridge/__init__.py +20 -0
- operate/data/contracts/l2_standard_bridge/build/L2StandardBridge.json +626 -0
- operate/data/contracts/l2_standard_bridge/contract.py +130 -0
- operate/data/contracts/l2_standard_bridge/contract.yaml +23 -0
- operate/data/contracts/mech_activity/__init__.py +20 -0
- operate/data/contracts/mech_activity/build/MechActivity.json +111 -0
- operate/data/contracts/mech_activity/contract.py +44 -0
- operate/data/contracts/mech_activity/contract.yaml +23 -0
- operate/data/contracts/optimism_mintable_erc20/__init__.py +20 -0
- operate/data/contracts/optimism_mintable_erc20/build/OptimismMintableERC20.json +491 -0
- operate/data/contracts/optimism_mintable_erc20/contract.py +45 -0
- operate/data/contracts/optimism_mintable_erc20/contract.yaml +23 -0
- operate/data/contracts/recovery_module/__init__.py +20 -0
- operate/data/contracts/recovery_module/build/RecoveryModule.json +811 -0
- operate/data/contracts/recovery_module/contract.py +61 -0
- operate/data/contracts/recovery_module/contract.yaml +23 -0
- operate/data/contracts/requester_activity_checker/__init__.py +20 -0
- operate/data/contracts/requester_activity_checker/build/RequesterActivityChecker.json +111 -0
- operate/data/contracts/requester_activity_checker/contract.py +33 -0
- operate/data/contracts/requester_activity_checker/contract.yaml +23 -0
- operate/data/contracts/staking_token/__init__.py +20 -0
- operate/data/contracts/staking_token/build/StakingToken.json +1336 -0
- operate/data/contracts/{service_staking_token → staking_token}/contract.py +27 -13
- operate/data/contracts/staking_token/contract.yaml +23 -0
- operate/data/contracts/uniswap_v2_erc20/contract.yaml +3 -1
- operate/data/contracts/uniswap_v2_erc20/tests/__init__.py +20 -0
- operate/data/contracts/uniswap_v2_erc20/tests/test_contract.py +363 -0
- operate/keys.py +118 -33
- operate/ledger/__init__.py +159 -56
- operate/ledger/profiles.py +321 -18
- operate/migration.py +555 -0
- operate/{http → operate_http}/__init__.py +3 -2
- operate/{http → operate_http}/exceptions.py +6 -4
- operate/operate_types.py +544 -0
- operate/pearl.py +13 -1
- operate/quickstart/analyse_logs.py +118 -0
- operate/quickstart/claim_staking_rewards.py +104 -0
- operate/quickstart/reset_configs.py +106 -0
- operate/quickstart/reset_password.py +70 -0
- operate/quickstart/reset_staking.py +145 -0
- operate/quickstart/run_service.py +726 -0
- operate/quickstart/stop_service.py +72 -0
- operate/quickstart/terminate_on_chain_service.py +83 -0
- operate/quickstart/utils.py +298 -0
- operate/resource.py +62 -3
- operate/services/agent_runner.py +202 -0
- operate/services/deployment_runner.py +868 -0
- operate/services/funding_manager.py +929 -0
- operate/services/health_checker.py +280 -0
- operate/services/manage.py +2356 -620
- operate/services/protocol.py +1246 -340
- operate/services/service.py +756 -391
- operate/services/utils/mech.py +103 -0
- operate/services/utils/tendermint.py +86 -12
- operate/settings.py +70 -0
- operate/utils/__init__.py +135 -0
- operate/utils/gnosis.py +407 -80
- operate/utils/single_instance.py +226 -0
- operate/utils/ssl.py +133 -0
- operate/wallet/master.py +708 -123
- operate/wallet/wallet_recovery_manager.py +507 -0
- olas_operate_middleware-0.1.0rc59.dist-info/METADATA +0 -304
- olas_operate_middleware-0.1.0rc59.dist-info/RECORD +0 -41
- operate/data/contracts/service_staking_token/build/ServiceStakingToken.json +0 -1273
- operate/data/contracts/service_staking_token/contract.yaml +0 -23
- operate/ledger/ethereum.py +0 -48
- operate/types.py +0 -260
- {olas_operate_middleware-0.1.0rc59.dist-info → olas_operate_middleware-0.13.2.dist-info}/entry_points.txt +0 -0
- {olas_operate_middleware-0.1.0rc59.dist-info → olas_operate_middleware-0.13.2.dist-info/licenses}/LICENSE +0 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# ------------------------------------------------------------------------------
|
|
3
|
+
#
|
|
4
|
+
# Copyright 2024 Valory AG
|
|
5
|
+
#
|
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
# you may not use this file except in compliance with the License.
|
|
8
|
+
# You may obtain a copy of the License at
|
|
9
|
+
#
|
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
#
|
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
# See the License for the specific language governing permissions and
|
|
16
|
+
# limitations under the License.
|
|
17
|
+
#
|
|
18
|
+
# ------------------------------------------------------------------------------
|
|
19
|
+
|
|
20
|
+
"""This module contains the class to connect to the `ForeignOmnibridge` contract."""
|
|
21
|
+
|
|
22
|
+
from typing import Optional, cast
|
|
23
|
+
|
|
24
|
+
import eth_abi
|
|
25
|
+
from aea.configurations.base import PublicId
|
|
26
|
+
from aea.contracts.base import Contract
|
|
27
|
+
from aea.crypto.base import LedgerApi
|
|
28
|
+
from aea_ledger_ethereum import EthereumApi
|
|
29
|
+
from web3 import Web3
|
|
30
|
+
from web3.types import BlockIdentifier
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class HomeOmnibridge(Contract):
|
|
34
|
+
"""HomeOmnibridge."""
|
|
35
|
+
|
|
36
|
+
contract_id = PublicId.from_str("valory/home_omnibridge:0.1.0")
|
|
37
|
+
|
|
38
|
+
@classmethod
|
|
39
|
+
def find_tokens_bridged_tx(
|
|
40
|
+
cls,
|
|
41
|
+
ledger_api: LedgerApi,
|
|
42
|
+
contract_address: str,
|
|
43
|
+
token: str,
|
|
44
|
+
recipient: str,
|
|
45
|
+
value: int,
|
|
46
|
+
message_id: str,
|
|
47
|
+
from_block: BlockIdentifier = "earliest",
|
|
48
|
+
to_block: BlockIdentifier = "latest",
|
|
49
|
+
) -> Optional[str]:
|
|
50
|
+
"""Return the transaction hash of the matching TokensBridged event in the given block range."""
|
|
51
|
+
ledger_api = cast(EthereumApi, ledger_api)
|
|
52
|
+
event_signature = "TokensBridged(address,address,uint256,bytes32)"
|
|
53
|
+
event_signature_hash = Web3.keccak(text=event_signature).hex()
|
|
54
|
+
|
|
55
|
+
topics = [
|
|
56
|
+
event_signature_hash, # TokensBridged
|
|
57
|
+
"0x" + token.lower()[2:].rjust(64, "0"), # token
|
|
58
|
+
"0x" + recipient.lower()[2:].rjust(64, "0"), # recipient
|
|
59
|
+
"0x" + message_id.lower()[2:].rjust(64, "0"), # messageId
|
|
60
|
+
]
|
|
61
|
+
non_indexed_types = ["uint256"]
|
|
62
|
+
non_indexed_values = [
|
|
63
|
+
value, # value
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
logs = ledger_api.api.eth.get_logs(
|
|
67
|
+
{
|
|
68
|
+
"fromBlock": from_block,
|
|
69
|
+
"toBlock": to_block,
|
|
70
|
+
"address": contract_address,
|
|
71
|
+
"topics": topics,
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
for log in logs:
|
|
76
|
+
decoded = eth_abi.decode(non_indexed_types, log["data"])
|
|
77
|
+
if all(a == b for a, b in zip(decoded, non_indexed_values)):
|
|
78
|
+
return log["transactionHash"].hex()
|
|
79
|
+
|
|
80
|
+
return None
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: home_omnibridge
|
|
2
|
+
author: valory
|
|
3
|
+
version: 0.1.0
|
|
4
|
+
type: contract
|
|
5
|
+
description: HomeOmnibridge
|
|
6
|
+
license: Apache-2.0
|
|
7
|
+
aea_version: '>=1.0.0, <2.0.0'
|
|
8
|
+
fingerprint:
|
|
9
|
+
__init__.py: bafybeigrlrmwk3dhnoe4o5ovygtmudik7ybhsx2etqqjpvdi65rtlfpuhe
|
|
10
|
+
build/HomeOmnibridge.json: bafybeihm4ff4mhoca2iwcogg5srqe2x6p674uxxc3v5dcci4emxfgc7qpm
|
|
11
|
+
contract.py: bafybeifitn7z4oqvycixw56lvrzvifydqyhwtph3nlaivzcm22ogn4rmfq
|
|
12
|
+
fingerprint_ignore_patterns: []
|
|
13
|
+
contracts: []
|
|
14
|
+
class_name: HomeOmnibridge
|
|
15
|
+
contract_interface_paths:
|
|
16
|
+
ethereum: build/HomeOmnibridge.json
|
|
17
|
+
dependencies:
|
|
18
|
+
open-aea-ledger-ethereum:
|
|
19
|
+
version: ==1.60.0
|
|
20
|
+
open-aea-test-autonomy:
|
|
21
|
+
version: ==0.18.3
|
|
22
|
+
web3:
|
|
23
|
+
version: <7,>=6.0.0
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# ------------------------------------------------------------------------------
|
|
3
|
+
#
|
|
4
|
+
# Copyright 2024 Valory AG
|
|
5
|
+
#
|
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
# you may not use this file except in compliance with the License.
|
|
8
|
+
# You may obtain a copy of the License at
|
|
9
|
+
#
|
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
#
|
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
# See the License for the specific language governing permissions and
|
|
16
|
+
# limitations under the License.
|
|
17
|
+
#
|
|
18
|
+
# ------------------------------------------------------------------------------
|
|
19
|
+
|
|
20
|
+
"""This module contains the support resources for the `L1StandardBridge` contract."""
|