mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-09-25 07:50:06 -05:00
isort: Remove all chia.cmds exceptions and sort the related files (#13940)
This commit is contained in:
-20
@@ -6,26 +6,6 @@ add_imports=from __future__ import annotations
|
||||
# venv/bin/isort --check . |& sed -n "s;ERROR: ${PWD}/\(.*\) Imports are.*; \1;p" | sort | uniq
|
||||
extend_skip=
|
||||
chia/clvm/spend_sim.py
|
||||
chia/cmds/chia.py
|
||||
chia/cmds/db.py
|
||||
chia/cmds/db_upgrade_func.py
|
||||
chia/cmds/farm_funcs.py
|
||||
chia/cmds/farm.py
|
||||
chia/cmds/init_funcs.py
|
||||
chia/cmds/init.py
|
||||
chia/cmds/keys_funcs.py
|
||||
chia/cmds/keys.py
|
||||
chia/cmds/netspace.py
|
||||
chia/cmds/passphrase_funcs.py
|
||||
chia/cmds/passphrase.py
|
||||
chia/cmds/plotnft_funcs.py
|
||||
chia/cmds/plotnft.py
|
||||
chia/cmds/plotters.py
|
||||
chia/cmds/show.py
|
||||
chia/cmds/start_funcs.py
|
||||
chia/cmds/start.py
|
||||
chia/cmds/wallet_funcs.py
|
||||
chia/cmds/wallet.py
|
||||
chia/daemon/keychain_proxy.py
|
||||
chia/daemon/keychain_server.py
|
||||
chia/daemon/server.py
|
||||
|
||||
+12
-10
@@ -1,33 +1,33 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from io import TextIOWrapper
|
||||
from typing import Optional
|
||||
|
||||
import click
|
||||
|
||||
from chia import __version__
|
||||
from chia.cmds.beta import beta_cmd
|
||||
from chia.cmds.configure import configure_cmd
|
||||
from chia.cmds.farm import farm_cmd
|
||||
from chia.cmds.data import data_cmd
|
||||
from chia.cmds.db import db_cmd
|
||||
from chia.cmds.farm import farm_cmd
|
||||
from chia.cmds.init import init_cmd
|
||||
from chia.cmds.keys import keys_cmd
|
||||
from chia.cmds.netspace import netspace_cmd
|
||||
from chia.cmds.passphrase import passphrase_cmd
|
||||
from chia.cmds.peer import peer_cmd
|
||||
from chia.cmds.plotnft import plotnft_cmd
|
||||
from chia.cmds.plots import plots_cmd
|
||||
from chia.cmds.plotters import plotters_cmd
|
||||
from chia.cmds.rpc import rpc_cmd
|
||||
from chia.cmds.show import show_cmd
|
||||
from chia.cmds.start import start_cmd
|
||||
from chia.cmds.stop import stop_cmd
|
||||
from chia.cmds.wallet import wallet_cmd
|
||||
from chia.cmds.plotnft import plotnft_cmd
|
||||
from chia.cmds.plotters import plotters_cmd
|
||||
from chia.cmds.db import db_cmd
|
||||
from chia.util.default_root import DEFAULT_KEYS_ROOT_PATH, DEFAULT_ROOT_PATH
|
||||
from chia.util.errors import KeychainCurrentPassphraseIsInvalid
|
||||
from chia.util.keychain import (
|
||||
Keychain,
|
||||
set_keys_root_path,
|
||||
)
|
||||
from chia.util.keychain import Keychain, set_keys_root_path
|
||||
from chia.util.ssl_check import check_ssl
|
||||
from typing import Optional
|
||||
|
||||
CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])
|
||||
|
||||
@@ -67,9 +67,10 @@ def cli(
|
||||
set_keys_root_path(Path(keys_root_path))
|
||||
|
||||
if passphrase_file is not None:
|
||||
from chia.cmds.passphrase_funcs import cache_passphrase, read_passphrase_from_file
|
||||
from sys import exit
|
||||
|
||||
from chia.cmds.passphrase_funcs import cache_passphrase, read_passphrase_from_file
|
||||
|
||||
try:
|
||||
passphrase = read_passphrase_from_file(passphrase_file)
|
||||
if Keychain.master_passphrase_is_valid(passphrase):
|
||||
@@ -104,6 +105,7 @@ def version_cmd() -> None:
|
||||
@click.pass_context
|
||||
def run_daemon_cmd(ctx: click.Context, wait_for_unlock: bool) -> None:
|
||||
import asyncio
|
||||
|
||||
from chia.daemon.server import async_run_daemon
|
||||
from chia.util.keychain import Keychain
|
||||
|
||||
|
||||
+5
-1
@@ -1,8 +1,12 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import click
|
||||
|
||||
from chia.cmds.db_backup_func import db_backup_func
|
||||
from chia.cmds.db_upgrade_func import db_upgrade_func
|
||||
from chia.cmds.db_validate_func import db_validate_func
|
||||
from chia.cmds.db_backup_func import db_backup_func
|
||||
|
||||
|
||||
@click.group("db", short_help="Manage the blockchain database")
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
from typing import Dict, Optional
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import platform
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import sys
|
||||
from time import time
|
||||
import textwrap
|
||||
import os
|
||||
from pathlib import Path
|
||||
from time import time
|
||||
from typing import Dict, Optional
|
||||
|
||||
from chia.util.config import load_config, lock_and_load_config, save_config
|
||||
from chia.util.path import path_from_root
|
||||
from chia.util.ints import uint32
|
||||
from chia.types.blockchain_format.sized_bytes import bytes32
|
||||
from chia.util.config import load_config, lock_and_load_config, save_config
|
||||
from chia.util.ints import uint32
|
||||
from chia.util.path import path_from_root
|
||||
|
||||
|
||||
# if either the input database or output database file is specified, the
|
||||
@@ -118,10 +120,10 @@ COIN_COMMIT_RATE = 30000
|
||||
|
||||
def convert_v1_to_v2(in_path: Path, out_path: Path) -> None:
|
||||
import sqlite3
|
||||
import zstd
|
||||
|
||||
from contextlib import closing
|
||||
|
||||
import zstd
|
||||
|
||||
if not in_path.exists():
|
||||
raise RuntimeError(f"input file doesn't exist. {in_path}")
|
||||
|
||||
|
||||
+6
-2
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
|
||||
import click
|
||||
@@ -55,9 +57,10 @@ def summary_cmd(
|
||||
harvester_rpc_port: Optional[int],
|
||||
farmer_rpc_port: Optional[int],
|
||||
) -> None:
|
||||
from .farm_funcs import summary
|
||||
import asyncio
|
||||
|
||||
from .farm_funcs import summary
|
||||
|
||||
asyncio.run(summary(rpc_port, wallet_rpc_port, harvester_rpc_port, farmer_rpc_port))
|
||||
|
||||
|
||||
@@ -79,7 +82,8 @@ def summary_cmd(
|
||||
show_default=True,
|
||||
)
|
||||
def challenges_cmd(farmer_rpc_port: Optional[int], limit: int) -> None:
|
||||
from .farm_funcs import challenges
|
||||
import asyncio
|
||||
|
||||
from .farm_funcs import challenges
|
||||
|
||||
asyncio.run(challenges(farmer_rpc_port, limit))
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from typing import Any, Dict, List, Optional
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
from chia.cmds.cmds_util import get_any_service_client
|
||||
from chia.cmds.units import units
|
||||
@@ -7,8 +8,7 @@ from chia.consensus.block_record import BlockRecord
|
||||
from chia.rpc.farmer_rpc_client import FarmerRpcClient
|
||||
from chia.rpc.full_node_rpc_client import FullNodeRpcClient
|
||||
from chia.rpc.wallet_rpc_client import WalletRpcClient
|
||||
from chia.util.misc import format_bytes
|
||||
from chia.util.misc import format_minutes
|
||||
from chia.util.misc import format_bytes, format_minutes
|
||||
from chia.util.network import is_localhost
|
||||
|
||||
SECONDS_PER_BLOCK = (24 * 3600) / 4608
|
||||
|
||||
+7
-2
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import click
|
||||
|
||||
|
||||
@@ -36,9 +38,11 @@ def init_cmd(ctx: click.Context, create_certs: str, fix_ssl_permissions: bool, t
|
||||
https://github.com/Chia-Network/chia-blockchain/wiki/Farming-on-many-machines
|
||||
"""
|
||||
from pathlib import Path
|
||||
from .init_funcs import init
|
||||
|
||||
from chia.cmds.passphrase_funcs import initialize_passphrase
|
||||
|
||||
from .init_funcs import init
|
||||
|
||||
set_passphrase = kwargs.get("set_passphrase")
|
||||
if set_passphrase:
|
||||
initialize_passphrase()
|
||||
@@ -53,7 +57,8 @@ def init_cmd(ctx: click.Context, create_certs: str, fix_ssl_permissions: bool, t
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from .init_funcs import chia_init
|
||||
from chia.util.default_root import DEFAULT_ROOT_PATH
|
||||
|
||||
from .init_funcs import chia_init
|
||||
|
||||
chia_init(DEFAULT_ROOT_PATH)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import sqlite3
|
||||
@@ -7,6 +9,7 @@ from typing import Any, Dict, List, Optional, Tuple
|
||||
import yaml
|
||||
|
||||
from chia import __version__
|
||||
from chia.cmds.configure import configure
|
||||
from chia.consensus.coinbase import create_puzzlehash_for_pk
|
||||
from chia.ssl.create_ssl import create_all_ssl
|
||||
from chia.util.bech32m import encode_puzzle_hash
|
||||
@@ -30,13 +33,12 @@ from chia.util.ssl_check import (
|
||||
fix_ssl,
|
||||
)
|
||||
from chia.wallet.derive_keys import (
|
||||
_derive_path,
|
||||
_derive_path_unhardened,
|
||||
master_sk_to_pool_sk,
|
||||
master_sk_to_wallet_sk_intermediate,
|
||||
master_sk_to_wallet_sk_unhardened_intermediate,
|
||||
_derive_path,
|
||||
_derive_path_unhardened,
|
||||
)
|
||||
from chia.cmds.configure import configure
|
||||
|
||||
|
||||
def dict_add_new_default(updated: Dict, default: Dict, do_not_migrate_keys: Dict[str, Any]):
|
||||
|
||||
+8
-4
@@ -1,9 +1,10 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import sys
|
||||
from typing import Optional, Tuple
|
||||
|
||||
import click
|
||||
import sys
|
||||
|
||||
from typing import Optional, Tuple
|
||||
|
||||
|
||||
@click.group("keys", short_help="Manage your keys")
|
||||
@@ -11,6 +12,7 @@ from typing import Optional, Tuple
|
||||
def keys_cmd(ctx: click.Context):
|
||||
"""Create, delete, view and use your key pairs"""
|
||||
from pathlib import Path
|
||||
|
||||
from .keys_funcs import migrate_keys
|
||||
|
||||
root_path: Path = ctx.obj["root_path"]
|
||||
@@ -305,9 +307,11 @@ def search_cmd(
|
||||
prefix: Optional[str],
|
||||
):
|
||||
import sys
|
||||
from .keys_funcs import search_derive, resolve_derivation_master_key
|
||||
|
||||
from blspy import PrivateKey
|
||||
|
||||
from .keys_funcs import resolve_derivation_master_key, search_derive
|
||||
|
||||
private_key: Optional[PrivateKey] = None
|
||||
fingerprint: Optional[int] = ctx.obj.get("fingerprint", None)
|
||||
filename: Optional[str] = ctx.obj.get("filename", None)
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
|
||||
from blspy import AugSchemeMPL, G1Element, G2Element, PrivateKey
|
||||
from enum import Enum
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from chia.consensus.coinbase import create_puzzlehash_for_pk
|
||||
from blspy import AugSchemeMPL, G1Element, G2Element, PrivateKey
|
||||
|
||||
from chia.cmds.passphrase_funcs import obtain_current_passphrase
|
||||
from chia.consensus.coinbase import create_puzzlehash_for_pk
|
||||
from chia.daemon.client import connect_to_daemon_and_validate
|
||||
from chia.daemon.keychain_proxy import KeychainProxy, connect_to_keychain_and_validate, wrap_local_keychain
|
||||
from chia.util.bech32m import encode_puzzle_hash
|
||||
from chia.util.errors import KeychainNotSet
|
||||
from chia.util.config import load_config
|
||||
from chia.util.errors import KeychainException
|
||||
from chia.util.errors import KeychainException, KeychainNotSet
|
||||
from chia.util.file_keyring import MAX_LABEL_LENGTH
|
||||
from chia.util.ints import uint32
|
||||
from chia.util.keychain import Keychain, bytes_to_mnemonic, generate_mnemonic, mnemonic_to_seed
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
|
||||
import click
|
||||
@@ -39,6 +41,7 @@ def netspace_cmd(rpc_port: Optional[int], delta_block_height: str, start: str) -
|
||||
Calculates the estimated space on the network given two block header hashes.
|
||||
"""
|
||||
import asyncio
|
||||
|
||||
from .netspace_funcs import netstorge_async
|
||||
|
||||
asyncio.run(netstorge_async(rpc_port, delta_block_height, start))
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import click
|
||||
import sys
|
||||
from io import TextIOWrapper
|
||||
from typing import Optional
|
||||
|
||||
import click
|
||||
|
||||
from chia.util.config import load_config
|
||||
|
||||
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
import click
|
||||
import colorama
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
from chia.daemon.client import acquire_connection_to_daemon
|
||||
from chia.util.config import load_config
|
||||
from chia.util.errors import KeychainMaxUnlockAttempts
|
||||
from chia.util.keychain import Keychain, supports_os_passphrase_storage
|
||||
from chia.util.keyring_wrapper import KeyringWrapper, DEFAULT_PASSPHRASE_IF_NO_MASTER_PASSPHRASE
|
||||
from chia.util.misc import prompt_yes_no
|
||||
from chia.util.ws_message import WsRpcMessage
|
||||
from getpass import getpass
|
||||
from io import TextIOWrapper
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, Optional, Tuple
|
||||
|
||||
import click
|
||||
import colorama
|
||||
|
||||
from chia.daemon.client import acquire_connection_to_daemon
|
||||
from chia.util.config import load_config
|
||||
from chia.util.errors import KeychainMaxUnlockAttempts
|
||||
from chia.util.keychain import Keychain, supports_os_passphrase_storage
|
||||
from chia.util.keyring_wrapper import DEFAULT_PASSPHRASE_IF_NO_MASTER_PASSPHRASE, KeyringWrapper
|
||||
from chia.util.misc import prompt_yes_no
|
||||
from chia.util.ws_message import WsRpcMessage
|
||||
|
||||
DEFAULT_PASSPHRASE_PROMPT = (
|
||||
colorama.Fore.YELLOW + colorama.Style.BRIGHT + "(Unlock Keyring)" + colorama.Style.RESET_ALL + " Passphrase: "
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from decimal import Decimal
|
||||
from typing import Optional
|
||||
|
||||
import click
|
||||
from chia.cmds.cmds_util import execute_with_wallet
|
||||
|
||||
from chia.cmds.cmds_util import execute_with_wallet
|
||||
|
||||
MAX_CMDLINE_FEE = Decimal(0.5)
|
||||
|
||||
@@ -47,6 +49,7 @@ def show_cmd(wallet_rpc_port: Optional[int], fingerprint: int, id: int) -> None:
|
||||
@click.option("-l", "--launcher_id", help="Launcher ID of the plotnft", type=str, required=True)
|
||||
def get_login_link_cmd(launcher_id: str) -> None:
|
||||
import asyncio
|
||||
|
||||
from .plotnft_funcs import get_login_link
|
||||
|
||||
asyncio.run(get_login_link(launcher_id))
|
||||
@@ -219,6 +222,7 @@ def claim(wallet_rpc_port: Optional[int], fingerprint: int, id: int, fee: int) -
|
||||
@click.option("-a", "--address", help="New address for payout instructions", type=str, required=True)
|
||||
def change_payout_instructions_cmd(launcher_id: str, address: str) -> None:
|
||||
import asyncio
|
||||
|
||||
from .plotnft_funcs import change_payout_instructions
|
||||
|
||||
asyncio.run(change_payout_instructions(launcher_id, address))
|
||||
|
||||
+11
-10
@@ -1,31 +1,32 @@
|
||||
from decimal import Decimal
|
||||
from dataclasses import replace
|
||||
from __future__ import annotations
|
||||
|
||||
import aiohttp
|
||||
import asyncio
|
||||
import functools
|
||||
import json
|
||||
import time
|
||||
|
||||
from dataclasses import replace
|
||||
from decimal import Decimal
|
||||
from pprint import pprint
|
||||
from typing import Any, List, Dict, Optional, Callable
|
||||
from typing import Any, Callable, Dict, List, Optional
|
||||
|
||||
import aiohttp
|
||||
|
||||
from chia.cmds.cmds_util import get_any_service_client, transaction_status_msg, transaction_submitted_msg
|
||||
from chia.cmds.units import units
|
||||
from chia.cmds.wallet_funcs import print_balance, wallet_coin_unit
|
||||
from chia.pools.pool_config import load_pool_config, PoolWalletConfig, update_pool_config
|
||||
from chia.pools.pool_wallet_info import PoolWalletInfo, PoolSingletonState
|
||||
from chia.pools.pool_config import PoolWalletConfig, load_pool_config, update_pool_config
|
||||
from chia.pools.pool_wallet_info import PoolSingletonState, PoolWalletInfo
|
||||
from chia.protocols.pool_protocol import POOL_PROTOCOL_VERSION
|
||||
from chia.rpc.farmer_rpc_client import FarmerRpcClient
|
||||
from chia.rpc.wallet_rpc_client import WalletRpcClient
|
||||
from chia.types.blockchain_format.sized_bytes import bytes32
|
||||
from chia.server.server import ssl_context_for_root
|
||||
from chia.ssl.create_ssl import get_mozilla_ca_crt
|
||||
from chia.util.bech32m import encode_puzzle_hash, decode_puzzle_hash
|
||||
from chia.types.blockchain_format.sized_bytes import bytes32
|
||||
from chia.util.bech32m import decode_puzzle_hash, encode_puzzle_hash
|
||||
from chia.util.byte_types import hexstr_to_bytes
|
||||
from chia.util.config import load_config
|
||||
from chia.util.default_root import DEFAULT_ROOT_PATH
|
||||
from chia.util.ints import uint32, uint64
|
||||
from chia.cmds.cmds_util import transaction_submitted_msg, transaction_status_msg, get_any_service_client
|
||||
from chia.wallet.transaction_record import TransactionRecord
|
||||
from chia.wallet.util.wallet_types import WalletType
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import click
|
||||
|
||||
from chia.plotters.plotters import call_plotters
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
|
||||
import click
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import click
|
||||
|
||||
from chia.util.config import load_config
|
||||
@@ -10,7 +12,9 @@ from chia.util.service_groups import all_groups
|
||||
@click.pass_context
|
||||
def start_cmd(ctx: click.Context, restart: bool, group: str) -> None:
|
||||
import asyncio
|
||||
|
||||
from chia.cmds.beta_funcs import warn_if_beta_enabled
|
||||
|
||||
from .start_funcs import async_start
|
||||
|
||||
root_path = ctx.obj["root_path"]
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
|
||||
+38
-4
@@ -1,14 +1,16 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
import click
|
||||
|
||||
from chia.cmds.cmds_util import execute_with_wallet
|
||||
from chia.cmds.coins import coins_cmd
|
||||
from chia.cmds.plotnft import validate_fee
|
||||
from chia.wallet.transaction_sorting import SortKey
|
||||
from chia.wallet.util.address_type import AddressType
|
||||
from chia.wallet.util.wallet_types import WalletType
|
||||
from chia.cmds.cmds_util import execute_with_wallet
|
||||
|
||||
|
||||
@click.group("wallet", short_help="Manage your wallet")
|
||||
@@ -32,6 +34,7 @@ def wallet_cmd(ctx: click.Context) -> None:
|
||||
def get_transaction_cmd(wallet_rpc_port: Optional[int], fingerprint: int, id: int, tx_id: str, verbose: int) -> None:
|
||||
extra_params = {"id": id, "tx_id": tx_id, "verbose": verbose}
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import get_transaction
|
||||
|
||||
asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, get_transaction))
|
||||
@@ -114,6 +117,7 @@ def get_transactions_cmd(
|
||||
}
|
||||
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import get_transactions
|
||||
|
||||
asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, get_transactions))
|
||||
@@ -199,6 +203,7 @@ def send_cmd(
|
||||
"exclude_coin_ids": list(exclude_coin_ids),
|
||||
}
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import send
|
||||
|
||||
asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, send))
|
||||
@@ -222,6 +227,7 @@ def send_cmd(
|
||||
)
|
||||
def show_cmd(wallet_rpc_port: Optional[int], fingerprint: int, wallet_type: Optional[str]) -> None:
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import print_balances
|
||||
|
||||
args: Dict[str, Any] = {}
|
||||
@@ -253,6 +259,7 @@ def show_cmd(wallet_rpc_port: Optional[int], fingerprint: int, wallet_type: Opti
|
||||
def get_address_cmd(wallet_rpc_port: Optional[int], id, fingerprint: int, new_address: bool) -> None:
|
||||
extra_params = {"id": id, "new_address": new_address}
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import get_address
|
||||
|
||||
asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, get_address))
|
||||
@@ -273,6 +280,7 @@ def get_address_cmd(wallet_rpc_port: Optional[int], id, fingerprint: int, new_ad
|
||||
def delete_unconfirmed_transactions_cmd(wallet_rpc_port: Optional[int], id, fingerprint: int) -> None:
|
||||
extra_params = {"id": id}
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import delete_unconfirmed_transactions
|
||||
|
||||
asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, delete_unconfirmed_transactions))
|
||||
@@ -290,6 +298,7 @@ def delete_unconfirmed_transactions_cmd(wallet_rpc_port: Optional[int], id, fing
|
||||
def get_derivation_index_cmd(wallet_rpc_port: Optional[int], fingerprint: int) -> None:
|
||||
extra_params: Dict[str, Any] = {}
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import get_derivation_index
|
||||
|
||||
asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, get_derivation_index))
|
||||
@@ -309,6 +318,7 @@ def get_derivation_index_cmd(wallet_rpc_port: Optional[int], fingerprint: int) -
|
||||
def address_sign_message(wallet_rpc_port: Optional[int], fingerprint: int, address: str, hex_message: str) -> None:
|
||||
extra_params: Dict[str, Any] = {"address": address, "message": hex_message, "type": AddressType.XCH}
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import sign_message
|
||||
|
||||
asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, sign_message))
|
||||
@@ -331,6 +341,7 @@ def address_sign_message(wallet_rpc_port: Optional[int], fingerprint: int, addre
|
||||
def update_derivation_index_cmd(wallet_rpc_port: Optional[int], fingerprint: int, index: int) -> None:
|
||||
extra_params = {"index": index}
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import update_derivation_index
|
||||
|
||||
asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, update_derivation_index))
|
||||
@@ -365,6 +376,7 @@ def update_derivation_index_cmd(wallet_rpc_port: Optional[int], fingerprint: int
|
||||
def add_token_cmd(wallet_rpc_port: Optional[int], asset_id: str, token_name: str, fingerprint: int) -> None:
|
||||
extra_params = {"asset_id": asset_id, "token_name": token_name}
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import add_token
|
||||
|
||||
asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, add_token))
|
||||
@@ -400,6 +412,7 @@ def make_offer_cmd(
|
||||
) -> None:
|
||||
extra_params = {"offers": offer, "requests": request, "filepath": filepath, "fee": fee}
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import make_offer
|
||||
|
||||
asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, make_offer))
|
||||
@@ -446,6 +459,7 @@ def get_offers_cmd(
|
||||
"reverse": reverse,
|
||||
}
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import get_offers
|
||||
|
||||
asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, get_offers))
|
||||
@@ -468,6 +482,7 @@ def take_offer_cmd(
|
||||
) -> None:
|
||||
extra_params = {"file": path_or_hex, "examine_only": examine_only, "fee": fee}
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import take_offer
|
||||
|
||||
asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, take_offer))
|
||||
@@ -488,6 +503,7 @@ def take_offer_cmd(
|
||||
def cancel_offer_cmd(wallet_rpc_port: Optional[int], fingerprint: int, id: str, insecure: bool, fee: str) -> None:
|
||||
extra_params = {"id": id, "insecure": insecure, "fee": fee}
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import cancel_offer
|
||||
|
||||
asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, cancel_offer))
|
||||
@@ -529,6 +545,7 @@ def did_create_wallet_cmd(
|
||||
wallet_rpc_port: Optional[int], fingerprint: int, name: Optional[str], amount: Optional[int], fee: Optional[int]
|
||||
) -> None:
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import create_did_wallet
|
||||
|
||||
extra_params = {"amount": amount, "fee": fee, "name": name}
|
||||
@@ -549,6 +566,7 @@ def did_create_wallet_cmd(
|
||||
def did_sign_message(wallet_rpc_port: Optional[int], fingerprint: int, did_id: str, hex_message: str) -> None:
|
||||
extra_params: Dict[str, Any] = {"did_id": did_id, "message": hex_message, "type": AddressType.DID}
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import sign_message
|
||||
|
||||
asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, sign_message))
|
||||
@@ -567,6 +585,7 @@ def did_sign_message(wallet_rpc_port: Optional[int], fingerprint: int, did_id: s
|
||||
@click.option("-n", "--name", help="Set the DID wallet name", type=str, required=True)
|
||||
def did_wallet_name_cmd(wallet_rpc_port: Optional[int], fingerprint: int, id: int, name: str) -> None:
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import did_set_wallet_name
|
||||
|
||||
extra_params = {"wallet_id": id, "name": name}
|
||||
@@ -585,6 +604,7 @@ def did_wallet_name_cmd(wallet_rpc_port: Optional[int], fingerprint: int, id: in
|
||||
@click.option("-i", "--id", help="Id of the wallet to use", type=int, required=True)
|
||||
def did_get_did_cmd(wallet_rpc_port: Optional[int], fingerprint: int, id: int) -> None:
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import get_did
|
||||
|
||||
extra_params = {"did_wallet_id": id}
|
||||
@@ -611,6 +631,7 @@ def nft_wallet_create_cmd(
|
||||
wallet_rpc_port: Optional[int], fingerprint: int, did_id: Optional[str], name: Optional[str]
|
||||
) -> None:
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import create_nft_wallet
|
||||
|
||||
extra_params: Dict[str, Any] = {"did_id": did_id, "name": name}
|
||||
@@ -631,6 +652,7 @@ def nft_wallet_create_cmd(
|
||||
def nft_sign_message(wallet_rpc_port: Optional[int], fingerprint: int, nft_id: str, hex_message: str) -> None:
|
||||
extra_params: Dict[str, Any] = {"nft_id": nft_id, "message": hex_message, "type": AddressType.NFT}
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import sign_message
|
||||
|
||||
asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, sign_message))
|
||||
@@ -693,6 +715,7 @@ def nft_mint_cmd(
|
||||
royalty_percentage_fraction: int,
|
||||
) -> None:
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import mint_nft
|
||||
|
||||
if metadata_uris is None:
|
||||
@@ -758,6 +781,7 @@ def nft_add_uri_cmd(
|
||||
fee: str,
|
||||
) -> None:
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import add_uri_to_nft
|
||||
|
||||
extra_params = {
|
||||
@@ -801,6 +825,7 @@ def nft_transfer_cmd(
|
||||
fee: str,
|
||||
) -> None:
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import transfer_nft
|
||||
|
||||
extra_params = {
|
||||
@@ -824,6 +849,7 @@ def nft_transfer_cmd(
|
||||
@click.option("-i", "--id", help="Id of the NFT wallet to use", type=int, required=True)
|
||||
def nft_list_cmd(wallet_rpc_port: Optional[int], fingerprint: int, id: int) -> None:
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import list_nfts
|
||||
|
||||
extra_params = {"wallet_id": id}
|
||||
@@ -860,6 +886,7 @@ def nft_set_did_cmd(
|
||||
fee: str,
|
||||
) -> None:
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import set_nft_did
|
||||
|
||||
extra_params = {
|
||||
@@ -887,6 +914,7 @@ def nft_get_info_cmd(
|
||||
nft_coin_id: str,
|
||||
) -> None:
|
||||
import asyncio
|
||||
|
||||
from .wallet_funcs import get_nft_info
|
||||
|
||||
extra_params = {
|
||||
@@ -934,9 +962,11 @@ def _send_notification(
|
||||
fee: str,
|
||||
) -> None:
|
||||
import asyncio
|
||||
from .wallet_funcs import send_notification
|
||||
|
||||
from chia.cmds.cmds_util import execute_with_wallet
|
||||
|
||||
from .wallet_funcs import send_notification
|
||||
|
||||
extra_params = {
|
||||
"address": to_address,
|
||||
"amount": amount,
|
||||
@@ -966,9 +996,11 @@ def _get_notifications(
|
||||
end: Optional[int],
|
||||
) -> None:
|
||||
import asyncio
|
||||
from .wallet_funcs import get_notifications
|
||||
|
||||
from chia.cmds.cmds_util import execute_with_wallet
|
||||
|
||||
from .wallet_funcs import get_notifications
|
||||
|
||||
extra_params = {
|
||||
"ids": id,
|
||||
"start": start,
|
||||
@@ -995,9 +1027,11 @@ def _delete_notifications(
|
||||
all: bool,
|
||||
) -> None:
|
||||
import asyncio
|
||||
from .wallet_funcs import delete_notifications
|
||||
|
||||
from chia.cmds.cmds_util import execute_with_wallet
|
||||
|
||||
from .wallet_funcs import delete_notifications
|
||||
|
||||
extra_params = {
|
||||
"ids": id,
|
||||
"all": all,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import os
|
||||
import pathlib
|
||||
|
||||
Reference in New Issue
Block a user