How can I get a wallet Id when cardano-wallet create return wallet_already_exists

Viewed 225

So far when I try to create a wallet with a recovery phrase that already exist the server returns 409 conflict and an error message saying: "This operation would yield a wallet with the following id: {id} However, I already know of a wallet with this id."

So the question is: Is there another way rather than extracting the id from the response message? I mean hopefully there is a better way to get the wallet Id, from the recovery phrase maybe?

2 Answers

Not at present, POST /v2/wallets is the only way the app allows a user to provide a mnemonic phrase, and as you've found it doesn't return the ID as a separate field.

If you're using cardano-wallet to handle only a single wallet, one could just 'List' all wallets, and pick it from the list.

As soccer193 already point out, there isn't a way to get back the wallet Id from the mnemonic phrase right now although there are plans to include it in some way as you can confirm from this issue from cardano-wallet's github repo.

Related