multicall

package
v0.0.0-...-2515fb6 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MULTICALL3_ADDR = common.HexToAddress("0xcA11bde05977b3631167028862bE2a173976CA11")

Functions

func Batch

func Batch[T any](ctx context.Context, mc MulticallBackend, contractABI *abi.ABI, addr common.Address, method string, callsArgs [][]interface{}) ([]T, error)

Batch executes multiple calls to the same method on the same contract in a single multicall and converts the results to the specified type TODO: configure max batch size, enabling multicall level and json-rpc level batching

Types

type Multicall3Custom

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

func NewMulticall3

func NewMulticall3(client bind.ContractCaller) *Multicall3Custom

func NewMulticall3Custom

func NewMulticall3Custom(client bind.ContractCaller, multicall3Addr common.Address) *Multicall3Custom

func (*Multicall3Custom) Aggregate

func (m *Multicall3Custom) Aggregate(ctx context.Context, calls []mc3.Multicall3Call) (blockNumer *big.Int, returnData [][]byte, err error)

func (*Multicall3Custom) Aggregate3

func (m *Multicall3Custom) Aggregate3(ctx context.Context, calls []mc3.Multicall3Call3) ([]mc3.Multicall3Result, error)

type MulticallBackend

type MulticallBackend interface {
	Aggregate(ctx context.Context, calls []multicall3.Multicall3Call) (blockNumer *big.Int, returnData [][]byte, err error)
}

Jump to

Keyboard shortcuts

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