voting_escrow¶
- class algofipy.governance.v1.voting_escrow.VotingEscrow(governance_client)¶
Bases:
object
- get_claim_txns(user)¶
Constructs a series of transactions for claiming the user’s locked amount after the timelock expires.
- Parameters:
user (
AlgofiUser
) – user who is claiming locked amount- Returns:
transaction group for claiming the user’s locked amount
- Return type:
TransactionGroup
- get_extend_lock_txns(user, duration_seconds)¶
Constructs a series of transactions that extend a user’s lock.
- Parameters:
user (
AlgofiUser
) – user who is lockingduration_seconds (int) – amount of time they are extending for in seconds
- Returns:
transaction group for extending lock of a user
- Return type:
TransactionGroup
- get_increase_lock_amount_txns(user, amount)¶
Constructs a series of transactions that increase a user’s lock amount.
- Parameters:
user (
AlgofiUser
) – user who is lockingamount (int) – amount they are increasing their lock for in microBANK
- Returns:
transaction group for increasing the locked amount
- Return type:
TransactionGroup
- get_lock_txns(user, amount, duration_seconds)¶
Constructs a series of transactions that lock a user’s BANK.
- Parameters:
user (
AlgofiUser
) – user who is lockingamount (int) – amount they are locking in microBANK
duration_seconds (int) – amount of time they are locking for in seconds
- Returns:
transaction group for locking BANK
- Return type:
TransactionGroup
- get_projected_boost_multiplier(user_voting_escrow_state)¶
Get projected vebank amount for user.
- Parameters:
user_voting_escrow_state (
UserVotingEscrowState
) – user voting escrow state- Returns:
projected vebank amount
- Return type:
int
- get_projected_vebank_amount(user_voting_escrow_state)¶
Get projected vebank amount for user.
- Parameters:
user_voting_escrow_state (
UserVotingEscrowState
) – user voting escrow state- Returns:
projected vebank amount
- Return type:
int
- get_update_vebank_data_txns(user_calling, user_updating)¶
Constructs a series of transactions to update a target user’s vebank.
- Parameters:
user_calling (
AlgofiUser
) – algofi user object for user updatinguser_updating (
AlgofiUser
) – algofi user object for user being updated
- Returns:
transaction group for updating target user vebank amount
- Return type:
TransactionGroup
- load_state(block=None)¶
Function which will update the data on the voting escrow object to match that of the global state of the voting escrow contract.