ethgo

package
v0.0.0-...-a14604a Latest Latest
Warning

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

Go to latest
Published: May 14, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BigInt

func BigInt(wei int64) *big.Int

BigInt returns a big int in wei

func GenPrivateKey

func GenPrivateKey() (*ecdsa.PrivateKey, error)

GenPrivateKey function that generates a private key and returns it

func GenPublicKey

func GenPublicKey(privkey *ecdsa.PrivateKey) interface{}

GenPublicKey generates the public key from the privateket

func GenTransaction

func GenTransaction(nonce uint64, toAddress common.Address, val *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte) *types.Transaction

GenTransaction retuns a new transaction

func GetFixedBalance

func GetFixedBalance(client *ethclient.Client, account common.Address) (*big.Int, error)

GetFixedBalance returns a fixed address in wei

func GetNetworkID

func GetNetworkID(client *ethclient.Client) (*big.Int, error)

GetNetworkID returns the network id of the current client

func GetNonce

func GetNonce(client *ethclient.Client, fromAddress common.Address) (uint64, error)

GetNonce returns the nonce number

func GetPendingBalance

func GetPendingBalance(client *ethclient.Client, account common.Address) (*big.Int, error)

GetPendingBalance get pending balance of an account

func GetPrivateKeyBites

func GetPrivateKeyBites(privkey *ecdsa.PrivateKey) []byte

GetPrivateKeyBites takes in a generated private key and returns that key in bytes

func GetPublicAddress

func GetPublicAddress(publicKeyECDSA *ecdsa.PublicKey) string

GetPublicAddress returns the public address for your account

func HexEncode

func HexEncode(privkeybytes []byte) string

HexEncode takes in the key in bytes and returns a string with that key

func HexToEcdsa

func HexToEcdsa(key string) (*ecdsa.PrivateKey, error)

HexToEcdsa encodes a private key string to a ECDSA

func PublicKeyBytes

func PublicKeyBytes(publicKeyECDSA *ecdsa.PublicKey) []byte

PublicKeyBytes turn the public key into bytes and returns bytes so we can work with it later

func SendTransaction

func SendTransaction(client *ethclient.Client, singTX *types.Transaction) error

SendTransaction return an error if process was not seccesfull

func SetAddress

func SetAddress(address string) common.Address

SetAddress sets a hex address and returns it

func SingTx

func SingTx(transaction *types.Transaction, chainID *big.Int, privkey *ecdsa.PrivateKey) (*types.Transaction, error)

SingTx returns a singed transaction

func SuggestGas

func SuggestGas(client *ethclient.Client) (*big.Int, error)

SuggestGas returns the best gas price in typof bigInt

func ToEth

func ToEth(balance *big.Int) *big.Float

ToEth from wei to eth converter

func Towei

func Towei(num float64) int64

Towei converter

Types

This section is empty.

Jump to

Keyboard shortcuts

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