ethutils

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 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

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

func EncodeTx

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

func EncodeVRS

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

func HexToPrivKey

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

func HexToPubKey

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

func NewTx

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

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

func MustParseABI

func MustParseABI(abiJSON string) ABIWrapper

func (ABIWrapper) GetABI

func (a ABIWrapper) GetABI() abi.ABI

func (ABIWrapper) MustPack

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

func (ABIWrapper) MustUnpack

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

func (ABIWrapper) Pack

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