ethereum

package
v0.0.0-...-a9b3359 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallOpts

func CallOpts(opts ...interface{}) (
	b *bind.CallOpts,
)

func FromAddress

func FromAddress(a common.Address) string

func FromBigInt

func FromBigInt(b *big.Int) int

func GetCallMsg

func GetCallMsg(from, to string) ethereum.CallMsg

func IsTransaction

func IsTransaction(t interface{}) (
	tx *types.Transaction,
	ok bool,
)

func PullPublicKey

func PullPublicKey(pk *ecdsa.PrivateKey) (*ecdsa.PublicKey, error)

func ToAddress

func ToAddress(s string) common.Address

func ToBigInt

func ToBigInt(b int) *big.Int

func ToHash

func ToHash(s string) common.Hash

Types

type Client

type Client struct {
	Client  *ethclient.Client
	Wallet  *Wallet
	ChainID *big.Int
}

func NewClient

func NewClient(url string) (
	cl *Client,
	err error,
)

func (*Client) ClientGet

func (c *Client) ClientGet() (
	cl interface{},
)

func (*Client) GetBallance

func (c *Client) GetBallance(ctx context.Context) (
	ball int,
	err error,
)

func (*Client) GetChainID

func (c *Client) GetChainID(ctx context.Context) *big.Int

func (*Client) GetNextTransaction

func (c *Client) GetNextTransaction(ctx context.Context) (
	opts *bind.TransactOpts,
	err error,
)

GetNextTransaction returns the next transaction in the pending transaction queue

func (*Client) ReplaceTx

func (c *Client) ReplaceTx(ctx context.Context, hash string) (
	opts *bind.TransactOpts,
	err error,
)

func (*Client) Setup

func (c *Client) Setup(ctx context.Context, wall *Wallet) (
	err error,
)

func (*Client) SignTx

func (c *Client) SignTx(ctx context.Context, tx *types.Transaction) (
	t *types.Transaction,
	err error,
)

not used

func (*Client) UpdateChainID

func (c *Client) UpdateChainID(ctx context.Context) (
	err error,
)

func (*Client) UseWallet

func (c *Client) UseWallet(wall *Wallet)

type Wallet

type Wallet struct {
	Address common.Address
	PubKey  *ecdsa.PublicKey
	// contains filtered or unexported fields
}

func NewWallet

func NewWallet() *Wallet

func (*Wallet) Setup

func (wall *Wallet) Setup(key string) (
	err error,
)

Jump to

Keyboard shortcuts

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