Documentation
¶
Index ¶
- func GenerateAddress() (privKey, pubKey, address string, err error)
- func GenerateAddressFromPrivKey(privKey string) (pubKey, address string, err error)
- func GenerateKeyFromSeed(seed string) (string, string, string, error)
- func GetAccountInfo(privKey string) (*ecdsa.PrivateKey, *common.Address, error)
- func NewEthClient(rpc string) (*ethclient.Client, error)
- func NewEthWsClient(ws string) (*ethclient.Client, error)
- func WaitForTx(client *ethclient.Client, tx common.Hash) error
- func WaitForTxReceipt(client *ethclient.Client, tx common.Hash) (*types.Receipt, error)
- func WalletAddressFromCompressedPublicKey(publicKeyStr string) (string, error)
- type Client
- func (c *Client) NetworkID(ctx context.Context) (*big.Int, error)
- func (c *Client) PendingNonceAt(ctx context.Context, address common.Address) (uint64, error)
- func (c *Client) SendTransaction(ctx context.Context, tx *types.Transaction) error
- func (c *Client) SuggestGasPrice(ctx context.Context) (*big.Int, error)
- func (c *Client) Transfer(senderPrivKey, receiverAddress string, amount, gasPrice *big.Int, ...) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateAddress ¶
GenerateAddress generates a new Ethereum address, public key, and private key
func GenerateAddressFromPrivKey ¶
GenerateAddressFromPrivKey generates a public key and address from a private key
func GenerateKeyFromSeed ¶
GenerateKeyFromSeed generates a private key, public key, and address from a seed
func GetAccountInfo ¶
GetAccountInfo returns the private key and Ethereum address for a given private key
func NewEthClient ¶
NewEthClient creates a new Ethereum client for HTTP connections
func NewEthWsClient ¶
NewEthWsClient creates a new Ethereum client for WebSocket connections
func WaitForTxReceipt ¶
WaitForTxReceipt waits for a transaction receipt to be available
func WalletAddressFromCompressedPublicKey ¶
WalletAddressFromCompressedPublicKey converts a compressed public key to an Ethereum address
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps an Ethereum client for convenience
func (*Client) PendingNonceAt ¶
PendingNonceAt retrieves the nonce of an address
func (*Client) SendTransaction ¶
SendTransaction sends a transaction to the network
func (*Client) SuggestGasPrice ¶
SuggestGasPrice retrieves the suggested gas price