blockchain

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package blockchain provides functionality for interacting with the Ethereum blockchain. It includes utilities for creating Ethereum accounts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountData

type AccountData struct {
	PrivateKey []byte
	PublicKey  []byte
	AddressHex string
}

AccountData contains the details of an Ethereum account

type Client

type Client struct {
	Client *ethclient.Client
	// contains filtered or unexported fields
}

Client provides methods to interact with an Ethereum blockchain network. It uses the Ethereum client to query information and perform blockchain operations.

func NewClient

func NewClient(rawurl string) (*Client, error)

NewClient creates and returns a new Client instance connected to the specified Ethereum network URL.

func (*Client) CreateEthAccount

func (c *Client) CreateEthAccount() (AccountData, error)

CreateEthAccount generates a new Ethereum account with a private key, public key, and address. It also checks if the generated address is available (i.e., not used for contracts or transactions).

Directories

Path Synopsis
Package auth provides ability to generate bind.TransactOpts using admin account
Package auth provides ability to generate bind.TransactOpts using admin account

Jump to

Keyboard shortcuts

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