pos

package
v0.0.0-...-aab1a1c Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StakeTransaction

type StakeTransaction struct {
	AccountAddress string  `json:"accountAddress"`
	Amount         float64 `json:"amount"`
	Timestamp      string  `json:"timestamp"`
	Signature      string  `json:"signature"`
}

StakeTransaction представляет транзакцию стейкинга

func (*StakeTransaction) Hash

func (st *StakeTransaction) Hash() [32]byte

Hash возвращает хеш транзакции

func (*StakeTransaction) Sign

func (st *StakeTransaction) Sign(privateKey *ecdsa.PrivateKey) error

Sign подписывает транзакцию стейкинга

func (*StakeTransaction) Verify

func (st *StakeTransaction) Verify(publicKey *ecdsa.PublicKey) (bool, error)

Verify проверяет подпись транзакции

type StakingWallet

type StakingWallet struct {
	Address string // Адрес кошелька для стейкинга
	// contains filtered or unexported fields
}

func NewStakingWallet

func NewStakingWallet(db *adb.LevelDB) *StakingWallet

func (*StakingWallet) AllValidators

func (sw *StakingWallet) AllValidators() (map[string]float64, error)

func (*StakingWallet) GetAccount

func (sw *StakingWallet) GetAccount(address string) (*accounts.Account, error)

func (*StakingWallet) SaveStake

func (sw *StakingWallet) SaveStake(address string, stake float64) error

func (*StakingWallet) SelectValidator

func (sw *StakingWallet) SelectValidator() (string, error)

func (*StakingWallet) StakeTokens

func (sw *StakingWallet) StakeTokens(accountAddress string, amount float64, privateKey *ecdsa.PrivateKey) error

Jump to

Keyboard shortcuts

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