Voting

Voting

class Voting(**kwargs)

Implements the voting api endpoints.

executed_polls(vote_type: int, pubkey_of_member_being_voted_on: Union[pystratis.core.types.hexstr.hexstr, str], **kwargs) → List[pystratis.api.global_responsemodels.pollviewmodel.PollViewModel]

Gets a list of executed polls.

Parameters:
  • vote_type (VoteKey, optional) – The type of vote to query.
  • pubkey_of_member_being_voted_on (PubKey, optional) – The pubkey to query.
  • **kwargs – Extra keyword arguments.
Returns:

A list of executed polls.

Return type:

List[PollViewModel]

Raises:

APIError – Error thrown by node API. See message for details.

finished_polls(vote_type: int, pubkey_of_member_being_voted_on: Union[pystratis.core.types.hexstr.hexstr, str], **kwargs) → List[pystratis.api.global_responsemodels.pollviewmodel.PollViewModel]

Gets a list of finished polls.

Parameters:
  • vote_type (VoteKey, optional) – The type of vote to query.
  • pubkey_of_member_being_voted_on (PubKey, optional) – The pubkey to query.
  • **kwargs – Extra keyword arguments.
Returns:

A list of finished polls.

Return type:

List[PollViewModel]

Raises:

APIError – Error thrown by node API. See message for details.

pending_polls(vote_type: int, pubkey_of_member_being_voted_on: Union[pystratis.core.types.hexstr.hexstr, str], **kwargs) → List[pystratis.api.global_responsemodels.pollviewmodel.PollViewModel]

Gets a list of pending polls.

Parameters:
  • vote_type (VoteKey, optional) – The type of vote to query.
  • pubkey_of_member_being_voted_on (PubKey, optional) – The pubkey to query.
  • **kwargs – Extra keyword arguments.
Returns:

A list of pending polls.

Return type:

List[PollViewModel]

Raises:

APIError – Error thrown by node API. See message for details.

scheduled_votes(**kwargs) → List[pystratis.api.voting.responsemodels.votingdatamodel.VotingDataModel]

Gets the scheduled voting data.

Parameters:**kwargs – Extra keyword arguments.
Returns:A list of voting data.
Return type:List[VotingDataModel]
Raises:APIError – Error thrown by node API. See message for details.
schedulevote_removehash(hash_id: Union[pystratis.core.types.uint256.uint256, str], **kwargs) → None

Vote to remove a hash from whitelist.

Parameters:
  • hash_id (uint256, str) – The hash to remove.
  • **kwargs – Extra keyword arguments.
Returns:

None

Raises:

APIError – Error thrown by node API. See message for details.

schedulevote_whitelisthash(hash_id: Union[pystratis.core.types.uint256.uint256, str], **kwargs) → None

Vote to add a hash from whitelist.

Parameters:
  • hash_id (uint256, str) – The hash to whitelist.
  • **kwargs – Extra keyword arguments.
Returns:

None

Raises:

APIError – Error thrown by node API. See message for details.

whitelisted_hashes(**kwargs) → List[pystratis.api.voting.responsemodels.whitelistedhashesmodel.WhitelistedHashesModel]

Gets a list of whitelisted hashes.

Parameters:**kwargs – Extra keyword arguments.
Returns:A list of whitelisted hashes.
Return type:List[WhitelistedhashesModel]
Raises:APIError – Error thrown by node API. See message for details.

PollViewModel

class PollViewModel

A pydantic model for polling data.

VotingDataModel

class VotingDataModel

A pydantic model representing voting data.

WhitelistedHashesModel

class WhitelistedHashesModel

A pydantic model for a whitelisted hash.