core

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CrossChainData

type CrossChainData struct {
	SourceHeight uint64
	SourceHash   types.Hash
	DestHeight   uint64
	ProofData    []byte
}

type Transaction

type Transaction struct {
	Version     uint32
	SourceChain string
	DestChain   string
	Nonce       uint64
	From        types.Address
	To          types.Address
	Amount      uint64
	Gas         uint64
	GasPrice    uint64
	Data        []byte
	Timestamp   time.Time
	Signature   []byte
}

func NewTransaction

func NewTransaction(
	from types.Address,
	to types.Address,
	amount uint64,
	nonce uint64,
	sourceChain string,
	destChain string,
) *Transaction

func (*Transaction) Decode

func (tx *Transaction) Decode(data []byte) error

func (*Transaction) Encode

func (tx *Transaction) Encode() ([]byte, error)

func (*Transaction) GasCost

func (tx *Transaction) GasCost() uint64

func (*Transaction) Hash

func (tx *Transaction) Hash() types.Hash

func (*Transaction) Sign

func (tx *Transaction) Sign(privateKey []byte) error

func (*Transaction) TotalCost

func (tx *Transaction) TotalCost() uint64

func (*Transaction) Verify

func (tx *Transaction) Verify() error

Jump to

Keyboard shortcuts

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