Documentation
¶
Index ¶
- func CalculateCompleteMinipoolShares(rp *rocketpool.RocketPool, contracts *NetworkContracts, ...) error
- func GetAllMegapoolValidators(rp *rocketpool.RocketPool, contracts *NetworkContracts) ([]megapool.ValidatorInfoFromGlobalIndex, error)
- func GetAllProtocolDaoProposalDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts) ([]protocol.ProtocolDaoProposalDetails, error)
- func GetProtocolDaoProposalDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts, proposalID uint64) (protocol.ProtocolDaoProposalDetails, error)
- func GetTotalEffectiveRplStake(rp *rocketpool.RocketPool, contracts *NetworkContracts) (*big.Int, error)
- type MegapoolRevenueSplitSettings
- type MegapoolRevenueSplitTimeWeightedAverages
- type NativeMegapoolDetails
- type NativeMinipoolDetails
- func GetAllNativeMinipoolDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts) ([]NativeMinipoolDetails, error)
- func GetNativeMinipoolDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts, ...) (NativeMinipoolDetails, error)
- func GetNodeNativeMinipoolDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts, ...) ([]NativeMinipoolDetails, error)
- type NativeNodeDetails
- func (node *NativeNodeDetails) CalculateAverageFeeAndDistributorShares(minipoolDetails []*NativeMinipoolDetails) error
- func (nnd *NativeNodeDetails) IsEligibleForBonuses(eligibleStart time.Time, eligibleEnd time.Time) (bool, time.Time, time.Time)
- func (node *NativeNodeDetails) WasOptedInAt(t time.Time) bool
- type NetworkContracts
- type NetworkDetails
- type OracleDaoMemberDetails
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateCompleteMinipoolShares ¶
func CalculateCompleteMinipoolShares(rp *rocketpool.RocketPool, contracts *NetworkContracts, minipoolDetails []*NativeMinipoolDetails, beaconBalances []*big.Int) error
Calculate the node and user shares of the total minipool balance, including the portion on the Beacon chain
func GetAllMegapoolValidators ¶ added in v1.18.0
func GetAllMegapoolValidators(rp *rocketpool.RocketPool, contracts *NetworkContracts) ([]megapool.ValidatorInfoFromGlobalIndex, error)
Get all megapool validators using the multicaller
func GetAllProtocolDaoProposalDetails ¶
func GetAllProtocolDaoProposalDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts) ([]protocol.ProtocolDaoProposalDetails, error)
Gets all Protocol DAO proposal details using the efficient multicall contract
func GetProtocolDaoProposalDetails ¶
func GetProtocolDaoProposalDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts, proposalID uint64) (protocol.ProtocolDaoProposalDetails, error)
Gets a Protocol DAO proposal's details using the efficient multicall contract
func GetTotalEffectiveRplStake ¶
func GetTotalEffectiveRplStake(rp *rocketpool.RocketPool, contracts *NetworkContracts) (*big.Int, error)
Gets the details for a node using the efficient multicall contract
Types ¶
type MegapoolRevenueSplitSettings ¶ added in v1.18.7
type MegapoolRevenueSplitTimeWeightedAverages ¶ added in v1.18.7
type MegapoolRevenueSplitTimeWeightedAverages struct {
}
type NativeMegapoolDetails ¶ added in v1.18.0
type NativeMegapoolDetails struct {
Address common.Address `json:"address"`
DelegateAddress common.Address `json:"delegate"`
EffectiveDelegateAddress common.Address `json:"effectiveDelegateAddress"`
Deployed bool `json:"deployed"`
ValidatorCount uint32 `json:"validatorCount"`
ActiveValidatorCount uint32 `json:"activeValidatorCount"`
LockedValidatorCount uint32 `json:"lockedValidatorCount"`
NodeDebt *big.Int `json:"nodeDebt"`
RefundValue *big.Int `json:"refundValue"`
DelegateExpiry uint64 `json:"delegateExpiry"`
DelegateExpired bool `json:"delegateExpired"`
NodeExpressTicketCount uint64 `json:"nodeExpressTicketCount"`
UseLatestDelegate bool `json:"useLatestDelegate"`
AssignedValue *big.Int `json:"assignedValue"`
NodeBond *big.Int `json:"nodeBond"`
UserCapital *big.Int `json:"userCapital"`
BondRequirement *big.Int `json:"bondRequirement"`
EthBalance *big.Int `json:"ethBalance"`
LastDistributionTime uint64 `json:"lastDistributionTime"`
}
func GetNodeMegapoolDetails ¶ added in v1.18.0
func GetNodeMegapoolDetails(rp *rocketpool.RocketPool, nodeAccount common.Address) (NativeMegapoolDetails, error)
func (*NativeMegapoolDetails) GetMegapoolBondNormalized ¶ added in v1.18.7
func (m *NativeMegapoolDetails) GetMegapoolBondNormalized() *big.Int
Get the normalized bond per 32 eth validator This is used in treegen to calculate attestation scores
type NativeMinipoolDetails ¶
type NativeMinipoolDetails struct {
// Redstone
Exists bool `json:"exists"`
MinipoolAddress common.Address `json:"minipool_address"`
Pubkey types.ValidatorPubkey `json:"pubkey"`
StatusRaw uint8 `json:"status_raw"`
StatusBlock *big.Int `json:"status_block"`
StatusTime *big.Int `json:"status_time"`
Finalised bool `json:"finalised"`
DepositTypeRaw uint8 `json:"deposit_type_raw"`
NodeFee *big.Int `json:"node_fee"`
NodeDepositBalance *big.Int `json:"node_deposit_balance"`
NodeDepositAssigned bool `json:"node_deposit_assigned"`
UserDepositBalance *big.Int `json:"user_deposit_balance"`
UserDepositAssigned bool `json:"user_deposit_assigned"`
UserDepositAssignedTime *big.Int `json:"user_deposit_assigned_time"`
UseLatestDelegate bool `json:"use_latest_delegate"`
Delegate common.Address `json:"delegate"`
PreviousDelegate common.Address `json:"previous_delegate"`
EffectiveDelegate common.Address `json:"effective_delegate"`
PenaltyCount *big.Int `json:"penalty_count"`
PenaltyRate *big.Int `json:"penalty_rate"`
NodeAddress common.Address `json:"node_address"`
Version uint8 `json:"version"`
Balance *big.Int `json:"balance"`
DistributableBalance *big.Int `json:"distributable_balance"`
NodeRefundBalance *big.Int `json:"node_refund_balance"`
WithdrawalCredentials common.Hash `json:"withdrawal_credentials"`
Status types.MinipoolStatus `json:"status"`
DepositType types.MinipoolDeposit `json:"deposit_type"`
// Must call CalculateCompleteMinipoolShares to get these
// Atlas
UserDistributed bool `json:"user_distributed"`
Slashed bool `json:"slashed"`
IsVacant bool `json:"is_vacant"`
LastBondReductionTime *big.Int `json:"last_bond_reduction_time"`
LastBondReductionPrevValue *big.Int `json:"last_bond_reduction_prev_value"`
LastBondReductionPrevNodeFee *big.Int `json:"last_bond_reduction_prev_node_fee"`
ReduceBondTime *big.Int `json:"reduce_bond_time"`
ReduceBondCancelled bool `json:"reduce_bond_cancelled"`
ReduceBondValue *big.Int `json:"reduce_bond_value"`
PreMigrationBalance *big.Int `json:"pre_migration_balance"`
}
Complete details for a minipool
func GetAllNativeMinipoolDetails ¶
func GetAllNativeMinipoolDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts) ([]NativeMinipoolDetails, error)
Gets all minpool details using the efficient multicall contract
func GetNativeMinipoolDetails ¶
func GetNativeMinipoolDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts, minipoolAddress common.Address) (NativeMinipoolDetails, error)
Gets the details for a minipool using the efficient multicall contract
func GetNodeNativeMinipoolDetails ¶
func GetNodeNativeMinipoolDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts, nodeAddress common.Address) ([]NativeMinipoolDetails, error)
Gets the minpool details for a node using the efficient multicall contract
func (*NativeMinipoolDetails) GetMinipoolBondAndNodeFee ¶
func (details *NativeMinipoolDetails) GetMinipoolBondAndNodeFee(blockTime time.Time) (*big.Int, *big.Int)
Get the bond and node fee of a minipool for the specified time
func (*NativeMinipoolDetails) IsEligibleForBonuses ¶
func (details *NativeMinipoolDetails) IsEligibleForBonuses(eligibleEnd time.Time) bool
type NativeNodeDetails ¶
type NativeNodeDetails struct {
Exists bool `json:"exists"`
RegistrationTime *big.Int `json:"registration_time"`
TimezoneLocation string `json:"timezone_location"`
FeeDistributorInitialised bool `json:"fee_distributor_initialised"`
FeeDistributorAddress common.Address `json:"fee_distributor_address"`
RewardNetwork *big.Int `json:"reward_network"`
RplStake *big.Int `json:"rpl_stake"`
EffectiveRPLStake *big.Int `json:"effective_rpl_stake"`
MinimumRPLStake *big.Int `json:"minimum_rpl_stake"`
MaximumRPLStake *big.Int `json:"maximum_rpl_stake"`
EthBorrowed *big.Int `json:"eth_borrowed"`
EthBorrowedLimit *big.Int `json:"eth_borrowed_limit"`
MegapoolETHBorrowed *big.Int `json:"megapool_eth_borrowed"`
MinipoolETHBorrowed *big.Int `json:"minipool_eth_borrowed"`
EthBonded *big.Int `json:"eth_bonded"`
MegapoolEthBonded *big.Int `json:"megapool_eth_bonded"`
MinipoolETHBonded *big.Int `json:"minipool_eth_bonded"`
MegapoolStakedRPL *big.Int `json:"megapool_staked_rpl"`
LegacyStakedRPL *big.Int `json:"legacy_staked_rpl"`
UnstakingRPL *big.Int `json:"unstaking_rpl"`
LockedRPL *big.Int `json:"locked_rpl"`
MinipoolCount *big.Int `json:"minipool_count"`
MegapoolValidatorCount uint32 `json:"megapool_validator_count"`
BalanceETH *big.Int `json:"balance_eth"`
BalanceRETH *big.Int `json:"balance_reth"`
BalanceRPL *big.Int `json:"balance_rpl"`
BalanceOldRPL *big.Int `json:"balance_old_rpl"`
DepositCreditBalance *big.Int `json:"deposit_credit_balance"`
DistributorBalanceUserETH *big.Int `json:"distributor_balance_user_eth"` // Must call CalculateAverageFeeAndDistributorShares to get this
DistributorBalanceNodeETH *big.Int `json:"distributor_balance_node_eth"` // Must call CalculateAverageFeeAndDistributorShares to get this
WithdrawalAddress common.Address `json:"withdrawal_address"`
PendingWithdrawalAddress common.Address `json:"pending_withdrawal_address"`
SmoothingPoolRegistrationState bool `json:"smoothing_pool_registration_state"`
SmoothingPoolRegistrationChanged *big.Int `json:"smoothing_pool_registration_changed"`
NodeAddress common.Address `json:"node_address"`
AverageNodeFee *big.Int `json:"average_node_fee"` // Must call CalculateAverageFeeAndDistributorShares to get this
CollateralisationRatio *big.Int `json:"collateralisation_ratio"`
DistributorBalance *big.Int `json:"distributor_balance"`
MegapoolAddress common.Address `json:"megapool_address"`
MegapoolDeployed bool `json:"megapool_deployed"`
}
Complete details for a node
func GetAllNativeNodeDetails ¶
func GetAllNativeNodeDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts) ([]NativeNodeDetails, error)
Gets the details for all nodes using the efficient multicall contract
func GetNativeNodeDetails ¶
func GetNativeNodeDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts, nodeAddress common.Address) (NativeNodeDetails, error)
Gets the details for a node using the efficient multicall contract
func (*NativeNodeDetails) CalculateAverageFeeAndDistributorShares ¶
func (node *NativeNodeDetails) CalculateAverageFeeAndDistributorShares(minipoolDetails []*NativeMinipoolDetails) error
Calculate the average node fee and user/node shares of the distributor's balance
func (*NativeNodeDetails) IsEligibleForBonuses ¶
func (nnd *NativeNodeDetails) IsEligibleForBonuses(eligibleStart time.Time, eligibleEnd time.Time) (bool, time.Time, time.Time)
Returns whether the node is eligible for bonuses, and the start and end times of its eligibility
func (*NativeNodeDetails) WasOptedInAt ¶
func (node *NativeNodeDetails) WasOptedInAt(t time.Time) bool
type NetworkContracts ¶
type NetworkContracts struct {
// Non-RP Utility
BalanceBatcher *multicall.BalanceBatcher
Multicaller *multicall.MultiCaller
ElBlockNumber *big.Int
// Network version
Version *version.Version
// Redstone
RocketDAONodeTrusted *rocketpool.Contract
RocketDAONodeTrustedSettingsMinipool *rocketpool.Contract
RocketDAOProtocolSettingsMinipool *rocketpool.Contract
RocketDAOProtocolSettingsNetwork *rocketpool.Contract
RocketDAOProtocolSettingsNode *rocketpool.Contract
RocketDepositPool *rocketpool.Contract
RocketMinipoolManager *rocketpool.Contract
RocketMinipoolQueue *rocketpool.Contract
RocketNetworkBalances *rocketpool.Contract
RocketNetworkFees *rocketpool.Contract
RocketNetworkPrices *rocketpool.Contract
RocketNodeDeposit *rocketpool.Contract
RocketNodeDistributorFactory *rocketpool.Contract
RocketNodeManager *rocketpool.Contract
RocketNodeStaking *rocketpool.Contract
RocketRewardsPool *rocketpool.Contract
RocketSmoothingPool *rocketpool.Contract
RocketStorage *rocketpool.Contract
RocketTokenRETH *rocketpool.Contract
RocketTokenRPL *rocketpool.Contract
RocketTokenRPLFixedSupply *rocketpool.Contract
// Atlas
RocketMinipoolBondReducer *rocketpool.Contract
// Houston
RocketDAOProtocolProposal *rocketpool.Contract
RocketDAOProtocolVerifier *rocketpool.Contract
// Saturn
RocketMegapoolFactory *rocketpool.Contract
RocketMegapoolManager *rocketpool.Contract
RocketNetworkRevenues *rocketpool.Contract
}
Container for network contracts
func NewNetworkContracts ¶
func NewNetworkContracts(rp *rocketpool.RocketPool, isSaturnDeployed bool, multicallerAddress common.Address, balanceBatcherAddress common.Address, opts *bind.CallOpts) (*NetworkContracts, error)
Get a new network contracts container
type NetworkDetails ¶
type NetworkDetails struct {
// Redstone
RplPrice *big.Int `json:"rpl_price"`
MinCollateralFraction *big.Int `json:"min_collateral_fraction"`
MaxCollateralFraction *big.Int `json:"max_collateral_fraction"`
MinimumLegacyRplStakeFraction *big.Int `json:"minimum_legacy_rpl_stake_fraction"`
IntervalDuration time.Duration `json:"interval_duration"`
IntervalStart time.Time `json:"interval_start"`
NodeOperatorRewardsPercent *big.Int `json:"node_operator_rewards_percent"`
TrustedNodeOperatorRewardsPercent *big.Int `json:"trusted_node_operator_rewards_percent"`
ProtocolDaoRewardsPercent *big.Int `json:"protocol_dao_rewards_percent"`
PendingRPLRewards *big.Int `json:"pending_rpl_rewards"`
RewardIndex uint64 `json:"reward_index"`
ScrubPeriod time.Duration `json:"scrub_period"`
SmoothingPoolAddress common.Address `json:"smoothing_pool_address"`
DepositPoolBalance *big.Int `json:"deposit_pool_balance"`
DepositPoolExcess *big.Int `json:"deposit_pool_excess"`
QueueCapacity minipool.QueueCapacity `json:"queue_capacity"`
QueueLength *big.Int `json:"queue_length"`
RPLInflationIntervalRate *big.Int `json:"rpl_inflation_interval_rate"`
RPLTotalSupply *big.Int `json:"rpl_total_supply"`
PricesBlock uint64 `json:"prices_block"`
LatestReportablePricesBlock uint64 `json:"latest_reportable_prices_block"`
ETHUtilizationRate float64 `json:"eth_utilization_rate"`
StakingETHBalance *big.Int `json:"staking_eth_balance"`
RETHExchangeRate float64 `json:"reth_exchange_rate"`
TotalETHBalance *big.Int `json:"total_eth_balance"`
RETHBalance *big.Int `json:"reth_balance"`
TotalRETHSupply *big.Int `json:"total_reth_supply"`
TotalRPLStake *big.Int `json:"total_rpl_stake"`
SmoothingPoolBalance *big.Int `json:"smoothing_pool_balance"`
NodeFee float64 `json:"node_fee"`
BalancesBlock uint64 `json:"balances_block"`
LatestReportableBalancesBlock uint64 `json:"latest_reportable_balances_block"`
SubmitBalancesEnabled bool `json:"submit_balances_enabled"`
SubmitPricesEnabled bool `json:"submit_prices_enabled"`
MinipoolLaunchTimeout *big.Int `json:"minipool_launch_timeout"`
// Atlas
PromotionScrubPeriod time.Duration `json:"promotion_scrub_period"`
BondReductionWindowStart time.Duration `json:"bond_reduction_window_start"`
BondReductionWindowLength time.Duration `json:"bond_reduction_window_length"`
DepositPoolUserBalance *big.Int `json:"deposit_pool_user_balance"`
// Houston
PricesSubmissionFrequency uint64 `json:"prices_submission_frequency"`
BalancesSubmissionFrequency uint64 `json:"balances_submission_frequency"`
// Saturn
MegapoolRevenueSplitSettings MegapoolRevenueSplitSettings
MegapoolRevenueSplitTimeWeightedAverages MegapoolRevenueSplitTimeWeightedAverages
}
func NewNetworkDetails ¶
func NewNetworkDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts, isSaturnDeployed bool) (*NetworkDetails, error)
Create a snapshot of all of the network's details
type OracleDaoMemberDetails ¶
type OracleDaoMemberDetails struct {
Address common.Address `json:"address"`
Exists bool `json:"exists"`
ID string `json:"id"`
Url string `json:"url"`
JoinedTime time.Time `json:"joinedTime"`
LastProposalTime time.Time `json:"lastProposalTime"`
RPLBondAmount *big.Int `json:"rplBondAmount"`
ReplacementAddress common.Address `json:"replacementAddress"`
IsChallenged bool `json:"isChallenged"`
// contains filtered or unexported fields
}
func GetAllOracleDaoMemberDetails ¶
func GetAllOracleDaoMemberDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts) ([]OracleDaoMemberDetails, error)
Gets all Oracle DAO member details using the efficient multicall contract
func GetOracleDaoMemberDetails ¶
func GetOracleDaoMemberDetails(rp *rocketpool.RocketPool, contracts *NetworkContracts, memberAddress common.Address) (OracleDaoMemberDetails, error)
Gets the details for an Oracle DAO member using the efficient multicall contract