eth

package
v0.0.0-...-b4d4280 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package eth provides Ethereum related helper functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTransactionInfo

func GetTransactionInfo(ctx context.Context, client ethereum.TransactionReader, hash common.Hash) (pipelinedb.TxState, *types.Transaction, *types.Receipt, error)

func TxStateFromReceipt

func TxStateFromReceipt(receipt *types.Receipt) pipelinedb.TxState

Types

type Auditor

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

Auditor audits eth transactions.

func NewAuditor

func NewAuditor(nodeAddress string) (*Auditor, error)

func (*Auditor) CheckConfirmedTransactionState

func (e *Auditor) CheckConfirmedTransactionState(ctx context.Context, hash string) (pipelinedb.TxState, error)

func (*Auditor) CheckTransactionState

func (e *Auditor) CheckTransactionState(ctx context.Context, hash string) (pipelinedb.TxState, error)

func (*Auditor) Close

func (e *Auditor) Close()

type Client

type Client interface {
	bind.ContractBackend
	ethereum.ChainReader
	ethereum.ChainStateReader
	ethereum.PendingStateReader
	ethereum.TransactionReader
}

type Payer

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

func NewPayer

func NewPayer(ctx context.Context,
	client Client,
	contractAddress common.Address,
	owner common.Address,
	key *ecdsa.PrivateKey,
	chainID *big.Int,
	gasTipCap *big.Int,
	maxGas *big.Int) (*Payer, error)

func (*Payer) CheckNonceGroup

func (e *Payer) CheckNonceGroup(ctx context.Context, log *zap.Logger, nonceGroup *pipelinedb.NonceGroup, checkOnly bool) (pipelinedb.TxState, []*pipelinedb.TxStatus, error)

func (*Payer) CheckPreconditions

func (e *Payer) CheckPreconditions(ctx context.Context) (unmet []string, err error)

func (*Payer) CreateRawTransaction

func (e *Payer) CreateRawTransaction(ctx context.Context, log *zap.Logger, payouts []*pipelinedb.Payout,
	nonce uint64, storjPrice decimal.Decimal) (_ payer.Transaction, _ common.Address, err error)

func (*Payer) EstimatedGasFee

func (e *Payer) EstimatedGasFee(ctx context.Context) (*big.Int, error)

func (*Payer) GetTokenBalance

func (e *Payer) GetTokenBalance(ctx context.Context) (*big.Int, error)

func (*Payer) GetTokenDecimals

func (e *Payer) GetTokenDecimals(ctx context.Context) (int32, error)

func (*Payer) NextNonce

func (e *Payer) NextNonce(ctx context.Context) (uint64, error)

func (*Payer) PrintEstimate

func (e *Payer) PrintEstimate(ctx context.Context, remaining int64) error

func (*Payer) SendTransaction

func (e *Payer) SendTransaction(ctx context.Context, log *zap.Logger, t payer.Transaction) error

func (*Payer) String

func (e *Payer) String() string

Jump to

Keyboard shortcuts

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