eth

package
v0.0.0-...-baa49d7 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckValidRpc

func CheckValidRpc(rpc string) (bool, error)

func CreateEthTransaction

func CreateEthTransaction(client *ethclient.Client, from common.Address, to common.Address, value *big.Int, input []byte) (*types.Transaction, error)

Copy from the function `(c *BoundContract) transact` in the `eth` package.

func DecodeSignature

func DecodeSignature(signature string) (r [32]byte, s [32]byte, v byte, err error)

func GenerateAddress

func GenerateAddress() (privKey, pubKey, address string, err error)

func GenerateAddressFromPrivKey

func GenerateAddressFromPrivKey(privKey string) (pubKey, address string, err error)

func GenerateKeyFromSeedNew

func GenerateKeyFromSeedNew(seed string) (string, string, string, error)

func GenerateKeyFromSeedOld

func GenerateKeyFromSeedOld(seed string) (string, string, string, error)

func GetAccountInfo

func GetAccountInfo(privKey string) (*ecdsa.PrivateKey, *common.Address, error)

func GetCurrentL1BlockNumber

func GetCurrentL1BlockNumber(rpc string) (uint64, error)

func GetLastBlock

func GetLastBlock(rpc string) (uint64, int64, error)

func NewEthClient

func NewEthClient(rpc string) (*ethclient.Client, error)

func NewEthWsClient

func NewEthWsClient(ws string) (*ethclient.Client, error)

func WaitForTx

func WaitForTx(client *ethclient.Client, tx common.Hash) error

func WaitForTxReceipt

func WaitForTxReceipt(client *ethclient.Client, tx common.Hash) (*types.Receipt, error)

func WaitForTxReceiptRetry

func WaitForTxReceiptRetry(client *ethclient.Client, tx common.Hash, sleep int, retry int) (*types.Receipt, error)

func WaitForTxRetry

func WaitForTxRetry(client *ethclient.Client, tx common.Hash, sleep int, retry int) error

Types

type Client

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

func NewClient

func NewClient(eth *ethclient.Client) *Client

func (*Client) NetworkID

func (c *Client) NetworkID(ctx context.Context) (*big.Int, error)

func (*Client) PendingNonceAt

func (c *Client) PendingNonceAt(ctx context.Context, address common.Address) (uint64, error)

func (*Client) SendTransaction

func (c *Client) SendTransaction(ctx context.Context, tx *types.Transaction) error

func (*Client) SuggestGasPrice

func (c *Client) SuggestGasPrice(ctx context.Context) (*big.Int, error)

func (*Client) Transfer

func (c *Client) Transfer(senderPrivKey, receiverAddress string, amount, gasPrice *big.Int, gasLimit, nonce uint64) (string, error)

transfer:

Jump to

Keyboard shortcuts

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