multicall

package
v0.0.0-...-1eef948 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MainnetMulticall : Multicall contract address on mainnet
	MainnetAddress = "0x5eb3fa2dfecdde21c950813c665e9364fa609bd2"
	// RopstenMulticall : Multicall contract address on Ropsten
	RopstenAddress = "0xf3ad7e31b052ff96566eedd218a823430e74b406"
)
View Source
const AggregateMethod = "0xd0707b67"

Variables

This section is empty.

Functions

This section is empty.

Types

type BigIntJSONString

type BigIntJSONString big.Int

func (BigIntJSONString) MarshalJSON

func (i BigIntJSONString) MarshalJSON() ([]byte, error)

type CallResult

type CallResult struct {
	//Success bool
	Raw     []byte
	Decoded []interface{}
}

type Config

type Config struct {
	MulticallAddress string
	Gas              string
}

type Multicall

type Multicall interface {
	CallRaw(calls ViewCalls, block string) (*Result, error)
	Call(calls ViewCalls, block string) (*Result, error)
	Contract() string
}

func New

func New(eth ethrpc.ETHInterface, opts ...Option) (Multicall, error)

type Option

type Option func(*Config)

func ContractAddress

func ContractAddress(address string) Option

func SetGas

func SetGas(gas uint64) Option

func SetGasHex

func SetGasHex(gas string) Option

type Result

type Result struct {
	BlockNumber uint64
	Calls       map[string]CallResult
}

type ViewCall

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

func NewViewCall

func NewViewCall(id, target, method string, arguments []interface{}) ViewCall

func (ViewCall) Validate

func (call ViewCall) Validate() error

type ViewCalls

type ViewCalls []ViewCall

Jump to

Keyboard shortcuts

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