multicall

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AggregateMethod = "0x252dba42"
	DefaultGasValue = uint64(17179869184)
)

Variables

View Source
var AggregateMethodBytes []byte

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 {
	Raw     []byte
	Decoded []interface{}
}

type Config

type Config struct {
	MulticallAddress string
	Gas              uint64
}

Config defines the Config for a multicall client

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(_client royal.EthClient, opts ...Option) (Multicall, error)

type Option

type Option func(*Config)

func SetContractAddress

func SetContractAddress(address string) Option

SetContractAddress will update the contract address for the Config

func SetGas

func SetGas(gas uint64) Option

SetGas will update the gas limit to the given value

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