diff --git a/electrum b/electrum
index 8e723a70e..a67dac22e 100755
--- a/electrum
+++ b/electrum
@@ -38,82 +38,6 @@ except ImportError:
from decimal import Decimal
-known_commands = {
- 'help':'Prints this help',
- 'validateaddress':'Check that the address is valid',
- 'balance': "Display the balance of your wallet or of an address.\nSyntax: balance [
]",
- 'contacts': "Show your list of contacts",
- 'create':'Create a wallet',
- 'restore':'Restore a wallet',
- 'payto':"""Create and broadcast a transaction.
-Syntax: payto [label]
- can be a bitcoin address or a label
-options:\n --fee, -f: set transaction fee\n --fromaddr, -s: send from address -\n --changeaddr, -c: send change to address
- """,
- 'sendrawtransaction':
- 'Broadcasts a transaction to the network. \nSyntax: sendrawtransaction ',
- 'password':
- "Changes your password",
- 'addresses':
- """Shows your list of addresses.
-options:
- -a: show all addresses, including change addresses
- -k: show private keys
- -b: show the balance of addresses""",
-
- 'history':"Shows the transaction history",
- 'setlabel':'Assign a label to an item\nSyntax: label ',
- 'mktx':
- """Create a signed transaction, password protected.
-Syntax: mktx [label]
-options:\n --fee, -f: set transaction fee\n --fromaddr, -s: send from address -\n --changeaddr, -c: send change to address
- """,
- 'get_seed':
- "Print the generation seed of your wallet.",
- 'importprivkey':
- 'Import a private key\nSyntax: importprivkey ',
- 'signmessage':
- 'Signs a message with a key\nSyntax: signmessage \nIf you want to lead or end a message with spaces, or want double spaces inside the message make sure you quote the string. I.e. " Hello This is a weird String "',
- 'verifymessage':
- 'Verifies a signature\nSyntax: verifymessage \nIf you want to lead or end a message with spaces, or want double spaces inside the message make sure you quote the string. I.e. " Hello This is a weird String "',
- 'eval':
- "Run python eval() on an object\nSyntax: eval \nExample: eval \"wallet.aliases\"",
- 'get':
- "Get config parameter.",
- 'set':
- "Set config parameter.",
- 'deseed':
- "Create a seedless, watching-only wallet.",
- 'freeze':'',
- 'unfreeze':'',
- 'prioritize':'',
- 'unprioritize':'',
- 'dumpprivkey':'similar to bitcoind\'s command',
- 'dumpprivkeys':'dump all private keys',
- 'listunspent':'similar to bitcoind\'s command',
- 'createmultisig':'similar to bitcoind\'s command',
- 'createrawtransaction':'similar to bitcoind\'s command',
- 'decoderawtransaction':'similar to bitcoind\'s command',
- 'signrawtransaction':'similar to bitcoind\'s command',
- 'get_history': 'get history for an address'
-
- }
-
-
-
-offline_commands = [ 'password', 'mktx',
- 'setlabel', 'contacts',
- 'help', 'validateaddress',
- 'signmessage', 'verifymessage',
- 'eval', 'set', 'get', 'create', 'addresses',
- 'importprivkey', 'get_seed',
- 'deseed',
- 'freeze','unfreeze',
- 'prioritize','unprioritize',
- 'dumpprivkey','listunspent',
- 'createmultisig', 'createrawtransaction', 'decoderawtransaction', 'signrawtransaction'
- ]
-
# get password routine
diff --git a/lib/__init__.py b/lib/__init__.py
index b07d09606..ea116ab9b 100644
--- a/lib/__init__.py
+++ b/lib/__init__.py
@@ -10,4 +10,4 @@ import bitcoin
from bitcoin import Transaction, EC_KEY
from mnemonic import mn_encode as mnemonic_encode
from mnemonic import mn_decode as mnemonic_decode
-from commands import protected_commands, Commands
+from commands import protected_commands, known_commands, offline_commands, Commands
diff --git a/lib/commands.py b/lib/commands.py
index 506ff6130..117c688a2 100644
--- a/lib/commands.py
+++ b/lib/commands.py
@@ -22,6 +22,80 @@ from bitcoin import *
from decimal import Decimal
import bitcoin
+known_commands = {
+ 'help':'Prints this help',
+ 'validateaddress':'Check that the address is valid',
+ 'balance': "Display the balance of your wallet or of an address.\nSyntax: balance []",
+ 'contacts': "Show your list of contacts",
+ 'create':'Create a wallet',
+ 'restore':'Restore a wallet',
+ 'payto':"""Create and broadcast a transaction.
+Syntax: payto [label]
+ can be a bitcoin address or a label
+options:\n --fee, -f: set transaction fee\n --fromaddr, -s: send from address -\n --changeaddr, -c: send change to address
+ """,
+ 'sendrawtransaction':
+ 'Broadcasts a transaction to the network. \nSyntax: sendrawtransaction ',
+ 'password':
+ "Changes your password",
+ 'addresses':
+ """Shows your list of addresses.
+options:
+ -a: show all addresses, including change addresses""",
+
+ 'history':"Shows the transaction history",
+ 'setlabel':'Assign a label to an item\nSyntax: label ',
+ 'mktx':
+ """Create a signed transaction, password protected.
+Syntax: mktx [label]
+options:\n --fee, -f: set transaction fee\n --fromaddr, -s: send from address -\n --changeaddr, -c: send change to address
+ """,
+ 'get_seed':
+ "Print the generation seed of your wallet.",
+ 'importprivkey':
+ 'Import a private key\nSyntax: importprivkey ',
+ 'signmessage':
+ 'Signs a message with a key\nSyntax: signmessage \nIf you want to lead or end a message with spaces, or want double spaces inside the message make sure you quote the string. I.e. " Hello This is a weird String "',
+ 'verifymessage':
+ 'Verifies a signature\nSyntax: verifymessage \nIf you want to lead or end a message with spaces, or want double spaces inside the message make sure you quote the string. I.e. " Hello This is a weird String "',
+ 'eval':
+ "Run python eval() on an object\nSyntax: eval \nExample: eval \"wallet.aliases\"",
+ 'get':
+ "Get config parameter.",
+ 'set':
+ "Set config parameter.",
+ 'deseed':
+ "Create a seedless, watching-only wallet.",
+ 'freeze':'',
+ 'unfreeze':'',
+ 'prioritize':'',
+ 'unprioritize':'',
+ 'dumpprivkey':'similar to bitcoind\'s command',
+ 'dumpprivkeys':'dump all private keys',
+ 'listunspent':'similar to bitcoind\'s command',
+ 'createmultisig':'similar to bitcoind\'s command',
+ 'createrawtransaction':'similar to bitcoind\'s command',
+ 'decoderawtransaction':'similar to bitcoind\'s command',
+ 'signrawtransaction':'similar to bitcoind\'s command',
+ 'get_history': 'get history for an address'
+
+ }
+
+
+
+offline_commands = [ 'password', 'mktx',
+ 'setlabel', 'contacts',
+ 'help', 'validateaddress',
+ 'signmessage', 'verifymessage',
+ 'eval', 'set', 'get', 'create', 'addresses',
+ 'importprivkey', 'get_seed',
+ 'deseed',
+ 'freeze','unfreeze',
+ 'prioritize','unprioritize',
+ 'dumpprivkey','listunspent',
+ 'createmultisig', 'createrawtransaction', 'decoderawtransaction', 'signrawtransaction'
+ ]
+
protected_commands = ['payto', 'password', 'mktx', 'get_seed', 'importprivkey','signmessage', 'signrawtransaction', 'dumpprivkey', 'dumpprivkeys' ]
class Commands: