tx

package
v0.0.0-...-19c2005 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input struct {
	ID        string
	From      string
	Recipient string
	Amount    float64
	Outputs   []*Output
}

type Output

type Output struct {
	ID            string
	Address       string
	Spent         atomic.Bool
	Confirmations atomic.Int32
	Signatures    []map[string]string
}

type TXQueue

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

type Transaction

type Transaction struct {
	ID         string
	MerkleRoot string
	From       string
	TxType     Type
	Time       *config.Time
	Timestamp  int64
	Fees       float64
	Nonce      uint32
	Validators []string
	Inputs     []map[string]*Input
	Outputs    []map[string]*Output
}

func (*Transaction) CreateTransaction

func (t *Transaction) CreateTransaction(from, to, amount string, currencyID uint) (*Transaction, error)

type TxManager

type TxManager interface {
	CreateTransaction(from, to, amount string, currencyID uint) (*Transaction, error)
	ValidateTransaction(validator, txid string) bool
	IncludeTransactionInBlock(txid string, txdata string) bool
}

type Type

type Type uint32
const (
	DEFAULT Type = iota
	COINBASE
	DEFERRED
	MULTIRECIPIENT
	SIGNATURE
	WALLET
	MULTIWALLET
	CURRENCY
	SWAP
	CONTENT
	EMPTY
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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