multicall

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MainnetAddress    = "0x5eb3fa2dfecdde21c950813c665e9364fa609bd2"
	RopstenAddress    = "0xf3ad7e31b052ff96566eedd218a823430e74b406"
	BSCAddress        = "0x6Cf63cC81660Dd174A49e0C61A1f916456Ee1471"
	BSCTestnetAddress = "0xD3c6D8dAa57dfD38609047447cccDEF7Db6631b5"
	PolygonAddress    = "0x8a233a018a2e123c0D96435CF99c8e65648b429F"
	FantomAddress     = "0x08AB4aa09F43cF2D45046870170dd75AE6FBa306"
	CronosAddress     = "0x845C4753954c347175B4179B2D5B18DE1629f94F"
)
View Source
const AggregateMethod = "0x17352e13"

Variables

This section is empty.

Functions

This section is empty.

Types

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 *ethclient.Client, opts ...Option) (Multicall, error)

type Option

type Option func(*Config)

func WithContractAddress

func WithContractAddress(address string) Option

func WithGas

func WithGas(gas uint64) Option

func WithGasHex

func WithGasHex(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