Federation

Federation

class Federation(**kwargs)

Implements the federation api endpoints.

reconstruct(**kwargs) str

Signals the node to rebuild the federation. Will need to restart node when complete.

Parameters:

**kwargs – Extra keyword arguments.

Returns:

The node response ot the request.

Return type:

str

Raises:

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

members_current(**kwargs) FederationMemberDetailedModel

Retrieves the information for the current federation member’s voting status and mining estimates.

Parameters:

**kwargs – Extra keyword arguments.

Returns:

Information on the current member.

Return type:

FederationMemberDetailedModel

Raises:

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

members(**kwargs) List[FederationMemberModel]

Retrieves a list of active federation members and last active times.

Parameters:

**kwargs – Extra keyword arguments.

Returns:

Information on each of federation members.

Return type:

List[FederationMemberModel]

Raises:

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

miner_at_height(block_height: int, **kwargs) PubKey

Gets the federation pubkey that mined the block at the specified height.

Parameters:
  • block_height – The height to query

  • **kwargs

Returns:

The pubkey that produced the block at the specified height.

Return type:

PubKey

Raises:

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

federation_at_height(block_height: int, **kwargs) List[PubKey]

Gets the federation membership at the specified height.

Parameters:
  • block_height – The height to query

  • **kwargs

Returns:

The pubkeys of federation members at the specified height.

Return type:

List[PubKey]

Raises:

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

FederationMemberDetailedModel

class FederationMemberDetailedModel(*, pubkey: PubKey, collateralAmount: Money, lastActiveTime: str, periodOfInactivity: str, pollStartBlockHeight: int = None, pollNumberOfVotesAcquired: int = None, pollFinishedBlockHeight: int = None, pollWillFinishInBlocks: int = None, pollExecutedBlockHeight: int = None, memberWillStartMiningAtBlockHeight: int = None, memberWillStartEarningRewardsEstimateHeight: int = None, pollType: str = None, rewardEstimatePerBlock: Money = None, federationSize: int, miningStats: MiningStats)

A pydantic model for details on federation members.

poll_start_block_height: int | None

The poll start block height.

poll_number_of_votes_acquired: int | None

The number of poll votes acquired.

poll_finished_block_height: int | None

The poll finished block height.

poll_will_finish_in_blocks: int | None

The number of blocks until the poll finishes.

poll_executed_block_height: int | None

The block heigh where poll was executed, if it has occurred.

member_will_start_mining_at_block_height: int | None

Height when the member will start mining.

pubkey: PubKey

The federation member’s pubkey.

collateral_amount: Money

The federation member’s collateral amount.

last_active_time: str

The federation member’s last active time.

period_of_inactivity: str

The federation member’s period of inactivity.

member_will_start_earning_rewards_estimate_height: int | None

Height when member will start earning rewards.

poll_type: str | None

The poll type.

reward_estimate_per_block: Money | None

The reward estimate per block.

federation_size: int

The size of the federation.

mining_stats: MiningStats

The mining stats for the federation member.

FederationMemberModel

class FederationMemberModel(*, pubkey: PubKey, collateralAmount: Money, lastActiveTime: str, periodOfInactivity: str)

A pydantic model for a federation member.

pubkey: PubKey

The federation member’s pubkey.

collateral_amount: Money

The federation member’s collateral amount.

last_active_time: str

The federation member’s last active time.

period_of_inactivity: str

The federation member’s period of inactivity.