client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultOption

func DefaultOption() *option

Types

type CallFrame added in v0.2.4

type CallFrame struct {
	Type         vm.OpCode       `json:"-"`
	From         common.Address  `json:"from"`
	Gas          uint64          `json:"gas"`
	GasUsed      uint64          `json:"gasUsed"`
	To           *common.Address `json:"to,omitempty" rlp:"optional"`
	Input        []byte          `json:"input" rlp:"optional"`
	Output       []byte          `json:"output,omitempty" rlp:"optional"`
	Error        string          `json:"error,omitempty" rlp:"optional"`
	RevertReason string          `json:"revertReason,omitempty"`
	Calls        []CallFrame     `json:"calls,omitempty" rlp:"optional"`
	Logs         []CallLog       `json:"logs,omitempty" rlp:"optional"`
	// Placed at end on purpose. The RLP will be decoded to 0 instead of
	// nil if there are non-empty elements after in the struct.
	Value *big.Int `json:"value,omitempty" rlp:"optional"`
}

see: https://github.com/ethereum/go-ethereum/blob/v1.12.0/eth/tracers/native/call.go#L44-L59

func (*CallFrame) UnmarshalJSON added in v0.2.18

func (c *CallFrame) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals from JSON.

type CallLog added in v0.2.18

type CallLog struct {
	Address common.Address `json:"address"`
	Topics  []common.Hash  `json:"topics"`
	Data    hexutil.Bytes  `json:"data"`
}

type ETHClient

type ETHClient struct {
	*ethclient.Client
	// contains filtered or unexported fields
}

func NewETHClient

func NewETHClient(endpoint string, opts ...Option) (*ETHClient, error)

func (*ETHClient) DebugTraceTransaction added in v0.2.2

func (cl *ETHClient) DebugTraceTransaction(ctx context.Context, txHash common.Hash) (CallFrame, error)

func (*ETHClient) EstimateGasFromTx added in v0.2.14

func (cl *ETHClient) EstimateGasFromTx(ctx context.Context, tx *gethtypes.Transaction) (uint64, error)

func (ETHClient) GetProof

func (cl ETHClient) GetProof(address common.Address, storageKeys [][]byte, blockNumber *big.Int) (*StateProof, error)

func (*ETHClient) GetTransactionReceipt

func (cl *ETHClient) GetTransactionReceipt(ctx context.Context, txHash common.Hash) (rc *Receipt, err error)

func (*ETHClient) Raw added in v0.2.4

func (cl *ETHClient) Raw() *rpc.Client

func (*ETHClient) WaitForReceiptAndGet

func (cl *ETHClient) WaitForReceiptAndGet(ctx context.Context, txHash common.Hash) (*Receipt, error)

type Option

type Option func(*option)

func WithRetryOption

func WithRetryOption(rops ...retry.Option) Option

type Receipt

type Receipt struct {
	gethtypes.Receipt
	RevertReason []byte `json:"revertReason,omitempty"`
}

func (Receipt) HasRevertReason

func (rc Receipt) HasRevertReason() bool

type StateProof

type StateProof struct {
	Balance     big.Int
	CodeHash    [32]byte
	Nonce       uint64
	StorageHash [32]byte

	AccountProofRLP []byte
	StorageProofRLP [][]byte
}

Jump to

Keyboard shortcuts

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