ethutils

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeTx

func DecodeTx(data []byte) (*types.Transaction, error)

func DecodeVRS added in v0.4.3

func DecodeVRS(bs [65]byte) (v, r, s *big.Int)

func EncodeTx

func EncodeTx(tx *types.Transaction) ([]byte, error)

func EncodeVRS added in v0.4.3

func EncodeVRS(tx *types.Transaction) [65]byte

func HexToPrivKey

func HexToPrivKey(key string) (*ecdsa.PrivateKey, []byte, error)

func HexToPubKey added in v0.1.6

func HexToPubKey(key string) (ed25519.PubKey, []byte, error)

func NewTx added in v0.1.2

func NewTx(nonce uint64, to *common.Address, amount *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte) *types.Transaction

func PrivKeyToAddr

func PrivKeyToAddr(key *ecdsa.PrivateKey) common.Address

func SignTx

func SignTx(tx *types.Transaction,
	chainID *big.Int, key *ecdsa.PrivateKey) (*types.Transaction, error)

Types

type ABIWrapper added in v0.3.0

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

func MustParseABI added in v0.3.0

func MustParseABI(abiJSON string) ABIWrapper

func (ABIWrapper) GetABI added in v0.3.0

func (a ABIWrapper) GetABI() abi.ABI

func (ABIWrapper) MustPack added in v0.3.0

func (a ABIWrapper) MustPack(name string, args ...interface{}) []byte

func (ABIWrapper) MustUnpack added in v0.3.0

func (a ABIWrapper) MustUnpack(name string, data []byte) []interface{}

func (ABIWrapper) Pack added in v0.3.0

func (a ABIWrapper) Pack(name string, args ...interface{}) ([]byte, error)

Jump to

Keyboard shortcuts

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