admin

class algofipy.governance.v1.admin.Admin(governance_client)

Bases: object

close_out_from_proposal_txns(user_calling, user_closing_out, proposal)

Constructs a series of transactions which will close out a target user from a proposal.

Parameters:
  • user_calling (AlgofiUser) – user who is calling the transaction

  • user_closing_out (AlgofiUser) – user who is closing out

  • proposal (Proposal) – proposal being closed out of

Returns:

a series of transactions which will close out a target user from a proposal.

Return type:

TransactionGroup

get_create_proposal_txns(user, title, link)

Constructs a series of transactions to create a proposal.

Parameters:
  • user (AlgofiUser) – user who is trying to create the transaction

  • title (str) – title of the proposal to be created

  • link (str) – link of the proposal to be created

Returns:

a series of transactions to create a proposal.

Return type:

TransactionGroup

get_delegate_txns(user, delegatee)

Constructs a series of transactions to delegate a user’s votes to another user.

Parameters:
  • user (AlgofiUser) – user who is delegating

  • delegatee (AlgofiUser) – user who is being delegated to

Returns:

a series of transactions to delegate a user’s votes to another user.

Return type:

TransactionGroup

get_delegated_vote_txns(calling_user, voting_user, proposal)

Constructs a series of transactions that will make a user vote on a proposal as their delegatee has.

Parameters:
  • calling_user (AlgofiUser) – user who is calling the delegated vote transaction

  • voting_user (AlgofiUser) – user who is voting

  • proposal (AlgofiUser) – proposal being voted on

Returns:

a series of transactions that will make a user vote on a proposal

as their delegatee has. :rtype: TransactionGroup

get_set_not_open_to_delegation_txns(user)

Constructs a series of tranactions to set a user not open to delegation.

Parameters:

user (AlgofiUser) – user who is setting themselves not open to delegation

Returns:

a series of tranactions to set a user not open to delegation.

Return type:

TransactionGroup

get_set_open_to_delegation_txns(user)

Constructs a series of transactions to set a user open to delegation.

Parameters:

user (AlgofiUser) – user who is setting themselves open to delegation

Returns:

a series of transactions to set a user open to delegation.

Return type:

TransactionGroup

get_undelegate_txns(user)

Constructs a series of transactions that will undelegate a user from their current delegatee.

Parameters:

user (AlgofiUser) – user who is undelegating

Returns:

series of transactions that will undelegate a user from their

current delegatee. :rtype: TransactionGroup

get_update_user_vebank_txns(user_calling, user_updating)

Constructs a series of transactions to update a target user’s vebank.

Parameters:
  • user_calling (AlgofiUser) – the user who is calling the transaction

  • user_updating (AlgofiUser) – the user who is being updated

Returns:

a series of transactions to update a target user’s vebank.

Return type:

TransactionGroup

get_validate_txns(user, proposal)

Constructs a series of transactions that will validate a specific proposal.

Parameters:
  • user (AlgofiUser) – user who is trying to validate a proposal

  • proposal (Proposal) – the proposal to validate

Returns:

a series of transactions that will validate a specific proposal.

Return type:

TransactionGroup

get_vote_txns(user, proposal, for_or_against)

Constructs a series of transactions to vote on a proposal.

Parameters:
  • user (AlgofiUser) – user who is voting

  • proposal (Proposal) – proposal being voted on

Returns:

a series of transactions to vote on a proposal.

Return type:

TransactionGroup

load_state(block=None)

Function to refresh and load all of the global and local state we need to keep track of on the admin, including all of the proposals that have been created.