connection

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Gwei10 = big.NewInt(10e9)
View Source
var Gwei20 = big.NewInt(20e9)
View Source
var Gwei5 = big.NewInt(5e9)

Functions

This section is empty.

Types

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(eth1Endpoint, eth2Endpoint string, kp *secp256k1.Keypair, gasLimit, maxGasPrice *big.Int) (*Connection, error)

NewConnection returns an uninitialized connection, must call Connection.Connect() before using.

func (*Connection) CallOpts

func (c *Connection) CallOpts(blocknumber *big.Int) *bind.CallOpts

func (*Connection) EnsureHasBytecode

func (c *Connection) EnsureHasBytecode(addr common.Address) error

EnsureHasBytecode asserts if contract code exists at the specified address

func (*Connection) Eth1Client

func (c *Connection) Eth1Client() *ethclient.Client

func (*Connection) Eth1LatestBlock

func (c *Connection) Eth1LatestBlock() (uint64, error)

LatestBlock returns the latest block from the current chain

func (*Connection) Eth2BeaconHead

func (c *Connection) Eth2BeaconHead() (beacon.BeaconHead, error)

func (*Connection) Eth2Client

func (c *Connection) Eth2Client() *client.StandardHttpClient

func (*Connection) GetBeaconBlock

func (c *Connection) GetBeaconBlock(blockId uint64) (beacon.BeaconBlock, bool, error)

func (*Connection) GetELRewardForBlock

func (c *Connection) GetELRewardForBlock(executionBlockNumber uint64) (*big.Int, error)

func (*Connection) GetRewardsForEpochWithValidators

func (c *Connection) GetRewardsForEpochWithValidators(epoch uint64, valIndexs []uint64) (map[uint64]*client.ValidatorEpochIncome, error)

if validator not exist on beacon chain will return err if exit after epoch will return zero reward

func (*Connection) GetSyncCommitteesForEpoch

func (c *Connection) GetSyncCommitteesForEpoch(epoch uint64) ([]beacon.SyncCommittee, error)

func (*Connection) GetValidatorProposerDuties

func (c *Connection) GetValidatorProposerDuties(epoch uint64) (map[uint64]uint64, error)

func (*Connection) GetValidatorStatus

func (c *Connection) GetValidatorStatus(pubkey types.ValidatorPubkey, opts *beacon.ValidatorStatusOptions) (beacon.ValidatorStatus, error)

func (*Connection) GetValidatorStatusByIndex

func (c *Connection) GetValidatorStatusByIndex(index string, opts *beacon.ValidatorStatusOptions) (beacon.ValidatorStatus, error)

func (*Connection) GetValidatorStatuses

func (*Connection) Keypair

func (c *Connection) Keypair() *secp256k1.Keypair

func (*Connection) LockAndUpdateTxOpts

func (c *Connection) LockAndUpdateTxOpts() error

LockAndUpdateOpts acquires a lock on the opts before updating the nonce and gas price.

func (*Connection) SafeEstimateFee

func (c *Connection) SafeEstimateFee(ctx context.Context) (*big.Int, *big.Int, error)

return suggest gastipcap gasfeecap

func (*Connection) TxOpts

func (c *Connection) TxOpts() *bind.TransactOpts

func (*Connection) UnlockTxOpts

func (c *Connection) UnlockTxOpts()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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