createmultisig createmultisig(threshold, pubkeys)Ĭreates a multisignature P2SH address with threshold and pubkeys (an array).OVERHAUL PENDING - write up changes pending, Gain factors to be added as I go through updating/overhauling everything Does not detach labels that may have been attached to addresses by previous requests. check_seed check_seed(seed, opt_entropy, opt_language)Ĭheck that seed (a string) was generated with given opt_entropy (optional) and opt_language (optional). broadcast broadcast(tx)īroadcast transaction tx (serialized hex format) to the network. It’s not clear why this function would ever be necessary. tx must have at least one input controlled by the wallet. addtransaction addtransaction(tx)Īdds transaction tx (serialized hex format) to the wallet history. If no payment is received, the address will be considered as unused if the payment request is deleted from the wallet. The address will be considered as used after this operation. addrequest addrequest(amount, label)Ĭreate a payment request for amount (in BTC) with label, using the first unused address of the wallet. The following is a list of built-in functions supported by the Console with example usage. Others make it possible to do things that are otherwise impossible. Many of them merely provide a command-line interface for things that can be done through the GUI. Built-in FunctionsĮlectrum supports a wide range of built-in functions. In this way, you can build up complex workflows modularly.įor more scripting ideas and examples, see the scripting tutorial. After loading the code with the exec command, you’ll be able to list your unspent outputs by outpoint: exec(open( '/pat/to/script/outpoints.py').read())Īlthough it may be obvious, your stored scripts can themselves import other scripts that use Electrum. Save this code as a function called outpoints contained in the file outpoints.py. A better option is to store scripts in a file, which can then be re-run from the Console: exec(open( '/path/to/script/test.py').read())įor example, you could create a file that adds a new custom function that lists all UTXOs by outpoint. Running Stored ScriptsĪs you begin using the Console for more sophisticated tasks, re-entering scripts will become tedious. The last two lines are blank, causing the preceding code to be executed as a unit. , after which we enter two spaces followed by the print statement. We can do that as follows: > for unspent in listunspent(): This can be done, but Python’s rules for significant whitespace must be followed.įor example, imagine we want to iterate over the addresses controlling unspent outputs. You may want to enter a code block into the Console. These commands (built-in functions) are enumerated and documented at the end of this post. You should see a list of available commands. For example, a good way to begin your exploration would be to issue the help command: help() Entering CommandsĮnter commands into the console by typing them after the > prompt and then pressing enter. The console allows you to perform this kind of automation and a lot more. For example, you may want to export certain views of your Electrum activity into reporting tools such as accounting software. One common reason to use the Console is reporting. This allows you build scripts to automate various activities you might perform routinely. The console provides you with an interactive Python shell configured with Electrum’s libraries. Then click on the Console button near the top of Electrum’s main window. Beginning Electrum users may want to first read A Beginner’s Guide to the Electrum Bitcoin Wallet and/or consider pre-ordering the upcoming book Electrum for Bitcoin Beginners. This article shows how to use the Console, and documents its built-in functions. One of Electrum’s most powerful features is the Console. Electrum is a popular wallet that can be used by beginners and experts alike.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |