Merge pull request #11431 from AmineKhaldi/nft_wallet_create_cmd

Initial iteration of the chia wallet nft create command
This commit is contained in:
William Allen
2022-06-10 15:09:26 -05:00
committed by GitHub
2 changed files with 9 additions and 3 deletions
+6 -2
View File
@@ -487,11 +487,15 @@ def nft_cmd():
default=None,
)
@click.option("-f", "--fingerprint", help="Set the fingerprint to specify which wallet to use", type=int)
def nft_wallet_create_cmd(wallet_rpc_port: Optional[int], fingerprint: int) -> None:
@click.option("-di", "--did-id", help="DID Id to use", type=str)
@click.option("-n", "--name", help="Set the NFT wallet name", type=str)
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 execute_with_wallet, create_nft_wallet
extra_params: Dict[str, Any] = {}
extra_params: Dict[str, Any] = {"did_id": did_id, "name": name}
asyncio.run(execute_with_wallet(wallet_rpc_port, fingerprint, extra_params, create_nft_wallet))
+3 -1
View File
@@ -682,8 +682,10 @@ async def get_did(args: Dict, wallet_client: WalletRpcClient, fingerprint: int)
async def create_nft_wallet(args: Dict, wallet_client: WalletRpcClient, fingerprint: int) -> None:
did_id = args["did_id"]
name = args["name"]
try:
response = await wallet_client.create_new_nft_wallet(None)
response = await wallet_client.create_new_nft_wallet(did_id, name)
wallet_id = response["wallet_id"]
print(f"Successfully created an NFT wallet with id {wallet_id} on key {fingerprint}")
except Exception as e: