diff --git a/CLI.md b/CLI.md index c388fdd5..9c8e9845 100644 --- a/CLI.md +++ b/CLI.md @@ -130,9 +130,10 @@ options: mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender --proxy PROXY 🔗 the URL of the proxy - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -222,9 +223,10 @@ options: mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender --proxy PROXY 🔗 the URL of the proxy - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -324,9 +326,10 @@ options: mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender --proxy PROXY 🔗 the URL of the proxy - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -501,9 +504,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --receiver RECEIVER 🖄 the address of the receiver --receiver-username RECEIVER_USERNAME 🖄 the username of the receiver --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) @@ -720,9 +724,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -775,9 +780,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -828,9 +834,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -881,9 +888,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -934,9 +942,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -987,9 +996,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -1039,9 +1049,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -1092,9 +1103,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -1145,9 +1157,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -1198,9 +1211,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -1251,9 +1265,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -1303,9 +1318,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -1395,9 +1411,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -1466,9 +1483,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -1521,9 +1539,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -1576,9 +1595,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -1631,9 +1651,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -1686,9 +1707,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -1741,9 +1763,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -1794,9 +1817,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -1847,9 +1871,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -1900,9 +1925,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -1953,9 +1979,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -2006,9 +2033,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -2060,9 +2088,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -2114,9 +2143,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -2169,9 +2199,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -2224,9 +2255,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -2280,9 +2312,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -2336,9 +2369,10 @@ options: --sender-wallet-index SENDER_WALLET_INDEX 🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender - --nonce NONCE # the nonce for the transaction + --nonce NONCE # the nonce for the transaction. If not provided, is fetched from the + network. --recall-nonce ⭮ whether to recall the nonce when creating the transaction (default: - False) + False). This argument is OBSOLETE. --gas-price GAS_PRICE ⛽ the gas price (default: 1000000000) --gas-limit GAS_LIMIT ⛽ the gas limit --value VALUE the value to transfer (default: 0) @@ -2997,5 +3031,7 @@ options: or Ledger devices (default: 0) --sender-username SENDER_USERNAME 🖄 the username of the sender --chain {D,T} the chain identifier + --api API custom api url for the native auth client + --wallet-url WALLET_URL custom wallet url to call the faucet from ``` diff --git a/multiversx_sdk_cli/args_validation.py b/multiversx_sdk_cli/args_validation.py index 1829ccf0..c15b290b 100644 --- a/multiversx_sdk_cli/args_validation.py +++ b/multiversx_sdk_cli/args_validation.py @@ -10,13 +10,11 @@ def validate_transaction_args(args: Any): def validate_nonce_args(args: Any): - """If nonce is not provided, ensure that recall_nonce is provided. If recall_nonce is provided, ensure that proxy is provided.""" + """If nonce is not provided, ensure that proxy is provided.""" if hasattr(args, "nonce") and args.nonce is None: - if not args.recall_nonce: - raise InvalidArgumentsError("Either --nonce or --recall-nonce must be provided") if hasattr(args, "proxy") and not args.proxy: - raise InvalidArgumentsError("--proxy must be provided if --recall-nonce is used") + raise InvalidArgumentsError("--proxy must be provided if --nonce is not provided") def validate_receiver_args(args: Any): diff --git a/multiversx_sdk_cli/cli.py b/multiversx_sdk_cli/cli.py index 8bf57fd8..00519941 100644 --- a/multiversx_sdk_cli/cli.py +++ b/multiversx_sdk_cli/cli.py @@ -66,6 +66,9 @@ def _do_main(cli_args: list[str]): default_hrp = config.get_address_hrp() LibraryConfig.default_address_hrp = default_hrp + if hasattr(args, "recall_nonce") and args.recall_nonce: + logger.warning("The --recall-nonce flag is DEPRECATED. The nonce is fetched from the network by default.") + if not hasattr(args, "func"): parser.print_help() else: diff --git a/multiversx_sdk_cli/cli_faucet.py b/multiversx_sdk_cli/cli_faucet.py index a9700528..fab50a27 100644 --- a/multiversx_sdk_cli/cli_faucet.py +++ b/multiversx_sdk_cli/cli_faucet.py @@ -6,7 +6,7 @@ from multiversx_sdk import Message, NativeAuthClient, NativeAuthClientConfig from multiversx_sdk_cli import cli_shared -from multiversx_sdk_cli.errors import BadUserInput +from multiversx_sdk_cli.errors import ArgumentsNotProvidedError, BadUserInput logger = logging.getLogger("cli.faucet") @@ -27,7 +27,9 @@ def setup_parser(args: list[str], subparsers: Any) -> Any: sub = cli_shared.add_command_subparser(subparsers, "faucet", "request", "Request xEGLD.") cli_shared.add_wallet_args(args, sub) - sub.add_argument("--chain", required=True, choices=["D", "T"], help="the chain identifier") + sub.add_argument("--chain", choices=["D", "T"], help="the chain identifier") + sub.add_argument("--api", type=str, help="custom api url for the native auth client") + sub.add_argument("--wallet-url", type=str, help="custom wallet url to call the faucet from") sub.set_defaults(func=faucet) parser.epilog = cli_shared.build_group_epilog(subparsers) @@ -59,6 +61,9 @@ def call_web_wallet_faucet(wallet_url: str, access_token: str): def get_wallet_and_api_urls(args: Any) -> tuple[str, str]: chain: str = args.chain + if not chain: + return get_custom_wallet_and_api_urls(args) + if chain.upper() == "D": return WebWalletUrls.DEVNET.value, ApiUrls.DEVNET.value @@ -66,3 +71,16 @@ def get_wallet_and_api_urls(args: Any) -> tuple[str, str]: return WebWalletUrls.TESTNET.value, ApiUrls.TESTNET.value raise BadUserInput("Invalid chain id. Choose between 'D' for devnet and 'T' for testnet.") + + +def get_custom_wallet_and_api_urls(args: Any) -> tuple[str, str]: + wallet = args.wallet_url + api = args.api + + if not wallet: + raise ArgumentsNotProvidedError("--wallet-url not provided") + + if not api: + raise ArgumentsNotProvidedError("--api not provided") + + return wallet, api diff --git a/multiversx_sdk_cli/cli_shared.py b/multiversx_sdk_cli/cli_shared.py index 26857ffd..316b8629 100644 --- a/multiversx_sdk_cli/cli_shared.py +++ b/multiversx_sdk_cli/cli_shared.py @@ -8,6 +8,7 @@ from multiversx_sdk import ( Account, Address, + ApiNetworkProvider, LedgerAccount, ProxyNetworkProvider, Transaction, @@ -103,13 +104,13 @@ def add_tx_args( type=int, required=False, default=None, - help="# the nonce for the transaction", + help="# the nonce for the transaction. If not provided, is fetched from the network.", ) sub.add_argument( "--recall-nonce", action="store_true", default=False, - help="⭮ whether to recall the nonce when creating the transaction (default: %(default)s)", + help="⭮ whether to recall the nonce when creating the transaction (default: %(default)s). This argument is OBSOLETE.", ) if with_receiver: @@ -175,6 +176,9 @@ def add_wallet_args(args: list[str], sub: Any): help="🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: %(default)s)", ) sub.add_argument("--sender-username", required=False, help="🖄 the username of the sender") + sub.add_argument( + "--hrp", required=False, type=str, help="The hrp used to convert the address to its bech32 representation" + ) def add_guardian_wallet_args(args: list[str], sub: Any): @@ -282,7 +286,7 @@ def parse_omit_fields_arg(args: Any) -> list[str]: def prepare_account(args: Any): - hrp = config.get_address_hrp() + hrp = _get_address_hrp(args) if args.pem: return Account.new_from_pem(file_path=Path(args.pem), index=args.sender_wallet_index, hrp=hrp) @@ -302,8 +306,43 @@ def prepare_account(args: Any): raise errors.NoWalletProvided() +def _get_address_hrp(args: Any) -> str: + """Use hrp provided by the user. If not provided, fetch from network. If proxy not provided, get hrp from config.""" + hrp: str = "" + + if hasattr(args, "hrp") and args.hrp: + hrp = args.hrp + return hrp + + if hasattr(args, "proxy") and args.proxy: + hrp = _get_hrp_from_proxy(args) + elif hasattr(args, "api") and args.api: + hrp = _get_hrp_from_api(args) + + if hrp: + return hrp + + return config.get_address_hrp() + + +def _get_hrp_from_proxy(args: Any) -> str: + network_provider_config = config.get_config_for_network_providers() + proxy = ProxyNetworkProvider(url=args.proxy, config=network_provider_config) + network_config = proxy.get_network_config() + hrp: str = network_config.raw.get("erd_address_hrp", "") + return hrp + + +def _get_hrp_from_api(args: Any) -> str: + network_provider_config = config.get_config_for_network_providers() + proxy = ApiNetworkProvider(url=args.api, config=network_provider_config) + network_config = proxy.get_network_config() + hrp: str = network_config.raw.get("erd_address_hrp", "") + return hrp + + def load_guardian_account(args: Any) -> Union[IAccount, None]: - hrp = config.get_address_hrp() + hrp = _get_address_hrp(args) if args.guardian_pem: return Account.new_from_pem(file_path=Path(args.guardian_pem), index=args.guardian_wallet_index, hrp=hrp) @@ -434,7 +473,7 @@ def _is_matching_address(account_address: Union[Address, None], args_address: Un def load_relayer_account(args: Any) -> Union[IAccount, None]: - hrp = config.get_address_hrp() + hrp = _get_address_hrp(args) if args.relayer_pem: return Account.new_from_pem(file_path=Path(args.relayer_pem), index=args.relayer_wallet_index, hrp=hrp) diff --git a/multiversx_sdk_cli/config.py b/multiversx_sdk_cli/config.py index 222e4c7b..ee83f3c5 100644 --- a/multiversx_sdk_cli/config.py +++ b/multiversx_sdk_cli/config.py @@ -57,7 +57,7 @@ def get_value(name: str) -> str: return value -def get_address_hrp(): +def get_address_hrp() -> str: return get_value("default_address_hrp") diff --git a/multiversx_sdk_cli/errors.py b/multiversx_sdk_cli/errors.py index be13e41b..577d6207 100644 --- a/multiversx_sdk_cli/errors.py +++ b/multiversx_sdk_cli/errors.py @@ -62,31 +62,11 @@ def __init__(self, directory: str): super().__init__(f"Bad directory: {directory}") -class BadFile(KnownError): - def __init__(self, filename: str, inner: Any = None): - super().__init__(f"Bad file: {filename}.", inner) - - -class NotSupportedProject(KnownError): - def __init__(self, directory: str): - super().__init__(f"Directory is not a supported project: {directory}") - - class PlatformNotSupported(KnownError): def __init__(self, action_or_item: str, platform: str): super().__init__(f"[{action_or_item}] is not supported on platform [{platform}].") -class BuildError(KnownError): - def __init__(self, message: str): - super().__init__(f"Build error: {message}.") - - -class UnknownArgumentFormat(KnownError): - def __init__(self, argument: Any): - super().__init__(f"Cannot handle non-hex, non-number arguments yet: {argument}.") - - class BadInputError(KnownError): def __init__(self, input: str, message: str): super().__init__(f"Bad input [{input}]: {message}") @@ -126,11 +106,6 @@ def __init__(self, message: str): super().__init__(f"Bad usage: {message}.") -class CannotReadValidatorsData(KnownError): - def __init__(self): - super(CannotReadValidatorsData, self).__init__("cannot read validators data") - - class TransactionIsNotSigned(KnownError): def __init__(self): super().__init__("Transaction is not signed.") @@ -141,11 +116,6 @@ def __init__(self): super().__init__("No wallet provided.") -class LedgerError(KnownError): - def __init__(self, message: str): - super().__init__("Ledger error: " + message) - - class DockerMissingError(KnownError): def __init__(self): super().__init__("Docker is not installed! Please visit https://docs.docker.com/get-docker/ to install docker.") @@ -161,12 +131,6 @@ def __init__(self, message: str): super().__init__(message) -class ProxyError(KnownError): - def __init__(self, message: str, url: str, data: str, code: str): - inner = {"url": url, "data": data, "code": code} - super().__init__(message, inner) - - class WalletGenerationError(KnownError): def __init__(self, message: str): super().__init__(message) diff --git a/multiversx_sdk_cli/tests/test_cli_contracts.py b/multiversx_sdk_cli/tests/test_cli_contracts.py index bb822e70..4d579cfe 100644 --- a/multiversx_sdk_cli/tests/test_cli_contracts.py +++ b/multiversx_sdk_cli/tests/test_cli_contracts.py @@ -28,7 +28,6 @@ def test_contract_deploy(): "https://testnet-api.multiversx.com", "--chain", "T", - "--recall-nonce", "--gas-limit", "5000000", "--arguments", @@ -57,7 +56,6 @@ def test_contract_upgrade(): "https://testnet-api.multiversx.com", "--chain", "T", - "--recall-nonce", "--gas-limit", "5000000", "--arguments", @@ -86,7 +84,6 @@ def test_contract_call(): "https://testnet-api.multiversx.com", "--chain", "T", - "--recall-nonce", "--gas-limit", "5000000", "--arguments", @@ -177,7 +174,6 @@ def test_contract_flow(capsys: Any): adder, "--pem", alice, - "--recall-nonce", "--gas-limit", "5000000", "--proxy", @@ -220,7 +216,6 @@ def test_contract_flow(capsys: Any): alice, "--function", "add", - "--recall-nonce", "--gas-limit", "5000000", "--proxy", @@ -262,7 +257,6 @@ def test_contract_flow(capsys: Any): adder, "--pem", alice, - "--recall-nonce", "--gas-limit", "5000000", "--proxy", @@ -287,7 +281,6 @@ def test_contract_deploy_without_required_arguments(): adder, "--pem", alice, - "--recall-nonce", "--gas-limit", "5000000", "--arguments", @@ -490,7 +483,6 @@ def test_contract_query(capsys: Any): adder_abi, "--pem", alice, - "--recall-nonce", "--gas-limit", "5000000", "--proxy", @@ -516,7 +508,6 @@ def test_contract_query(capsys: Any): alice, "--function", "add", - "--recall-nonce", "--gas-limit", "5000000", "--proxy", diff --git a/multiversx_sdk_cli/tests/test_cli_validators_localnet.py b/multiversx_sdk_cli/tests/test_cli_validators_localnet.py index 89149f18..067b0d23 100644 --- a/multiversx_sdk_cli/tests/test_cli_validators_localnet.py +++ b/multiversx_sdk_cli/tests/test_cli_validators_localnet.py @@ -34,7 +34,6 @@ def test_stake(): "localnet", "--proxy", "http://127.0.0.1:7950", - "--recall-nonce", ] ) assert return_code == 0 @@ -78,7 +77,6 @@ def test_stake_top_up(): "localnet", "--proxy", "http://127.0.0.1:7950", - "--recall-nonce", ] ) assert return_code == 0 @@ -99,7 +97,6 @@ def test_unstake(): "localnet", "--proxy", "http://127.0.0.1:7950", - "--recall-nonce", ] ) assert return_code == 0 @@ -120,7 +117,6 @@ def test_unbond(): "localnet", "--proxy", "http://127.0.0.1:7950", - "--recall-nonce", ] ) assert return_code == 0 @@ -143,7 +139,6 @@ def test_unjail(): "localnet", "--proxy", "http://127.0.0.1:7950", - "--recall-nonce", ] ) assert return_code == 0 @@ -164,7 +159,6 @@ def test_change_reward_address(): "localnet", "--proxy", "http://127.0.0.1:7950", - "--recall-nonce", ] ) assert return_code == 0 @@ -185,7 +179,6 @@ def test_unstake_nodes(): "localnet", "--proxy", "http://127.0.0.1:7950", - "--recall-nonce", ] ) assert return_code == 0 @@ -206,7 +199,6 @@ def test_unstake_tokens(): "localnet", "--proxy", "http://127.0.0.1:7950", - "--recall-nonce", ] ) assert return_code == 0 @@ -227,7 +219,6 @@ def test_unbond_nodes(): "localnet", "--proxy", "http://127.0.0.1:7950", - "--recall-nonce", ] ) assert return_code == 0 @@ -248,7 +239,6 @@ def test_unbond_tokens(): "localnet", "--proxy", "http://127.0.0.1:7950", - "--recall-nonce", ] ) assert return_code == 0 @@ -267,7 +257,6 @@ def test_clean_registration_data(): "localnet", "--proxy", "http://127.0.0.1:7950", - "--recall-nonce", ] ) assert return_code == 0 @@ -288,7 +277,6 @@ def test_re_stake_unstaked_nodes(): "localnet", "--proxy", "http://127.0.0.1:7950", - "--recall-nonce", ] ) assert return_code == 0 diff --git a/pyproject.toml b/pyproject.toml index 684c0320..b911b8cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "multiversx-sdk-cli" -version = "10.0.1" +version = "10.1.0" authors = [ { name="MultiversX" }, ]