governance_client

class algofipy.governance.v1.governance_client.GovernanceClient(algofi_client)

Bases: object

get_governor_admin_state()

Function that uses indexer to query for governors’ admin state

get_governor_proposal_state(proposal_app_id)

Function that uses indexer to query for governors’ proposal state

get_governor_voting_escrow_state()

Function that uses indexer to query for governors’ voting escrow state

get_opt_in_txns(user, storage_address)

Constructs a series of transactions to opt the user and their storage account into all of the necessary applications for governance including the admin, the voting escrow, and the rewards manager.

Parameters:
  • user (AlgofiUser) – user we are opting into the contracts

  • storage_address – a newly created account that will serve as the

storage account for the user on the protocol :type storage_address: str :return: a series of transactions to opt the user and their storage account into all of the necessary applications for governance including the admin, the voting escrow, and the rewards manager. :rtype: TransactionGroup

get_user(user_address)

Gets an algofi governance user given an address.

Parameters:

user_address (str) – the address of the user we are interested in.

Returns:

an algofi governance user.

Return type:

GovernanceUser

load_state(block=None)

Creates new admin, voting escrow, and rewards managers on the algofi client object and loads their state.