Governance#

class defichain.transactions.builder.modules.Governance(builder)#

The methods of this module create governance transactions

  1. vote: transaction witch includes your own hexadecimal data

vote(proposalId: str, masternodeId: str, decision: str, inputs=[]) Transaction#

Creates a transaction that votes for proposal

>>> builder.governance.vote("1f4039ab714cf73ff1d92b58608ed20a73a799cde88c103b679bdafd83eb472b", "33abc61982725be797f83b47da6f41a344f4d64879d84e31d87a91281070add8", "neutral")  # creates a vote transaction
Parameters:
  • proposalId (str) – (required) the proposal txid

  • masternodeId (str) – (required) the masternodeId to vote with

  • decision (str) – (required) the vote decision (yes / no / neutral)

  • inputs ([TxInput]) – (optional) additional inputs to spend

Returns:

Transaction