Documentation ¶
Overview ¶
Package ethereum provides functions to assist with Ethereum related functionality
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractAddresses ¶
ExtractAddresses turns an array of accounts into an array of addresses
func ExtractAddressesNoPrefix ¶
ExtractAddressesNoPrefix turns an array of accounts into an array of addresses without the 0x prefix
func RLPHexEncode ¶ added in v1.8.5
RLPHexEncode converts an object into hex encoded RLP
Types ¶
type Account ¶
type Account struct { PrivateKey *ecdsa.PrivateKey PublicKey *ecdsa.PublicKey Address common.Address }
Account represents an ethereum account
func CreateAccountFromHex ¶
CreateAccountFromHex creates an account from a hex encoded private key
func GenerateAccounts ¶
GenerateAccounts is a convience function to generate an arbitrary number of accounts using GenerateEthereumAddress
func GenerateEthereumAddress ¶
GenerateEthereumAddress generates a new, random Ethereum account
func NewAccount ¶
func NewAccount(privKey *ecdsa.PrivateKey) *Account
NewAccount creates an account from a SECP256K1 ECDSA private key
func (Account) HexAddress ¶
HexAddress gets the address in hex format
func (Account) HexPrivateKey ¶
HexPrivateKey gets the private key in hex format
func (Account) HexPublicKey ¶
HexPublicKey gets the public key in hex format
func (Account) MarshalJSON ¶
MarshalJSON handles the marshaling of Acount into JSON, so that the fields are exposed in their hex encodings
func (*Account) UnmarshalJSON ¶ added in v1.7.1
UnmarshalJSON handles the conversion from json to account