Repository: Chia-Network/chia-blockchain
Pull request: Fix NFT wallet naming issue

Problem statement:
[Bug] Incorrect NFT wallet name
### What happened?

Running on testnet10 with a synced full node, start with a new wallet with some TXCH:

```
chia wallet show
Wallet keys:
1)   502984008
2) * 1239193935 (Synced)
Choose a wallet key [1-2] ('q' to quit, or Enter to use 1239193935):
Wallet height: 1373140
Sync status: Synced
Balances, fingerprint: 1239193935

Chia Wallet:
   -Total Balance:         27.308604999833 txch (27308604999833 mojo)
   -Pending Total Balance: 27.308604999833 txch (27308604999833 mojo)
   -Spendable:             27.308604999833 txch (27308604999833 mojo)
   -Type:                  STANDARD_WALLET
   -Wallet ID:             1
```

Create a new DID:

```
chia wallet did create -n bulk_mint_DID
Wallet keys:
1)   502984008
2) * 1239193935 (Synced)
Choose a wallet key [1-2] ('q' to quit, or Enter to use 1239193935):
Successfully created a DID wallet with name bulk_mint_DID and id 2 on key 1239193935
Successfully created a DID did:chia:18pze0ae5n2e4g3v664cqt23uuduyeyaa7j2umywhqd0mhve298ksdephpr in the newly created DID wallet
PS C:\Users\User> chia wallet nft create -f 1239193935 -di did:chia:18pze0ae5n2e4g3v664cqt23uuduyeyaa7j2umywhqd0mhve298ksdephpr -n "NFT Wallet for bulk minting"
Successfully created an NFT wallet with id 3 on key 1239193935
```

Create an NFT wallet using the new DID:

```
chia wallet nft create -f 1239193935 -di did:chia:18pze0ae5n2e4g3v664cqt23uuduyeyaa7j2umywhqd0mhve298ksdephpr -n "NFT Wallet for bulk minting"
Successfully created an NFT wallet with id 3 on key 1239193935
```

Show the wallets:

```
chia wallet show
Wallet keys:
1)   502984008
2) * 1239193935 (Synced)
Choose a wallet key [1-2] ('q' to quit, or Enter to use 1239193935):
Wallet height: 1373141
Sync status: Synced
Balances, fingerprint: 1239193935

Chia Wallet:
   -Total Balance:         27.308604999833 txch (27308604999833 mojo)
   -Pending Total Balance: 27.308604999832 txch (27308604999832 mojo)
   -Spendable:             0.0 txch (0 mojo)
   -Type:                  STANDARD_WALLET
   -Wallet ID:             1

bulk_mint_DID:
   -Total Balance:         0.0
   -Pending Total Balance: 1.0
   -Spendable:             0.0
   -Type:                  DECENTRALIZED_ID
   -DID ID:                did:chia:18pze0ae5n2e4g3v664cqt23uuduyeyaa7j2umywhqd0mhve298ksdephpr
   -Wallet ID:             2

bulk_mint_DID:
   -Total Balance:         0.0
   -Pending Total Balance: 0.0
   -Spendable:             0.0
   -Type:                  NFT
   -DID ID:                did:chia:18pze0ae5n2e4g3v664cqt23uuduyeyaa7j2umywhqd0mhve298ksdephpr
   -Wallet ID:             3
```

Wallet 3 (the NFT wallet) has an incorrect name.

### Version

1.5.1.dev438 (dogfood build)

### What platform are you using?

Windows

### What ui mode are you using?

CLI

### Relevant log output

_No response_

Hints from issue discussion:
When you create a DID wallet it will create a NFT wallet automatically. You just need to rename it. 
I will change the default NFT wallet to [DID_Wallet_Name] + 'NFT Wallet'

Commit message: Fix NFT wallet naming

Patch to review:
diff --git a/chia/rpc/wallet_rpc_api.py b/chia/rpc/wallet_rpc_api.py
index c835b89ab9d5..c59336dc3020 100644
--- a/chia/rpc/wallet_rpc_api.py
+++ b/chia/rpc/wallet_rpc_api.py
@@ -541,11 +541,12 @@ async def create_new_wallet(self, request: Dict) -> EndpointResult:
                     my_did_id = encode_puzzle_hash(
                         bytes32.fromhex(did_wallet.get_my_DID()), AddressType.DID.hrp(self.service.config)
                     )
+                    nft_wallet_name = request.get("wallet_name", "") + " NFT Wallet"
                     await NFTWallet.create_new_nft_wallet(
                         wallet_state_manager,
                         main_wallet,
                         bytes32.fromhex(did_wallet.get_my_DID()),
-                        request.get("wallet_name", None),
+                        nft_wallet_name,
                     )
                 return {
                     "success": True,


Code review comments:
diff_hunk: @@ -541,11 +541,12 @@ async def create_new_wallet(self, request: Dict) -> EndpointResult:
                     my_did_id = encode_puzzle_hash(
                         bytes32.fromhex(did_wallet.get_my_DID()), AddressType.DID.hrp(self.service.config)
                     )
+                    nft_wallet_name = request.get("wallet_name", "") + " NFT Wallet"
path: chia/rpc/wallet_rpc_api.py
text: @user1:
In some way avoid the leading space this introduces.  Here's one of a few options that crossed my mind.

```suggestion
                    request_wallet_name = request.get("wallet_name")
                    if request_wallet_name is None:
                        nft_wallet_name = "NFT Wallet"
                    else:
                        nft_wallet_name = f"{request_wallet_name.strip()} NFT Wallet"
```