blockchain

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 9 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 BlockchainClient added in v0.3.0

type BlockchainClient interface {
	CreateEthAccount() (AccountData, error)
}

type EthClient added in v0.3.0

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

EthClient 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) (*EthClient, error)

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

func (*EthClient) CreateEthAccount added in v0.3.0

func (c *EthClient) 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).

type MockClient added in v0.3.0

type MockClient struct {
	mock.Mock
}

MockClient is a mock implementation of the blockchain Client interface.

func (*MockClient) CreateEthAccount added in v0.3.0

func (m *MockClient) CreateEthAccount() (AccountData, error)

CreateEthAccount mocks the creation of an Ethereum account.

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