mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2026-09-05 02:24:21 -05:00
Merge commit '022052ac4506964e54727e6911918d73beccde3c' into checkpoint/datalayer-sim_from_release_1.4.0_022052ac4506964e54727e6911918d73beccde3c
This commit is contained in:
@@ -455,6 +455,24 @@ def did_wallet_name_cmd(wallet_rpc_port: Optional[int], fingerprint: int, id: in
|
||||
asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, did_set_wallet_name))
|
||||
|
||||
|
||||
@did_cmd.command("get_did", short_help="Get DID from wallet")
|
||||
@click.option(
|
||||
"-wp",
|
||||
"--wallet-rpc-port",
|
||||
help="Set the port where the Wallet is hosting the RPC interface. See the rpc_port under wallet in config.yaml",
|
||||
type=int,
|
||||
default=None,
|
||||
)
|
||||
@click.option("-f", "--fingerprint", help="Set the fingerprint to specify which wallet to use", type=int)
|
||||
@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 execute_with_wallet, get_did
|
||||
|
||||
extra_params = {"did_wallet_id": id}
|
||||
asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, get_did))
|
||||
|
||||
|
||||
@wallet_cmd.group("nft", short_help="NFT related actions")
|
||||
def nft_cmd():
|
||||
pass
|
||||
|
||||
@@ -669,6 +669,18 @@ async def did_set_wallet_name(args: Dict, wallet_client: WalletRpcClient, finger
|
||||
print(f"Failed to set DID wallet name: {e}")
|
||||
|
||||
|
||||
async def get_did(args: Dict, wallet_client: WalletRpcClient, fingerprint: int) -> None:
|
||||
did_wallet_id: int = args["did_wallet_id"]
|
||||
try:
|
||||
response = await wallet_client.get_did_id(did_wallet_id)
|
||||
my_did = response["my_did"]
|
||||
coin_id = response["coin_id"]
|
||||
print(f"{'DID:'.ljust(23)} {my_did}")
|
||||
print(f"{'Coin ID:'.ljust(23)} {coin_id}")
|
||||
except Exception as e:
|
||||
print(f"Failed to get DID: {e}")
|
||||
|
||||
|
||||
async def create_nft_wallet(args: Dict, wallet_client: WalletRpcClient, fingerprint: int) -> None:
|
||||
try:
|
||||
response = await wallet_client.create_new_nft_wallet(None)
|
||||
|
||||
Reference in New Issue
Block a user