eth

package
v0.0.0-...-d7b061b Latest Latest
Warning

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

Go to latest
Published: Apr 4, 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 EthAuditor

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

EthAuditor audits eth transactions.

func NewEthAuditor

func NewEthAuditor(nodeAddress string) (*EthAuditor, error)

func (*EthAuditor) CheckConfirmedTransactionState

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

func (*EthAuditor) CheckTransactionState

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

type EthClient

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

type EthPayer

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

func NewEthPayer

func NewEthPayer(ctx context.Context,
	client EthClient,
	contractAddress common.Address,
	owner common.Address,
	key *ecdsa.PrivateKey,
	chainID *big.Int,
	gasTipCap *big.Int,
	maxGas *big.Int) (*EthPayer, error)

func (*EthPayer) CheckNonceGroup

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

func (*EthPayer) CheckPreconditions

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

func (*EthPayer) CreateRawTransaction

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

func (*EthPayer) EstimatedGasFee

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

func (*EthPayer) GetTokenBalance

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

func (*EthPayer) GetTokenDecimals

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

func (*EthPayer) NextNonce

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

func (*EthPayer) PrintEstimate

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

func (*EthPayer) SendTransaction

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

Jump to

Keyboard shortcuts

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