diff --git a/multiversx_sdk_cli/accounts.py b/multiversx_sdk_cli/accounts.py index 515093b1..489f03a7 100644 --- a/multiversx_sdk_cli/accounts.py +++ b/multiversx_sdk_cli/accounts.py @@ -2,10 +2,9 @@ from pathlib import Path from typing import Any, Optional, Protocol -from multiversx_sdk_core import (Address, Message, MessageComputer, - TransactionComputer) -from multiversx_sdk_network_providers.accounts import AccountOnNetwork -from multiversx_sdk_wallet import UserSigner +from multiversx_sdk import (Address, Message, MessageComputer, + TransactionComputer, UserSigner) +from multiversx_sdk.network_providers.accounts import AccountOnNetwork from multiversx_sdk_cli.constants import DEFAULT_HRP from multiversx_sdk_cli.interfaces import IAccount, IAddress, ITransaction diff --git a/multiversx_sdk_cli/cli_accounts.py b/multiversx_sdk_cli/cli_accounts.py index 1ebf8bc6..9ae5933a 100644 --- a/multiversx_sdk_cli/cli_accounts.py +++ b/multiversx_sdk_cli/cli_accounts.py @@ -1,9 +1,7 @@ import logging from typing import Any -from multiversx_sdk_core import Address -from multiversx_sdk_network_providers.proxy_network_provider import \ - ProxyNetworkProvider +from multiversx_sdk import Address, ProxyNetworkProvider from multiversx_sdk_cli import cli_shared, utils diff --git a/multiversx_sdk_cli/cli_contracts.py b/multiversx_sdk_cli/cli_contracts.py index c6eda82a..62cc983b 100644 --- a/multiversx_sdk_cli/cli_contracts.py +++ b/multiversx_sdk_cli/cli_contracts.py @@ -3,10 +3,8 @@ from pathlib import Path from typing import Any, List -from multiversx_sdk_core import Address, AddressComputer, Transaction -from multiversx_sdk_core.transaction_factories import TransactionsFactoryConfig -from multiversx_sdk_network_providers.proxy_network_provider import \ - ProxyNetworkProvider +from multiversx_sdk import (Address, AddressComputer, ProxyNetworkProvider, + Transaction, TransactionsFactoryConfig) from multiversx_sdk_cli import cli_shared, projects, utils from multiversx_sdk_cli.cli_output import CLIOutputBuilder diff --git a/multiversx_sdk_cli/cli_delegation.py b/multiversx_sdk_cli/cli_delegation.py index 7d936c18..b5601ed8 100644 --- a/multiversx_sdk_cli/cli_delegation.py +++ b/multiversx_sdk_cli/cli_delegation.py @@ -1,8 +1,6 @@ from typing import Any, List -from multiversx_sdk_core.transaction_factories import TransactionsFactoryConfig -from multiversx_sdk_network_providers.proxy_network_provider import \ - ProxyNetworkProvider +from multiversx_sdk import ProxyNetworkProvider, TransactionsFactoryConfig from multiversx_sdk_cli import cli_shared, errors, utils from multiversx_sdk_cli.delegation import DelegationOperations diff --git a/multiversx_sdk_cli/cli_dns.py b/multiversx_sdk_cli/cli_dns.py index 3e270595..a7c8dcd6 100644 --- a/multiversx_sdk_cli/cli_dns.py +++ b/multiversx_sdk_cli/cli_dns.py @@ -1,8 +1,6 @@ from typing import Any, List -from multiversx_sdk_core import Address -from multiversx_sdk_network_providers.proxy_network_provider import \ - ProxyNetworkProvider +from multiversx_sdk import Address, ProxyNetworkProvider from prettytable import PrettyTable from multiversx_sdk_cli import cli_shared diff --git a/multiversx_sdk_cli/cli_output.py b/multiversx_sdk_cli/cli_output.py index 91560bfd..bb2fdc94 100644 --- a/multiversx_sdk_cli/cli_output.py +++ b/multiversx_sdk_cli/cli_output.py @@ -3,8 +3,7 @@ from collections import OrderedDict from typing import Any, Dict, List, Optional, Union -from multiversx_sdk_network_providers.transactions import \ - transaction_to_dictionary +from multiversx_sdk import TransactionsConverter from multiversx_sdk_cli import utils from multiversx_sdk_cli.interfaces import IAddress, ITransaction @@ -52,7 +51,8 @@ def build(self) -> Dict[str, Any]: output: Dict[str, Any] = OrderedDict() if self.emitted_transaction: - emitted_transaction_dict = transaction_to_dictionary(self.emitted_transaction) + tx_converter = TransactionsConverter() + emitted_transaction_dict = tx_converter.transaction_to_dictionary(self.emitted_transaction) emitted_transaction_hash = self.emitted_transaction_hash or "" emitted_transaction_data = self.emitted_transaction.data.decode() utils.omit_fields(emitted_transaction_dict, self.emitted_transaction_omitted_fields) diff --git a/multiversx_sdk_cli/cli_shared.py b/multiversx_sdk_cli/cli_shared.py index 48d04f2f..10ba00fe 100644 --- a/multiversx_sdk_cli/cli_shared.py +++ b/multiversx_sdk_cli/cli_shared.py @@ -5,9 +5,7 @@ from argparse import FileType from typing import Any, Dict, List, Text, cast -from multiversx_sdk_core import Address -from multiversx_sdk_network_providers.proxy_network_provider import \ - ProxyNetworkProvider +from multiversx_sdk import Address, ProxyNetworkProvider from multiversx_sdk_cli import config, errors, utils from multiversx_sdk_cli.accounts import Account, LedgerAccount diff --git a/multiversx_sdk_cli/cli_wallet.py b/multiversx_sdk_cli/cli_wallet.py index de7dd7ce..9a71f8d1 100644 --- a/multiversx_sdk_cli/cli_wallet.py +++ b/multiversx_sdk_cli/cli_wallet.py @@ -5,10 +5,8 @@ from pathlib import Path from typing import Any, List, Optional, Tuple -from multiversx_sdk_core import Address -from multiversx_sdk_wallet import UserSecretKey, UserWallet -from multiversx_sdk_wallet.mnemonic import Mnemonic -from multiversx_sdk_wallet.user_pem import UserPEM +from multiversx_sdk import (Address, Mnemonic, UserPEM, UserSecretKey, + UserWallet) from multiversx_sdk_cli import cli_shared, utils from multiversx_sdk_cli.constants import DEFAULT_HRP diff --git a/multiversx_sdk_cli/config.py b/multiversx_sdk_cli/config.py index 614857db..1ed612fc 100644 --- a/multiversx_sdk_cli/config.py +++ b/multiversx_sdk_cli/config.py @@ -3,7 +3,6 @@ from typing import Any, Dict, List from multiversx_sdk_cli import errors, utils -from multiversx_sdk_cli.ux import show_warning SDK_PATH = Path("~/multiversx-sdk").expanduser().resolve() LOCAL_CONFIG_PATH = Path("mxpy.json").resolve() diff --git a/multiversx_sdk_cli/contract_verification.py b/multiversx_sdk_cli/contract_verification.py index 7c6266da..01e833bb 100644 --- a/multiversx_sdk_cli/contract_verification.py +++ b/multiversx_sdk_cli/contract_verification.py @@ -6,7 +6,7 @@ from typing import Any, Dict, Optional, Tuple import requests -from multiversx_sdk_core import Address +from multiversx_sdk import Address from multiversx_sdk_cli.accounts import Account from multiversx_sdk_cli.errors import KnownError diff --git a/multiversx_sdk_cli/contracts.py b/multiversx_sdk_cli/contracts.py index a0a18855..515dec52 100644 --- a/multiversx_sdk_cli/contracts.py +++ b/multiversx_sdk_cli/contracts.py @@ -3,12 +3,10 @@ from pathlib import Path from typing import Any, List, Optional, Protocol, Sequence, Union -from multiversx_sdk_core import (Token, TokenComputer, TokenTransfer, - Transaction, TransactionPayload) -from multiversx_sdk_core.address import Address -from multiversx_sdk_core.transaction_factories import \ - SmartContractTransactionsFactory -from multiversx_sdk_network_providers.interface import IContractQuery +from multiversx_sdk import (Address, SmartContractTransactionsFactory, Token, + TokenComputer, TokenTransfer, Transaction, + TransactionPayload) +from multiversx_sdk.network_providers.interface import IContractQuery from multiversx_sdk_cli import errors from multiversx_sdk_cli.accounts import Account @@ -70,11 +68,13 @@ class IConfig(Protocol): chain_id: str min_gas_limit: int gas_limit_per_byte: int + gas_limit_claim_developer_rewards: int + gas_limit_change_owner_address: int class SmartContract: def __init__(self, config: IConfig): - self._factory = SmartContractTransactionsFactory(config, TokenComputer()) + self._factory = SmartContractTransactionsFactory(config) def prepare_deploy_transaction(self, owner: Account, diff --git a/multiversx_sdk_cli/cosign_transaction.py b/multiversx_sdk_cli/cosign_transaction.py index 30a3ec79..fce9e274 100644 --- a/multiversx_sdk_cli/cosign_transaction.py +++ b/multiversx_sdk_cli/cosign_transaction.py @@ -1,17 +1,17 @@ from typing import Any, Dict import requests -from multiversx_sdk_network_providers.transactions import \ - transaction_to_dictionary +from multiversx_sdk import TransactionsConverter from multiversx_sdk_cli.errors import GuardianServiceError from multiversx_sdk_cli.interfaces import ITransaction def cosign_transaction(transaction: ITransaction, service_url: str, guardian_code: str) -> ITransaction: + tx_converter = TransactionsConverter() payload = { "code": f"{guardian_code}", - "transaction": transaction_to_dictionary(transaction) + "transaction": tx_converter.transaction_to_dictionary(transaction) } url = f"{service_url}/sign-transaction" diff --git a/multiversx_sdk_cli/custom_network_provider.py b/multiversx_sdk_cli/custom_network_provider.py index 3354a495..e11c9870 100644 --- a/multiversx_sdk_cli/custom_network_provider.py +++ b/multiversx_sdk_cli/custom_network_provider.py @@ -1,6 +1,6 @@ from typing import Any, Dict, Optional, Protocol -from multiversx_sdk_network_providers import GenericError, ProxyNetworkProvider +from multiversx_sdk import GenericError, ProxyNetworkProvider from multiversx_sdk_cli.errors import ProxyError from multiversx_sdk_cli.interfaces import ISimulateResponse, ITransaction diff --git a/multiversx_sdk_cli/delegation/staking_provider.py b/multiversx_sdk_cli/delegation/staking_provider.py index 3152925e..5b9de82c 100644 --- a/multiversx_sdk_cli/delegation/staking_provider.py +++ b/multiversx_sdk_cli/delegation/staking_provider.py @@ -1,10 +1,8 @@ from pathlib import Path from typing import Any, List, Protocol, Tuple -from multiversx_sdk_core import Address -from multiversx_sdk_core.transaction_factories import \ - DelegationTransactionsFactory -from multiversx_sdk_wallet import ValidatorPublicKey +from multiversx_sdk import (Address, DelegationTransactionsFactory, + ValidatorPublicKey) from multiversx_sdk_cli.accounts import Account, LedgerAccount from multiversx_sdk_cli.cli_password import load_password diff --git a/multiversx_sdk_cli/dns.py b/multiversx_sdk_cli/dns.py index 54485a48..26fce0b9 100644 --- a/multiversx_sdk_cli/dns.py +++ b/multiversx_sdk_cli/dns.py @@ -1,7 +1,7 @@ from typing import Any, List, Protocol from Cryptodome.Hash import keccak -from multiversx_sdk_core import Address, AddressComputer +from multiversx_sdk import Address, AddressComputer from multiversx_sdk_cli import cli_shared, utils from multiversx_sdk_cli.accounts import Account diff --git a/multiversx_sdk_cli/localnet/wallets.py b/multiversx_sdk_cli/localnet/wallets.py index 2134e889..f4e3e5e2 100644 --- a/multiversx_sdk_cli/localnet/wallets.py +++ b/multiversx_sdk_cli/localnet/wallets.py @@ -3,7 +3,7 @@ from pathlib import Path from typing import Dict, Tuple -from multiversx_sdk_wallet.validator_pem import ValidatorPEM +from multiversx_sdk import ValidatorPEM from multiversx_sdk_cli import errors, utils from multiversx_sdk_cli.accounts import Account diff --git a/multiversx_sdk_cli/projects/report/data/folder_report.py b/multiversx_sdk_cli/projects/report/data/folder_report.py index 31c78064..d0559379 100644 --- a/multiversx_sdk_cli/projects/report/data/folder_report.py +++ b/multiversx_sdk_cli/projects/report/data/folder_report.py @@ -1,9 +1,12 @@ from pathlib import Path from typing import Any, List, Optional -from multiversx_sdk_cli.projects.report.data.common import first_not_none, flatten_list_of_rows, merge_values_by_key -from multiversx_sdk_cli.projects.report.data.project_report import ProjectReport, merge_list_of_projects -from multiversx_sdk_cli.projects.report.format.format_options import FormatOptions +from multiversx_sdk_cli.projects.report.data.common import ( + first_not_none, flatten_list_of_rows, merge_values_by_key) +from multiversx_sdk_cli.projects.report.data.project_report import ( + ProjectReport, merge_list_of_projects) +from multiversx_sdk_cli.projects.report.format.format_options import \ + FormatOptions class FolderReport: @@ -17,6 +20,7 @@ def to_json(self) -> Any: 'projects': self.projects } + @staticmethod def from_json(json: Any) -> 'FolderReport': projects = [ProjectReport.from_json(project) for project in json['projects']] return FolderReport(Path(json['root_path']), projects) diff --git a/multiversx_sdk_cli/sign_verify.py b/multiversx_sdk_cli/sign_verify.py index 240a843e..09b45a55 100644 --- a/multiversx_sdk_cli/sign_verify.py +++ b/multiversx_sdk_cli/sign_verify.py @@ -1,7 +1,6 @@ from typing import Dict -from multiversx_sdk_core import Address, Message, MessageComputer -from multiversx_sdk_wallet import UserVerifier +from multiversx_sdk import Address, Message, MessageComputer, UserVerifier from multiversx_sdk_cli.accounts import Account diff --git a/multiversx_sdk_cli/tests/test_cli_shared.py b/multiversx_sdk_cli/tests/test_cli_shared.py index 04944866..4a1b1107 100644 --- a/multiversx_sdk_cli/tests/test_cli_shared.py +++ b/multiversx_sdk_cli/tests/test_cli_shared.py @@ -40,7 +40,7 @@ def test_args_obj_to_list(): assert args_list[1] == contract_build_args.path assert args_list[2] == "--no-wasm-opt" - contract_build_args.ignore = "random_directory" + contract_build_args.ignore = "random_directory" # type: ignore contract_build_args.no_imports = True args_list = convert_args_object_to_args_list(contract_build_args) diff --git a/multiversx_sdk_cli/tests/test_cli_wallet.py b/multiversx_sdk_cli/tests/test_cli_wallet.py index 5255b4d3..3a8e0db6 100644 --- a/multiversx_sdk_cli/tests/test_cli_wallet.py +++ b/multiversx_sdk_cli/tests/test_cli_wallet.py @@ -3,7 +3,7 @@ from pathlib import Path from typing import Any -from multiversx_sdk_wallet import Mnemonic, UserPEM, UserWallet +from multiversx_sdk import Mnemonic, UserPEM, UserWallet from multiversx_sdk_cli.cli import main @@ -376,4 +376,4 @@ def _read_stdout(capsys: Any) -> str: def _mock_getpass(monkeypatch: Any, password: str): - monkeypatch.setattr(getpass, "getpass", lambda _: password) + monkeypatch.setattr(getpass, "getpass", lambda _: password) # type: ignore diff --git a/multiversx_sdk_cli/tests/test_contracts.py b/multiversx_sdk_cli/tests/test_contracts.py index 733969a3..de2a507b 100644 --- a/multiversx_sdk_cli/tests/test_contracts.py +++ b/multiversx_sdk_cli/tests/test_contracts.py @@ -3,7 +3,7 @@ import pytest from Cryptodome.Hash import keccak -from multiversx_sdk_core.address import Address +from multiversx_sdk import Address from multiversx_sdk_cli import errors from multiversx_sdk_cli.accounts import Account diff --git a/multiversx_sdk_cli/tests/test_proxy.py b/multiversx_sdk_cli/tests/test_proxy.py index 969aecd2..8cff09a5 100644 --- a/multiversx_sdk_cli/tests/test_proxy.py +++ b/multiversx_sdk_cli/tests/test_proxy.py @@ -1,6 +1,4 @@ -from multiversx_sdk_core import Address -from multiversx_sdk_network_providers.proxy_network_provider import \ - ProxyNetworkProvider +from multiversx_sdk import Address, ProxyNetworkProvider from multiversx_sdk_cli.accounts import Account from multiversx_sdk_cli.cli import main diff --git a/multiversx_sdk_cli/tests/test_validators_core.py b/multiversx_sdk_cli/tests/test_validators_core.py index f3a7bcce..0066b345 100644 --- a/multiversx_sdk_cli/tests/test_validators_core.py +++ b/multiversx_sdk_cli/tests/test_validators_core.py @@ -1,6 +1,6 @@ from pathlib import Path -from multiversx_sdk_core import Address +from multiversx_sdk import Address from multiversx_sdk_cli.validators.core import \ prepare_transaction_data_for_stake diff --git a/multiversx_sdk_cli/transactions.py b/multiversx_sdk_cli/transactions.py index 6f32c511..439c2a5d 100644 --- a/multiversx_sdk_cli/transactions.py +++ b/multiversx_sdk_cli/transactions.py @@ -4,7 +4,7 @@ import time from typing import Any, Dict, Optional, Protocol, TextIO -from multiversx_sdk_core import Address, Transaction, TransactionPayload +from multiversx_sdk import Address, Transaction, TransactionPayload from multiversx_sdk_cli import errors from multiversx_sdk_cli.accounts import Account, LedgerAccount diff --git a/multiversx_sdk_cli/utils.py b/multiversx_sdk_cli/utils.py index f2af91ef..a21596d4 100644 --- a/multiversx_sdk_cli/utils.py +++ b/multiversx_sdk_cli/utils.py @@ -11,10 +11,8 @@ from typing import (Any, Dict, List, Optional, Protocol, Union, runtime_checkable) -import requests_cache import toml -import multiversx_sdk_cli.config from multiversx_sdk_cli import errors logger = logging.getLogger("utils") @@ -149,17 +147,6 @@ def mark_executable(file: str) -> None: os.chmod(file, st.st_mode | stat.S_IEXEC) -def find_in_dictionary(dictionary, compound_path): - keys = compound_path.split(".") - node = dictionary - for key in keys: - node = node.get(key) - if node is None: - break - - return node - - def list_files(folder: Path, suffix: Optional[str] = None) -> List[Path]: folder = folder.expanduser() files: List[Path] = [folder / file for file in os.listdir(folder)] @@ -210,7 +197,7 @@ def str_int_to_hex_str(number_str: str) -> str: return bytes_str -def parse_keys(bls_public_keys): +def parse_keys(bls_public_keys: str): keys = bls_public_keys.split(',') parsed_keys = '' for key in keys: diff --git a/multiversx_sdk_cli/validators/core.py b/multiversx_sdk_cli/validators/core.py index 61d0c136..0e6e9f95 100644 --- a/multiversx_sdk_cli/validators/core.py +++ b/multiversx_sdk_cli/validators/core.py @@ -2,9 +2,7 @@ from pathlib import Path from typing import Any, List, Tuple, Union -from multiversx_sdk_core import Address -from multiversx_sdk_wallet.validator_pem import ValidatorPEM -from multiversx_sdk_wallet.validator_signer import ValidatorSigner +from multiversx_sdk import Address, ValidatorPEM, ValidatorSigner from multiversx_sdk_cli import utils from multiversx_sdk_cli.accounts import Account diff --git a/multiversx_sdk_cli/validators/validators_file.py b/multiversx_sdk_cli/validators/validators_file.py index 4a664aac..ab10535a 100644 --- a/multiversx_sdk_cli/validators/validators_file.py +++ b/multiversx_sdk_cli/validators/validators_file.py @@ -2,9 +2,7 @@ from pathlib import Path from typing import Dict, List -from multiversx_sdk_wallet import ValidatorSigner -from multiversx_sdk_wallet.validator_keys import ValidatorPublicKey -from multiversx_sdk_wallet.validator_pem import ValidatorPEM +from multiversx_sdk import ValidatorPEM, ValidatorPublicKey, ValidatorSigner from multiversx_sdk_cli import guards from multiversx_sdk_cli.errors import CannotReadValidatorsData diff --git a/pyproject.toml b/pyproject.toml index da76bd45..ac423476 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,9 +27,7 @@ dependencies = [ "semver", "requests-cache", "rich==13.3.4", - "multiversx-sdk-network-providers>=0.13.0,<0.14.0", - "multiversx-sdk-wallet>=0.9.0,<0.10.0", - "multiversx-sdk-core>=0.8.0,<0.9.0", + "multiversx-sdk>=0.9.2,<1.0.0", "argcomplete==3.2.2" ] diff --git a/requirements.txt b/requirements.txt index 1d7aa8f9..c6f46432 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,6 +10,4 @@ requests-cache rich==13.3.4 argcomplete==3.2.2 -multiversx-sdk-core>=0.8.0,<0.9.0 -multiversx-sdk-network-providers>=0.13.0,<0.14.0 -multiversx-sdk-wallet>=0.9.0,<0.10.0 +multiversx-sdk>=0.9.2,<1.0.0