wallet

package
v0.0.0-...-5d48b45 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transaction

type Transaction struct {
	Id        [32]byte
	Timestamp int64

	SenderAddress    string
	RecipientAddress string
	Value            float32
	TransactionType  blockchain.TransactionType
	// contains filtered or unexported fields
}

func NewTransaction

func NewTransaction(privateKey *ecdsa.PrivateKey, publicKey *ecdsa.PublicKey, sender string, recipient string, value float32, transactionType blockchain.TransactionType) *Transaction

func (*Transaction) GenerateSignature

func (t *Transaction) GenerateSignature() *utils.Signature

func (*Transaction) MarshalJSON

func (t *Transaction) MarshalJSON() ([]byte, error)

type Wallet

type Wallet struct {
	// contains filtered or unexported fields
}

func ImportWallet

func ImportWallet(mnemonic string) (*Wallet, error)

func NewWallet

func NewWallet() *Wallet

func (*Wallet) Address

func (w *Wallet) Address() string

func (*Wallet) MarshalJSON

func (w *Wallet) MarshalJSON() ([]byte, error)

func (*Wallet) Mnemonic

func (w *Wallet) Mnemonic() string

func (*Wallet) PrivateKey

func (w *Wallet) PrivateKey() *ecdsa.PrivateKey

func (*Wallet) PrivateKeyStr

func (w *Wallet) PrivateKeyStr() string

func (*Wallet) PublicKey

func (w *Wallet) PublicKey() *ecdsa.PublicKey

func (*Wallet) PublicKeyStr

func (w *Wallet) PublicKeyStr() string

Jump to

Keyboard shortcuts

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