Author

Topic: Console commands (Read 243 times)

HCP
legendary
Activity: 2086
Merit: 4361
December 17, 2017, 09:02:25 PM
#4
As far as I'm aware, there is no way to do this within Electrum itself... you'd need to dump the codes out and then run them through an external QRCode generator of some description.

The console in Electrum is a very basic Python Interpreter... and is not a "full" Python environment... and not able to affect the Electrum GUI as far as I can tell.
staff
Activity: 3500
Merit: 6152
December 17, 2017, 01:42:29 PM
#3
Everything worked, I appreciate it. I just want know is there is anyway to show the QRcode of these private keys? I found on the documentation something about gui.show_qrcode but that didn't work. Have you tried it? If that's something achievable, I assume it will open a window and not draw the code in the console so If that's the case, can you make it that it open multiple windows (multiple codes)?
HCP
legendary
Activity: 2086
Merit: 4361
December 06, 2017, 06:20:15 AM
#2
You can... providing the return value of the first command is compatible with the inputs required for the 2nd command.

For instance... you can do: deserialize(gettransaction("TXID_HERE"))

If however your first command is returning something that isn't identical to the type of input needed for the 2nd command, you'll probably need to do some "python" programming and maybe use a "for" loop or something like that to iterate over the collection of addresses or unspent coins etc...

Balance of each address:
Code:
for theAddress in listaddresses():
  print(theAddress)
  print(getaddressbalance(theAddress))


PrivateKeys of addresses with balance:
Code:
for utxo in listunspent():
  print(utxo["address"])
  print(getprivatekeys(utxo["address"]))

NOTES:
- Copy each line one at a time... otherwise weird things might happen
- The spaces at the beginning of each "print" line ARE important
- You'll need to press enter a couple of times to get it to run
staff
Activity: 3500
Merit: 6152
December 05, 2017, 08:59:34 AM
#1
Is it possible to use multiple console commands. If yes, how? I'm trying to basically get the balance from addresses with something like this:

Code:
getaddressbalance(listaddresses())

or export the private keys of all addresses that has unspent funds.

Code:
getprivatekeys(listunspent())

Jump to: