multicall

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: MIT Imports: 8 Imported by: 3

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 = "0x17352e13"

Variables

This section is empty.

Functions

This section is empty.

Types

type CallResult

type CallResult struct {
	Success      bool
	ReturnValues []interface{}
}

type Config

type Config struct {
	MulticallAddress string
	Gas              string
}

type Multicall

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

func New

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

func (*Multicall) Call

func (mc *Multicall) Call(calls ViewCalls, block string) (*Result, error)

func (*Multicall) Contract added in v0.0.3

func (mc *Multicall) Contract() string

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 {
	Key       string
	Target    string
	Method    string
	Arguments []interface{}
}

type ViewCalls

type ViewCalls []ViewCall

Jump to

Keyboard shortcuts

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