module

package
Version: v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockNumberArg

func BlockNumberArg(blockNumber *big.Int) string

Types

type ArgsWrapperFunc

type ArgsWrapperFunc func([]any) ([]any, error)

type Factory

type Factory[T any] struct {
	// contains filtered or unexported fields
}

func NewFactory

func NewFactory[T any](method string, args []any, opts ...Option[T]) *Factory[T]

func (Factory[T]) CreateRequest

func (f Factory[T]) CreateRequest() (rpc.BatchElem, error)

func (Factory[T]) HandleResponse

func (f Factory[T]) HandleResponse(elem rpc.BatchElem) error

func (Factory[T]) Returns

func (f Factory[T]) Returns(ret *T) w3types.Caller

type Option

type Option[T any] func(*Factory[T])

func WithArgsWrapper

func WithArgsWrapper[T any](fn ArgsWrapperFunc) Option[T]

func WithRetWrapper

func WithRetWrapper[T any](fn RetWrapperFunc[T]) Option[T]

type RetWrapperFunc

type RetWrapperFunc[T any] func(*T) any
var (
	HexBigRetWrapper    RetWrapperFunc[big.Int] = func(ret *big.Int) any { return (*hexutil.Big)(ret) }
	HexUintRetWrapper   RetWrapperFunc[uint]    = func(ret *uint) any { return (*hexutil.Uint)(ret) }
	HexUint64RetWrapper RetWrapperFunc[uint64]  = func(ret *uint64) any { return (*hexutil.Uint64)(ret) }
	HexBytesRetWrapper  RetWrapperFunc[[]byte]  = func(ret *[]byte) any { return (*hexutil.Bytes)(ret) }
)

Source Files

Jump to

Keyboard shortcuts

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