Skip to content

Commit ab55288

Browse files
authored
[LABS-126] Add label support to /add_key (#20098)
Add label support
1 parent f7b7c66 commit ab55288

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

chia/wallet/wallet_request_types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ class GenerateMnemonicResponse(Streamable):
125125
@dataclass(frozen=True)
126126
class AddKey(Streamable):
127127
mnemonic: list[str]
128+
label: Optional[str] = None
128129

129130

130131
@streamable

chia/wallet/wallet_rpc_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ async def generate_mnemonic(self, request: Empty) -> GenerateMnemonicResponse:
810810
async def add_key(self, request: AddKey) -> AddKeyResponse:
811811
# Adding a key from 24 word mnemonic
812812
try:
813-
sk = await self.service.keychain_proxy.add_key(" ".join(request.mnemonic))
813+
sk = await self.service.keychain_proxy.add_key(" ".join(request.mnemonic), label=request.label)
814814
except KeyError as e:
815815
raise ValueError(f"The word '{e.args[0]}' is incorrect.")
816816

0 commit comments

Comments
 (0)