minipool

package
v0.6.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2023 License: GPL-3.0 Imports: 15 Imported by: 14

Documentation

Index

Constants

View Source
const (
	MinipoolPrelaunchBatchSize     = 250
	MinipoolAddressBatchSize       = 50
	MinipoolDetailsBatchSize       = 20
	NativeMinipoolDetailsBatchSize = 1000
)

Settings

View Source
const EventScanInterval = 10000

The number of blocks to look for events in at once when scanning

Variables

This section is empty.

Functions

func BeginReduceBondAmount

func BeginReduceBondAmount(rp *rocketpool.RocketPool, minipoolAddress common.Address, newBondAmount *big.Int, opts *bind.TransactOpts) (common.Hash, error)

Begin a minipool bond reduction

func EstimateBeginReduceBondAmountGas

func EstimateBeginReduceBondAmountGas(rp *rocketpool.RocketPool, minipoolAddress common.Address, newBondAmount *big.Int, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas required to begin a minipool bond reduction

func EstimateSubmitMinipoolWithdrawableGas

func EstimateSubmitMinipoolWithdrawableGas(rp *rocketpool.RocketPool, minipoolAddress common.Address, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of SubmitMinipoolWithdrawable

func EstimateVoteCancelReductionGas

func EstimateVoteCancelReductionGas(rp *rocketpool.RocketPool, minipoolAddress common.Address, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas required to vote to cancel a minipool's bond reduction

func GetActiveMinipoolCount

func GetActiveMinipoolCount(rp *rocketpool.RocketPool, opts *bind.CallOpts) (uint64, error)

Get the number of active minipools in the network

func GetExpectedAddress

func GetExpectedAddress(rp *rocketpool.RocketPool, nodeAddress common.Address, salt *big.Int, opts *bind.CallOpts) (common.Address, error)

Get the address of a minipool based on the node address and a salt

func GetFinalisedMinipoolCount

func GetFinalisedMinipoolCount(rp *rocketpool.RocketPool, opts *bind.CallOpts) (uint64, error)

Get the number of finalised minipools in the network

func GetLastBondReductionPrevNodeFee

func GetLastBondReductionPrevNodeFee(rp *rocketpool.RocketPool, minipoolAddress common.Address, opts *bind.CallOpts) (*big.Int, error)

Gets the previous node fee (commission) of the minipool prior to its last reduction

func GetLastBondReductionPrevValue

func GetLastBondReductionPrevValue(rp *rocketpool.RocketPool, minipoolAddress common.Address, opts *bind.CallOpts) (*big.Int, error)

Gets the previous bond amount of the minipool prior to its last reduction

func GetLastBondReductionTime

func GetLastBondReductionTime(rp *rocketpool.RocketPool, minipoolAddress common.Address, opts *bind.CallOpts) (time.Time, error)

Gets the timestamp at which the bond was last reduced

func GetMinipoolAddresses

func GetMinipoolAddresses(rp *rocketpool.RocketPool, opts *bind.CallOpts) ([]common.Address, error)

Get all minipool addresses

func GetMinipoolAt

func GetMinipoolAt(rp *rocketpool.RocketPool, index uint64, opts *bind.CallOpts) (common.Address, error)

Get a minipool address by index

func GetMinipoolByPubkey

func GetMinipoolByPubkey(rp *rocketpool.RocketPool, pubkey rptypes.ValidatorPubkey, opts *bind.CallOpts) (common.Address, error)

Get a minipool address by validator pubkey

func GetMinipoolCount

func GetMinipoolCount(rp *rocketpool.RocketPool, opts *bind.CallOpts) (uint64, error)

Get the minipool count

func GetMinipoolDepositType

func GetMinipoolDepositType(rp *rocketpool.RocketPool, minipoolAddress common.Address, opts *bind.CallOpts) (types.MinipoolDeposit, error)

Get a minipool's deposit type invariant of its delegate version

func GetMinipoolExists

func GetMinipoolExists(rp *rocketpool.RocketPool, minipoolAddress common.Address, opts *bind.CallOpts) (bool, error)

Check whether a minipool exists

func GetMinipoolPenaltyCount

func GetMinipoolPenaltyCount(rp *rocketpool.RocketPool, minipoolAddress common.Address, opts *bind.CallOpts) (uint64, error)

Get the number of penalties applied to a minipool

func GetMinipoolPubkey

func GetMinipoolPubkey(rp *rocketpool.RocketPool, minipoolAddress common.Address, opts *bind.CallOpts) (rptypes.ValidatorPubkey, error)

Get a minipool's validator pubkey

func GetMinipoolRPLSlashed

func GetMinipoolRPLSlashed(rp *rocketpool.RocketPool, minipoolAddress common.Address, opts *bind.CallOpts) (bool, error)

Get a minipool's RPL slashing status

func GetMinipoolWithdrawalCredentials

func GetMinipoolWithdrawalCredentials(rp *rocketpool.RocketPool, minipoolAddress common.Address, opts *bind.CallOpts) (common.Hash, error)

Get the 0x01-based Beacon Chain withdrawal credentials for a given minipool

func GetNodeActiveMinipoolCount

func GetNodeActiveMinipoolCount(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (uint64, error)

Get the number of minipools owned by a node that are not finalised

func GetNodeFinalisedMinipoolCount

func GetNodeFinalisedMinipoolCount(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (uint64, error)

Get the number of minipools owned by a node that are finalised

func GetNodeMinipoolAddresses

func GetNodeMinipoolAddresses(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) ([]common.Address, error)

Get a node's minipool addresses

func GetNodeMinipoolAt

func GetNodeMinipoolAt(rp *rocketpool.RocketPool, nodeAddress common.Address, index uint64, opts *bind.CallOpts) (common.Address, error)

Get a node's minipool address by index

func GetNodeMinipoolCount

func GetNodeMinipoolCount(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (uint64, error)

Get a node's minipool count

func GetNodeMinipoolCountRaw

func GetNodeMinipoolCountRaw(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (*big.Int, error)

Get a node's minipool count

func GetNodeValidatingMinipoolAt

func GetNodeValidatingMinipoolAt(rp *rocketpool.RocketPool, nodeAddress common.Address, index uint64, opts *bind.CallOpts) (common.Address, error)

Get a node's validating minipool address by index

func GetNodeValidatingMinipoolCount

func GetNodeValidatingMinipoolCount(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (uint64, error)

Get a node's validating minipool count

func GetNodeValidatingMinipoolPubkeys

func GetNodeValidatingMinipoolPubkeys(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) ([]rptypes.ValidatorPubkey, error)

Get a node's validating minipool pubkeys

func GetPrelaunchMinipoolAddresses

func GetPrelaunchMinipoolAddresses(rp *rocketpool.RocketPool, opts *bind.CallOpts) ([]common.Address, error)

Get the addresses of all minipools in prelaunch status

func GetQueueEffectiveCapacity

func GetQueueEffectiveCapacity(rp *rocketpool.RocketPool, opts *bind.CallOpts) (*big.Int, error)

Get the total effective capacity of the minipool queue (used in node demand calculation)

func GetQueueMinipoolAtPosition

func GetQueueMinipoolAtPosition(rp *rocketpool.RocketPool, position uint64, opts *bind.CallOpts) (common.Address, error)

Get the minipool at the specified position in queue (0-indexed).

func GetQueuePositionOfMinipool

func GetQueuePositionOfMinipool(rp *rocketpool.RocketPool, minipoolAddress common.Address, opts *bind.CallOpts) (int64, error)

Get a minipools position in queue (1-indexed). 0 means it is currently not queued.

func GetQueueTotalCapacity

func GetQueueTotalCapacity(rp *rocketpool.RocketPool, opts *bind.CallOpts) (*big.Int, error)

Get the total capacity of the minipool queue

func GetQueueTotalLength

func GetQueueTotalLength(rp *rocketpool.RocketPool, opts *bind.CallOpts) (uint64, error)

Get the total length of the minipool queue

func GetReduceBondCancelled

func GetReduceBondCancelled(rp *rocketpool.RocketPool, minipoolAddress common.Address, opts *bind.CallOpts) (bool, error)

Gets whether or not the bond reduction process for this minipool has already been cancelled

func GetReduceBondTime

func GetReduceBondTime(rp *rocketpool.RocketPool, minipoolAddress common.Address, opts *bind.CallOpts) (time.Time, error)

Gets the time at which the MP owner started the bond reduction process

func GetReduceBondValue

func GetReduceBondValue(rp *rocketpool.RocketPool, minipoolAddress common.Address, opts *bind.CallOpts) (*big.Int, error)

Gets the amount of ETH a minipool is reducing its bond to

func GetStakingMinipoolCount

func GetStakingMinipoolCount(rp *rocketpool.RocketPool, opts *bind.CallOpts) (uint64, error)

Get the number of staking minipools in the network

func GetVacantMinipoolAt

func GetVacantMinipoolAt(rp *rocketpool.RocketPool, index uint64, opts *bind.CallOpts) (common.Address, error)

Get a vacant minipool address by index

func GetVacantMinipoolCount

func GetVacantMinipoolCount(rp *rocketpool.RocketPool, opts *bind.CallOpts) (uint64, error)

Get the vacant minipool count

func SubmitMinipoolWithdrawable

func SubmitMinipoolWithdrawable(rp *rocketpool.RocketPool, minipoolAddress common.Address, opts *bind.TransactOpts) (common.Hash, error)

Submit a minipool withdrawable event

func VoteCancelReduction

func VoteCancelReduction(rp *rocketpool.RocketPool, minipoolAddress common.Address, opts *bind.TransactOpts) (common.Hash, error)

Vote to cancel a minipool's bond reduction

Types

type Minipool

type Minipool interface {
	GetContract() *rocketpool.Contract
	GetAddress() common.Address
	GetVersion() uint8
	GetStatusDetails(opts *bind.CallOpts) (StatusDetails, error)
	GetStatus(opts *bind.CallOpts) (rptypes.MinipoolStatus, error)
	GetStatusBlock(opts *bind.CallOpts) (uint64, error)
	GetStatusTime(opts *bind.CallOpts) (time.Time, error)
	GetFinalised(opts *bind.CallOpts) (bool, error)
	GetDepositType(opts *bind.CallOpts) (rptypes.MinipoolDeposit, error)
	GetNodeDetails(opts *bind.CallOpts) (NodeDetails, error)
	GetNodeAddress(opts *bind.CallOpts) (common.Address, error)
	GetNodeFee(opts *bind.CallOpts) (float64, error)
	GetNodeFeeRaw(opts *bind.CallOpts) (*big.Int, error)
	GetNodeDepositBalance(opts *bind.CallOpts) (*big.Int, error)
	GetNodeRefundBalance(opts *bind.CallOpts) (*big.Int, error)
	GetNodeDepositAssigned(opts *bind.CallOpts) (bool, error)
	GetUserDetails(opts *bind.CallOpts) (UserDetails, error)
	GetUserDepositBalance(opts *bind.CallOpts) (*big.Int, error)
	GetUserDepositAssigned(opts *bind.CallOpts) (bool, error)
	GetUserDepositAssignedTime(opts *bind.CallOpts) (time.Time, error)
	EstimateRefundGas(opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	Refund(opts *bind.TransactOpts) (common.Hash, error)
	EstimateStakeGas(validatorSignature rptypes.ValidatorSignature, depositDataRoot common.Hash, opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	Stake(validatorSignature rptypes.ValidatorSignature, depositDataRoot common.Hash, opts *bind.TransactOpts) (common.Hash, error)
	EstimateDissolveGas(opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	Dissolve(opts *bind.TransactOpts) (common.Hash, error)
	EstimateCloseGas(opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	Close(opts *bind.TransactOpts) (common.Hash, error)
	EstimateFinaliseGas(opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	Finalise(opts *bind.TransactOpts) (common.Hash, error)
	EstimateDelegateUpgradeGas(opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	DelegateUpgrade(opts *bind.TransactOpts) (common.Hash, error)
	EstimateDelegateRollbackGas(opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	DelegateRollback(opts *bind.TransactOpts) (common.Hash, error)
	EstimateSetUseLatestDelegateGas(setting bool, opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	SetUseLatestDelegate(setting bool, opts *bind.TransactOpts) (common.Hash, error)
	GetUseLatestDelegate(opts *bind.CallOpts) (bool, error)
	GetDelegate(opts *bind.CallOpts) (common.Address, error)
	GetPreviousDelegate(opts *bind.CallOpts) (common.Address, error)
	GetEffectiveDelegate(opts *bind.CallOpts) (common.Address, error)
	CalculateNodeShare(balance *big.Int, opts *bind.CallOpts) (*big.Int, error)
	CalculateUserShare(balance *big.Int, opts *bind.CallOpts) (*big.Int, error)
	EstimateVoteScrubGas(opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	VoteScrub(opts *bind.TransactOpts) (common.Hash, error)
	GetPrestakeEvent(intervalSize *big.Int, opts *bind.CallOpts) (PrestakeData, error)
}

func NewMinipool

func NewMinipool(rp *rocketpool.RocketPool, address common.Address, opts *bind.CallOpts) (Minipool, error)

Create a minipool binding

func NewMinipoolFromVersion

func NewMinipoolFromVersion(rp *rocketpool.RocketPool, address common.Address, version uint8, opts *bind.CallOpts) (Minipool, error)

Create a minipool binding from an explicit version number

type MinipoolCountsPerStatus

type MinipoolCountsPerStatus struct {
	Initialized  *big.Int `abi:"initialisedCount"`
	Prelaunch    *big.Int `abi:"prelaunchCount"`
	Staking      *big.Int `abi:"stakingCount"`
	Withdrawable *big.Int `abi:"withdrawableCount"`
	Dissolved    *big.Int `abi:"dissolvedCount"`
}

The counts of minipools per status

func GetMinipoolCountPerStatus

func GetMinipoolCountPerStatus(rp *rocketpool.RocketPool, opts *bind.CallOpts) (MinipoolCountsPerStatus, error)

Get the minipool count by status

type MinipoolDetails

type MinipoolDetails struct {
	Address common.Address          `json:"address"`
	Exists  bool                    `json:"exists"`
	Pubkey  rptypes.ValidatorPubkey `json:"pubkey"`
}

Minipool details

func GetMinipoolDetails

func GetMinipoolDetails(rp *rocketpool.RocketPool, minipoolAddress common.Address, opts *bind.CallOpts) (MinipoolDetails, error)

Get a minipool's details

func GetMinipools

func GetMinipools(rp *rocketpool.RocketPool, opts *bind.CallOpts) ([]MinipoolDetails, error)

Get all minipool details

func GetNodeMinipools

func GetNodeMinipools(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) ([]MinipoolDetails, error)

Get a node's minipool details

type MinipoolPrestakeEvent

type MinipoolPrestakeEvent struct {
	Pubkey                []byte   `abi:"validatorPubkey"`
	Signature             []byte   `abi:"validatorSignature"`
	DepositDataRoot       [32]byte `abi:"depositDataRoot"`
	Amount                *big.Int `abi:"amount"`
	WithdrawalCredentials []byte   `abi:"withdrawalCredentials"`
	Time                  *big.Int `abi:"time"`
}

The data from a minipool's MinipoolPrestaked event

type MinipoolV2

type MinipoolV2 interface {
	Minipool
	EstimateDistributeBalanceAndFinaliseGas(opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	DistributeBalanceAndFinalise(opts *bind.TransactOpts) (common.Hash, error)
	EstimateDistributeBalanceGas(opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	DistributeBalance(opts *bind.TransactOpts) (common.Hash, error)
}

func GetMinipoolAsV2

func GetMinipoolAsV2(mp Minipool) (MinipoolV2, bool)

Get the minipool as a v2 minipool if it implements the required methods

type MinipoolV3

type MinipoolV3 interface {
	Minipool
	EstimateReduceBondAmountGas(opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	ReduceBondAmount(opts *bind.TransactOpts) (common.Hash, error)
	EstimatePromoteGas(opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	Promote(opts *bind.TransactOpts) (common.Hash, error)
	GetPreMigrationBalance(opts *bind.CallOpts) (*big.Int, error)
	GetUserDistributed(opts *bind.CallOpts) (bool, error)
	EstimateDistributeBalanceGas(rewardsOnly bool, opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	DistributeBalance(rewardsOnly bool, opts *bind.TransactOpts) (common.Hash, error)
}

func GetMinipoolAsV3

func GetMinipoolAsV3(mp Minipool) (MinipoolV3, bool)

Get the minipool as a v3 minipool if it implements the required methods

type NodeDetails

type NodeDetails struct {
	Address         common.Address `json:"address"`
	Fee             float64        `json:"fee"`
	DepositBalance  *big.Int       `json:"depositBalance"`
	RefundBalance   *big.Int       `json:"refundBalance"`
	DepositAssigned bool           `json:"depositAssigned"`
}

type PrestakeData

type PrestakeData struct {
	Pubkey                rptypes.ValidatorPubkey    `json:"pubkey"`
	WithdrawalCredentials common.Hash                `json:"withdrawalCredentials"`
	Amount                *big.Int                   `json:"amount"`
	Signature             rptypes.ValidatorSignature `json:"signature"`
	DepositDataRoot       common.Hash                `json:"depositDataRoot"`
	Time                  time.Time                  `json:"time"`
}

Formatted MinipoolPrestaked event data

type QueueCapacity

type QueueCapacity struct {
	Total     *big.Int
	Effective *big.Int
}

Minipool queue capacity

func GetQueueCapacity

func GetQueueCapacity(rp *rocketpool.RocketPool, opts *bind.CallOpts) (QueueCapacity, error)

Get minipool queue capacity

type QueueDetails

type QueueDetails struct {
	Position int64
}

Minipools queue status details

func GetQueueDetails

func GetQueueDetails(rp *rocketpool.RocketPool, minipoolAddress common.Address, opts *bind.CallOpts) (QueueDetails, error)

Get Queue position details of a minipool

type StatusDetails

type StatusDetails struct {
	Status      rptypes.MinipoolStatus `json:"status"`
	StatusBlock uint64                 `json:"statusBlock"`
	StatusTime  time.Time              `json:"statusTime"`
	IsVacant    bool                   `json:"isVacant"`
}

Minipool detail types

type UserDetails

type UserDetails struct {
	DepositBalance      *big.Int  `json:"depositBalance"`
	DepositAssigned     bool      `json:"depositAssigned"`
	DepositAssignedTime time.Time `json:"depositAssignedTime"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL