Last active
August 29, 2015 14:04
-
-
Save chill117/07555de183683ea17343 to your computer and use it in GitHub Desktop.
Get an address by its index from the default wallet in Electrum.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Place this file in the Electrum scripts directory. Then run from command line, like this: `~/.electrum/scripts/get_address_by_index.py <index>`. | |
import sys | |
from electrum import SimpleConfig, Wallet, WalletStorage | |
try: | |
index = int(sys.argv[1]) | |
except Exception: | |
print 'Usage: ' + sys.argv[0] + ' <index>' | |
sys.exit(1) | |
config = SimpleConfig() | |
storage = WalletStorage(config) | |
wallet = Wallet(storage) | |
for i in wallet.accounts: | |
print wallet.accounts[i].get_address(0, index) | |
break | |
sys.exit(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment