Documentation ¶
Index ¶
- func BigInt(wei int64) *big.Int
- func GenPrivateKey() (*ecdsa.PrivateKey, error)
- func GenPublicKey(privkey *ecdsa.PrivateKey) interface{}
- func GenTransaction(nonce uint64, toAddress common.Address, val *big.Int, gasLimit uint64, ...) *types.Transaction
- func GetFixedBalance(client *ethclient.Client, account common.Address) (*big.Int, error)
- func GetNetworkID(client *ethclient.Client) (*big.Int, error)
- func GetNonce(client *ethclient.Client, fromAddress common.Address) (uint64, error)
- func GetPendingBalance(client *ethclient.Client, account common.Address) (*big.Int, error)
- func GetPrivateKeyBites(privkey *ecdsa.PrivateKey) []byte
- func GetPublicAddress(publicKeyECDSA *ecdsa.PublicKey) string
- func HexEncode(privkeybytes []byte) string
- func HexToEcdsa(key string) (*ecdsa.PrivateKey, error)
- func PublicKeyBytes(publicKeyECDSA *ecdsa.PublicKey) []byte
- func SendTransaction(client *ethclient.Client, singTX *types.Transaction) error
- func SetAddress(address string) common.Address
- func SingTx(transaction *types.Transaction, chainID *big.Int, privkey *ecdsa.PrivateKey) (*types.Transaction, error)
- func SuggestGas(client *ethclient.Client) (*big.Int, error)
- func ToEth(balance *big.Int) *big.Float
- func Towei(num float64) int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
GetFixedBalance returns a fixed address in wei
func GetNetworkID ¶
GetNetworkID returns the network id of the current client
func GetPendingBalance ¶
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 ¶
GetPublicAddress returns the public address for your account
func HexToEcdsa ¶
func HexToEcdsa(key string) (*ecdsa.PrivateKey, error)
HexToEcdsa encodes a private key string to a ECDSA
func PublicKeyBytes ¶
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 ¶
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 ¶
SuggestGas returns the best gas price in typof bigInt
Types ¶
This section is empty.