txrelayer

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultGasLimit   = 5242880 // 0x500000
	DefaultRPCAddress = "http://127.0.0.1:8545"
)

Variables

This section is empty.

Functions

func ConvertTxnToCallMsg

func ConvertTxnToCallMsg(txn *ethgo.Transaction) *ethgo.CallMsg

ConvertTxnToCallMsg converts txn instance to call message

Types

type TxRelayer

type TxRelayer interface {
	// Call executes a message call immediately without creating a transaction on the blockchain
	Call(from ethgo.Address, to ethgo.Address, input []byte) (string, error)
	// SendTransaction signs given transaction by provided key and sends it to the blockchain
	SendTransaction(txn *ethgo.Transaction, key ethgo.Key) (*ethgo.Receipt, error)
	// SendTransactionLocal sends non-signed transaction
	// (this function is meant only for testing purposes and is about to be removed at some point)
	SendTransactionLocal(txn *ethgo.Transaction) (*ethgo.Receipt, error)
	// Client returns jsonrpc client
	Client() *jsonrpc.Client
}

func NewTxRelayer

func NewTxRelayer(opts ...TxRelayerOption) (TxRelayer, error)

type TxRelayerImpl

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

func (*TxRelayerImpl) Call

func (t *TxRelayerImpl) Call(from ethgo.Address, to ethgo.Address, input []byte) (string, error)

Call executes a message call immediately without creating a transaction on the blockchain

func (*TxRelayerImpl) Client

func (t *TxRelayerImpl) Client() *jsonrpc.Client

Client returns jsonrpc client

func (*TxRelayerImpl) SendTransaction

func (t *TxRelayerImpl) SendTransaction(txn *ethgo.Transaction, key ethgo.Key) (*ethgo.Receipt, error)

SendTransaction signs given transaction by provided key and sends it to the blockchain

func (*TxRelayerImpl) SendTransactionLocal

func (t *TxRelayerImpl) SendTransactionLocal(txn *ethgo.Transaction) (*ethgo.Receipt, error)

SendTransactionLocal sends non-signed transaction (this function is meant only for testing purposes and is about to be removed at some point)

type TxRelayerOption

type TxRelayerOption func(*TxRelayerImpl)

func WithClient

func WithClient(client *jsonrpc.Client) TxRelayerOption

func WithIPAddress

func WithIPAddress(ipAddress string) TxRelayerOption

func WithNumRetries

func WithNumRetries(numRetries int) TxRelayerOption

WithNumRetries sets the maximum number of eth_getTransactionReceipt retries before considering the transaction sending as timed out. Set to -1 to disable waitForReceipt and not wait for the transaction receipt

func WithReceiptTimeout

func WithReceiptTimeout(receiptTimeout time.Duration) TxRelayerOption

func WithWriter

func WithWriter(writer io.Writer) TxRelayerOption

Jump to

Keyboard shortcuts

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