wallet

package
v0.0.0-...-8b83558 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package wallet contains the blockchain wallet implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetWalletID

func GetWalletID(key *ecdsa.PrivateKey) database.AccountID

GetWalletIDFromKey returns the wallet ID from the provided private key.

Types

type Wallet

type Wallet struct {
	ID      database.AccountID
	ChainID uint16

	Nonce   uint64
	Balance uint64
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, privKey *ecdsa.PrivateKey, node string, chainID int) (Wallet, error)

New initializes a new Wallet instance. It now takes a context parameter to allow setting deadlines on the readiness check request.

func (*Wallet) Info

func (w *Wallet) Info(ctx context.Context) (database.Account, error)

Info retrieves account information.

func (*Wallet) Transfer

func (w *Wallet) Transfer(ctx context.Context, to database.AccountID, amount uint64, tip uint64, data []byte) error

Transfer submits a blockchain transaction.

Jump to

Keyboard shortcuts

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