<p>You can try the <code>select_wallet</code> method of the Electrum JSON-RPC API to switch between wallets</p>
<p>for example for a wallet <code>dat_test_wallet_01</code></p>
<pre><code>{&quot;jsonrpc&quot;: &quot;2.0&quot;, &quot;id&quot;: &quot;test&quot;, &quot;method&quot;: &quot;select_wallet&quot;, &quot;params&quot;: {&quot;name&quot;: &quot;dat_test_wallet_01&quot;}} 
</code></pre>
<p>for multiple wallet you can use <code>load_wallet</code> like</p>
<pre><code>{&quot;jsonrpc&quot;: &quot;2.0&quot;, &quot;id&quot;: &quot;test&quot;, &quot;method&quot;: &quot;load_wallet&quot;, &quot;params&quot;: {&quot;path&quot;: &quot;/electrum/testnet/wallets/dat_test_wallet_01&quot;}}
{&quot;jsonrpc&quot;: &quot;2.0&quot;, &quot;id&quot;: &quot;test&quot;, &quot;method&quot;: &quot;select_wallet&quot;, &quot;params&quot;: {&quot;name&quot;: &quot;dat_test_wallet_01&quot;}}
</code></pre>

CC BY-SA 4.0
2023-03-21T08:14:57.477Z
I cannot rely on "select_wallet" functionality, because there might be another "select_wallet" between my two commands, and the selected wallet gets changed in between.
Meglio
CC BY-SA 4.0
2023-03-15T22:52:45.037Z
2023-03-16T12:27:23.883Z
2023-03-16T12:27:23.883Z
Saxtheowl
<p>It seems that the &quot;wallet&quot; parameter is not recognized by the &quot;load_wallet&quot; method in the context of the JSON-RPC call you are making.</p>
<p>One solution could be to pass the wallet path as a command-line argument when starting the JSON-RPC server. For example, if you are using Electrum, you could start the server with the following command:</p>
<pre><code>electrum --testnet --rpcuser=&lt;username&gt; --rpcpassword=&lt;password&gt; --rpchost=localhost --rpcport=8000 /electrum/testnet/wallets/orders001
</code></pre>
<p>This command starts the Electrum server in testnet mode and specifies the wallet path as the last argument.</p>
<p>Once the server is running, you can make JSON-RPC requests to it without including the &quot;wallet&quot; parameter in the payload. The server should automatically load the wallet specified in the command-line argument.</p>
<p>Alternatively, you could try using the &quot;load_wallet_file&quot; method instead of &quot;load_wallet&quot;. According to the Electrum documentation, &quot;load_wallet_file&quot; takes a single argument, which is the path to the wallet file. Here is an example payload:</p>
<p><code>{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;id&quot;:&quot;test&quot;,&quot;method&quot;:&quot;load_wallet_file&quot;,&quot;params&quot;:[&quot;/electrum/testnet/wallets/orders001&quot;]}</code></p>
<p>Note that the wallet path is passed as an array element in the &quot;params&quot; field, not as a separate &quot;wallet&quot; parameter.</p>

CC BY-SA 4.0
2023-03-15T21:37:26.970Z
None of the solutions proposed help when working with multiple wallets via json-rpc. I need to specify the target wallet for each wallet-related command, and keep multiple wallets loader.
Meglio
CC BY-SA 4.0
2023-03-15T20:27:49.747Z
2023-03-15T20:27:49.747Z
Dan
<p>When calling <code>load_wallet</code> through json-rpc, using &quot;wallet&quot; param with a path to the wallet throws an error:</p>
<pre><code>Commands.load_wallet() got an unexpected keyword argument 'wallet'
</code></pre>
<p>In the same time, <code>electrum help load_wallet</code> lists <code>wallet</code> as an acceptable option:</p>
<p><a href="https://i.sstatic.net/cEemG.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/cEemG.png" alt="electrum help load_wallet" /></a></p>
<p>The question is, how do I specify wallet path when calling load_wallet through json-rpc.</p>
<p>Example payload:</p>
<pre><code>{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;id&quot;:&quot;test&quot;,&quot;method&quot;:&quot;load_wallet&quot;,&quot;params&quot;:{&quot;wallet&quot;: &quot;/electrum/testnet/wallets/orders001&quot;}}
</code></pre>

CC BY-SA 4.0
2023-03-15T20:13:18.837Z
are you running electrumX ?
Saxtheowl
CC BY-SA 4.0
2023-03-15T21:38:10.550Z
No, my question is about Electrum daemon and json-rpc.
Meglio
<json-rpc><electrum><electrum-console>
Electrum load_wallet through json-rpcs does not accept "wallet" parameter
Meglio
# Electrum load_wallet through json-rpcs does not accept "wallet" parameter

(Asked by: username_0 on 2023-03-14)

When calling load_wallet through json-rpc, using "wallet" param with a path to the wallet throws an error:
Commands.load_wallet() got an unexpected keyword argument 'wallet'

In the same time, electrum help load_wallet lists wallet as an acceptable option:

The question is, how do I specify wallet path when calling load_wallet through json-rpc.
Example payload:
{"jsonrpc":"2.0","id":"test","method":"load_wallet","params":{"wallet": "/electrum/testnet/wallets/orders001"}}

**Tags:** json-rpc, electrum, electrum-console

> **Comments:**
> **username_1**: are you running electrumX ?  
> **username_0**: No, my question is about Electrum daemon and json-rpc.  

---

## 2 answers

### Answer by username_1 on 2023-03-15. Score: 0

You can try the select_wallet method of the Electrum JSON-RPC API to switch between wallets
for example for a wallet dat_test_wallet_01
{"jsonrpc": "2.0", "id": "test", "method": "select_wallet", "params": {"name": "dat_test_wallet_01"}} 

for multiple wallet you can use load_wallet like
{"jsonrpc": "2.0", "id": "test", "method": "load_wallet", "params": {"path": "/electrum/testnet/wallets/dat_test_wallet_01"}}
{"jsonrpc": "2.0", "id": "test", "method": "select_wallet", "params": {"name": "dat_test_wallet_01"}}

> **Comments:**
> **username_0**: I cannot rely on "select_wallet" functionality, because there might be another "select_wallet" between my two commands, and the selected wallet gets changed in between.  

---

### Answer by username_2 on 2023-03-15. Score: 0

It seems that the "wallet" parameter is not recognized by the "load_wallet" method in the context of the JSON-RPC call you are making.
One solution could be to pass the wallet path as a command-line argument when starting the JSON-RPC server. For example, if you are using Electrum, you could start the server with the following command:
electrum --testnet --rpcuser= --rpcpassword= --rpchost=localhost --rpcport=8000 /electrum/testnet/wallets/orders001

This command starts the Electrum server in testnet mode and specifies the wallet path as the last argument.
Once the server is running, you can make JSON-RPC requests to it without including the "wallet" parameter in the payload. The server should automatically load the wallet specified in the command-line argument.
Alternatively, you could try using the "load_wallet_file" method instead of "load_wallet". According to the Electrum documentation, "load_wallet_file" takes a single argument, which is the path to the wallet file. Here is an example payload:
{"jsonrpc":"2.0","id":"test","method":"load_wallet_file","params":["/electrum/testnet/wallets/orders001"]}
Note that the wallet path is passed as an array element in the "params" field, not as a separate "wallet" parameter.

> **Comments:**
> **username_0**: None of the solutions proposed help when working with multiple wallets via json-rpc. I need to specify the target wallet for each wallet-related command, and keep multiple wallets loader.  

---

