beem.transactionbuilder module

class beem.transactionbuilder.TransactionBuilder(tx={}, proposer=None, expiration=None, steem_instance=None)

Bases: dict

This class simplifies the creation of transactions by adding operations and signers. To build your own transactions and sign them

from beem.transactionbuilder import TransactionBuilder
from beembase.operations import Transfer
tx = TransactionBuilder()
tx.appendOps(Transfer(**{
         "from": "test",
         "to": "test1",
         "amount": "1 STEEM",
         "memo": ""
     }))
tx.appendSigner("test", "active")
tx.sign()
tx.broadcast()
addSigningInformation(account, permission)

This is a private method that adds side information to a unsigned/partial transaction in order to simplify later signing (e.g. for multisig or coldstorage)

FIXME: Does not work with owner keys!

appendMissingSignatures()

Store which accounts/keys are supposed to sign the transaction

This method is used for an offline-signer!

appendOps(ops, append_to=None)

Append op(s) to the transaction builder

Parameters:ops (list) – One or a list of operations
appendSigner(account, permission)

Try to obtain the wif key from the wallet by telling which account and permission is supposed to sign the transaction

appendWif(wif)

Add a wif that should be used for signing of the transaction.

broadcast()

Broadcast a transaction to the steem network

Parameters:tx (tx) – Signed transaction to broadcast
clear()

Clear the transaction builder and start from scratch

constructTx()

Construct the actual transaction and store it in the class’s dict store

get_parent()

TransactionBuilders don’t have parents, they are their own parent

is_empty()
json()

Show the transaction as plain json

list_operations()
set_expiration(p)
sign()

Sign a provided transaction witht he provided key(s)

Parameters:
  • tx (dict) – The transaction to be signed and returned
  • wifs (string) – One or many wif keys to use for signing a transaction. If not present, the keys will be loaded from the wallet as defined in “missing_signatures” key of the transactions.
verify_authority()

Verify the authority of the signed transaction