eth

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseArgs

func ParseArgs(args []string, abi Abi) ([]any, error)

Types

type Abi

type Abi struct {
	Name            string      `json:"name,omitempty"`
	Type            string      `json:"type,omitempty"`
	StateMutability string      `json:"stateMutability,omitempty"`
	Inputs          []AbiInput  `json:"inputs,omitempty"`
	Outputs         []AbiOutput `json:"outputs,omitempty"`
}

type AbiInput

type AbiInput struct {
	Name    string `json:"name,omitempty"`
	Type    string `json:"type,omitempty"`
	Indexed bool   `json:"indexed,omitempty"`
}

type AbiOutput

type AbiOutput struct {
	Name string `json:"name,omitempty"`
	Type string `json:"type,omitempty"`
}

type Client

type Client interface {
	RawEthClient() *ethclient.Client
	PrivateKey() PrivateKey
	Transaction(txHash string) (tx *types.Transaction, isPending bool, err error)
	BalanceOf(address string) (uint64, error)
	ChainID() (uint64, error)
	SuggestedGasPrice() (uint64, error)
	WaitForMined(txHash string) error
}

func NewClient

func NewClient(rpcURL string, privateKey PrivateKey) Client

func NewClientWithoutPrivateKey

func NewClientWithoutPrivateKey(rpcURL string) Client

type Contract

type Contract interface{}

func NewContract

func NewContract(abi string, bin string, address string) Contract

type DeployContractResult

type DeployContractResult struct {
	Address string
	TxHash  string
	Nonce   uint64
}

type PrivateKey

type PrivateKey interface {
	Hex() string
	PublicKey() PublicKey
	RawPrivateKey() *ecdsa.PrivateKey
}

func NewPrivateKey

func NewPrivateKey() PrivateKey

func NewPrivateKeyFromHex

func NewPrivateKeyFromHex(hex string) PrivateKey

type PublicKey

type PublicKey interface {
	Address() string
	RawPublicKey() *ecdsa.PublicKey
}

func NewPublicKeyFromHex

func NewPublicKeyFromHex(hex string) PublicKey

type TransactOpts

type TransactOpts struct {
	Value    uint
	GasLimit uint
	GasPrice uint
}

type WriteContractResult

type WriteContractResult struct {
	TxHash string
	Nonce  uint64
}

Jump to

Keyboard shortcuts

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