graphenecommon.aio.chain module

class graphenecommon.aio.chain.AbstractGrapheneChain(*args, **kwargs)

Bases: graphenecommon.chain.AbstractGrapheneChain

broadcast(tx=None)

Broadcast a transaction to the Blockchain

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

Connect to blockchain network

Async version does wallet initialization after connect because wallet depends on prefix which is available after connection only, and we want to keep __init__() synchronous.

finalizeOp(ops, account, permission, **kwargs)

This method obtains the required private keys if present in the wallet, finalizes the transaction, signs it and broadacasts it

Parameters:
  • ops (operation) – The operation (or list of operaions) to broadcast
  • account (operation) – The account that authorizes the operation
  • permission (string) – The required permission for signing (active, owner, posting)
  • append_to (object) – This allows to provide an instance of ProposalsBuilder (see new_proposal()) or TransactionBuilder (see new_tx()) to specify where to put a specific operation.
… note:: append_to is exposed to every method used in the
this class

… note:

If ``ops`` is a list of operation, they all need to be
signable by the same key! Thus, you cannot combine ops
that require active permission with ops that require
posting permission. Neither can you use different
accounts for different operations!
… note:: This uses txbuffer as instance of
transactionbuilder.TransactionBuilder. You may want to use your own txbuffer
info()

Returns the global properties

sign(tx=None, wifs=[])

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.