rocketpool

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2021 License: GPL-3.0 Imports: 20 Imported by: 36

Documentation

Index

Constants

View Source
const (
	GasLimitMultiplier float64 = 1.5
	MaxGasLimit                = 12000000
)

Transaction settings

View Source
const CacheTTL = 300 // 5 minutes

Cache settings

Variables

This section is empty.

Functions

func DecodeAbi

func DecodeAbi(abiEncoded string) (*abi.ABI, error)

Decode, decompress and parse a zlib-compressed, base64-encoded ABI

func EncodeAbiStr

func EncodeAbiStr(abiStr string) (string, error)

zlib-compress and base64-encode an ABI JSON string

Types

type Contract

type Contract struct {
	Contract *bind.BoundContract
	Address  *common.Address
	ABI      *abi.ABI
	Client   *client.EthClientProxy
}

Contract type wraps go-ethereum bound contract

func (*Contract) Call

func (c *Contract) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error

Call a contract method

func (*Contract) GetTransactionEvents

func (c *Contract) GetTransactionEvents(txReceipt *types.Receipt, eventName string, eventPrototype interface{}) ([]interface{}, error)

Get contract events from a transaction eventPrototype must be an event struct type Returns a slice of untyped values; assert returned events to event struct type

func (*Contract) GetTransactionGasInfo

func (c *Contract) GetTransactionGasInfo(opts *bind.TransactOpts, method string, params ...interface{}) (GasInfo, error)

Get Gas Limit for transaction

func (*Contract) GetTransferGasInfo

func (c *Contract) GetTransferGasInfo(opts *bind.TransactOpts) (GasInfo, error)

Get gas limit for a transfer call

func (*Contract) Transact

func (c *Contract) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (common.Hash, error)

Transact on a contract method and wait for a receipt

func (*Contract) Transfer

func (c *Contract) Transfer(opts *bind.TransactOpts) (common.Hash, error)

Transfer ETH to a contract and wait for a receipt

type GasInfo

type GasInfo struct {
	EstGasLimit  uint64 `json:"estGasLimit"`
	SafeGasLimit uint64 `json:"safeGasLimit"`
}

Response for gas limits from network and from user request

type RocketPool

type RocketPool struct {
	Client                *client.EthClientProxy
	RocketStorage         *contracts.RocketStorage
	RocketStorageContract *Contract
	// contains filtered or unexported fields
}

Rocket Pool contract manager

func NewRocketPool

func NewRocketPool(client *client.EthClientProxy, rocketStorageAddress common.Address) (*RocketPool, error)

Create new contract manager

func (*RocketPool) GetABI

func (rp *RocketPool) GetABI(contractName string) (*abi.ABI, error)

Load Rocket Pool contract ABIs

func (*RocketPool) GetABIs

func (rp *RocketPool) GetABIs(contractNames ...string) ([]*abi.ABI, error)

func (*RocketPool) GetAddress

func (rp *RocketPool) GetAddress(contractName string) (*common.Address, error)

Load Rocket Pool contract addresses

func (*RocketPool) GetAddresses

func (rp *RocketPool) GetAddresses(contractNames ...string) ([]*common.Address, error)

func (*RocketPool) GetContract

func (rp *RocketPool) GetContract(contractName string) (*Contract, error)

Load Rocket Pool contracts

func (*RocketPool) GetContracts

func (rp *RocketPool) GetContracts(contractNames ...string) ([]*Contract, error)

func (*RocketPool) MakeContract

func (rp *RocketPool) MakeContract(contractName string, address common.Address) (*Contract, error)

Create a Rocket Pool contract instance

Jump to

Keyboard shortcuts

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