Electrum can restore a HD wallet but indeed it's tricky to handle multiple wallets at the same time there.
Yes, but what i meant is there's no Electrum command to import HD wallet. You don't plan to import it manually, do you?
The "restore" command works in the console, command line and through an RPC call. It takes a text that can have various formats including a mnemonic word list or a master private key.
See lines 151-166 in
https://github.com/spesmilo/electrum/blob/master/electrum/commands.pyWith Curl:
curl --data-binary '{"id":"curltext","method":"restore","params":{"text":"word1 word2 word3...""}}'
http://user:password@127.0.0.1:7777As for working with multiple wallets, that's a bit hacky but I figured out switching between them can be done by using the "setconfig" command. For example:
curl --data-binary '{"id":"curltext","method":"setconfig","params":{"key":"wallet_path","value":"path/to/wallet1"}}'
http://user:password@127.0.0.1:7777switches to wallet1 file. It's then possible to work with any number of wallet files without restarting the electrum daemon (as I previously thought will be necessary).
I wish they'd publish a full reference for the RPC API, it is tricky to figure out what goes where.
Thanks a lot, I'll check that one as well.