transaction

package
v0.0.0-...-c3a2cad Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetaData

type MetaData struct {
	SenderPrivateKey           *ecdsa.PrivateKey
	SenderPublicKey            *ecdsa.PublicKey
	SenderBlockchainAddress    string
	RecipientBlockchainAddress string
	Value                      float32
}

func NewMetaData

func NewMetaData(senderPrivateKey *ecdsa.PrivateKey, senderPublicKey *ecdsa.PublicKey, senderBlockchainAddress string,
	recipientBlockchainAddress string, value float32) *MetaData

func (*MetaData) GenerateSignature

func (md *MetaData) GenerateSignature() *helpers.Signature

func (*MetaData) MarshalJSON

func (md *MetaData) MarshalJSON() ([]byte, error)

func (*MetaData) Validate

func (md *MetaData) Validate() bool

type Request

type Request struct {
	SenderBlockchainAddress    string
	RecipientBlockchainAddress string
	SenderPublicKey            string
	Value                      float32
	Signature                  string
}

type Transaction

type Transaction struct {
	SenderBlockChainAddress    string
	RecipientBlockChainAddress string
	Value                      float32
	Hash                       [32]byte
	TimeStamp                  string
}

func New

func New(senderBlockChainAddress string, recipientBlockChainAddress string, value float32) *Transaction

func (*Transaction) MarshalJSON

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

func (*Transaction) TxHash

func (t *Transaction) TxHash() [32]byte

Jump to

Keyboard shortcuts

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