bitshares.aio.transactionbuilder module

class bitshares.aio.transactionbuilder.ProposalBuilder(*args, **kwargs)[source]

Bases: bitshares.instance.BlockchainInstance, bitshares.aio.transactionbuilder.ProposalBuilder

Proposal Builder allows us to construct an independent Proposal that may later be added to an instance ot TransactionBuilder.

Parameters:
  • proposer (str) – Account name of the proposing user
  • proposal_expiration (int) – Number seconds until the proposal is supposed to expire
  • proposal_review (int) – Number of seconds for review of the proposal
  • transactionbuilder.TransactionBuilder – Specify your own instance of transaction builder (optional)
  • blockchain_instance (instance) – Blockchain instance
appendOps(ops, append_to=None)[source]

Append op(s) to the transaction builder

Parameters:ops (list) – One or a list of operations
bitshares

Alias for the specific blockchain.

blockchain
blockchain_instance_class

alias of bitshares.instance.BlockchainInstance

broadcast()[source]
chain

Short form for blockchain (for the lazy)

define_classes()[source]

Needs to define instance variables that provide classes

get_instance_class()

Should return the Chain instance class, e.g. bitshares.BitShares

get_parent()[source]

This allows to referr to the actual parent of the Proposal

get_raw()[source]

Returns an instance of base “Operations” for further processing

classmethod inject(cls)
is_empty()[source]
json()[source]

Return the json formated version of this proposal

list_operations()[source]
set_expiration(p)[source]
set_parent(p)[source]
set_proposer(p)[source]
set_review(p)[source]
classmethod set_shared_blockchain_instance(instance)

This method allows us to override default instance for all users of SharedInstance.instance.

Parameters:instance (chaininstance) – Chain instance
classmethod set_shared_config(config)

This allows to set a config that will be used when calling shared_blockchain_instance and allows to define the configuration without requiring to actually create an instance

set_shared_instance()

This method allows to set the current instance as default

shared_blockchain_instance()

This method will initialize SharedInstance.instance and return it. The purpose of this method is to have offer single default instance that can be reused by multiple classes.

class bitshares.aio.transactionbuilder.TransactionBuilder(*args, **kwargs)[source]

Bases: bitshares.instance.BlockchainInstance, bitshares.aio.transactionbuilder.TransactionBuilder

This class simplifies the creation of transactions by adding operations and signers.

addSigningInformation(account, permission)[source]

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!

add_required_fees(ops, asset_id='1.3.0')[source]

Auxiliary method to obtain the required fees for a set of operations. Requires a websocket connection to a witness node!

appendMissingSignatures()[source]

Store which accounts/keys are supposed to sign the transaction

This method is used for an offline-signer!

appendOps(ops, append_to=None)[source]

Append op(s) to the transaction builder

Parameters:ops (list) – One or a list of operations
appendSigner(accounts, permission)[source]

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

appendWif(wif)[source]

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

bitshares

Alias for the specific blockchain.

blockchain
blockchain_instance_class

alias of bitshares.instance.BlockchainInstance

broadcast()[source]

Broadcast a transaction to the blockchain network

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

Short form for blockchain (for the lazy)

clear()[source]

Clear the transaction builder and start from scratch

constructTx()[source]

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

copy() → a shallow copy of D
define_classes()[source]

Needs to define instance variables that provide classes

fromkeys()

Create a new dictionary with keys from iterable and values set to value.

get()

Return the value for key if key is in the dictionary, else default.

get_block_params(use_head_block=False)[source]

Auxiliary method to obtain ref_block_num and ref_block_prefix. Requires a websocket connection to a witness node!

get_instance_class()

Should return the Chain instance class, e.g. bitshares.BitShares

get_parent()[source]

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

classmethod inject(cls)
is_empty()[source]
items() → a set-like object providing a view on D's items
json()[source]

Show the transaction as plain json

keys() → a set-like object providing a view on D's keys
list_operations()[source]
permission_types = ['active', 'owner']
pop(k[, d]) → v, remove specified key and return the corresponding value.

If key is not found, d is returned if given, otherwise KeyError is raised

popitem() → (k, v), remove and return some (key, value) pair as a

2-tuple; but raise KeyError if D is empty.

set_expiration(p)[source]
set_fee_asset(fee_asset)[source]

Set asset to fee

classmethod set_shared_blockchain_instance(instance)

This method allows us to override default instance for all users of SharedInstance.instance.

Parameters:instance (chaininstance) – Chain instance
classmethod set_shared_config(config)

This allows to set a config that will be used when calling shared_blockchain_instance and allows to define the configuration without requiring to actually create an instance

set_shared_instance()

This method allows to set the current instance as default

setdefault()

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

shared_blockchain_instance()

This method will initialize SharedInstance.instance and return it. The purpose of this method is to have offer single default instance that can be reused by multiple classes.

sign()[source]

Sign a provided transaction with the 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.
update([E, ]**F) → None. Update D from dict/iterable E and F.

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values() → an object providing a view on D's values
verify_authority()[source]

Verify the authority of the signed transaction